On 08/07/2009 11:04 AM, Hans de Goede wrote:
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
Indentation looks weird here.
@@ -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)))
I'm not a big fan of this method of detecting the theme. Really, a helper program should be added to plymouth for this, so that we're immune to it changing.
+ [ -n "$theme" ]&& kernargs="$kernargs rd_plytheme=$theme"
"] &&" would be better.
+ 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"
-- Peter _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list