;;
--debugfile*)
CMD_DEBUGFILE=`parse_opt "$*"`
+ DEBUGFILE=`parse_opt "$*"`
print_info 2 "CMD_DEBUGFILE: $CMD_DEBUGFILE"
+ print_info 2 "DEBUGFILE: $CMD_DEBUGFILE"
;;
--kerneldir*)
CMD_KERNELDIR=`parse_opt "$*"`
UNDER=''
fi
+dump_debugcache() {
+ TODEBUGCACHE=0
+ echo "${DEBUGCACHE}" >> ${DEBUGFILE}
+}
+
# print_info(debuglevel, print [, newline [, prefixline [, forcefile ] ] ])
print_info() {
local NEWLINE=1
if [ "${NEWLINE}" = '0' ]
then
- echo -ne "${STR}" >> ${DEBUGFILE}
+ if [ "${TODEBUGCACHE}" -eq 1 ]; then
+ DEBUGCACHE="${DEBUGCACHE}${STR}"
+ else
+ echo -ne "${STR}" >> ${DEBUGFILE}
+ fi
else
- echo "${STR}" >> ${DEBUGFILE}
+ if [ "${TODEBUGCACHE}" -eq 1 ]; then
+ DEBUGCACHE="${DEBUGCACHE}${STR}"$'\n'
+ else
+ echo "${STR}" >> ${DEBUGFILE}
+ fi
fi
fi
}
clear_log() {
- rm -f ${DEBUGFILE}
- touch ${DEBUGFILE}
+ [ -f "${DEBUGFILE}" ] && echo > "${DEBUGFILE}"
}
gen_die() {
+ dump_debugcache
+
if [ "$#" -gt '0' ]
then
print_error 1 "ERROR: ${1}"
GK_V='3.0.2d'
TEMP='/var/tmp/genkernel'
+TODEBUGCACHE=1 # Until an error occurs or DEBUGFILE is fully qualified.
small_die() {
echo $1
source /etc/genkernel.conf || small_die "Could not read /etc/genkernel.conf"
source ${GK_BIN}/gen_funcs.sh || small_die "Could not read ${GK_BIN}/gen_funcs.sh"
-clear_log
source ${GK_BIN}/gen_cmdline.sh || gen_die "Could not read ${GK_BIN}/gen_cmdline.sh"
source ${GK_BIN}/gen_arch.sh || gen_die "Could not read ${GK_BIN}/gen_arch.sh"
source ${GK_BIN}/gen_determineargs.sh || gen_die "Could not read ${GK_BIN}/gen_determineargs.sh"
exit 1
fi
+clear_log
NORMAL=${GOOD} print_info 1 "Gentoo Linux Genkernel; Version ${GK_V}${NORMAL}"
# Set ${ARCH}
# Based on genkernel.conf, arch-specific configs, and commandline options,
# get the real arguments for usage...
+
determine_real_args
+dump_debugcache
NORMAL=${BOLD} print_info 1 "Compiling Linux Kernel ${BOLD}${KV}${NORMAL} for ${BOLD}${ARCH}${NORMAL}..."
echo