[syslinux] [PATCH] nictype.c32: PXELINUX module to display UNDI NIC bus type...

Torgeir.Wulfsberg at kongsberg.com Torgeir.Wulfsberg at kongsberg.com
Mon Nov 26 10:31:42 PST 2012


Nevermind sha0!

I managed to modify nictype.c to work the way I asked for in the last e-mail.
http://pastebin.com/9iiLzhBr

Added something like this.
_________________________________________________________________
char *bootif_str;
char *bootifcommand_str;
char delims[] = ",";
char *result = NULL;

 if (!strncmp(argv[0], "--bootif", sizeof "--bootif")) {
        if (arg + 1 == argc || !argv[1]) {
        fprintf(stderr, "--bootif args not provided\n");
        return usage();
        }
        bootif_str = argv[1];
        ++arg;
        ++argv;
        continue;
    }

    if (!strncmp(argv[0], "--bootifcommand", sizeof "--bootifcommand")) {
        if (arg + 1 == argc || !argv[1]) {
        fprintf(stderr, "--bootifcommand args not provided\n");
        return usage();
        }
        bootifcommand_str = argv[1];
        ++arg;
        ++argv;
        continue;
    }

    // split --bootif 102020202,120020202 from pxelinux label
    // compare strings, boot bootif command if match found
    result = strtok(bootif_str, delims);
    while( result != NULL ) {

        if (strncmp(result, vvvvdddd, sizeof vvvvdddd) == 0 ) {
            printf("Found match... Running command '%s'...\n", bootifcommand_str);
            syslinux_run_command(bootifcommand_str);
        }
        result = strtok( NULL, delims );
    }

_________________________________________________________________

Now I can have this syntax from pxelinux. Just the way I had in mind.
________________________________________________________________________________________________________________________
label install
com32 nictype.c32
append --config --bootif 10222100,10222101,10222102 --bootifcommand images/pxe/ipxe/ipxe.kpxe.0 --fallbackcommand images/pxe/ipxe/ipxe.pxe.0
________________________________________________________________________________________________________________________

--Torgeir
________________________________________
From: Wulfsberg, Torgeir
Sent: Monday, November 26, 2012 10:19 AM
To: Shao Miller
Cc: syslinux at zytor.com
Subject: RE: [syslinux] [PATCH] nictype.c32: PXELINUX module to display UNDI NIC bus type...

Hello Shao!

Did not know that :) Okey then, that worked great.
Knowing, THAT works....

Could't we just have this from pxelinux instead? Dont need any config files at all?

label install
com32 nictype.c32
append --if_vendor_id 00100222 --boot_this ipxe.pxe.0 --or_fallback_to undionly.kpxe.0

Where "--if_vendor_id" tries to match that vendor id we sent as an argument "00100222" and "--boot_this" executes "syslinux_run_command("ipxe.pxe.0")" or fallback to "syslinux_run_command("undionly.kpxe.0")"

Does that makes any sense?

--Torgeir

________________________________________
From: Shao Miller [sha0.miller at gmail.com]
Sent: Monday, November 26, 2012 9:39 AM
To: Wulfsberg, Torgeir; syslinux at zytor.com
Subject: RE: [syslinux] [PATCH] nictype.c32: PXELINUX module to display UNDI NIC bus type...

Hello again, Torgeir.

I'm glad if you enjoy nictype.c32.

You don't need to modify it at all, as you can use the --fallback to execute
undionly.kpxe:

LABEL install
  COM32 nictype.c32
  APPEND --config --fallback undionly.0

Simply rename undionly.kpxe to undionly.0, then PXELINUX will auto-detect it
as a PXE image.  That way, you don't need your nictype.fallback file at all.

- Shao Miller


________________________________

CONFIDENTIALITY
This e-mail and any attachment contain KONGSBERG information which may be proprietary, confidential or subject to export regulations, and is only meant for the intended recipient(s). Any disclosure, copying, distribution or use is prohibited, if not otherwise explicitly agreed with KONGSBERG. If received in error, please delete it immediately from your system and notify the sender properly.




More information about the Syslinux mailing list