add "--kernel-cmdline" and kernel_cmdline options for default parameters

master
Harald Hoyer 2012-10-04 13:23:19 -04:00
parent e0a393361d
commit d20fb951fa
4 changed files with 19 additions and 0 deletions

View 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


View 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)


View 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 "

View File

@ -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