Bug 836121 - Kernel build can fail due to non-existent req.list
Summary: Kernel build can fail due to non-existent req.list
Keywords:
Status: CLOSED DUPLICATE of bug 833558
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-28 07:21 UTC by Bruce Jerrick
Modified: 2012-07-03 14:32 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-07-03 14:32:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Bruce Jerrick 2012-06-28 07:21:32 UTC
Description of problem:
A kernel build (rpmbuild -bb ...) can fail with:

  ...
  + sort -u req.list
  sort: open failed: req.list: No such file or directory
  error: Bad exit status from /var/tmp/rpm-tmp.qtIY2n (%build)

The problem is that req.list first gets removed, then appended to by
conditional code.  If the conditions never evaluate true, then
req.list won't exist.
The code in question comes from the %build section kernel.spec .

Version-Release number of selected component (if applicable):
First appeared in F17 Releasei (still in F18 Rawhide):
kernel-3.3.4-5.fc17.src.rpm

How reproducible:
Always, if the kernel .config is just right.

Steps to Reproduce:
Probably not worthwhile -- just examine the code (see below).
It happened to me with a kernel config that had only about 35% of
the modules enabled.  I used 'make xconfig', then copied the resulting
.config to SOURCES/config-local (see SOURCE1000 in kernel.spec).

Actual results:
Build fails.

Expected results:
Build succeeds.

Additional info (and FIX):
The relevant code from kernel.spec follows.  The relevant lines are
tagged '>>>'.  A fix is to add the line tagged 'ADD'.  It also touches
dep.list, because the code that appends to it is also conditional, and
conceivably it could end up non-existent also.

Line 1782:
        # Look through all of the modules, and throw any that have a dependency in
        # our list into the list as well.
        rm -rf dep.list dep2.list
>>>     rm -rf req.list req2.list
ADD:    touch dep.list req.list     # ensure they exist for 'sort' below
        cp %{SOURCE16} .
        for dep in `cat modnames`
        do
          depends=`modinfo $dep | grep depends| cut -f2 -d":" | sed -e 's/^[ \t]*//'`
          [ -z "$depends" ] && continue;
          for mod in `echo $depends | sed -e 's/,/ /g'`
          do
            match=`grep "^$mod.ko" mod-extra.list` ||:
            if [ -z "$match" ]
            then
              continue
            else
              # check if the module we're looking at is in mod-extra too.  if so
              # we don't need to mark the dep as required
              mod2=`basename $dep`
              match2=`grep "^$mod2" mod-extra.list` ||:
              if [ -n "$match2" ]
              then
                continue
                #echo $mod2 >> notreq.list
              else
>>>             echo $mod.ko >> req.list
              fi
            fi
          done
        done

Comment 1 Josh Boyer 2012-07-03 14:32:32 UTC

*** This bug has been marked as a duplicate of bug 833558 ***


Note You need to log in before you can comment on or make changes to this bug.