Andrew Bobulsky | 22 May 2013 19:35
Picon

Re: iPXE server

Adding the list back in to my reply.  Generally on mailing lists like this one, Reply All is a good practice ;)
 
Hello Marcel,
 
The error you're getting is coming from the first line in your script:
 
cpuid --ext 29 && set arch x86
 
Your script as written doesn't actually make use of the ${arch} variable, so you could delete the line, comment it out, or add two pipe characters to the end of the line to tell iPXE to ignore the error and continue executing the script.
 
Commented, it would look like this:
 
#cpuid --ext 29 && set arch x86
 
 
With the pipe operators (to ignore the error), it would look like this:
 
cpuid --ext 29 && set arch x86 ||
 
 
And finally, with the line deleted, your entire script should look like:  
 
#!ipxe
kernel http://192.168.1.254/win7DVD/wimboot
initrd http://192.168.1.254/win7DVD/bootmgr             bootmgr
initrd http://192.168.1.254/win7DVD/boot/bcd            BCD
initrd http://192.168.1.254/win7DVD/boot/boot.sdi       boot.sdi
initrd http://192.168.1.254/win7DVD/sources/boot.wim    boot.wim
imgstat
boot
 
For more general info on how iPXE scripting works, take a look at the online documentation here: http://ipxe.org/scripting
Good luck, and best regards,
Andrew

 
On Wed, May 22, 2013 at 8:34 AM, <m.m_de_vries-f/vm7P8qpiNmR6Xm/wNWPw@public.gmane.org> wrote:
And now with attachment.

Hello Andrew,

Thank you for your extensive answer!

I have copied ipxe.usb to an usb stick. What happened you can see in the attached file.
So after it found theboot.ipxe file it looks on http://ipxe.org/2d80e03b
My boot.ipxe file is:

#!ipxe

cpuid --ext 29 && set arch x86
kernel http://192.168.1.254/win7DVD/wimboot
initrd http://192.168.1.254/win7DVD/bootmgr             bootmgr
initrd http://192.168.1.254/win7DVD/boot/bcd            BCD
initrd http://192.168.1.254/win7DVD/boot/boot.sdi       boot.sdi
initrd http://192.168.1.254/win7DVD/sources/boot.wim    boot.wim
imgstat
boot

So where is written that ipxe has to go to http://ipxe.org/2d80e03b?

Kind regards,
Marcel

----- Oorspronkelijk bericht -----
Van: "Andrew Bobulsky" <rulerof-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Aan: "m m de vries" <m.m_de_vries-f/vm7P8qpiNmR6Xm/wNWPw@public.gmane.org>
Cc: ipxe-devel-Ajx3hB6KsW1nerjlECmc1w@public.gmane.org
Verzonden: Dinsdag 21 mei 2013 03:30:36
Onderwerp: Re: [ipxe-devel] iPXE server


bHello Marcel,

You've asked a lot of questions here, so I'll do my best to answer them inline with your original message.

On Mon, May 20, 2013 at 7:30 AM, < m.m_de_vries-f/vm7P8qpiNmR6Xm/wNWPw@public.gmane.org > wrote:


Hello,

I have set up a pxe-server from which I can install Ubuntu and Windows7. But when I boot PE-environment for installing WIndows it stops with a dis shell. Then I have to make e new script to start the actual installation. That's not what I want. The solution is simple, make a startup script in the boot.wim file and it will start. OK that works. But now comes a problem, whenI want to seperate a Windows 7 home installation from a Windows 7 Pro installation. The problem is that I can only point to the .wim file and than the BCD file wil be loaded. But there is no way to load another BCD file or .wim file.


The BCD and WIM files that you provide to Wimboot can be modified, as it looks like you have done, to start an automatic installation. The important thing to realize here, though, is that wimboot isn't really a utility for installing Windows, it's just designed to help you PXE boot Windows PE in a modular fashion. The contents of the BCD don't have any influence on Windows Setup, so the easiest method for you to create two different Windows PE boot directories, identical in every way except for the boot.wim file. In one boot.wim, pack in your automatic Windows 7 Home setup script. Put them in side-by-side directories such that you can create two iPXE scripts, name the first directory win7home and the second win7pro. Using the example from the wimboot web page, script 1 could be named win7home.ipxe, and script 2 named win7pro.ipxe, that look like this:




win7home.ipxe


#!ipxe
kernel wimboot
initrd win7home/bootmgr bootmgr
initrd win7home/boot/bcd BCD
initrd win7home/boot/boot.sdi boot.sdi
initrd win7home/sources/boot.wim boot.wim
imgstat
boot


win7pro.ipxe



