From: Harald Hoyer Date: Wed, 9 Mar 2011 20:50:04 +0000 (+0100) Subject: dracut: make "-i, --include SOURCE TARGET" work for files, too X-Git-Tag: 009~68 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4fea3ea6f15733ea7ad695eb0ddde4518c628f1b;p=thirdparty%2Fdracut.git dracut: make "-i, --include SOURCE TARGET" work for files, too --- diff --git a/dracut b/dracut index ce5bac7a1..8553774b1 100755 --- a/dracut +++ b/dracut @@ -74,6 +74,8 @@ Creates initial ramdisk images for preloading modules -i, --include [SOURCE] [TARGET] Include the files in the SOURCE directory into the Target directory in the final initramfs. + If SOURCE is a file, it will be installed to TARGET + in the final initramfs. -I, --install [LIST] Install the space separated list of files into the initramfs. --gzip Compress the generated initramfs using gzip. @@ -344,8 +346,12 @@ if [[ -d $initdir/lib/modules/$kernel ]] && \ fi if [[ $include_src && $include_target ]]; then - mkdir -p "$initdir$include_target" - cp -a -t "$initdir$include_target" "$include_src"/* + if [[ -f $include_src ]]; then + inst $include_src $include_target + else + mkdir -p "$initdir$include_target" + cp -a -t "$initdir$include_target" "$include_src"/* + fi fi for item in $install_items; do diff --git a/dracut.8.xml b/dracut.8.xml index 26e575b5a..35e3b119f 100644 --- a/dracut.8.xml +++ b/dracut.8.xml @@ -329,11 +329,11 @@ the local host instead of a generic host. - + - include the files in the source directory into the -target directory in the final initramfs. + include the files in the SOURCE directory into the +TARGET directory in the final initramfs. If SOURCE is a file, it will be installed to TARGET in the final initramfs.