diff -Nru flash-kernel-3.106ubuntu12/debian/changelog flash-kernel-3.106ubuntu13/debian/changelog --- flash-kernel-3.106ubuntu12/debian/changelog 2023-02-21 13:52:26.000000000 +0000 +++ flash-kernel-3.106ubuntu13/debian/changelog 2023-02-22 06:42:26.000000000 +0000 @@ -1,3 +1,11 @@ +flash-kernel (3.106ubuntu13) lunar; urgency=medium + + * Permit flash-kernel to workaround an inconsistent /boot directory when + triggered prior to the kernel finishing its triggers (LP: #2007827) + * Fine-tune the indents + + -- Ethan Hsieh Wed, 22 Feb 2023 14:42:26 +0800 + flash-kernel (3.106ubuntu12) lunar; urgency=medium * Add StarFive VisionFive 2 board to db/all.db (LP: #2007981) diff -Nru flash-kernel-3.106ubuntu12/functions flash-kernel-3.106ubuntu13/functions --- flash-kernel-3.106ubuntu12/functions 2023-02-21 13:52:26.000000000 +0000 +++ flash-kernel-3.106ubuntu13/functions 2023-02-22 06:42:26.000000000 +0000 @@ -1138,7 +1138,10 @@ case "$method" in "android") - [ -n "$ifile" ] || error "Initrd required for android method" + if [ ! -n "$ifile" ]; then + echo "flash-kernel: Initrd required for android method missing; expecting future run" >&2 + exit 0 + fi if abootimg -i "$android_boot_device" > /dev/null 2>&1; then part="$android_boot_device" else @@ -1203,12 +1206,15 @@ rm -f "$tmpdir/kernel" fi if [ -n "$boot_fit_path" ]; then - [ -n "$ifile" ] || error "Initrd required for FIT method" - # Write tmp file in same filesystem as final destination - fit_tmp="$boot_fit_path".tmp - mkimage_fit "$boot_its_file_name" "$fit_tmp" \ + if [ ! -n "$ifile" ]; then + echo "flash-kernel: Initrd required for FIT method missing; expecting future run" >&2 + exit 0 + fi + # Write tmp file in same filesystem as final destination + fit_tmp="$boot_fit_path".tmp + mkimage_fit "$boot_its_file_name" "$fit_tmp" \ "$kfile" "$ifile" "${kvers}" "$(find_dtb_file)" - backup_and_install "$fit_tmp" "$boot_fit_path" + backup_and_install "$fit_tmp" "$boot_fit_path" fi if [ -n "$boot_device" ]; then check_block_dev "$boot_device" @@ -1237,13 +1243,19 @@ backup_and_install "$tmpdir/uImage" "$boot_multi_path" fi if [ -n "$uiaddr" ]; then - [ -n "$ifile" ] || error "Initrd required for generic method with Initrd-Adress" + if [ ! -n "$ifile" ]; then + echo "flash-kernel: Initrd required for generic method with Initrd-Adress missing; expecting future run" >&2 + exit 0 + fi mkimage_initrd "$uiaddr" "$idesc" "$initrd" \ "$tmpdir/uInitrd" initrd="$tmpdir/uInitrd" fi if [ -n "$boot_initrd_path" ]; then - [ -n "$ifile" ] || error "Initrd required for generic method with Boot-Initrd-Path" + if [ ! -n "$ifile" ]; then + echo "flash-kernel: Initrd required for generic method with Boot-Initrd-Pathnn missing; expecting future run" >&2 + exit 0 + fi boot_initrd_path="$boot_mnt_dir/$boot_initrd_path" if [ "$boot_initrd_path_version" = "yes" ]; then boot_initrd_path="${boot_initrd_path}-${kvers}" @@ -1255,7 +1267,10 @@ fi backup_and_install "$initrd" "$boot_initrd_path" elif [ -n "$imtd" ]; then - [ -n "$ifile" ] || error "Initrd required for generic method with Mtd-Initrd" + if [ ! -n "$ifile" ]; then + echo "flash-kernel: Initrd required for generic method with Mtd-Initrd missing; expecting future run" >&2 + exit 0 + fi ipad=0 # padding isn't needed for U-Boot images if [ -z "$uiaddr" ]; then @@ -1331,13 +1346,19 @@ } ;; "symlink") - [ -n "$ifile" ] || error "Initrd required for symlink method" + if [ ! -n "$ifile" ]; then + echo "flash-kernel: Initrd required for symlink method missing; expecting future run" >&2 + exit 0 + fi rm -f /boot/initrd /boot/zImage ln -s "$(basename "$ifile")" /boot/initrd gen_kernel "$kfile" "/boot/zImage" "$machine_id" ;; "multi") - [ -n "$ifile" ] || error "Initrd required for multi method" + if [ ! -n "$ifile" ]; then + echo "flash-kernel: Initrd required for multi method missing; expecting future run" >&2 + exit 0 + fi gen_kernel "$kfile" "$tmpdir/kernel" "" # Hack to work around a bug in some U-Boot versions: if [ $(($(stat -c '%s' "$tmpdir/kernel") % 4)) -eq 0 ]; then @@ -1349,13 +1370,19 @@ backup_and_install "$tmpdir/uImage" "$boot_multi_path" ;; "redboot") - [ -n "$ifile" ] || error "Initrd required for redboot method" + if [ ! -n "$ifile" ]; then + echo "flash-kernel: Initrd required for redboot method missing; expecting future run" >&2 + exit 0 + fi flash_kernel "$kfile" "$kmtd" "$machine_id" pad=$(($imtdsize - $ifilesize)) flash_initrd "$ifile" "$imtd" $pad ;; "slug") - [ -n "$ifile" ] || error "Initrd required for slug method" + if [ ! -n "$ifile" ]; then + echo "flash-kernel: Initrd required for slug method missing; expecting future run" >&2 + exit 0 + fi case "$(dpkg --print-architecture)" in arm|armel) little_endian=1 @@ -1430,7 +1457,10 @@ echo "done." >&2 ;; "olpc") - [ -n "$ifile" ] || error "Initrd required for olpc method" + if [ ! -n "$ifile" ]; then + echo "flash-kernel: Initrd required for olpc method missing; expecting future run" >&2 + exit 0 + fi local olpcfth="$(mktemp --tmpdir=$tmpdir)" local olpc_boot_dir="$(findmnt -n --output target --target /boot)" local kernel="$(realpath --relative-to=$olpc_boot_dir $kfile |sed 's!/!\\\\!')"