[ipxe-devel] sanbooting FreeBSD ISO under UEFI

Christian Nilsson nikize at gmail.com
Mon Jan 23 19:46:27 UTC 2017


Hi Rick,

On Mon, Jan 23, 2017 at 7:29 PM, Rick Miller <vmiller at hostileadmin.com> wrote:
> Hi Shao,
>
> On Mon, Jan 23, 2017 at 10:28 AM, Shao Miller <ipxe at sha0.net> wrote:
>>
>> On 1/23/2017 10:27, Rick Miller wrote:
>>>
>>> Hi all,
>>>
>>> I currently use iPXE to load memdisk and, subsequently, a FreeBSD disk
>>> image to perform an OS installation to disk. This works great in BIOS, but
>>> upcoming requirements make UEFI a prerequisite.  Because memdisk is not
>>> UEFI-aware, new UEFI-aware media is necessary.  The current plan is to
>>> integrate the installation scripts (currently in the hard drive image) into
>>> a bootable FreeBSD ISO (something I’ve previous experience with) and instead
>>> of loading it via memdisk, load it directly from iPXE using `sanboot` (or
>>> similar).
>>>
>>> Unfortunately, I have been unable to get iPXE to sanboot an ISO.  It
>>> errors citing “Operation not permitted”.  The current working theory is that
>>> the necessary features aren’t enabled in the current UEFI-aware iPXE
>>> program.  This has lead me to the general.h[2] header file where many of the
>>> image types are disabled, including IMAGE_PXE, which seems to be the image
>>> type necessary for PXE booting.  However, uncommenting and building the
>>> resulting code via:
>>>
>>> # pwd
>>> /ipxe/src
>>> # make bin-x86_64-efi/ipxe.efi
>>>
>>> produces the following error:
>>>
>>>   [AR] bin-x86_64-efi/blib.a
>>> ar: creating bin-x86_64-efi/blib.a
>>>   [HOSTCC] util/elf2efi64
>>>   [VERSION] bin-x86_64-efi/version.ipxe.efi.o
>>>   [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
>>> bin-x86_64-efi/blib.a(pxe_entry.o): In function `pxe_segments':
>>> (.text16.data+0x26): undefined reference to `_data16_memsz'
>>> bin-x86_64-efi/blib.a(pxe_entry.o): In function `pxe_segments':
>>> (.text16.data+0x2e): undefined reference to `_data16_memsz'
>>> bin-x86_64-efi/blib.a(pxe_entry.o): In function `pxe_segments':
>>> (.text16.data+0x36): undefined reference to `_text16_memsz'
>>> bin-x86_64-efi/blib.a(pxe_entry.o): In function `pxe_segments':
>>> (.text16.data+0x3e): undefined reference to `_text16_memsz'
>>> bin-x86_64-efi/blib.a(pxe_entry.o): In function `pxenv':
>>> (.text16.data+0x76): undefined reference to `_data16_memsz'
>>> bin-x86_64-efi/blib.a(pxe_entry.o): In function `pxenv':
>>> (.text16.data+0x82): undefined reference to `_data16_memsz'
>>> bin-x86_64-efi/blib.a(pxe_entry.o): In function `pxenv':
>>> (.text16.data+0x86): undefined reference to `_text16_memsz'
>>> make: *** [bin-x86_64-efi/ipxe.efi.tmp] Error 1
>>> rm bin-x86_64-efi/version.ipxe.efi.o
>>>
>>> Are there additional options, such as PXE_STACK, that are required when
>>> booting a FreeBSD ISO from iPXE under UEFI, but perhaps disabled that might
>>> mitigate this error or perhaps this feature is unavailable under UEFI?
>>>
>>>
>>> [1] http://ipxe.org/efi/vision
>>> [2] https://git.ipxe.org/ipxe.git/blob/HEAD:/src/config/general.h
>>>
>>>
>> Good day, Rick.
>>
>> The following forum-post might be related:
>> http://forum.ipxe.org/showthread.php?tid=6896&pid=9117#pid9117
>
>
> It is related in the context of booting from an iSCSI target where I am
> booting from an HTTP target.  Having said that, the thread suggests
> additional patches are necessary to support iBFT under UEFI.  Could it be
> that these patches are required to enable sanboot to attach to the URL?
>
> --
> Take care
> Rick Miller
>

PXE or bzImage is only supported in pcbios mode since they requrire
BIOS calls, so no efi mode, efi mode will only boot efi compatible
binaries, nothing else so trying to enable IMAGE_PXE or IMAGE_BZIMAGE
will not be possible for EFI builds.
And syslinux memdisk is AFAIK a BIOS only implementation which
requires INT13 so will not be able to work in EFI mode.

The patches you might need that I mentioned in that forum post[1] is
to get proper iBFT handover for sanboot in efi mode, another is to be
able to change the name of efi executable if it is not located in the
default path, and another one is for some ISOs

You should be able to boot an EFI compliant ISO over iSCSI with
current ipxe.efi, but you might need one or more of those patches for
the boot to complete.
For BIOS mode you might want to try if everything works as you expect
with sanboot instead of memdisk and then take it from there to move to
EFI.

Shao: as mentioned in post #18 in that thread, basic sanboot support
for EFI was added in
https://git.ipxe.org/ipxe.git/commit/fd95c780b6ad39ab55344c0e4b9c2125c2c2f5ad

[1] http://forum.ipxe.org/showthread.php?tid=6896&pid=13392#pid13392



More information about the ipxe-devel mailing list