diff options
-rw-r--r-- | gpxe/Makefile | 26 | ||||
-rwxr-xr-x | gpxe/nictoesel.pl | 26 |
2 files changed, 51 insertions, 1 deletions
diff --git a/gpxe/Makefile b/gpxe/Makefile index 09e03d9d..55f41198 100644 --- a/gpxe/Makefile +++ b/gpxe/Makefile @@ -16,16 +16,21 @@ # Very simple, really... # -TARGETS = gpxelinux.0 +PERL = perl +MKISOFS = mkisofs + +TARGETS = gpxelinux.0 gpxeboot.iso all: $(TARGETS) tidy: + rm -rf gpxeboot clean: tidy dist: $(MAKE) -C src veryclean > /dev/null 2>&1 + rm -f gpxeboot.iso spotless: clean dist rm -f $(TARGETS) @@ -37,3 +42,22 @@ src/bin/undionly.kpxe: ../core/pxelinux.0 gpxelinux.0: src/bin/undionly.kpxe cp -f $< $@ + +src/bin/NIC: + $(MAKE) -C src bin/NIC + +allnics: src/bin/NIC + $(MAKE) -C src `$(PERL) -ne 'chomp; \ + if (m:^family\s.*/([^/\s]+)\s*$$:) { print "bin/$$1.lkrn\n"; }' $<` + +gpxeboot.iso: allnics nictoesel.pl + rm -rf gpxeboot + mkdir -p gpxeboot + cp -f ../core/isolinux.bin gpxeboot/ + $(PERL) nictoesel.pl src/bin/NIC > gpxeboot/isolinux.cfg + cp -f ../com32/modules/ethersel.c32 gpxeboot/ + cp -f src/bin/*.lkrn gpxeboot/ + $(MKISOFS) -q -l -r -J -o $@ \ + -b isolinux.bin -c boot.cat \ + -no-emul-boot -boot-load-size 4 -boot-info-table \ + gpxeboot diff --git a/gpxe/nictoesel.pl b/gpxe/nictoesel.pl new file mode 100755 index 00000000..cbe36b88 --- /dev/null +++ b/gpxe/nictoesel.pl @@ -0,0 +1,26 @@ +#!/usr/bin/perl +# +# Script to convert src/bin/NIC to Ethersel format +# + +print "default ethersel.c32\n"; + +undef $nicname; +%nic = (); + +while (<>) { + if (m:^family\s.*/([^/\s]+)\s*$:) { + $nicname = $1; + } elsif (m:^(\S+)\s+([0-9a-f]+)\,([0-9a-f]+)\s+:) { + $vid = hex $2; + $did = hex $3; + $dev = sprintf("%04x:%04x", $vid, $did); + unless (($vid == 0 || $vid == 0xffff) && $did == $vid) { + if (defined($nicname) && !defined($nic{$dev})) { + print "# DEV DID $dev $nicname.lkrn\n"; + $nic{$dev} = $nicname; + } + } + } +} + |