iPXE discussion forum
[SOLVED] PXELinux + Wimboot + MS-RIS -> BUG? - Printable Version

+- iPXE discussion forum (https://forum.ipxe.org)
+-- Forum: iPXE user forums (/forumdisplay.php?fid=1)
+--- Forum: General (/forumdisplay.php?fid=2)
+--- Thread: [SOLVED] PXELinux + Wimboot + MS-RIS -> BUG? (/showthread.php?tid=7256)



[SOLVED] PXELinux + Wimboot + MS-RIS -> BUG? - KingBonecrusher - 2014-04-01 08:44

Hi!

I think there is a "BUG" in wimboot. Iam using the same files of pxelinux on a windows based server and on an linux based server. On the linux system wimboot loads everything without any problem, on the windows system it fails with missing bootmgr.exe. After a lot of troubleshooting it could only be the slash and blackslash problem.

Code:
LABEL wimbootpe
menu label WindowsPE
    COM32  pxelinux.cfg\modules\linux.c32
    APPEND pxelinux.cfg\images\loader\wimboot initrdfile=pxelinux.cfg\images\winpe\bootmgr,pxelinux.cfg\images\winpe\bcd,pxeli​nux.cfg\images\winpe\boot.sdi,pxelinux.cfg\images\winpe\boot.wim

This fails to boot on the windows system with missing "bootmgr.exe"! But all files are loaded into memory correctly.

[Image: m4rx794me3t6.jpg]


Code:
LABEL wimbootpe
menu label WindowsPE
    COM32  pxelinux.cfg/modules/linux.c32
    APPEND pxelinux.cfg/images/loader/wimboot initrdfile=pxelinux.cfg/images/winpe/bootmgr,pxelinux.cfg/images/winpe/bcd,pxelinux.cfg/images/winpe/boot.sdi,pxelinux.cfg/images/winpe/boot.wim

Same code with slashes works on the linux system.

I have done a cpio by hand with all necessary files and voila it boots also on the Windows Server. So i think there is a problem with parsing "\"


RE: PXELinux + Wimboot + MS-RIS -> BUG? - mcb30 - 2014-04-01 11:54

(2014-04-01 08:44)KingBonecrusher Wrote:  I think there is a "BUG" in wimboot. Iam using the same files of pxelinux on a windows based server and on an linux based server. On the linux system wimboot loads everything without any problem, on the windows system it fails with missing bootmgr.exe. After a lot of troubleshooting it could only be the slash and blackslash problem.

The "bug" is in syslinux's com32/modules/linux.c, in the code

Code:
    /* Forget the source path */
    target_fname = fname;
    while ((p = strchr(target_fname, '/')))
        target_fname = p + 1;

As can be seen, this code is attempting to find the filename by finding the last '/' character in the path. In the case of a path using backslashes, this will end up with "filenames" such as "pxelinux.cfg\images\winpe\boot.wim" rather than "boot.wim".

Use normal (forward) slashes instead. The use of backslash as a path delimiter is an abomination.

If your Windows server refuses to understand normal slashes as a path delimiter (which is unlikely; the Windows kernel will accept either normal slashes or backslashes), then you can use the "@filename" extension to "initrdfile" to explicitly specify a location. For example (untested):

Code:
LABEL wimbootpe
menu label WindowsPE
    COM32  pxelinux.cfg\modules\linux.c32
    APPEND pxelinux.cfg\images\loader\wimboot initrdfile=pxelinux.cfg\images\winpe\bootmgr@bootmgr,pxelinux.cfg\images\winpe\b​cd@bcd,pxelinux.cfg\images\winpe\boot.sdi@boot.sdi,pxelinux.cfg\images\winpe\boo​t.wim@boot.wim

Michael


RE: PXELinux + Wimboot + MS-RIS -> BUG? - KingBonecrusher - 2014-04-01 12:00

(2014-04-01 11:54)mcb30 Wrote:  
(2014-04-01 08:44)KingBonecrusher Wrote:  I think there is a "BUG" in wimboot. Iam using the same files of pxelinux on a windows based server and on an linux based server. On the linux system wimboot loads everything without any problem, on the windows system it fails with missing bootmgr.exe. After a lot of troubleshooting it could only be the slash and blackslash problem.

The "bug" is in syslinux's com32/modules/linux.c, in the code

Code:
    /* Forget the source path */
    target_fname = fname;
    while ((p = strchr(target_fname, '/')))
        target_fname = p + 1;

As can be seen, this code is attempting to find the filename by finding the last '/' character in the path. In the case of a path using backslashes, this will end up with "filenames" such as "pxelinux.cfg\images\winpe\boot.wim" rather than "boot.wim".

Use normal (forward) slashes instead. The use of backslash as a path delimiter is an abomination.

If your Windows server refuses to understand normal slashes as a path delimiter (which is unlikely; the Windows kernel will accept either normal slashes or backslashes), then you can use the "@filename" extension to "initrdfile" to explicitly specify a location. For example (untested):

Code:
LABEL wimbootpe
menu label WindowsPE
    COM32  pxelinux.cfg\modules\linux.c32
    APPEND pxelinux.cfg\images\loader\wimboot initrdfile=pxelinux.cfg\images\winpe\bootmgr@bootmgr,pxelinux.cfg\images\winpe\b​cd@bcd,pxelinux.cfg\images\winpe\boot.sdi@boot.sdi,pxelinux.cfg\images\winpe\boo​t.wim@boot.wim

Michael

Hi Michael!

Thank you for your fast answer! I was thinking that the files inside the encapsulated cpio are in folders and wimboot creates the basename, but ok that makes also sense for me :-) I will try the "@" sign. I must use an pxelinux 4.06 with initrdfile patch, because a needed software will not boot with 6.02 or ipxe itself.


RE: PXELinux + Wimboot + MS-RIS -> BUG? - mcb30 - 2014-04-01 12:02

(2014-04-01 12:00)KingBonecrusher Wrote:  Thank you for your fast answer! I was thinking that the files inside the encapsulated cpio are in folders and wimboot creates the basename, but ok that makes also sense for me :-) I will try the "@" sign. I must use an pxelinux 4.06 with initrdfile patch, because a needed software will not boot with 6.02 or ipxe itself.

Which needed software doesn't work with iPXE, and what goes wrong?

Michael


RE: PXELinux + Wimboot + MS-RIS -> BUG? - KingBonecrusher - 2014-04-01 12:52

(2014-04-01 12:02)mcb30 Wrote:  
(2014-04-01 12:00)KingBonecrusher Wrote:  Thank you for your fast answer! I was thinking that the files inside the encapsulated cpio are in folders and wimboot creates the basename, but ok that makes also sense for me :-) I will try the "@" sign. I must use an pxelinux 4.06 with initrdfile patch, because a needed software will not boot with 6.02 or ipxe itself.

Which needed software doesn't work with iPXE, and what goes wrong?

Michael

Hi Michael, it is a special internal software. Cannot tell much about this software (freebds or linux based), but with sl6.02 and ipxe it stucks after loading. Cannot debug it, because special software :-(

So it is not the fault of ipxe or sl :-)

WinPE works with the "@"! Great success :-)


RE: [SOLVED] PXELinux + Wimboot + MS-RIS -> BUG? - KingBonecrusher - 2014-04-01 19:30

I`am not a programmer but this works for me...

I`ve added just this to linux.c

Code:
while ((p = strchr(target_fname, '\\')))
           target_fname = p + 1;