Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] PXELinux + Wimboot + MS-RIS -> BUG?
2014-04-01, 08:44 (This post was last modified: 2014-04-01 14:01 by KingBonecrusher.)
Post: #1
[SOLVED] PXELinux + Wimboot + MS-RIS -> BUG?
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 "\"
Find all posts by this user
Quote this message in a reply
2014-04-01, 11:54
Post: #2
RE: PXELinux + Wimboot + MS-RIS -> BUG?
(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
Visit this user's website Find all posts by this user
Quote this message in a reply
2014-04-01, 12:00
Post: #3
RE: PXELinux + Wimboot + MS-RIS -> BUG?
(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.
Find all posts by this user
Quote this message in a reply
2014-04-01, 12:02
Post: #4
RE: PXELinux + Wimboot + MS-RIS -> BUG?
(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
Visit this user's website Find all posts by this user
Quote this message in a reply
2014-04-01, 12:52 (This post was last modified: 2014-04-01 12:53 by KingBonecrusher.)
Post: #5
RE: PXELinux + Wimboot + MS-RIS -> BUG?
(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 :-)
Find all posts by this user
Quote this message in a reply
2014-04-01, 19:30
Post: #6
RE: [SOLVED] PXELinux + Wimboot + MS-RIS -> BUG?
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;
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 7 Guest(s)