Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ipxe usb only + wimboot
2018-12-29, 09:26
Post: #1
ipxe usb only + wimboot
Upfront I realize I'm pushing iPXE beyond what it was probably intended for.

Primary goals:
1) pc bios + 64-bit EFI boot flash drive, all the files are on the drive
2) Use wimboot to boot .wim files

Secondary goal: Use iPXE to make sharing menu items between my flash drive and PXE boot setup much smoother.
Following this somewhat:
http://forum.ipxe.org/showthread.php?tid=8132

I took a flash drive in Linux.
Code:
cat ipxe.usb > /dev/sdb
Then in fdisk I created a new partition, made it primary, set the fs type to 0c.
I marked the partition as bootable which may have been a mistake.

Went over and created EFI/boot and put my ipxe.efi in there, but named bootx64.efi.

My small boot menu(boot.ipxe)
Code:
#!ipxe


set menu-timeout 5000
set submenu-timeout ${menu-timeout}
isset ${menu-default} || set menu-default exit
console  --x 1024 --y 768

:start
menu Doing menu things
item WinRE Win 10 RE
item shell Shell
item reboot Reboot

choose --default exit --timeout 60000 target && goto ${target}

:reboot
reboot

:shell
echo Type exit to get back to the menu
shell
set menu-timeout 0
goto start

:WinRE
imgfree
kernel file:/wimboot pause
imgfetch --name bootmgr file:/bootmgr bootmgr
imgfetch --name BCD file:/BCD BCD
imgfetch --name boot.sdi file:/boot.sdi boot.sdi
imgfetch --name boot.wim file:/boot.original.wim boot.wim
imgstat
prompt  || read void
boot || prompt Something can you read above && goto start

My ipxe binaries are compiled with
Code:
#!ipxe
chain file:/boot.ipxe


In BIOS mode when I boot the flash drive I get
Quote:This is not a bootable disk. Please insert a bootable floppy and press any key to try again ...

On the EFI side I have fared much better. It boots, the menu loads, it loads wimboot and the four required files. When I get to the boot line it errors out with 2c048087 . At the very bottom of the page for that, it says iPXE must have an open network interface to boot.

My test laptop and many others don't have a wired ethernet to bring up. I searched a bit, but is there a localhost interface I can bring up?

Should I scrap the whole thing and make the flash drive with grub2 and wimboot?

I do really enjoy being able to patch in files to the wim at boot time, instead of having to mount the wim and put all the files inside.

Creative suggestions are appreciated. Thanks in advance.

Ah, this may also be helpful.
Code:
Dunstin:~ phoenix$ sudo fdisk  /dev/rdisk2
Disk: /dev/rdisk2    geometry: 962/255/63 [15466496 sectors]
Signature: 0xAA55
         Starting       Ending
#: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
*1: 0C    3   0   1 -  383  63  32 [      6144 -   15460352] Win95 FAT32L
2: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
3: E0    0   1   1 -    0  63  32 [        32 -       2016] <Unknown ID>
*4: EB    1   0   1 -    2  63  32 [      2048 -       4096] BeOS/i386

The PC with the Linux VM is put away, so I used fdisk on a Mac just for this output.[/code]
Find all posts by this user
Quote this message in a reply
2018-12-29, 13:09
Post: #2
RE: ipxe usb only + wimboot
Don't change which partition is bootable.

As you have read on the error page you have to have an open interface for it to bind to, you can do this with ifopen as long as there is an interface.
For PCBIOS file:// does not work.

Using iPXE for local boots are painful, and is not the goal of iPXE since it adds to complexity.
One workaround could be to build the USB enabled version of iPXE with rndis support, and use an USB tethered phone as the "server"

For just USB without network I can not recommend using iPXE

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2018-12-29, 20:13
Post: #3
RE: ipxe usb only + wimboot
Thanks. I'll go down a slightly different path then. I thought I would give it a try.

I've read about some success with WIMBoot via Grub2(PC BIOS mode). It looks like to get it working via EFI folks have had to go Grub->iPXE-wimboot. Is this expected?

I'll get to working on it anyway and post a write up back here. At this point sans WIMBoot converting between GRUB2 and iPXE configurations isn't a problem.
Find all posts by this user
Quote this message in a reply
2018-12-29, 21:34
Post: #4
RE: ipxe usb only + wimboot
(2018-12-29 20:13)dontlook Wrote:  I've read about some success with WIMBoot via Grub2(PC BIOS mode). It looks like to get it working via EFI folks have had to go Grub->iPXE-wimboot. Is this expected?

I'll get to working on it anyway and post a write up back here. At this point sans WIMBoot converting between GRUB2 and iPXE configurations isn't a problem.

Grub is broken in so many ways in regards to EFI, quite recently there was patches sent (probably to the mailing list) for wimboot to work from EFI grub.

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2018-12-29, 22:02
Post: #5
RE: ipxe usb only + wimboot
(2018-12-29 21:34)NiKiZe Wrote:  Grub is broken in so many ways in regards to EFI, quite recently there was patches sent (probably to the mailing list) for wimboot to work from EFI grub.

