--- trunk/grubby/new-kernel-pkg 2011/06/03 20:32:19 1332 +++ trunk/grubby/new-kernel-pkg 2011/06/03 20:56:30 1334 @@ -89,6 +89,8 @@ mode="" version="" initrd="" +dracut="" +dracuthostonly="" initrdfile="" moddep="" verbose="" @@ -96,14 +98,18 @@ package="" mbkernel="" mbargs="" +adddracutargs="" +addplymouthinitrd="" usage() { - echo "Usage: $(basename $0) [-v] [--mkinitrd] [--rminitrd]" >&2 + echo "Usage: $(basename $0) [-v] [--mkinitrd] [--rminitrd] [--dracut]" >&2 echo " [--initrdfile=] [--depmod] [--rmmoddep]" >&2 echo " [--kernel-args=] [--remove-args=]" >&2 echo " [--banner=] [--multiboot=multiboot]" >&2 - echo " [--mbargs=mbargs] [--make-default]" >&2 + echo " [--mbargs=mbargs] [--make-default] [--add-dracut-args]" >&2 + echo " [--add-plymouth-initrd]" >&2 + echo " [--host-only]" >&2 echo " <--install | --remove | --update> " >&2 echo " (ex: $(basename $0) --mkinitrd --depmod --install 2.4.7-2)" >&2 exit 1 @@ -132,6 +138,11 @@ then [[ -n ${verbose} ]] && echo "found ${initrdfile} and using it with grubby" INITRD="--initrd ${initrdfile}" + + if [[ -n ${addplymouthinitrd} ]] + then + INITRD="${INITRD} --extra-initrd ${bootPrefix}/initrd-plymouth.img" + fi fi # FIXME: is this a good heuristic to find out if we're on iSeries? @@ -262,6 +273,11 @@ then [[ -n ${verbose} ]] && echo "found ${initrdfile} and using it with grubby" INITRD="--initrd ${initrdfile}" + + if [[ -n ${addplymouthinitrd} ]] + then + INITRD="${INITRD} --extra-initrd ${bootPrefix}/initrd-plymouth.img" + fi fi # Run grub2's configuration update in parallel, if it is installed @@ -304,8 +320,14 @@ mkinitrd() { + if [[ -n ${dracut} ]] + then + tool="/sbin/dracut ${dracuthostonly} -f ${initrdfile} ${version}" + else + tool="/sbin/mkinitrd --allow-missing -f ${initrdfile} ${version}" + fi [[ -n ${verbose} ]] && echo "creating initrd ${initrdfile} using ${version}" - /sbin/mkinitrd --allow-missing -f ${initrdfile} ${version} + ${tool} rc=$? if [ ${rc} != 0 ] then @@ -344,6 +366,14 @@ initrd="remove" ;; + --dracut) + dracut=--dracut + ;; + + --host-only) + dracuthostonly=-H + ;; + --initrdfile*) if echo $1 | grep '=' >/dev/null then @@ -427,6 +457,14 @@ fi ;; + --add-dracut-args) + adddracutargs=--add-dracut-args + ;; + + --add-plymouth-initrd) + addplymouthinitrd=--add-plymouth-initrd + ;; + -v) verbose=-v ;; @@ -478,6 +516,10 @@ if [[ -z ${initrdfile} ]] then INITRD_NAME_PREFIX="initrd" + if [[ -n ${dracut} ]] + then + INITRD_NAME_PREFIX="initramfs" + fi if [[ $(uname -m) = ia64 ]] then @@ -488,6 +530,23 @@ fi [[ -n ${verbose} ]] && echo "initrdfile is ${initrdfile}" +# add dracut i18n, keyboard and plymouth kernel args if requested +if [[ -n ${dracut} ]] || [[ -n ${adddracutargs} ]] +then + [ -r /etc/conf.d/keymap ] && . /etc/conf.d/keymap + [ -r /etc/conf.d/consolefont ] && . /etc/conf.d/consolefont + + if [[ -n ${KEYMAP} ]] + then + kernargs="${kernargs} KEYTABLE=${KEYMAP}" + fi + + if [[ -n ${CONSOLEFONT} ]] + then + kernargs="${kernargs} SYSFONT=${CONSOLEFONT}" + fi +fi + # set this as the default if we have the package and it matches if [[ ${mode} = --install ]] && [[ ${UPDATEDEFAULT} = yes ]] && [[ -n ${package} ]] && [[ -n ${DEFAULTKERNEL} ]] && [[ ${package} = ${DEFAULTKERNEL} ]]