#!ipxe
kernel wimboot
initrd win7pro/bootmgr bootmgr
initrd win7pro/boot/bcd BCD
initrd win7pro/boot/boot.sdi boot.sdi
initrd win7pro/sources/boot.wim boot.wim
imgstat
boot
As the scripts imply, instead of having wimboot in the same folder as bootmgr and the /boot/ folder, you'll have wimboot sitting in a folder with two subfolders, one named win7home, and the other named win7pro, along with the win7home.ipxe and win7pro.ipxe script files.


I tried iPXE but now I have the problem that the client doesn't load boot.ipxe with the http protocol. It persist with the tftp protocol and keeps telling me that it could not find the file. How can I force the client to load the boot.ipxe file with http or load it with tftp. I followed the instructions on http://ipxe.org/wimboot .

When you're at the iPXE command line, in order to keep things as close to the PXE spec as possible, if a protocol isn't specified in your URL, iPXE will use TFTP by default.

I'm not completely certain on this, but usually a command like



chain http://webserver/script.ipxe

will result in any further downloads done by iPXE to use the same protocol that the script itself was downloaded with. However, if you find yourself needing to force iPXE to use a particular protocol, just fill out the full paths in the script itself. Using the win7pro.ipxe script I wrote above, try this instead:



win7pro.ipxe



#!ipxe
kernel http://webserver/wimboot
initrd http://webserver/win7pro/bootmgr bootmgr
initrd http://webserver/win7pro/boot/bcd BCD
initrd http://webserver/win7pro/boot/boot.sdi boot.sdi
initrd http://webserver/win7pro/sources/boot.wim boot.wim
imgstat
boot
That should get the behavior you desire.


Is it possible to start an installation of Windows7 Home and Windows7 Pro from the same pxeserver.
Thank you in advance.

Kind Regards,
Marcel de Vries

We do it all the time ;)

Don't hesitate to mail back if you're at all confused, network booting can be a little tricky when you first get into it! Good luck to you!

Best Regards,
Andrew Bobulsky

<div>
<div>Adding the list back in to my reply.&nbsp; Generally on mailing lists like this one, Reply All is a good practice ;)</div>
<div>&nbsp;</div>
<div>Hello Marcel,</div>
<div>&nbsp;</div>
<div>The error you're getting is coming from the first line in your script:</div>
<div>&nbsp;</div>
<blockquote class="gmail_quote">cpuid --ext 29 &amp;&amp; set arch x86</blockquote>
<div>&nbsp;</div>
<div>Your script as written doesn't actually make use of the ${arch} variable, so you could delete the line, comment it out, or add two pipe characters to the end of the line to tell iPXE to ignore the error and continue executing the script.</div>
<div>&nbsp;</div>
<div>Commented, it would look like this:</div>
<div>&nbsp;</div>
<div>
<blockquote class="gmail_quote">
#cpuid --ext 29 &amp;&amp; set arch x86</blockquote>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>With the pipe operators (to ignore the error), it would look like this:</div>
<div>&nbsp;</div>
<div>
<blockquote class="gmail_quote">
cpuid --ext 29 &amp;&amp; set arch x86 ||</blockquote>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>And finally, with the line deleted,&nbsp;your entire script should look like:&nbsp;&nbsp;</div>
<div>&nbsp;</div>
<blockquote class="gmail_quote">
#!ipxe<br>kernel <a href="http://192.168.1.254/win7DVD/wimboot" target="_blank">http://192.168.1.254/win7DVD/wimboot</a><br> initrd <a href="http://192.168.1.254/win7DVD/bootmgr" target="_blank">http://192.168.1.254/win7DVD/bootmgr</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bootmgr<br>
 initrd <a href="http://192.168.1.254/win7DVD/boot/bcd" target="_blank">http://192.168.1.254/win7DVD/boot/bcd</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BCD<br> initrd <a href="http://192.168.1.254/win7DVD/boot/boot.sdi" target="_blank">http://192.168.1.254/win7DVD/boot/boot.sdi</a> &nbsp; &nbsp; &nbsp; boot.sdi<br>
 initrd <a href="http://192.168.1.254/win7DVD/sources/boot.wim" target="_blank">http://192.168.1.254/win7DVD/sources/boot.wim</a> &nbsp; &nbsp;boot.wim<br> imgstat<br> boot</blockquote>
