summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mkinitcpio17
1 files changed, 12 insertions, 5 deletions
diff --git a/mkinitcpio b/mkinitcpio
index 3985cc1..1468010 100644
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -24,7 +24,7 @@ MODULE_FILE=""
SAVELIST=""
GENIMG=""
APPEND=""
-QUIET="n"
+QUIET="y"
APPNAME=$(basename "${0}")
@@ -37,7 +37,7 @@ usage ()
echo " -b BASEDIR Use BASEDIR. default: /"
echo " -g IMAGE Generate a cpio image as IMAGE. default: no"
echo " -a NAME Append to an existing filelist. default: no"
- echo " -q Quiet output. Default: no"
+ echo " -v Verbose output. Default: no"
echo " -H HOOKNAME Output help for hook 'HOOKNAME'."
echo " -h This message."
exit 1
@@ -51,7 +51,7 @@ while getopts 'c:k:s:b:g:a:qH:h' arg; do
b) BASEDIR="$OPTARG" ;;
g) GENIMG="$OPTARG" ;;
a) APPEND="y" FILELIST="$OPTARG" ;;
- q) QUIET="y" ;;
+ v) QUIET="n" ;;
H) source "${INSTDIR}/${OPTARG}";
echo "Help for hook '${OPTARG}':"
help
@@ -101,6 +101,7 @@ else
fi
source "${FUNCTIONS}"
+echo ":: Begin build"
#parse 'global' hook, as defined in ${CONFIG}
parse_hook
@@ -111,13 +112,14 @@ for hook in $HOOKS; do
install () { msg "${hook}: no install function..."; }
if grep "install" "${INSTDIR}/${hook}" >/dev/null 2>&1; then
source "${INSTDIR}/${hook}"
- msg ":: Parsing hook [${hook}]"
+ echo ":: Parsing hook [${hook}]"
install
parse_hook
fi
done
if [ "${HAS_MODULES}" == "y" ]; then
+ echo ":: Generating module dependancies"
[ -e /tmp${MODULEDIR}/ ] && rm -r /tmp${MODULEDIR}/
cp --parents $(grep "file /lib/modules" ${FILELIST} | awk '{print $2}') /tmp/
depmod -b /tmp ${KERNELVERSION}
@@ -127,13 +129,18 @@ if [ "${HAS_MODULES}" == "y" ]; then
fi
if [ "x$GENIMG" != "x" ]; then
+ echo -n "::Generating image '${GENIMG}'..."
if ! gen_init_cpio ${FILELIST} | gzip -9 > "${GENIMG}"; then
- err "Failed to create '${GENIMG}' image"
+ echo "FAILED"
+ else
+ echo "SUCCESS"
fi
if [ "x${SAVELIST}" == "x" ]; then
rm ${FILELIST}
fi
+else
+ echo ":: Dry run complete, use -g IMAGE to generate a real image"
fi
[ -e "${MODULE_FILE}" ] && rm "${MODULE_FILE}"
#vim:set ft=sh ts=4 sw=4 noet: