[syslinux] UEFI bootable USB stick to allow PXE booting with USB ethernet adaptors?

Dan Jackson djackson at longroad.ac.uk
Fri Jul 21 00:54:29 PDT 2023


Hello,

What you said in regards to "How did you arrange that the driver gets loaded before the iPXE binary? Start an EFI shell, run the driver binary (TSR style), then run iPXE?" is largely correct.

There is a slight difference in that the EFI shell provides a specific "load" command for loading drivers. So the sequence of events was:

Boot to EFI shell (which is on the USB stick, by the way, because the system BIOS on this laptop doesn't include an EFI shell either)
load FS1:\efi\boot\RtkUsbUndiDxe.efi
FS1:\efi\boot\ipxe.efi

Then pressing Ctrl+B to get the iPXE shell, and:
dhcp
chain tftp://ip.address.of.sccm.server/\smsboot\DEPLOYMENT_ID_OF_BOOT_IMAGE\x64\wdsmgfw.efi

This then allows me to successfully proceed on with an SCCM deployment of the machine as normal, without requiring any additional modification or configuration on the SCCM side.

I think this should be possible to automate using a combination of startup.nsh and autoexec.ipxe, though automatically locating the filesystem in the EFI shell might prove somewhat tricky. I think I saw flow control commands in the help though, so I can maybe put together some kind of DOS-like script to do it.

Booting iPXE directly does not work as it provides no means (as far as I could tell from the command help) to load the Realtek driver at the iPXE shell prompt.

The Realtek UEFI drivers are available for download freely on Realtek's web site (they're a separate download from the regular drivers, a bit further down the page).

Thanks,
Dan Jackson (Network & Systems Engineer)
Long Road Sixth Form College
Cambridge, UK

-----Original Message-----
From: Syslinux <syslinux-bounces at syslinux.org> On Behalf Of Frantisek Rysanek via Syslinux
Sent: Thursday, July 20, 2023 1:19 PM
To: Dan Jackson via Syslinux <syslinux at syslinux.org>
Subject: Re: [syslinux] UEFI bootable USB stick to allow PXE booting with USB ethernet adaptors?

CAUTION: This email originated from outside of Long Road Sixth Form College. Do not click links or open attachments unless you recognise the sender and know the content is safe.

Dear gents,

apologies for responding to the private message:

> 1. What brand of laptops are these that don't include Ethernet
> adaptor, but do support UEFI??

That would be the whole market segment under 500 GBP, for the last
maybe 6 generations of Intel CPU's :-)

[/jokes aside]

So... you do know about iPXE, and you know your way around - good.

Realtek is a popular brand, and to me it can mean either the old
10/100Mb RTL8150, or the recent-ish 10/100/1000 RTL8153.
Knowing that even the classic PCI-based NIC's are sometimes
troublesome when PXE-booting, I'd expect USB-based NIC's to be
definitely more of a problem.
Interesting that you've got an EFI driver binary for the card :-)
Makes me wonder how it addresses USB support.
How did you arrange that the driver gets loaded before the iPXE
binary? Start an EFI shell, run the driver binary (TSR style), then
run iPXE? I've had some brief encounters with the EFI shell before,
but not very reassuring.

Have you tried starting a fresh version iPXE directly, instead of the
EFI shell?

> ...unsuccessful in booting from the PXE image.
>
Any details in what way it failed?
Have you tried the same "UEFI PXE-boot kickstart USB stick" in some
other, less degenerate PC, perhaps with some classic PCI(-e) NIC ?
With BIOS support for PXE turned *off*, just to make sure :-)
As to isolate, whether the problem in the desired laptop has to do
with the USB NIC, or someplace completely different.

Makes me wonder to what extent that server-side software stack by
Microsoft is able to PXE-boot in UEFI mode, and if it needs UEFI PXE
services in the on-motherboard ROM to succeed.

As mentioned before, I'm using a "vanilla" stack on Linux.
I can see that the binary of ipxe.efi has been combined (rebuilt) to
include the following script:

