Skip to content
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
16 changes: 16 additions & 0 deletions debian/nullboot-fallback.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Ammend boot loader on successful kernel upgrades for TPM-backed FDE instances

# Runs after basic system initialization and local filesystems are mounted.
# This ensures a stable environment before proceeding to higher-level services.
After=sysinit.target local-fs.target

[Service]
Type=oneshot

# If BootCurrent is the latest kernel, update BootOrder
# Also ensures a bad kernel is not reset to BootNext if a boot was unsuccessful
ExecStart=/usr/bin/nullbootctl -no-boot-next

[Install]
WantedBy=multi-user.target
10 changes: 6 additions & 4 deletions debian/nullboot.postinst
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/sh
set -e
if [ "$1" = "triggered" ] || [ "$1" = "configure" ]; then
if [ -e "/boot/efi/EFI/ubuntu/" ]; then
nullbootctl
fi
if [ "$1" = "configure" ] && [ -e "/boot/efi/EFI/ubuntu/" ]; then
systemctl enable nullboot-fallback.service
nullbootctl
fi
if [ "$1" = "triggered" ] && [ -e "/boot/efi/EFI/ubuntu/" ]; then
nullbootctl
fi

#DEBHELPER#
3 changes: 3 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ override_dh_gencontrol:
dh_gencontrol -- -Vshim-signed:Version=$(SHIM_SIGNED_VERSION)

override_dh_auto_install:
mkdir -p debian/nullboot/etc/systemd/system
cp debian/nullboot-fallback.service debian/nullboot/etc/systemd/system/
chmod +x debian/nullboot/etc/systemd/system/nullboot-fallback.service
mkdir -p debian/nullboot/usr/lib/nullboot/shim
cp $(SHIM_DIR)/shim*.signed $(SHIM_DIR)/fb*.efi $(SHIM_DIR)/mm*.efi debian/nullboot/usr/lib/nullboot/shim
dh_auto_install -- --no-source
Loading