From 62b6035d2a9ec79140bbf04f5fb9e5bfe92435ed Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Mon, 17 Sep 2007 22:23:48 +0000 Subject: [PATCH] Rename DEBUGLEVEL/DEBUGFILE to LOGLEVEL/LOGFILE to help reduce confusion. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@543 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- ChangeLog | 5 +++++ gen_cmdline.sh | 22 +++++++++++----------- gen_compile.sh | 18 +++++++++--------- gen_determineargs.sh | 4 ++-- gen_funcs.sh | 24 ++++++++++++------------ gen_initrd.sh | 8 ++++---- genkernel | 4 ++-- genkernel.8 | 4 ++-- genkernel.conf | 4 ++-- 9 files changed, 49 insertions(+), 44 deletions(-) diff --git a/ChangeLog b/ChangeLog index d85c436..cf71c8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ # Copyright 2006-2007 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 17 Sep 2007; Chris Gianelloni gen_cmdline.sh, + gen_compile.sh, gen_determineargs.sh, gen_funcs.sh, gen_initrd.sh, + genkernel, genkernel.8, genkernel.conf: + Rename DEBUGLEVEL/DEBUGFILE to LOGLEVEL/LOGFILE to help reduce confusion. + 17 Sep 2007; Chris Gianelloni gen_cmdline.sh, gen_configkernel.sh, genkernel: Some more generalcleanup and adding support for using a config file other diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 53ac1a9..3a18f00 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -15,8 +15,8 @@ longusage() { echo " Configuration settings" echo " --config= genkernel configuration file to use" echo " Debug settings" - echo " --debuglevel=<0-5> Debug Verbosity Level" - echo " --debugfile= Output file for debug info" + echo " --loglevel=<0-5> Debug Verbosity Level" + echo " --logfile= Output file for debug info" echo " --color Output debug in color" echo " --no-color Do not output debug in color" echo " Kernel Configuration settings" @@ -251,10 +251,10 @@ parse_cmdline() { CMD_BOOTLOADER=`parse_opt "$*"` print_info 2 "CMD_BOOTLOADER: ${CMD_BOOTLOADER}" ;; - --debuglevel=*) - CMD_DEBUGLEVEL=`parse_opt "$*"` - DEBUGLEVEL="${CMD_DEBUGLEVEL}" - print_info 2 "CMD_DEBUGLEVEL: ${CMD_DEBUGLEVEL}" + --loglevel=*) + CMD_LOGLEVEL=`parse_opt "$*"` + LOGLEVEL="${CMD_LOGLEVEL}" + print_info 2 "CMD_LOGLEVEL: ${CMD_LOGLEVEL}" ;; --menuconfig) TERM_LINES=`stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1` @@ -398,11 +398,11 @@ parse_cmdline() { print_info 2 "USECOLOR: ${USECOLOR}" setColorVars ;; - --debugfile=*) - CMD_DEBUGFILE=`parse_opt "$*"` - DEBUGFILE=`parse_opt "$*"` - print_info 2 "CMD_DEBUGFILE: ${CMD_DEBUGFILE}" - print_info 2 "DEBUGFILE: ${CMD_DEBUGFILE}" + --logfile=*) + CMD_LOGFILE=`parse_opt "$*"` + LOGFILE=`parse_opt "$*"` + print_info 2 "CMD_LOGFILE: ${CMD_LOGFILE}" + print_info 2 "LOGFILE: ${CMD_LOGFILE}" ;; --kerneldir=*) CMD_KERNELDIR=`parse_opt "$*"` diff --git a/gen_compile.sh b/gen_compile.sh index a123ea9..c302983 100644 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -216,16 +216,16 @@ compile_generic() { print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS/-j?/j1} ${ARGS} ${target} $*" 1 0 1 eval ${MAKE} -s ${MAKEOPTS/-j?/-j1} "${ARGS}" ${target} $* RET=$? - elif [ "${DEBUGLEVEL}" -gt "1" ] + elif [ "${LOGLEVEL}" -gt "1" ] then - # Output to stdout and debugfile + # Output to stdout and logfile print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $*" 1 0 1 - eval ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* 2>&1 | tee -a ${DEBUGFILE} + eval ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* 2>&1 | tee -a ${LOGFILE} RET=${PIPESTATUS[0]} else - # Output to debugfile only + # Output to logfile only print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${1} $*" 1 0 1 - eval ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* >> ${DEBUGFILE} 2>&1 + eval ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* >> ${LOGFILE} 2>&1 RET=$? fi [ "${RET}" -ne '0' ] && @@ -495,7 +495,7 @@ compile_lvm() { LDFLAGS="-L${TEMP}/device-mapper/lib" \ CFLAGS="-I${TEMP}/device-mapper/include" \ CPPFLAGS="-I${TEMP}/device-mapper/include" \ - ./configure --enable-static_link --prefix=${TEMP}/lvm >> ${DEBUGFILE} 2>&1 || + ./configure --enable-static_link --prefix=${TEMP}/lvm >> ${LOGFILE} 2>&1 || gen_die 'Configure of lvm failed!' print_info 1 'lvm: >> Compiling...' compile_generic '' utils @@ -536,7 +536,7 @@ compile_dmraid() { LDFLAGS="-L${TEMP}/device-mapper/lib" \ CFLAGS="-I${TEMP}/device-mapper/include" \ CPPFLAGS="-I${TEMP}/device-mapper/include" \ - ./configure --enable-static_link --prefix=${TEMP}/dmraid >> ${DEBUGFILE} 2>&1 || + ./configure --enable-static_link --prefix=${TEMP}/dmraid >> ${LOGFILE} 2>&1 || gen_die 'Configure of dmraid failed!' # We dont necessarily have selinux installed yet... look into @@ -600,7 +600,7 @@ compile_device_mapper() { gen_die "device-mapper directory ${DEVICE_MAPPER_DIR} invalid" cd "${DEVICE_MAPPER_DIR}" ./configure --prefix=${TEMP}/device-mapper --enable-static_link \ - --disable-selinux >> ${DEBUGFILE} 2>&1 || + --disable-selinux >> ${LOGFILE} 2>&1 || gen_die 'Configuring device-mapper failed!' print_info 1 'device-mapper: >> Compiling...' compile_generic '' utils @@ -633,7 +633,7 @@ compile_e2fsprogs() { gen_die "e2fsprogs directory ${E2FSPROGS_DIR} invalid" cd "${E2FSPROGS_DIR}" print_info 1 'e2fsprogs: >> Configuring...' - ./configure --with-ldopts=-static >> ${DEBUGFILE} 2>&1 || + ./configure --with-ldopts=-static >> ${LOGFILE} 2>&1 || gen_die 'Configuring e2fsprogs failed!' print_info 1 'e2fsprogs: >> Compiling...' MAKE=${UTILS_MAKE} compile_generic "" "" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 7f6986b..8ae5d63 100644 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -78,9 +78,9 @@ get_KV() { } determine_real_args() { - if [ "${CMD_DEBUGFILE}" != '' ] + if [ "${CMD_LOGFILE}" != '' ] then - DEBUGFILE="${CMD_DEBUGFILE}" + LOGFILE="${CMD_LOGFILE}" fi if [ "${CMD_MAKEOPTS}" != '' ] diff --git a/gen_funcs.sh b/gen_funcs.sh index 8ade7e5..80e4883 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -43,10 +43,10 @@ setColorVars dump_debugcache() { TODEBUGCACHE=0 - echo "${DEBUGCACHE}" >> ${DEBUGFILE} + echo "${DEBUGCACHE}" >> ${LOGFILE} } -# print_info(debuglevel, print [, newline [, prefixline [, forcefile ] ] ]) +# print_info(loglevel, print [, newline [, prefixline [, forcefile ] ] ]) print_info() { local NEWLINE=1 local FORCEFILE=0 @@ -91,9 +91,9 @@ print_info() { fi fi - # PRINT TO SCREEN ONLY IF PASSED DEBUGLEVEL IS HIGHER THAN + # PRINT TO SCREEN ONLY IF PASSED LOGLEVEL IS HIGHER THAN # OR EQUAL TO SET DEBUG LEVEL - if [ "$1" -lt "${DEBUGLEVEL}" -o "$1" -eq "${DEBUGLEVEL}" ] + if [ "$1" -lt "${LOGLEVEL}" -o "$1" -eq "${LOGLEVEL}" ] then SCRPRINT='1' fi @@ -142,13 +142,13 @@ print_info() { if [ "${TODEBUGCACHE}" -eq 1 ]; then DEBUGCACHE="${DEBUGCACHE}${STR}" else - echo -ne "${STR}" >> ${DEBUGFILE} + echo -ne "${STR}" >> ${LOGFILE} fi else if [ "${TODEBUGCACHE}" -eq 1 ]; then DEBUGCACHE="${DEBUGCACHE}${STR}"$'\n' else - echo "${STR}" >> ${DEBUGFILE} + echo "${STR}" >> ${LOGFILE} fi fi fi @@ -194,9 +194,9 @@ cache_replace() { } clear_log() { - if [ -f "${DEBUGFILE}" ] + if [ -f "${LOGFILE}" ] then - (echo > "${DEBUGFILE}") 2>/dev/null || small_die "Genkernel: Could not write to ${DEBUGFILE}." + (echo > "${LOGFILE}") 2>/dev/null || small_die "Genkernel: Could not write to ${LOGFILE}." fi } @@ -213,20 +213,20 @@ gen_die() { if isTrue ${USECOLOR} then - GREP_COLOR='1' grep -B5 -E --colour=always "([Ww][Aa][Rr][Nn][Ii][Nn][Gg]|[Ee][Rr][Rr][Oo][Rr][ :,!]|[Ff][Aa][Ii][Ll][Ee]?[Dd]?)" ${DEBUGFILE} + GREP_COLOR='1' grep -B5 -E --colour=always "([Ww][Aa][Rr][Nn][Ii][Nn][Gg]|[Ee][Rr][Rr][Oo][Rr][ :,!]|[Ff][Aa][Ii][Ll][Ee]?[Dd]?)" ${LOGFILE} else - grep -B5 -E "([Ww][Aa][Rr][Nn][Ii][Nn][Gg]|[Ee][Rr][Rr][Oo][Rr][ :,!]|[Ff][Aa][Ii][Ll][Ee]?[Dd]?)" ${DEBUGFILE} + grep -B5 -E "([Ww][Aa][Rr][Nn][Ii][Nn][Gg]|[Ee][Rr][Rr][Oo][Rr][ :,!]|[Ff][Aa][Ii][Ll][Ee]?[Dd]?)" ${LOGFILE} fi echo print_info 1 "-- End log... --" echo - print_info 1 "Please consult ${DEBUGFILE} for more information and any" + print_info 1 "Please consult ${LOGFILE} for more information and any" print_info 1 "errors that were reported above." echo print_info 1 "Report any genkernel bugs to bugs.gentoo.org and" print_info 1 "assign your bug to genkernel@gentoo.org. Please include" print_info 1 "as much information as you can in your bug report; attaching" - print_info 1 "${DEBUGFILE} so that your issue can be dealt with effectively." + print_info 1 "${LOGFILE} so that your issue can be dealt with effectively." print_info 1 '' print_info 1 'Please do *not* report compilation failures as genkernel bugs!' print_info 1 '' diff --git a/gen_initrd.sh b/gen_initrd.sh index f48856b..46f8d07 100644 --- a/gen_initrd.sh +++ b/gen_initrd.sh @@ -6,11 +6,11 @@ create_initrd_loop() { [ "$#" -ne '1' ] && gen_die 'create_initrd_loop(): Not enough arguments!' mkdir -p ${TEMP}/initrd-mount || gen_die 'Could not create loopback mount directory!' - dd if=/dev/zero of=${TMPDIR}/initrd-${KV} bs=1k count=${1} >> "${DEBUGFILE}" 2>&1 || + dd if=/dev/zero of=${TMPDIR}/initrd-${KV} bs=1k count=${1} >> "${LOGFILE}" 2>&1 || gen_die "Could not zero initrd-${KV}" - mke2fs -F -N750 -q "${TMPDIR}/initrd-${KV}" >> "${DEBUGFILE}" 2>&1 || + mke2fs -F -N750 -q "${TMPDIR}/initrd-${KV}" >> "${LOGFILE}" 2>&1 || gen_die "Could not format initrd-${KV}!" - mount -t ext2 -o loop "${TMPDIR}/initrd-${KV}" "${TEMP}/initrd-mount" >> "${DEBUGFILE}" 2>&1 || + mount -t ext2 -o loop "${TMPDIR}/initrd-${KV}" "${TEMP}/initrd-mount" >> "${LOGFILE}" 2>&1 || gen_die 'Could not mount the initrd filesystem!' } @@ -22,7 +22,7 @@ create_initrd_unmount_loop() { move_initrd_to_loop() { cd "${TEMP}/initrd-temp" - mv * "${TEMP}/initrd-mount" >> ${DEBUGFILE} 2>&1 + mv * "${TEMP}/initrd-mount" >> ${LOGFILE} 2>&1 } # check for static linked file with objdump diff --git a/genkernel b/genkernel index 7733731..9ca1a78 100755 --- a/genkernel +++ b/genkernel @@ -7,7 +7,7 @@ GK_V='3.4.9_pre3' # --tempdir command line option. TMPDIR='/var/tmp/genkernel' -TODEBUGCACHE=1 # Until an error occurs or DEBUGFILE is fully qualified. +TODEBUGCACHE=1 # Until an error occurs or LOGFILE is fully qualified. small_die() { echo $1 @@ -290,7 +290,7 @@ then then echo echo - eval ${CMD_CALLBACK} | tee -a ${DEBUGFILE} + eval ${CMD_CALLBACK} | tee -a ${LOGFILE} CMD_STATUS="${PIPESTATUS[0]}" echo print_info 1 "<<< Callback exit status: ${CMD_STATUS}" diff --git a/genkernel.8 b/genkernel.8 index 27a4b06..bf1962c 100644 --- a/genkernel.8 +++ b/genkernel.8 @@ -49,12 +49,12 @@ do the opposite thing. You can specify your options in any order. .PP .BR Debugging \ Options .TP -\fB\-\-debuglevel=\fR<0-5> +\fB\-\-loglevel=\fR<0-5> This controls the out verbosity level of genkernel output - if this is set to 0, minimal debugging is done; if this is set to 5 as much output as possible is given. .TP -\fB\-\-debugfile=\fR +\fB\-\-logfile=\fR This outputs debugging data to the file . By default this is .I /var/log/genkernel.log\fR. .TP diff --git a/genkernel.conf b/genkernel.conf index 79386e1..e1549b4 100755 --- a/genkernel.conf +++ b/genkernel.conf @@ -70,9 +70,9 @@ GK_SHARE="/usr/share/genkernel" # Location of the default cache CACHE_DIR="/var/cache/genkernel/%%ARCH%%" # Log output file -DEBUGFILE="/var/log/genkernel.log" +LOGFILE="/var/log/genkernel.log" # Debug Level -DEBUGLEVEL=1 +LOGLEVEL=1 # Default location of kernel source DEFAULT_KERNEL_SOURCE="/usr/src/linux" -- 2.26.2