inst_symlink: create parent dir if doesn't exist
commite7da9734d892ace96b4717fd622f5b9be9149227
authorAmadeusz Żołnowski <aidecoe@aidecoe.name>
Mon, 26 Mar 2012 07:39:34 +0000 (26 09:39 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 26 Mar 2012 11:20:29 +0000 (26 13:20 +0200)
treeda0c22daf81a3f717ae058ae96dc47da5e7f788a
parent0cec23040678466db4eb986c1a0079dd2fdee7b1
inst_symlink: create parent dir if doesn't exist

If symlink is yet alone in target directory, inst_symlink will fail to
create it.  This is how to reproduce the bug:

 # mkdir /tmp/test
 # ln -s /bin/cp /tmp/test/cp
 # ./dracut -l -f -H /tmp/test.img -I /tmp/test/cp

Result:

[...]

I: *** Including modules done ***
ln: failed to create symbolic link
`/var/tmp/initramfs.Z5isVu//tmp/test/cp': No such file or directory
ln: failed to create symbolic link
`/var/tmp/initramfs.Z5isVu//tmp/test/cp': No such file or directory
I: Wrote /tmp/test.img:

[...]

Following patch creates directory for the symlink if it doesn't exist.
dracut-functions.sh