[contents of embed.ipxe]
#!ipxe

dhcp
chain tftp://192.168.x.y/ipxe/menu.ipxe
[/embed.ipxe]

See also https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fipxe.org%2fembed&c=E,1,gmf7g86GodijIBPhKFTmhl_5vDvhH7ppFElDFQr5ssGPdh9oeLoyTQI9XqU2pVvbX-u-6hDpeq8I1S8mNNgQSESmHnSAaR680bl5Bjy6vkE1St_-vQ,,&typo=1

So the ipxe.efi, as served by my DHCP+TFTP, is told where to load the
menu script.
These are the relevant contents of my menu.ipxe:

[menu.ipxe]
#!ipxe

#console --picture tftp://192.168.what.ever/ipxe/background.png

#prompt --key 0x02 --timeout 2000 Press Ctrl-B for cmd && shell ||

menu Please select a profile to boot:
 item memtest Memtest86+ 6.2 (https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmemtest.org&c=E,1,mMUA6IUPKBnUh1GRpn_AzvJXNKDc_8bUCPL-cusKmvvqs0746cuu4X7S2cxW0vKuvhK-cvPmay50xUCrbGxkZtFKWm4KBlZUGCNR18Emt8ZF&typo=1)
item --gap Windows PE:
 item win10pe Windows 10 PE on bare metal
choose profile && goto ${profile}

:memtest
  kernel tftp://192.168.x.y/os/memt620i64.efi
  imgargs memt620i64.efi keyboard=both usbinit=3
  boot

:win10pe
  kernel nfs://192.168.x.y/tftpboot/ipxe/wimboot gui
  initrd nfs://192.168.x.y/tftpboot/PE/wimboot/boot/bcd BCD
  initrd nfs://192.168.x.y/tftpboot/PE/wimboot/boot/boot.sdi boot.sdi
  # boot.wim is a symlink to Win10PE.WIM
  initrd nfs://192.168.x.y/tftpboot/PE/wimboot/src/boot.wim boot.wim
#  sleep 5
  boot
[/menu.ipxe]

Wimboot is an intermediate bootloader module, companion to iPXE.
AFAICT, it loads the *whole* WIM image into RAM, so it doesn't need
UEFI PXE services to start the kernel. The WIM can contain Windows
drivers for the typical LAN cards, or the image can function without
LAN access.
I have no clue how we arrived at the boot.wim - somebody else's
responsibility :-) But I believe it's an almost original Microsoft
installer image. If I remember correctly, we just had to extract the
BCD and boot.sdi manually. Actually, here you are, original
documentation:
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fipxe.org%2fwimboot&c=E,1,fvI1YDy3COED92m86_YZAeo48UKels8ijqibYElAqOcIO_Ms2hIVTRGyZGKqgFpNE9xj2JsOz7lgs1H6mC4hRGp0xJK6HUBPODDURnWwJ3Wv7Zj_ww,,&typo=1

I guess we couldn't get around the silly message of the Windows
installer, requiring you to "press any key to boot from DVD" if it
finds Windows already installed on a hard drive present in the
system... In this case, you have to wait for iPXE to finish loading
the WIM image into ramdisk, which can take a minute, and then be
ready to hit any key within about 3 seconds...

Frank