</div>
</div>
<div>&nbsp;</div>
<div>For more general info on how iPXE scripting works, take a look at the online documentation here: <a href="http://ipxe.org/scripting">http://ipxe.org/scripting</a><br>
</div>
<div>Good luck, and best regards,</div>
<div>Andrew</div>
<div>
<br>&nbsp;</div>
<div class="gmail_quote">On Wed, May 22, 2013 at 8:34 AM,  <span dir="ltr">&lt;<a href="mailto:m.m_de_vries@..." target="_blank">m.m_de_vries@...</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">And now with attachment.<br><div class="HOEnZb"><div class="h5">
<br>
Hello Andrew,<br><br>
Thank you for your extensive answer!<br><br>
I have copied ipxe.usb to an usb stick. What happened you can see in the attached file.<br>
So after it found theboot.ipxe file it looks on <a href="http://ipxe.org/2d80e03b" target="_blank">http://ipxe.org/2d80e03b</a><br>
My boot.ipxe file is:<br><br>
#!ipxe<br><br>
cpuid --ext 29 &amp;&amp; set arch x86<br>
kernel <a href="http://192.168.1.254/win7DVD/wimboot" target="_blank">http://192.168.1.254/win7DVD/wimboot</a><br>
initrd <a href="http://192.168.1.254/win7DVD/bootmgr" target="_blank">http://192.168.1.254/win7DVD/bootmgr</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bootmgr<br>
initrd <a href="http://192.168.1.254/win7DVD/boot/bcd" target="_blank">http://192.168.1.254/win7DVD/boot/bcd</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BCD<br>
initrd <a href="http://192.168.1.254/win7DVD/boot/boot.sdi" target="_blank">http://192.168.1.254/win7DVD/boot/boot.sdi</a> &nbsp; &nbsp; &nbsp; boot.sdi<br>
initrd <a href="http://192.168.1.254/win7DVD/sources/boot.wim" target="_blank">http://192.168.1.254/win7DVD/sources/boot.wim</a> &nbsp; &nbsp;boot.wim<br>
imgstat<br>
boot<br><br>
So where is written that ipxe has to go to <a href="http://ipxe.org/2d80e03b" target="_blank">http://ipxe.org/2d80e03b</a>?<br><br>
Kind regards,<br>
Marcel<br><br>
----- Oorspronkelijk bericht -----<br>
Van: "Andrew Bobulsky" &lt;<a href="mailto:rulerof@...">rulerof@...</a>&gt;<br>
Aan: "m m de vries" &lt;<a href="mailto:m.m_de_vries@...">m.m_de_vries@...</a>&gt;<br>
Cc: <a href="mailto:ipxe-devel@...">ipxe-devel@...</a><br>
Verzonden: Dinsdag 21 mei 2013 03:30:36<br>
Onderwerp: Re: [ipxe-devel] iPXE server<br><br><br>
bHello Marcel,<br><br>
You've asked a lot of questions here, so I'll do my best to answer them inline with your original message.<br><br>
On Mon, May 20, 2013 at 7:30 AM, &lt; <a href="mailto:m.m_de_vries <at> online.nl">m.m_de_vries@...</a> &gt; wrote:<br><br><br>
Hello,<br><br>
I have set up a pxe-server from which I can install Ubuntu and Windows7. But when I boot PE-environment for installing WIndows it stops with a dis shell. Then I have to make e new script to start the actual installation. That's not what I want. The solution is simple, make a startup script in the boot.wim file and it will start. OK that works. But now comes a problem, whenI want to seperate a Windows 7 home installation from a Windows 7 Pro installation. The problem is that I can only point to the .wim file and than the BCD file wil be loaded. But there is no way to load another BCD file or .wim file.<br><br><br>
The BCD and WIM files that you provide to Wimboot can be modified, as it looks like you have done, to start an automatic installation. The important thing to realize here, though, is that wimboot isn't really a utility for installing Windows, it's just designed to help you PXE boot Windows PE in a modular fashion. The contents of the BCD don't have any influence on Windows Setup, so the easiest method for you to create two different Windows PE boot directories, identical in every way except for the boot.wim file. In one boot.wim, pack in your automatic Windows 7 Home setup script. Put them in side-by-side directories such that you can create two iPXE scripts, name the first directory win7home and the second win7pro. Using the example from the wimboot web page, script 1 could be named win7home.ipxe, and script 2 named win7pro.ipxe, that look like this:<br><br><br><br><br>
win7home.ipxe<br><br><br>
#!ipxe<br>
kernel wimboot<br>
initrd win7home/bootmgr bootmgr<br>
initrd win7home/boot/bcd BCD<br>
initrd win7home/boot/boot.sdi boot.sdi<br>
initrd win7home/sources/boot.wim boot.wim<br>
imgstat<br>
boot<br><br><br>
win7pro.ipxe<br><br><br><br>
#!ipxe<br>
kernel wimboot<br>
initrd win7pro/bootmgr bootmgr<br>
initrd win7pro/boot/bcd BCD<br>
initrd win7pro/boot/boot.sdi boot.sdi<br>
initrd win7pro/sources/boot.wim boot.wim<br>
imgstat<br>
boot<br>
As the scripts imply, instead of having wimboot in the same folder as bootmgr and the /boot/ folder, you'll have wimboot sitting in a folder with two subfolders, one named win7home, and the other named win7pro, along with the win7home.ipxe and win7pro.ipxe script files.<br><br><br>
I tried iPXE but now I have the problem that the client doesn't load boot.ipxe with the http protocol. It persist with the tftp protocol and keeps telling me that it could not find the file. How can I force the client to load the boot.ipxe file with http or load it with tftp. I followed the instructions on <a href="http://ipxe.org/wimboot" target="_blank">http://ipxe.org/wimboot</a> .<br><br>
When you're at the iPXE command line, in order to keep things as close to the PXE spec as possible, if a protocol isn't specified in your URL, iPXE will use TFTP by default.<br><br>
I'm not completely certain on this, but usually a command like<br><br><br><br>
chain <a href="http://webserver/script.ipxe" target="_blank">http://webserver/script.ipxe</a><br><br>
will result in any further downloads done by iPXE to use the same protocol that the script itself was downloaded with. However, if you find yourself needing to force iPXE to use a particular protocol, just fill out the full paths in the script itself. Using the win7pro.ipxe script I wrote above, try this instead:<br><br><br><br>
win7pro.ipxe<br><br><br><br>
#!ipxe<br>
kernel <a href="http://webserver/wimboot" target="_blank">http://webserver/wimboot</a><br>
initrd <a href="http://webserver/win7pro/bootmgr" target="_blank">http://webserver/win7pro/bootmgr</a> bootmgr<br>
initrd <a href="http://webserver/win7pro/boot/bcd" target="_blank">http://webserver/win7pro/boot/bcd</a> BCD<br>
initrd <a href="http://webserver/win7pro/boot/boot.sdi" target="_blank">http://webserver/win7pro/boot/boot.sdi</a> boot.sdi<br>
initrd <a href="http://webserver/win7pro/sources/boot.wim" target="_blank">http://webserver/win7pro/sources/boot.wim</a> boot.wim<br>
imgstat<br>
boot<br>
That should get the behavior you desire.<br><br><br>
Is it possible to start an installation of Windows7 Home and Windows7 Pro from the same pxeserver.<br>
Thank you in advance.<br><br>
Kind Regards,<br>
Marcel de Vries<br><br>
We do it all the time ;)<br><br>
Don't hesitate to mail back if you're at all confused, network booting can be a little tricky when you first get into it! Good luck to you!<br><br>
Best Regards,<br>
Andrew Bobulsky </div></div>
</blockquote>
</div>
<br>
</div>
Gruher, Joseph R | 22 May 2013 01:46
Picon
Favicon

using iPXE in a VM

Hello-

 

I am trying to use iPXE with a VM in VMWare ESXi 5.1.  For the most part it seems to be working.  I created a VM with an emulated e1000 network adapter and an iPXE ROM.  I edited the VM to use the iPXE ROM for the network adapter BIOS.  When I start the VM iPXE comes up and I can enter the CLI.  I can configure an IP and successfully sanhook a target.  The next step I then want to do is exit iPXE and boot into an OS installer CD to install my guest OS on the VM.  However, after I run the “exit” command in iPXE, nothing happens, it does not continue to the next boot device.

 

I’ve done something similar on physical hardware and it works well, although in that case I’m booting iPXE from a USB key, rather than as the NIC ROM, but otherwise the process is the same and works. 

 

Even here on the VM, if I do not CTRL-B to the iPXE CLI and just let it execute the default iPXE behavior, it will bring up iPXE and look for PXE servers, and then fall through to the OS installer CD just fine, exactly as desired.  So my boot order seems to work.  It is only if I CTRL-B to the CLI and then try to exit that it hangs.  It just sits there after the exit command forever and never moves on in the VM BIOS boot order.

 

Anyone else run into this problem?  Any thoughts on how I might get this to work?  Thanks!

 

-Joe

 

(Attempting to attach a screenshot.)

 

