From 02607774d17c89fbe9b77e8bbb379518c502a6cd Mon Sep 17 00:00:00 2001 From: Thomas Bächler Date: Wed, 6 Dec 2006 09:13:52 +0000 Subject: Trying to address piix issue: - added -m to print a message before passing control to kinit - added earlymodules= to preload modules git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@187 880c04e9-e011-0410-abf7-b926e227c9cd --- init | 9 +++++++++ install/base | 4 ++++ mkinitcpio | 10 ++++++++-- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/init b/init index 20d902e..e9d1866 100644 --- a/init +++ b/init @@ -55,6 +55,12 @@ if [ "x${disablemodules}" != "x" ]; then done fi +if [ "x${earlymodules}" != "x" ]; then + for m in $(replace "${earlymodules}" ','); do + /bin/modprobe -q $m > /dev/null 2>&1 + done +fi + . /config for m in $MODULES; do @@ -94,6 +100,9 @@ if [ "x${udevpid}" != "x" ]; then fi msg ":: Initramfs Completed - control passing to kinit" +if [ -f "/message" ]; then + msg "$(cat /message)" +fi echo "/sbin/modprobe" > /proc/sys/kernel/modprobe exec /bin/kinit -- "root=${root}" ${kinit_params} "${runlevel}" > /dev/null 2>&1 diff --git a/install/base b/install/base index 0bb45db..78fbc1d 100644 --- a/install/base +++ b/install/base @@ -20,6 +20,10 @@ install () add_file "/lib/initcpio/init" "/init" add_file "${CONFIG}" "/config" + if [ "x${MESSAGE}" != "x" ]; then + echo -e "${MESSAGE}" > ${MESSAGEFILE} + add_file "${MESSAGEFILE}" "/message" + fi SCRIPT="" } diff --git a/mkinitcpio b/mkinitcpio index 70f848c..ace6b77 100644 --- a/mkinitcpio +++ b/mkinitcpio @@ -16,6 +16,7 @@ # Settings BASEDIR="" FILELIST="$(mktemp /tmp/.tmpfilelist.XXXX)" +MESSAGEFILE="$(mktemp /tmp/.message.XXXX)" KERNELVERSION="$(uname -r)" FUNCTIONS="functions" CONFIG="mkinitcpio.conf" @@ -26,6 +27,7 @@ SAVELIST="" GENIMG="" APPEND="" PRESET="" +MESSAGE="" PRESETDIR="mkinitcpio.d" QUIET="y" SHOW_AUTOMODS="n" @@ -42,6 +44,7 @@ usage () echo " -g IMAGE Generate a cpio image as IMAGE. default: no" echo " -a NAME Append to an existing filelist. default: no" echo " -p PRESET Build specified preset." + echo " -m MESSAGE Print MESSAGE before passing control to kinit." echo " -v Verbose output. Default: no" echo " -M Display modules found via autodetection." echo " -L List all available hooks." @@ -50,7 +53,7 @@ usage () exit 1 } -while getopts ':c:k:s:b:g:a:p:vH:LMh' arg; do +while getopts ':c:k:s:b:g:a:p:m:vH:LMh' arg; do if [ "${OPTARG:0:1}" = "-" ]; then echo "error: optional argument to '-$arg' begins with a '-'" echo " you probably don't want this....aborting." @@ -64,6 +67,7 @@ while getopts ':c:k:s:b:g:a:p:vH:LMh' arg; do g) GENIMG="$OPTARG" ;; a) APPEND="y"; SAVELIST="y"; FILELIST="$OPTARG" ;; p) PRESET="$OPTARG" ;; + m) MESSAGE="$OPTARG" ;; v) QUIET="n" ;; H) source "${INSTDIR}/${OPTARG}"; echo "Help for hook '${OPTARG}':" @@ -85,9 +89,10 @@ shift $(($OPTIND - 1)) # use preset $PRESET if [ -n "${PRESET}" ]; then if [ -f "${PRESETDIR}/${PRESET}.preset" ]; then - # Use -b and -v options specified earlier + # Use -b, -m and -v options specified earlier PRESET_MKOPTS="${0}" [ -n "${BASEDIR}" ] && PRESET_MKOPTS="${PRESET_MKOPTS} -b ${BASEDIR}" + [ -n "${MESSAGE}" ] && PRESET_MKOPTS="${PRESET_MKOPTS} -m ${MESSAGE}" [ "${QUIET}" = "n" ] && PRESET_MKOPTS="${PRESET_MKOPTS} -v" # Build all images source ${PRESETDIR}/${PRESET}.preset @@ -238,6 +243,7 @@ if [ "x$GENIMG" != "x" ]; then if [ "x${SAVELIST}" == "x" ]; then rm ${FILELIST} fi + rm ${MESSAGEFILE} else echo ":: Dry run complete, use -g IMAGE to generate a real image" fi -- cgit v1.2.3-24-g4f1b