On 20 Jul 2023 at 9:41, Dan Jackson via Syslinux wrote:
>
> Hello,
>
> It's an Acer Swift SF114-31.
>
> The existing PXE server that we are trying to boot from is Microsoft
> Configuration Manager (also known as SCCM or MECM). I tried putting
> the boot image itself on a USB stick manually but while I got the
> initial Configuration Manager wallpaper appearing, after a short
> period it just rebooted itself. It does appear that there may be a
> native ConfigMgr way to create a minimal USB stick without needing to
> include everything and the kitchen sink, so I'll be investigating that
> as well.
>
> The USB ethernet adapters are Realtek based. I put together a USB
> stick with an EFI Shell, a copy of the Realtek USB UNDI EFI driver and
> a copy of iPXE and this combination was after some fiddling able to
> initialise the network adapter, however it's unsuccessful in booting
> from the PXE image. Hence why I was investigating whether Syslinux
> might be able to help in some way.
>
> Thanks,
> Dan Jackson (Network & Systems Engineer)
> Long Road Sixth Form College
> Cambridge, UK
>
> -----Original Message-----
> From: Michael D. Setzer II <mikes at guam.net>
> Sent: Thursday, July 20, 2023 10:25 AM
> To: Dan Jackson <djackson at longroad.ac.uk>
> Subject: Re: [syslinux] UEFI bootable USB stick to allow PXE booting with USB ethernet adaptors?
>
> CAUTION: This email originated from outside of Long Road Sixth Form College. Do not click links or open attachments unless you recognise the sender and know the content is safe.
>
> Couple of things?
> 1. What brand of laptops are these that don't include Ethernet
> adaptor, but do support UEFI?? Perhaps knowing hardware info?
> 2. I've use PXE boot on a local network with syslinux long ago with
> regular ethernet in PCs, but never got UEFI to work with syslinux.
> 3. Have used grub4dos to create USBs that have both the regular
> and UEFI booting on the same flash. My disk imaging project then
> load its kernel and ramdisk.lzma files into ram, but I've included
> regular ethernet in the setup, but don't have wifi adapters.
> 4. What is the PXE image file? Not sure why it can't be put on a
> bootiable flash?
> 5. What kind of image is this. Window's what or Linux What.
> 6. What kind of USB ethernet adapters are you talking about?
>
> Think lot more info would be needed.
>
>
> On 20 Jul 2023 at 8:31, Dan Jackson via Syslinux wrote:
>
> To:                     "syslinux at syslinux.org" <syslinux at syslinux.org>
> Date sent:              Thu, 20 Jul 2023 08:31:23 +0000
> Subject:                [syslinux] UEFI bootable USB stick to allow PXE
> booting with USB
>         ethernet adaptors?
> From:                   Dan Jackson via Syslinux <syslinux at syslinux.org>
> Send reply to:          Dan Jackson <djackson at longroad.ac.uk>
>
> > Hello,
> >
> > At my workplace we have some laptops that don't have a built in Ethernet adaptor and don't natively support PXE booting using a USB Ethernet adaptor.
> >
> > Is it possible to create a UEFI bootable USB stick with Syslinux that can somehow kickstart the PXE boot process using the USB Ethernet adaptor? If so, how would we do that?
> >
> > Unfortunately due to the nature of the boot image, simply writing the boot image to a USB stick and trying to boot off that does not work, we specifically need to PXE boot it.
> >
> > Thanks,
> > Dan Jackson (Network & Systems Engineer)
> > Long Road Sixth Form College
> > Cambridge, UK
> >
> > Thank you for your email which we will respond to as quickly as we can. Please be aware that to support the wellbeing of our staff and students, Long Road Sixth Form College does not routinely respond to emails outside of our usual working hours.
> >
> > --
> >
> > [https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.longroad.ac.uk%2f_site%2fdata%2ffiles%2fimages%2flogos%2fF077AFDB9FEBB77F977D7E6C09DA751F.png&c=E,1,8oh_xWxyf31T4FLz9xMR70WcOrHhlkdsRBynbgjT7Jr_5dVj3deYEeH31tASV8qZeAK3t2jv3lwV4OiWosKwKIcL5jCSzrK437PKSqzA48-Sq1gUjWzU5hY,&typo=1]<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.longroad.ac.uk&c=E,1,wpWnadIC4Kb0T9kMlGgET3mJPD5o7VK1XVXCR-I_jsb2UkCzyFLHKi0s4skGCNjEUuHkhC3NkvI5E5toiBviEgShmAQSz9-CGIfW01wDY6yqu3PMHLTEc3qgEw,,&typo=1>
> >
> > [https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.longroad.ac.uk%2f_site%2fdata%2ffiles%2fimages%2f76DB28695AB2A957B1812BD75CC585E1.png&c=E,1,dWID1ilzsMkpn5VvCQj1Z5VKM8I6dBx6K77kvS_2MuAPjqibv2G81TFSDTry-3ZbOMj7Mt68Wg0_gU4lT5muBJsfA14lk_R6KnRFCBpW8tn-sEO_pKKQYknCA-nu&typo=1]<https://www.facebook.com/LongRoadSixthFormCollege/> [https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.longroad.ac.uk%2f_site%2fdata%2ffiles%2fimages%2fCE703F46CFAF86CA4D3BBF0AB2232A7F.png&c=E,1,DNDzDmer9Y4NX_DBlh7j07olpX8XOzfADThcwm7XwUgC0_wENx4g8RgPnI9H6xRvpHPNyAVpgiDkeaO02891SC2a9buMSXgLJA2_IMj1ttQXBg,,&typo=1] <https://twitter.com/LR6FC>  [https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.longroad.ac.uk%2f_site%2fdata%2ffiles%2fimages%2f3DF251EAAF6B9B15CF4C8EC453B73AFA.png&c=E,1,MgzRf6EgjniG2L9A4WwSOMdGRaZ1nPdjvKgAJbRh1c3mtcZdfm-g2m9HWleUWFb3WgHOJCqAVoPCfmBVnQOHJanI323fQrTsgmi8TixhjyRLQjbs&typo=1] <https://www.instagram.com/lr6fc/>
> >
> > This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual(s) to whom it is addressed. If you receive this email by mistake please notify the sender and delete it immediately. This communication represents the originator's personal views and opinions which do not necessarily reflect those of Long Road Sixth Form College. Please be aware that any encrypted files emailed to Long Road may be subject to a delay.
> > _______________________________________________
> > Syslinux mailing list
> > Submissions to Syslinux at syslinux.org
> > Unsubscribe or set options at:
> > https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.syslinux.org%2fsyslinux&c=E,1,VFSsGbnxb-15ySy1d73jDCB9iJQ8Q6jmfYqF8AmDKKe_yzkC2umqsLmAGAQ1ErnQcNNxsjEHkgDIfj6BqGQCR2bV0zTiZdj3zR71xaWLkA,,&typo=1
>
>
> +------------------------------------------------------------+
>  Michael D. Setzer II - Computer Science Instructor (Retired)
>  mailto:mikes at guam.net
>  mailto:msetzerii at gmail.com
>  Guam - Where America's Day Begins
>  G4L Disk Imaging Project maintainer
>  http://sourceforge.net/projects/g4l/
> +------------------------------------------------------------+
>
>
>
> Thank you for your email which we will respond to as quickly as we can. Please be aware that to support the wellbeing of our staff and students, Long Road Sixth Form College does not routinely respond to emails outside of our usual working hours.
>
> --
>
> [https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.longroad.ac.uk%2f_site%2fdata%2ffiles%2fimages%2flogos%2fF077AFDB9FEBB77F977D7E6C09DA751F.png&c=E,1,h8jtJlLih4EBGUWYB3ymyxV_cbz0GfQZdHmtVMILNOIAi2R9ljoNmgYzy9YBzMYVl8L6Bd6-lWZ5ZEYlcAMArpNZHHxCbnzfEksvoO4vPuyFG-1kfg,,&typo=1]<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.longroad.ac.uk&c=E,1,HjYFXDQLY_RMWGNj7vQLbFxdP0ma8PilpQlpqCLifK3bp8TB17-eBxNbaBGGKKTpsq_Xza6qTvvHesncVmMt7WpNPhLhwcFY58WdZYRUNlM12Du7Emg,&typo=1>
>
> [https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.longroad.ac.uk%2f_site%2fdata%2ffiles%2fimages%2f76DB28695AB2A957B1812BD75CC585E1.png&c=E,1,lBnh2ZIxjRC8DAJD4mgcont4ooqwgKCbQa-iVYLjRJ-K2ueUK45xb3KkjRYJmWqB08aSkTnVYdqXI0uaueWhCkFUtcA4Qnz6YD1h0zFmtQ,,&typo=1]<https://www.facebook.com/LongRoadSixthFormCollege/> [https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.longroad.ac.uk%2f_site%2fdata%2ffiles%2fimages%2fCE703F46CFAF86CA4D3BBF0AB2232A7F.png&c=E,1,moutPls0D133aZsdo8_G2DbacL4xbYUtJHTrTo-e97eirI1zglLp8weu6wAM2g9ZxGVOokhkT75Pc5h1bNUVFWCtYk8Wp7LFEhjATeqfrGIFzleuRdUh&typo=1] <https://twitter.com/LR6FC>  [https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.longroad.ac.uk%2f_site%2fdata%2ffiles%2fimages%2f3DF251EAAF6B9B15CF4C8EC453B73AFA.png&c=E,1,a8hjrWZgfK4w_bJ0TgUm0d9fOxj7eJeDE299uiJN76-y9gsHZrL4njP607njccdzmwPhYOiTL0idELzsLuTp780P6rSxwxDhKhqGXbYkPDDTsTJ6EaM,&typo=1] <https://www.instagram.com/lr6fc/>
>
> This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual(s) to whom it is addressed. If you receive this email by mistake please notify the sender and delete it immediately. This communication represents the originator's personal views and opinions which do not necessarily reflect those of Long Road Sixth Form College. Please be aware that any encrypted files emailed to Long Road may be subject to a delay.
>
> _______________________________________________
> Syslinux mailing list
> Submissions to Syslinux at syslinux.org
> Unsubscribe or set options at:
> https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.syslinux.org%2fsyslinux&c=E,1,2sNW2U7lf0cxuf57dglN9EFeFUwNycsDB_AbaAwNsWU2IzmU3IWIFpUTEaznSBqCbeu_xzg7nTuSDuwzLAwuslxy-LOaFm9wEIz6u_zjTIg,&typo=1


