iPXE discussion forum
Unable to open initramfs - Printable Version

+- iPXE discussion forum (https://forum.ipxe.org)
+-- Forum: iPXE user forums (/forumdisplay.php?fid=1)
+--- Forum: General (/forumdisplay.php?fid=2)
+--- Thread: Unable to open initramfs (/showthread.php?tid=18186)



Unable to open initramfs - daferret - 2019-05-10 08:38

Hi, I'm having trouble with the initramfs I am using when booting in UEFI. The initramfs works when in legacy but when trying to run on UEFI the system it "failed to open file". Additional info for context: My goal is just to load the ramdisk image and not load to any storage device because I intend to test all storage devices by running destructive tools against them, hope that makes sense :-)

Here are the events leading up to failure:
1) Boot into ipxe with embed script:
#!ipxe

echo Will keep trying to get a valid DHCP address before loading the image
echo via http://x.x.x.x/ipxe/ipxe-usbnic.script
:retry
ifstat
ifconf -c dhcp || goto retry
chain http://x.x.x.x/api/ipxe/ipxe-usbnic.script

2) Loads the following from the ipxe-usbnic.script
#!ipxe
set mfg_data http://x.x.x.x/data
set mfg_releases http://x.x.x.x/releases
menu
item uut_os Boot the UUT Ramdisk Based OS (the default)

choose --default uut_os --timeout 10000 target && goto ${target}
:uut_os
set default_uut_os ${mfg_data}/uut-os/default
kernel ${default_uut_os}/vmlinuz console=ttyS0,11520 fastboot initrd=${default_uut_os}/initramfs.gz mfg_setup=${mfg_releases}/mfg/default/admin/uut_os/setup-after-boot.sh
initrd ${default_uut_os}/initramfs.gz
boot

:shell
shell
:exit
exit

It looks like it's able to download the images, but when trying to unpack the initramfs.gz it fails. Do I need to modify anything for UEFI? Thanks...any hints would be greatly appreciated.


RE: Unable to open initramfs - NiKiZe - 2019-05-10 08:56

(2019-05-10 08:38)daferret Wrote:  set default_uut_os ${mfg_data}/uut-os/default
kernel ${default_uut_os}/vmlinuz console=ttyS0,11520 fastboot initrd=${default_uut_os}/initramfs.gz mfg_setup=${mfg_releases}/mfg/default/admin/uut_os/setup-after-boot.sh
initrd ${default_uut_os}/initramfs.gz

You need to differ between initrd to download the file which can use full path to find it.
When it is downloaded however there is no path information, this can be seen by using imgstat.

what you need is to change your kernel line to only have
initrd=initramfs.gz
that is without the ${default_uut_os}/ part


RE: Unable to open initramfs - daferret - 2019-05-10 09:27

(2019-05-10 08:56)NiKiZe Wrote:  
(2019-05-10 08:38)daferret Wrote:  set default_uut_os ${mfg_data}/uut-os/default
kernel ${default_uut_os}/vmlinuz console=ttyS0,11520 fastboot initrd=${default_uut_os}/initramfs.gz mfg_setup=${mfg_releases}/mfg/default/admin/uut_os/setup-after-boot.sh
initrd ${default_uut_os}/initramfs.gz

You need to differ between initrd to download the file which can use full path to find it.
When it is downloaded however there is no path information, this can be seen by using imgstat.

what you need is to change your kernel line to only have
initrd=initramfs.gz
that is without the ${default_uut_os}/ part

Cool...thanks...will try it out and let you know how it goes!


RE: Unable to open initramfs - daferret - 2019-05-10 18:20

(2019-05-10 08:56)NiKiZe Wrote:  
(2019-05-10 08:38)daferret Wrote:  set default_uut_os ${mfg_data}/uut-os/default
kernel ${default_uut_os}/vmlinuz console=ttyS0,11520 fastboot initrd=${default_uut_os}/initramfs.gz mfg_setup=${mfg_releases}/mfg/default/admin/uut_os/setup-after-boot.sh
initrd ${default_uut_os}/initramfs.gz

You need to differ between initrd to download the file which can use full path to find it.
When it is downloaded however there is no path information, this can be seen by using imgstat.

what you need is to change your kernel line to only have
initrd=initramfs.gz
that is without the ${default_uut_os}/ part

Worked like a charm! Thanks again!