]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
add "--kernel-cmdline" and kernel_cmdline options for default parameters
authorHarald Hoyer <harald@redhat.com>
Thu, 4 Oct 2012 17:23:19 +0000 (13:23 -0400)
committerHarald Hoyer <harald@redhat.com>
Thu, 4 Oct 2012 17:23:19 +0000 (13:23 -0400)
dracut.8.asc
dracut.conf.5.asc
dracut.conf.d/fedora.conf.example
dracut.sh

index 203f9cde66c616825664786b66f742ac6b65e5b7..1f7100b11d3d5ba390f36ddd2b023ed26db691bd 100644 (file)
@@ -208,6 +208,10 @@ example:
     specify additional directories, where to look for firmwares. This parameter
     can be specified multiple times.
 
+**--kernel-cmdline <parameters>**::
+    specify default kernel command line parameters
+
+
 **--kernel-only**::
     only install kernel drivers and firmware files
 
index f3a7de65e0b068019037a5260181c6f10416579a..68bd9eb3500444c100585fcd2ef94db6cdeb8e93 100644 (file)
@@ -100,6 +100,9 @@ If chrooted to another root other than the real root device, use --fstab and pro
 *ro_mnt*
     Mount _/_ and _/usr_ read-only by default.
 
+*kernel_cmdline=*"__parameters__"::
+    Specify default kernel command line parameters
+
 *kernel_only=*"__{yes|no}__"::
     Only install kernel drivers and firmware files. (default=no)
 
index 9f4d666c0a45c6467959e3fdac6caebc9a51cb34..2649e71bee19973a2a3f51d722581921f1c1ac48 100644 (file)
@@ -11,3 +11,4 @@ systemdsystemunitdir=/usr/lib/systemd/system
 udevdir=/usr/lib/udev
 add_dracutmodules+=" systemd "
 realinitpath="/usr/lib/systemd/systemd"
+kernelcmdline+=" rd.auto=1 "
\ No newline at end of file
index 96faa061b5ec4048afed10303f6e255aba71f847..90f4fdf34561c4879bc6310fc28a0149d93d6e93 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -89,6 +89,7 @@ Creates initial ramdisk images for preloading modules
                         firmwares, separated by :
   --kernel-only         Only install kernel drivers and firmware files
   --no-kernel           Do not install kernel drivers and firmware files
+  --kernel-cmdline [PARAMETERS] Specify default kernel command line parameters
   --strip               Strip binaries in the initramfs
   --nostrip             Do not strip binaries in the initramfs (default)
   --hardlink            Hardlink files in the initramfs (default)
@@ -275,6 +276,7 @@ TEMP=$(unset POSIXLY_CORRECT; getopt \
     --long force \
     --long kernel-only \
     --long no-kernel \
+    --long kernel-cmdline: \
     --long strip \
     --long nostrip \
     --long hardlink \
@@ -330,6 +332,7 @@ while :; do
         --add-fstab)   push add_fstab_l          "$2"; shift;;
         --mount)       push fstab_lines          "$2"; shift;;
         --device)      push host_devs            "$2"; shift;;
+        --kernel-cmdline) push kernel_cmdline_l  "$2"; shift;;
         --nofscks)     nofscks_l="yes";;
         --ro-mnt)      ro_mnt_l="yes";;
         -k|--kmoddir)  drivers_dir_l="$2"; shift;;
@@ -646,6 +649,12 @@ if (( ${#omit_drivers_l[@]} )); then
 fi
 omit_drivers=${omit_drivers/-/_}
 
+if (( ${#kernel_cmdline_l[@]} )); then
+    while pop kernel_cmdline_l val; do
+        kernel_cmdline+=" $val "
+    done
+fi
+
 omit_drivers_corrected=""
 for d in $omit_drivers; do
     strstr " $drivers $add_drivers " " $d " && continue
@@ -928,6 +937,8 @@ fi
 if [[ $kernel_only != yes ]]; then
     (( ${#install_items[@]} > 0 )) && dracut_install  ${install_items[@]}
 
+    echo "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf"
+
     while pop fstab_lines line; do
         echo "$line 0 0" >> "${initdir}/etc/fstab"
     done