Subject: kern/15175: bootstrapping of makefs fails
To: None <gnats-bugs@gnats.netbsd.org>
From: g r <gr@grappa.eclipsed.net>
List: netbsd-bugs
Date: 01/08/2002 01:39:01
>Number:         15175
>Category:       kern
>Synopsis:       bootstrapping of makefs fails
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 07 22:40:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     gabriel rosenkoetter
>Release:        NetBSD 1.5Y, building source checked out ~200201080100 EST
>Organization:
	
>Environment:
	
	
System: NetBSD grappa 1.5Y NetBSD 1.5Y (GRAPPA) #2: Fri Nov 23 11:25:03 EST 2001 gr@grappa:/usr/src/sys/arch/i386/compile/GRAPPA i386
Architecture: i386
Machine: i386
>Description:

I just wanted to build a newer kernel (not a full build) for a
separate system with newer source, so I did a make cleandir, then
cvs updated my source, then attempted to build a kernel only to find
either that cleandir removed my older tools or that I had previously
removed them on purpose (that's not the point here) So I decided
I'd just build the new toolchain first and then the kernel.

However:

>How-To-Repeat:

# ./build.sh -r -t
[...]
cc -O -Wall   -I/usr/src/tools/makefs/../../usr.sbin/makefs  -I/usr/src/tools/makefs/../../usr.sbin/makefs/../../bin/ls -I/usr/src/tools/makefs/../../usr.sbin/makefs/../../sbin/mknod -I/usr/src/tools/makefs/../../usr.sbin/makefs/../../usr.sbin/mtree -I/usr/src/tools/makefs/../../usr.sbin/makefs/../../bin/dd -include /usr/src/tools/compat/obj.i386/config.h -c -o ffs_bswap.lo /usr/src/tools/makefs/../../usr.sbin/makefs/../../sys/ufs/ffs/ffs_bswap.c
/usr/src/tools/makefs/../../usr.sbin/makefs/../../sys/ufs/ffs/ffs_bswap.c: In function `ffs_sb_swap':
/usr/src/tools/makefs/../../usr.sbin/makefs/../../sys/ufs/ffs/ffs_bswap.c:99: structure has no member named `fs_pendingblocks'
/usr/src/tools/makefs/../../usr.sbin/makefs/../../sys/ufs/ffs/ffs_bswap.c:99: structure has no member named `fs_pendingblocks'
/usr/src/tools/makefs/../../usr.sbin/makefs/../../sys/ufs/ffs/ffs_bswap.c:99: structure has no member named `fs_pendingblocks'
/usr/src/tools/makefs/../../usr.sbin/makefs/../../sys/ufs/ffs/ffs_bswap.c:99: structure has no member named `fs_pendingblocks'
/usr/src/tools/makefs/../../usr.sbin/makefs/../../sys/ufs/ffs/ffs_bswap.c:99: structure has no member named `fs_pendingblocks'
/usr/src/tools/makefs/../../usr.sbin/makefs/../../sys/ufs/ffs/ffs_bswap.c:99: structure has no member named `fs_pendingblocks'
/usr/src/tools/makefs/../../usr.sbin/makefs/../../sys/ufs/ffs/ffs_bswap.c:99: structure has no member named `fs_pendingblocks'
/usr/src/tools/makefs/../../usr.sbin/makefs/../../sys/ufs/ffs/ffs_bswap.c:100: structure has no member named `fs_pendinginodes'
/usr/src/tools/makefs/../../usr.sbin/makefs/../../sys/ufs/ffs/ffs_bswap.c:100: structure has no member named `fs_pendinginodes'
/usr/src/tools/makefs/../../usr.sbin/makefs/../../sys/ufs/ffs/ffs_bswap.c:100: structure has no member named `fs_pendinginodes'
/usr/src/tools/makefs/../../usr.sbin/makefs/../../sys/ufs/ffs/ffs_bswap.c:100: structure has no member named `fs_pendinginodes'
/usr/src/tools/makefs/../../usr.sbin/makefs/../../sys/ufs/ffs/ffs_bswap.c:100: structure has no member named `fs_pendinginodes'
/usr/src/tools/makefs/../../usr.sbin/makefs/../../sys/ufs/ffs/ffs_bswap.c:100: structure has no member named `fs_pendinginodes'
/usr/src/tools/makefs/../../usr.sbin/makefs/../../sys/ufs/ffs/ffs_bswap.c:100: structure has no member named `fs_pendinginodes'
*** Error code 1

Stop.
nbmake: stopped in /usr/src/tools/makefs
*** Error code 1

Stop.
nbmake: stopped in /usr/src/tools/makefs
*** Error code 1

Stop.
nbmake: stopped in /usr/src/tools

>Fix:

As near as I can figure, makefs is getting the wrong <ufs/ffs/fs.h>
(that is, it's seeing the installed one rather than the one under
/usr/src/sys/ufs), as fs.h within the source tree does include the
correct definition for a struct fs.

But I've only just glanced at ffs_bswap.c, so I'm probably missing
something.

The point, of course, is that a bootstrap must not fail, or else
it's not really a bootstrap. (So, the old "you need to make
includes" is not a good solution here.)
>Release-Note:
>Audit-Trail:
>Unformatted: