]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut: make "-i, --include SOURCE TARGET" work for files, too
authorHarald Hoyer <harald@redhat.com>
Wed, 9 Mar 2011 20:50:04 +0000 (21:50 +0100)
committerHarald Hoyer <harald@redhat.com>
Thu, 10 Mar 2011 16:22:56 +0000 (17:22 +0100)
dracut
dracut.8.xml

diff --git a/dracut b/dracut
index ce5bac7a1cefae79f5b8671399385ace378f718a..8553774b1223fc617610fc2dcfa9466aba9abd05 100755 (executable)
--- 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
index 26e575b5a90da5c930ddffec3f52a5a385b4a299..35e3b119f2612b9bc12570d46a17b7892a36f0a1 100644 (file)
@@ -329,11 +329,11 @@ the local host instead of a generic host.
             <option>-i</option>
           </term>
           <term>
-            <option>--include&nbsp;<replaceable>&lt;source directory&gt;</replaceable>&nbsp;<replaceable>&lt;target directory&gt;</replaceable></option>
+            <option>--include&nbsp;<replaceable>&lt;SOURCE&gt;</replaceable>&nbsp;<replaceable>&lt;TARGET&gt;</replaceable></option>
           </term>
           <listitem>
-            <para>include the files in the source directory into the
-target directory in the final initramfs.</para>
+            <para>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.</para>
           </listitem>
         </varlistentry>
         <varlistentry>