Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package sdbootutil for openSUSE:Factory checked in at 2023-09-21 22:14:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sdbootutil (Old) and /work/SRC/openSUSE:Factory/.sdbootutil.new.1770 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sdbootutil" Thu Sep 21 22:14:06 2023 rev:5 rq:1112550 version:1+git20230817.2a3cd34 Changes: -------- --- /work/SRC/openSUSE:Factory/sdbootutil/sdbootutil.changes 2023-08-14 22:36:27.224680905 +0200 +++ /work/SRC/openSUSE:Factory/.sdbootutil.new.1770/sdbootutil.changes 2023-09-21 22:15:08.747657484 +0200 @@ -1,0 +2,16 @@ +Thu Aug 17 12:02:02 UTC 2023 - [email protected] + +- Update to version 1+git20230817.2a3cd34: + * Ignore errors from efibootmgr + * Update spec file + * Add marker to flag installation using sdbootutil + * Refactor and fix boot entry installation + * Don't exit in warn() + * feat: use arg_esp_path directly + * fix: get esp_device from bootctl + * fix: only install shim for secure boot + * feat: create only non-existing entries & pass correct ESP partition + * fix: make efibootmgr silent + * feat: create boot menu entries when installed + +------------------------------------------------------------------- Old: ---- sdbootutil-1+git20230814.38973c7.obscpio New: ---- sdbootutil-1+git20230817.2a3cd34.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sdbootutil.spec ++++++ --- /var/tmp/diff_new_pack.G3s3K5/_old 2023-09-21 22:15:09.959701473 +0200 +++ /var/tmp/diff_new_pack.G3s3K5/_new 2023-09-21 22:15:09.963701619 +0200 @@ -27,7 +27,7 @@ %define git_version %{nil} %endif Name: sdbootutil -Version: 1+git20230814.38973c7%{git_version} +Version: 1+git20230817.2a3cd34%{git_version} Release: 0 Summary: script to install shim with sd-boot License: MIT @@ -53,7 +53,8 @@ Plugin scripts for snapper to handle BLS config files %package rpm-scriptlets -Summary: dummy scriptlets for the kernel +Summary: Scripts to create boot entries on kernel updates +Requires: sdbootutil >= %{version}-%{release} # make sure to not replace scriptlets with nops on systems that # use grub2 Conflicts: grub2 @@ -62,7 +63,8 @@ Obsoletes: %{name}-filetriggers < %{version} %description rpm-scriptlets -Empty scriptlets to satisfy kernel dependencies +Scriptlets that call sdbootutil to create boot entries when +kernels are installed or removed %prep %setup -q ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.G3s3K5/_old 2023-09-21 22:15:10.007703216 +0200 +++ /var/tmp/diff_new_pack.G3s3K5/_new 2023-09-21 22:15:10.007703216 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/lnussel/sdbootutil.git</param> - <param name="changesrevision">38973c76394e4c4120c626df82ecb8fc956e5847</param></service></servicedata> + <param name="changesrevision">2a3cd34a65361917adef2023dc312362af7e970d</param></service></servicedata> (No newline at EOF) ++++++ sdbootutil-1+git20230814.38973c7.obscpio -> sdbootutil-1+git20230817.2a3cd34.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sdbootutil-1+git20230814.38973c7/sdbootutil new/sdbootutil-1+git20230817.2a3cd34/sdbootutil --- old/sdbootutil-1+git20230814.38973c7/sdbootutil 2023-08-14 15:22:49.000000000 +0200 +++ new/sdbootutil-1+git20230817.2a3cd34/sdbootutil 2023-08-17 14:01:37.000000000 +0200 @@ -16,6 +16,8 @@ arg_esp_path="$SYSTEMD_ESP_PATH" arg_entry_token= arg_arch= +arg_no_variables= +# for x in vmlinuz image vmlinux linux bzImage uImage Image zImage; do image=vmlinuz rollback=() @@ -118,7 +120,6 @@ else echo "Warning: $*" >&2 fi - exit 1 } reset_rollback() @@ -578,7 +579,7 @@ has_stale=1 elif [ "${known_kernels[$k]}" = missing ]; then known_kernels["$k"]="$id" - is_bootable=1 + is_bootable=1 fi done < <(jq -r '.[]|select(has("linux"))|[.linux,.id]|join(" ")'< "$entryfile") } @@ -711,32 +712,46 @@ return 0 } -# TODO: need to create a boot variable if it's not the first installation install_sdboot() { - local sdboot=$(find_sdboot) + local sdboot blkpart drive partno + + sdboot=$(find_sdboot) mkdir -p "$boot_root/loader/entries" + mountpoint -q "$boot_root" || err "$boot_root is not a valid mountpoint" + blkpart="$(findmnt -nvo SOURCE "$boot_root")" + [ -L "/sys/class/block/${blkpart##*/}" ] || err "$blkpart is not a partition" + drive="$(readlink -f "/sys/class/block/${blkpart##*/}")" + drive="${drive%/*}" + drive="/dev/${drive##*/}" + read -r partno < "/sys/class/block/${blkpart##*/}"/partition + if [ -e "$shimdir/shim.efi" ]; then + log_info "Installing systemd-boot with shim into $boot_root" entry="$sdboot_dst/shim.efi" for i in MokManager shim; do install -D "$shimdir/$i.efi" "$boot_root$sdboot_dst/$i.efi" done install -D "$sdboot" "$boot_root$sdboot_dst/grub.efi" - echo "shim.efi,openSUSE Boot Manager" | iconv -f ascii -t ucs2 > "$boot_root/$sdboot_dst/boot.csv" + # boot entry point for i in MokManager fallback; do install -D "$shimdir/$i.efi" "$boot_root/EFI/BOOT/$i.efi" done install -D "$shimdir/shim.efi" "$boot_root/EFI/BOOT/BOOT${firmware_arch^^}.EFI" else + log_info "Installing systemd-boot into $boot_root" entry="$sdboot_dst/${sdboot##*/}" install -D "$sdboot" "$boot_root$entry" install -D "$sdboot" "$boot_root/EFI/BOOT/BOOT${firmware_arch^^}.EFI" - echo "${sdboot##*/},openSUSE Boot Manager" | iconv -f ascii -t ucs2 > "$boot_root/$sdboot_dst/boot.csv" fi + # this is for shim to create the entry if missing + echo "${entry##*/},openSUSE Boot Manager" | iconv -f ascii -t ucs2 > "$boot_root/$sdboot_dst/boot.csv" + mkdir -p "$boot_root/$entry_token" + :> "$boot_root/$entry_token/installed_by_sdbootutil" mkdir -p "/etc/kernel" [ -s /etc/kernel/entry-token ] || echo "$entry_token" > /etc/kernel/entry-token update_random_seed @@ -744,6 +759,10 @@ [ -s "$boot_root/loader/entries.srel" ] || echo type1 > "$boot_root/loader/entries.srel" [ -e "$boot_root/loader/loader.conf" ] || echo -e "#timeout 3\n#console-mode keep\n" > "$boot_root/loader/loader.conf" + + set -x + # Create boot menu entry if it does not exist + [ -n "$arg_no_variables" ] || efibootmgr | grep -q 'Boot.*openSUSE Boot Manager' || efibootmgr -q --create --disk "$drive" --part "$partno" --label "openSUSE Boot Manager" --loader "$entry" || true } settle_entry_token() @@ -852,7 +871,7 @@ ####### main ####### -getopttmp=$(getopt -o hc:v --long help,flicker,verbose,esp-path:,entry-token:,arch:,image: -n "${0##*/}" -- "$@") +getopttmp=$(getopt -o hc:v --long help,flicker,verbose,esp-path:,entry-token:,arch:,image:,no-variables -n "${0##*/}" -- "$@") eval set -- "$getopttmp" while true ; do @@ -864,6 +883,7 @@ --arch) arg_arch="$2"; shift 2 ;; --entry-token) arg_entry_token="$2"; shift 2 ;; --image) image="$2"; shift 2 ;; + --no-variables) arg_no_variables=1; shift ;; --) shift ; break ;; *) echo "Internal error!" ; exit 1 ;; esac @@ -921,7 +941,13 @@ elif [ "$1" = "set-default-snapshot" ]; then set_default_snapshot "${2:-$root_snapshot}" elif [ "$1" = "is-installed" ]; then - sdboot_version > /dev/null + if sdboot_version > /dev/null && [ -e "$boot_root/$entry_token/installed_by_sdbootutil" ]; then + log_info "systemd-boot was installed using sdbootutil" + exit 0 + else + log_info "not installed using this tool" + exit 1 + fi elif [ "$1" = "list-kernels" ]; then list_kernels "${2:-$root_snapshot}" elif [ "$1" = "is-bootable" ]; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sdbootutil-1+git20230814.38973c7/sdbootutil.spec new/sdbootutil-1+git20230817.2a3cd34/sdbootutil.spec --- old/sdbootutil-1+git20230814.38973c7/sdbootutil.spec 2023-08-14 15:22:49.000000000 +0200 +++ new/sdbootutil-1+git20230817.2a3cd34/sdbootutil.spec 2023-08-17 14:01:37.000000000 +0200 @@ -53,7 +53,8 @@ Plugin scripts for snapper to handle BLS config files %package rpm-scriptlets -Summary: dummy scriptlets for the kernel +Summary: Scripts to create boot entries on kernel updates +Requires: sdbootutil >= %{version}-%{release} # make sure to not replace scriptlets with nops on systems that # use grub2 Conflicts: grub2 @@ -62,7 +63,8 @@ Obsoletes: %{name}-filetriggers < %{version} %description rpm-scriptlets -Empty scriptlets to satisfy kernel dependencies +Scriptlets that call sdbootutil to create boot entries when +kernels are installed or removed %prep %setup -q ++++++ sdbootutil.obsinfo ++++++ --- /var/tmp/diff_new_pack.G3s3K5/_old 2023-09-21 22:15:10.119707281 +0200 +++ /var/tmp/diff_new_pack.G3s3K5/_new 2023-09-21 22:15:10.123707425 +0200 @@ -1,5 +1,5 @@ name: sdbootutil -version: 1+git20230814.38973c7 -mtime: 1692019369 -commit: 38973c76394e4c4120c626df82ecb8fc956e5847 +version: 1+git20230817.2a3cd34 +mtime: 1692273697 +commit: 2a3cd34a65361917adef2023dc312362af7e970d
