byebyebios - Man Page
x86 boot sector injector
Synopsis
byebyebios [OPTION]... RAW-DISK-IMAGE
byebyebios [OPTION]... BLOCK-DEVICE
Description
The byebyebios tool is to be used when an operating system installation for the x86 architecture is only intended to boot via UEFI firmware.
When pointed to either a raw disk image file, or a block device, containing the installation, it will inject a dummy x86 boot sector. If a user subsequently attempts to boot via legacy BIOS firmware, instead of UEFI, a message will be printed (on both the primary serial port and VGA display) indicating that UEFI is required.
Options
--boot-stub FILE-PATH
Override the default file path identifying the precompiled boot stub binary that will be injected
--message FILE-PATH
Override the default message text that is printed when the installation is booted under legacy BIOS firmware.
The message file must fit within the remaining free space of the boot sector. The dummy MBR and boot signature take 66 bytes, the boot stub 21 bytes, and the message <NUL> terminator a single byte. This leaves 424 bytes for the text message.
Note, the message file must use <CR><LF> line terminators.
--force
Normally byebyebios will validate that the disk image specified contains a valid GPT header signature before installing the dummy boot sector. This is a safety net against accidental overwriting data in a file/device that is not a bootable OS image, should the wrong path be given.
This option cause instalation of the boot sector even if the GPT signature is not found. Be careful with use of this option, as data loss will likely result if this tool is pointed to an inappropriate file with the GPT check disabled.
Examples
Injection post install
Create a disk image using virt-install(1) and inject a boot sector after installation is complete:
$ virt-install \ --virt-type kvm \ --arch x86_64 \ --boot uefi \ --name demo \ --disk bus=virtio,format=raw,size=4 \ ...other args... $ byebyebios /var/lib/libvirt/images/demo.img
Injection during install
Inject a boot sector as part of the installation process from an anaconda(1) kickstart file (or equivalent):
$ cat demo.ks ...snip... ignoredisk --only-use=vda clearpart --none --initlabel part /boot/efi --fstype="efi" --ondisk=vda --size=1007 --fsoptions="umask=0077,shortname=winnt" part / --fstype="ext4" --ondisk=vda --size=3087 ..snip... %post byebyebios /dev/vda %end
Customized warning message
To customize the warning message provide a custom text file with <CR><LF> line terminators:
$ echo "Bye Bye BIOS" | figlet -f bubble | unix2dos > msg.txt $ byebyebios --message msg.txt /var/lib/libvirt/images/demo.img
Bugs
Please report all bugs you discover to the upstream repository:
Alternatively, you may report bugs to your software distributor / vendor.
Authors
Daniel P. Berrangé
Copyright
Copyright (C) 2023 Red Hat
License
byebyebios is distributed under the terms of the MIT No Attribution license.
See Also
virt-install(1), anaconda(1)