[syslinux] [patch] PXE-On-A-Disk: etherboot2ethersel.pl patched for etherboot-5.4.3+dfgs

sobtwmxt sobtwmxt at sdf.lonestar.org
Tue Oct 6 13:25:02 PDT 2009


  PXE-On-A-Disk from
(ftp://ftp.scyld.com/private/jlehan/pxe-on-a-disk.html) was posted on
syslinux mailing list:
http://syslinux.zytor.com/archives/2005-December/006222.html.  It is 
being mentioned by syslinux wiki, or some other documentation of 
syslinux that I currently can't find.

  I tried etherboot2ethersel.pl from PXE-On-A-Disk
(ftp://ftp.scyld.com/private/jlehan/pxe-on-a-disk.html) with
etherboot-5.4.3.  I hope it doesn't matter much that I actually used
Debian source package.  It failed:


    $ ./etherboot2ethersel.pl.orig etherboot-5.4.3+dfsg/src/bin/ TEMPDIR/
    Sorry, couldn't find etherboot-5.4.3+dfsg/src/bin//mlx_ipoib/mt23108.zlilo file, may be a 
    problem with make allzlilos at ./etherboot2ethersel.pl.orig line 
189, <ETHER> line 365.


  I patched etherboot2ethersel.pl to fix it:


    $ ./etherboot2ethersel.pl.patched etherboot-5.4.3+dfsg/src/bin/ 
TEMPDIR/
    Now reading from NIC file and generating SYSLINUX.CFG file
    Done!
    Supported 32 drivers and 273 cards
    (Skipped 8 bad drivers and 13 bad cards)
    (Skipped 52 unrecognizable lines in file)


The patch also adds a -d command line switch.  This switch replaces the
need to edit the script in order to produce debugging information by a
command line switch.


--- etherboot2ethersel.pl.orig  2009-10-06 07:46:08.000000000 +0100
+++ etherboot2ethersel.pl.patched       2009-10-06 10:57:40.000000000 
+0100
@@ -59,17 +59,20 @@

 my $etherdir;
 my $outdir;
+my $debug;

-# This really tests for 2 arguments.
 # Perl array counts always return 1 less than reality.  *shrug*
-if ($#ARGV != 1)
+if (!($#ARGV == 1  ||  $#ARGV == 2  &&  $ARGV[0] eq "-d"))
 {
-       print "Usage: $0 <etherboot-bin-dir> <output-dir>\n";
-       die "Sorry, you need 2 parameters on the command line";
+       print "Usage: $0 [-d] <etherboot-bin-dir> <output-dir>
+       -d is optional. With -d, debugging information is printed 
too.\n";
+       die "Sorry, there must be 2 arguments on the command line\n";
 }

-$etherdir = $ARGV[0];
-$outdir = $ARGV[1];
+if ($#ARGV == 2)
+{ $debug = "true";  $etherdir = $ARGV[1];  $outdir = $ARGV[2]; }
+else  #  $#ARGV == 1
+{ $etherdir = $ARGV[0];  $outdir = $ARGV[1]; }

 my $etherfile;
 my $syscfgfile;
@@ -123,8 +126,7 @@
                ($drivername, $leftover) = 
/^family\s+drivers\/net\/(\S+)/;
                if (defined $drivername)
                {
-                       # Uncomment lines with "###" if you are 
debugging, for more verbosity.
-                       ###print "Found family $drivername\n";
+                       if ($debug)  { print "Found family 
$drivername\n"; }
                        $ntotaldriv ++;
                        $state = 1;
                }
@@ -144,7 +146,7 @@
                        # Skip over bogus entries in the file, that 
aren't really PCI cards
                        if ($pcistring eq "-" || $pcistring eq 
"0x0000,0x0000")
                        {
-                               ###print "Skipping bogus entry 
$cardname ($friendlyname) because it isn't a PCI card\n";
+                               if ($debug)  { print "Skipping bogus 
entry $cardname ($friendlyname) because it isn't a PCI card\n"; }
                                $nbadcard ++;
                                next;
                        }
@@ -157,7 +159,7 @@
                        }
                        else
                        {
-                               ###print "Skipping unrecognizable 
entry $cardname ($friendlyname) with ID of $pcistring\n";
+                               if ($debug)  { print "Skipping 
unrecognizable entry $cardname ($friendlyname) with ID of 
$pcistring\n"; }
                                $nbadcard ++;
                                next;
                        }
@@ -165,8 +167,14 @@
                        if (1 == $state)
                        {
                                # This is the first time we've seen a 
valid PCI card for this driver
-                               ###print "Driver $drivername appears 
valid, now setting it up\n";
+                               if ($debug)  { print "Driver 
$drivername appears valid, now setting it up\n"; }

+                               if ($drivername =~ /\//)
+                               {
+                                       if ($debug)  { print 
"\t$drivername contains the character \"/\" !\n"; } ;
+                                       $drivername =~ s/.*\///;                                        
# filter out the prefix, up and including the last "/" character
+                               }
+
                                # Neuter the driver's name to match 
MS-DOS naming restrictions
                                $driverdosname = $drivername;
                                $driverdosname =~ tr/a-zA-Z0-9//cd;                                     
# filter out non-alphanum chars
@@ -196,7 +204,7 @@
                        }

                        # Write PCI reference as SYSLINUX comment, to 
be later parsed by ethersel
-                       ###print "PCI card of $pcistring ($cardname, $friendlyname) parsed as $pcivend $pcidev and gets driver $drivername 
($driverdosname)\n";
+                       if ($debug)  { print "PCI card of $pcistring ($cardname, $friendlyname) parsed as $pcivend $pcidev and gets driver $drivername ($driverdosname)\n"; }
+                       if ($debug)  { print "PCI card of $pcistring 
($cardname, $friendlyname) parsed as $pcivend $pcidev and gets driver 
$drivername ($driverdosname)\n"; }
                        print SYSCFG "# DEV DID $pcivend:$pcidev 
$drivername\n";
                        $ngoodcard ++;
                        next;


-- sobtwmxt at sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org




More information about the Syslinux mailing list