It''s riddled with Linux-isms. I have no idea what this code is really for, or how to test it, so I''m not going to be much use fixing this up. With the patch below (at least some of the way), I just get: gld -melf_i386 -N -T arch/i386/core/etherboot.lds -o bin/eepro100.rom.rt bin/pciprefix.exit.o bin/eepro100.rt.o eepro100.rom.rt: Bad entry point /bin/sh: test: argument expected Suggestions? regards john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Fri, Feb 01, 2008 at 06:16:47PM +0000, John Levon wrote:> With the patch below (at least some of the way), I just get:And the patch john diff --git a/config/StdGNU.mk b/config/StdGNU.mk --- a/config/StdGNU.mk +++ b/config/StdGNU.mk @@ -12,6 +12,7 @@ SIZEUTIL = $(CROSS_COMPILE)size MSGFMT = msgfmt MSGMERGE = msgmerge +TAR = tar INSTALL = install INSTALL_DIR = $(INSTALL) -d -m0755 -p diff --git a/config/SunOS.mk b/config/SunOS.mk --- a/config/SunOS.mk +++ b/config/SunOS.mk @@ -11,6 +11,7 @@ SIZEUTIL = $(CROSS_COMPILE)gsize SIZEUTIL = $(CROSS_COMPILE)gsize MSGFMT = gmsgfmt +TAR = gtar SHELL = bash diff --git a/tools/firmware/etherboot/Makefile b/tools/firmware/etherboot/Makefile --- a/tools/firmware/etherboot/Makefile +++ b/tools/firmware/etherboot/Makefile @@ -21,14 +21,14 @@ eb-%.zrom.h: $E/src/Config mv -f $@.new $@ eb-rom-list.h: make-eb-rom-list $E/src/bin/Roms - ./$^ $(NICS) >$@.new && mv -f $@.new $@ + PATH=/usr/gnu/bin/:$(PATH) ./$^ $(NICS) >$@.new && mv -f $@.new $@ eb-roms.h: eb-rom-list.h $(ROM_ZHS) cat $^ >$@.new && mv -f $@.new $@ $E/src/Config: $T Config rm -rf $D $E - tar zxf $T + $(TAR) zxf $T cat Config >>$D/src/Config @ # override many of the settings in Config @@ -36,14 +36,14 @@ eb-roms.h: eb-rom-list.h $(ROM_ZHS) echo "HOST_CC=$(HOSTCC)" >>$D/src/Config echo "CPP=$(CPP)" >>$D/src/Config echo "CC=$(CC)" >>$D/src/Config - echo "AS=$(CC) -c -x assembler -" >>$D/src/Config + echo "AS=$(AS)" >>$D/src/Config echo "LD=$(LD)" >>$D/src/Config echo "SIZE=$(SIZE)" >>$D/src/Config echo "AR=$(AR)" >>$D/src/Config echo "RANLIB=$(RANLIB)" >>$D/src/Config echo "OBJCOPY=$(OBJCOPY)" >>$D/src/Config echo "CFLAGS+=$(CFLAGS)" >>$D/src/Config - echo "ASFLAGS+=$(CFLAGS)" >>$D/src/Config + echo "ASFLAGS+=$(ASFLAGS)" >>$D/src/Config echo "LDFLAGS+=$(LDFLAGS_DIRECT)" >>$D/src/Config @ set -e; cd $D/src/arch/i386; \ @@ -53,7 +53,7 @@ eb-roms.h: eb-rom-list.h $(ROM_ZHS) mv $D $E $E/src/bin/Roms: $E/src/Config - $(MAKE) -C $E/src bin/Roms + PATH=/usr/gnu/bin/:$(PATH) $(MAKE) -C $E/src bin/Roms clean: rm -rf $D $E *.zrom.h eb-rom-list.h eb-roms.h *~ diff --git a/tools/firmware/etherboot/make-eb-rom-list b/tools/firmware/etherboot/make-eb-rom-list --- a/tools/firmware/etherboot/make-eb-rom-list +++ b/tools/firmware/etherboot/make-eb-rom-list @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e roms=$1; shift echo "/* autogenerated - do not edit */" _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Probably should take this patch and then either build no ROMs if not building on Linux, or have a default pre-prepared set of ROMs checked into the repo. -- Keir On 1/2/08 18:21, "John Levon" <levon@movementarian.org> wrote:> On Fri, Feb 01, 2008 at 06:16:47PM +0000, John Levon wrote: > >> With the patch below (at least some of the way), I just get: > > And the patch > > john > > diff --git a/config/StdGNU.mk b/config/StdGNU.mk > --- a/config/StdGNU.mk > +++ b/config/StdGNU.mk > @@ -12,6 +12,7 @@ SIZEUTIL = $(CROSS_COMPILE)size > > MSGFMT = msgfmt > MSGMERGE = msgmerge > +TAR = tar > > INSTALL = install > INSTALL_DIR = $(INSTALL) -d -m0755 -p > diff --git a/config/SunOS.mk b/config/SunOS.mk > --- a/config/SunOS.mk > +++ b/config/SunOS.mk > @@ -11,6 +11,7 @@ SIZEUTIL = $(CROSS_COMPILE)gsize > SIZEUTIL = $(CROSS_COMPILE)gsize > > MSGFMT = gmsgfmt > +TAR = gtar > > SHELL = bash > > diff --git a/tools/firmware/etherboot/Makefile > b/tools/firmware/etherboot/Makefile > --- a/tools/firmware/etherboot/Makefile > +++ b/tools/firmware/etherboot/Makefile > @@ -21,14 +21,14 @@ eb-%.zrom.h: $E/src/Config > mv -f $@.new $@ > > eb-rom-list.h: make-eb-rom-list $E/src/bin/Roms > - ./$^ $(NICS) >$@.new && mv -f $@.new $@ > + PATH=/usr/gnu/bin/:$(PATH) ./$^ $(NICS) >$@.new && mv -f $@.new $@ > > eb-roms.h: eb-rom-list.h $(ROM_ZHS) > cat $^ >$@.new && mv -f $@.new $@ > > $E/src/Config: $T Config > rm -rf $D $E > - tar zxf $T > + $(TAR) zxf $T > cat Config >>$D/src/Config > @ > # override many of the settings in Config > @@ -36,14 +36,14 @@ eb-roms.h: eb-rom-list.h $(ROM_ZHS) > echo "HOST_CC=$(HOSTCC)" >>$D/src/Config > echo "CPP=$(CPP)" >>$D/src/Config > echo "CC=$(CC)" >>$D/src/Config > - echo "AS=$(CC) -c -x assembler -" >>$D/src/Config > + echo "AS=$(AS)" >>$D/src/Config > echo "LD=$(LD)" >>$D/src/Config > echo "SIZE=$(SIZE)" >>$D/src/Config > echo "AR=$(AR)" >>$D/src/Config > echo "RANLIB=$(RANLIB)" >>$D/src/Config > echo "OBJCOPY=$(OBJCOPY)" >>$D/src/Config > echo "CFLAGS+=$(CFLAGS)" >>$D/src/Config > - echo "ASFLAGS+=$(CFLAGS)" >>$D/src/Config > + echo "ASFLAGS+=$(ASFLAGS)" >>$D/src/Config > echo "LDFLAGS+=$(LDFLAGS_DIRECT)" >>$D/src/Config > @ > set -e; cd $D/src/arch/i386; \ > @@ -53,7 +53,7 @@ eb-roms.h: eb-rom-list.h $(ROM_ZHS) > mv $D $E > > $E/src/bin/Roms: $E/src/Config > - $(MAKE) -C $E/src bin/Roms > + PATH=/usr/gnu/bin/:$(PATH) $(MAKE) -C $E/src bin/Roms > > clean: > rm -rf $D $E *.zrom.h eb-rom-list.h eb-roms.h *~ > diff --git a/tools/firmware/etherboot/make-eb-rom-list > b/tools/firmware/etherboot/make-eb-rom-list > --- a/tools/firmware/etherboot/make-eb-rom-list > +++ b/tools/firmware/etherboot/make-eb-rom-list > @@ -1,4 +1,4 @@ > -#!/bin/sh > +#!/bin/bash > set -e > roms=$1; shift > echo "/* autogenerated - do not edit */" > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Friday 01 February 2008 19:21:03 John Levon wrote:> On Fri, Feb 01, 2008 at 06:16:47PM +0000, John Levon wrote: > > With the patch below (at least some of the way), I just get: > > And the patchSee the bottom of this mail for comment.> john > > diff --git a/config/StdGNU.mk b/config/StdGNU.mk > --- a/config/StdGNU.mk > +++ b/config/StdGNU.mk > @@ -12,6 +12,7 @@ SIZEUTIL = $(CROSS_COMPILE)size > > MSGFMT = msgfmt > MSGMERGE = msgmerge > +TAR = tar > > INSTALL = install > INSTALL_DIR = $(INSTALL) -d -m0755 -p > diff --git a/config/SunOS.mk b/config/SunOS.mk > --- a/config/SunOS.mk > +++ b/config/SunOS.mk > @@ -11,6 +11,7 @@ SIZEUTIL = $(CROSS_COMPILE)gsize > SIZEUTIL = $(CROSS_COMPILE)gsize > > MSGFMT = gmsgfmt > +TAR = gtar > > SHELL = bash > > diff --git a/tools/firmware/etherboot/Makefile > b/tools/firmware/etherboot/Makefile --- a/tools/firmware/etherboot/Makefile > +++ b/tools/firmware/etherboot/Makefile > @@ -21,14 +21,14 @@ eb-%.zrom.h: $E/src/Config > mv -f $@.new $@ > > eb-rom-list.h: make-eb-rom-list $E/src/bin/Roms > - ./$^ $(NICS) >$@.new && mv -f $@.new $@ > + PATH=/usr/gnu/bin/:$(PATH) ./$^ $(NICS) >$@.new && mv -f $@.new $@ > > eb-roms.h: eb-rom-list.h $(ROM_ZHS) > cat $^ >$@.new && mv -f $@.new $@ > > $E/src/Config: $T Config > rm -rf $D $E > - tar zxf $T > + $(TAR) zxf $T > cat Config >>$D/src/Config > @ > # override many of the settings in Config > @@ -36,14 +36,14 @@ eb-roms.h: eb-rom-list.h $(ROM_ZHS) > echo "HOST_CC=$(HOSTCC)" >>$D/src/Config > echo "CPP=$(CPP)" >>$D/src/Config > echo "CC=$(CC)" >>$D/src/Config > - echo "AS=$(CC) -c -x assembler -" >>$D/src/Config > + echo "AS=$(AS)" >>$D/src/Config > echo "LD=$(LD)" >>$D/src/Config > echo "SIZE=$(SIZE)" >>$D/src/Config > echo "AR=$(AR)" >>$D/src/Config > echo "RANLIB=$(RANLIB)" >>$D/src/Config > echo "OBJCOPY=$(OBJCOPY)" >>$D/src/Config > echo "CFLAGS+=$(CFLAGS)" >>$D/src/Config > - echo "ASFLAGS+=$(CFLAGS)" >>$D/src/Config > + echo "ASFLAGS+=$(ASFLAGS)" >>$D/src/Config > echo "LDFLAGS+=$(LDFLAGS_DIRECT)" >>$D/src/Config > @ > set -e; cd $D/src/arch/i386; \ > @@ -53,7 +53,7 @@ eb-roms.h: eb-rom-list.h $(ROM_ZHS) > mv $D $E > > $E/src/bin/Roms: $E/src/Config > - $(MAKE) -C $E/src bin/Roms > + PATH=/usr/gnu/bin/:$(PATH) $(MAKE) -C $E/src bin/Roms > > clean: > rm -rf $D $E *.zrom.h eb-rom-list.h eb-roms.h *~ > diff --git a/tools/firmware/etherboot/make-eb-rom-list > b/tools/firmware/etherboot/make-eb-rom-list --- > a/tools/firmware/etherboot/make-eb-rom-list > +++ b/tools/firmware/etherboot/make-eb-rom-list > @@ -1,4 +1,4 @@ > -#!/bin/sh > +#!/bin/bash > set -e > roms=$1; shift > echo "/* autogenerated - do not edit */"This is not ok for *BSD. bash is a third-party package there. Christoph -- AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Christoph Egger writes ("Re: [Xen-devel] getting etherboot compiling"):> This is not ok for *BSD. bash is a third-party package there.I think this is OK in a tool needed for building, surely ? After all you need GCC to build Xen and that''s a third-party package in *BSD too. However, it''s a very simple script and I can''t see anything in it which ought not to work (ie, I think it uses only features in SuSv3). What is the problem that means Solaris /bin/sh doesn''t work ? Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Monday 04 February 2008 16:52:56 Ian Jackson wrote:> Christoph Egger writes ("Re: [Xen-devel] getting etherboot compiling"): > > This is not ok for *BSD. bash is a third-party package there. > > I think this is OK in a tool needed for building, surely ? After all > you need GCC to build Xen and that''s a third-party package in *BSD > too.GCC is in the base system. Install a BSD and have a look.> However, it''s a very simple script and I can''t see anything in it > which ought not to work (ie, I think it uses only features in SuSv3). > What is the problem that means Solaris /bin/sh doesn''t work ?Neither do I. It works with *BSD''s /bin/sh. However, Solaris /bin/sh is a much older bourne shell than on BSD. Christoph _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Mon, Feb 04, 2008 at 03:52:56PM +0000, Ian Jackson wrote:> Christoph Egger writes ("Re: [Xen-devel] getting etherboot compiling"): > > This is not ok for *BSD. bash is a third-party package there. > > I think this is OK in a tool needed for building, surely ? After all > you need GCC to build Xen and that''s a third-party package in *BSD > too. > > However, it''s a very simple script and I can''t see anything in it > which ought not to work (ie, I think it uses only features in SuSv3). > What is the problem that means Solaris /bin/sh doesn''t work ?It''s the variable substitution command, not understand by the ''real'' Bourne shell regards john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
John Levon writes ("Re: [Xen-devel] getting etherboot compiling"):> It''s the variable substitution command, not understand by the ''real'' > Bourne shellYou mean the ${...#...} construction in this line echo " ETHERBOOT_ROM($nic,${makerom#*-p}) \\" ? This is specified in SuSv3 `Shell Command Language'' section 2.6.2 `Parameter Expansion'', final part of the normative text. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Mon, Feb 04, 2008 at 05:07:19PM +0000, Ian Jackson wrote:> John Levon writes ("Re: [Xen-devel] getting etherboot compiling"): > > It''s the variable substitution command, not understand by the ''real'' > > Bourne shell > > You mean the ${...#...} construction in this line > echo " ETHERBOOT_ROM($nic,${makerom#*-p}) \\" > ?Yep.> This is specified in SuSv3 `Shell Command Language'' section 2.6.2 > `Parameter Expansion'', final part of the normative text.Original Bourne shell isn''t SuSv3 (would be hard for that to be true :) Such standards allow a system to provide a way of choosing to opt into them. On Solaris, that involves fiddling with the path to pick the standard variants (adding /usr/xpg4/bin would do it I think). This was because SuS and other standards are incompatible with various bits of historical behaviour. regards john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
John Levon writes ("Re: [Xen-devel] getting etherboot compiling"):> Such standards allow a system to provide a way of choosing to opt into > them. On Solaris, that involves fiddling with the path to pick the > standard variants (adding /usr/xpg4/bin would do it I think). This was > because SuS and other standards are incompatible with various bits of > historical behaviour.Well I think putting #!/usr/xpg4/bin/sh at the top of this script would work even less well. Is there an Official Sun Answer to what #! line should be put at the top of a portable SuSv3 shell script ? As far as I can tell everyone else uses #!/bin/sh for this. As I say, you don''t need to run it now anyway (since Keir has checked in the generated roms.h). Even so, if we have to break someone''s attempts to build after hacking the roms, I''d rather break on where /bin/sh is prehistoric, which seems like an actual bug, rather than systems which don''t have bash or maybe lack /bin/bash as a symlink. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Mon, Feb 04, 2008 at 05:25:53PM +0000, Ian Jackson wrote:> John Levon writes ("Re: [Xen-devel] getting etherboot compiling"): > > Such standards allow a system to provide a way of choosing to opt into > > them. On Solaris, that involves fiddling with the path to pick the > > standard variants (adding /usr/xpg4/bin would do it I think). This was > > because SuS and other standards are incompatible with various bits of > > historical behaviour. > > Well I think putting #!/usr/xpg4/bin/sh at the top of this script > would work even less well.Indeed.> Is there an Official Sun Answer to what #! > line should be put at the top of a portable SuSv3 shell script?Not really. "/usr/bin/env sh" would be closest I suppose, assuming you''ve set up your environment as in standards(5) (that is, set PATH appropriately).> As far as I can tell everyone else uses #!/bin/sh for this.This is rarely true. Most commonly, this means "something that''s kind of like the Bourne shell, but definitely not the Korn or C shell", and often "I actually mean bash".> As I say, you don''t need to run it now anyway (since Keir has checked > in the generated roms.h). Even so, if we have to break someone''s > attempts to build after hacking the roms, I''d rather break on where > /bin/sh is prehistoric, which seems like an actual bug, rather than > systems which don''t have bash or maybe lack /bin/bash as a symlink.Agreed. regards, john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel