<div dir="ltr">Well, the purpose of this what we call bootdisk provisioning is actually avoid PXE and also DHCP. Users download bootdisks with embedded scripts that contain network IP/GW/DNS so no PXE or DHCP is actually required.<div><br></div><div>I was pointed to a commit that should allow such an integration via command line (<a href="https://git.ipxe.org/ipxe.git/commit/9913a405ea151706770559d42e758bc2c1da8525">https://git.ipxe.org/ipxe.git/commit/9913a405ea151706770559d42e758bc2c1da8525</a>) but I struggle to verify this. I am getting "error: invalid magic number" when I attempt to boot it via linuxefi:</div><div><br></div><div>menuentry "Chainload iPXE B" {<br></div><div> search --no-floppy --set=root -f /ipxe.efi</div><div> linuxefi ($root)/ipxe.efi chain file:script</div><div>}</div><div><br></div><div>Am I doing this right?</div><div><br></div><div>If I remove Grub2 and try to boot directly (e.g. creating a FAT32 image putting it into correct CDROM section), I don't believe there is any chance to inject the script dynamically and the only option would be to embed the script when building, which is exactly what I want to avoid :-(</div><div><br></div><div>LZ</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-12-02 11:26 GMT+01:00 Hummel Frank <span dir="ltr"><<a href="mailto:F.Hummel@ads-tec.de" target="_blank">F.Hummel@ads-tec.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I do that via DHCP server configuration.<br>
Legacy (Syslinux) and IPXE clients use different user-classes.<br>
Legacy and UEFI use different architectures.<br>
As IPXE initiates a new DHCP request you have to break the boot-loop by detecting the iPXE user-class<br>
<br>
Shortened code snippet from my dhcpd.conf:<br>
*.ipxe files are the scripts for iPXE.<br>
No scripts embedded in ipxe.lkrn<br>
------------------------------<wbr>------------------------------<wbr>-----<br>
<br>
filename "/pxelinux.0"; # user selects in Syslinux menu "default" to continue in Syslinux mode or chain to iPXE via<br>
# KERNEL ipxe/ipxe.lkrn<br>
# APPEND dhcp && chain <a href="http://111.222.333.444/ipxe/boot.ipxe" rel="noreferrer" target="_blank">http://111.222.333.444/ipxe/<wbr>boot.ipxe</a><br>
if exists user-class {<br>
if option user-class = "iPXE" {<br>
# legacy menu ipxe<br>
filename "<a href="http://111.222.333.444/boot.ipxe" rel="noreferrer" target="_blank">http://111.222.333.444/boot.<wbr>ipxe</a>";<br>
}<br>
}<br>
# UEFI menu ipxe<br>
if option arch = 00:07 {<br>
if exists user-class {<br>
if option user-class = "iPXE" {<br>
filename "/ipxe/efi/bootefi.ipxe";<br>
}<br>
}<br>
}<br>
<br>
<br>
mit freundlichen Grüßen<br>
with kind regards<br>
<br>
i. A. Dipl.Ing. (FH) Frank Hummel<br>
Systementwicklung<br>
System development<br>
<br>
ads-tec GmbH<br>
Heinrich-Hertz Str. 1<br>
72622 Nürtingen<br>
Germany<br>
<br>
Tel.: <a href="tel:%2B49%207022%202522-2412" value="+49702225222412">+49 7022 2522-2412</a><br>
Fax: <a href="tel:%2B49%207022%202522-400" value="+4970222522400">+49 7022 2522-400</a><br>
E-Mail: <a href="mailto:F.Hummel@ads-tec.de">F.Hummel@ads-tec.de</a><br>
Web: <a href="http://www.ads-tec.de" rel="noreferrer" target="_blank">www.ads-tec.de</a><br>
<br>
-----Ursprüngliche Nachricht-----<br>
Von: <a href="mailto:ipxe-devel-bounces@lists.ipxe.org">ipxe-devel-bounces@lists.ipxe.<wbr>org</a> [mailto:<a href="mailto:ipxe-devel-bounces@lists.ipxe.org">ipxe-devel-bounces@<wbr>lists.ipxe.org</a>] Im Auftrag von Martin Habets<br>
Gesendet: Freitag, 2. Dezember 2016 10:28<br>
An: <a href="mailto:ipxe-devel@lists.ipxe.org">ipxe-devel@lists.ipxe.org</a><br>
Betreff: Re: [ipxe-devel] Script embedding in EFI environment<br>
<div><div class="h5"><br>
Maybe you could use DHCP option 209?<br>
<a href="https://tools.ietf.org/html/rfc5071#section-4" rel="noreferrer" target="_blank">https://tools.ietf.org/html/<wbr>rfc5071#section-4</a><br>
<br>
Martin<br>
<br>
On 01/12/16 15:49, Lukas Zapletal wrote:<br>
> Hello,<br>
><br>
> our project (<a href="http://www.theforeman.org" rel="noreferrer" target="_blank">www.theforeman.org</a> <<a href="http://www.theforeman.org" rel="noreferrer" target="_blank">http://www.theforeman.org</a>>) provides functionality to generate bootdisk for individual hosts. These are either iPXE or SYSLINUX based. The iPXE version does load the kernel/initramdisk directly via HTTP, the SYSLINUX has embedded linux kernel.<br>
><br>
> Now, we had no UEFI support, until now. I am able to implement SYSLINUX bootdisk type (we call it Full host image) with Grub2 and that was pretty simple.<br>
><br>
> I would like to add ipxe.efi into the image and be able to boot it, which is also doable either directly, or via chainbooting from Grub2. But the problem is, with SYSLINUX we've been able to provide the script via initramdisk (it's call embedding in iPXE terms I believe):<br>
><br>
> default ipxe<br>
> label ipxe<br>
> kernel /ipxe<br>
> initrd /script<br>
><br>
> This worked fine, but I am unable to do the same with ipxe.efi.<br>
><br>
> set default=0<br>
> set timeout=1<br>
> menuentry "Chainload iPXE - this does not work" {<br>
> linuxefi /ipxe.efi<br>
> initrdefi /script<br>
> }<br>
> menuentry "Chainload iPXE - this loads iPXE but no script" {<br>
> search --no-floppy --set=root -f /ipxe.efi<br>
> chainloader /ipxe.efi + 1<br>
> }<br>
><br>
> Is there a way to embed a script? What I want to avoid is building iPXE from scratch (with embedded script), I don't want to make our application complex and compiler and tools are not usually available on production installations.<br>
><br>
> If there is no way of doing that from Grub2, I am fine booting iPXE directly, that's just more work when generating the ISO (hybrid) image for me, but feasible too.<br>
><br>
> Tried to post into the user forum, but it did not work (form was submitted but no post appeared). Later on, I saw a PostgreSQL error page, so sending to the dev list if you don't mind. Thanks for help!<br>
><br>
> --<br>
> S pozdravem / Best regards<br>
> Lukas Zapletal<br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> ipxe-devel mailing list<br>
> <a href="mailto:ipxe-devel@lists.ipxe.org">ipxe-devel@lists.ipxe.org</a><br>
> <a href="https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel" rel="noreferrer" target="_blank">https://lists.ipxe.org/<wbr>mailman/listinfo.cgi/ipxe-<wbr>devel</a><br>
><br>
The information contained in this message is confidential and is intended for the addressee(s) only. If you have received this message in error, please notify the sender immediately and delete the message. Unless you are an addressee (or authorized to receive for an addressee), you may not use, copy or disclose to anyone this message or any information contained in this message. The unauthorized use, disclosure, copying or alteration of this message is strictly prohibited.<br>
______________________________<wbr>_________________<br>
ipxe-devel mailing list<br>
<a href="mailto:ipxe-devel@lists.ipxe.org">ipxe-devel@lists.ipxe.org</a><br>
<a href="https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel" rel="noreferrer" target="_blank">https://lists.ipxe.org/<wbr>mailman/listinfo.cgi/ipxe-<wbr>devel</a><br>
</div></div>______________________________<wbr>_________________<br>
ads-tec GmbH<br>
Sitz: 72622 Nürtingen<br>
Registergericht Stuttgart HRB 224527<br>
<br>
Geschaeftsfuehrer:<br>
Dipl.-Ing. Thomas Speidel<br>
______________________________<wbr>_________________<br>
Diese E-Mail enthaelt vertrauliche und/oder rechtlich<br>
geschuetzte Informationen. Wenn Sie nicht der richtige<br>
Adressat sind oder diese E-Mail irrtuemlich erhalten<br>
haben, informieren Sie bitte sofort den Absender und<br>
vernichten Sie diese E-Mail. Das unerlaubte Kopieren,<br>
jegliche anderweitige Verwendung sowie die unbefugte<br>
Weitergabe dieser Mail sind nicht gestattet.<br>
______________________________<wbr>_________________<br>
<br>
This e-mail may contain confidential and/or privileged<br>
information. If you are not the intended recipient (or have<br>
received this e-mail in error) please notify the sender<br>
immediately and destroy this e-mail. Any unauthorized<br>
copying, disclosure, distribution or other use of the<br>
material or parts thereof are strictly forbidden.<br>
______________________________<wbr>_________________<br>
<div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
ipxe-devel mailing list<br>
<a href="mailto:ipxe-devel@lists.ipxe.org">ipxe-devel@lists.ipxe.org</a><br>
<a href="https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel" rel="noreferrer" target="_blank">https://lists.ipxe.org/<wbr>mailman/listinfo.cgi/ipxe-<wbr>devel</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">S pozdravem / Best regards<br> Lukas Zapletal</div>
</div>