Browse Source

Support the EFI Stub loader's splash image feature.

Checks if `uefi_splash_image` exists in `dracutsysroot` if not unset
`uefi_splash_image`. Alternate Value parameter expansion adds section-vma
for splash image to EFI stub loader when the path to image is valid and
not an empty file.

I did not test on other distributions, but on Arch Linux the `systemd`
package includes a splash image at the path
`/usr/share/systemd/bootctl/splash-arch.bmp`. Perhaps, if this is a
common practice, a default image could be gathered from that directory.

It is required that the image be in bitmap (`.bmp`) format according to
`splash.c`.

The code for `stub.c` and `splash.c` can be found at:
https://github.com/systemd/systemd/blob/master/src/boot/efi/stub.c
https://github.com/systemd/systemd/blob/master/src/boot/efi/splash.c
master
Donovan Tremura 5 years ago committed by Harald Hoyer
parent
commit
4237aeb040
  1. 4
      dracut.8.asc
  2. 3
      dracut.conf.5.asc
  3. 12
      dracut.sh

4
dracut.8.asc

@ -517,6 +517,10 @@ will not be able to boot.
_$prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_ _$prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
or _$prefix/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_ or _$prefix/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_


**--uefi-splash-image _<FILE>_**::
Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**) image
format.

**--kernel-image _<FILE>_**:: **--kernel-image _<FILE>_**::
Specifies the kernel image, which to include in the UEFI executable. The default is Specifies the kernel image, which to include in the UEFI executable. The default is
_/lib/modules/<KERNEL-VERSION>/vmlinuz_ or _/boot/vmlinuz-<KERNEL-VERSION>_ _/lib/modules/<KERNEL-VERSION>/vmlinuz_ or _/boot/vmlinuz-<KERNEL-VERSION>_

3
dracut.conf.5.asc

@ -205,6 +205,9 @@ provide a valid _/etc/fstab_.
_/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_ _/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
or _/usr/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_ or _/usr/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_


*uefi_splash_image=*"_<FILE>_"::
Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**) image format.

*uefi_secureboot_cert=*"_<FILE>_", *uefi_secureboot_key=*"_<FILE>_":: *uefi_secureboot_cert=*"_<FILE>_", *uefi_secureboot_key=*"_<FILE>_"::
Specifies a certificate and corresponding key, which are used to sign the created UEFI executable. Specifies a certificate and corresponding key, which are used to sign the created UEFI executable.
Requires both certificate and key need to be specified and _sbsign_ to be installed. Requires both certificate and key need to be specified and _sbsign_ to be installed.

12
dracut.sh

@ -236,6 +236,9 @@ Creates initial ramdisk images for preloading modules
--uefi Create an UEFI executable with the kernel cmdline and --uefi Create an UEFI executable with the kernel cmdline and
kernel combined kernel combined
--uefi-stub [FILE] Use the UEFI stub [FILE] to create an UEFI executable --uefi-stub [FILE] Use the UEFI stub [FILE] to create an UEFI executable
--uefi-splash-image [FILE]
Use [FILE] as a splash image when creating an UEFI
executable
--kernel-image [FILE] location of the kernel image --kernel-image [FILE] location of the kernel image


If [LIST] has multiple arguments, then you have to put these in quotes. If [LIST] has multiple arguments, then you have to put these in quotes.
@ -398,6 +401,7 @@ rearrange_params()
--long loginstall: \ --long loginstall: \
--long uefi \ --long uefi \
--long uefi-stub: \ --long uefi-stub: \
--long uefi-splash-image: \
--long kernel-image: \ --long kernel-image: \
--long no-hostonly-i18n \ --long no-hostonly-i18n \
--long hostonly-i18n \ --long hostonly-i18n \
@ -596,6 +600,8 @@ while :; do
--uefi) uefi="yes";; --uefi) uefi="yes";;
--uefi-stub) --uefi-stub)
uefi_stub_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;; uefi_stub_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
--uefi-splash-image)
uefi_splash_image_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
--kernel-image) --kernel-image)
kernel_image_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;; kernel_image_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
--no-machineid) --no-machineid)
@ -772,6 +778,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
[[ $reproducible_l ]] && reproducible="$reproducible_l" [[ $reproducible_l ]] && reproducible="$reproducible_l"
[[ $loginstall_l ]] && loginstall="$loginstall_l" [[ $loginstall_l ]] && loginstall="$loginstall_l"
[[ $uefi_stub_l ]] && uefi_stub="$uefi_stub_l" [[ $uefi_stub_l ]] && uefi_stub="$uefi_stub_l"
[[ $uefi_splash_image_l ]] && uefi_splash_image="$uefi_splash_image_l"
[[ $kernel_image_l ]] && kernel_image="$kernel_image_l" [[ $kernel_image_l ]] && kernel_image="$kernel_image_l"
[[ $machine_id_l ]] && machine_id="$machine_id_l" [[ $machine_id_l ]] && machine_id="$machine_id_l"


@ -2018,11 +2025,14 @@ if [[ $uefi = yes ]]; then


[[ -s $dracutsysrootdir/usr/lib/os-release ]] && uefi_osrelease="$dracutsysrootdir/usr/lib/os-release" [[ -s $dracutsysrootdir/usr/lib/os-release ]] && uefi_osrelease="$dracutsysrootdir/usr/lib/os-release"
[[ -s $dracutsysrootdir/etc/os-release ]] && uefi_osrelease="$dracutsysrootdir/etc/os-release" [[ -s $dracutsysrootdir/etc/os-release ]] && uefi_osrelease="$dracutsysrootdir/etc/os-release"
[[ -s "${dracutsysrootdir}${uefi_splash_image}" ]] && \
uefi_splash_image="${dracutsysroot}${uefi_splash_image}" || unset uefi_splash_image


if objcopy \ if objcopy \
${uefi_osrelease:+--add-section .osrel=$uefi_osrelease --change-section-vma .osrel=0x20000} \ ${uefi_osrelease:+--add-section .osrel=$uefi_osrelease --change-section-vma .osrel=0x20000} \
--add-section .cmdline="${uefi_outdir}/cmdline.txt" --change-section-vma .cmdline=0x30000 \ --add-section .cmdline="${uefi_outdir}/cmdline.txt" --change-section-vma .cmdline=0x30000 \
--add-section .linux="$kernel_image" --change-section-vma .linux=0x40000 \ ${uefi_splash_image:+--add-section .splash="$uefi_splash_image" --change-section-vma .splash=0x40000} \
--add-section .linux="$kernel_image" --change-section-vma .linux=0x2000000 \
--add-section .initrd="${DRACUT_TMPDIR}/initramfs.img" --change-section-vma .initrd=0x3000000 \ --add-section .initrd="${DRACUT_TMPDIR}/initramfs.img" --change-section-vma .initrd=0x3000000 \
"$uefi_stub" "${uefi_outdir}/linux.efi"; then "$uefi_stub" "${uefi_outdir}/linux.efi"; then
if [[ -n "${uefi_secureboot_key}" && -n "${uefi_secureboot_cert}" ]]; then \ if [[ -n "${uefi_secureboot_key}" && -n "${uefi_secureboot_cert}" ]]; then \

Loading…
Cancel
Save