I'll go look for those, I'd be happy to test.

It looks like everyone else is going grub->ipxe->wimboot . Which again fails because no actual interface exists.

I went looking for RNDIS options(using rom-o-matic) to compile them in, but I don't see any RNDIS related options. Undecided
Find all posts by this user
Quote this message in a reply
2018-12-30, 04:48
Post: #6
RE: ipxe usb only + wimboot
Spent all day on this. It looks like one of the patches is doubled up.

The compile failed because the efifile.h file was not patched to include the new function added to efifile.c .

Unrelated to the patches gcc on my system doesn't seem to understand the -liberty flag. I couldn't find what it was, so I removed it. The compile succeed and the build does boot normally via iPXE, so that is a good sign.

Would the above be more appropriate for the mailing list?

It doesn't boot with either linuxefi or linux commands in grub to load the kernel.

I'll have to try RNDIS tomorrow.

I notice there is a wimboot.x86_64.efi binary created. Is that supposed to be directly usable?
Find all posts by this user
Quote this message in a reply
2018-12-31, 02:23
Post: #7
RE: ipxe usb only + wimboot
it doesn't boot efi from either grub or syslinux.

The error I get with syslinux is:
Quote: Could not set file position: 0x80000000000000035->0x1674da80
Failed to exit header boot index 2->3

------

The compiled bin-x86_64-efi/acm--ecm--ncm.efi doesn't even get past initializing devices. I only have an AX88179 chipset.[/quote]
Find all posts by this user
Quote this message in a reply
2019-01-01, 06:06
Post: #8
RE: ipxe usb only + wimboot
In reverse order of the previous post. I compiled in the axge driver in with the other drivers, and then a version with just the axge driver.

Both times(booting from syslinux) it just hung at initializing devices.

I got some great feedback on the list and it turns out my syslinux configuration was incorrect.

Wimboot patched with the patches submitted to the dev list in Nov 2018 can be booted from Syslinux with the following configuration
Code:
LABEL wimboot
    com32 linux.c32
    APPEND /wimboot initrdfile=bcd,boot.sdi,boot.wim rawwim
Thanks to Alif on the mailing list and Frienrick for the patches.

Alif has suggested that this is the more correct configuration
Code:
label wimboot
        com32 linux.c32 /wimboot initrdfile=bcd,boot.sdi,boot.wim
        append rawwim
-------------
Starting with a blank flash drive. In Linux(or something with fdisk), find the identifier for you your flash drive. I'm going to use /dev/sdX and an Ubuntu 18.04.01 x64 VM
Install the following packages:
Code:
sudo apt install syslinux-common syslinux-legacy syslinux-efi

Code:
sudo fdisk -l
o <enter>
n <enter>
p <enter>
1 <enter>
<enter>
<enter>
t <enter>
0b <enter>
a <enter>
w <enter>

Then format the drive
Code:
mkfs.vfat /dev/sdX1

Put the Syslinux bios bootloader on the drive.
Code:
syslinux -i /dev/sdX1
dd conv=notrunc bs=440 count=1 if=/usr/lib/syslinux/mbr/mbr.bin of=/dev/sdX
mount -o umask=000 /dev/sdX1 /mnt
mkdir -p /mnt/EFI/boot/
cp /usr/lib/SYSLINUX.EFI/efi64/syslinux.efi /mnt/EFI/boot/bootx64.efi

The following files need to be copied from /usr/lib/syslinux/modules/bios/ to the root of the flash drive
Code:
chain.c32
ldlinux.c32
libcom32.c32
libutil.c32
linux.c32
menu.c32
syslinux.c32
vesamenu.c32

The following files need to be copied from /usr/lib/syslinux/modules/efi64/ to /mnt/EFI/boot
Code:
ldlinux.e64
chain.c32
libcom32.c32
libutil.c32
linux.c32
menu.c32
syslinux.c32
vesamenu.c32

Create syslinux.cfg in the root of the flash drive with the following:
Code:
PROMPT 0
TIMEOUT 0
DEFAULT wimboot

LABEL wimboot
    com32 linux.c32
    append /wimboot initrdfile=/bcd,/boot.sdi,/boot.wim,/segmono_boot.ttf,/segoe_slboot.ttf,/segoen_slboot.ttf gui

Note, I couldn't get this to boot without the GUI argument in the second build for this guide. I may have been using an argument that doesn't exist rawwim vs rawbcd.

Create syslinux.cfg in EFI/boot/ folder on the flash drive with the following contents
Code:
PROMPT 0
TIMEOUT 0

INCLUDE /syslinux.cfg

Copy the patched version of wimboot to the root of the flash drive along with:
Code:
bcd
boot.sdi
boot.wim
segmono_boot.ttf
segoe_slboot.ttf
segoen_slboot.ttf

This now should be bootable both as bios and EFIx64. It may not be the best config with regard to syslinux, but it works and I'm tired of testing to reductions for now.

This came together with help from folks on the Dev list, NiKiZe in multiple places, ndeineko on GitHub, and the syslinux wiki.
Find all posts by this user
Quote this message in a reply
Post Reply 




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