<div>
<div class="WordSection1">
<p class="MsoNormal">Hello-<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">I am trying to use iPXE with a VM in VMWare ESXi 5.1.&nbsp; For the most part it seems to be working.&nbsp; I created a VM with an emulated e1000 network adapter and an iPXE ROM.&nbsp; I edited the VM to use the iPXE ROM for the network adapter BIOS.&nbsp;
 When I start the VM iPXE comes up and I can enter the CLI.&nbsp; I can configure an IP and successfully sanhook a target.&nbsp; The next step I then want to do is exit iPXE and boot into an OS installer CD to install my guest OS on the VM.&nbsp; However, after I run the
 &ldquo;exit&rdquo; command in iPXE, nothing happens, it does not continue to the next boot device.<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">I&rsquo;ve done something similar on physical hardware and it works well, although in that case I&rsquo;m booting iPXE from a USB key, rather than as the NIC ROM, but otherwise the process is the same and works.&nbsp;
<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Even here on the VM, if I do not CTRL-B to the iPXE CLI and just let it execute the default iPXE behavior, it will bring up iPXE and look for PXE servers, and then fall through to the OS installer CD just fine, exactly as desired.&nbsp; So my
 boot order seems to work.&nbsp; It is only if I CTRL-B to the CLI and then try to exit that it hangs.&nbsp; It just sits there after the exit command forever and never moves on in the VM BIOS boot order.<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Anyone else run into this problem?&nbsp; Any thoughts on how I might get this to work?&nbsp; Thanks!<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">-Joe<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">(Attempting to attach a screenshot.)<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><p></p></p>
</div>
</div>
m.m_de_vries | 20 May 2013 13:30
Picon
Favicon

iPXE server

Hello,

I have set up a pxe-server from which I can install Ubuntu and Windows7. But when I boot PE-environment for
installing WIndows it stops with a dis shell. Then I have to make e new script to start the actual
installation. That's not what I want. The solution is simple, make a startup script in the boot.wim file
and it will start. OK that works. But now comes a problem, whenI want to seperate a Windows 7 home
installation from a Windows 7 Pro installation. The problem is that I can only point to the .wim file and
than the BCD file wil be loaded. But there is no way to load another BCD file or .wim file. I tried iPXE but now I
have the problem that the client doesn't load boot.ipxe with the http protocol. It persist with the tftp
protocol and keeps telling me that it could not find the file. 
 How can I force the client to load the boot.ipxe file with http or load it with tftp. I followed the
instructions on http://ipxe.org/wimboot. Is it possible to start an installation of Windo
 ws7 Home and Windows7 Pro from the same pxeserver.
Thank you in advance.

Kind Regards,
Marcel de Vries
Gray, Michael E. | 15 May 2013 22:34

iPXE help

We area Church / School who would like to utilize the IPXE boot options, preferably off a USB drive.  We are well versed in DOS, WINDOWS not Linux however.  Is there any way to gather a image for a USB thumb drive and be able to edit the script file to boot from a specified location. Thank you.

 

 

 

Michael E. Gray

IT Specialist,

Calvary Chapel of Philadelphia /

Calvary Christian Academy

 

<div><div class="WordSection1">
<p class="MsoNormal">We area Church / School who would like to utilize the IPXE boot options, preferably off a USB drive.&nbsp; We are well versed in DOS, WINDOWS not Linux however.&nbsp; Is there any way to gather a image for a USB thumb drive and be able to edit the script file to boot from a specified location. Thank you.<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Michael E. Gray<p></p></p>
<p class="MsoNormal">IT Specialist,<p></p></p>
<p class="MsoNormal">Calvary Chapel of Philadelphia /<p></p></p>
<p class="MsoNormal">Calvary Christian Academy<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
</div></div>
Frediano Ziglio | 14 May 2013 15:06

[PATCH] Fix wrong pointer offset in undiloader.S

From: Frediano Ziglio <frediano.ziglio@...>

This fix commit 24226472b2fa07d014bef62e308095a69de8a106 bug.
A push instruction was inserted without modifying offset of stack.
This lead to reboot when you try to load UNDI stack.

Signed-off-by: Frediano Ziglio <frediano.ziglio@...>
---
 src/arch/i386/prefix/undiloader.S |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/arch/i386/prefix/undiloader.S b/src/arch/i386/prefix/undiloader.S
index ccdd816..74bb590 100644
--- a/src/arch/i386/prefix/undiloader.S
+++ b/src/arch/i386/prefix/undiloader.S
 <at>  <at>  -23,8 +23,8  <at>  <at>  undiloader:
 	popw	%ds
 	/* UNDI loader parameter structure address into %es:%di */
 	movw	%sp, %bx
-	movw	%ss:18(%bx), %di
-	movw	%ss:20(%bx), %es
+	movw	%ss:22(%bx), %di
+	movw	%ss:24(%bx), %es
 	/* Install to specified real-mode addresses */
 	pushw	%di
 	movw	%es:12(%di), %bx
--

-- 
1.7.9.5

Jarrod Johnson | 13 May 2013 21:20
Picon

bootmgfw.efi and simple filesystem support


