Hi all, The attached patch adds a --add-dracut-args cmdline option to new-kernel-pkg, which will make it add the necessary kernel cmdline params for i18n, keyboard and plymouth when installing a dracut kernel. This goes hand in hand with a kernel.spec patch which makes dracut using kernels pass this option in their %post script. I've also attached this patch for completeness. Regards, Hans
diff --git a/new-kernel-pkg b/new-kernel-pkg index be3933a..3414027 100755 --- a/new-kernel-pkg +++ b/new-kernel-pkg @@ -89,13 +89,14 @@ makedefault="" package="" mbkernel="" mbargs="" +adddracutargs="" usage() { echo "Usage: `basename $0` [-v] [--mkinitrd] [--rminitrd]" >&2 echo " [--initrdfile=<initrd-image>] [--depmod] [--rmmoddep]" >&2 echo " [--kernel-args=<args>] [--remove-args=<args>]" >&2 echo " [--banner=<banner>] [--multiboot=multiboot]" >&2 - echo " [--mbargs=mbargs] [--make-default]" >&2 + echo " [--mbargs=mbargs] [--make-default] [--add-dracut-args]" >&2 echo " <--install | --remove | --update | --rpmposttrans> <kernel-version>" >&2 echo " (ex: `basename $0` --mkinitrd --depmod --install 2.4.7-2)" >&2 exit 1 @@ -384,6 +385,10 @@ while [ $# -gt 0 ]; do fi ;; + --add-dracut-args) + adddracutargs=--add-dracut-args + ;; + -v) verbose=-v ;; @@ -436,6 +441,29 @@ if [ -z "$initrdfile" ]; then fi [ -n "$verbose" ] && echo "initrdfile is $initrdfile" +# add dracut i18n, keyboard and plymouth kernel args if requested +if [ -n "$adddracutargs" ]; then + . /etc/sysconfig/keyboard + . /etc/sysconfig/i18n + + for i in SYSFONT SYSFONTACM UNIMAP LANG KEYTABLE; do + val=$(eval echo \$$i) + [ -n "$val" ] && kernargs="$kernargs $i=$val" + done + + if [ -n "$KEYBOARDTYPE" -a "$KEYBOARDTYPE" != "pc" ]; then + kernargs="$kernargs KEYBOARDTYPE=$KEYBOARDTYPE" + fi + + if [ -L /usr/share/plymouth/themes/default.plymouth ]; then + theme=$(basename \ + $(dirname \ + $(readlink -f \ + /usr/share/plymouth/themes/default.plymouth))) + [ -n "$theme" ] && kernargs="$kernargs rd_plytheme=$theme" + fi +fi + # set this as the default if we have the package and it matches if [ "$mode" == "--install" -a "$UPDATEDEFAULT" == "yes" -a -n "$package" -a -n "$DEFAULTKERNEL" -a "$package" == "$DEFAULTKERNEL" ]; then makedefault="--make-default"
Index: kernel.spec =================================================================== RCS file: /cvs/extras/rpms/kernel/devel/kernel.spec,v retrieving revision 1.1701 diff -u -r1.1701 kernel.spec --- kernel.spec 6 Aug 2009 20:48:38 -0000 1.1701 +++ kernel.spec 7 Aug 2009 14:58:49 -0000 @@ -1797,7 +1797,12 @@ [ -f /etc/sysconfig/kernel ]; then\ /bin/sed -r -i -e 's/^DEFAULTKERNEL=%{-r*}$/DEFAULTKERNEL=kernel%{?-v:-%{-v*}}/' /etc/sysconfig/kernel || exit $?\ fi}\ +%{expand:\ +%if %{with_dracut}\ +/sbin/new-kernel-pkg --package kernel%{?-v:-%{-v*}} --depmod --add-dracut-args --initrdfile=/boot/initrd-generic-%{KVERREL}%{?-v:.%{-v*}}.img --install %{KVERREL}%{?-v:.%{-v*}} || exit $?\ +%else\ /sbin/new-kernel-pkg --package kernel%{?-v:-%{-v*}} --mkinitrd --depmod --install %{KVERREL}%{?-v:.%{-v*}} || exit $?\ +%endif}\ #if [ -x /sbin/weak-modules ]\ #then\ # /sbin/weak-modules --add-kernel %{KVERREL}%{?-v*} || exit $?\
_______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list