_______________________________________________
Syslinux mailing list
Submissions to Syslinux at syslinux.org
Unsubscribe or set options at:
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.syslinux.org%2fsyslinux&c=E,1,QlbJ8nkXABshxCoJ2eC7gCYN6Dvrqvd166blnantCnWAjsI_AOKaoaYcbu9gA2k5SxXV0OGGP4CD_5Pn7frFpRtu7OOmoc3kJGEcYI-USDWe73e-2Khn&typo=1
Thank you for your email which we will respond to as quickly as we can. Please be aware that to support the wellbeing of our staff and students, Long Road Sixth Form College does not routinely respond to emails outside of our usual working hours.

--

[https://www.longroad.ac.uk/_site/data/files/images/logos/F077AFDB9FEBB77F977D7E6C09DA751F.png]<https://www.longroad.ac.uk>

[https://www.longroad.ac.uk/_site/data/files/images/76DB28695AB2A957B1812BD75CC585E1.png]<https://www.facebook.com/LongRoadSixthFormCollege/> [https://www.longroad.ac.uk/_site/data/files/images/CE703F46CFAF86CA4D3BBF0AB2232A7F.png] <https://twitter.com/LR6FC>  [https://www.longroad.ac.uk/_site/data/files/images/3DF251EAAF6B9B15CF4C8EC453B73AFA.png] <https://www.instagram.com/lr6fc/>

This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual(s) to whom it is addressed. If you receive this email by mistake please notify the sender and delete it immediately. This communication represents the originator's personal views and opinions which do not necessarily reflect those of Long Road Sixth Form College. Please be aware that any encrypted files emailed to Long Road may be subject to a delay.



More information about the Syslinux mailing list