Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 36519 - genkernel log is empty or incomplete (/var/log/genkernel.log gets overwriten)
Summary: genkernel log is empty or incomplete (/var/log/genkernel.log gets overwriten)
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Brad House
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-26 05:28 UTC by Rui Malheiro
Modified: 2004-01-18 08:09 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rui Malheiro 2003-12-26 05:28:59 UTC
/usr/sbin/genkernel writes the output from its process to /var/log/genkernel.log but uses overwrite (>) instead of append (>>).

Reproducible: Always
Steps to Reproduce:
1. genkernel
2. cat /var/log/genkernel.log
3. only the last command is logged

Actual Results:  
 

Expected Results:  
genkernel should log the entire process to /var/log/genkernel.log 

I suggest the folowing patch: (i'm not a developer so comments on how to properly submit 
patches are welcome) 
 
===================================================================== 
--- /usr/sbin/genkernel 2003-11-13 16:40:28.000000000 +0000 
+++ /tmp/genkernel.fix  2003-12-26 13:08:07.433149000 +0000 
@@ -205,19 +205,19 @@ 
        ebegin "Running \"make dep\"" 
        make dep  >/var/log/genkernel.log 2>&1 ||die; eend 
         ebegin "Running \"make bzImage\"" 
-       make $MAKEOPTS bzImage >/var/log/genkernel.log 2>&1 || die; eend 
+       make $MAKEOPTS bzImage >>/var/log/genkernel.log 2>&1 || die; eend 
        ebegin "Running \"make modules\"" 
-       make $MAKEOPTS modules >/var/log/genkernel.log 2>&1 || die; eend 
+       make $MAKEOPTS modules >>/var/log/genkernel.log 2>&1 || die; eend 
         ebegin "Running \"make modules_install\"" 
        if [ "$PACKAGE" = "yes" ] 
        then 
        install -d ${TEMP}/modules 
-       INSTALL_MOD_PATH="${TEMP}/modules" make modules_install >/var/log/genkernel.log 
2>&1 || die; eend 
+       INSTALL_MOD_PATH="${TEMP}/modules" make modules_install 
>>/var/log/genkernel.log 2>&1 || die; eend 
        mkdir ${TEMP}/genkernel 
        cp -rf ${TEMP}/modules/lib/modules/${KV} ${TEMP}/genkernel 
        rm -rf ${TEMP}/modules 
        else 
-       make modules_install >/var/log/genkernel.log 2>&1 || die; eend 
+       make modules_install >>/var/log/genkernel.log 2>&1 || die; eend 
        fi 
        mount /boot > /dev/null 2>&1 
        if [ "$LIVECD" = "yes" ] 
@@ -373,10 +373,10 @@ 
        mv ${TEMP}/kernel-${KV} ${TEMP}/genkernel || die "cannot copy kernel" 
        mv ${TEMP}/initrd-${KV} ${TEMP}/genkernel || die "cannot copy initrd" 
        eend 
-       cp -f /usr/src/linux-${KV}/.config ${TEMP}/genkernel/config >/var/log/genkernel.log 2>&1 
+       cp -f /usr/src/linux-${KV}/.config ${TEMP}/genkernel/config >>/var/log/genkernel.log 2>&1 
        cd ${TEMP} 
        ebegin "Copying Kernel package to /kernel-${KV}.tar.bz2" 
-       tar -jcvf /kernel-${KV}.tar.bz2 genkernel >/var/log/genkernel.log 2>&1 || die 
+       tar -jcvf /kernel-${KV}.tar.bz2 genkernel >>/var/log/genkernel.log 2>&1 || die 
        eend 
        rm -rf ${TEMP}/genkernel 
        fi 
@@ -390,7 +390,7 @@ 
        echo 
        einfo "A detailed log can be found at /var/log/genkernel.log." 
        rm -rf /tmp/KV 
-       umount ${TEMP}/kernel-initrd >/var/log/genkernel.log 2>&1 
+       umount ${TEMP}/kernel-initrd >>/var/log/genkernel.log 2>&1 
 
        rm -rf ${TEMP}/kernel-initrd 
        rm -rf ${TEMP}/${BUSYBOX_DIR} 
@@ -400,10 +400,10 @@ 
 configuration 
 compile 
 ebegin "Building busybox" 
-busybox >/var/log/genkernel.log 2>&1 
+busybox >>/var/log/genkernel.log 2>&1 
 eend 
 ebegin "Creating initrd" 
-initrd >/var/log/genkernel.log 2>&1 
+initrd >>/var/log/genkernel.log 2>&1 
 eend 
 bootsplash 
 buildpkg 
=====================================================================
Comment 1 SpanKY gentoo-dev 2003-12-26 11:37:44 UTC
patches are always best submitted as attachments ... posting as comments ruins them
Comment 2 Brad House 2004-01-18 08:09:47 UTC
we will not be fixing genkernel versions less than 3
this is obviously not from 3.x