Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 70193 - Using build 'kernel' and --minkernpackage causes genkernel to stop with an error
Summary: Using build 'kernel' and --minkernpackage causes genkernel to stop with an error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2004-11-05 14:22 UTC by David Bryson (RETIRED)
Modified: 2004-12-21 05:05 UTC (History)
0 users

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


Attachments
patches bug in gen_cmdline.patch (gen_cmdline.patch,455 bytes, patch)
2004-11-05 14:24 UTC, David Bryson (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Bryson (RETIRED) gentoo-dev 2004-11-05 14:22:05 UTC
Building only the 'kernel' with the   --minkernpackage produces the following error:

* initrd: Not building since only the kernel was requested...
* Creating kernel package
* ERROR: Could not copy the initrd for the kernel package!

In the runtime case statement in gen_cmdline.sh BUILD_INITRD is not properly set in one condition:

            all)
                      BUILD_KERNEL=1
                      BUILD_INITRD=1
              ;;
              initrd)
                      BUILD_INITRD=1
              ;;
              kernel)
                      BUILD_KERNEL=1
              ;;

Then later this code is executed in gen_package.sh:

        [ "${BUILD_INITRD}" -ne 0 ] && cp "${TEMP}/initrd-${KV}" "${TEMP}/minker
npackage/initrd-${KV}" || gen_die 'Could not copy the initrd for the kernel pack
age!'

Since BUILD_INITRD is set to 1 by default, this code exits genkernel and it cannot complete.  I will attach a patch that sets BUILD_INITRD=0 in the 'kernel' build option.


Reproducible: Always
Steps to Reproduce:
1. genkernel <args> --minkernpackage=<pkg path> kernel
2. watch genkernel die

Actual Results:  

* initrd: Not building since only the kernel was requested...
* Creating kernel package
* ERROR: Could not copy the initrd for the kernel package!
Comment 1 David Bryson (RETIRED) gentoo-dev 2004-11-05 14:24:00 UTC
Created attachment 43364 [details, diff]
patches bug in gen_cmdline.patch

This is patched from the genkernel_bradmssw folder in the gentoo cvs module as
of todays date.
It's really just a 1 line patch, nothing special.
Comment 2 David Bryson (RETIRED) gentoo-dev 2004-11-08 16:02:38 UTC
The previous submitted patch does not actually fix this bug. It does provide a bit of clarity in regards to the state of BUILD_INITRD.  However, I realized that the real problem from the bug is in this line:

        [ "${BUILD_INITRD}" -ne 0 ] && cp "${TEMP}/initrd-${KV}" "${TEMP}/minker
npackage/initrd-${KV}" || gen_die 'Could not copy the initrd for the kernel pack
age!'

operational precedence says that '&&' and '||' have the same precedence level.  
The code was written like this:

smt1 && stm2 || throw up and die

It appears to me it was meant to work like this:

stm1 && (stm2 || throw up and die)

But when the code is executed it actually does the following:

(stmt 1 && stm2) || throw up and die

I propose parenthesis are added so that the code execution is:

stm1 && (stm2 || throw up and die)
Comment 3 David Bryson (RETIRED) gentoo-dev 2004-11-08 16:03:29 UTC
Oh i see this is actually how the code is in cvs, so nevermind.
Comment 4 Tim Yamin (RETIRED) gentoo-dev 2004-12-21 05:05:58 UTC
Fixed in genkernel-3.1.0d; please reopen this bug if you have any problems. Thanks!