Harald Hoyer from Red Hat has come up with a demonstration of booting the Linux kernel to a command prompt on a UEFI device using a single image. It is the userland proof of concept for the work done by Kay Sievers and David Herrmann in gummiboot. They created a UEFI loader which starts a linux kernel with an initrd and a kernel cmdline, all stuffed-in as the COFF section of the executable.
Hover did this using a shell script which creates a rescue image on Fedora using a rescue kernel and rescue initrd. The kernel cmdline parameter rd.retry is set to 20 seconds to wait for devices. Finally it drops to a shell as the root device is specified as “root=/dev/failme” which does not exist. You can fsck your devices, mount them and repair your system from this shell.
To try it out on Fedora, run:
# yum install gummiboot binutils # wget https://raw.githubusercontent.com/haraldh/mkrescue-uefi/master/mkrescue-uefi.sh # chmod +x mkrescue-uefi.sh # bash mkrescue-uefi.sh BOOTX64.EFI
Copy the generated BOOTX64.EFI to a UEFI-formatted bootable FAT32 USB volume under EFI/BOOT/ and point your BIOS to boot from the USB stick. If you are not sure how to create the FAT32 volume, refer to my earlier article on creating a UEFI bootable ArchBang USB.