Jeremy Chadwick
2010-Oct-27 07:44 UTC
Can't build boot blocks after new GPT attributes added
The below commit has broken the ability to build system boot blocks (including pxeldr) the "historic way"[1]: http://freshbsd.org/2010/10/17/20/10/00 The breakage on RELENG_8 (dated as of a few minutes ago): =======================================# rm -fr /usr/obj/* # cd /sys/boot # make clean [...] # make [...] cc -DBOOTPROG=\"gptboot\" -Os -fno-guess-branch-probability -fomit-frame-pointer -fno-unit-at-a-time -mno-align-long-strings -mrtd -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -DGPT -DUFS1_AND_UFS2 -DSIOPRT=0x3f8 -DSIOFMT=0x3 -DSIOSPD=9600 -I/usr/src/sys/boot/i386/gptboot/../../common -I/usr/src/sys/boot/i386/gptboot/../common -I/usr/src/sys/boot/i386/gptboot/../btx/lib -I. -I/usr/src/sys/boot/i386/gptboot/../boot2 -Wall -Waggregate-return -Wbad-function-cast -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings -Winline --param max-inline-insns-single=100 -ffreestanding -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -m32 -march=i386 -std=gnu99 -c /usr/src/sys/boot/i386/gptboot/../../common/gpt.c /usr/src/sys/boot/i386/gptboot/../../common/gpt.c: In function 'gptfind': /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:128: error: 'GPT_ENT_ATTR_BOOTME' undeclared (first use in this function) /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:128: error: (Each undeclared identifier is reported only once /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:128: error: for each function it appears in.) /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:130: error: 'GPT_ENT_ATTR_BOOTONCE' undeclared (first use in this function) /usr/src/sys/boot/i386/gptboot/../../common/gpt.c: In function 'gptbootfailed': /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:217: error: 'GPT_ENT_ATTR_BOOTONCE' undeclared (first use in this function) /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:222: error: 'GPT_ENT_ATTR_BOOTFAILED' undeclared (first use in this function) /usr/src/sys/boot/i386/gptboot/../../common/gpt.c: In function 'gptbootconv': /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:249: error: 'GPT_ENT_ATTR_BOOTME' undeclared (first use in this function) /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:250: error: 'GPT_ENT_ATTR_BOOTONCE' undeclared (first use in this function) /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:251: error: 'GPT_ENT_ATTR_BOOTFAILED' undeclared (first use in this function) *** Error code 1 Stop in /usr/src/sys/boot/i386/gptboot. *** Error code 1 Stop in /usr/src/sys/boot/i386. *** Error code 1 Stop in /usr/src/sys/boot. ======================================= Please advise. If there is a new/correct method, then I'd like to know what it is, in addition to the Handbook needing to be updated. [1]: http://www.freebsd.org/doc/handbook/serialconsole-setup.html (See Section 26.6.5.2) -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |
Pawel Jakub Dawidek
2010-Oct-27 08:09 UTC
Can't build boot blocks after new GPT attributes added
On Wed, Oct 27, 2010 at 12:44:02AM -0700, Jeremy Chadwick wrote:> The below commit has broken the ability to build system boot blocks > (including pxeldr) the "historic way"[1]: > > http://freshbsd.org/2010/10/17/20/10/00 > > The breakage on RELENG_8 (dated as of a few minutes ago): > > =======================================> # rm -fr /usr/obj/* > # cd /sys/boot > # make clean > [...] > # make > [...] > cc -DBOOTPROG=\"gptboot\" -Os -fno-guess-branch-probability -fomit-frame-pointer -fno-unit-at-a-time -mno-align-long-strings -mrtd -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -DGPT -DUFS1_AND_UFS2 -DSIOPRT=0x3f8 -DSIOFMT=0x3 -DSIOSPD=9600 -I/usr/src/sys/boot/i386/gptboot/../../common -I/usr/src/sys/boot/i386/gptboot/../common -I/usr/src/sys/boot/i386/gptboot/../btx/lib -I. -I/usr/src/sys/boot/i386/gptboot/../boot2 -Wall -Waggregate-return -Wbad-function-cast -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings -Winline --param max-inline-insns-single=100 -ffreestanding -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -m32 -march=i386 -std=gnu99 -c /usr/src/sys/boot/i386/gptboot/../../common/gpt.c > /usr/src/sys/boot/i386/gptboot/../../common/gpt.c: In function 'gptfind': > /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:128: error: 'GPT_ENT_ATTR_BOOTME' undeclared (first use in this function) > /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:128: error: (Each undeclared identifier is reported only once > /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:128: error: for each function it appears in.) > /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:130: error: 'GPT_ENT_ATTR_BOOTONCE' undeclared (first use in this function) > /usr/src/sys/boot/i386/gptboot/../../common/gpt.c: In function 'gptbootfailed': > /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:217: error: 'GPT_ENT_ATTR_BOOTONCE' undeclared (first use in this function) > /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:222: error: 'GPT_ENT_ATTR_BOOTFAILED' undeclared (first use in this function) > /usr/src/sys/boot/i386/gptboot/../../common/gpt.c: In function 'gptbootconv': > /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:249: error: 'GPT_ENT_ATTR_BOOTME' undeclared (first use in this function) > /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:250: error: 'GPT_ENT_ATTR_BOOTONCE' undeclared (first use in this function) > /usr/src/sys/boot/i386/gptboot/../../common/gpt.c:251: error: 'GPT_ENT_ATTR_BOOTFAILED' undeclared (first use in this function) > *** Error code 1 > > Stop in /usr/src/sys/boot/i386/gptboot. > *** Error code 1 > > Stop in /usr/src/sys/boot/i386. > *** Error code 1 > > Stop in /usr/src/sys/boot. > =======================================> > Please advise. If there is a new/correct method, then I'd like to know > what it is, in addition to the Handbook needing to be updated. > > [1]: http://www.freebsd.org/doc/handbook/serialconsole-setup.html > (See Section 26.6.5.2)Well, your problem is that gptboot.c is including gpt.h not from your source tree, but from /usr/include/sys/, which has an old version of this header file. This can be easly fixed by extending CFLAGS in one of the Makefiles (which is already done in HEAD), but I'm afraid this procedure is incorrect (and never was correct). Apart from including wrong files it also links to wrong libraries, etc. The proper way is to: # cd /usr/src # make buildenv # cd sys/boot # make clean && make && make install -- Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 196 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20101027/94510cd5/attachment.pgp
On Wednesday, October 27, 2010 3:44:02 am Jeremy Chadwick wrote:> The below commit has broken the ability to build system boot blocks > (including pxeldr) the "historic way"[1]: > > http://freshbsd.org/2010/10/17/20/10/00 > > The breakage on RELENG_8 (dated as of a few minutes ago): > > =======================================> # rm -fr /usr/obj/* > # cd /sys/boot > # make cleanThis only works if your source tree is in sync with your installed world. Adding a hack to the Makefile is wrong. The buildenv approach pjd@ suggested will work for the case that your source tree does not match your installed world. Maybe you could add text to the handbook to say this, but it is already implicitly assumed in the handbook section you are referring to since it assumes you can safely compile a new kernel, etc. The handbook section is meant as more of a tutorial on how to enable a serial console on a fresh box. Once you are experienced enough to start using buildworld, etc. I don't think it is unreasonable to require users to understand that having a source tree different from the installed world requires extra steps. If we were to document those every time it would clutter documentation making it harder for someone who is new to FreeBSD to simply setup a serial console on a box that they just installed. -- John Baldwin