Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
EFI PXE bootstrap and NBI image support
2016-10-14, 00:33
Post: #1
EFI PXE bootstrap and NBI image support
It appears the build for EFI PXE Bootstrap (32 or 64-but) with IMAGE_NBI enabled is broken. I cannot build it locally, or with Rom-o-Matic.

Is there some inherent incompatibility with these options?

I need NBI image support because Clonezilla and DRBL still appear to use NBI images.

Here is the log from a Rom-O-Matic build which failed:

Code:
Build failed:

"make" unexpectedly returned exit value 2 at /var/www/ipxe-buildweb/build.fcgi line 630


Build log:
Path:
Parameters:
  BINARY = ipxe.efi
  BINDIR = bin-x86_64-efi
  DEBUG =
  EMBED.00script.ipxe =
  REVISION = master
  general.h/IMAGE_NBI: = 1
Binary: ipxe.efi
Binary directory: bin-x86_64-efi
Revision: master
Canonicalising revision master...
Canonical revision: 827dd1bfee67daa683935ce65316f7e0f057fe1c
Creating temporary directories...
Temporary git directory: /var/tmp/ipxe-build/ipxe-build-ybmekN
Temporary working tree: /var/tmp/ipxe-build/ipxe-build-lkkBOm
Cloning git tree from /var/tmp/ipxe/.git...
Finding closest cached binaries for 827dd1bfee67daa683935ce65316f7e0f057fe1c...
Found cached binaries in ipxe-build/cached/bin-x86_64-efi/827dd1bfee67daa683935ce65316f7e0f057fe1c.gz at distance 0
Opening binary tarball /var/cache/ipxe-build/827dd1bfee67daa683935ce65316f7e0f057fe1c-bin-x86_64-efi.tar.gz...
Opened binary tarball /var/cache/ipxe-build/827dd1bfee67daa683935ce65316f7e0f057fe1c-bin-x86_64-efi.tar.gz...
Checking out revision 827dd1bfee67daa683935ce65316f7e0f057fe1c...
Identifying timestamp for commit 827dd1bfee67daa683935ce65316f7e0f057fe1c...
Setting timestamps to Wed Aug 31 18:23:42 2016...
Unpacking binary tarball /var/cache/ipxe-build/827dd1bfee67daa683935ce65316f7e0f057fe1c-bin-x86_64-efi.tar.gz...
Checking out revision 827dd1bfee67daa683935ce65316f7e0f057fe1c...
Local configuration for general.h:
#define IMAGE_NBI
Building final target bin-x86_64-efi/ipxe.efi...
make: Entering directory `/var/tmp/ipxe-build/ipxe-build-lkkBOm/src'
  [DEPS] arch/x86/prefix/romprefix.S
  [DEPS] arch/x86/prefix/pciromprefix.S
  [DEPS] arch/x86/prefix/mromprefix.S
  [DEPS] arch/x86/prefix/isaromprefix.S
  [DEPS] arch/x86/interface/pcbios/bios_smbios.c
  [DEPS] config/config_route.c
  [DEPS] config/config_romprefix.c
  [DEPS] config/config_pixbuf.c
  [DEPS] config/config_net80211.c
  [DEPS] config/config_infiniband.c
  [DEPS] config/config_http.c
  [DEPS] config/config_fc.c
  [DEPS] config/config_ethernet.c
  [DEPS] config/config_efi.c
  [DEPS] config/config_asn1.c
  [DEPS] config/config.c
  [DEPS] usr/autoboot.c
  [DEPS] interface/smbios/smbios_settings.c
  [DEPS] interface/smbios/smbios.c
  [DEPS] interface/efi/efi_snp.c
  [DEPS] interface/efi/efi_smbios.c
  [DEPS] interface/efi/efi_pxe.c
  [DEPS] drivers/net/smsc95xx.c
  [DEPS] net/netdevice.c
make: Leaving directory `/var/tmp/ipxe-build/ipxe-build-lkkBOm/src'
make: Entering directory `/var/tmp/ipxe-build/ipxe-build-lkkBOm/src'
  [BUILD] bin-x86_64-efi/smbios.o
  [BUILD] bin-x86_64-efi/autoboot.o
  [BUILD] bin-x86_64-efi/config.o
  [BUILD] bin-x86_64-efi/config_asn1.o
  [BUILD] bin-x86_64-efi/config_efi.o
  [BUILD] bin-x86_64-efi/config_ethernet.o
  [BUILD] bin-x86_64-efi/config_fc.o
  [BUILD] bin-x86_64-efi/config_http.o
  [BUILD] bin-x86_64-efi/config_infiniband.o
  [BUILD] bin-x86_64-efi/config_net80211.o
  [BUILD] bin-x86_64-efi/config_pixbuf.o
  [BUILD] bin-x86_64-efi/config_romprefix.o
  [BUILD] bin-x86_64-efi/config_route.o
  [BUILD] bin-x86_64-efi/bios_smbios.o
  [BUILD] bin-x86_64-efi/isaromprefix.o
  [BUILD] bin-x86_64-efi/mromprefix.o
  [BUILD] bin-x86_64-efi/pciromprefix.o
  [BUILD] bin-x86_64-efi/romprefix.o
  [HOSTCC] util/elf2efi64
  [VERSION] bin-x86_64-efi/version.ipxe.efi.o
  [AR] bin-x86_64-efi/blib.a
ar: creating bin-x86_64-efi/blib.a
  [LD] bin-x86_64-efi/ipxe.efi.tmp
bin-x86_64-efi/blib.a(librm.o): In function `pm_esp':
(.data.pm_esp+0x0): relocation truncated to fit: R_X86_64_32 against symbol `_estack' defined in .stack section in bin-x86_64-efi/blib.a(stack.o)
bin-x86_64-efi/blib.a(librm.o): In function `real_to_prot':
(.text16.real_to_prot+0x1): relocation truncated to fit: R_X86_64_PC16 against symbol `enable_a20' defined in .text16.early section in bin-x86_64-efi/blib.a(liba20.o)
bin-x86_64-efi/blib.a(librm.o): In function `real_to_prot':
(.text16.real_to_prot+0x8): relocation truncated to fit: R_X86_64_16 against symbol `rm_ds' defined in .text16.data.rm_ds section in bin-x86_64-efi/blib.a(librm.o)
bin-x86_64-efi/blib.a(librm.o): In function `real_to_prot':
(.text16.real_to_prot+0x22): relocation truncated to fit: R_X86_64_16 against `.bss16.rm_virt_addrs'
bin-x86_64-efi/blib.a(librm.o): In function `real_to_prot':
(.text16.real_to_prot+0x2e): relocation truncated to fit: R_X86_64_16 against `.bss16.rm_virt_addrs'
bin-x86_64-efi/blib.a(librm.o): In function `real_to_prot':
(.text16.real_to_prot+0x33): relocation truncated to fit: R_X86_64_16 against `.bss16.rm_virt_addrs'
bin-x86_64-efi/blib.a(librm.o): In function `real_to_prot':
(.text16.real_to_prot+0x39): relocation truncated to fit: R_X86_64_16 against `.data16.gdt'
bin-x86_64-efi/blib.a(librm.o): In function `real_to_prot':
(.text16.real_to_prot+0x58): relocation truncated to fit: R_X86_64_32 against `.text.real_to_prot'
bin-x86_64-efi/blib.a(librm.o): In function `r2p_pmode':
(.text.real_to_prot+0x10): relocation truncated to fit: R_X86_64_32 against `.data.pm_esp'
bin-x86_64-efi/blib.a(librm.o): In function `r2p_pmode':
(.text.real_to_prot+0x17): relocation truncated to fit: R_X86_64_32 against symbol `idtr32' defined in .data.idtr32 section in bin-x86_64-efi/blib.a(librm_mgmt.o)
bin-x86_64-efi/blib.a(librm.o): In function `r2p_pmode':
(.text.real_to_prot+0x1f): additional relocation overflows omitted from the output
make: *** [bin-x86_64-efi/ipxe.efi.tmp] Error 1
rm bin-x86_64-efi/version.ipxe.efi.o
make: Leaving directory `/var/tmp/ipxe-build/ipxe-build-lkkBOm/src'
"make" unexpectedly returned exit value 2 at /var/www/ipxe-buildweb/build.fcgi line 630
Find all posts by this user
Quote this message in a reply
2016-10-17, 19:32
Post: #2
RE: EFI PXE bootstrap and NBI image support
EFI mode only supports to boot efi executables for the right cpu architechture. So you need to get a kernel with CONFIG_EFI_STUB enabled and recent enough to not be to buggy in EFI mode.

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2016-10-20, 06:35 (This post was last modified: 2016-10-20 06:56 by anary.)
Post: #3
RE: EFI PXE bootstrap and NBI image support
The built-in EFI PXE boot correctly handles booting from DRBL, but when I use iPXE it gives the following error:

Code:
Could not find config file (tftp)/grub-efi.cfg/grub.cfg- or (tftp)/grub-efi.cfg/grub.cfg

Any ideas?

The directory with grub-efi.cfg on the DRBL server appears to be:

Code:
/tftpboot/nbi_image/grub-efi.cfg/grub.cfg

Any idea how to point it to the correct place? Or am I barking up the wrong tree with this line of reasoning and I do actually need NBI image support?
Find all posts by this user
Quote this message in a reply
2016-10-20, 07:58
Post: #4
RE: EFI PXE bootstrap and NBI image support
It seems you are trying to get grub.efi to work from ipxe? I would instead suggest to get a working efi kernel - which will work fine in ipxe.

For example http://b800.org/sysr/sysrcd.ipxe works in both legacy and efi.
No magic just simple initrd and kernel with efi support.
Then some extras to load squashfs.

It is possible to add clonezilla on top of this, will however take a look on DRBL and see what they have.

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2016-10-21, 02:38 (This post was last modified: 2016-10-21 02:40 by anary.)
Post: #5
RE: EFI PXE bootstrap and NBI image support
I need to be able to start Clonezilla through DRBL because my setup involves initiating Clonezilla restores to about ~40 computers on-demand, and DRBL is used to automate the process. I am open to other suggestions.

This has been working great until recently when computers/laptops started arriving without CSM/BIOS or without uEFI Network Boot options, or without wired ethernet at all. In which case I add a USB Ethernet dongle to the machine and use iPXE to do a PXE boot through the USB dongle.

In CSM/BIOS mode iPXE loads up DRBL just fine, but in uEFI it's giving me trouble.
Find all posts by this user
Quote this message in a reply
2016-10-21, 22:59
Post: #6
RE: EFI PXE bootstrap and NBI image support
Ok so tested to download the latest clonezilla zip: clonezilla-live-2.4.7-8-amd64.zip by selecting amd64 and zip on this page: http://clonezilla.org/downloads/download...nch=stable

extracted and created a ipxe script with this:
Code:
#!ipxe
initrd live/initrd.img
kernel live/vmlinuz initrd=initrd.img boot=live username=user union=overlay config components quiet noswap edd=on nomodeset nodmraid locales= keyboard-layouts= ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch=no net.ifnames=0 nosplash noprompt fetch=tftp://$serverIP/filesystem.squashfs
boot

Which boots just fine in efi mode (at least until it goes of and tries to fetch the squashfs)

This is based on the information at: http://clonezilla.org/livepxe.php

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2016-10-23, 01:08 (This post was last modified: 2016-10-23 01:10 by anary.)
Post: #7
RE: EFI PXE bootstrap and NBI image support
This may deserve a new thread since I don't think it has anything to do with NBI Image support anymore. It appears to be an issue with iPXE EFI chainloading a grub2 PXE EFI file.

I posted the same bug to the DRBL forum (https://sourceforge.net/p/clonezilla/dis...ff/?page=1) and Steven Shiau from the DRBL/Clonezilla project made a thread on the iPXE development mailing list about it: http://lists.ipxe.org/pipermail/ipxe-dev...05214.html
Find all posts by this user
Quote this message in a reply
2016-10-23, 03:17
Post: #8
RE: EFI PXE bootstrap and NBI image support
This is my sort of working configurations (both - legacy and efi):

NFS:
Code:
:clonezilla1
kernel ${boot-url}/clonezilla64/live/vmlinuz initrd=initrd.img vga=791 boot=live union=overlay components net.ifnames=0 noprompt edd=on nomodeset nosplash username=user config locales=pl_PL.UTF-8 keyboard-layouts=pl timezone=Europe/Warsaw i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.blacklist=yes live-netdev="eth0" netboot=nfs nfsroot=${next-server}:/data/tftpboot/clonezilla64 ocs_prerun="" ocs_live_run="" ocs_live_batch="no"
initrd ${boot-url}/clonezilla64/live/initrd.img
imgstat
boot || read void

TFTP:
Code:
:clonezilla2
kernel ${boot-url}/clonezilla64/live/vmlinuz initrd=initrd.img vga=791 boot=live union=overlay components net.ifnames=0 noprompt edd=on nomodeset nosplash username=user config locales=pl_PL.UTF-8 keyboard-layouts=pl timezone=Europe/Warsaw i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.blacklist=yes live-netdev="eth0" fetch=tftp://${next-server}/clonezilla64/live/filesystem.squashfs ocs_prerun="" ocs_live_run="" ocs_live_batch="no"
initrd ${boot-url}/clonezilla64/live/initrd.img
imgstat
boot || read void

HTTP:
Code:
:clonezilla3
imgselect ${boot-url}/clonezilla64/live/vmlinuz
imgfetch ${boot-url}/clonezilla64/live/initrd.img
imgargs vmlinuz initrd=initrd.img vga=791 boot=live union=overlay components net.ifnames=0 noprompt edd=on nomodeset nosplash username=user config locales=pl_PL.UTF-8 keyboard-layouts=pl timezone=Europe/Warsaw i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.blacklist=yes live-netdev="eth0" fetch=${boot-url}/clonezilla64/live/filesystem.squashfs  ocs_prerun="" ocs_live_run="" ocs_live_batch="no"
imgstat
boot || read void

FTP:
Code:
:clonezilla4
imgselect ${boot-url}/clonezilla64/live/vmlinuz
imgfetch ${boot-url}/clonezilla64/live/initrd.img
imgargs vmlinuz initrd=initrd.img vga=791 boot=live union=overlay components net.ifnames=0 noprompt edd=on nomodeset nosplash username=user config locales=pl_PL.UTF-8 keyboard-layouts=pl timezone=Europe/Warsaw i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.blacklist=yes live-netdev="eth0" fetch=ftp://${next-server}//tftpboot/clonezilla64/live/filesystem.squashfs  ocs_prerun="" ocs_live_run="" ocs_live_batch="no"
imgstat
boot || read void

${boot-url} = http://ip/tftproot

NFS is the fastest solution.

pzdr
Find all posts by this user
Quote this message in a reply
2016-10-23, 13:20
Post: #9
RE: EFI PXE bootstrap and NBI image support
(2016-10-23 01:08)anary Wrote:  This may deserve a new thread since I don't think it has anything to do with NBI Image support anymore. It appears to be an issue with iPXE EFI chainloading a grub2 PXE EFI file.

Hu, Why are you chaining from ipxe to grub, when you can chain the kernel directly?

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2016-10-23, 13:24
Post: #10
RE: EFI PXE bootstrap and NBI image support
(2016-10-23 03:17)maggreg Wrote:  This is my sort of working configurations (both - legacy and efi):
.....

NFS is the fastest solution.

pzdr

What is needed is a squashfs loaded by ipxe option.
That way you don't have to rely on the kernel/distribution or network configuration to work in the distro, instead we know that ipxe does the right thing and the init scripts can then just load squashfs from ramfs without any extra downloads.

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2016-10-23, 17:46 (This post was last modified: 2016-10-23 17:49 by maggreg.)
Post: #11
RE: EFI PXE bootstrap and NBI image support
(2016-10-23 13:24)NiKiZe Wrote:  What is needed is a squashfs loaded by ipxe option.
That way you don't have to rely on the kernel/distribution or network configuration to work in the distro, instead we know that ipxe does the right thing and the init scripts can then just load squashfs from ramfs without any extra downloads.

Try:
Code:
set args1 vga=791 boot=live union=overlay components net.ifnames=0 noprompt edd=on nomodeset nosplash username=user config locales=pl_PL.UTF-8 keyboard-layouts=pl timezone=Europe/Warsaw i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.blacklist=yes
set args2 ip=frommedia live-media-path=/live bootfrom=/ toram=filesystem.squashfs ocs_preload="${boot-url}/linghost/skrypty/test.sh" ocs_live_run="/opt/test.sh" ocs_live_batch="no"
kernel ${boot-url}/clonezilla64/live/vmlinuz
initrd ${boot-url}/clonezilla64/live/initrd.img
initrd ${boot-url}/clonezilla64/live/file.cgz
imgargs vmlinuz initrd=initrd.img initrd=file.cgz ${args1} ${args2}
imgstat
boot || read void

where file.cgz is:
Code:
find live | cpio -o -H newc | gzip -9 > file.cgz
live folder contains filesystem.squashfs

Sorry for my English.
pzdr
Find all posts by this user
Quote this message in a reply
2016-10-23, 19:49 (This post was last modified: 2016-10-23 19:51 by anary.)
Post: #12
RE: EFI PXE bootstrap and NBI image support
(2016-10-23 13:20)NiKiZe Wrote:  Hu, Why are you chaining from ipxe to grub, when you can chain the kernel directly?

Because machines should not always enter Clonezilla, the default state is to boot the local OS. However, when a machine is selected to be re-imaged (via the drbl-client-switch command in the DRBL server), a Clonezilla menu item is generated in grub so that the machine enters Clonezilla on the next boot.
Find all posts by this user
Quote this message in a reply
2016-10-23, 20:46
Post: #13
RE: EFI PXE bootstrap and NBI image support
(2016-10-23 19:49)anary Wrote:  
(2016-10-23 13:20)NiKiZe Wrote:  Hu, Why are you chaining from ipxe to grub, when you can chain the kernel directly?

Because machines should not always enter Clonezilla, the default state is to boot the local OS. However, when a machine is selected to be re-imaged (via the drbl-client-switch command in the DRBL server), a Clonezilla menu item is generated in grub so that the machine enters Clonezilla on the next boot.

Then change that so it generates a ipxe menu instead, using grub at all when booting a linux from ipxe seems to be totally wrong.

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2016-10-23, 22:34 (This post was last modified: 2016-10-23 22:35 by anary.)
Post: #14
RE: EFI PXE bootstrap and NBI image support
(2016-10-23 20:46)NiKiZe Wrote:  Then change that so it generates a ipxe menu instead, using grub at all when booting a linux from ipxe seems to be totally wrong.

Yes, I think re-writing DRBL/Clonezilla menu configuration scripts to generate iPXE menus would be the most correct solution, but would also be quite the undertaking.

The question becomes "should iPXE be able to chainload grub EFI"?

If there is a bug in chainloading iPXE to grub EFI (as suggested in http://lists.ipxe.org/pipermail/ipxe-dev...05214.html ), it may be fixed with considerably less effort than re-writing all the grub menu generating scripts DRBL uses.
Find all posts by this user
Quote this message in a reply
Post Reply 




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