From 4fea3ea6f15733ea7ad695eb0ddde4518c628f1b Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 9 Mar 2011 21:50:04 +0100 Subject: [PATCH] dracut: make "-i, --include SOURCE TARGET" work for files, too --- dracut | 10 ++++++++-- dracut.8.xml | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) 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. -- 2.47.3