]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut: add option --kver=<kernel-version>
authorHarald Hoyer <harald@redhat.com>
Fri, 20 Jul 2012 09:34:40 +0000 (11:34 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 20 Jul 2012 09:37:55 +0000 (11:37 +0200)
dracut.8.asc
dracut.asc
dracut.sh

index 619fcaf66c420fb406c155d5933491f9d8ed97f2..0cd1663f6cf81644ade8613017adc88c2b1e538d 100644 (file)
@@ -26,6 +26,13 @@ For a complete list of kernel command line options see *dracut.cmdline*(7)
 
 OPTIONS
 -------
+**--kver** _<kernel version>_::
+    set the kernel version. This enables to specify the kernel version, without
+    specifying the location of the initramfs image. For example:
+----
+# dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64
+----
+
 **-f, --force**::
     overwrite existing initramfs file.
 
index e1f756ce3a41830f8faafdbf367887b7125d52fe..ca896ee719e75ffa568305f039ec35c7873e1d63 100644 (file)
@@ -154,7 +154,7 @@ To generate an image for a specific kernel version, the command would be:
 A shortcut to generate the image at the default location for a specific kernel
 version is:
 ----
-# dracut '' 2.6.40-1.rc5.f20
+# dracut --kver 2.6.40-1.rc5.f20
 ----
 
 If you want to create lighter, smaller initramfs images, you may want to specify
index afd076ab05b8fa7f5f0d9b4444e61945e38ad95d..ffdcbccb557e3f035e0d042db6b03a9364e3856d 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -67,6 +67,7 @@ Version: $DRACUT_VERSION
 
 Creates initial ramdisk images for preloading modules
 
+  --kver [VERSION]      Set kernel version to [VERSION].
   -f, --force           Overwrite existing initramfs file.
   -m, --modules [LIST]  Specify a space-separated list of dracut modules to
                          call when building the initramfs. Modules are located
@@ -244,6 +245,7 @@ set -- "${@/%-i/++include}"
 
 TEMP=$(unset POSIXLY_CORRECT; getopt \
     -o "a:m:o:d:I:k:c:L:fvqlHhM" \
+    --long kver: \
     --long add: \
     --long force-add: \
     --long add-drivers: \
@@ -308,6 +310,7 @@ eval set -- "$TEMP"
 
 while :; do
     case $1 in
+        --kver)        kernel="$2"; shift;;
         -a|--add)      push add_dracutmodules_l  "$2"; shift;;
         --force-add)   push force_add_dracutmodules_l  "$2"; shift;;
         --add-drivers) push add_drivers_l        "$2"; shift;;