Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

splash image support #587

Merged
merged 2 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ core: zbm-release
install -m 0644 -t "$(DESTDIR)/$(MANDIR)/man8" -D docs/man/dist/man8/*.8
install -m 0755 -t "$(DESTDIR)/$(EXAMPLES)/hooks" -D contrib/*
install -m 0755 -t "$(DESTDIR)/$(EXAMPLES)" -D examples/*
install -m 0644 -t "$(DESTDIR)/$(EXAMPLES)" -D media/splash.bmp

dracut:
./install-tree.sh dracut "$(DESTDIR)/$(DRACUTDIR)/90zfsbootmenu"
Expand Down
8 changes: 7 additions & 1 deletion bin/generate-zbm
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,8 @@ sub createUEFIBundle {

# For now, default stub locations are x86_64 only
my @uefi_stub_defaults = qw(
/usr/lib/gummiboot/linuxx64.efi.stub
/usr/lib/systemd/boot/efi/linuxx64.efi.stub
/usr/lib/gummiboot/linuxx64.efi.stub
);

foreach my $stubloc (@uefi_stub_defaults) {
Expand Down Expand Up @@ -762,6 +762,12 @@ sub createUEFIBundle {
$uki_offset = addBundleSection( \@cmd, ".cmdline", $cmdline, $uki_offset, $uki_alignment );
}

if ( nonempty $config{EFI}{SplashImage} and -f $config{EFI}{SplashImage} ) {
# only supported with systemd-boot's efistub,
# but gummiboot doesn't care if the section exists
$uki_offset = addBundleSection( \@cmd, ".splash", $config{EFI}{SplashImage}, $uki_offset, $uki_alignment );
}

$uki_offset = addBundleSection( \@cmd, ".initrd", $initramfs, $uki_offset, $uki_alignment );

# Add the kernel last, so that it can decompress without overflowing other sections
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/void-linux/_include/zbm-install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Install ZFSBootMenu

.. code-block::

xbps-install -S zfsbootmenu gummiboot-efistub
xbps-install -S zfsbootmenu systemd-boot-efistub

.. include:: ../_include/configure-gen-zbm.rst

Expand Down
6 changes: 5 additions & 1 deletion docs/man/generate-zbm.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ EFI

**Stub**

The path to the EFI stub loader used to boot the unified bundle. If not set, a default of ``/usr/lib/gummiboot/linuxx64.efi.stub`` is assumed.
The path to the EFI stub loader used to boot the unified bundle. If not set, a default of either ``/usr/lib/systemd/boot/efi/linuxx64.efi.stub`` or ``/usr/lib/gummiboot/linuxx64.efi.stub`` is assumed.

**SplashImage**

The path to a bitmap image file (BMP) to use as a splash image before ZFSBootMenu loads. Only works if using systemd-boot's EFI stub loader. The ZFSBootMenu logo is available in BMP format at ``/usr/share/examples/zfsbootmenu/splash.bmp``.

EXAMPLE
=======
Expand Down
1 change: 1 addition & 0 deletions etc/zfsbootmenu/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ EFI:
ImageDir: /boot/efi/EFI/zbm
Versions: false
Enabled: false
SplashImage: /etc/zfsbootmenu/splash.bmp
Kernel:
CommandLine: ro quiet loglevel=0
1 change: 1 addition & 0 deletions etc/zfsbootmenu/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ Components:
EFI:
Versions: false
Enabled: true
SplashImage: /etc/zfsbootmenu/splash.bmp
zdykstra marked this conversation as resolved.
Show resolved Hide resolved
Kernel:
CommandLine: quiet loglevel=0 nomodeset
Binary file added media/splash.bmp
Binary file not shown.
2 changes: 1 addition & 1 deletion releng/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ RUN --mount=type=cache,target=/var/cache/xbps <<-EOF
# Install ZFSBootMenu dependencies and components necessary to build images
zbm_deps="$(xbps-query -Rp run_depends zfsbootmenu)"
xbps-install -y ${KERNELS} ${kern_headers} ${zbm_deps} \
zstd gummiboot-efistub curl yq-go bash kbd \
zstd systemd-boot-efistub curl yq-go bash kbd \
dracut mkinitcpio dracut-network gptfdisk iproute2 iputils parted \
dosfstools e2fsprogs efibootmgr cryptsetup openssh util-linux kpartx

Expand Down
2 changes: 1 addition & 1 deletion releng/docker/image-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ buildah run "${host_mounts[@]}" "${container}" \

buildah run "${host_mounts[@]}" "${container}" \
xbps-install -y "${kern_series[@]}" "${kern_headers[@]}" \
git zstd gummiboot-efistub curl yq-go bash kbd \
git zstd systemd-boot-efistub curl yq-go bash kbd \
dracut mkinitcpio dracut-network gptfdisk iproute2 iputils parted \
curl dosfstools e2fsprogs efibootmgr cryptsetup openssh util-linux kpartx

Expand Down
2 changes: 1 addition & 1 deletion testing/helpers/chroot-void.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
# Pre-install zfsbootmenu
if [ -x /root/zbm-populate.sh ]; then
xbps-query -Rp run_depends zfsbootmenu | xargs xbps-install -y
xbps-install -y git gummiboot-efistub
xbps-install -y git systemd-boot-efistub
SKIP_PERL=yes /root/zbm-populate.sh
rm /root/zbm-populate.sh
fi
2 changes: 1 addition & 1 deletion testing/helpers/zbm-populate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if [ -f /etc/zfsbootmenu/config.yaml ]; then
-e '/BootMountPoint:/d' -i /etc/zfsbootmenu/config.yaml

# Build the EFI executable if the stub is available
for stubdir in /usr/lib/gummiboot /usr/lib/systemd/boot/efi; do
for stubdir in /usr/lib/systemd/boot/efi /usr/lib/gummiboot; do
[ -r "${stubdir}/linuxx64.efi.stub" ] || continue
sed -e 's/Enabled:.*/Enabled: true/' -i /etc/zfsbootmenu/config.yaml
break
Expand Down
Loading