From: Harald Hoyer Date: Thu, 4 Oct 2012 17:23:19 +0000 (-0400) Subject: add "--kernel-cmdline" and kernel_cmdline options for default parameters X-Git-Tag: 024~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d20fb951fa4456889a1066ed820dd89f70f1c167;p=thirdparty%2Fdracut.git add "--kernel-cmdline" and kernel_cmdline options for default parameters --- diff --git a/dracut.8.asc b/dracut.8.asc index 203f9cde6..1f7100b11 100644 --- a/dracut.8.asc +++ b/dracut.8.asc @@ -208,6 +208,10 @@ example: specify additional directories, where to look for firmwares. This parameter can be specified multiple times. +**--kernel-cmdline **:: + specify default kernel command line parameters + + **--kernel-only**:: only install kernel drivers and firmware files diff --git a/dracut.conf.5.asc b/dracut.conf.5.asc index f3a7de65e..68bd9eb35 100644 --- a/dracut.conf.5.asc +++ b/dracut.conf.5.asc @@ -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) diff --git a/dracut.conf.d/fedora.conf.example b/dracut.conf.d/fedora.conf.example index 9f4d666c0..2649e71be 100644 --- a/dracut.conf.d/fedora.conf.example +++ b/dracut.conf.d/fedora.conf.example @@ -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 diff --git a/dracut.sh b/dracut.sh index 96faa061b..90f4fdf34 100755 --- 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