Skip to content

Commit

Permalink
set_boot_target: Set (and log) the boot target for the newly installe…
Browse files Browse the repository at this point in the history
…d image
  • Loading branch information
sysrich committed May 6, 2024
1 parent d1f84df commit 9b71e32
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions usr/bin/tik
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ load_modules "pre" "custom"
get_disk
get_img
dump_image "${TIK_INSTALL_IMAGE}" "${TIK_INSTALL_DEVICE}"
set_boot_target

load_modules "post"
load_modules "post" "custom"
Expand Down
17 changes: 17 additions & 0 deletions usr/lib/tik/lib/tik-functions
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,23 @@ function dump_image {
prun /usr/bin/sync | d --progress --title="Syncing" --pulsate --auto-close --no-cancel --width=400
}

function set_boot_target {
if [ "${debug}" == "1" ]; then
log "[debug] Not setting EFI boot target"
else
# Cleanup any existing openSUSE boot entries
prun efibootmgr -B -L "openSUSE Boot Manager"
prun efibootmgr -B -L "opensuse-secureboot"
prun efibootmgr -B -L "opensuse"
# Clear boot order, to make absolutely sure this new installation is first
prun efibootmgr -O
# Currently assuming Aeon-like partition layout and shim name. This function will need extra intelligence to probe partitions for other image layouts
prun efibootmgr -c -L "openSUSE Boot Manager" -d ${TIK_INSTALL_DEVICE} -l "\EFI\systemd\shim.efi" -p 2
# Log to show the resulting eficonfig
log "[efibootmgr] $(prun efibootmgr)"
fi
}


load_modules() {
local module_dir
Expand Down

0 comments on commit 9b71e32

Please sign in to comment.