Has anyone tried to get windows to do http transfer of wim using simple filesystem support?  It seems that bootmgfw.efi has it's heart set on tftp loading content if the loaded image suggests the boot device is PXE-capable.
<div><div dir="ltr">
<div><br></div>
<div>Has anyone tried to get windows to do http transfer of wim using simple filesystem support?&nbsp; It seems that bootmgfw.efi has it's heart set on tftp loading content if the loaded image suggests the boot device is PXE-capable.<br>
</div>
</div></div>
Frediano Ziglio | 13 May 2013 16:59

[PATCH] Fix loading tftp file from pxe bios call

From 1827c48034d2387819629c4b28d7c2910b5d889b Mon Sep 17 00:00:00 2001
From: Frediano Ziglio <frediano.ziglio@...>
Date: Mon, 13 May 2013 15:58:32 +0100
Subject: [PATCH] Fix loading tftp file from pxe bios call

If filename contained '#' tftp does not load correctly file cause url was not
quoted correctly.

This patch actually fix two paths in the code that require quoting filename:
- loading file from dhcp;
- loading file from PXE calls.

Signed-off-by: Frediano Ziglio <frediano.ziglio@...>
---
 src/arch/i386/interface/pxe/pxe_tftp.c |   13 ++++++++++---
 src/usr/autoboot.c                     |    8 +++++---
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/arch/i386/interface/pxe/pxe_tftp.c b/src/arch/i386/interface/pxe/pxe_tftp.c
index f4801ba..90599fd 100644
--- a/src/arch/i386/interface/pxe/pxe_tftp.c
+++ b/src/arch/i386/interface/pxe/pxe_tftp.c
 <at>  <at>  -31,6 +31,8  <at>  <at>  FILE_LICENCE ( GPL2_OR_LATER );
 #include <byteswap.h>
 #include <ipxe/uaccess.h>
 #include <ipxe/in.h>
+#include <ipxe/uri.h>
+#include <ipxe/vsprintf.h>
 #include <ipxe/tftp.h>
 #include <ipxe/iobuf.h>
 #include <ipxe/xfer.h>
 <at>  <at>  -174,6 +176,7  <at>  <at>  static int pxe_tftp_open ( uint32_t ipaddress, unsigned int port,
 			   const unsigned char *filename, size_t blksize,
 			   int sizeonly ) {
 	char uri_string[PXE_TFTP_URI_LEN];
+	ssize_t len;
 	struct in_addr address;
 	int rc;

 <at>  <at>  -189,10 +192,14  <at>  <at>  static int pxe_tftp_open ( uint32_t ipaddress, unsigned int port,
 	address.s_addr = ipaddress;
 	if ( ! port )
 		port = htons ( TFTP_PORT );
-	snprintf ( uri_string, sizeof ( uri_string ), "tftp%s://%s:%d%s%s",
+	len = snprintf ( uri_string, sizeof ( uri_string ), "tftp%s://%s:%d%s",
 		   sizeonly ? "size" : "", inet_ntoa ( address ),
-		   ntohs ( port ), ( ( filename[0] == '/' ) ? "" : "/" ),
-		   filename );
+		   ntohs ( port ), ( ( filename[0] == '/' ) ? "" : "/" ) );
+	len += uri_encode( (const char *) filename, uri_string + len, sizeof ( uri_string ) - len, URI_PATH);
+	if ( len >= (ssize_t) sizeof ( uri_string ) ) {
+		return -ENAMETOOLONG;
+	}
+	uri_string[len] = 0;
 	DBG ( " %s", uri_string );

 	/* Open PXE TFTP connection */
diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c
index b2d288e..4359dfe 100644
--- a/src/usr/autoboot.c
+++ b/src/usr/autoboot.c
 <at>  <at>  -91,9 +91,10  <at>  <at>  static struct net_device * find_boot_netdev ( void ) {
  */
 static struct uri * parse_next_server_and_filename ( struct in_addr next_server,
 						     const char *filename ) {
-	char buf[ 23 /* "tftp://xxx.xxx.xxx.xxx/" */ + strlen ( filename )
+	char buf[ 23 /* "tftp://xxx.xxx.xxx.xxx/" */ + 3 * strlen ( filename )
 		  + 1 /* NUL */ ];
 	struct uri *uri;
+	int len;

 	/* Parse filename */
 	uri = parse_uri ( filename );
 <at>  <at>  -108,8 +109,9  <at>  <at>  static struct uri * parse_next_server_and_filename ( struct in_addr next_server,
 	 */
 	if ( next_server.s_addr && filename[0] && ! uri_is_absolute ( uri ) ) {
 		uri_put ( uri );
-		snprintf ( buf, sizeof ( buf ), "tftp://%s/%s",
-			   inet_ntoa ( next_server ), filename );
+		len = snprintf ( buf, sizeof ( buf ), "tftp://%s%s",
+			   inet_ntoa ( next_server ), ( filename[0] == '/' ) ? "" : "/" );
+		uri_encode( filename, buf + len, sizeof ( buf ) - len, URI_PATH);
 		uri = parse_uri ( buf );
 		if ( ! uri )
 			return NULL;
--

-- 
1.7.9.5

Gruher, Joseph R | 10 May 2013 03:12
Picon
Favicon

Install RHEL to iSCSI Target and Boot From iPXE

Hello-

 

I am trying to boot RHEL6.4 over iSCSI using iPXE to start the boot process.  I’ve done this before on boards which had BIOS iSCSI boot support and it works fine so I know RHEL6.4 supports iSCSI boot.  However, I can’t quite seem to get it to work with iPXE. 

 

My process is:

1.       Boot RHEL installer from ISO

2.       Mount iSCSI target using iSCSI support in installer GUI

3.       Install RHEL as usual, no special settings

4.       Reboot and boot from iPXE on USB key

5.       Use iPXE script to configure network interface and sanboot from iSCSI target

 

It almost works… iPXE is able to configure the network and connect the target and begin the boot process.  I can actually see RHEL loading for a while so I know boot has begun.  However, before boot completes, it crashes as shown in the attached screenshot.  My theory is this is happening when the iSCSI connection is handed off from iPXE to the native iSCSI initiator in RHEL, but that is just a guess, I don’t really have any evidence for that being the case. 

 

Is this a known problem?  Any known tips or tricks or workarounds I might try?

 

Thanks!

 

-Joe

 

<div>
<div class="WordSection1">
<p class="MsoNormal">Hello-<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">I am trying to boot RHEL6.4 over iSCSI using iPXE to start the boot process.&nbsp; I&rsquo;ve done this before on boards which had BIOS iSCSI boot support and it works fine so I know RHEL6.4 supports iSCSI boot.&nbsp; However, I can&rsquo;t quite seem to get
 it to work with iPXE.&nbsp; <p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">My process is:<p></p></p>
<p class="MsoListParagraph"><span>1.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span>Boot RHEL installer from ISO<p></p></p>
<p class="MsoListParagraph"><span>2.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span>Mount iSCSI target using iSCSI support in installer GUI<p></p></p>
<p class="MsoListParagraph"><span>3.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span>Install RHEL as usual, no special settings<p></p></p>
<p class="MsoListParagraph"><span>4.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span>Reboot and boot from iPXE on USB key<p></p></p>
<p class="MsoListParagraph"><span>5.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span>Use iPXE script to configure network interface and sanboot from iSCSI target<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">It almost works&hellip; iPXE is able to configure the network and connect the target and begin the boot process.&nbsp; I can actually see RHEL loading for a while so I know boot has begun.&nbsp; However, before boot completes, it crashes as shown in the
 attached screenshot.&nbsp; My theory is this is happening when the iSCSI connection is handed off from iPXE to the native iSCSI initiator in RHEL, but that is just a guess, I don&rsquo;t really have any evidence for that being the case.&nbsp;
<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Is this a known problem?&nbsp; Any known tips or tricks or workarounds I might try?<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Thanks!<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">-Joe<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><p></p></p>
</div>
</div>
Sven Dreyer | 8 May 2013 21:02
Picon

https does not work - but only on a single system

Hi list,

I have a problem with https access in current iPXE when booting it via 
PXE on an Alix 2c3 (embedded x86 hardware, see 
http://pcengines.ch/alix2c3.htm ).

Quite strange:
1) if I point iPXE to an http URI, it works flawless on the Alix (and on 
all other systems, too)
2) if I point iPXE to an https URI instead, it throws error 0216e63c 
(see below) - but ONLY on the Alix! The exact same setup (which means 
the same iPXE executable delivered over PXE) works works like a charm in 
VirtualBox and on all physical systems (32 and 64 bits) I tried it on.

Anybody any hint or idea?

Thanks in advance,
Sven

<snip (captured via serial console)>
Intel UNDI, PXE-2.0 (build 082)
Copyright (C) 1997,1998,1999  Intel Corporation
VIA Rhine III Management Adapter v2.43 (2005/12/15)

CLIENT MAC ADDR: 00 0D B9 XX XX XX
CLIENT IP: 10.1.1.2  MASK: 255.255.255.0  DHCP IP: 10.1.1.1
GATEWAY IP: 10.1.1.1
PXE->EB: !PXE at 9E2E:0070, entry point at 9E2E:0106
          UNDI code segment 9E2E:1966, data segment 94BD:9710 (594-640kB)
          UNDI device is PCI 00:09.0, type DIX+802.3
          594kB free base memory after PXE unload
iPXE initialising devices...ok

iPXE 1.0.0+ (8bc2) -- Open Source Network Boot Firmware -- http://ipxe.org
Features: HTTP HTTPS iSCSI DNS bzImage ELF PXE PXEXT Menu
net0: 00:0d:b9:XX:XX:XX using undionly on UNDI-PCI00:09.0 (open)
   [Link:up, TX:0 TXE:0 RX:0 RXE:0]
DHCP (net0 00:0d:b9:13:43:04)... ok
net0: 10.1.1.2/255.255.255.0 gw 10.1.1.1
Filename:

https://my.server/cgi-bin/ipxe/ipxe.cgi?i=${netX/ip}&m=${netX/mac:hexhyp}&v=${manufacturer:uristring}&p=${product:uristring
https://my.server/cgi-bin/ipxe/ipxe.cgi?i=10.1.1.2&m=00-0d-b9-XX-XX-XX&v=&p=%24%7Bproduct%3Auristring... 
Permission denied (http://ipxe.org/0216e63c)
</snip>
Torgeir W | 4 May 2013 21:15
Picon

get mac from ipxe in different format (no delimiter at all)

Hi!

I found myself in need of getting the mac from iPXE with no delimiter at 
all.
Sanboot with the MAC address (no delimited), in an embedded script 
within iPXE.

Usage:
iPXE> show mac
net0/mac:hex 00:aa:11:bb:22:cc

iPXE> show mac:hexhyp
net0/mac:hexhyp 00-aa-11-bb-22-cc

# hex no delimiter
iPXE> show mac:hexnd
net0/mac:hexnd 00aa11bb22cc

So I made myself a little patch for this (don't know if anyone else 
would ever need it..., or if you could call copy/paste with small name 
modifications a patch), but here it goes...

settings.c.patch
--- a/src/core/settings.c    2013-05-04 12:41:09.828764000 +0200
  +++ b/src/core/settings.cc    2013-05-04 12:39:54.476391000 +0200
   <at>  <at>  -1770,6 +1770,20  <at>  <at> 
      return format_hex_setting ( raw, raw_len, buf, len, "-" );
  }

  +/**
  + * Format hex string setting value (using no delimiter)
  + *
  + *  <at> v raw        Raw setting value
  + *  <at> v raw_len        Length of raw setting value
  + *  <at> v buf        Buffer to contain formatted value
  + *  <at> v len        Length of buffer
  + *  <at> ret len        Length of formatted value, or negative error
  + */
  +static int format_hex_no_delimiter_setting ( const void *raw, size_t 
raw_len,
  +                       char *buf, size_t len ) {
  +    return format_hex_setting ( raw, raw_len, buf, len, "" );
  +}
  +
  /** A hex-string setting (colon-delimited) */
  struct setting_type setting_type_hex __setting_type = {
      .name = "hex",
   <at>  <at>  -1784,6 +1798,13  <at>  <at> 
      .format = format_hex_hyphen_setting,
  };

  +/** A hex-string setting (no delimiter) */
  +struct setting_type setting_type_hex_no_delimiter __setting_type = {
  +    .name = "hexnd",
  +    .parse = parse_hex_setting,
  +    .format = format_hex_no_delimiter_setting,
  +};
  +
  /**
    * Parse UUID setting value
    *

settings.h.patch
--- a/src/ipxe/include/settings.h    2013-05-04 12:41:09.928765000 +0200
  +++ b/src/ipxe/include/settings.hh    2013-05-04 12:39:21.272226000 +0200
   <at>  <at>  -322,6 +322,7  <at>  <at> 
  extern struct setting_type setting_type_uint32 __setting_type;
  extern struct setting_type setting_type_hex __setting_type;
  extern struct setting_type setting_type_hexhyp __setting_type;
  +extern struct setting_type setting_type_hex_no_delimiter __setting_type;
  extern struct setting_type setting_type_uuid __setting_type;

  extern struct setting ip_setting __setting ( SETTING_IPv4 );

Torgeir
sxiprateek | 1 May 2013 03:49
Picon
Gravatar

configure ipxe to boot from alternative port ie1067 and 1068

sir
i am using drbl on alternative port & using ipxe to boot my clients but 
if my server is on alternative dhcp porth then how cai i tell ipxe to 
boot form it

as the default dhcp port is 67 and 68 but my dhcp server is on port 1067 
and 1068

--
prateek

Gmane