diff -pruN 3.109/README 3.109ubuntu7/README
--- 3.109/README	2022-03-23 14:22:28.000000000 +0000
+++ 3.109ubuntu7/README	2025-05-08 10:08:03.000000000 +0000
@@ -136,6 +136,15 @@ The supported fields are:
   kernel,  initrd and U-Boot script; Boot-Kernel-Path, Boot-Initrd-Path and
   Boot-Script-Path are then taken relative to this boot device
 
+* Boot-FIT-Path: (optional) when present, a FIT image will be created. It
+  contains the path where the FIT image will be written.
+
+* Boot-ITS-File-Name: (optional) name of the ITS file used to describe the
+  content of the FIT image when a FIT image is being created.
+  @@LINUX_IMAGE_FILE@@, @@INITRD_FILE@@, @@DEVICE_TREE_FILE@@ and
+  @@KERNEL_VERSION@@ strings in the file will be replaced by the path to
+  the kernel, initrd, device tree blob and kernel version respectively.
+
 
 Configuration
 - - - - - - -
diff -pruN 3.109/bootscript/all/bootscr.rpi 3.109ubuntu7/bootscript/all/bootscr.rpi
--- 3.109/bootscript/all/bootscr.rpi	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/bootscript/all/bootscr.rpi	2025-05-08 10:08:03.000000000 +0000
@@ -0,0 +1,109 @@
+# Ubuntu Classic RPi U-Boot script (for armhf and arm64)
+
+# Expects to be called with the following environment variables set:
+#
+#  devtype              e.g. mmc/scsi etc
+#  devnum               The device number of the given type
+#  distro_bootpart      The partition containing the boot files
+#                       (introduced in u-boot mainline 2016.01)
+#  prefix               Prefix within the boot partiion to the boot files
+#  kernel_addr_r        Address to load the kernel to
+#  fdt_addr_r           Address to load the FDT to
+#  ramdisk_addr_r       Address to load the initrd to.
+
+# Take fdt addr from the prior stage boot loader, if available
+if test -n "$fdt_addr"; then
+  fdt addr ${fdt_addr}
+  fdt move ${fdt_addr} ${fdt_addr_r}  # implicitly sets fdt active
+else
+  fdt addr ${fdt_addr_r}
+fi
+fdt get value bootargs /chosen bootargs
+
+setenv bootargs "@@LINUX_KERNEL_CMDLINE_DEFAULTS@@ ${bootargs} @@LINUX_KERNEL_CMDLINE@@"
+@@UBOOT_ENV_EXTRA@@
+
+@@UBOOT_PREBOOT_EXTRA@@
+
+setenv kernel_filename vmlinuz
+setenv core_state "/uboot/ubuntu/boot.sel"
+setenv kernel_bootpart ${distro_bootpart}
+
+if test -z "${fk_image_locations}"; then
+  setenv fk_image_locations ${prefix}
+fi
+
+for pathprefix in ${fk_image_locations}; do
+  if load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${pathprefix}${core_state}; then
+    # Core image; set defaults for core's state then import from the first
+    # boot.sel file. Then load the mutable boot.sel file from the next
+    # partition
+    setenv kernel_filename kernel.img
+    setenv kernel_vars "snap_kernel snap_try_kernel kernel_status"
+    setenv recovery_vars "snapd_recovery_mode snapd_recovery_system snapd_recovery_kernel"
+    setenv snapd_recovery_mode "install"
+    setenv snapd_standard_params "panic=-1"
+
+    env import -c ${kernel_addr_r} ${filesize} ${recovery_vars}
+    setenv bootargs "${bootargs} snapd_recovery_mode=${snapd_recovery_mode} snapd_recovery_system=${snapd_recovery_system} ${snapd_standard_params}"
+
+    if test "${snapd_recovery_mode}" = "run"; then
+      setexpr kernel_bootpart ${distro_bootpart} + 1
+      load ${devtype} ${devnum}:${kernel_bootpart} ${kernel_addr_r} ${pathprefix}${core_state}
+      env import -c ${kernel_addr_r} ${filesize} ${kernel_vars}
+      setenv kernel_name "${snap_kernel}"
+
+      if test -n "${kernel_status}"; then
+        if test "${kernel_status}" = "try"; then
+          if test -n "${snap_try_kernel}"; then
+            setenv kernel_status trying
+            setenv kernel_name "${snap_try_kernel}"
+          fi
+        elif test "${kernel_status}" = "trying"; then
+          setenv kernel_status ""
+        fi
+        env export -c ${kernel_addr_r} ${kernel_vars}
+        save ${devtype} ${devnum}:${kernel_bootpart} ${kernel_addr_r} ${pathprefix}${core_state} ${filesize}
+      fi
+      setenv kernel_prefix "${pathprefix}uboot/ubuntu/${kernel_name}/"
+    else
+      setenv kernel_prefix "${pathprefix}systems/${snapd_recovery_system}/kernel/"
+    fi
+  else
+    # Classic image; the kernel prefix is unchanged, nothing special to do
+    setenv kernel_prefix "${pathprefix}"
+  fi
+
+  # Store the gzip header (1f 8b) in the kernel area for comparison to the
+  # header of the image we load. Load "$kernel_filename" into the portion of
+  # memory for the RAM disk (because we want to uncompress to the kernel area
+  # if it's compressed) and compare the word at the start
+  mw.w ${kernel_addr_r} 0x8b1f  # little endian
+  if load ${devtype} ${devnum}:${kernel_bootpart} ${ramdisk_addr_r} ${kernel_prefix}${kernel_filename}; then
+    kernel_size=${filesize}
+    if cmp.w ${kernel_addr_r} ${ramdisk_addr_r} 1; then
+      # gzip compressed image (NOTE: *not* a self-extracting gzip compressed
+      # kernel, just a kernel image that has been gzip'd)
+      echo "Decompressing kernel..."
+      unzip ${ramdisk_addr_r} ${kernel_addr_r}
+      setenv kernel_size ${filesize}
+      setenv try_boot "booti"
+    else
+      # Possibly self-extracting or uncompressed; copy data into the kernel area
+      # and attempt launch with bootz then booti
+      echo "Copying kernel..."
+      cp.b ${ramdisk_addr_r} ${kernel_addr_r} ${kernel_size}
+      setenv try_boot "bootz booti"
+    fi
+
+    if load ${devtype} ${devnum}:${kernel_bootpart} ${ramdisk_addr_r} ${kernel_prefix}initrd.img; then
+      setenv ramdisk_param "${ramdisk_addr_r}:${filesize}"
+    else
+      setenv ramdisk_param "-"
+    fi
+    for cmd in ${try_boot}; do
+        echo "Booting Ubuntu (with ${cmd}) from ${devtype} ${devnum}:${partition}..."
+        ${cmd} ${kernel_addr_r} ${ramdisk_param} ${fdt_addr_r}
+    done
+  fi
+done
diff -pruN 3.109/bootscript/arm64/bootscr.mediatek-aiot 3.109ubuntu7/bootscript/arm64/bootscr.mediatek-aiot
--- 3.109/bootscript/arm64/bootscr.mediatek-aiot	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/bootscript/arm64/bootscr.mediatek-aiot	2025-05-08 10:08:03.000000000 +0000
@@ -0,0 +1,70 @@
+# Ubuntu Core and Classic MTK AIoT U-Boot script (for armhf and arm64)
+
+# Expects to be called with the following environment variables set:
+#
+#  devtype              e.g. mmc/scsi etc
+#  devnum               The device number of the given type
+#  distro_bootpart      The partition containing the boot files
+#                       (introduced in u-boot mainline 2016.01)
+#  prefix               Prefix within the boot partiion to the boot files
+#  kernel_addr_r        Address to load the kernel to
+#  boot_conf            The dtb filename
+
+setenv bootargs "@@LINUX_KERNEL_CMDLINE_DEFAULTS@@ ${bootargs} @@LINUX_KERNEL_CMDLINE@@"
+@@UBOOT_ENV_EXTRA@@
+
+@@UBOOT_PREBOOT_EXTRA@@
+
+setenv kernel_filename fitImage
+setenv core_state "/uboot/ubuntu/boot.sel"
+setenv kernel_bootpart ${distro_bootpart}
+
+if test -z "${fk_image_locations}"; then
+  setenv fk_image_locations ${prefix}
+fi
+
+for pathprefix in ${fk_image_locations}; do
+  if load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${pathprefix}${core_state}; then
+    # Core image; set defaults for core's state then import from the first
+    # boot.sel file. Then load the mutable boot.sel file from the next
+    # partition
+    setenv kernel_filename kernel.img
+    setenv kernel_vars "snap_kernel snap_try_kernel kernel_status"
+    setenv recovery_vars "snapd_recovery_mode snapd_recovery_system snapd_recovery_kernel"
+    setenv snapd_recovery_mode "install"
+    setenv snapd_standard_params "panic=-1"
+
+    env import -c ${kernel_addr_r} ${filesize} ${recovery_vars}
+    setenv bootargs "${bootargs} snapd_recovery_mode=${snapd_recovery_mode} snapd_recovery_system=${snapd_recovery_system} ${snapd_standard_params}"
+
+    if test "${snapd_recovery_mode}" = "run"; then
+      setexpr kernel_bootpart ${distro_bootpart} + 1
+      load ${devtype} ${devnum}:${kernel_bootpart} ${kernel_addr_r} ${pathprefix}${core_state}
+      env import -c ${kernel_addr_r} ${filesize} ${kernel_vars}
+      setenv kernel_name "${snap_kernel}"
+
+      if test -n "${kernel_status}"; then
+        if test "${kernel_status}" = "try"; then
+          if test -n "${snap_try_kernel}"; then
+            setenv kernel_status trying
+            setenv kernel_name "${snap_try_kernel}"
+          fi
+        elif test "${kernel_status}" = "trying"; then
+          setenv kernel_status ""
+        fi
+        env export -c ${kernel_addr_r} ${kernel_vars}
+        save ${devtype} ${devnum}:${kernel_bootpart} ${kernel_addr_r} ${pathprefix}${core_state} ${filesize}
+      fi
+      setenv kernel_prefix "${pathprefix}uboot/ubuntu/${kernel_name}/"
+    else
+      setenv kernel_prefix "${pathprefix}systems/${snapd_recovery_system}/kernel/"
+    fi
+  else
+    # Classic image; the kernel prefix is unchanged, nothing special to do
+    setenv kernel_prefix "${pathprefix}"
+  fi
+  if load ${devtype} ${devnum}:${kernel_bootpart} ${kernel_addr_r} ${kernel_prefix}${kernel_filename}; then
+    echo "Booting Ubuntu (with bootm ${kernel_addr_r}${boot_conf})"
+    bootm ${kernel_addr_r}${boot_conf}
+  fi
+done
diff -pruN 3.109/bootscript/arm64/bootscr.zynqmp 3.109ubuntu7/bootscript/arm64/bootscr.zynqmp
--- 3.109/bootscript/arm64/bootscr.zynqmp	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/bootscript/arm64/bootscr.zynqmp	2025-05-08 10:08:03.000000000 +0000
@@ -0,0 +1,226 @@
+# This is a boot script for U-Boot
+# Generate boot.scr:
+# mkimage -c none -A arm -T script -d boot.cmd boot.scr
+# For initrd, when using a file override:
+# mkimage -A arm -O linux -T ramdisk -d initrd.img rootfs.cpio.gz.u-boot
+# Kernel "Image" file must be of EFI type:
+# - Get vmlinuz from Ubuntu rootfs and uncompress
+# system.dtb is a normal dtb file
+#
+# Here is the ZCU board support list:
+#
+# ZCU102/104/106
+#
+# Here is the Kria board support list:
+#
+# Kria board                     | DTB Name                      |
+# :----------------------------- | :---------------------------- |
+# Revision A   KR Carrier Card   | smk-k26-revA-sck-kr-g-revA    |
+# Revision B/1 KR Carrier Card   | smk-k26-revA-sck-kr-g-revB    |
+# Revision A/Z KV Carrier Card   | smk-k26-revA-sck-kv-g-revA    |
+# Revision B/1 KV Carrier Card   | smk-k26-revA-sck-kv-g-revB    |
+# Revision A   KD Carrier Card   | smk-k24-revA-sck-kd-g-revA    |
+#
+# Here is the Versal board support list:
+#
+# vck190
+#
+#
+# Variables expected to be in the environment:
+#
+# Variable       | Description                                                                           |
+# :------------- | :------------------------------------------------------------------------------------ |
+# card1_name     | Holds the information about the carrier card configuration (utilized for Kria family) |
+# boot_targets   | Includes the list of devices that can be used to look for image boot                  |
+#
+#
+# Local Variables:
+#
+# Variable        | Description                                                                           |
+# :-------------- | :------------------------------------------------------------------------------------ |
+# kria            | Holds the information about the type of the board in Kria family.                     | \
+#                 | Possible values when it is initialized: "KD", "KR", "KV"                              |
+################
+
+@@UBOOT_ENV_EXTRA@@
+
+# Legacy KV260 U-Boot was not eliminating a space at the end of the card1_name variable
+# e.g. card1_name is "SCK-KV-G ", not "SCK-KV-G"
+# Force drop of the extra space character by setenv for backward compatibility
+setenv card1_name $card1_name
+
+for boot_target in ${boot_targets};
+do
+	if test "${boot_target}" = "jtag" ; then
+		booti 0x00200000 0x04000000 0x00100000
+		exit;
+	fi
+	if test "${boot_target}" = "mmc0" || test "${boot_target}" = "mmc1" || test "${boot_target}" = "usb0" || test "${boot_target}" = "usb1"; then
+		# Load alternative bitstream if present
+		if test -e ${devtype} ${devnum}:${distro_bootpart} /system.bit; then
+			echo "Loading alternative bitstream"
+			load ${devtype} ${devnum}:${distro_bootpart} 0x10000000 system.bit
+			fpga load 0 0x10000000 $filesize
+		fi
+
+		# Check for KR/KV260 board and choose the proper device tree
+		if test "${card1_name}" = "SCK-KV-G" || test "${card1_name}" = "SCK-KR-G" || test "${card1_name}" = "SCK-KD-G"; then
+			echo "Selecting DT for Kria boards"
+			if test "${card1_name}" = "SCK-KV-G"; then
+				setenv kria "KV"
+				if test "${card1_rev}" = "Z" || test "${card1_rev}" = "A"; then
+					# revA dtb also supports revZ boards
+					boot_conf=#conf-smk-k26-revA-sck-kv-g-revA
+				elif test "${card1_rev}" = "B" || test "${card1_rev}" = "1" || test "${card1_rev}" = "2"; then
+					# revB dtb also supports rev1 and rev2 boards
+					boot_conf=#conf-smk-k26-revA-sck-kv-g-revB
+				else
+					# fallback to the latest dtb
+					boot_conf=#conf-smk-k26-revA-sck-kv-g-revB
+				fi
+			elif test "${card1_name}" = "SCK-KR-G"; then
+				setenv kria "KR"
+				if test "${card1_rev}" = "B" || test "${card1_rev}" = "1"; then
+					# revB dtb also supports rev1 dtb
+					boot_conf=#conf-smk-k26-revA-sck-kr-g-revB
+				elif test "${card1_rev}" = "A"; then
+					boot_conf=#conf-smk-k26-revA-sck-kr-g-revA
+				else
+					# fallback to the latest dtb
+					boot_conf=#conf-smk-k26-revA-sck-kr-g-revB
+				fi
+			elif test "${card1_name}" = "SCK-KD-G"; then
+				boot_conf=#conf-zynqmp-smk-kd-g-revA
+				setenv kria "KD"
+			else
+				# fallback dtb
+				boot_conf=#conf-zynqmp-smk-k26-revA
+				echo "The detected Kria board is not in the supported list"
+			fi
+			echo "Kria DT: ${boot_conf}"
+		fi
+
+		setenv bootargs "root=LABEL=writable rootwait"
+		if test "${card1_name}" = "SCK-KR-G" || test "${card1_name}" = "SCK-KV-G" || test "${card1_name}" = "SCK-KD-G"; then
+			setenv bootargs "${bootargs} earlycon console=ttyPS1,115200 console=tty1 clk_ignore_unused uio_pdrv_genirq.of_id=generic-uio xilinx_tsn_ep.st_pcp=4"
+		elif test "${board_name}" = "versal"; then
+			setenv bootargs "${bootargs} earlycon=pl011,mmio32,0xFF000000,115200n8 console=ttyAMA0 clk_ignore_unused"
+		else
+			setenv bootargs "${bootargs} earlycon console=ttyPS0,115200 console=tty1 uio_pdrv_genirq.of_id=generic-uio"
+		fi
+
+		echo "Configuring the cma value based on the board type"
+		fdt addr $fdtcontroladdr
+		# For ZCU: ZynqMP ZCU1* Rev*
+		# For Kria: ZynqMP K26 Rev*
+		# For Kria: ZynqMP K24 Rev*
+		fdt get value model_test / model
+		if test $kria = "KD"; then
+			cma="512M"
+		elif  test -n $kria; then
+			cma="1000M"
+		elif setexpr model_test gsub '.*104.*' 104; then
+			cma="700M"
+		elif setexpr model_test gsub '.*106.*' 106; then
+			cma="1200M"
+		elif setexpr model_test gsub '.*102.*' 102 || setexpr model_test gsub '.*111.*' 111; then
+			cma="1000M"
+		# Versal's dtb files has included the default CMA value.
+		# The bootargs will take precedence. So, please remove the commented-out code when you want to set it
+		elif setexpr model_test gsub '.*vck190.*' vck190; then
+			#cma="600M"
+			echo "The CMA value is not being set by U-boot for this board - the value will be set by Linux"
+		fi
+		if test -n $cma; then
+			echo "cma=${cma}"
+			setenv bootargs "${bootargs} cma=${cma}"
+		fi
+
+		# Get custom values from /etc/default/flash-kernel
+		setenv bootargs "@@LINUX_KERNEL_CMDLINE_DEFAULTS@@ ${bootargs} @@LINUX_KERNEL_CMDLINE@@"
+		img_addr=-
+		initrd_addr=-
+
+		# Take dtb from boot image unless Kria, where we take from FIT
+		if test -n $kria; then
+			dtb_addr=0x10000000${boot_conf}
+		else
+			dtb_addr=$fdtcontroladdr
+		fi
+
+		if test -e ${devtype} ${devnum}:${distro_bootpart} /Image; then
+			echo "Loading Image"
+			img_addr=0x00200000
+			load ${devtype} ${devnum}:${distro_bootpart} ${img_addr} Image;
+		fi
+		if test -e ${devtype} ${devnum}:${distro_bootpart} /user-override.dtb; then
+			echo "Loading user-override.dtb"
+			dtb_addr=0x70000000
+			load ${devtype} ${devnum}:${distro_bootpart} ${dtb_addr} user-override.dtb;
+		fi
+		if test -e ${devtype} ${devnum}:${distro_bootpart} /rootfs.cpio.gz.u-boot; then
+			echo "Loading rootfs.cpio.gz.u-boot"
+			initrd_addr=0x04000000
+			load ${devtype} ${devnum}:${distro_bootpart} ${initrd_addr} rootfs.cpio.gz.u-boot
+		fi
+
+		@@UBOOT_PREBOOT_EXTRA@@
+
+		if test $img_addr = "-" || test $initrd_addr = "-"; then
+			if test -e ${devtype} ${devnum}:${distro_bootpart} /image.fit; then
+				echo "Loading image.fit"
+				load ${devtype} ${devnum}:${distro_bootpart} 0x10000000 image.fit;
+				if test $img_addr = "-"; then
+					if test -n $kria; then
+						img_addr=0x10000000${boot_conf}
+					else
+						img_addr=0x10000000
+					fi
+				fi
+				if test $initrd_addr = "-"; then
+					if test -n $kria; then
+						initrd_addr=0x10000000${boot_conf}
+					else
+						initrd_addr=0x10000000
+					fi
+				fi
+			fi
+		fi
+		if test "${img_addr}" -eq "0x10000000"; then
+			bootm ${img_addr} ${initrd_addr} ${dtb_addr}
+		elif test "${img_addr}" -eq "0x00200000"; then
+			booti ${img_addr} ${initrd_addr} ${dtb_addr}
+		fi
+		echo "No kernel found in ${devtype}"
+		exit;
+	fi
+	if test "${boot_target}" = "xspi0" || test "${boot_target}" = "qspi" || test "${boot_target}" = "qspi0"; then
+		sf probe 0 0 0;
+		if test "image.fit" = "image.fit"; then
+			sf read 0x10000000 0xF00000 0x6400000;
+			bootm 0x10000000;
+			exit;
+		fi
+		if test "image.fit" = "Image"; then
+			sf read 0x00200000 0xF00000 0x1D00000;
+			sf read 0x04000000 0x4000000 0x4000000
+			booti 0x00200000 0x04000000 0x00100000
+			exit;
+		fi
+		exit;
+	fi
+	if test "${boot_target}" = "nand" || test "${boot_target}" = "nand0"; then
+		nand info
+		if test "image.fit" = "image.fit"; then
+			nand read 0x10000000 0x4100000 0x6400000;
+			bootm 0x10000000;
+			exit;
+		fi
+		if test "image.fit" = "Image"; then
+			nand read 0x00200000 0x4100000 0x3200000;
+			nand read 0x04000000 0x7800000 0x3200000;
+			booti 0x00200000 0x04000000 0x00100000
+			exit;
+		fi
+	fi
+done
diff -pruN 3.109/bootscript/arm64/bootscr.zynqmp.kria 3.109ubuntu7/bootscript/arm64/bootscr.zynqmp.kria
--- 3.109/bootscript/arm64/bootscr.zynqmp.kria	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/bootscript/arm64/bootscr.zynqmp.kria	2025-05-08 10:08:03.000000000 +0000
@@ -0,0 +1,207 @@
+# This is a boot script for U-Boot
+# Generate boot.scr:
+# mkimage -c none -A arm -T script -d boot.cmd boot.scr
+# For initrd, when using a file override:
+# mkimage -A arm -O linux -T ramdisk -d initrd.img rootfs.cpio.gz.u-boot
+# Kernel "Image" file must be of EFI type:
+# - Get vmlinuz from Ubuntu rootfs and uncompress
+# system.dtb is a normal dtb file
+#
+#
+# Here is the Kria board support list:
+#
+# Kria board                     | DTB Name                      |
+# :----------------------------- | :---------------------------- |
+# Revision A   KR Carrier Card   | smk-k26-revA-sck-kr-g-revA    |
+# Revision B/1 KR Carrier Card   | smk-k26-revA-sck-kr-g-revB    |
+# Revision A/Z KV Carrier Card   | smk-k26-revA-sck-kv-g-revA    |
+# Revision B/1 KV Carrier Card   | smk-k26-revA-sck-kv-g-revB    |
+# Revision A   KD Carrier Card   | smk-k24-revA-sck-kd-g-revA    |
+#
+#
+# Variables expected to be in the environment:
+#
+# Variable       | Description                                                                           |
+# :------------- | :------------------------------------------------------------------------------------ |
+# card1_name     | Holds the information about the carrier card configuration (utilized for Kria family) |
+# boot_targets   | Includes the list of devices that can be used to look for image boot                  |
+#
+#
+# Local Variables:
+#
+# Variable        | Description                                                                           |
+# :-------------- | :------------------------------------------------------------------------------------ |
+# kria            | Holds the information about the type of the board in Kria family.                     | \
+#                 | Possible values when it is initialized: "KD", "KR", "KV"                              |
+################
+
+@@UBOOT_ENV_EXTRA@@
+
+# Legacy KV260 U-Boot was not eliminating a space at the end of the card1_name variable
+# e.g. card1_name is "SCK-KV-G ", not "SCK-KV-G"
+# Force drop of the extra space character by setenv for backward compatibility
+setenv card1_name $card1_name
+
+for boot_target in ${boot_targets};
+do
+  if test "${boot_target}" = "jtag" ; then
+    booti 0x00200000 0x04000000 0x00100000
+    exit;
+  fi
+  if test "${boot_target}" = "mmc0" || test "${boot_target}" = "mmc1" || test "${boot_target}" = "usb0" || test "${boot_target}" = "usb1"; then
+    # Load alternative bitstream if present
+    if test -e ${devtype} ${devnum}:${distro_bootpart} /system.bit; then
+      echo "Loading alternative bitstream"
+      load ${devtype} ${devnum}:${distro_bootpart} 0x10000000 system.bit
+      fpga load 0 0x10000000 $filesize
+    fi
+
+    # Check for KR/KV260 board and choose the proper device tree
+    if test "${card1_name}" = "SCK-KV-G" || test "${card1_name}" = "SCK-KR-G" || test "${card1_name}" = "SCK-KD-G"; then
+      echo "Selecting DT for Kria boards"
+      if test "${card1_name}" = "SCK-KV-G"; then
+        setenv kria "KV"
+        if test "${card1_rev}" = "Z" || test "${card1_rev}" = "A"; then
+          # revA dtb also supports revZ boards
+          boot_conf=#conf-smk-k26-revA-sck-kv-g-revA
+        elif test "${card1_rev}" = "B" || test "${card1_rev}" = "1" || test "${card1_rev}" = "2"; then
+          # revB dtb also supports rev1 and rev2 boards
+          boot_conf=#conf-smk-k26-revA-sck-kv-g-revB
+        else
+          # fallback to the latest dtb
+          boot_conf=#conf-smk-k26-revA-sck-kv-g-revB
+        fi
+      elif test "${card1_name}" = "SCK-KR-G"; then
+        setenv kria "KR"
+        if test "${card1_rev}" = "B" || test "${card1_rev}" = "1"; then
+          # revB dtb also supports rev1 dtb
+          boot_conf=#conf-smk-k26-revA-sck-kr-g-revB
+        elif test "${card1_rev}" = "A"; then
+          boot_conf=#conf-smk-k26-revA-sck-kr-g-revA
+        else
+          # fallback to the latest dtb
+          boot_conf=#conf-smk-k26-revA-sck-kr-g-revB
+        fi
+      elif test "${card1_name}" = "SCK-KD-G"; then
+        boot_conf=#conf-zynqmp-smk-kd-g-revA
+        setenv kria "KD"
+      else
+        # fallback dtb
+        boot_conf=#conf-zynqmp-smk-k26-revA
+        echo "The detected Kria board is not in the supported list"
+      fi
+      echo "Kria DT: ${boot_conf}"
+    fi
+
+    setenv bootargs "root=LABEL=writable rootwait"
+    if test "${card1_name}" = "SCK-KR-G" || test "${card1_name}" = "SCK-KV-G" || test "${card1_name}" = "SCK-KD-G"; then
+      setenv bootargs "${bootargs} earlycon console=ttyPS1,115200 console=tty1 clk_ignore_unused uio_pdrv_genirq.of_id=generic-uio xilinx_tsn_ep.st_pcp=4"
+    else
+      setenv bootargs "${bootargs} earlycon console=ttyPS0,115200 console=tty1 uio_pdrv_genirq.of_id=generic-uio"
+    fi
+
+    echo "Configuring the cma value based on the board type"
+
+    fdt addr $fdtcontroladdr
+    # For Kria: ZynqMP K26 Rev*
+    # For Kria: ZynqMP K24 Rev*
+    fdt get value model_test / model
+    if test $kria = "KD"; then
+      cma="512M"
+    elif  test -n $kria; then
+      cma="800M"
+    fi
+
+    if test -n $cma; then
+      echo "cma=${cma}"
+      setenv bootargs "${bootargs} cma=${cma}"
+    fi
+
+    # Get custom values from /etc/default/flash-kernel
+    setenv bootargs "@@LINUX_KERNEL_CMDLINE_DEFAULTS@@ ${bootargs} @@LINUX_KERNEL_CMDLINE@@"
+    img_addr=-
+    initrd_addr=-
+
+    # Take dtb from boot image unless Kria, where we take from FIT
+    if test -n $kria; then
+      dtb_addr=0x10000000${boot_conf}
+    else
+      dtb_addr=$fdtcontroladdr
+    fi
+
+    if test -e ${devtype} ${devnum}:${distro_bootpart} /Image; then
+      echo "Loading Image"
+      img_addr=0x00200000
+      load ${devtype} ${devnum}:${distro_bootpart} ${img_addr} Image;
+    fi
+    if test -e ${devtype} ${devnum}:${distro_bootpart} /user-override.dtb; then
+      echo "Loading user-override.dtb"
+      dtb_addr=0x70000000
+      load ${devtype} ${devnum}:${distro_bootpart} ${dtb_addr} user-override.dtb;
+    fi
+    if test -e ${devtype} ${devnum}:${distro_bootpart} /rootfs.cpio.gz.u-boot; then
+      echo "Loading rootfs.cpio.gz.u-boot"
+      initrd_addr=0x04000000
+      load ${devtype} ${devnum}:${distro_bootpart} ${initrd_addr} rootfs.cpio.gz.u-boot
+    fi
+
+    @@UBOOT_PREBOOT_EXTRA@@
+
+    if test $img_addr = "-" || test $initrd_addr = "-"; then
+      if test -e ${devtype} ${devnum}:${distro_bootpart} /image.fit; then
+        echo "Loading image.fit"
+        load ${devtype} ${devnum}:${distro_bootpart} 0x10000000 image.fit;
+        if test $img_addr = "-"; then
+          if test -n $kria; then
+            img_addr=0x10000000${boot_conf}
+          else
+            img_addr=0x10000000
+          fi
+        fi
+        if test $initrd_addr = "-"; then
+          if test -n $kria; then
+            initrd_addr=0x10000000${boot_conf}
+          else
+            initrd_addr=0x10000000
+          fi
+        fi
+      fi
+    fi
+    if test "${img_addr}" -eq "0x10000000"; then
+      bootm ${img_addr} ${initrd_addr} ${dtb_addr}
+    elif test "${img_addr}" -eq "0x00200000"; then
+      booti ${img_addr} ${initrd_addr} ${dtb_addr}
+    fi
+    echo "No kernel found in ${devtype}"
+    exit;
+  fi
+  if test "${boot_target}" = "xspi0" || test "${boot_target}" = "qspi" || test "${boot_target}" = "qspi0"; then
+    sf probe 0 0 0;
+    if test "image.fit" = "image.fit"; then
+      sf read 0x10000000 0xF00000 0x6400000;
+      bootm 0x10000000;
+      exit;
+    fi
+    if test "image.fit" = "Image"; then
+      sf read 0x00200000 0xF00000 0x1D00000;
+      sf read 0x04000000 0x4000000 0x4000000
+      booti 0x00200000 0x04000000 0x00100000
+      exit;
+    fi
+    exit;
+  fi
+  if test "${boot_target}" = "nand" || test "${boot_target}" = "nand0"; then
+    nand info
+    if test "image.fit" = "image.fit"; then
+      nand read 0x10000000 0x4100000 0x6400000;
+      bootm 0x10000000;
+      exit;
+    fi
+    if test "image.fit" = "Image"; then
+      nand read 0x00200000 0x4100000 0x3200000;
+      nand read 0x04000000 0x7800000 0x3200000;
+      booti 0x00200000 0x04000000 0x00100000
+      exit;
+    fi
+  fi
+done
diff -pruN 3.109/db/all.db 3.109ubuntu7/db/all.db
--- 3.109/db/all.db	2025-04-08 22:26:17.000000000 +0000
+++ 3.109ubuntu7/db/all.db	2025-10-17 13:19:14.000000000 +0000
@@ -8,6 +8,10 @@ DTB-Id: sun5i-a10s-wobo-i5.dtb
 U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
+Machine: Acer Swift 14 AI (SF14-11)
+Kernel-Flavors: any
+DTB-Id: qcom/x1p64100-acer-swift-sf14-11.dtb
+
 Machine: Allwinner A23 Evaluation Board
 Kernel-Flavors: armmp armmp-lpae
 Boot-Script-Path: /boot/boot.scr
@@ -30,7 +34,7 @@ U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
 Machine: Allwinner D1 Nezha
-Kernel-Flavors: allwinner riscv64
+Kernel-Flavors: any
 DTB-Id: allwinner/sun20i-d1-nezha.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -72,6 +76,22 @@ Machine: ASUS Vivobook S 15
 Kernel-Flavors: any
 DTB-Id: qcom/x1e80100-asus-vivobook-s15.dtb
 
+Machine: ASUS Zenbook A14 (UX3407QA)
+Kernel-Flavors: any
+DTB-Id: qcom/x1p42100-asus-zenbook-a14.dtb
+
+Machine: ASUS Zenbook A14 (UX3407QA, LCD)
+Kernel-Flavors: any
+DTB-Id: qcom/x1p42100-asus-zenbook-a14-lcd.dtb
+
+Machine: ASUS Zenbook A14 (UX3407QA, OLED)
+Kernel-Flavors: any
+DTB-Id: qcom/x1p42100-asus-zenbook-a14.dtb
+
+Machine: ASUS Zenbook A14 (UX3407RA)
+Kernel-Flavors: any
+DTB-Id: qcom/x1e80100-asus-zenbook-a14.dtb
+
 Machine: Auxtek t003 A10s hdmi tv-stick
 Kernel-Flavors: armmp
 Boot-Script-Path: /boot/boot.scr
@@ -122,14 +142,14 @@ U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
 Machine: BeagleBoard.org BeagleBone AI-64
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 Boot-Script-Path: /boot/boot.scr
 DTB-Id: ti/k3-j721e-beagleboneai64.dtb
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: BeagleV Starlight Beta
-Kernel-Flavors: generic riscv64
+Kernel-Flavors: any
 DTB-Id: starfive/jh7100-beaglev-starlight.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -363,7 +383,7 @@ U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
 Machine: CZ.NIC Turris Mox Board
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 Boot-Script-Path: /boot/boot.scr
 DTB-Id: marvell/armada-3720-turris-mox.dtb
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -390,6 +410,28 @@ U-Boot-Initrd-Address: 0x00800000
 Required-Packages: u-boot-tools
 Bootloader-Sets-Incorrect-Root: yes
 
+Machine: DeepComputing FML13V01
+Kernel-Flavors: any
+DTB-Id: starfive/jh7110-deepcomputing-fml13v01.dtb
+Boot-Script-Path: /boot/boot.scr
+U-Boot-Script-Name: bootscr.uboot-generic
+Required-Packages: u-boot-tools
+
+Machine: DeepComputing FML13V03
+Kernel-Flavors: any
+DTB-Id: eswin/eic7702-deepcomputing-fml13v03.dtb
+Boot-Script-Path: /boot/boot.scr
+U-Boot-Script-Name: bootscr.uboot-generic
+Required-Packages: u-boot-tools
+
+Machine: Dell Inspiron 14 Plus 7441
+Kernel-Flavors: any
+DTB-Id: qcom/x1e80100-dell-inspiron-14-plus-7441.dtb
+
+Machine: Dell Latitude 7455
+Kernel-Flavors: any
+DTB-Id: qcom/x1e80100-dell-latitude-7455.dtb
+
 Machine: Dell XPS 13 9345
 Kernel-Flavors: any
 DTB-Id: qcom/x1e80100-dell-xps13-9345.dtb
@@ -440,7 +482,7 @@ U-Boot-Script-Name: bootscr.uboot-generi
 Required-Packages: u-boot-tools
 
 Machine: Firefly-RK3399 Board
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: rockchip/rk3399-firefly.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -484,7 +526,7 @@ U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
 Machine: FriendlyARM NanoPi NEO 2
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 Boot-Script-Path: /boot/boot.scr
 DTB-Id: allwinner/sun50i-h5-nanopi-neo2.dtb
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -498,7 +540,7 @@ U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
 Machine: FriendlyARM NanoPi NEO Plus2
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 Boot-Script-Path: /boot/boot.scr
 DTB-Id: allwinner/sun50i-h5-nanopi-neo-plus2.dtb
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -613,35 +655,35 @@ U-Boot-Script-Name: bootscr.uboot-generi
 Required-Packages: u-boot-tools
 
 Machine: Hardkernel ODROID-C2
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: amlogic/meson-gxbb-odroidc2.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Hardkernel ODROID-C4
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: amlogic/meson-sm1-odroid-c4.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Hardkernel ODROID-HC4
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: amlogic/meson-sm1-odroid-hc4.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Hardkernel ODROID-N2
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: amlogic/meson-g12b-odroid-n2.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Hardkernel ODROID-N2Plus
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: amlogic/meson-g12b-odroid-n2-plus.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -928,7 +970,7 @@ U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
 Machine: Lenovo Miix 630
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 Boot-Script-Path: /boot/boot.scr
 DTB-Id: qcom/msm8998-lenovo-miix-630.dtb
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -938,12 +980,24 @@ Machine: Lenovo ThinkPad T14s Gen 6
 Kernel-Flavors: any
 DTB-Id: qcom/x1e78100-lenovo-thinkpad-t14s.dtb
 
+Machine: Lenovo ThinkPad T14s Gen 6 (LCD)
+Kernel-Flavors: any
+DTB-Id: qcom/x1e78100-lenovo-thinkpad-t14s.dtb
+
+Machine: Lenovo ThinkPad T14s Gen 6 (OLED)
+Kernel-Flavors: any
+DTB-Id: qcom/x1e78100-lenovo-thinkpad-t14s-oled.dtb
+
+Machine: Lenovo ThinkPad X13s
+Kernel-Flavors: any
+DTB-Id: qcom/sc8280xp-lenovo-thinkpad-x13s.dtb
+
 Machine: Lenovo ThinkPad X13s
 Kernel-Flavors: any
 DTB-Id: qcom/sc8280xp-lenovo-thinkpad-x13s.dtb
 
 Machine: Lenovo Yoga C630
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 Boot-Script-Path: /boot/boot.scr
 DTB-Id: qcom/sdm850-lenovo-yoga-c630.dtb
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -987,21 +1041,21 @@ Machine: linux,dummy-virt
 Machine: Marvell 8040 MACCHIATOBin
 Machine: Marvell 8040 MACCHIATOBin Double-shot
 Machine: Marvell 8040 MACHIATOBin
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: marvell/armada-8040-mcbin.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Marvell 8040 MACCHIATOBin Single-shot
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: marvell/armada-8040-mcbin-singleshot.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Marvell Armada 8040 DB board
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: marvell/armada-8040-db.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -1097,6 +1151,15 @@ Boot-Initrd-Path: /boot/uInitrd
 Boot-DTB-Path: /boot/dtb
 Required-Packages: u-boot-tools
 
+Machine: MediaTek MT8195 demo board
+Kernel-Flavors: mtk
+Method: generic
+Boot-Script-Path: /boot/firmware/boot.scr
+U-Boot-Script-Name: bootscr.mediatek-aiot
+Boot-FIT-Path: /boot/firmware/fitImage
+Boot-ITS-File-Name: image-mediatek-aiot-i1200.its
+Required-Packages: u-boot-tools
+
 Machine: Mele A1000
 Kernel-Flavors: armmp
 Boot-Script-Path: /boot/boot.scr
@@ -1153,9 +1216,16 @@ DTB-Id: sun9i-a80-optimus.dtb
 U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
+Machine: Microchip PIC64GX Curiosity Kit
+Kernel-Flavors: any
+DTB-Id: microchip/pic64gx-curiosity-kit.dtb
+Boot-Script-Path: /boot/boot.scr
+U-Boot-Script-Name: bootscr.uboot-generic
+Required-Packages: u-boot-tools
+
 Machine: Microchip PolarFire-SoC Icicle Kit
-Kernel-Flavors: generic riscv64
-DTB-Id: microchip/microchip-mpfs-icicle-kit.dtb
+Kernel-Flavors: any
+DTB-Id: microchip/mpfs-icicle-kit.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
@@ -1288,6 +1358,13 @@ Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
+Machine: NXP S32G274A-RDB2
+Method: generic
+DTB-Id: s32g274a-rdb2.dtb
+Boot-FIT-Path: /boot/firmware/fitImage
+Boot-ITS-File-Name: image-nxp-s32.its
+Required-Packages: u-boot-tools
+
 Machine: Olimex A10-OLinuXino-LIME
 Kernel-Flavors: armmp
 Boot-Script-Path: /boot/boot.scr
@@ -1366,21 +1443,21 @@ U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
 Machine: Olimex A64 Teres-I
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: allwinner/sun50i-a64-teres-i.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Olimex A64-Olinuxino
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: allwinner/sun50i-a64-olinuxino.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Olimex A64-Olinuxino-eMMC
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: allwinner/sun50i-a64-olinuxino-emmc.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -1417,63 +1494,63 @@ U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
 Machine: OrangePi One Plus
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: allwinner/sun50i-h6-orangepi-one-plus.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: PHICOMM N1
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: amlogic/meson-gxl-s905d-phicomm-n1.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Pine64 LTS
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: allwinner/sun50i-a64-pine64-lts.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Pine64 Pinebook
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: allwinner/sun50i-a64-pinebook.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Pine64 Pinebook Pro
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: rockchip/rk3399-pinebook-pro.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Pine64 Rock64
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: rockchip/rk3328-rock64.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Pine64 RockPro64
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: rockchip/rk3399-rockpro64.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Pine64 RockPro64 v2.0
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: rockchip/rk3399-rockpro64-v2.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Pine64 RockPro64 v2.1
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: rockchip/rk3399-rockpro64.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -1487,14 +1564,14 @@ U-Boot-Script-Name: bootscr.uboot-generi
 Required-Packages: u-boot-tools
 
 Machine: Pine64+
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: allwinner/sun50i-a64-pine64-plus.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Pinebook
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: allwinner/sun50i-a64-pinebook.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -1552,8 +1629,17 @@ DTB-Id: sun8i-a23-polaroid-mid2809pxe04.
 U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
+Machine: Pumpkin MT8183
+Kernel-Flavors: mtk
+Method: generic
+Boot-Script-Path: /boot/firmware/boot.scr
+U-Boot-Script-Name: bootscr.mediatek-aiot
+Boot-FIT-Path: /boot/firmware/fitImage
+Boot-ITS-File-Name: image-mediatek-aiot-i500.its
+Required-Packages: u-boot-tools
+
 Machine: Purism Librem 5 devkit
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: freescale/imx8mq-librem5-devkit.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -1655,6 +1741,10 @@ Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
+Machine: Qualcomm Technologies, Inc. X1E80100 CRD
+Kernel-Flavors: any
+DTB-Id: qcom/x1e80100-crd.dtb
+
 Machine: R7 A10s hdmi tv-stick
 Kernel-Flavors: armmp
 Boot-Script-Path: /boot/boot.scr
@@ -1670,28 +1760,28 @@ U-Boot-Script-Name: bootscr.uboot-generi
 Required-Packages: u-boot-tools
 
 Machine: Radxa ROCK 4C+
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: rockchip/rk3399-rock-4c-plus.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Radxa ROCK Pi 4A
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: rockchip/rk3399-rock-pi-4a.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Radxa ROCK Pi 4B
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: rockchip/rk3399-rock-pi-4b.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Radxa ROCK Pi 4C
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: rockchip/rk3399-rock-pi-4c.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -1739,41 +1829,101 @@ U-Boot-Script-Name: bootscr.uboot-generi
 Required-Packages: u-boot-tools
 Boot-Script-Path: /boot/boot.scr
 
-Machine: Raspberry Pi 2 Model B
-Kernel-Flavors: armmp armmp-lpae
-DTB-Id: bcm2836-rpi-2-b.dtb
-U-Boot-Script-Name: bootscr.uboot-generic
-Required-Packages: u-boot-tools
-Boot-Script-Path: /boot/boot.scr
+# Please ignore the DTB-Id in the following entries; the "pi" method copies
+# *all* dtbs (including all dtb overlays) found to ensure that the storage can
+# be moved between supported models.
 
-Machine: Raspberry Pi 3 Compute Module
-Kernel-Flavors: arm64 armmp armmp-lpae
-DTB-Id: broadcom/bcm2837-rpi-cm3-io3.dtb
-U-Boot-Script-Name: bootscr.uboot-generic
-Required-Packages: u-boot-tools
-Boot-Script-Path: /boot/boot.scr
+Machine: Raspberry Pi 2 Model B
+Machine: Raspberry Pi 2 Model B Rev 1.2
+Machine: Raspberry Pi 2 Model B Rev *
+Kernel-Flavors: raspi
+Method: pi-try
+DTB-Id: bcm2710-rpi-2-b.dtb
+
+Machine: Raspberry Pi 3 Model A+
+Machine: Raspberry Pi 3 Model A Plus
+Machine: Raspberry Pi 3 Model A Plus Rev 1.0
+Machine: Raspberry Pi 3 Model A Plus Rev *
+Kernel-Flavors: raspi
+Method: pi-try
+DTB-Id: bcm2710-rpi-3-b-plus.dtb
+# XXX when a 3A+ specific dtb is added to linux-raspi, use it here
 
+# Raspberry Pi 3 (BCM2710)
 Machine: Raspberry Pi 3 Model B
-Kernel-Flavors: arm64 armmp armmp-lpae
-DTB-Id: broadcom/bcm2837-rpi-3-b.dtb
-U-Boot-Script-Name: bootscr.uboot-generic
-Required-Packages: u-boot-tools
-Boot-Script-Path: /boot/boot.scr
+Machine: Raspberry Pi 3 Model B Rev 1.2
+Machine: Raspberry Pi 3 Model B Rev *
+Kernel-Flavors: raspi
+Method: pi-try
+DTB-Id: bcm2710-rpi-3-b.dtb
 
-Machine: Raspberry Pi 3 Model B Plus Rev 1.3
 Machine: Raspberry Pi 3 Model B+
-Kernel-Flavors: arm64 armmp armmp-lpae
-DTB-Id: broadcom/bcm2837-rpi-3-b-plus.dtb
-U-Boot-Script-Name: bootscr.uboot-generic
-Required-Packages: u-boot-tools
-Boot-Script-Path: /boot/boot.scr
+Machine: Raspberry Pi 3 Model B Plus
+Machine: Raspberry Pi 3 Model B Plus Rev 1.3
+Machine: Raspberry Pi 3 Model B Plus Rev *
+Kernel-Flavors: raspi
+Method: pi-try
+DTB-Id: bcm2710-rpi-3-b-plus.dtb
+
+Machine: Raspberry Pi 4 Model B
+Machine: Raspberry Pi 4 Model B Rev 1.1
+Machine: Raspberry Pi 4 Model B Rev 1.2
+Machine: Raspberry Pi 4 Model B Rev 1.4
+Machine: Raspberry Pi 4 Model B Rev 1.5
+Machine: Raspberry Pi 4 Model B Rev *
+Kernel-Flavors: raspi raspi-realtime
+Method: pi-try
+DTB-Id: bcm2711-rpi-4-b.dtb
 
+Machine: Raspberry Pi 400
 Machine: Raspberry Pi 400 Rev 1.0
-Kernel-Flavors: arm64 armmp armmp-lpae
-DTB-Id: broadcom/bcm2711-rpi-400.dtb
-U-Boot-Script-Name: bootscr.uboot-generic
-Required-Packages: u-boot-tools
-Boot-Script-Path: /boot/boot.scr
+Machine: Raspberry Pi 400 Rev 1.1
+Machine: Raspberry Pi 400 Rev *
+Kernel-Flavors: raspi raspi-realtime
+Method: pi-try
+DTB-Id: bcm2711-rpi-400.dtb
+
+Machine: Raspberry Pi 5 Model B
+Machine: Raspberry Pi 5 Model B Rev 1.0
+Machine: Raspberry Pi 5 Model B Rev *
+Kernel-Flavors: raspi raspi-realtime
+Method: pi-try
+DTB-Id: bcm2712-rpi-5-b.dtb
+
+Machine: Raspberry Pi 500
+Machine: Raspberry Pi 500 Rev 1.0
+Machine: Raspberry Pi 500 Rev *
+Kernel-Flavors: raspi raspi-realtime
+Method: pi-try
+DTB-Id: bcm2712d0-rpi-5-b.dtb
+
+Machine: Raspberry Pi Compute Module 3
+Machine: Raspberry Pi Compute Module 3 Rev 1.0
+Machine: Raspberry Pi Compute Module 3 Rev *
+Machine: Raspberry Pi Compute Module 3 Plus
+Machine: Raspberry Pi Compute Module 3 Plus Rev 1.0
+Machine: Raspberry Pi Compute Module 3 Plus Rev *
+Kernel-Flavors: raspi
+Method: pi-try
+DTB-Id: bcm2710-rpi-cm3.dtb
+
+Machine: Raspberry Pi Compute Module 4 Rev 1.0
+Machine: Raspberry Pi Compute Module 4 Rev *
+Kernel-Flavors: raspi raspi-realtime
+Method: pi-try
+DTB-Id: bcm2711-rpi-cm4.dtb
+
+Machine: Raspberry Pi Compute Module 5 Lite Rev 1.0
+Machine: Raspberry Pi Compute Module 5 Lite Rev *
+Kernel-Flavors: raspi raspi-realtime
+Method: pi-try
+DTB-Id: bcm2712-rpi-cm5l-cm5io.dtb
+
+Machine: Raspberry Pi Compute Module 5 Rev 1.0
+Machine: Raspberry Pi Compute Module 5 Rev *
+Kernel-Flavors: raspi raspi-realtime
+Method: pi-try
+DTB-Id: bcm2712-rpi-cm5-cm5io.dtb
 
 Machine: Raspberry Pi Zero
 Kernel-Flavors: rpi
@@ -1782,6 +1932,13 @@ U-Boot-Script-Name: bootscr.uboot-generi
 Required-Packages: u-boot-tools
 Boot-Script-Path: /boot/boot.scr
 
+Machine: Raspberry Pi Zero 2 W
+Machine: Raspberry Pi Zero 2 W Rev 1.0
+Machine: Raspberry Pi Zero 2 W Rev *
+Kernel-Flavors: raspi
+Method: pi-try
+DTB-Id: bcm2710-rpi-zero-2-w.dtb
+
 Machine: Raspberry Pi Zero W
 Kernel-Flavors: rpi
 DTB-Id: bcm2835-rpi-zero-w.dtb
@@ -1800,12 +1957,16 @@ U-Boot-Script-Name: bootscr.uboot-generi
 Required-Packages: u-boot-tools
 
 Machine: Rockchip RK3399 Evaluation Board
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: rockchip/rk3399-evb.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
+Machine: Samsung Galaxy Book4 Edge
+Kernel-Flavors: any
+DTB-Id: qcom/x1e80100-samsung-galaxy-book4-edge.dtb
+
 Machine: Seagate Blackarmor NAS220
 Kernel-Flavors: kirkwood marvell
 DTB-Id: kirkwood-blackarmor-nas220.dtb
@@ -1872,8 +2033,15 @@ Boot-DTB-Path: /boot/dtb
 Required-Packages: u-boot-tools
 Bootloader-Sets-Incorrect-Root: no
 
+Machine: SiFive HiFive Premier P550
+Kernel-Flavors: any
+DTB-Id: eswin/eic7700-hifive-premier-p550.dtb
+Boot-Script-Path: /boot/boot.scr
+U-Boot-Script-Name: bootscr.uboot-generic
+Required-Packages: u-boot-tools
+
 Machine: SiFive HiFive Unmatched A00
-Kernel-Flavors: generic riscv64
+Kernel-Flavors: any
 DTB-Id: sifive/hifive-unmatched-a00.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -1903,13 +2071,13 @@ Required-Packages: u-boot-tools
 Machine: Sipeed Lichee Pi 4A
 Kernel-Flavors: any
 Boot-Script-Path: /boot/boot.scr
-DTB-Id: thead/th1520-lichee-pi-4a.dtb
+DTB-Id: th1520-lichee-pi-4a.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Sipeed Lichee RV
-Kernel-Flavors: allwinner riscv64
+Kernel-Flavors: any
 DTB-Id: allwinner/sun20i-d1-lichee-rv.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -1923,21 +2091,21 @@ U-Boot-Script-Name: bootscr.uboot-generi
 Required-Packages: u-boot-tools
 
 Machine: SolidRun AM642 HummingBoard-T
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: ti/k3-am642-hummingboard-t.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: SolidRun AM642 HummingBoard-T with PCI-E
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: ti/k3-am642-hummingboard-t-pcie.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: SolidRun AM642 HummingBoard-T with USB-3.1 Gen 1
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: ti/k3-am642-hummingboard-t-usb3.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -1965,28 +2133,28 @@ U-Boot-Script-Name: bootscr.uboot-generi
 Required-Packages: u-boot-tools
 
 Machine: SolidRun CN9130 Clearfog Base
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: marvell/cn9130-cf-base.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: SolidRun CN9130 Clearfog Pro
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: marvell/cn9130-cf-pro.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: SolidRun CN9131 SolidWAN
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: marvell/cn9131-cf-solidwan.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: SolidRun CN9132 Clearfog
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: marvell/cn9132-clearfog.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -2133,26 +2301,33 @@ U-Boot-Script-Name: bootscr.uboot-generi
 Required-Packages: u-boot-tools
 
 Machine: SolidRun LX2160A Clearfog CX
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: freescale/fsl-lx2160a-clearfog-cx.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: SolidRun LX2160A Honeycomb
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: freescale/fsl-lx2160a-honeycomb.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: SolidRun LX2162A Clearfog
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: freescale/fsl-lx2162a-clearfog.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
+Machine: StarFive VisionFive 2 Lite
+Kernel-Flavors: any
+DTB-Id: starfive/jh7110s-starfive-visionfive-2-lite.dtb
+Boot-Script-Path: /boot/boot.scr
+U-Boot-Script-Name: bootscr.uboot-generic
+Required-Packages: u-boot-tools
+
 Machine: StarFive VisionFive 2 v1.2A
 Kernel-Flavors: any
 DTB-Id: starfive/jh7110-starfive-visionfive-2-v1.2a.dtb
@@ -2168,14 +2343,14 @@ U-Boot-Script-Name: bootscr.uboot-generi
 Required-Packages: u-boot-tools
 
 Machine: StarFive VisionFive V1
-Kernel-Flavors: starfive riscv64
+Kernel-Flavors: any
 DTB-Id: starfive/jh7100-starfive-visionfive-v1.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
 Machine: Theobroma Systems RK3399-Q7 SoM
-Kernel-Flavors: arm64
+Kernel-Flavors: any
 DTB-Id: rockchip/rk3399-puma-haikou.dtb
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
@@ -2362,6 +2537,15 @@ DTB-Id: sun7i-a20-wits-pro-a20-dkt.dtb
 U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
+Machine: Xilinx Versal vck190*
+Kernel-Flavors: xilinx-zynqmp
+Method: generic
+Boot-Script-Path: /boot/firmware/boot.scr.uimg
+U-Boot-Script-Name: bootscr.zynqmp
+Boot-FIT-Path: /boot/firmware/image.fit
+Boot-ITS-File-Name: image-zcu.its
+Required-Packages: u-boot-tools
+
 Machine: Xunlong Orange Pi 2
 Kernel-Flavors: armmp armmp-lpae
 Boot-Script-Path: /boot/boot.scr
@@ -2425,3 +2609,53 @@ Boot-Script-Path: /boot/boot.scr
 DTB-Id: sun6i-a31s-yones-toptech-bs1078-v2.dtb
 U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
+
+Machine: ZynqMP SMK-K26 Rev1/B/A
+Machine: ZynqMP *K26*
+Machine: ZynqMP *K24*
+Machine: ZynqMP *KD240*
+Machine: ZynqMP *KR260*
+Machine: ZynqMP *KV260*
+Kernel-Flavors: xilinx xilinx-zynqmp
+Method: generic
+Boot-Script-Path: /boot/firmware/boot.scr.uimg
+U-Boot-Script-Name: bootscr.zynqmp.kria
+Boot-FIT-Path: /boot/firmware/image.fit
+Boot-ITS-File-Name: image-kria.its
+Required-Packages: u-boot-tools
+
+Machine: ZynqMP ZCU102*
+Kernel-Flavors: xilinx-zynqmp
+Method: generic
+Boot-Script-Path: /boot/firmware/boot.scr.uimg
+U-Boot-Script-Name: bootscr.zynqmp
+Boot-FIT-Path: /boot/firmware/image.fit
+Boot-ITS-File-Name: image-zcu.its
+Required-Packages: u-boot-tools xlnx-firmware
+
+Machine: ZynqMP ZCU104*
+Kernel-Flavors: xilinx-zynqmp
+Method: generic
+Boot-Script-Path: /boot/firmware/boot.scr.uimg
+U-Boot-Script-Name: bootscr.zynqmp
+Boot-FIT-Path: /boot/firmware/image.fit
+Boot-ITS-File-Name: image-zcu.its
+Required-Packages: u-boot-tools xlnx-firmware
+
+Machine: ZynqMP ZCU106*
+Kernel-Flavors: xilinx-zynqmp
+Method: generic
+Boot-Script-Path: /boot/firmware/boot.scr.uimg
+U-Boot-Script-Name: bootscr.zynqmp
+Boot-FIT-Path: /boot/firmware/image.fit
+Boot-ITS-File-Name: image-zcu.its
+Required-Packages: u-boot-tools xlnx-firmware
+
+Machine: ZynqMP ZCU111*
+Kernel-Flavors: xilinx-zynqmp
+Method: generic
+Boot-Script-Path: /boot/firmware/boot.scr.uimg
+U-Boot-Script-Name: bootscr.zynqmp
+Boot-FIT-Path: /boot/firmware/image.fit
+Boot-ITS-File-Name: image-zcu.its
+Required-Packages: u-boot-tools xlnx-firmware
diff -pruN 3.109/debian/90-piboot-try 3.109ubuntu7/debian/90-piboot-try
--- 3.109/debian/90-piboot-try	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/debian/90-piboot-try	2025-08-24 20:43:17.000000000 +0000
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+if [ -x /usr/sbin/piboot-try ]; then
+    exec /usr/sbin/piboot-try --status
+fi
diff -pruN 3.109/debian/changelog 3.109ubuntu7/debian/changelog
--- 3.109/debian/changelog	2025-04-08 22:56:42.000000000 +0000
+++ 3.109ubuntu7/debian/changelog	2025-10-17 14:51:57.000000000 +0000
@@ -1,3 +1,224 @@
+flash-kernel (3.109ubuntu7) resolute; urgency=medium
+
+  * Show --help if no options specified to piboot-try
+  * Ensure validation is done before motd displays (LP: #2128718)
+  * Do not execute piboot-try when method != pi-try (LP: #2127780)
+
+ -- Dave Jones <dave.jones@canonical.com>  Fri, 17 Oct 2025 15:51:57 +0100
+
+flash-kernel (3.109ubuntu6) questing; urgency=medium
+
+  * Add entry for StarFive VisionFive 2 Lite (LP: #2121220)
+
+ -- Dave Jones <dave.jones@canonical.com>  Sun, 24 Aug 2025 21:51:02 +0100
+
+flash-kernel (3.109ubuntu5) questing; urgency=medium
+
+  [ Tobias Heider ]
+  * Add new T14s model names for LCD/OLED split
+  * Add Acer Swift 14 AI
+
+  [ Aleksandrs Vinarskis ]
+  * Add Asus Zenbook A14
+  * Add Dell Inspiron 14 Plus 7441
+  * Add Dell Latitude 7455
+  * Add new Asus Zenbook A14 model names for LCD/OLED split
+
+ -- Tobias Heider <tobias.heider@canonical.com>  Wed, 13 Aug 2025 11:30:26 +0200
+
+flash-kernel (3.109ubuntu4) questing; urgency=medium
+
+  * Enable the hardware watchdog during migration of the boot configuration
+    (LP: #2120177)
+  * Report failure of new boot assets in motd (LP: #2119659)
+
+ -- Dave Jones <dave.jones@canonical.com>  Fri, 08 Aug 2025 14:48:45 +0100
+
+flash-kernel (3.109ubuntu3) questing; urgency=medium
+
+  * Implement an A/B boot mechanism for the Raspberry Pi. This adds the new
+    flash-kernel-piboot package, which contains the new piboot-try-reboot and
+    piboot-try-validate services (LP: #2116266)
+
+ -- Dave Jones <dave.jones@canonical.com>  Wed, 09 Jul 2025 14:35:09 +0100
+
+flash-kernel (3.109ubuntu2) questing; urgency=medium
+
+  [ Heinrich Schuchardt ]
+  * db/all.db: Add entry for DeepComputing FML13V03 (LP: #2116161)
+
+ -- Dave Jones <dave.jones@canonical.com>  Tue, 08 Jul 2025 14:17:18 +0100
+
+flash-kernel (3.109ubuntu1) questing; urgency=medium
+
+  * Merge with Debian unstable (LP: #2109835). Remaining changes:
+    - Add support for Raspberry Pi 2, 3, 3+, CM3, CM3+, and 4 using a
+      unified bootscript (replaces upstream's entries)
+      + Update pi bootscript to support all flash-kernel vars, including
+        calculated devtype and partition for future USB boot support
+      + Add entry for Raspberry Pi 3A+
+      + Add entry for Raspberry Pi CM4
+      + Add entry for Raspberry Pi 400
+      + Import UC20 updates to the rpi bootscript from the snappy-dev/image
+        PPA
+    - Add Kernel-Flavors check to Raspberry Pi entries
+      + Support "raspi" kernel flavor
+    - use umount -l in the cleanup function, else we fail while finishing up
+      with the script
+    - add a diversion for update-initramfs to live-installers
+      post-base-installer.d to avoid update-initramfs runs before flash-kernel
+      is configured
+    - add a check for the diverted update-initramfs to flash-kernel-installer,
+      so it gets reverted before we try to call update-initramfs
+    - make post-base-installer.d/01flash-kernel-diversion actually an
+      executable shell script
+    - make sure that /dev is bind mounted in /target when running
+      update-initramfs from flash-kernel-installer, else we do not find the
+      boot media (this is only a workaround, actual fixing of the netinst
+      environment is needed to fix this properly)
+    - drop the "|| true" from the initramfs building code, if we fail here we
+      actually dont want to attempt to flash that
+    - Do not run flash-kernel inside an LXC container
+    - Migrate default /etc/default/flash-kernel content to new default without
+      asking via debconf
+    - Filter the selection of 'latest' usable kernel through the whitelist.
+    - Do not fail if there are no specified Kernel-Flavors for this machine.
+    - flash-kernel/functions: Stop attempting to install the latest kernel
+      if we request an older version, just refuse to act without --force.
+    - Look for dtbs in /lib/firmware/$kvers/device-tree/ in find_dtb_file()
+    - Allow us to find DTBs in both the old flat layout and the new vendor
+      subdirectory layout, so we keep backward compatibility
+    - Add support for gzip-compressed kernel images
+    - Fix mkimage_kernel tests
+    - Add tests for android-related functions
+    - Add "pi" value for the "Method" field which copies all dtbs and
+      overlays to the boot partition and provides defaults for the boot
+      paths of the kernel, initrd, and u-boot script.
+      + This fixes upgrades to support the Pi 4 on Bionic
+      + Permit initrd to be missing in flash-kernel
+      + Make U-boot optional in the "pi" method. From Groovy onwards, U-Boot
+        will be an option in the boot chain but not activated by default.
+        For the time being, the U-Boot-Script-Name will remain in the Pi
+        entries, but this commit permits it to be blank in future.
+      + Copy the Pi's bootloader firmware. At present, the Pi's bootloader
+        firmware is being copied to the boot partition by the postinst of
+        the linux-firmware-raspi2 package. However, flash-kernel should be
+        responsible for copying *everything* necessary to boot the Linux
+        kernel, hence this responsibility should be transferred to
+        flash-kernel.
+    - Ensure tests work independently of sort implementation
+    - Always run flash-kernel on install/upgrade
+    - Add pattern matching for machines
+      + A requirement has come up to permit a simple form of pattern matching
+        (specifically shell-style globbing) in the Machine field of the
+        database. This commit implements this via a "case" match.
+    - Install u-boot binaries in addition to u-boot scripts for the Pi
+    - Copy overlay_map.dtb into overlays/ sub-directory instead of the
+      root of the boot partition (LP: 1918110)
+    - Add minor board revisions to db/all.db
+    - Add support for FIT images
+      + Support for ITS files
+      + New Boot-FIT-Path and Boot-ITS-File-Name DB fields
+    - Add Xilinx Kria SOM and ZCU10{2,4,6} boards to the devices database
+    - Drop the "systemd.gpt_auto=0 rd.systemd.unit=basic.target" values from
+      the snapd_standard_params, which have not been needed since pre-GA of
+      UC20 and were removed in pc gadget on 20th April 2020. (LP: 1933093)
+    - mkimage_fit: subst KERNEL_VERSION in ITS file with actual kernel
+      version.
+    - Add DB entry, bootscript and ITS templates for Mediatek AIoT i500 board.
+    - Added note in db/all.db above Pi entries about "incorrect" DTB-Id
+      (LP: 1928314)
+    - Added entries for the Pi 4B rev 1.5, and moved CM4 and 400 models to their
+      own entries for the sake of clarity
+    - Include overlays/README in the files copied by Method: pi
+    - Add Kria KR260 support
+    - bootscr.zynqmp:
+      + Add Kria KV260 support on jammy and kinetic
+      + Add ZCU102/104/106 support on jammy and kinetic
+    - image-kria.its: add dtb files into fitimage
+    - Add kernel parameter for Kria TSN
+    - Add ZCU111 support (LP: 1978798)
+    - bootscr.zynqmp (LP: 1978798)
+      + Improve messaging in U-Boot boot script for board detection
+      + Add kria and zcu board support lists
+      + Update kR260 and KV260's bootargs as per AMD-Xilinx's request
+      + Support legacy KV260 U-Boot
+    - Allow to bypass container exit test by introducing FK_FORCE_CONTAINER
+      for RISC-V images build to run flash-kernel in a container (LP: 1980929)
+    - Unconditionally map 'armmp' in the Kernel-Flavors field to 'generic',
+      which is what this flavor is called in Ubuntu.  This allows us to support
+      a much greater number of boards without having to carry an extensive
+      delta against the all.db data file.
+    - Add Mediatek AIoT i1200 board support
+    - Fix Microchip Icicle Kit DTB name (LP: 1988169)
+    - Change FK_FORCE_CONTAINER to FK_FORCE and cleanly exit if running
+      in a chroot environment (LP: 1955353)
+    - Fix remaining reference to FK_FORCE_CONTAINER (LP: 1955353)
+    - Add database entry for Lenovo X13s (LP: 2002092)
+    - Add support for the NXP S32G274A-RDB2 (LP: 2004495)
+      + Add entry in db/all.db using the generic U-Boot method, the kernel
+        provided s33g274a-rdb2 device tree to generate a FIT image under
+        boot/firmware/fitImage.
+      + Add its/arm64/image-nxp-s32.its FIT image template applicable for all
+        S32x boards.
+    - Add support for Xilinx Versal VCK190 (LP: 2006558)
+    - Ensure that only kernels in fully "installed" state are considered for
+      flashing (LP: 2007827)
+    - test_functions: Add tests for include_only_flavors
+    - Handle "not fully installed" kernels differently by quitting instead of
+      re-triggering to avoid a dpkg trigger cycle (LP: 2011925)
+    - d/control: Remove redundant awk dependency to appease lintian
+    - Use "any" kernel flavor for all RISC-V boards
+    - Add support for Sipeed Lichee Pi 4A
+    - Use generic-revision catch-alls for each model rather than relying on a
+      single Pi catch-all to avoid a confusing selection of "the one DTB" for a
+      given board (even though all other DTBs will still be copied anyway)
+      (LP: 2038087)
+      + Add missing Pi Zero 2W entry
+      + Add missing Pi 5B entry
+    - Use LC_ALL= instead of LANG= for consistency (LP: 2007827)
+    - Add support for Xilinx Kria KD240 (LP: 2037407)
+      + Fix minor issues in bootscr.zynqmp
+    - Add raspi-realtime kernel flavor to bcm2711 and bcm2712 based Pi boards
+      (LP: 2051960)
+    - Update Xilinx board support (LP: 2054556)
+      + Remove support claim for Xilinx ZCU111
+      + Add new machine entries for KV260 and KR260 due to model string changes
+      + Create separate bootscript for AMD-Xilinx Kria board family
+    - db/all.db: Fix Raspberry Pi 2 entry for noble. Here we can assume it is
+      definitely the 64-bit revision (1.2) board, but this change must not
+      be backported earlier than noble where this assumption does not hold
+      (LP: 2060856)
+    - db/all.db: Add Microchip PIC64GX Curiosity Kit (LP: 2072500)
+    - db/all.db: Support for Qualcomm x1e80100 CRD board (LP: 2065380)
+    - db/all.db: add CM5 entry (LP: 2086774)
+    - db/all.db: add HiFive Premier P550 to database (LP: 2077981)
+    - Add support for AMD-Xilinx Kria noble kernel (LP: 2069802)
+      + bootscript/arm64/bootscr.zynqmp.kria: Update cma value
+        - CMA value of 1G at start address of 0 is not working with Ubuntu noble
+          optimized kernel on ZynqMP Kria K26 platforms
+      + db/all.db: change kernel-flavor for Kria platforms in noble because of
+        the kernel name change
+      + its/arm64/image-kria.its: use new device-tree file names
+    - Add Samsung Galaxy Book4 Edge
+    - db/all.db: Add entry for Raspberry Pi 500 (LP: 2092216)
+    - test_functions: Remove test for android_skip_initrd (obsolete with
+      removal of Nexus 4 (Mako) delta)
+    - db/all.db: Add another RISC-V board (LP: 2093200)
+      + Add entry for DeepComputing FML13V01
+  * Removed patches obsoleted/merged by upstream:
+    - Add Asus Vivobook S 15
+    - Add Dell XPS 13 9345
+    - Add HP Omnibook X 14
+    - Add Lenovo Thinkpad T14s Gen6
+    - Add Lenovo Yoga Slim 7x
+    - Add Microsoft Surface Laptop 7 variants
+    - Add entry for Pine64 Star64
+  * db/all.db: Fix entries with "Kernel-Flavors: arm64". (LP: #2092737)
+  * db/all.db: Add CM5 Lite to flash-kernel database (LP: #2097008)
+
+ -- Pragyansh Chaturvedi <pragyansh.chaturvedi@canonical.com>  Fri, 02 May 2025 17:43:46 +0530
+
 flash-kernel (3.109) unstable; urgency=medium
 
   [ Heinrich Schuchardt ]
@@ -36,6 +257,261 @@ flash-kernel (3.109) unstable; urgency=m
 
  -- Vagrant Cascadian <vagrant@debian.org>  Tue, 08 Apr 2025 15:56:42 -0700
 
+flash-kernel (3.108ubuntu2) plucky; urgency=medium
+
+  * Prevent removal of flash-kernel on switch to dracut (LP: #2100618)
+
+ -- Dave Jones <dave.jones@canonical.com>  Fri, 21 Mar 2025 13:41:50 +0000
+
+flash-kernel (3.108ubuntu1) plucky; urgency=medium
+
+  * Merge from Debian unstable (LP: #2081313). Remaining changes:
+    - Add support for Raspberry Pi 2, 3, 3+, CM3, CM3+, and 4 using a unified
+      bootscript (replaces upstream's entries)
+      - Update pi bootscript to support all flash-kernel vars, including
+        calculated devtype and partition for future USB boot support
+      - Add entry for Raspberry Pi 3A+
+      - Add entry for Raspberry Pi CM4
+      - Add entry for Raspberry Pi 400
+      - Import UC20 updates to the rpi bootscript from the snappy-dev/image
+        PPA
+    - Add Kernel-Flavors check to Raspberry Pi entries
+      - Support "raspi" kernel flavor
+    - use umount -l in the cleanup function, else we fail while finishing up
+      with the script
+    - add a diversion for update-initramfs to live-installers post-base-
+      installer.d to avoid update-initramfs runs before flash-kernel is
+      configured
+    - add a check for the diverted update-initramfs to flash-kernel-installer,
+      so it gets reverted before we try to call update-initramfs
+    - make post-base-installer.d/01flash-kernel-diversion actually an
+      executable shell script
+    - make sure that /dev is bind mounted in /target when running update-
+      initramfs from flash-kernel-installer, else we do not find the boot
+      media (this is only a workaround, actual fixing of the netinst
+      environment is needed to fix this properly)
+    - drop the "|| true" from the initramfs building code, if we fail here we
+      actually dont want to attempt to flash that
+    - Do not run flash-kernel inside an LXC container
+    - Migrate default /etc/default/flash-kernel content to new default without
+      asking via debconf
+    - Filter the selection of 'latest' usable kernel through the whitelist.
+    - Do not fail if there are no specified Kernel-Flavors for this machine.
+    - flash-kernel/functions: Stop attempting to install the latest kernel if
+      we request an older version, just refuse to act without --force.
+    - Look for dtbs in /lib/firmware/$kvers/device-tree/ in find_dtb_file()
+    - Allow us to find DTBs in both the old flat layout and the new vendor
+      subdirectory layout, so we keep backward compatibility
+    - Add support for gzip-compressed kernel images
+    - Fix mkimage_kernel tests
+    - Add tests for android-related functions
+    - Add "pi" value for the "Method" field which copies all dtbs and overlays
+      to the boot partition and provides defaults for the boot paths of the
+      kernel, initrd, and u-boot script.
+      - This fixes upgrades to support the Pi 4 on Bionic
+      - Permit initrd to be missing in flash-kernel
+      - Make U-boot optional in the "pi" method. From Groovy onwards, U-Boot
+        will be an option in the boot chain but not activated by default. For
+        the time being, the U-Boot-Script-Name will remain in the Pi entries,
+        but this commit permits it to be blank in future.
+      - Copy the Pi's bootloader firmware. At present, the Pi's bootloader
+        firmware is being copied to the boot partition by the postinst of the
+        linux-firmware-raspi2 package. However, flash-kernel should be
+        responsible for copying *everything* necessary to boot the Linux
+        kernel, hence this responsibility should be transferred to flash-
+        kernel.
+    - Ensure tests work independently of sort implementation
+    - Always run flash-kernel on install/upgrade
+    - Add pattern matching for machines
+      - A requirement has come up to permit a simple form of pattern matching
+        (specifically shell-style globbing) in the Machine field of the
+        database. This commit implements this via a "case" match.
+    - Install u-boot binaries in addition to u-boot scripts for the Pi
+    - Copy overlay_map.dtb into overlays/ sub-directory instead of the root of
+      the boot partition
+    - Add minor board revisions to db/all.db
+    - Add support for FIT images
+      - Support for ITS files
+      - New Boot-FIT-Path and Boot-ITS-File-Name DB fields
+    - Add Xilinx Kria SOM and ZCU10{2,4,6} boards to the devices database
+    - Drop the "systemd.gpt_auto=0 rd.systemd.unit=basic.target" values from
+      the snapd_standard_params, which have not been needed since pre-GA of
+      UC20 and were removed in pc gadget on 20th April 2020.
+    - mkimage_fit: subst KERNEL_VERSION in ITS file with actual kernel
+      version.
+    - Add DB entry, bootscript and ITS templates for Mediatek AIoT i500 board.
+    - Added note in db/all.db above Pi entries about "incorrect" DTB-Id
+    - Added entries for the Pi 4B rev 1.5, and moved CM4 and 400 models to
+      their own entries for the sake of clarity
+    - Include overlays/README in the files copied by Method: pi
+    - Add Kria KR260 support
+    - bootscr.zynqmp:
+      - Add Kria KV260 support on jammy and kinetic
+      - Add ZCU102/104/106 support on jammy and kinetic
+    - image-kria.its: add dtb files into fitimage
+    - Add kernel parameter for Kria TSN
+    - Add ZCU111 support
+    - bootscr.zynqmp
+      - Improve messaging in U-Boot boot script for board detection
+      - Add kria and zcu board support lists
+      - Update kR260 and KV260's bootargs as per AMD-Xilinx's request
+      - Support legacy KV260 U-Boot
+    - Allow to bypass container exit test by introducing FK_FORCE_CONTAINER
+      for RISC-V images build to run flash-kernel in a container
+    - Unconditionally map 'armmp' in the Kernel-Flavors field to 'generic',
+      which is what this flavor is called in Ubuntu.  This allows us to
+      support a much greater number of boards without having to carry an
+      extensive delta against the all.db data file.
+    - Add Mediatek AIoT i1200 board support
+    - Fix Microchip Icicle Kit DTB name
+    - Change FK_FORCE_CONTAINER to FK_FORCE and cleanly exit if running in a
+      chroot environment
+    - Fix remaining reference to FK_FORCE_CONTAINER
+    - Add database entry for Lenovo X13s
+    - Add support for the NXP S32G274A-RDB2
+      - Add entry in db/all.db using the generic U-Boot method, the kernel
+        provided s33g274a-rdb2 device tree to generate a FIT image under
+        boot/firmware/fitImage.
+      - Add its/arm64/image-nxp-s32.its FIT image template applicable for all
+        S32x boards.
+    - Add support for Xilinx Versal VCK190
+    - Ensure that only kernels in fully "installed" state are considered for
+      flashing
+    - test_functions: Add tests for include_only_flavors
+    - Handle "not fully installed" kernels differently by quitting instead of
+      re-triggering to avoid a dpkg trigger cycle
+    - d/control: Remove redundant awk dependency to appease lintian
+    - Use "any" kernel flavor for all RISC-V boards
+    - Add support for Sipeed Lichee Pi 4A
+    - Use generic-revision catch-alls for each model rather than relying on a
+      single Pi catch-all to avoid a confusing selection of "the one DTB" for
+      a given board (even though all other DTBs will still be copied anyway)
+      - Add missing Pi Zero 2W entry
+      - Add missing Pi 5B entry
+    - Use LC_ALL= instead of LANG= for consistency
+    - Add support for Xilinx Kria KD240
+      - Fix minor issues in bootscr.zynqmp
+    - Add raspi-realtime kernel flavor to bcm2711 and bcm2712 based Pi boards
+    - Update Xilinx board support
+      - Remove support claim for Xilinx ZCU111
+      - Add new machine entries for KV260 and KR260 due to model string
+        changes
+      - Create separate bootscript for AMD-Xilinx Kria board family
+    - db/all.db: Fix Raspberry Pi 2 entry for noble. Here we can assume it is
+      definitely the 64-bit revision (1.2) board, but this change must not be
+      backported earlier than noble where this assumption does not hold
+    - db/all.db: Add Microchip PIC64GX Curiosity Kit
+    - db/all.db: Support for Qualcomm x1e80100 CRD board
+    - db/all.db: add CM5 entry
+    - db/all.db: add HiFive Premier P550 to database
+    - Add support for AMD-Xilinx Kria noble kernel
+      - bootscript/arm64/bootscr.zynqmp.kria: Update cma value
+        - CMA value of 1G at start address of 0 is not working with Ubuntu
+          noble optimized kernel on ZynqMP Kria K26 platforms
+      - db/all.db: change kernel-flavor for Kria platforms in noble because of
+        the kernel name change
+      - its/arm64/image-kria.its: use new device-tree file names
+    - Add Asus Vivobook S 15
+    - Add Dell XPS 13 9345
+    - Add HP Omnibook X 14
+    - Add Lenovo Thinkpad T14s Gen6
+    - Add Lenovo Yoga Slim 7x
+    - Add Microsoft Surface Laptop 7 variants
+    - Add Samsung Galaxy Book4 Edge
+  * Removed obsolete patches/changes:
+    - Add support for QCT APQ8064 CDP
+      - Add support for QCT APQ8064 CDP; thanks Alfonso Sanchez-Beato.
+    - Add support for Calxeda Highbank
+      - Add support for Calxeda Highbank (with bootscr.highbank different from
+        Debian's version)
+      - bootscr.highbank: allow more space to load larger kernels
+    - Add support for Nexus 4 (Mako)
+      - Enabling support for mako (Nexus 4)
+    - Add support for Marvell ArmadaXP
+      - Re-add support for Marvell ArmadaXP
+      - Fix armadaxp kernel load address
+    - Add support for Samsung Exynos 5440 platforms
+      - Add support for EXYNOS5440-based platforms
+    - Add generic-lpae to the XB-Subarchitecture list in debian/control
+    - debian/flash-kernel-installer.isinstallable: add arm*/generic-lpae
+    - Add support for HP ProLiant m400 cartridges
+      - Add support for HP ProLiant m400 Server Cartridges
+      - HP Moonshot Cartridges: Use $baudrate from u-boot environment as
+        serial console speed
+      - HP Moonshot Cartridges: Enable hardware flow control as required by
+        the HP moonshot chassis
+      - Enable U-Boot environment support for X-Gene platforms
+      - Use filesystem agnostic "load" command instead of assuming ext4
+      - Add a bootscript specific to X-Gene Mustang boards since they need to
+        pull their dtb from the OS.
+    - Add support for OMAP3 and OMAP4 boards
+      - add DB entry for "OMAP3 Beagle Board" (funnily thats missing)
+      - add Panda to the list of supported board in the README file
+      - debian/control: Re-add omap and omap4 to the flash-kernel-installer
+        XB-Subarchitecture field. These appear to have been lost somewhere
+        along the way.
+      - Also add omap and omap4 to flash-kernel-installer.isinstallable.
+      - switch omap3 and omap4 to uEnv.txt/preEnv.txt (the former holds all
+        active boot commands, the latter holds the kernel commandline only)
+      - switch omap3 and omap4 from Bootloader-sets-root: no to yes, we now
+        generate a root=UUID= line on the fly for arches using
+        uEnv.txt/preEnv.txt
+      - introduce bootscript/uEnvtxt.omap
+      - do not move the original uEnvtxt.omap to the target, use a copy
+        instead
+      - add "quiet splash" as default options to omap bootscr
+    - enable UUID detection of the currently used root device
+    - if uEnv.txt is defined in the db for an arch, generate preEnv.txt from
+      UBOOT_DEFAULTS and UUID detection data
+    - make sure blkid only gives us the UUID and not any other metadata like
+      labels or filesystem
+    - hide the boot device from udisk's automounting after installation on all
+      systems using uEnv.txt to configure u-boot
+    - make sure we only rename the bootrom partition so udisks hides it, when
+      using mkdosfs for setting the label like we did in jasper (where we
+      cached the contents before doing this) MLO and u-boot.bin are gone
+    - Add support for grouper boards
+      - add support for the grouper architecture
+    - Add support for Wandboard Quad
+      - Wandboard: Use /dev/disk/by-path/platform-2198000.usdhc-part1 instead
+        of the hardcoded mmcblk1p1, this should make things work on boards
+        with just a single microSD card in.
+      - Add basic support for WandBoard Quad.
+    - Add support for AAarch64 Qualcomm laptops.
+      - Fix AARCH64 qcom laptop names, to those accepted upstream and in the
+        Ubuntu kernel.
+    - Install all potential uboot scripts [previously undocumented]
+    - make sure that if we dont want to override the bootloader root= option
+      by setting "Bootloader-sets-root: yes", we actually dont do it
+    - Update tests with new fields: Bootloader-sets-root
+    - Add workaround for older u-boot versions that can fail to read files
+      using ext4 extents, and enable it for HP ProLiant m400 Moonshot Server
+      Cartridges.
+    - Make errors in workaround for HP Proliant m400 u-boot ext4 parsing bug
+      fatal.
+    - Introduce "Boot-Kernel-Max-Size" and support for compressing kernel
+      images that exceed it. This will allow installation of larger
+      uncompressed kernels on HP ProLiant m400 cartridges.
+    - Cache lookup of Bootloader-Has-Broken-Ext4-Extent-Support for
+      significant performance improvement on Raspberry Pi
+    - Add raspi-nolpae kernel flavor to all supported boards
+    - Remove raspi-nolpae kernel flavor from all Pi boards
+    - Add dtb-probe script to handle missing bcm2710-rpi-zero-2-w.dtb in some
+      of the 5.15 series kernels
+  * Removed patches obsoleted/merged by upstream:
+    - Add support for the LicheeRV Dock
+    - Add StarFive VisionFive 2 board to db/all.db
+    - Add Milk-V Mars to database
+    - Bump standards version
+  * db/all.db: Add entry for Raspberry Pi 500 (LP: #2092216)
+  * db/all.db: Add more RISC-V boards (LP: #2093200)
+    - Add entry for DeepComputing FML13V01
+    - Add entry for Pine64 Star64
+  * test_functions: Remove test for android_skip_initrd (obsolete with
+    removal of Nexus 4 (Mako) delta)
+
+ -- Dave Jones <dave.jones@canonical.com>  Thu, 05 Dec 2024 12:10:28 +0000
+
 flash-kernel (3.108) unstable; urgency=medium
 
   [ Manfred Stock ]
@@ -84,6 +560,326 @@ flash-kernel (3.108) unstable; urgency=m
 
  -- Vagrant Cascadian <vagrant@debian.org>  Wed, 17 Jul 2024 13:19:31 -0700
 
+flash-kernel (3.107ubuntu14) plucky; urgency=medium
+
+  * Add Asus Vivobook S 15
+  * Add Dell XPS 13 9345
+  * Add HP Omnibook X 14
+  * Add Lenovo Thinkpad T14s Gen6
+  * Add Lenovo Yoga Slim 7x
+  * Add Microsoft Surface Laptop 7 variants
+  * Add Samsung Galaxy Book4 Edge
+
+ -- Tobias Heider <tobias.heider@canonical.com>  Sat, 16 Nov 2024 23:20:01 +0100
+
+flash-kernel (3.107ubuntu13) plucky; urgency=medium
+
+  [ Talha Can Havadar ]
+  * Add support for AMD-Xilinx Kria noble kernel (LP: #2069802)
+    - bootscript/arm64/bootscr.zynqmp.kria: Update cma value
+      - CMA value of 1G at start address of 0 is not working with Ubuntu noble
+        optimized kernel on ZynqMP Kria K26 platforms
+    - db/all.db: change kernel-flavor for Kria platforms in noble because of
+      the kernel name change
+    - its/arm64/image-kria.its: use new device-tree file names
+
+  [ Heinrich Schuchardt ]
+  * db/all.db: add HiFive Premier P550 to database (LP: #2077981)
+
+  [ Dave Jones ]
+  * db/all.db: add CM5 entry (LP: #2086774)
+
+ -- Dave Jones <dave.jones@canonical.com>  Wed, 06 Nov 2024 13:39:21 +0000
+
+flash-kernel (3.107ubuntu11) oracular; urgency=medium
+
+  * Add dtb-probe script to handle missing bcm2710-rpi-zero-2-w.dtb in some of
+    the 5.15 series kernels (LP: #2078525)
+
+ -- Dave Jones <dave.jones@canonical.com>  Tue, 10 Sep 2024 16:32:47 +0100
+
+flash-kernel (3.107ubuntu10) oracular; urgency=medium
+
+  * db/all.db: Support for Qualcomm x1e80100 CRD board (LP: #2065380)
+
+ -- Ike Panhc <ike.pan@canonical.com>  Mon, 22 Jul 2024 16:39:56 +0800
+
+flash-kernel (3.107ubuntu9) oracular; urgency=medium
+
+  * db/all.db: Add Microchip PIC64GX Curiosity Kit (LP: #2072500)
+
+ -- Heinrich Schuchardt <heinrich.schuchardt@canonical.com>  Mon, 08 Jul 2024 16:00:03 +0200
+
+flash-kernel (3.107ubuntu8) noble; urgency=medium
+
+  * db/all.db: Fix Raspberry Pi 2 entry for noble. Here we can assume it is
+    definitely the 64-bit revision (1.2) board, but this change must not
+    be backported earlier than noble where this assumption does not hold
+    (LP: #2060856)
+
+ -- Dave Jones <dave.jones@canonical.com>  Wed, 10 Apr 2024 22:40:05 +0100
+
+flash-kernel (3.107ubuntu7) noble; urgency=high
+
+  * No change rebuild for 64-bit time_t and frame pointers.
+
+ -- Julian Andres Klode <juliank@ubuntu.com>  Mon, 08 Apr 2024 17:57:37 +0200
+
+flash-kernel (3.107ubuntu6) noble; urgency=medium
+
+  * Add Milk-V Mars to database (LP: #2053028)
+
+ -- Heinrich Schuchardt <heinrich.schuchardt@canonical.com>  Fri, 23 Feb 2024 16:10:56 +0100
+
+flash-kernel (3.107ubuntu5) noble; urgency=medium
+
+  [ Juerg Haefliger ]
+  * Remove raspi-nolpae kernel flavor from all Pi boards (LP: #2048864)
+  * Add raspi-realtime kernel flavor to bcm2711 and bcm2712 based Pi boards
+    (LP: #2051960)
+
+  [ Talha Can Havadar ]
+  * Update Xilinx board support (LP: #2054556)
+    - Remove support claim for Xilinx ZCU111
+    - Add new machine entries for KV260 and KR260 due to model string changes
+    - Create separate bootscript for AMD-Xilinx Kria board family
+
+ -- Dave Jones <dave.jones@canonical.com>  Thu, 22 Feb 2024 15:29:21 +0000
+
+flash-kernel (3.107ubuntu4) noble; urgency=medium
+
+  * Add support for Xilinx Kria KD240 (LP: #2037407)
+    - Fix minor issues in bootscr.zynqmp
+
+ -- Talha Can Havadar <talha.can.havadar@canonical.com>  Fri, 08 Dec 2023 14:17:40 +0000
+
+flash-kernel (3.107ubuntu3) noble; urgency=medium
+
+  * Use LC_ALL= instead of LANG= for consistency (LP: #2007827)
+
+ -- Dave Jones <dave.jones@canonical.com>  Fri, 10 Nov 2023 09:39:34 +0200
+
+flash-kernel (3.107ubuntu2) mantic; urgency=medium
+
+  * Use generic-revision catch-alls for each model rather than relying on a
+    single Pi catch-all to avoid a confusing selection of "the one DTB" for a
+    given board (even though all other DTBs will still be copied anyway)
+    (LP: #2038087)
+    - Add missing Pi Zero 2W entry
+    - Add missing Pi 5B entry
+
+ -- Dave Jones <dave.jones@canonical.com>  Mon, 02 Oct 2023 12:59:44 +0100
+
+flash-kernel (3.107ubuntu1) mantic; urgency=medium
+
+  [ Dave Jones ]
+  * Merge from Debian unstable (LP: #2024672). Remaining changes:
+    - Add support for QCT APQ8064 CDP
+      - Add support for QCT APQ8064 CDP; thanks Alfonso Sanchez-Beato.
+    - Add support for Calxeda Highbank
+      - Add support for Calxeda Highbank (with bootscr.highbank different from
+        Debian's version)
+      - bootscr.highbank: allow more space to load larger kernels
+    - Add support for Nexus 4 (Mako)
+      - Enabling support for mako (Nexus 4)
+    - Add support for Marvell ArmadaXP
+      - Re-add support for Marvell ArmadaXP
+      - Fix armadaxp kernel load address
+    - Add support for Samsung Exynos 5440 platforms
+      - Add support for EXYNOS5440-based platforms
+    - Add generic-lpae to the XB-Subarchitecture list in debian/control
+    - debian/flash-kernel-installer.isinstallable: add arm*/generic-lpae
+    - Add support for HP ProLiant m400 cartridges
+      - Add support for HP ProLiant m400 Server Cartridges
+      - HP Moonshot Cartridges: Use $baudrate from u-boot environment as
+        serial console speed
+      - HP Moonshot Cartridges: Enable hardware flow control as required by
+        the HP moonshot chassis
+      - Enable U-Boot environment support for X-Gene platforms
+      - Use filesystem agnostic "load" command instead of assuming ext4
+      - Add a bootscript specific to X-Gene Mustang boards since they need to
+        pull their dtb from the OS.
+    - Add support for OMAP3 and OMAP4 boards
+      - add DB entry for "OMAP3 Beagle Board" (funnily thats missing)
+      - add Panda to the list of supported board in the README file
+      - debian/control: Re-add omap and omap4 to the flash-kernel-installer
+        XB-Subarchitecture field. These appear to have been lost somewhere
+        along the way.
+      - Also add omap and omap4 to flash-kernel-installer.isinstallable.
+      - switch omap3 and omap4 to uEnv.txt/preEnv.txt (the former holds all
+        active boot commands, the latter holds the kernel commandline only)
+      - switch omap3 and omap4 from Bootloader-sets-root: no to yes, we now
+        generate a root=UUID= line on the fly for arches using
+        uEnv.txt/preEnv.txt
+      - introduce bootscript/uEnvtxt.omap
+      - do not move the original uEnvtxt.omap to the target, use a copy
+        instead
+      - add "quiet splash" as default options to omap bootscr
+    - enable UUID detection of the currently used root device
+    - if uEnv.txt is defined in the db for an arch, generate preEnv.txt from
+      UBOOT_DEFAULTS and UUID detection data
+    - make sure blkid only gives us the UUID and not any other metadata like
+      labels or filesystem
+    - hide the boot device from udisk's automounting after installation on all
+      systems using uEnv.txt to configure u-boot
+    - make sure we only rename the bootrom partition so udisks hides it, when
+      using mkdosfs for setting the label like we did in jasper (where we
+      cached the contents before doing this) MLO and u-boot.bin are gone
+    - Add support for grouper boards
+      - add support for the grouper architecture
+    - Add support for Wandboard Quad
+      - Wandboard: Use /dev/disk/by-path/platform-2198000.usdhc-part1 instead
+        of the hardcoded mmcblk1p1, this should make things work on boards
+        with just a single microSD card in.
+      - Add basic support for WandBoard Quad.
+    - Add support for AAarch64 Qualcomm laptops.
+      - Fix AARCH64 qcom laptop names, to those accepted upstream and in the
+        Ubuntu kernel.
+    - Add support for Raspberry Pi 2, 3, 3+, CM3, CM3+, and 4 using a unified
+      bootscript (replaces upstream's entries)
+      - Update pi bootscript to support all flash-kernel vars, including
+        calculated devtype and partition for future USB boot support
+      - Install all potential uboot scripts [previously undocumented]
+      - Add entry for Raspberry Pi 3A+
+      - Add entry for Raspberry Pi CM4
+      - Add entry for Raspberry Pi 400
+      - Import UC20 updates to the rpi bootscript from the snappy-dev/image
+        PPA
+    - Add Kernel-Flavors check to Raspberry Pi entries
+      - Support "raspi" kernel flavor
+    - make sure that if we dont want to override the bootloader root= option
+      by setting "Bootloader-sets-root: yes", we actually dont do it
+    - Update tests with new fields: Bootloader-sets-root
+    - use umount -l in the cleanup function, else we fail while finishing up
+      with the script
+    - add a diversion for update-initramfs to live-installers post-base-
+      installer.d to avoid update-initramfs runs before flash-kernel is
+      configured
+    - add a check for the diverted update-initramfs to flash-kernel-installer,
+      so it gets reverted before we try to call update-initramfs
+    - make post-base-installer.d/01flash-kernel-diversion actually an
+      executable shell script
+    - make sure that /dev is bind mounted in /target when running update-
+      initramfs from flash-kernel-installer, else we do not find the boot
+      media (this is only a workaround, actual fixing of the netinst
+      environment is needed to fix this properly)
+    - drop the "|| true" from the initramfs building code, if we fail here we
+      actually dont want to attempt to flash that
+    - Do not run flash-kernel inside an LXC container
+    - Migrate default /etc/default/flash-kernel content to new default without
+      asking via debconf
+    - Filter the selection of 'latest' usable kernel through the whitelist.
+    - Do not fail if there are no specified Kernel-Flavors for this machine.
+    - flash-kernel/functions: Stop attempting to install the latest kernel if
+      we request an older version, just refuse to act without --force.
+    - Look for dtbs in /lib/firmware/$kvers/device-tree/ in find_dtb_file()
+    - Allow us to find DTBs in both the old flat layout and the new vendor
+      subdirectory layout, so we keep backward compatibility
+    - Add support for gzip-compressed kernel images
+    - Fix mkimage_kernel tests
+    - Add tests for android-related functions
+    - Add "pi" value for the "Method" field which copies all dtbs and overlays
+      to the boot partition and provides defaults for the boot paths of the
+      kernel, initrd, and u-boot script.
+      - This fixes upgrades to support the Pi 4 on Bionic
+      - Permit initrd to be missing in flash-kernel
+      - Make U-boot optional in the "pi" method. From Groovy onwards, U-Boot
+        will be an option in the boot chain but not activated by default. For
+        the time being, the U-Boot-Script-Name will remain in the Pi entries,
+        but this commit permits it to be blank in future.
+      - Copy the Pi's bootloader firmware. At present, the Pi's bootloader
+        firmware is being copied to the boot partition by the postinst of the
+        linux-firmware-raspi2 package. However, flash-kernel should be
+        responsible for copying *everything* necessary to boot the Linux
+        kernel, hence this responsibility should be transferred to flash-
+        kernel.
+    - Ensure tests work independently of sort implementation
+    - Always run flash-kernel on install/upgrade
+    - Add pattern matching for machines
+      - A requirement has come up to permit a simple form of pattern matching
+        (specifically shell-style globbing) in the Machine field of the
+        database. This commit implements this via a "case" match.
+    - Add workaround for older u-boot versions that can fail to read files
+      using ext4 extents, and enable it for HP ProLiant m400 Moonshot Server
+      Cartridges.
+    - Make errors in workaround for HP Proliant m400 u-boot ext4 parsing bug
+      fatal.
+    - Install u-boot binaries in addition to u-boot scripts for the Pi
+    - Copy overlay_map.dtb into overlays/ sub-directory instead of the root of
+      the boot partition
+    - Add minor board revisions to db/all.db
+    - Add support for FIT images
+      - Support for ITS files
+      - New Boot-FIT-Path and Boot-ITS-File-Name DB fields
+    - Add Xilinx Kria SOM and ZCU10{2,4,6} boards to the devices database
+    - Drop the "systemd.gpt_auto=0 rd.systemd.unit=basic.target" values from
+      the snapd_standard_params, which have not been needed since pre-GA of
+      UC20 and were removed in pc gadget on 20th April 2020.
+    - Introduce "Boot-Kernel-Max-Size" and support for compressing kernel
+      images that exceed it. This will allow installation of larger
+      uncompressed kernels on HP ProLiant m400 cartridges.
+    - mkimage_fit: subst KERNEL_VERSION in ITS file with actual kernel
+      version.
+    - Add DB entry, bootscript and ITS templates for Mediatek AIoT i500 board.
+    - Cache lookup of Bootloader-Has-Broken-Ext4-Extent-Support for
+      significant performance improvement on Raspberry Pi
+    - Added note in db/all.db above Pi entries about "incorrect" DTB-Id
+    - Add raspi-nolpae kernel flavor to all supported boards
+    - Added entries for the Pi 4B rev 1.5, and moved CM4 and 400 models to
+      their own entries for the sake of clarity
+    - Include overlays/README in the files copied by Method: pi
+    - Add Kria KR260 support
+    - bootscr.zynqmp:
+      - Add Kria KV260 support on jammy and kinetic
+      - Add ZCU102/104/106 support on jammy and kinetic
+    - image-kria.its: add dtb files into fitimage
+    - Add kernel parameter for Kria TSN
+    - Add ZCU111 support
+    - bootscr.zynqmp
+      - Improve messaging in U-Boot boot script for board detection
+      - Add kria and zcu board support lists
+      - Update kR260 and KV260's bootargs as per AMD-Xilinx's request
+      - Support legacy KV260 U-Boot
+    - Allow to bypass container exit test by introducing FK_FORCE_CONTAINER
+      for RISC-V images build to run flash-kernel in a container
+    - Unconditionally map 'armmp' in the Kernel-Flavors field to 'generic',
+      which is what this flavor is called in Ubuntu.  This allows us to
+      support a much greater number of boards without having to carry an
+      extensive delta against the all.db data file.
+    - Add Mediatek AIoT i1200 board support
+    - Add support for the LicheeRV Dock
+    - Fix Microchip Icicle Kit DTB name
+    - Change FK_FORCE_CONTAINER to FK_FORCE and cleanly exit if running in a
+      chroot environment
+    - Fix remaining reference to FK_FORCE_CONTAINER
+    - Add database entry for Lenovo X13s
+    - Add support for the NXP S32G274A-RDB2
+      - Add entry in db/all.db using the generic U-Boot method, the kernel
+        provided s33g274a-rdb2 device tree to generate a FIT image under
+        boot/firmware/fitImage.
+      - Add its/arm64/image-nxp-s32.its FIT image template applicable for all
+        S32x boards.
+    - Add support for Xilinx Versal VCK190
+    - Add StarFive VisionFive 2 board to db/all.db
+    - Ensure that only kernels in fully "installed" state are considered for
+      flashing
+    - test_functions: Add tests for include_only_flavors
+    - Handle "not fully installed" kernels differently by quitting instead of
+      re-triggering to avoid a dpkg trigger cycle
+    - Bump standards version
+    - d/control: Remove redundant awk dependency to appease lintian
+  * Removed patches obsoleted/merged by upstream:
+    - db/all.db: add dummy entries as noops when running on VMs
+    - Add StarFive VisionFive board to the database
+    - Add support for VisionFive, Nezha and LicheeRV boards
+    - db/all.db: add dummy entry for RISC-V under QEMU
+
+  [ Heinrich Schuchardt ]
+  * Use "any" kernel flavor for all RISC-V boards
+  * Add support for Sipeed Lichee Pi 4A
+
+ -- Dave Jones <dave.jones@canonical.com>  Thu, 22 Jun 2023 15:18:53 +0100
+
 flash-kernel (3.107) unstable; urgency=medium
 
   [ Lubomir Rintel ]
@@ -124,6 +920,295 @@ flash-kernel (3.107) unstable; urgency=m
 
  -- Vagrant Cascadian <vagrant@debian.org>  Wed, 19 Apr 2023 14:12:53 -0700
 
+flash-kernel (3.106ubuntu14) lunar; urgency=medium
+
+  * Handle "not fully installed" kernels differently by quitting instead of
+    re-triggering to avoid a dpkg trigger cycle (LP: #2011925)
+
+ -- Dave Jones <dave.jones@canonical.com>  Thu, 23 Mar 2023 14:12:19 +0000
+
+flash-kernel (3.106ubuntu13) lunar; urgency=medium
+
+  * Ensure that only kernels in fully "installed" state are considered for
+    flashing (LP: #2007827)
+  * test_functions: Add tests for include_only_flavors
+  * d/control: Remove redundant awk dependency to appease lintian
+  * Bump standards version
+
+ -- Dave Jones <dave.jones@canonical.com>  Mon, 27 Feb 2023 11:53:49 +0000
+
+flash-kernel (3.106ubuntu12) lunar; urgency=medium
+
+  * Add StarFive VisionFive 2 board to db/all.db (LP: #2007981)
+
+ -- Heinrich Schuchardt <heinrich.schuchardt@canonical.com>  Tue, 21 Feb 2023 14:52:26 +0100
+
+flash-kernel (3.106ubuntu11) lunar; urgency=medium
+
+  * Add support for Xilinx Versal VCK190 (LP: #2006558)
+
+ -- Ethan Hsieh <ethan.hsieh@canonical.com>  Wed, 08 Feb 2023 15:49:46 +0800
+
+flash-kernel (3.106ubuntu10) lunar; urgency=medium
+
+  * Add support for the NXP S32G274A-RDB2 (LP: #2004495)
+    - Add entry in db/all.db using the generic U-Boot method, the kernel
+      provided s33g274a-rdb2 device tree to generate a FIT image under
+      boot/firmware/fitImage.
+    - Add its/arm64/image-nxp-s32.its FIT image template applicable for all
+      S32x boards.
+
+ -- Isaac True <isaac.true@canonical.com>  Wed, 01 Feb 2023 15:30:35 +0000
+
+flash-kernel (3.106ubuntu9) lunar; urgency=medium
+
+  * Add database entry for Lenovo X13s (LP: #2002092)
+
+ -- Heinrich Schuchardt <heinrich.schuchardt@canonical.com>  Fri, 06 Jan 2023 13:27:16 +0100
+
+flash-kernel (3.106ubuntu8) kinetic; urgency=medium
+
+  * Fix remaining reference to FK_FORCE_CONTAINER (LP: #1955353)
+
+ -- Dave Jones <dave.jones@canonical.com>  Mon, 17 Oct 2022 13:46:14 +0100
+
+flash-kernel (3.106ubuntu7) kinetic; urgency=medium
+
+  * Change FK_FORCE_CONTAINER to FK_FORCE and cleanly exit if running
+    in a chroot environment (LP: #1955353)
+
+ -- William 'jawn-smith' Wilson <jawn-smith@ubuntu.com>  Thu, 08 Sep 2022 09:16:55 -0500
+
+flash-kernel (3.106ubuntu6) kinetic; urgency=medium
+
+  * Add support for the LicheeRV Dock (LP: #1987735)
+  * Fix Microchip Icicle Kit DTB name (LP: #1988169)
+
+ -- Alexandre Ghiti <alexandre.ghiti@canonical.com>  Tue, 30 Aug 2022 15:07:30 +0200
+
+flash-kernel (3.106ubuntu5) kinetic; urgency=medium
+
+  * Add Mediatek AIoT i1200 board support
+
+ -- Ethan Hsieh <ethan.hsieh@canonical.com>  Mon, 15 Aug 2022 10:51:16 +0800
+
+flash-kernel (3.106ubuntu4) kinetic; urgency=medium
+
+  * Unconditionally map 'armmp' in the Kernel-Flavors field to 'generic',
+    which is what this flavor is called in Ubuntu.  This allows us to support
+    a much greater number of boards without having to carry an extensive
+    delta against the all.db data file.
+
+ -- Steve Langasek <steve.langasek@ubuntu.com>  Mon, 01 Aug 2022 15:13:38 +0000
+
+flash-kernel (3.106ubuntu3) kinetic; urgency=medium
+
+  [ Ethan Hsieh ]
+
+  * Add ZCU111 support (LP: #1978798)
+  * bootscr.zynqmp (LP: #1978798)
+    - Improve messaging in U-Boot boot script for board detection
+    - Add kria and zcu board support lists
+    - Update kR260 and KV260's bootargs as per AMD-Xilinx's request
+    - Support legacy KV260 U-Boot
+
+  [ Alexandre Ghiti ]
+
+  * Allow to bypass container exit test by introducing FK_FORCE_CONTAINER
+    for RISC-V images build to run flash-kernel in a container (LP: #1980929)
+
+ -- Dave Jones <dave.jones@canonical.com>  Thu, 14 Jul 2022 13:19:57 +0100
+
+flash-kernel (3.106ubuntu2) kinetic; urgency=medium
+
+  * db/all.db: add dummy entry for RISC-V under QEMU (LP: #1980519)
+
+ -- Dave Jones <dave.jones@canonical.com>  Wed, 06 Jul 2022 11:25:53 +0100
+
+flash-kernel (3.106ubuntu1) kinetic; urgency=medium
+
+  [ Dave Jones ]
+
+  * Merge from Debian unstable (LP: #1973801). Remaining changes:
+    - Add support for QCT APQ8064 CDP
+      - Add support for QCT APQ8064 CDP; thanks Alfonso Sanchez-Beato.
+    - Add support for Calxeda Highbank
+      - Add support for Calxeda Highbank (with bootscr.highbank different from
+        Debian's version)
+      - bootscr.highbank: allow more space to load larger kernels
+    - Add support for Nexus 4 (Mako)
+      - Enabling support for mako (Nexus 4)
+    - Add support for Marvell ArmadaXP
+      - Re-add support for Marvell ArmadaXP
+      - Fix armadaxp kernel load address
+    - Add support for Samsung Exynos 5440 platforms
+      - Add support for EXYNOS5440-based platforms
+    - Add generic-lpae to the XB-Subarchitecture list in debian/control
+    - debian/flash-kernel-installer.isinstallable: add arm*/generic-lpae
+    - Add support for HP ProLiant m400 cartridges
+      - Add support for HP ProLiant m400 Server Cartridges
+      - HP Moonshot Cartridges: Use $baudrate from u-boot environment as
+        serial console speed
+      - HP Moonshot Cartridges: Enable hardware flow control as required by
+        the HP moonshot chassis
+      - Enable U-Boot environment support for X-Gene platforms
+      - Use filesystem agnostic "load" command instead of assuming ext4
+      - Add a bootscript specific to X-Gene Mustang boards since they need to
+        pull their dtb from the OS.
+    - Add support for OMAP3 and OMAP4 boards
+      - add DB entry for "OMAP3 Beagle Board" (funnily thats missing)
+      - add Panda to the list of supported board in the README file
+      - debian/control: Re-add omap and omap4 to the flash-kernel-installer
+        XB-Subarchitecture field. These appear to have been lost somewhere
+        along the way.
+      - Also add omap and omap4 to flash-kernel-installer.isinstallable.
+      - switch omap3 and omap4 to uEnv.txt/preEnv.txt (the former holds all
+        active boot commands, the latter holds the kernel commandline only)
+      - switch omap3 and omap4 from Bootloader-sets-root: no to yes, we now
+        generate a root=UUID= line on the fly for arches using
+        uEnv.txt/preEnv.txt
+      - introduce bootscript/uEnvtxt.omap
+      - do not move the original uEnvtxt.omap to the target, use a copy
+        instead
+      - add "quiet splash" as default options to omap bootscr
+    - enable UUID detection of the currently used root device
+    - if uEnv.txt is defined in the db for an arch, generate preEnv.txt from
+      UBOOT_DEFAULTS and UUID detection data
+    - make sure blkid only gives us the UUID and not any other metadata like
+      labels or filesystem
+    - hide the boot device from udisk's automounting after installation on all
+      systems using uEnv.txt to configure u-boot
+    - make sure we only rename the bootrom partition so udisks hides it, when
+      using mkdosfs for setting the label like we did in jasper (where we
+      cached the contents before doing this) MLO and u-boot.bin are gone
+    - Add support for grouper boards
+      - add support for the grouper architecture
+    - db/all.db: add dummy entries as noops when running on VMs
+    - Add support for Wandboard Quad
+      - Wandboard: Use /dev/disk/by-path/platform-2198000.usdhc-part1 instead
+        of the hardcoded mmcblk1p1, this should make things work on boards
+        with just a single microSD card in.
+      - Add basic support for WandBoard Quad.
+    - Add support for AAarch64 Qualcomm laptops.
+      - Fix AARCH64 qcom laptop names, to those accepted upstream and in the
+        Ubuntu kernel.
+    - Add support for Raspberry Pi 2, 3, 3+, CM3, CM3+, and 4 using a unified
+      bootscript (replaces upstream's entries)
+      - Update pi bootscript to support all flash-kernel vars, including
+        calculated devtype and partition for future USB boot support
+      - Install all potential uboot scripts [previously undocumented]
+      - Add entry for Raspberry Pi 3A+
+      - Add entry for Raspberry Pi CM4
+      - Add entry for Raspberry Pi 400
+      - Import UC20 updates to the rpi bootscript from the snappy-dev/image
+        PPA
+    - Add Kernel-Flavors check to Raspberry Pi entries
+      - Support "raspi" kernel flavor
+    - make sure that if we dont want to override the bootloader root= option
+      by setting "Bootloader-sets-root: yes", we actually dont do it
+    - Update tests with new fields: Bootloader-sets-root
+    - use umount -l in the cleanup function, else we fail while finishing up
+      with the script
+    - add a diversion for update-initramfs to live-installers post-base-
+      installer.d to avoid update-initramfs runs before flash-kernel is
+      configured
+    - add a check for the diverted update-initramfs to flash-kernel-installer,
+      so it gets reverted before we try to call update-initramfs
+    - make post-base-installer.d/01flash-kernel-diversion actually an
+      executable shell script
+    - make sure that /dev is bind mounted in /target when running update-
+      initramfs from flash-kernel-installer, else we do not find the boot
+      media (this is only a workaround, actual fixing of the netinst
+      environment is needed to fix this properly)
+    - drop the "|| true" from the initramfs building code, if we fail here we
+      actually dont want to attempt to flash that
+    - Do not run flash-kernel inside an LXC container
+    - Migrate default /etc/default/flash-kernel content to new default without
+      asking via debconf
+    - Filter the selection of 'latest' usable kernel through the whitelist.
+    - Do not fail if there are no specified Kernel-Flavors for this machine.
+    - flash-kernel/functions: Stop attempting to install the latest kernel if
+      we request an older version, just refuse to act without --force.
+    - Look for dtbs in /lib/firmware/$kvers/device-tree/ in find_dtb_file()
+    - Allow us to find DTBs in both the old flat layout and the new vendor
+      subdirectory layout, so we keep backward compatibility
+    - Add support for gzip-compressed kernel images
+    - Fix mkimage_kernel tests
+    - Add tests for android-related functions
+    - Add "pi" value for the "Method" field which copies all dtbs and overlays
+      to the boot partition and provides defaults for the boot paths of the
+      kernel, initrd, and u-boot script.
+      - This fixes upgrades to support the Pi 4 on Bionic
+      - Permit initrd to be missing in flash-kernel
+      - Make U-boot optional in the "pi" method. From Groovy onwards, U-Boot
+        will be an option in the boot chain but not activated by default. For
+        the time being, the U-Boot-Script-Name will remain in the Pi entries,
+        but this commit permits it to be blank in future.
+      - Copy the Pi's bootloader firmware. At present, the Pi's bootloader
+        firmware is being copied to the boot partition by the postinst of the
+        linux-firmware-raspi2 package. However, flash-kernel should be
+        responsible for copying *everything* necessary to boot the Linux
+        kernel, hence this responsibility should be transferred to flash-
+        kernel.
+    - Ensure tests work independently of sort implementation
+    - Always run flash-kernel on install/upgrade
+    - Add pattern matching for machines
+      - A requirement has come up to permit a simple form of pattern matching
+        (specifically shell-style globbing) in the Machine field of the
+        database. This commit implements this via a "case" match.
+    - Add workaround for older u-boot versions that can fail to read files
+      using ext4 extents, and enable it for HP ProLiant m400 Moonshot Server
+      Cartridges.
+    - Make errors in workaround for HP Proliant m400 u-boot ext4 parsing bug
+      fatal.
+    - Install u-boot binaries in addition to u-boot scripts for the Pi
+    - Copy overlay_map.dtb into overlays/ sub-directory instead of the root of
+      the boot partition
+    - Add minor board revisions to db/all.db
+    - Add support for FIT images
+      - Support for ITS files
+      - New Boot-FIT-Path and Boot-ITS-File-Name DB fields
+    - Add Xilinx Kria SOM and ZCU10{2,4,6} boards to the devices database
+    - Drop the "systemd.gpt_auto=0 rd.systemd.unit=basic.target" values from
+      the snapd_standard_params, which have not been needed since pre-GA of
+      UC20 and were removed in pc gadget on 20th April 2020.
+    - Introduce "Boot-Kernel-Max-Size" and support for compressing kernel
+      images that exceed it. This will allow installation of larger
+      uncompressed kernels on HP ProLiant m400 cartridges.
+    - mkimage_fit: subst KERNEL_VERSION in ITS file with actual kernel
+      version.
+    - Add DB entry, bootscript and ITS templates for Mediatek AIoT i500 board.
+    - Cache lookup of Bootloader-Has-Broken-Ext4-Extent-Support for
+      significant performance improvement on Raspberry Pi
+    - Added note in db/all.db above Pi entries about "incorrect" DTB-Id
+    - Add raspi-nolpae kernel flavor to all supported boards
+    - Added entries for the Pi 4B rev 1.5, and moved CM4 and 400 models to
+      their own entries for the sake of clarity
+    - Include overlays/README in the files copied by Method: pi
+    - Add Kria KR260 support
+    - bootscr.zynqmp:
+      - Add Kria KV260 support on jammy and kinetic
+      - Add ZCU102/104/106 support on jammy and kinetic
+    - image-kria.its: add dtb files into fitimage
+    - Add kernel parameter for Kria TSN
+  * Removed obsolete patches/changes:
+    - Remove raspi2 flavour
+      - The raspi2 flavour does not exist in Groovy onwards
+  * Removed patches obsoleted/merged by upstream:
+    - Cherry-pick patch from Debian to disable flash-kernel on EFI-based
+      systems.
+    - Add riscv64 support
+    - Add the following boards to db/all.db
+      - SiFive HiFive Unmatched A00
+      - BeagleV Starlight Beta
+
+  [ Alexandre Ghiti ]
+
+  * Add StarFive VisionFive board to the database
+  * Add support for VisionFive, Nezha and LicheeRV boards
+
+ -- Dave Jones <dave.jones@canonical.com>  Tue, 17 May 2022 17:58:28 +0100
+
 flash-kernel (3.106) unstable; urgency=medium
 
   * db/all.db: Move MNT Reform 2 boards later to fix sort order.
@@ -164,6 +1249,234 @@ flash-kernel (3.105) unstable; urgency=m
 
  -- Vagrant Cascadian <vagrant@debian.org>  Fri, 22 Apr 2022 12:26:15 -0700
 
+flash-kernel (3.104ubuntu10) kinetic; urgency=medium
+
+  * Add Kria KR260 support
+  * bootscr.zynqmp:
+    - Add Kria KV260 support on jammy and kinetic
+    - Add ZCU102/104/106 support on jammy and kinetic
+  * image-kria.its: add dtb files into fitimage
+  * Add kernel parameter for Kria TSN
+
+ -- Ethan Hsieh <ethan.hsieh@canonical.com>  Thu, 21 Apr 2022 12:38:21 +0800
+
+flash-kernel (3.104ubuntu9) jammy; urgency=medium
+
+  * Cache lookup of Bootloader-Has-Broken-Ext4-Extent-Support for significant
+    performance improvement on Raspberry Pi (LP: #1965129)
+  * Added note in db/all.db above Pi entries about "incorrect" DTB-Id
+    (LP: #1928314)
+  * Add raspi-nolpae kernel flavor to all supported boards (LP: #1962312)
+  * Added entries for the Pi 4B rev 1.5, and moved CM4 and 400 models to their
+    own entries for the sake of clarity
+  * Include overlays/README in the files copied by Method: pi
+
+ -- Dave Jones <dave.jones@canonical.com>  Mon, 18 Apr 2022 12:13:13 +0100
+
+flash-kernel (3.104ubuntu8) jammy; urgency=medium
+
+  * mkimage_fit: subst KERNEL_VERSION in ITS file with actual kernel
+    version.
+  * Add DB entry, bootscript and ITS templates for Mediatek AIoT i500 board.
+
+ -- Ethan Hsieh <ethan.hsieh@canonical.com>  Sun, 03 Apr 2022 19:33:03 +0200
+
+
+flash-kernel (3.104ubuntu7) jammy; urgency=medium
+
+  * Add riscv64 support (LP: #1966219)
+  * Add the following boards to db/all.db
+    - SiFive HiFive Unmatched A00 
+    - BeagleV Starlight Beta
+
+ -- Heinrich Schuchardt <heinrich.schuchardt@canonical.com>  Tue, 08 Mar 2022 10:05:15 +0100
+
+flash-kernel (3.104ubuntu6) jammy; urgency=medium
+
+  * Introduce "Boot-Kernel-Max-Size" and support for compressing kernel
+    images that exceed it. This will allow installation of larger
+    uncompressed kernels on HP ProLiant m400 cartridges. LP: #1954692
+  * Drop support for HP ProLiant m800 cartridges. The kernel flavor they
+    require (-keystone) never shipped in Ubuntu.
+
+ -- dann frazier <dannf@ubuntu.com>  Mon, 31 Jan 2022 16:47:18 +0000
+
+flash-kernel (3.104ubuntu5) impish; urgency=medium
+
+  * Drop the "systemd.gpt_auto=0 rd.systemd.unit=basic.target" values from
+    the snapd_standard_params, which have not been needed since pre-GA of
+    UC20 and were removed in pc gadget on 20th April 2020. LP: #1933093
+
+ -- Dimitri John Ledkov <xnox@ubuntu.com>  Mon, 21 Jun 2021 12:12:21 +0100
+
+flash-kernel (3.104ubuntu4) impish; urgency=medium
+
+  [ Alfonso Sanchez-Beato ]
+  * Add support for FIT images
+    - Support for ITS files
+    - New Boot-FIT-Path and Boot-ITS-File-Name DB fields
+  * Add Xilinx Kria SOM and ZCU10{2,4,6} boards to the devices database
+
+ -- Loïc Minier <loic.minier@ubuntu.com>  Mon, 14 Jun 2021 17:47:16 +0200
+
+flash-kernel (3.104ubuntu3) hirsute; urgency=medium
+
+  * Copy overlay_map.dtb into overlays/ sub-directory instead of the
+    root of the boot partition (LP: #1918110)
+  * Add minor board revisions to db/all.db
+
+ -- Dave Jones <dave.jones@canonical.com>  Tue, 06 Apr 2021 11:31:11 +0100
+
+flash-kernel (3.104ubuntu2) hirsute; urgency=medium
+
+  * Cherry-pick patch from Debian to disable flash-kernel on EFI-based
+    systems. LP: #1920827.
+
+ -- dann frazier <dannf@ubuntu.com>  Mon, 22 Mar 2021 15:21:53 -0600
+
+flash-kernel (3.104ubuntu1) hirsute; urgency=medium
+
+  * Merge with Debian unstable. Remaining changes:
+    - Add support for QCT APQ8064 CDP
+      - Add support for QCT APQ8064 CDP; thanks Alfonso Sanchez-Beato.
+    - Add support for Calxeda Highbank
+      - Add support for Calxeda Highbank (with bootscr.highbank different from
+        Debian's version)
+      - bootscr.highbank: allow more space to load larger kernels
+    - Add support for Nexus 4 (Mako)
+      - Enabling support for mako (Nexus 4)
+    - Add support for Marvell ArmadaXP
+      - Re-add support for Marvell ArmadaXP
+      - Fix armadaxp kernel load address
+    - Add support for Samsung Exynos 5440 platforms
+      - Add support for EXYNOS5440-based platforms
+    - Add generic-lpae to the XB-Subarchitecture list in debian/control
+    - debian/flash-kernel-installer.isinstallable: add arm*/generic-lpae
+    - Add support for HP ProLiant m400 and m800 cartridges
+      - Added support for HP ProLiant m800 Server Cartridge
+      - Add support for HP ProLiant m800 cartridges
+      - Set required boot arguments for HP ProLiant m800 cartridges
+      - Add support for HP ProLiant m400 Server Cartridges
+      - HP Moonshot Cartridges: Use $baudrate from u-boot environment as
+        serial console speed
+      - HP Moonshot Cartridges: Enable hardware flow control as required by
+        the HP moonshot chassis
+      - Enable U-Boot environment support for X-Gene platforms
+      - Use filesystem agnostic "load" command instead of assuming ext4
+      - Add a bootscript specific to X-Gene Mustang boards since they need to
+        pull their dtb from the OS.
+    - Add support for OMAP3 and OMAP4 boards
+      - add DB entry for "OMAP3 Beagle Board" (funnily thats missing)
+      - add Panda to the list of supported board in the README file
+      - debian/control: Re-add omap and omap4 to the flash-kernel-installer
+        XB-Subarchitecture field. These appear to have been lost somewhere
+        along the way.
+      - Also add omap and omap4 to flash-kernel-installer.isinstallable.
+      - switch omap3 and omap4 to uEnv.txt/preEnv.txt (the former holds all
+        active boot commands, the latter holds the kernel commandline only)
+      - switch omap3 and omap4 from Bootloader-sets-root: no to yes, we now
+        generate a root=UUID= line on the fly for arches using
+        uEnv.txt/preEnv.txt
+      - introduce bootscript/uEnvtxt.omap
+      - do not move the original uEnvtxt.omap to the target, use a copy
+        instead
+      - add "quiet splash" as default options to omap bootscr
+    - enable UUID detection of the currently used root device
+    - if uEnv.txt is defined in the db for an arch, generate preEnv.txt from
+      UBOOT_DEFAULTS and UUID detection data
+    - make sure blkid only gives us the UUID and not any other metadata like
+      labels or filesystem
+    - hide the boot device from udisk's automounting after installation on all
+      systems using uEnv.txt to configure u-boot
+    - make sure we only rename the bootrom partition so udisks hides it,
+      when using mkdosfs for setting the label like we did in jasper (where
+      we cached the contents before doing this) MLO and u-boot.bin are gone
+    - Add support for grouper boards
+      - add support for the grouper architecture
+    - db/all.db: add dummy entries as noops when running on VMs
+    - Add support for Wandboard Quad
+      - Wandboard: Use /dev/disk/by-path/platform-2198000.usdhc-part1
+        instead of the hardcoded mmcblk1p1, this should make things work on
+        boards with just a single microSD card in.
+      - Add basic support for WandBoard Quad.
+    - Add support for AAarch64 Qualcomm laptops.
+      - Fix AARCH64 qcom laptop names, to those accepted upstream and in the
+        Ubuntu kernel.
+    - Add support for Raspberry Pi 2, 3, 3+, CM3, CM3+, and 4 using a
+      unified bootscript (replaces upstream's entries)
+      - Update pi bootscript to support all flash-kernel vars, including
+        calculated devtype and partition for future USB boot support
+      - Install all potential uboot scripts [previously undocumented]
+      - Add entry for Raspberry Pi 3A+
+      - Add entry for Raspberry Pi CM4
+      - Add entry for Raspberry Pi 400
+      - Import UC20 updates to the rpi bootscript from the snappy-dev/image
+        PPA
+    - Add Kernel-Flavors check to Raspberry Pi entries
+      - Support "raspi" kernel flavor in addition to "raspi2"
+    - Remove raspi2 flavour
+      - The raspi2 flavour does not exist in Groovy onwards
+    - make sure that if we dont want to override the bootloader root=
+      option by setting "Bootloader-sets-root: yes", we actually dont do it
+    - Update tests with new fields: Bootloader-sets-root
+    - use umount -l in the cleanup function, else we fail while finishing up
+      with the script
+    - add a diversion for update-initramfs to live-installers
+      post-base-installer.d to avoid update-initramfs runs before flash-kernel
+      is configured
+    - add a check for the diverted update-initramfs to flash-kernel-installer,
+      so it gets reverted before we try to call update-initramfs
+    - make post-base-installer.d/01flash-kernel-diversion actually an
+      executable shell script
+    - make sure that /dev is bind mounted in /target when running
+      update-initramfs from flash-kernel-installer, else we do not find the
+      boot media (this is only a workaround, actual fixing of the netinst
+      environment is needed to fix this properly)
+    - drop the "|| true" from the initramfs building code, if we fail here we
+      actually dont want to attempt to flash that
+    - Do not run flash-kernel inside an LXC container
+    - Migrate default /etc/default/flash-kernel content to new default without
+      asking via debconf
+    - Filter the selection of 'latest' usable kernel through the whitelist.
+    - Do not fail if there are no specified Kernel-Flavors for this machine.
+    - flash-kernel/functions: Stop attempting to install the latest kernel
+      if we request an older version, just refuse to act without --force.
+    - Look for dtbs in /lib/firmware/$kvers/device-tree/ in find_dtb_file()
+    - Allow us to find DTBs in both the old flat layout and the new vendor
+      subdirectory layout, so we keep backward compatibility
+    - Add support for gzip-compressed kernel images
+    - Fix mkimage_kernel tests
+    - Add tests for android-related functions
+    - Add "pi" value for the "Method" field which copies all dtbs and
+      overlays to the boot partition and provides defaults for the boot
+      paths of the kernel, initrd, and u-boot script.
+      - This fixes upgrades to support the Pi 4 on Bionic
+      - Permit initrd to be missing in flash-kernel
+      - Make U-boot optional in the "pi" method. From Groovy onwards, U-Boot
+        will be an option in the boot chain but not activated by default.
+        For the time being, the U-Boot-Script-Name will remain in the Pi
+        entries, but this commit permits it to be blank in future.
+      - Copy the Pi's bootloader firmware. At present, the Pi's bootloader
+        firmware is being copied to the boot partition by the postinst of
+        the linux-firmware-raspi2 package. However, flash-kernel should be
+        responsible for copying *everything* necessary to boot the Linux
+        kernel, hence this responsibility should be transferred to
+        flash-kernel.
+    - Always run flash-kernel on install/upgrade
+    - Add pattern matching for machines
+      - A requirement has come up to permit a simple form of pattern matching
+        (specifically shell-style globbing) in the Machine field of the
+        database. This commit implements this via a "case" match.
+    - Ensure tests work independently of sort implementation
+    - Add workaround for older u-boot versions that can fail to read files
+      using ext4 extents, and enable it for HP ProLiant m400 Moonshot Server
+      Cartridges.
+    - Make errors in workaround for HP Proliant m400 u-boot ext4 parsing bug
+      fatal.
+  * Install u-boot binaries in addition to u-boot scripts for the Pi
+
+ -- Dave Jones <dave.jones@canonical.com>  Thu, 18 Feb 2021 12:06:26 +0000
+
 flash-kernel (3.104) unstable; urgency=medium
 
   [ Guido Günther ]
@@ -192,6 +1505,160 @@ flash-kernel (3.104) unstable; urgency=m
 
  -- Vagrant Cascadian <vagrant@debian.org>  Sat, 06 Feb 2021 19:42:01 -0800
 
+flash-kernel (3.103ubuntu2) hirsute; urgency=medium
+
+  * Make errors in workaround for HP Proliant m400 u-boot ext4 parsing
+    bug fatal. LP: #1915078.
+
+ -- dann frazier <dannf@ubuntu.com>  Mon, 08 Feb 2021 17:54:06 -0700
+
+flash-kernel (3.103ubuntu1) hirsute; urgency=medium
+
+  * Merge with Debian unstable. Remaining changes:
+    - Add support for QCT APQ8064 CDP
+      - Add support for QCT APQ8064 CDP; thanks Alfonso Sanchez-Beato.
+    - Add support for Calxeda Highbank
+      - Add support for Calxeda Highbank (with bootscr.highbank different
+        from Debian's version)
+      - bootscr.highbank: allow more space to load larger kernels
+    - Add support for Nexus 4 (Mako)
+      - Enabling support for mako (Nexus 4)
+    - Add support for Marvell ArmadaXP
+      - Re-add support for Marvell ArmadaXP
+      - Fix armadaxp kernel load address
+    - Add support for Samsung Exynos 5440 platforms
+      - Add support for EXYNOS5440-based platforms
+    - Add generic-lpae to the XB-Subarchitecture list in debian/control
+      - debian/flash-kernel-installer.isinstallable: add arm*/generic-lpae
+    - Add support for HP ProLiant m400 and m800 cartridges
+      - Added support for HP ProLiant m800 Server Cartridge
+      - Add support for HP ProLiant m800 cartridges
+      - Set required boot arguments for HP ProLiant m800 cartridges
+      - Add support for HP ProLiant m400 Server Cartridges
+      - HP Moonshot Cartridges: Use $baudrate from u-boot environment as
+        serial console speed
+      - HP Moonshot Cartridges: Enable hardware flow control as required by
+        the HP moonshot chassis
+      - Enable U-Boot environment support for X-Gene platforms
+      - Use filesystem agnostic "load" command instead of assuming ext4
+      - Add a bootscript specific to X-Gene Mustang boards since they need to
+        pull their dtb from the OS.
+    - Add support for OMAP3 and OMAP4 boards
+      - add DB entry for "OMAP3 Beagle Board" (funnily thats missing)
+      - add Panda to the list of supported board in the README file
+      - debian/control: Re-add omap and omap4 to the flash-kernel-installer
+        XB-Subarchitecture field. These appear to have been lost somewhere
+        along the way.
+      - Also add omap and omap4 to flash-kernel-installer.isinstallable.
+      - switch omap3 and omap4 to uEnv.txt/preEnv.txt (the former holds all
+        active boot commands, the latter holds the kernel commandline only)
+      - switch omap3 and omap4 from Bootloader-sets-root: no to yes, we now
+        generate a root=UUID= line on the fly for arches using
+        uEnv.txt/preEnv.txt
+      - introduce bootscript/uEnvtxt.omap
+      - do not move the original uEnvtxt.omap to the target, use a copy
+        instead
+      - add "quiet splash" as default options to omap bootscr
+      - enable UUID detection of the currently used root device
+      - if uEnv.txt is defined in the db for an arch, generate preEnv.txt
+        from UBOOT_DEFAULTS and UUID detection data
+      - make sure blkid only gives us the UUID and not any other metadata
+        like labels or filesystem
+      - hide the boot device from udisk's automounting after installation
+        on all systems using uEnv.txt to configure u-boot
+      - make sure we only rename the bootrom partition so udisks hides it,
+        when using mkdosfs for setting the label like we did in jasper
+        (where we cached the contents before doing this) MLO and u-boot.bin
+        are gone
+    - Add support for grouper boards
+      - add support for the grouper architecture
+    - db/all.db: add dummy entries as noops when running on VMs
+    - Add support for Wandboard Quad
+      - Wandboard: Use /dev/disk/by-path/platform-2198000.usdhc-part1 instead
+        of the hardcoded mmcblk1p1, this should make things work on boards
+        with just a single microSD card in.
+      - Add basic support for WandBoard Quad.
+    - Add support for AAarch64 Qualcomm laptops.
+      - Fix AARCH64 qcom laptop names, to those accepted upstream and in the
+        Ubuntu kernel. LP: #1847594
+    - Add support for Raspberry Pi 2, 3, 3+, CM3, CM3+, and 4 using a
+      unified bootscript (replaces upstream's entries)
+      - Update pi bootscript to support all flash-kernel vars, including
+        calculated devtype and partition for future USB boot support
+      - Install all potential uboot scripts [previously undocumented]
+      - Add entry for Raspberry Pi 3A+ (LP: #1841955)
+      - Add entry for Raspberry Pi CM4
+      - Add entry for Raspberry Pi 400
+      - Import UC20 updates to the rpi bootscript from the snappy-dev/image
+        PPA (LP: #1871831)
+    - Add Kernel-Flavors check to Raspberry Pi entries
+      - Support "raspi" kernel flavor in addition to "raspi2" (LP: #1868071)
+    - Remove raspi2 flavour
+      - The raspi2 flavour does not exist in Groovy onwards
+    - make sure that if we dont want to override the bootloader root=
+      option by setting "Bootloader-sets-root: yes", we actually dont do it
+      - Update tests with new fields: Bootloader-sets-root
+    - use umount -l in the cleanup function, else we fail while finishing
+      up with the script
+    - add a diversion for update-initramfs to live-installers
+      post-base-installer.d to avoid update-initramfs runs before
+      flash-kernel is configured
+      - add a check for the diverted update-initramfs to
+        flash-kernel-installer, so it gets reverted before we try to call
+        update-initramfs
+      - make post-base-installer.d/01flash-kernel-diversion actually an
+        executable shell script
+    - make sure that /dev is bind mounted in /target when running
+      update-initramfs from flash-kernel-installer, else we do not find the
+      boot media (this is only a workaround, actual fixing of the netinst
+      environment is needed to fix this properly)
+      - drop the "|| true" from the initramfs building code, if we fail here
+        we actually dont want to attempt to flash that
+    - Do not run flash-kernel inside an LXC container
+    - Migrate default /etc/default/flash-kernel content to new default
+      without asking via debconf
+    - Filter the selection of 'latest' usable kernel through the whitelist.
+      - Do not fail if there are no specified Kernel-Flavors for this
+        machine.
+    - flash-kernel/functions: Stop attempting to install the latest kernel
+      if we request an older version, just refuse to act without --force.
+    - Look for dtbs in /lib/firmware/$kvers/device-tree/ in find_dtb_file()
+      - Allow us to find DTBs in both the old flat layout and the new vendor
+        subdirectory layout, so we keep backward compatibility
+    - Add support for gzip-compressed kernel images
+    - Fix mkimage_kernel tests
+    - Add tests for android-related functions
+    - Add "pi" value for the "Method" field which copies all dtbs and
+      overlays to the boot partition and provides defaults for the boot
+      paths of the kernel, initrd, and u-boot script.
+      - This fixes upgrades to support the Pi 4 on Bionic (LP: #1850678)
+      - Permit initrd to be missing in flash-kernel (LP: #1867791)
+      - Make U-boot optional in the "pi" method. From Groovy onwards, U-Boot
+        will be an option in the boot chain but not activated by default. For
+        the time being, the U-Boot-Script-Name will remain in the Pi entries,
+        but this commit permits it to be blank in future.
+      - Copy the Pi's bootloader firmware. At present, the Pi's bootloader
+        firmware is being copied to the boot partition by the postinst of the
+        linux-firmware-raspi2 package. However, flash-kernel should be
+        responsible for copying *everything* necessary to boot the Linux
+        kernel, hence this responsibility should be transferred to
+        flash-kernel.
+    - Always run flash-kernel on install/upgrade
+    - Add pattern matching for machines
+      - A requirement has come up to permit a simple form of pattern matching
+        (specifically shell-style globbing) in the Machine field of the
+        database. This commit implements this via a "case" match.
+    - Ensure tests work independently of sort implementation
+    - Add workaround for older u-boot versions that can fail to read files
+      using ext4 extents, and enable it for HP ProLiant m400 Moonshot Server
+      Cartridges. LP: #1900796
+
+  * Added entry for RPi 400 to db/all.db (previously implied by the Raspberry
+    Pi wildcard entry)
+  * Ensured tests run successfully regardless of the "sort" implementation
+
+ -- Dave Jones <dave.jones@canonical.com>  Sun, 22 Nov 2020 15:32:05 +0000
+
 flash-kernel (3.103) unstable; urgency=medium
 
   * Team upload
@@ -242,6 +1709,177 @@ flash-kernel (3.101) unstable; urgency=m
 
  -- Holger Wansing <hwansing@mailbox.org>  Sun, 12 Jul 2020 12:42:27 +0200
 
+flash-kernel (3.100ubuntu5) hirsute; urgency=medium
+
+  * Add workaround for older u-boot versions that can fail to read files
+    using ext4 extents, and enable it for HP ProLiant m400 Moonshot Server
+    Cartridges. LP: #1900796
+
+ -- dann frazier <dannf@ubuntu.com>  Mon, 14 Dec 2020 16:48:14 -0700
+
+flash-kernel (3.100ubuntu4) groovy; urgency=medium
+
+  * Use wild-card matching in check_supported as well as get_machine_field
+    (LP: #1899493)
+
+ -- Dave Jones <dave.jones@canonical.com>  Mon, 12 Oct 2020 15:21:57 +0100
+
+flash-kernel (3.100ubuntu3) groovy; urgency=medium
+
+  * Add new Pi models to the database
+  * Remove the -raspi2 kernel flavor from the database
+  * Add support for pattern matching in the Machine: field of the database
+  * For the "pi" method, copy the boot firmware too (relates to LP: #1895137)
+
+ -- Dave Jones <dave.jones@canonical.com>  Wed, 23 Sep 2020 13:14:09 +0100
+
+flash-kernel (3.100ubuntu2) groovy; urgency=medium
+
+  * Import UC20 updates to the rpi bootscript from the snappy-dev/image
+    PPA. LP: #1871831
+
+ -- Dimitri John Ledkov <xnox@ubuntu.com>  Mon, 15 Jun 2020 14:29:41 +0100
+
+flash-kernel (3.100ubuntu1) groovy; urgency=medium
+
+  * Merge with Debian unstable. Remaining changes:
+    - Add support for QCT APQ8064 CDP
+      - Add support for QCT APQ8064 CDP; thanks Alfonso Sanchez-Beato.
+    - Add support for Calxeda Highbank
+      - Add support for Calxeda Highbank (with bootscr.highbank different from
+        Debian's version)
+      - bootscr.highbank: allow more space to load larger kernels
+    - Add support for Nexus 4 (Mako)
+      - Enabling support for mako (Nexus 4)
+    - Add support for Marvell ArmadaXP
+      - Re-add support for Marvell ArmadaXP
+      - Fix armadaxp kernel load address
+    - Add support for Samsung Exynos 5440 platforms
+      - Add support for EXYNOS5440-based platforms
+    - Add generic-lpae to the XB-Subarchitecture list in debian/control
+      - debian/flash-kernel-installer.isinstallable: add arm*/generic-lpae
+    - Add support for HP ProLiant m400 and m800 cartridges
+      - Added support for HP ProLiant m800 Server Cartridge
+      - Add support for HP ProLiant m800 cartridges
+      - Set required boot arguments for HP ProLiant m800 cartridges
+      - Add support for HP ProLiant m400 Server Cartridges
+      - HP Moonshot Cartridges: Use $baudrate from u-boot environment as
+        serial console speed
+      - HP Moonshot Cartridges: Enable hardware flow control as required by
+        the HP moonshot chassis
+      - Enable U-Boot environment support for X-Gene platforms
+      - Use filesystem agnostic "load" command instead of assuming ext4
+      - Add a bootscript specific to X-Gene Mustang boards since they need to
+        pull their dtb from the OS.
+    - Add support for OMAP3 and OMAP4 boards
+      - add DB entry for "OMAP3 Beagle Board" (funnily thats missing)
+      - add Panda to the list of supported board in the README file
+      - debian/control: Re-add omap and omap4 to the flash-kernel-installer
+        XB-Subarchitecture field. These appear to have been lost somewhere
+        along the way.
+      - Also add omap and omap4 to flash-kernel-installer.isinstallable.
+      - switch omap3 and omap4 to uEnv.txt/preEnv.txt (the former holds all
+        active boot commands, the latter holds the kernel commandline only)
+      - switch omap3 and omap4 from Bootloader-sets-root: no to yes, we now
+        generate a root=UUID= line on the fly for arches using
+        uEnv.txt/preEnv.txt
+      - introduce bootscript/uEnvtxt.omap
+      - do not move the original uEnvtxt.omap to the target, use a copy
+        instead
+      - add "quiet splash" as default options to omap bootscr
+      - enable UUID detection of the currently used root device
+      - if uEnv.txt is defined in the db for an arch, generate preEnv.txt from
+        UBOOT_DEFAULTS and UUID detection data
+      - make sure blkid only gives us the UUID and not any other metadata like
+        labels or filesystem
+      - hide the boot device from udisk's automounting after installation on
+        all systems using uEnv.txt to configure u-boot
+      - make sure we only rename the bootrom partition so udisks hides it,
+        when using mkdosfs for setting the label like we did in jasper (where
+        we cached the contents before doing this) MLO and u-boot.bin are gone
+    - Add support for grouper boards
+      - add support for the grouper architecture
+    - Add support for Wandboard Quad
+      - Wandboard: Use /dev/disk/by-path/platform-2198000.usdhc-part1
+        instead of the hardcoded mmcblk1p1, this should make things work on
+        boards with just a single microSD card in.
+      - Add basic support for WandBoard Quad.
+    - Add support for Raspberry Pi 2, 3, 3+, CM3, CM3+, and 4 using a unified
+      bootscript (replaces upstream's entries)
+      - Update pi bootscript to support all flash-kernel vars, including
+        calculated devtype and partition for future USB boot support
+      - Install all potential uboot scripts [previously undocumented]
+    - db/all.db: Add dummy entries as noops when running on VMs
+    - make sure that if we dont want to override the bootloader root=
+      option by setting "Bootloader-sets-root: yes", we actually dont do it
+    - Update tests with new fields: Bootloader-sets-root
+    - use umount -l in the cleanup function, else we fail while finishing up
+      with the script
+    - add a diversion for update-initramfs to live-installers
+      post-base-installer.d to avoid update-initramfs runs before flash-kernel
+      is configured
+    - add a check for the diverted update-initramfs to flash-kernel-installer,
+      so it gets reverted before we try to call update-initramfs
+    - make post-base-installer.d/01flash-kernel-diversion actually an
+      executable shell script
+    - make sure that /dev is bind mounted in /target when running
+      update-initramfs from flash-kernel-installer, else we do not find the
+      boot media (this is only a workaround, actual fixing of the netinst
+      environment is needed to fix this properly)
+    - drop the "|| true" from the initramfs building code, if we fail here we
+      actually dont want to attempt to flash that
+    - Do not run flash-kernel inside an LXC container
+    - Migrate default /etc/default/flash-kernel content to new default without
+      asking via debconf
+    - Filter the selection of 'latest' usable kernel through the whitelist.
+    - Do not fail if there are no specified Kernel-Flavors for this machine.
+    - flash-kernel/functions: Stop attempting to install the latest kernel
+      if we request an older version, just refuse to act without --force.
+    - Look for dtbs in /lib/firmware/$kvers/device-tree/ in find_dtb_file()
+    - Allow us to find DTBs in both the old flat layout and the new vendor
+      subdirectory layout, so we keep backward compatibility
+    - Add support for gzip-compressed kernel images
+    - Add support for AAarch64 Qualcomm laptops.
+      - Fix AARCH64 qcom laptop names, to those accepted upstream and in the
+        Ubuntu kernel. LP: #1847594
+    - Fix mkimage_kernel tests
+    - Add "pi" value for the "Method" field which copies all dtbs and overlays
+      to the boot partition and provides defaults for the boot paths of the
+      kernel, initrd, and u-boot script. This fixes upgrades to support the Pi
+      4 on Bionic (LP: #1850678)
+    - Add tests for android-related functions [previously undocumented]
+    - Add Kernel-Flavors check to Raspberry Pi entries [previously
+      undocumented]
+      - Support "raspi" kernel flavor in addition to "raspi2" (LP: #1868071)
+    - Add entry for Raspberry Pi 3A+ (LP: #1841955)
+    - Always run flash-kernel on install/upgrade
+    - Permit initrd to be missing in flash-kernel and the pi u-boot script
+      (LP: #1867791)
+
+  * Dropped obsolete changes:
+    - Include support for arm*/ixp4xx and arm*/iop32x (was dropped upstream
+      but erroneously re-included in prior merge)
+    - re-add support for the FLASH_KERNEL_SKIP env variable, so the image
+      build infrastructure has a chance to skip the automated flash-kernel run
+      during image builds.
+    - Also check for FLASH_KERNEL_SKIP to avoid setting up the root parameter
+      in case flash-kernel will not be used
+    - make the package postinst respect FLASH_KERNEL_SKIP
+    - Remove FLASH_KERNEL_SKIP; it's no longer used in livecd-rootfs
+    - Add support for installing dtb files in boot partition
+    - Remove redundant copying of boot dtb
+    - Apply patch from Paolo Pisati for appended DTB support
+    - Update tests with new fields: DTB-Kernel-Version
+    - Fix typo in dtb_kver test that made it break all non-dtb platforms.
+    - Remove redundant DTB-Kernel-Version field (in favour of upstream
+      DTB-Append-From field)
+    - Merge all RPi bootscripts into one unified bootscript which handles all
+      Pi architectures
+    - Remove uboot.env case which was only used for RPi2 (now supported by the
+      unified RPi bootscript)
+
+ -- Dave Jones <dave.jones@canonical.com>  Mon, 04 May 2020 20:14:16 +0000
+
 flash-kernel (3.100) unstable; urgency=medium
 
   * Team upload
@@ -283,6 +1921,227 @@ flash-kernel (3.99) unstable; urgency=me
 
  -- Vagrant Cascadian <vagrant@debian.org>  Fri, 24 May 2019 18:36:25 -0700
 
+flash-kernel (3.98ubuntu12) focal; urgency=medium
+
+  * Support "raspi" kernel flavor in addition to "raspi2" (LP: #1868071)
+  * Permit initrd to be missing in flash-kernel and the pi u-boot script
+    (LP: #1867791)
+  * Backport optional initrd changes from upstream to reduce our delta
+  * Move the container test from initramfs and kernel hooks to main to prevent
+    flash-kernel ever running in a container (LP: #1863145)
+  * Remove FLASH_KERNEL_SKIP; it's no longer used in livecd-rootfs
+
+ -- Dave Jones <dave.jones@canonical.com>  Mon, 23 Mar 2020 14:10:03 +0000
+
+flash-kernel (3.98ubuntu11) focal; urgency=medium
+
+  * Permit flash-kernel to workaround an inconsistent /boot directory when
+    triggered prior to the kernel finishing its triggers (LP: #1861292)
+
+ -- Dave Jones <dave.jones@canonical.com>  Wed, 29 Jan 2020 16:15:05 +0000
+
+flash-kernel (3.98ubuntu10) focal; urgency=medium
+
+  * Always run flash-kernel on install/upgrade
+
+ -- Dave Jones <dave.jones@canonical.com>  Wed, 22 Jan 2020 19:53:20 +0000
+
+flash-kernel (3.98ubuntu9) focal; urgency=medium
+
+  * Ensure overlays dir always exists
+
+ -- Dave Jones <dave.jones@canonical.com>  Fri, 17 Jan 2020 13:40:28 +0000
+
+flash-kernel (3.98ubuntu8) focal; urgency=medium
+
+  * Add support for the Raspberry Pi 4 rev 1.2 board (LP: #1854487)
+
+ -- Dave Jones <dave.jones@canonical.com>  Fri, 29 Nov 2019 11:35:00 +0000
+
+flash-kernel (3.98ubuntu7) focal; urgency=medium
+
+  * Add systemd depends, as systemd-detect-virt is called in the scripts.
+
+ -- Dimitri John Ledkov <xnox@ubuntu.com>  Tue, 26 Nov 2019 14:18:02 +0000
+
+flash-kernel (3.98ubuntu6) focal; urgency=medium
+
+  * Remove redundant DTB-Kernel-Version field
+  * Remove redundant copying of boot dtb
+  * Fix mkimage_kernel tests
+  * Add "pi" value for the "Method" field which copies all dtbs and overlays
+    to the boot partition and provides defaults for the boot paths of the
+    kernel, initrd, and u-boot script. This fixes upgrades to support the Pi 4
+    on Bionic (LP: #1850678)
+  * Update pi bootscript to support all flash-kernel vars, including
+    calculated devtype and partition for future USB boot support
+  * Add entry for Raspberry Pi 3A+ (LP: #1841955)
+
+ -- Dave Jones <dave.jones@canonical.com>  Thu, 07 Nov 2019 14:02:26 +0000
+
+flash-kernel (3.98ubuntu5) eoan; urgency=medium
+
+  * Fix AARCH64 qcom laptop names, to those accepted upstream and in the
+    Ubuntu kernel. LP: #1847594
+
+ -- Dimitri John Ledkov <xnox@ubuntu.com>  Thu, 10 Oct 2019 13:04:59 +0100
+
+flash-kernel (3.98ubuntu4) eoan; urgency=medium
+
+  * Add support for Raspberry Pi 4 (LP: #1847587)
+
+ -- Dave Jones <dave.jones@canonical.com>  Thu, 10 Oct 2019 10:41:43 +0100
+
+flash-kernel (3.98ubuntu3) eoan; urgency=medium
+
+  * Add support for AAarch64 Qualcomm laptops.
+
+ -- Dimitri John Ledkov <xnox@ubuntu.com>  Sun, 21 Jul 2019 11:17:17 -0300
+
+flash-kernel (3.98ubuntu2) eoan; urgency=medium
+
+  * Merge all RPi bootscripts into one unified bootscript which handles all Pi
+    architectures
+  * Remove uboot.env case which was only used for RPi2 (now supported by the
+    unified RPi bootscript)
+
+ -- Dave Jones <dave.jones@canonical.com>  Tue, 11 Jun 2019 13:43:21 +0000
+
+flash-kernel (3.98ubuntu1) eoan; urgency=medium
+
+  * Merge with Debian unstable. Remaining changes:
+    - add "quiet splash" as default options to omap bootscr
+    - re-add support for the FLASH_KERNEL_SKIP env variable, so the image
+      build infrastructure has a chance to skip the automated flash-kernel run
+      during image builds.
+    - Also check for FLASH_KERNEL_SKIP to avoid setting up the root parameter
+      in case flash-kernel will not be used
+    - make the package postinst respect FLASH_KERNEL_SKIP
+    - make sure that if we dont want to override the bootloader root=
+      option by setting "Bootloader-sets-root: yes", we actually dont do it
+    - use umount -l in the cleanup function, else we fail while finishing up
+      with the script
+    - add a diversion for update-initramfs to live-installers
+      post-base-installer.d to avoid update-initramfs runs before flash-kernel
+      is configured
+    - add a check for the diverted update-initramfs to flash-kernel-installer,
+      so it gets reverted before we try to call update-initramfs
+    - make post-base-installer.d/01flash-kernel-diversion actually an
+      executable shell script
+    - enable UUID detection of the currently used root device
+    - if uEnv.txt is defined in the db for an arch, generate preEnv.txt from
+      UBOOT_DEFAULTS and UUID detection data
+    - make sure blkid only gives us the UUID and not any other metadata like
+      labels or filesystem
+    - hide the boot device from udisk's automounting after installation on all
+      systems using uEnv.txt to configure u-boot
+    - make sure we only rename the bootrom partition so udisks hides it,
+      when using mkdosfs for setting the label like we did in jasper (where
+      we cached the contents before doing this) MLO and u-boot.bin are gone
+    - make sure that /dev is bind mounted in /target when running
+      update-initramfs from flash-kernel-installer, else we do not find the
+      boot media (this is only a workaround, actual fixing of the netinst
+      environment is needed to fix this properly)
+    - drop the "|| true" from the initramfs building code, if we fail here we
+      actually dont want to attempt to flash that
+    - Do not run flash-kernel inside an LXC container
+    - Call systemd-detect-virt instead of the Ubuntu specific
+      running-in-container wrapper.
+    - Add generic-lpae to the XB-Subarchitecture list in debian/control
+    - debian/flash-kernel-installer.isinstallable: add arm*/generic-lpae
+    - Fix typo in dtb_kver test that made it break all non-dtb platforms.
+    - Apply patch from Paolo Pisati for appended DTB support
+    - Filter the selection of 'latest' usable kernel through the whitelist.
+    - Do not fail if there are no specified Kernel-Flavors for this machine.
+    - Allow us to find DTBs in both the old flat layout and the new vendor
+      subdirectory layout, so we keep backward compatibility
+    - Add support for installing dtb files in boot partition
+    - Add support for gzip-compressed kernel images
+    - db/all.db: add dummy entries as noops when running on VMs
+    - Add support for Calxeda Highbank
+      - Add support for Calxeda Highbank (with bootscr.highbank different from
+        Debian's version)
+      - bootscr.highbank: allow more space to load larger kernels
+    - Add support for Marvell ArmadaXP
+      - Re-add support for Marvell ArmadaXP
+      - Fix armadaxp kernel load address
+    - Add support for OMAP3 and OMAP4 boards
+      - add DB entry for "OMAP3 Beagle Board" (funnily thats missing)
+      - add Panda to the list of supported board in the README file
+      - debian/control: Re-add omap and omap4 to the flash-kernel-installer
+        XB-Subarchitecture field. These appear to have been lost somewhere
+        along the way.
+      - Also add omap and omap4 to flash-kernel-installer.isinstallable.
+      - switch omap3 and omap4 to uEnv.txt/preEnv.txt (the former holds all
+        active boot commands, the latter holds the kernel commandline only)
+      - switch omap3 and omap4 from Bootloader-sets-root: no to yes, we now
+        generate a root=UUID= line on the fly for arches using
+        uEnv.txt/preEnv.txt
+      - introduce bootscript/uEnvtxt.omap
+      - do not move the original uEnvtxt.omap to the target, use a copy
+        instead
+    - Add support for grouper boards
+      - add support for the grouper architecture
+    - Add support for Samsung Exynos 5440 platforms
+      - Add support for EXYNOS5440-based platforms
+    - Add support for HP ProLiant m400 and m800 cartridges
+      - Added support for HP ProLiant m800 Server Cartridge
+      - Add support for HP ProLiant m800 cartridges
+      - Set required boot arguments for HP ProLiant m800 cartridges
+      - Add support for HP ProLiant m400 Server Cartridges
+      - HP Moonshot Cartridges: Use $baudrate from u-boot environment as
+        serial console speed
+      - HP Moonshot Cartridges: Enable hardware flow control as required by
+        the HP moonshot chassis
+      - Enable U-Boot environment support for X-Gene platforms
+      - Use filesystem agnostic "load" command instead of assuming ext4
+      - Add a bootscript specific to X-Gene Mustang boards since they need to
+        pull their dtb from the OS.
+    - Add support for Wandboard Quad
+      - Wandboard: Use /dev/disk/by-path/platform-2198000.usdhc-part1
+        instead of the hardcoded mmcblk1p1, this should make things work on
+        boards with just a single microSD card in.
+      - Add basic support for WandBoard Quad.
+    - Add support for Raspberry Pi 2, 3, 3+, CM3, and CM3+
+      - Extend support for the RPi2 to actually install the kernel/initramfs
+        on the fat partition, and provide a uboot boot script based on the one
+        used for Snappy images.
+      - Extend functions to support generating uboot.env images, as an
+        alternative to boot.scr and uEnv.txt, and use this for RPi2 as well.
+      - Adjust the uboot.env.rpi2 to use the one Paolo Pisati has tested,
+        instead of trying to base on the Snappy one, which is failing to boot.
+      - Adjust the size of uboot.env based on empirical results on the rpi2.
+      - Adjust rpi2/3 dtb address from 0x100 to 0x02000000
+      - Support Raspberry Pi 2 Model B Rev 1.2
+      - Add Raspberry Pi 3 Model B+ to the db.
+      - Modify the Pi 3 boot.scr addresses to fit a bigger kernel, prepare
+        separate versions for armhf and arm64.
+      - Add Raspberry Pi Compute Module 3 and 3+ to the db.
+    - Add support for Nexus 4 (Mako)
+      - Enabling support for mako (Nexus 4)
+    - Add support for QCT APQ8064 CDP
+      - Add support for QCT APQ8064 CDP; thanks Alfonso Sanchez-Beato.
+    - Migrate default /etc/default/flash-kernel content to new default without
+      asking via debconf
+    - Update tests with new fields: Android-Skip-Initrd, Bootloader-sets-root,
+      DTB-Kernel-Version
+    - Look for dtbs in /lib/firmware/$kvers/device-tree/ in find_dtb_file()
+    - Add Bootloader-sets-root to Toshiba AC100 [previously undocumented]
+    - Install all potential uboot scripts [previously undocumented]
+    - initramfs-hook/flash-kernel: Pretend we're running from the kernel's
+      postinst to activate the same guard against mismatched kernel versions.
+    - flash-kernel/functions: Stop attempting to install the latest kernel
+      if we request an older version, just refuse to act without --force.
+
+  * Dropped changes merged in Debian:
+    - Remove commit-tmp cruft [previously undocumented]
+
+  * Dropped obsolete changes:
+    - Add archs (why?) and duplicate generic (why?!) in d/control [previously
+      undocumented]
+
+ -- Dave Jones <dave.jones@canonical.com>  Thu, 16 May 2019 12:08:32 +0000
+
 flash-kernel (3.98) unstable; urgency=medium
 
   [ Vagrant Cascadian ]
@@ -429,6 +2288,206 @@ flash-kernel (3.91) unstable; urgency=me
 
  -- Christian Perrier <bubulle@debian.org>  Thu, 01 Feb 2018 06:32:56 +0100
 
+flash-kernel (3.90ubuntu5) disco; urgency=medium
+
+  * Add Raspberry Pi Compute Module 3 and 3+ to the db.
+
+ -- Dave Jones <dave.jones@canonical.com>  Thu, 14 Feb 2019 11:12:13 +0000
+
+flash-kernel (3.90ubuntu4) disco; urgency=medium
+
+  * Add Raspberry Pi 3 Model B+ to the db.
+  * Modify the Pi 3 boot.scr addresses to fit a bigger kernel, prepare
+    separate versions for armhf and arm64.
+
+ -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com>  Wed, 05 Dec 2018 00:18:12 +0200
+
+flash-kernel (3.90ubuntu3) bionic; urgency=medium
+
+  * flash-kernel/functions: Stop attempting to install the latest kernel
+    if we request an older version, just refuse to act without --force.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Wed, 25 Apr 2018 05:11:44 -0600
+
+flash-kernel (3.90ubuntu2) bionic; urgency=medium
+
+  * initramfs-hook/flash-kernel: Pretend we're running from the kernel's
+    postinst to activate the same guard against mismatched kernel versions.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Tue, 24 Apr 2018 08:17:06 -0600
+
+flash-kernel (3.90ubuntu1) bionic; urgency=medium
+
+  [ Balint Reczey ]
+  *  Merge with Debian (LP: #1743771)
+     - remaining changes:
+       - add "quiet splash" as default options to omap bootscr
+       - re-add support for the FLASH_KERNEL_SKIP env variable, so the image
+         build infrastructure has a chance to skip the automated flash-kernel
+         run during image builds.
+       - bootscr.highbank: allow more space to load larger kernels
+       - Add support for Calxeda Highbank (with bootscr.highbank different from
+         Debian's version)
+       - Re-add support for Marvell ArmadaXP
+       - Fix armadaxp kernel load address
+       - use umount -l in the cleanup function, else we fail while finishing up
+         with the script
+       - add DB entry for "OMAP3 Beagle Board" (funnily thats missing)
+       - add Panda to the list of supported board in the README file
+       - debian/control: Re-add omap and omap4 to the flash-kernel-installer
+         XB-Subarchitecture field. These appear to have been lost somewhere
+         along the way.
+       - Also add omap and omap4 to flash-kernel-installer.isinstallable.
+       - add a diversion for update-initramfs to live-installers
+         post-base-installer.d to avoid update-initramfs runs before
+         flash-kernel is configured
+       - add a check for the diverted update-initramfs to
+         flash-kernel-installer, so it gets reverted before we try to call
+         update-initramfs
+       - make post-base-installer.d/01flash-kernel-diversion actually an
+         executable shell script
+       - switch omap3 and omap4 to uEnv.txt/preEnv.txt (the former holds all
+         active boot commands, the latter holds the kernel commandline only)
+       - enable UUID detection of the currently used root device
+       - if uEnv.txt is defined in the db for an arch, generate preEnv.txt from
+         UBOOT_DEFAULTS and UUID detection data
+       - switch omap3 and omap4 from Bootloader-sets-root: no to yes, we now
+         generate a root=UUID= line on the fly for arches using
+         uEnv.txt/preEnv.txt
+       - introduce bootscript/uEnvtxt.omap
+       - do not move the original uEnvtxt.omap to the target, use a copy instead
+       - initramfs-tools/hooks/flash_kernel_set_root:
+         - make sure that if we dont want to override the bootloader root=
+           option by setting "Bootloader-sets-root: yes", we actually dont do it
+         - Also check for FLASH_KERNEL_SKIP to avoid setting up the root
+           parameter in case flash-kernel will not be used
+         - this is a slightly different approach to fix the bug than
+           the patch attached to the bug.
+       - hide the boot device from udisk's automounting after installation
+         on all systems using uEnv.txt to configure u-boot
+       - make sure we only rename the bootrom partition so udisks hides it,
+         when using mkdosfs for setting the label like we did in jasper (where
+         we cached the contents before doing this) MLO and u-boot.bin are gone
+       - make sure that /dev is bind mounted in /target when running
+         update-initramfs from flash-kernel-installer, else we do not find the
+         boot media (this is only a workaround, actual fixing of
+         the netinst environment is needed to fix this properly)
+       - add support for the grouper architecture
+       - make sure blkid only gives us the UUID and not any other metadata like
+         labels or filesystem
+       - drop the "|| true" from the initramfs building code, if we fail here we
+         actually dont want to attempt to flash that
+       - Do not run flash-kernel inside an LXC container
+       - Accept "generic" as a valid kernel flavor on highbank
+       - Add support for Calxeda ECX-2000 to the machine DB
+       - Add generic-lpae to the XB-Subarchitecture list in debian/control
+       - Update the Highbank entry in DB to use its device-tree model name
+       - Fix the testsuite to work with the new DT model support and add
+         a new test to specifically try to use a DT instead of cpuinfo.
+       - And now fix the quoting error exposed by the fixed testsuite.
+       - debian/flash-kernel-installer.isinstallable: add arm*/generic-lpae
+       - Fix typo in dtb_kver test that made it break all non-dtb platforms.
+       - Add support for EXYNOS5440-based platforms
+       - Added support for HP ProLiant m800 Server Cartridge
+       - Filter the selection of 'latest' usable kernel through the
+         whitelist.
+       - Do not fail if there are no specified Kernel-Flavors for this machine.
+         - HP Moonshot Cartridges: Use $baudrate from u-boot environment as
+           serial console speed
+         - HP Moonshot Cartridges: Enable hardware flow control as required by
+           the HP moonshot chassis
+         - Enable U-Boot environment support for X-Gene platforms
+         - Use filesystem agnostic "load" command instead of assuming ext4
+         - Add support for HP ProLiant m800 cartridges
+         - Set required boot arguments for HP ProLiant m800 cartridges
+       - Allow us to find DTBs in both the old flat layout and the new vendor
+         subdirectory layout, so we keep backward compatibility
+       - Wandboard: Use /dev/disk/by-path/platform-2198000.usdhc-part1
+         instead of the hardcoded mmcblk1p1, this should make things work on
+         boards with just a single microSD card in.
+       - make the package postinst respect FLASH_KERNEL_SKIP
+       - Call systemd-detect-virt instead of the Ubuntu specific
+         running-in-container wrapper.
+       - Extend support for the RPi2 to actually install the kernel/initramfs
+         on the fat partition, and provide a uboot boot script based on the one
+         used for Snappy images.
+       - Extend functions to support generating uboot.env images, as an
+         alternative to boot.scr and uEnv.txt, and use this for RPi2 as well.
+       - Adjust the uboot.env.rpi2 to use the one Paolo Pisati has tested,
+         instead of trying to base on the Snappy one, which is failing to boot.
+       - Adjust the size of uboot.env based on empirical results on the rpi2.
+
+     - dropped changes, merged in Debian:
+       - make sure the call to abootimg -i does not make the script fail
+         (checking non bootimg devices makes it return 1 even though there
+         is no error, this in turn makes teh whole script fail since we run
+         with "set -e")
+       - determine the latest installer kernel version in the target rootfs
+         instead of assuming the version is the same as the running kernel
+       - flash-plugin-installer: make installable on armhf/generic for highbank
+       - Also update XB-Subarchitecture to use "generic" instead of 'highbank"
+       - Extending Android specific options to cover the Ubuntu Touch use cases
+         (flashing to a specific device and support skipping initrd)
+       - Enabling support for mako (Nexus 4)
+       - Fix get_kfile_suffix() function to deal with flavours with dashes.
+       - Apply patch from Paolo Pisati for appended DTB support
+       - Add basic support for WandBoard Quad.
+       - flash-kernel-installer: make installable on armhf/exynos5
+       - Add support for APM X-Gene
+       - Add support for installing dtb files in boot partition; activate this
+         for APM X-Gene boards
+       - Add support for HP ProLiant m400 Server Cartridges
+       - Update APM X-Gene config to match upstream device tree filename/model
+       - Add a bootscript specific to X-Gene Mustang boards since they need to
+         pull their dtb from the OS.
+       - db/all.db: add dummy entries as noops when running on VMs
+       - Add U-Boot environment configuration support
+       - Cherry pick from Debian: Succeed but do nothing when run on an
+         unknown machine which was booted via EFI.
+       - Add support for the Raspberry Pi2; thanks to Paolo Pisati
+       - Cherry-pick fixes from Debian to support copying kernel/initrd to
+         destination.
+       - Add Raspberry Pi 3 support
+       - Add support for gzip-compressed kernel images
+       - Adjust rpi2/3 dtb address from 0x100 to 0x02000000
+       - Add support for QCT APQ8064 CDP; thanks Alfonso Sanchez-Beato.
+       - Check /proc/device-tree/model before /proc/cpuinfo
+
+     - dropped obsoleted changes:
+       - add very very ugly temporary workaround to make quantal A3 arm server
+         installs possible (yes, i suck)
+       - re-add a diversion for update-initramfs to live-installers
+         post-base-installer.d to avoid update-initramfs runs before
+         flash-kernel is configured
+       - re-add a check for the diverted update-initramfs to
+         flash-kernel-installer, so it gets reverted before we try to call
+         update-initramfs
+       - drop teh super ugly hack that added a /var/lib/flash-kernel/configured
+         file to actually check if flash-kernel is configured
+       - sigh, not only drop the creation of /var/lib/flash-kernel/configured
+         but also the check for its existance, else we will always exit 0
+       - make post-base-installer.d/01flash-kernel-diversion executable
+       - flash-kernel-installer.postinst: now that we have a diversion in place
+         there isnt a pre-existing initrd, instead of calling
+         update-initramfs -u we better call update-initramfs -c -k all to create
+         one from scratch
+       - seemingly -k all doesnt want to work with -c, use -k $(uname -r) for
+         now
+       - enable generation of a /etc/default/flash-kernel file from
+         flash-kernel-installer holding a UBOOT_DEFAULTS variable with distro
+         default settings (ro quiet splash)
+       - make /etc/default/flash-kernel a proper conffile
+       - Added support for user defined uboot environment variables
+  * Update tests with new fields: Android-Skip-Initrd, Bootloader-sets-root,
+    DTB-Kernel-Version
+  * Migrate default /etc/default/flash-kernel content to new default without asking via debconf
+  * Look for dtbs in /lib/firmware/$kvers/device-tree/ in find_dtb_file()
+
+  [ Alex McWhirter ]
+  * Support Raspberry Pi 2 Model B Rev 1.2
+
+ -- Balint Reczey <rbalint@ubuntu.com>  Fri, 26 Jan 2018 22:05:44 +0100
+
 flash-kernel (3.90) unstable; urgency=medium
 
   [ Andreas Henriksson ]
@@ -1593,6 +3652,498 @@ flash-kernel (3.0~rc.5) unstable; urgenc
 
  -- Hector Oron <zumbi@debian.org>  Sun, 11 Mar 2012 16:02:39 +0100
 
+flash-kernel (3.0~rc.4ubuntu66) artful; urgency=medium
+
+  * Add support for QCT APQ8064 CDP; thanks Alfonso Sanchez-Beato.
+
+ -- Loïc Minier <loic.minier@ubuntu.com>  Fri, 01 Sep 2017 14:46:52 +0200
+
+flash-kernel (3.0~rc.4ubuntu65) zesty; urgency=medium
+
+  * Adjust rpi2/3 dtb address from 0x100 to 0x02000000 (LP: #1636838)
+
+ -- Paolo Pisati <paolo.pisati@canonical.com>  Wed, 09 Nov 2016 15:41:50 +0200
+
+flash-kernel (3.0~rc.4ubuntu64) yakkety; urgency=medium
+
+  * Add support for gzip-compressed kernel images (LP: #1384955)
+
+ -- dann frazier <dannf@ubuntu.com>  Thu, 25 Aug 2016 12:39:19 -0600
+
+flash-kernel (3.0~rc.4ubuntu63) yakkety; urgency=medium
+
+  * Add Raspberry Pi 3 support (LP: #1578505)
+
+ -- Ryan Finnie <ryan@finnie.org>  Thu, 05 May 2016 06:04:00 +0000
+
+flash-kernel (3.0~rc.4ubuntu62) xenial; urgency=medium
+
+  * Adjust the size of uboot.env based on empirical results on the rpi2.
+
+ -- Steve Langasek <steve.langasek@ubuntu.com>  Sat, 13 Feb 2016 23:25:39 -0800
+
+flash-kernel (3.0~rc.4ubuntu61) xenial; urgency=medium
+
+  * Adjust the uboot.env.rpi2 to use the one Paolo Pisati has tested,
+    instead of trying to base on the Snappy one, which is failing to boot.
+
+ -- Steve Langasek <steve.langasek@ubuntu.com>  Fri, 12 Feb 2016 11:44:45 -0800
+
+flash-kernel (3.0~rc.4ubuntu60) xenial; urgency=medium
+
+  * Extend support for the RPi2 to actually install the kernel/initramfs
+    on the fat partition, and provide a uboot boot script based on the one
+    used for Snappy images.
+  * Extend functions to support generating uboot.env images, as an
+    alternative to boot.scr and uEnv.txt, and use this for RPi2 as well.
+  * Cherry-pick fixes from Debian to support copying kernel/initrd to
+    destination.
+
+ -- Steve Langasek <steve.langasek@ubuntu.com>  Thu, 11 Feb 2016 17:09:53 -0800
+
+flash-kernel (3.0~rc.4ubuntu59) xenial; urgency=medium
+
+  * Add support for the Raspberry Pi2; thanks to Paolo Pisati
+  * <paolo.pisati@canonical.com>.
+
+ -- Steve Langasek <steve.langasek@ubuntu.com>  Tue, 09 Feb 2016 22:35:28 -0800
+
+flash-kernel (3.0~rc.4ubuntu58) xenial; urgency=medium
+
+  * Call systemd-detect-virt instead of the Ubuntu specific
+    running-in-container wrapper. (LP: #1539016)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Thu, 28 Jan 2016 14:22:57 +0100
+
+flash-kernel (3.0~rc.4ubuntu57) xenial; urgency=medium
+
+  * Cherry pick from Debian: Succeed but do nothing when run on an
+    unknown machine which was booted via EFI. (LP: #1517582)
+
+ -- dann frazier <dannf@ubuntu.com>  Tue, 01 Dec 2015 13:51:27 -0700
+
+flash-kernel (3.0~rc.4ubuntu56) xenial; urgency=medium
+
+  * make the package postinst respect FLASH_KERNEL_SKIP (LP: #1517582)
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Wed, 25 Nov 2015 21:12:16 +0100
+
+flash-kernel (3.0~rc.4ubuntu55) wily; urgency=medium
+
+  * Wandboard: Use /dev/disk/by-path/platform-2198000.usdhc-part1
+    instead of the hardcoded mmcblk1p1, this should make things work on
+    boards with just a single microSD card in.
+
+ -- Stéphane Graber <stgraber@ubuntu.com>  Thu, 27 Aug 2015 11:55:41 -0400
+
+flash-kernel (3.0~rc.4ubuntu54) vivid; urgency=medium
+
+  * Allow us to find DTBs in both the old flat layout and the new vendor
+    subdirectory layout, so we keep backward compatibility (LP: #1408004)
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Fri, 27 Feb 2015 03:46:28 -0700
+
+flash-kernel (3.0~rc.4ubuntu53) utopic; urgency=medium
+
+  * Merge in remaining trusty SRU changes:
+    * Add U-Boot environment configuration support (LP: #1328597)
+    * HP Moonshot Cartridges: Use $baudrate from u-boot environment as
+      serial console speed (LP: #1373628)
+    * HP Moonshot Cartridges: Enable hardware flow control as required by
+      the HP moonshot chassis (LP: #1328280)
+    * Enable U-Boot environment support for X-Gene platforms
+    * Use filesystem agnostic "load" command instead of assuming ext4
+    * Add support for HP ProLiant m800 cartridges (LP: #1326437)
+    * Set required boot arguments for HP ProLiant m800 cartridges
+      (LP: #1373659)
+
+ -- dann frazier <dannf@ubuntu.com>  Mon, 29 Sep 2014 16:20:15 -0600
+
+flash-kernel (3.0~rc.4ubuntu52) utopic; urgency=medium
+
+  * Do not fail if there are no specified Kernel-Flavors for this machine.
+
+ -- Scott Moser <smoser@ubuntu.com>  Wed, 27 Aug 2014 15:59:26 -0400
+
+flash-kernel (3.0~rc.4ubuntu51) utopic; urgency=medium
+
+  * Filter the selection of 'latest' usable kernel through the
+    whitelist.  (LP: #1356569)
+
+ -- Manoj Iyer <manoj.iyer@canonical.com>  Tue, 19 Aug 2014 14:27:33 -0500
+
+flash-kernel (3.0~rc.4ubuntu50) utopic; urgency=medium
+
+  * Added support for user defined uboot environment variables
+  * Added support for HP ProLiant m800 Server Cartridge
+
+ -- Manoj Iyer <manoj.iyer@canonical.com>  Thu, 24 Apr 2014 17:34:28 -0500
+
+flash-kernel (3.0~rc.4ubuntu49) trusty; urgency=medium
+
+  * db/all.db: add dummy entries as noops when running on VMs (LP: #1298070)
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Thu, 10 Apr 2014 04:15:37 -0600
+
+flash-kernel (3.0~rc.4ubuntu48) trusty; urgency=medium
+
+  * Update APM X-Gene config to match upstream device tree filename/model
+  * Add a bootscript specific to X-Gene Mustang boards since they need to
+    pull their dtb from the OS.
+
+ -- dann frazier <dann.frazier@canonical.com>  Tue, 18 Mar 2014 16:31:38 -0600
+
+flash-kernel (3.0~rc.4ubuntu47) trusty; urgency=medium
+
+  * Add support for HP ProLiant m400 Server Cartridges (LP: #1287910)
+
+ -- dann frazier <dann.frazier@canonical.com>  Wed, 12 Mar 2014 15:10:43 +0100
+
+flash-kernel (3.0~rc.4ubuntu46) trusty; urgency=low
+
+  * Add support for APM X-Gene
+  * Add support for installing dtb files in boot partition; activate this for
+    APM X-Gene boards
+
+ -- dann frazier <dann.frazier@canonical.com>  Mon, 23 Dec 2013 14:51:32 -0700
+
+flash-kernel (3.0~rc.4ubuntu45) trusty; urgency=low
+
+  * bootscr.highbank: allow more space to load larger kernels (LP: #1250495)
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Wed, 11 Dec 2013 03:48:23 -0700
+
+flash-kernel (3.0~rc.4ubuntu44) trusty; urgency=low
+
+  * flash-kernel-installer: make installable on armhf/exynos5 (LP: #1247601)
+
+ -- dann frazier <dann.frazier@canonical.com>  Wed, 13 Nov 2013 08:08:08 +0100
+
+flash-kernel (3.0~rc.4ubuntu43) trusty; urgency=low
+
+  * Add basic support for WandBoard Quad.
+
+ -- Stéphane Graber <stgraber@ubuntu.com>  Thu, 07 Nov 2013 23:57:58 -0500
+
+flash-kernel (3.0~rc.4ubuntu42) saucy; urgency=low
+
+  * Add support for EXYNOS5440-based platforms (LP: #1231249)
+
+ -- dann frazier <dann.frazier@canonical.com>  Thu, 03 Oct 2013 13:56:55 +0100
+
+flash-kernel (3.0~rc.4ubuntu41) saucy; urgency=low
+
+  * Fix typo in dtb_kver test that made it break all non-dtb platforms.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Sat, 21 Sep 2013 13:07:23 -0600
+
+flash-kernel (3.0~rc.4ubuntu40) saucy; urgency=low
+
+  * Apply patch from Paolo Pisati for appended DTB support (LP: #1223261)
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Thu, 19 Sep 2013 10:27:47 -0600
+
+flash-kernel (3.0~rc.4ubuntu39) saucy; urgency=low
+
+  * Fix get_kfile_suffix() function to deal with flavours with dashes.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Tue, 10 Sep 2013 19:30:34 -0400
+
+flash-kernel (3.0~rc.4ubuntu38) saucy; urgency=low
+
+  * debian/flash-kernel-installer.isinstallable: add arm*/generic-lpae
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Tue, 10 Sep 2013 17:43:52 -0400
+
+flash-kernel (3.0~rc.4ubuntu37) saucy; urgency=low
+
+  * And now fix the quoting error exposed by the fixed testsuite.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Tue, 10 Sep 2013 15:22:49 -0400
+
+flash-kernel (3.0~rc.4ubuntu36) saucy; urgency=low
+
+  * Fix the testsuite to work with the new DT model support and add
+    a new test to specifically try to use a DT instead of cpuinfo.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Tue, 10 Sep 2013 14:59:04 -0400
+
+flash-kernel (3.0~rc.4ubuntu35) saucy; urgency=low
+
+  * Check /proc/device-tree/model before /proc/cpuinfo (LP: #1164484)
+  * Add support for Calxeda ECX-2000 to the machine DB (LP: #1223439)
+  * Add generic-lpae to the XB-Subarchitecture list in debian/control
+  * Update the Highbank entry in DB to use its device-tree model name
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Tue, 10 Sep 2013 14:36:05 -0400
+
+flash-kernel (3.0~rc.4ubuntu34) saucy; urgency=low
+
+  * Extending Android specific options to cover the Ubuntu Touch use cases
+    (flashing to a specific device and support skipping initrd)
+  * Enabling support for mako (Nexus 4)
+
+ -- Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>  Tue, 14 May 2013 04:27:01 -0300
+
+flash-kernel (3.0~rc.4ubuntu33) raring; urgency=low
+
+  * Also update XB-Subarchitecture to use "generic" instead of 'highbank"
+    (LP: #1170515)
+
+ -- dann frazier <dann.frazier@canonical.com>  Sun, 21 Apr 2013 09:36:29 -0600
+
+flash-kernel (3.0~rc.4ubuntu32) raring; urgency=low
+
+  * flash-plugin-installer: make installable on armhf/generic for highbank
+
+ -- dann frazier <dann.frazier@canonical.com>  Thu, 18 Apr 2013 16:39:18 -0600
+
+flash-kernel (3.0~rc.4ubuntu31) raring; urgency=low
+
+  * Accept "generic" as a valid kernel flavor on highbank (LP: #1164074)
+
+ -- dann frazier <dann.frazier@canonical.com>  Wed, 03 Apr 2013 12:48:56 -0600
+
+flash-kernel (3.0~rc.4ubuntu30) raring; urgency=low
+
+  * Do not run flash-kernel inside an LXC container (LP: #1160360)
+
+ -- Jean-Baptiste Lallement <jean-baptiste.lallement@canonical.com>  Wed, 27 Mar 2013 16:29:20 +0100
+
+flash-kernel (3.0~rc.4ubuntu29) raring; urgency=low
+
+  * determine the latest installer kernel version in the target rootfs instead
+    of assuming the version is the same as the running kernel (LP: #1084106)
+  * drop the "|| true" from the initramfs building code, if we fail here we
+    actually dont want to attempt to flash that
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Tue, 04 Dec 2012 17:24:49 +0100
+
+flash-kernel (3.0~rc.4ubuntu28) raring; urgency=low
+
+  * make sure blkid only gives us the UUID and not any other metadata like
+    labels or filesystem (LP: #1079185)
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Fri, 16 Nov 2012 15:40:21 +0100
+
+flash-kernel (3.0~rc.4ubuntu27) quantal; urgency=low
+
+  * add support for the grouper architecture
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Mon, 08 Oct 2012 14:44:41 +0200
+
+flash-kernel (3.0~rc.4ubuntu26) quantal-proposed; urgency=low
+
+  * make sure that /dev is bind mounted in /target when running
+    update-initramfs from flash-kernel-installer, else we do not find the boot
+    media (this is only a workaround for LP: #1056482 actual fixing of the
+    netinst environment is needed to fix this properly)
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Wed, 26 Sep 2012 15:27:06 +0200
+
+flash-kernel (3.0~rc.4ubuntu25) quantal; urgency=low
+
+  * make sure we only rename the bootrom partition so udisks hides it,
+    when using mkdosfs for setting the label like we did in jasper (where
+    we cached the contents before doing this) MLO and u-boot.bin are gone
+    (LP: #1055938).
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Tue, 25 Sep 2012 10:31:32 +0200
+
+flash-kernel (3.0~rc.4ubuntu24) quantal; urgency=low
+
+  * hide the boot device from udisk's automounting after installation
+    on all systems using uEnv.txt to configure u-boot
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Mon, 17 Sep 2012 14:25:37 +0200
+
+flash-kernel (3.0~rc.4ubuntu23) quantal; urgency=low
+
+  * initramfs-tools/hooks/flash_kernel_set_root:
+    - make sure that if we dont want to override the bootloader root= option by
+      setting "Bootloader-sets-root: yes", we actually dont do it
+    - Also check for FLASH_KERNEL_SKIP to avoid setting up the root parameter
+      in case flash-kernel will not be used
+    - this is a slightly different approach to fix bug (LP: #1034734) than the
+      patch attached to the bug.
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Thu, 13 Sep 2012 14:02:48 +0200
+
+flash-kernel (3.0~rc.4ubuntu22) quantal; urgency=low
+
+  * do not move the original uEnvtxt.omap to the target, use a copy instead
+  * make /etc/default/flash-kernel a proper conffile
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Thu, 23 Aug 2012 11:49:01 +0200
+
+flash-kernel (3.0~rc.4ubuntu21) quantal; urgency=low
+
+  * switch omap3 and omap4 to uEnv.txt/preEnv.txt (the former holds all active
+    boot commands, the latter holds the kernel commandline only)
+  * enable generation of a /etc/default/flash-kernel file from
+    flash-kernel-installer holding a UBOOT_DEFAULTS variable with distro
+    default settings (ro quiet splash)
+  * enable UUID detection of the currently used root device
+  * if uEnv.txt is defined in the db for an arch, generate preEnv.txt from
+    UBOOT_DEFAULTS and UUID detection data
+  * switch omap3 and omap4 from Bootloader-sets-root: no to yes, we now
+    generate a root=UUID= line on the fly for arches using uEnv.txt/preEnv.txt
+  * introduce bootscript/uEnvtxt.omap
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Wed, 22 Aug 2012 21:56:09 +0200
+
+flash-kernel (3.0~rc.4ubuntu20) quantal; urgency=low
+
+  * seemingly -k all doesnt want to work with -c, use -k $(uname -r) for now
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Fri, 10 Aug 2012 18:29:34 +0200
+
+flash-kernel (3.0~rc.4ubuntu19) quantal; urgency=low
+
+  * flash-kernel-installer.postinst: now that we have a diversion in place
+    there isnt a pre-existing initrd, instead of calling update-initramfs -u
+    we better call update-initramfs -c -k all to create one from scratch,
+    fixes (LP: #1035269)
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Fri, 10 Aug 2012 17:49:00 +0200
+
+flash-kernel (3.0~rc.4ubuntu18) quantal; urgency=low
+
+  * make post-base-installer.d/01flash-kernel-diversion executable
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Thu, 09 Aug 2012 13:59:15 +0200
+
+flash-kernel (3.0~rc.4ubuntu17) quantal; urgency=low
+
+  * sigh, not only drop the creation of /var/lib/flash-kernel/configured but
+    also the check for its existance, else we will always exit 0
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Tue, 07 Aug 2012 20:03:20 +0200
+
+flash-kernel (3.0~rc.4ubuntu16) quantal; urgency=low
+
+  * re-add a diversion for update-initramfs to live-installers
+    post-base-installer.d to avoid update-initramfs runs before
+    flash-kernel is configured
+  * re-add a check for the diverted update-initramfs to
+    flash-kernel-installer, so it gets reverted before we try to call
+    update-initramfs
+  * drop teh super ugly hack that added a /var/lib/flash-kernel/configured
+    file to actually check if flash-kernel is configured
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Tue, 07 Aug 2012 19:52:51 +0200
+
+flash-kernel (3.0~rc.4ubuntu15) quantal; urgency=low
+
+  * Fix armadaxp kernel load address (LP: #1026835).
+
+ -- Robie Basak <robie.basak@ubuntu.com>  Tue, 31 Jul 2012 16:31:30 +0100
+
+flash-kernel (3.0~rc.4ubuntu14) quantal-proposed; urgency=low
+
+  * better do the "configured" check in /var/lib
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Wed, 25 Jul 2012 18:03:18 +0200
+
+flash-kernel (3.0~rc.4ubuntu13) quantal-proposed; urgency=low
+
+  * add very very ugly temporary workaround to make quantal A3 arm server
+    installs possible (yes, i suck)
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Wed, 25 Jul 2012 17:16:16 +0200
+
+flash-kernel (3.0~rc.4ubuntu12) quantal; urgency=low
+
+  * remove the diversion code again, it doesnt help since
+    flash-kernel-installer.udeb only comes into play to late so the
+    post-base-installer.d file isnt available at live-installer time
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Wed, 25 Jul 2012 14:38:24 +0200
+
+flash-kernel (3.0~rc.4ubuntu11) quantal; urgency=low
+
+  * make post-base-installer.d/01flash-kernel-diversion actually an executable
+    shell script
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Tue, 24 Jul 2012 15:33:46 +0200
+
+flash-kernel (3.0~rc.4ubuntu10) quantal; urgency=low
+
+  * add a diversion for update-initramfs to live-installers
+    post-base-installer.d to avoid update-initramfs runs before
+    flash-kernel is configured
+  * add a check for the diverted update-initramfs to flash-kernel-installer,
+    so it gets reverted before we try to call update-initramfs
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Tue, 24 Jul 2012 15:28:37 +0200
+
+flash-kernel (3.0~rc.4ubuntu9) quantal; urgency=low
+
+  * Also add omap and omap4 to flash-kernel-installer.isinstallable.
+
+ -- Luke Yelavich <themuso@ubuntu.com>  Fri, 20 Jul 2012 11:42:33 +1000
+
+flash-kernel (3.0~rc.4ubuntu8) quantal; urgency=low
+
+  * debian/control: Re-add omap and omap4 to the flash-kernel-installer
+    XB-Subarchitecture field. These appear to have been lost somewhere along
+    the way.
+
+ -- Luke Yelavich <themuso@ubuntu.com>  Fri, 20 Jul 2012 11:39:08 +1000
+
+flash-kernel (3.0~rc.4ubuntu7) quantal; urgency=low
+
+  * make sure the call to abootimg -i does not make the script fail (checking
+    non bootimg devices makes it return 1 even though there is no error, this
+    in turn makes teh whole script fail since we run with "set -e")
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Tue, 17 Jul 2012 13:20:43 +0200
+
+flash-kernel (3.0~rc.4ubuntu6) quantal; urgency=low
+
+  * add DB entry for "OMAP3 Beagle Board" (funnily thats missing)
+  * add Panda to the list of supported board in the README file
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Fri, 06 Jul 2012 15:59:48 +0200
+
+flash-kernel (3.0~rc.4ubuntu5) quantal; urgency=low
+
+  * use umount -l in the cleanup function, else we fail while finishing up
+    with the script (LP: #1014139)
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Thu, 05 Jul 2012 19:43:02 +0200
+
+flash-kernel (3.0~rc.4ubuntu4) quantal; urgency=low
+
+  * also add FLASH_KERNEL_SKIP to the initramfs post update script, this
+    should finally fix ac100 image building
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Fri, 22 Jun 2012 11:20:39 +0200
+
+flash-kernel (3.0~rc.4ubuntu3) quantal; urgency=low
+
+  * re-add support for the FLASH_KERNEL_SKIP env variable, so the image build
+    infrastructure has a chance to skip the automated flash-kernel run during
+    image builds.
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Wed, 20 Jun 2012 16:41:28 +0200
+
+flash-kernel (3.0~rc.4ubuntu2) quantal; urgency=low
+
+  * add "quiet splash" as default options to omap bootscr
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Wed, 20 Jun 2012 16:25:31 +0200
+
+flash-kernel (3.0~rc.4ubuntu1) quantal; urgency=low
+
+  [ dann frazier ]
+  * Re-add support for Marvell ArmadaXP
+
+  [ Robie Basak ]
+  * Add support for Calxeda Highbank
+
+ -- Robie Basak <robie.basak@ubuntu.com>  Thu, 31 May 2012 10:09:53 +0100
+
 flash-kernel (3.0~rc.4) unstable; urgency=low
 
   * Upload to unstable
diff -pruN 3.109/debian/control 3.109ubuntu7/debian/control
--- 3.109/debian/control	2025-04-08 22:51:15.000000000 +0000
+++ 3.109ubuntu7/debian/control	2025-08-04 11:01:38.000000000 +0000
@@ -1,10 +1,12 @@
 Source: flash-kernel
 Section: utils
 Priority: optional
-Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
 Uploaders: Vagrant Cascadian <vagrant@debian.org>,
            Karsten Merker <merker@debian.org>
-Build-Depends: debhelper-compat (= 13), devio, linux-base (>= 3.2), dash
+Build-Depends: debhelper-compat (= 13), devio, linux-base (>= 3.2), dash,
+ gnu-coreutils (>= 9.5), dh-python, python3
 Standards-Version: 4.7.2
 Vcs-Browser: https://salsa.debian.org/installer-team/flash-kernel
 Vcs-Git: https://salsa.debian.org/installer-team/flash-kernel.git
@@ -13,11 +15,13 @@ Rules-Requires-Root: no
 Package: flash-kernel
 Architecture: arm64 armel armhf riscv64 loong64
 Depends: ${misc:Depends},
+         ${python3:Depends},
          devio,
          initramfs-tools (>= 0.92f),
+         systemd,
          linux-base (>= 3.2),
          mtd-utils,
-         ucf
+         ucf,
 Recommends: u-boot-tools
 Description: utility to make certain embedded devices bootable
  flash-kernel is a script which will put the kernel and initramfs in
@@ -26,6 +30,16 @@ Description: utility to make certain emb
  boot from flash memory (hence the name) as well as some devices that
  require a special boot image on the disk.
 
+Package: flash-kernel-piboot
+Architecture: arm64 armhf
+Depends: ${misc:Depends},
+         flash-kernel (= ${source:Version}),
+         gnu-coreutils (>= 9.5),
+Description: service to manage the A/B boot mechanism on the Raspberry Pi
+ piboot-try is a service which works with flash-kernel to manage the A/B boot
+ mechanism on Ubuntu for the Raspberry Pi for those flash-kernel entries that
+ use method "pi-ab".
+
 Package: flash-kernel-installer
 Section: debian-installer
 Priority: standard
diff -pruN 3.109/debian/flash-kernel-installer.install 3.109ubuntu7/debian/flash-kernel-installer.install
--- 3.109/debian/flash-kernel-installer.install	2022-03-23 14:22:28.000000000 +0000
+++ 3.109ubuntu7/debian/flash-kernel-installer.install	2025-05-08 10:08:03.000000000 +0000
@@ -1,2 +1,3 @@
 db              usr/share/flash-kernel
 functions       usr/share/flash-kernel
+post-base-installer.d    usr/lib/
diff -pruN 3.109/debian/flash-kernel-installer.postinst.in 3.109ubuntu7/debian/flash-kernel-installer.postinst.in
--- 3.109/debian/flash-kernel-installer.postinst.in	2022-03-23 14:22:28.000000000 +0000
+++ 3.109ubuntu7/debian/flash-kernel-installer.postinst.in	2025-07-16 14:25:31.000000000 +0000
@@ -28,6 +28,12 @@ tac () {
 	sed '1!G;h;$!d'
 }
 
+# check if live-installer diverted update-initramfs, revert before we move on
+if [ -e /target/usr/sbin/update-initramfs.flash-kernel-diverted ];then
+		rm -f /target/usr/sbin/update-initramfs
+		in-target dpkg-divert --remove --local --rename /usr/sbin/update-initramfs
+fi
+
 get_machine
 
 if machine_uses_flash "$machine"; then
@@ -91,7 +97,10 @@ case "$machine" in
 		:
 	;;
 	*)
-		in-target update-initramfs -u || true
+		latest_version=$(in-target --pass-stdout sh -c 'linux-version list | linux-version sort | tail -n1')
+		mount -o bind /dev /target/dev
+		in-target update-initramfs -c -k $latest_version
+		umount /target/dev || true
 	;;
 esac
 
diff -pruN 3.109/debian/flash-kernel-piboot.install 3.109ubuntu7/debian/flash-kernel-piboot.install
--- 3.109/debian/flash-kernel-piboot.install	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/debian/flash-kernel-piboot.install	2025-08-24 20:43:17.000000000 +0000
@@ -0,0 +1,2 @@
+piboot-try                      usr/sbin
+debian/90-piboot-try            /etc/update-motd.d/
diff -pruN 3.109/debian/flash-kernel-piboot.manpages 3.109ubuntu7/debian/flash-kernel-piboot.manpages
--- 3.109/debian/flash-kernel-piboot.manpages	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/debian/flash-kernel-piboot.manpages	2025-08-04 11:01:38.000000000 +0000
@@ -0,0 +1 @@
+piboot-try.8
diff -pruN 3.109/debian/flash-kernel-piboot.piboot-try-reboot.service 3.109ubuntu7/debian/flash-kernel-piboot.piboot-try-reboot.service
--- 3.109/debian/flash-kernel-piboot.piboot-try-reboot.service	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/debian/flash-kernel-piboot.piboot-try-reboot.service	2025-08-04 11:01:38.000000000 +0000
@@ -0,0 +1,17 @@
+[Unit]
+Description=Test and switch Raspberry Pi boot assets written by flash-kernel
+Documentation=man:piboot-try(8)
+DefaultDependencies=no
+Requires=local-fs.target
+After=local-fs.target
+ConditionPathExists=/proc/device-tree/chosen/bootloader/tryboot
+ConditionPathExists=/proc/device-tree/chosen/bootloader/partition
+ConditionPathExists=/boot/firmware/current/state
+ConditionPathExists=/boot/firmware/new/state
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/piboot-try --reboot
+
+[Install]
+WantedBy=sysinit.target
diff -pruN 3.109/debian/flash-kernel-piboot.piboot-try-validate.service 3.109ubuntu7/debian/flash-kernel-piboot.piboot-try-validate.service
--- 3.109/debian/flash-kernel-piboot.piboot-try-validate.service	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/debian/flash-kernel-piboot.piboot-try-validate.service	2025-10-17 14:51:57.000000000 +0000
@@ -0,0 +1,15 @@
+[Unit]
+Description=Test and switch Raspberry Pi boot assets written by flash-kernel
+Documentation=man:piboot-try(8)
+Requires=local-fs.target
+After=local-fs.target
+Before=getty.target
+ConditionPathExists=/proc/device-tree/chosen/bootloader/tryboot
+ConditionPathExists=/boot/firmware/current/state
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/piboot-try --validate
+
+[Install]
+WantedBy=multi-user.target
diff -pruN 3.109/debian/flash-kernel.install 3.109ubuntu7/debian/flash-kernel.install
--- 3.109/debian/flash-kernel.install	2022-03-23 14:22:28.000000000 +0000
+++ 3.109ubuntu7/debian/flash-kernel.install	2025-08-24 20:43:17.000000000 +0000
@@ -3,9 +3,13 @@ kernel-hook/zz-flash-kernel     etc/kern
 kernel-hook/zz-flash-kernel     etc/kernel/postrm.d
 etc/db                          etc/flash-kernel
 etc/README.dtbs                 etc/flash-kernel/dtbs
+etc/piboot-validate             etc/flash-kernel
 flash-kernel                    usr/sbin
 initramfs-tools                 usr/share
 db                              usr/share/flash-kernel
 functions                       usr/share/flash-kernel
+functions-piboot                usr/share/flash-kernel
+migrate-autoboot                usr/share/flash-kernel
+migrate-config                  usr/share/flash-kernel
 debian/default/flash-kernel     usr/share/flash-kernel/default
 dtb-probe                       usr/share/flash-kernel
diff -pruN 3.109/debian/flash-kernel.postinst 3.109ubuntu7/debian/flash-kernel.postinst
--- 3.109/debian/flash-kernel.postinst	2022-08-09 15:25:01.000000000 +0000
+++ 3.109ubuntu7/debian/flash-kernel.postinst	2025-05-08 10:08:03.000000000 +0000
@@ -24,20 +24,20 @@ case "$1" in
 		. /usr/share/debconf/confmodule
 
 		tmp_default_fk="/etc/default/flash-kernel.ucftmp"
-		trap "rm -f ${tmp_default_fk}" EXIT
+		tmp_default_fk_old_md5s="$(mktemp -t flash-kernel.md5sums.XXXXXXXXXX)"
+		trap "rm -f ${tmp_default_fk} ${tmp_default_fk_old_md5s}" EXIT
 		cp -p /usr/share/flash-kernel/default/flash-kernel \
 			${tmp_default_fk}
+		echo "6d73d0418e01f86e006d590e4b1ca85e" > ${tmp_default_fk_old_md5s}
 		merge_debconf_into_conf "$tmp_default_fk" \
 			LINUX_KERNEL_CMDLINE flash-kernel/linux_cmdline
 
-		ucf --three-way --debconf-ok ${tmp_default_fk} \
+		ucf --three-way --debconf-ok --sum-file ${tmp_default_fk_old_md5s} \
+			${tmp_default_fk} \
 			/etc/default/flash-kernel
 		ucfr flash-kernel /etc/default/flash-kernel
 		;;
-	triggered)
-		FLASH_KERNEL_NOTRIGGER=y flash-kernel
-		;;
-	abort-upgrade|abort-remove|abort-deconfigure)
+	triggered|abort-upgrade|abort-remove|abort-deconfigure)
 		;;
 	*)
 		echo "postinst called with unknown argument \`$1'" >&2
@@ -45,4 +45,12 @@ case "$1" in
 		;;
 esac
 
+if [ "x$1" = xtriggered ]; then
+	# this forces flash-kernel to run rather than setting our trigger to
+	# cause a later run (as happens without _NOTRIGGER being set)
+	FLASH_KERNEL_NOTRIGGER=y flash-kernel
+else
+	flash-kernel
+fi
+
 #DEBHELPER#
diff -pruN 3.109/debian/rules 3.109ubuntu7/debian/rules
--- 3.109/debian/rules	2022-03-23 14:22:28.000000000 +0000
+++ 3.109ubuntu7/debian/rules	2025-08-04 11:01:38.000000000 +0000
@@ -8,6 +8,10 @@ else
 DEFAULT_CMDLINE := quiet
 endif
 
+override_dh_installsystemd:
+	dh_installsystemd --name=piboot-try-reboot --no-start
+	dh_installsystemd --name=piboot-try-validate --no-start
+
 override_dh_auto_install:
 	for i in $(AUTOGEN_DEB_FILES); do \
 		sed "s/@DEFAULT_CMDLINE@/$(DEFAULT_CMDLINE)/" \
@@ -25,6 +29,13 @@ ifeq (armhf,$(DEB_HOST_ARCH))
 		debian/flash-kernel/etc/flash-kernel/bootscript/
 endif
 
+	install -m0755 -p -d debian/flash-kernel/usr/share/flash-kernel/its
+	set -ex ; for arch in all $(DEB_HOST_ARCH) ; do \
+		[ -d its/$${arch} ] || continue ; \
+		install -m0644 its/$${arch}/* \
+			debian/flash-kernel/usr/share/flash-kernel/its/ ; \
+	done
+
 	dh_auto_install
 
 override_dh_auto_clean:
@@ -38,6 +49,7 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTI
 	FK_CHECKOUT=. ./test_db
 	FK_CHECKOUT=. ./test_flash-kernel
 	FK_CHECKOUT=. ./test_functions
+	FK_CHECKOUT=. ./test_functions-piboot
 
 # check alphabetic ordering of database
 # The key for each entry is its first Machine: line
@@ -45,4 +57,4 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTI
 endif
 
 %:
-	dh $@
+	dh $@ --with=python3
diff -pruN 3.109/etc/piboot-validate 3.109ubuntu7/etc/piboot-validate
--- 3.109/etc/piboot-validate	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/etc/piboot-validate	2025-08-04 11:01:38.000000000 +0000
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+set -e
+
+# This script is called by the piboot-try-validate service to "validate" boot
+# assets being tested by piboot-try (under new/ on the boot partition).
+#
+# If this script exits with return code 0 ("true" in shell parlance), the boot
+# assets under new/ will be considered "good", and will be swapped into
+# current/, otherwise they will be marked "bad".
+
+# By default, this script simply returns 0. In other words, reaching the
+# piboot-try-validate service (which runs as part of multi-user.target) is
+# enough to consider the boot "good".
+true
+
+# You may want to test if a particular network interface exists. For example,
+# if you have a headless server that must connect to the network, and a kernel
+# update misses a module necessary for driving that interface, then it may not
+# exist.
+#ip link show eth0 >/dev/null
+#ip link show wlan0 >/dev/null
+
+# You may further wish to test if the interface is "up" and/or has a valid
+# address, but be warned that testing to this degree is not necessarily
+# advisable.
+#
+# Firstly, for such a test to be valid, you should add something like
+# "After=network-online.target" to piboot-try-validate with a unit override.
+# Secondly, consider that, using the examples below, a faulty DHCP server could
+# result in your Pi marking perfectly valid boot assets as "bad", resulting in
+# it falling back to an older kernel with unpatched security issues.
+#
+# Test if eth0 is "UP"
+#ip --json addr show eth0 | jq -e '.[0].operstate == "UP"' >/dev/null
+#
+# Test if eth0 has an IPv4 address
+#ip --json addr show eth0 | jq -e '[.[0].addr_info[].family == "inet"] | any' >/dev/null
+#
+# Test if eth0 has an IPv6 address
+#ip --json addr show eth0 | jq -e '[.[0].addr_info[].family == "inet6"] | any' >/dev/null
diff -pruN 3.109/functions 3.109ubuntu7/functions
--- 3.109/functions	2025-04-08 22:26:17.000000000 +0000
+++ 3.109ubuntu7/functions	2025-08-04 11:01:38.000000000 +0000
@@ -20,7 +20,9 @@
 # USA.
 
 BOOTSCRIPTS_DIR="${FK_CHECKOUT:-/etc/flash-kernel}/bootscript"
+ITSFILES_DIR="${FK_CHECKOUT:-/usr/share/flash-kernel}/its"
 FK_ETC_MACHINE="${FK_ETC_MACHINE:-/etc/flash-kernel/machine}"
+FK_DEFAULTS="${FK_DEFAULTS:-/etc/default/flash-kernel}"
 PROC_CPUINFO="${FK_PROC_CPUINFO:-/proc/cpuinfo}"
 PROC_DTMODEL="${FK_PROC_DTMODEL:-/proc/device-tree/model}"
 PROC_MTD="/proc/mtd"
@@ -131,7 +133,7 @@ check_supported() {
 	echo "$MACHINE_DB" | {
 		while read field value; do
 			if [ "$field" = "Machine:" ] &&
-				[ "$value" = "$machine" ]; then
+				match_machine "$machine" "$value"; then
 				return 0
 			fi
 		done
@@ -171,6 +173,23 @@ get_kfile_suffix() {
 	echo "$kfile" | sed -e "s/.*-\([^-]*$tail\)/\\1/"
 }
 
+# match a machine name (in $1) to a machine name / pattern ($2) from the
+# database; patterns are permitted to contain globbing characters (*, ?, [)
+# supported by dash
+match_machine() {
+	local machine="$1"
+	local pattern="$2"
+
+	case "$machine" in
+		$pattern)  # Must not be quoted to permit globbing
+			return 0
+			;;
+		*)
+			return 1
+			;;
+	esac
+}
+
 # this is case-sensitive and doesn't support fields spanning multiple lines
 get_machine_field() {
 	local machine="$1"
@@ -190,7 +209,7 @@ get_machine_field() {
 		while read field value; do
 			if [ "$state" = "machine" ] &&
 				[ "$field" = "Machine:" ] &&
-				[ "$value" = "$machine" ]; then
+				match_machine "$machine" "$value"; then
 				state="gotmachine"
 			fi
 			if [ "$state" = "fields" ] || [ "$state" = "gotmachine" ]; then
@@ -429,12 +448,25 @@ flash_initrd() {
 	echo "done." >&2
 }
 
+compress_type() {
+    local file="$1"
+    magic="$(od -x -N2 $file | head -1 | cut -d' ' -f2)"
+    case $magic in
+	8b1f)
+	    echo "gzip"
+	    ;;
+	*)
+	    echo "none"
+	    ;;
+    esac
+}
+
 get_kernel_cmdline() {
-        . /etc/default/flash-kernel
+        . ${FK_DEFAULTS}
 	echo "$LINUX_KERNEL_CMDLINE"
 }
 get_kernel_cmdline_defaults() {
-        . /etc/default/flash-kernel
+        . ${FK_DEFAULTS}
 	echo "$LINUX_KERNEL_CMDLINE_DEFAULTS"
 }
 
@@ -444,9 +476,12 @@ mkimage_kernel() {
 	local kdesc="$3"
 	local kdata="$4"
 	local uimage="$5"
+	local comp
+
+	comp="$(compress_type $kdata)"
 
 	printf "Generating kernel u-boot image... " >&2
-	mkimage -A "$mkarch" -O linux -T kernel -C none -a "$kaddr" -e "$epoint" \
+	mkimage -A "$mkarch" -O linux -T kernel -C $comp -a "$kaddr" -e "$epoint" \
 		-n "$kdesc" -d "$kdata" "$uimage" >&2 1>/dev/null
 	echo "done." >&2
 }
@@ -489,7 +524,7 @@ mkimage_script() {
             -e "/@@UBOOT_ENV_EXTRA@@/{
                   s/@@UBOOT_ENV_EXTRA@@//g
                   r $ubootenv
-                }" < $sdata > $tdata \
+                }" \
             -e "/@@UBOOT_PREBOOT_EXTRA@@/{
                   s/@@UBOOT_PREBOOT_EXTRA@@//g
                   r $preboot
@@ -515,9 +550,30 @@ mkimage_multi() {
 	echo "done." >&2
 }
 
+mkimage_fit() {
+	local image_its="$1"
+	local image_fit="$2"
+	local kernel_file="$3"
+	local initrd_file="$4"
+	local kernel_ver="$5"
+	local dtb_file="$6"
+
+	local its_tmp="$tmpdir/image.its"
+
+	sed -e "s#@@LINUX_IMAGE_FILE@@#$kernel_file#g" \
+	    -e "s#@@INITRD_FILE@@#$initrd_file#g" \
+	    -e "s#@@DEVICE_TREE_FILE@@#$dtb_file#g" \
+	    -e "s#@@KERNEL_VERSION@@#$kernel_ver#g" \
+	    < "$ITSFILES_DIR/$image_its" > "$its_tmp"
+
+	printf "Generating u-boot image..." >&2
+	mkimage -D "-I dts -O dtb" -f "$its_tmp" "$image_fit" >&2 1>/dev/null
+	echo " done." >&2
+}
+
 # Return a nonempty string *unless* NO_CREATE_DOT_BAK_FILES is set.
 get_dot_bak_preference() {
-	. /etc/default/flash-kernel
+	. ${FK_DEFAULTS}
 	case $(echo "$NO_CREATE_DOT_BAK_FILES" | tr '[:upper:]' '[:lower:]') in
 	    true|yes|1) ;;
 	    *) echo yes ;;
@@ -526,7 +582,7 @@ get_dot_bak_preference() {
 
 # Return a nonempty string *unless* MTD_BACKUP_DIR is "none".
 get_mtd_backup_dir() {
-	. /etc/default/flash-kernel
+	. ${FK_DEFAULTS}
 	case "${MTD_BACKUP_DIR:=/var/backups/flash-kernel}" in
 	    none) echo "";;
 	    *) echo "${MTD_BACKUP_DIR}";;
@@ -559,6 +615,20 @@ backup_and_install() {
 	mv "$source" "$dest"
 }
 
+backup_and_remove() {
+	local dest="$1"
+	local do_dot_bak=$(get_dot_bak_preference)
+	if [ -e "$dest" ]; then
+		if [ -n "$do_dot_bak" ]; then
+			echo "Taking backup of $(basename "$dest")." >&2
+			mv "$dest" "$dest.bak"
+		else
+			echo "Skipping backup of $(basename "$dest")." >&2
+			rm "$dest"
+		fi
+	fi
+}
+
 # See http://www.nslu2-linux.org/wiki/Info/BootFlash -- the NSLU2 uses a
 # 16 byte MTD header, the first four bytes (big endian) give the length of
 # the remainder of the image, and the remaining bytes are zero.  Generate
@@ -575,7 +645,6 @@ nslu2_swap() {
 	fi
 }
 
-# XXX needs testsuite coverage
 abootimg_get_image_size() {
 	local abootimg="$1"
 
@@ -586,7 +655,6 @@ dtb_append_required() {
 	linux-version compare "$kvers" ge "$dtb_append_from"
 }
 
-# XXX needs testsuite coverage
 android_flash() {
 	local device="$1"
 
@@ -596,8 +664,48 @@ android_flash() {
 	echo "done." >&2
 }
 
+include_only_flavors() {
+	# include_only_flavors(flav1, flav2, flav3)
+	# filter lines of input in uname -r format (X.Y.Z-N-flavor)
+	# and filter-out anything that is not in the listed input
+	# if the only flavor given is "any", then assume everything is a match
+	local cur_uname cur_flav allowed_flav
+	while read -r cur_uname; do
+		if [ "$*" = "any" ]; then
+			echo "$cur_uname"
+		else
+			# could use cur_flav=$(get_kfile_suffix "$cur_uname")
+			# but this is much faster.
+			cur_flav=${cur_uname#*-*-}
+			for allowed_flav in "$@"; do
+				if [ "${cur_flav}" = "${allowed_flav}" ]; then
+					echo "$cur_uname"
+					break
+				fi
+			done
+		fi
+	done
+}
+
+get_kernel_status() {
+	# get_kernel_status(query_ver)
+	# return the dpkg package status of kernel version $query_ver
+	local query_ver="$1"
+	local ver path pkg
+	linux-version list --paths | while read -r ver path; do
+		if linux-version compare "$ver" eq "$query_ver"; then
+			pkg=$(
+				LC_ALL=C dpkg-query --search "$path" 2>/dev/null |
+				awk -F ": " -v path="$path" '$2==path { print $1; }'
+			)
+			LC_ALL=C dpkg-query --show --showformat '${db:Status-Status}' "$pkg"
+			break
+		fi
+	done
+}
+
 find_dtb_file() {
-	local dtb
+	local dtb path
 	case "$dtb_dir" in
 	/*)
 		dtb="$dtb_dir/$dtb_name"
@@ -606,12 +714,14 @@ find_dtb_file() {
 		fi
 		;;
 	*)
-		dtb=$(find /etc/flash-kernel/dtbs -name $dtb_name 2>/dev/null | head -n 1)
-		if [ -z "$dtb" ]; then
-			dtb=$(find /usr/lib/linux-image-$kvers -name $dtb_name 2>/dev/null | head -n 1)
-		fi
+		dtb=
+		paths="/etc/flash-kernel/dtbs /usr/lib/linux-image-$kvers /lib/firmware/$kvers/device-tree/"
+		for path in $paths; do
+			dtb=$(find $path -name $dtb_name 2>/dev/null | head -n 1)
+			[ -z "$dtb" ] || break
+		done
 		if [ ! -f "$dtb" ]; then
-			error "Couldn't find DTB $dtb_name in /usr/lib/linux-image-$kvers or /etc/flash-kernel/dtbs"
+			error "Couldn't find DTB $dtb_name on the following paths: $paths"
 		fi
 		;;
 	esac
@@ -673,6 +783,13 @@ handle_dtb() {
 }
 
 main() {
+# Do not run inside an LXC container unless explicitly asked
+if [ "$FK_FORCE" != "yes" ]; then
+    if systemd-detect-virt --quiet --container || systemd-detect-virt --quiet --chroot; then
+        exit 0
+    fi
+fi
+
 force="no"
 if [ "x$1" = "x--force" ]; then
 	force="yes"
@@ -708,7 +825,16 @@ if [ -n "$kvers" ] ; then
 	handle_dtb
 fi
 
-latest_version=$(linux-version list | linux-version sort | tail -1)
+# if get_machine_field returns non-zero, then all flavors are allowed
+if ! kflavors=$(get_machine_field "$machine" "Kernel-Flavors") ; then
+	# Since no Kernel-Flavors were specified, allow any kernel.
+	kflavors="any"
+fi
+# 'armmp' kernel flavor is called 'generic' in Ubuntu.  Map this
+# unconditionally.
+kflavors=$(echo "$kflavors" | sed -e's/\barmmp\b/generic/g')
+
+latest_version=$(linux-version list | include_only_flavors $kflavors | linux-version sort | tail -1)
 
 if [ -n "$kvers" ] && [ "$FK_KERNEL_HOOK_SCRIPT" = "postrm.d" ]; then
 	echo "flash-kernel: Kernel ${kvers} has been removed." >&2
@@ -727,22 +853,6 @@ if [ -n "$kvers" ] && [ "$FK_KERNEL_HOOK
 	fi
 fi
 
-if [ "$kvers" != "$latest_version" ] && [ "x$force" = "xyes" ]; then
-	echo "flash-kernel: forcing install of ${kvers} instead of ${latest_version}." >&2
-	echo "flash-kernel: WARNING: Installing any new kernel package might override this." >&2
-else
-	if [ -n "$kvers" ] && [ "$kvers" != "$latest_version" ]; then
-		echo "Ignoring old or unknown version $kvers (latest is $latest_version)" >&2
-		if [ "$FK_KERNEL_HOOK_SCRIPT" = "postinst.d" ]; then
-			exit 0
-		fi
-		echo "Use --force if you want version $kvers." >&2
-	fi
-	kvers="$latest_version"
-	# Make sure we install the DTB for $latest_version
-	handle_dtb
-fi
-
 # accumulate multiple calls in a trigger to only run flash-kernel once; the
 # trigger will just call flash-kernel again with FLASH_KERNEL_NOTRIGGER set to
 # force a real run
@@ -759,6 +869,47 @@ if [ -z "$FLASH_KERNEL_NOTRIGGER" ] && [
 	# dpkg-trigger failed for some reason, proceed to a normal run
 fi
 
+case "$kvers" in
+	"")
+		if [ "$force" = "yes" ]; then
+			echo "flash-kernel: no kernel version specified with --force." >&2
+			exit 1
+		else
+			kvers="$latest_version"
+			# Make sure we install the DTB for $latest_version
+			handle_dtb
+		fi
+		;;
+	"$latest_version")
+		# Proceed as normal; --force is basically a noop here
+		;;
+	*)
+		if [ "$force" = "yes" ]; then
+			echo "flash-kernel: forcing install of ${kvers} instead of ${latest_version}." >&2
+			echo "flash-kernel: WARNING: Installing any new kernel package might override this." >&2
+		else
+			echo "Ignoring old or unknown version $kvers (latest is $latest_version)" >&2
+			exit 0
+		fi
+		;;
+esac
+
+kstatus=$(get_kernel_status "$kvers")
+if [ "$kstatus" != "installed" ]; then
+	echo "flash-kernel: requested kernel ${kvers} is in state ${kstatus}." >&2
+	if [ -n "$DPKG_RUNNING_VERSION" ]; then
+		# This is a horrid hack; we *should* re-trigger ourselves, but that
+		# causes dpkg to report a trigger-cycle on some arm64 clouds for
+		# reasons not fully understood. So we exit cleanly in the vague hope
+		# that we'll be re-triggered later in the apt run
+		echo "flash-kernel: quitting cleanly, anticipating a future run" >&2
+		exit 0
+	elif [ "$force" != "yes" ]; then
+		exit 1
+	fi
+	echo "flash-kernel: WARNING: Components like the initrd may be missing or require regeneration." >&2
+fi
+
 kfile="/boot/vmlinuz-$kvers"
 ifile="/boot/initrd.img-$kvers"
 desc="kernel $kvers"
@@ -807,10 +958,6 @@ if ! check_supported "$machine"; then
 fi
 
 kfile_suffix=""
-if ! kflavors=$(get_machine_field "$machine" "Kernel-Flavors") ; then
-	# Since no Kernel-Flavors were specified, allow any kernel.
-	kflavors="any"
-fi
 for kflavor in $kflavors ; do
 	if check_kflavors "$kvers" "$kflavor" ; then
 		kfile_suffix="$kflavor"
@@ -846,6 +993,8 @@ boot_initrd_path_version="$(get_machine_
 boot_script_path="$(get_machine_field "$machine" "Boot-Script-Path")" || :
 boot_dtb_path="$(get_machine_field "$machine" "Boot-DTB-Path")" || :
 boot_dtb_path_version="$(get_machine_field "$machine" "Boot-DTB-Path-Version")" || :
+boot_fit_path="$(get_machine_field "$machine" "Boot-FIT-Path")" || :
+boot_its_file_name="$(get_machine_field "$machine" "Boot-ITS-File-Name")" || :
 boot_multi_path="$(get_machine_field "$machine" "Boot-Multi-Path")" || :
 android_boot_device="$(get_machine_field "$machine" "Android-Boot-Device")" || :
 
@@ -892,7 +1041,7 @@ boot_mnt_dir=""
 cleanups() {
 	rm -rf "$tmpdir"
 	if [ -d "$boot_mnt_dir" ]; then
-		umount "$boot_mnt_dir"
+		umount -l "$boot_mnt_dir"
 		rmdir "$boot_mnt_dir"
 	fi
 }
@@ -963,6 +1112,14 @@ case "$method" in
 				"$tmpdir/uImage"
 			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" \
+				"$kfile" "$ifile" "${kvers}" "$(find_dtb_file)"
+		    backup_and_install "$fit_tmp" "$boot_fit_path"
+		fi
 		if [ -n "$boot_device" ]; then
 			check_block_dev "$boot_device"
 			echo "Will use $boot_device as boot device." >&2
@@ -1040,6 +1197,97 @@ case "$method" in
 			backup_and_install "$dtb" "$boot_dtb_path"
 		fi
 	;;
+	"pi")
+		boot_dir="/boot/firmware"
+		bootloader_paths="/usr/lib/linux-firmware-raspi"
+		device_tree_paths="
+			/etc/flash-kernel/dtbs
+			/usr/lib/firmware/$kvers/device-tree
+			/usr/lib/firmware/$kvers/device-tree/broadcom"
+		. "${FK_CHECKOUT:-$FK_DIR}/functions-piboot"
+		boot_kernel_path=${boot_kernel_path:-$boot_dir/vmlinuz}
+		boot_initrd_path=${boot_initrd_path:-$boot_dir/initrd.img}
+		boot_script_path=${boot_script_path:-$boot_dir/boot.scr}
+		cp "$kfile" "$tmpdir/vmlinuz"
+		backup_and_install "$tmpdir/vmlinuz" "$boot_kernel_path"
+		if [ -n "$ifile" ]; then
+			cp "$ifile" "$tmpdir/initrd.img"
+			backup_and_install "$tmpdir/initrd.img" "$boot_initrd_path"
+		else
+			backup_and_remove "$boot_initrd_path"
+		fi
+		find_bootloader_assets $bootloader_paths | {
+			while read fw; do
+				fw_name=$(basename $fw)
+				cp "$fw" "$tmpdir/$fw_name"
+				backup_and_install "$tmpdir/$fw_name" "$boot_dir/$fw_name"
+			done
+		}
+		find_device_trees $device_tree_paths | {
+			while read dtb; do
+				dtb_name=$(basename $dtb)
+				cp "$dtb" "$tmpdir/$dtb_name"
+				backup_and_install "$tmpdir/$dtb_name" "$boot_dir/$dtb_name"
+			done
+		}
+		mkdir -p "$boot_dir/overlays"
+		find_device_tree_overlays $device_tree_paths | {
+			while read overlay; do
+				overlay_name=$(basename $overlay)
+				cp "$overlay" "$tmpdir/$overlay_name"
+				backup_and_install "$tmpdir/$overlay_name" "$boot_dir/overlays/$overlay_name"
+			done
+		}
+	;;
+	"pi-try")
+		boot_mnt="/boot/firmware"
+		bootloader_paths="/usr/lib/linux-firmware-raspi"
+		device_tree_paths="
+			/etc/flash-kernel/dtbs
+			/usr/lib/firmware/$kvers/device-tree
+			/usr/lib/firmware/$kvers/device-tree/broadcom"
+		. "${FK_CHECKOUT:-$FK_DIR}/functions-piboot"
+		if needs_migrate "$boot_mnt"; then
+			echo "Detected old layout on $boot_mnt; migrating" >&2
+			migrate "$boot_mnt"
+		fi
+		if [ -d "$boot_mnt"/old ]; then
+			echo "Removing $boot_mnt/old/ and $boot_mnt/new/" >&2
+			rm -rf "$boot_mnt"/old "$boot_mnt"/new
+		fi
+		echo "Copying kernel assets to $boot_mnt/new/" >&2
+		mkdir -p "$boot_mnt"/new/overlays
+		cp "$kfile" "$boot_mnt"/new/vmlinuz
+		cp "$boot_mnt"/current/cmdline.txt "$boot_mnt"/new/cmdline.txt
+		if [ -n "$ifile" ]; then
+			cp "$ifile" "$boot_mnt"/new/initrd.img
+		fi
+		echo "Copying boot firmware to $boot_mnt/new/" >&2
+		find_bootloader_assets $bootloader_paths | {
+			while read src; do
+				cp "$src" "$boot_mnt"/new/
+				# NOTE: new bootloader is always copied to root of boot
+				# partition; this part of the chain is not subject to (this
+				# style of) tryboot
+				atomic_cp "$src" "$boot_mnt"/
+			done
+		}
+		echo "Copying device trees to $boot_mnt/new/" >&2
+		find_device_trees $device_tree_paths | {
+			while read src; do
+				cp "$src" "$boot_mnt"/new/
+			done
+		}
+		echo "Copying device tree overlays to $boot_mnt/new/overlays/" >&2
+		find_device_tree_overlays $device_tree_paths | {
+			while read src; do
+				cp "$src" "$boot_mnt"/new/overlays/
+			done
+		}
+		sync
+		set_state "$boot_mnt" new unknown
+		echo "Please be aware next reboot will boot twice" >&2
+	;;
 	"symlink")
 		[ -n "$ifile" ] || error "Initrd required for symlink method"
 		rm -f /boot/initrd /boot/zImage
diff -pruN 3.109/functions-piboot 3.109ubuntu7/functions-piboot
--- 3.109/functions-piboot	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/functions-piboot	2025-10-17 14:51:57.000000000 +0000
@@ -0,0 +1,706 @@
+# Copyright (C) 2025 Dave Jones <dave.jones@canonical.com>
+
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+PROC_DT_BOOTLOADER="${FK_PROC_DT_BOOTLOADER:-/proc/device-tree/chosen/bootloader}"
+FK_ETC_VALIDATE="${FK_ETC_VALIDATE:-/etc/flash-kernel/piboot-validate}"
+
+parse_find_opts() {
+	# A parser for options common to all the find_* functions below. Simply
+	# arranges the --suffix argument to be echo'd first, and all other
+	# positional parameters to follow
+
+	local sources
+	local suffix
+
+	eval set -- $(getopt -o "s:" -l "suffix:" -- "$@")
+	while true; do
+		case "$1" in
+			-s|--suffix)
+				suffix="$2"
+				shift 2
+			;;
+			--)
+				shift
+				break
+			;;
+			*)
+				printf "internal error %s" "$0"
+				exit 1
+			;;
+		esac
+	done
+
+	echo "suffix=$suffix" "$@"
+}
+
+unique_filenames() {
+	# Given a list of filepaths on stdin, filters the list to include only
+	# unique file *names* (with the first encountered winning). The filtered
+	# list is printed on stdout.
+	#
+	# For example, given input of "/foo/quux" "/foo/bar" "/bar/quux" the
+	# function will echo "/foo/quux" "/foo/bar", eliminating "/bar/quux" as
+	# there was already a "quux" file encountered.
+
+	awk '
+	{
+		file=$0;
+		sub("^.*/", "", file);
+		if (!(file in files)) files[file]=$0;
+	}
+	END {
+		for (file in files) print files[file];
+	}'
+}
+
+find_bootloader_assets() {
+	# Searches for the Raspberry Pi bootloader files on the paths specified
+	# as positional parameters. If --suffix is specified, searches for files
+	# with the specified suffix appended (e.g. ".bak").
+
+	local suffix
+
+	set -- $(parse_find_opts "$@")
+	suffix="${1#suffix=}"
+	shift
+
+	find "$@" -maxdepth 1 \
+		-name "bootcode.bin${suffix}" -o \
+		-name "start*.elf${suffix}" -o \
+		-name "fixup*.dat${suffix}" | unique_filenames
+}
+
+find_device_trees() {
+	# Searches for base device-trees (*.dtb) on the paths specified as
+	# positional parameters. If --suffix is specified, searches for files with
+	# the specified suffix appended (e.g. ".bak").
+
+	local suffix
+
+	set -- $(parse_find_opts "$@")
+	suffix="${1#suffix=}"
+	shift
+
+	find "$@" -maxdepth 1 \
+		-name "*.dtb${suffix}" | unique_filenames
+}
+
+find_device_tree_overlays() {
+	# Searches for device-tree overlays on the paths specified as positional
+	# parameters. If --suffix is specified, searches for files with the
+	# specified suffix appended (e.g. ".bak").
+	#
+	# NOTE: the paths specified are assumed to be base directories. The
+	# "overlays/" folder should NOT be specified
+
+	local suffix
+
+	set -- $(parse_find_opts "$@")
+	suffix="${1#suffix=}"
+	shift
+
+	find "$@" -maxdepth 2 \
+		-path "*/overlays/*.dtbo${suffix}" -o \
+		-path "*/overlays/hat_map.dtb${suffix}" -o \
+		-path "*/overlays/overlay_map.dtb${suffix}" -o \
+		-path "*/overlays/README${suffix}" | unique_filenames
+}
+
+find_kernel_assets() {
+	# Searches for Linux kernel assets (vmlinuz and the initramfs) on the paths
+	# specified as positional parameters. If --suffix is specified, searches
+	# for files with the specified suffix appended (e.g. ".bak").
+
+	local suffix
+
+	set -- $(parse_find_opts "$@")
+	suffix="${1#suffix=}"
+	shift
+
+	find "$@" -maxdepth 1 \
+		-name "vmlinuz${suffix}" -o \
+		-name "initrd.img${suffix}" -o \
+		-name "cmdline.txt${suffix}" | unique_filenames
+}
+
+find_all_assets() {
+	# Searches for all boot assets relevant to the Raspberry Pi on the paths
+	# specified as positional parameters. If --suffix is specified, searches
+	# for files with the specified suffix appended (e.g. ".bak").
+
+	find_bootloader_assets "$@"
+	find_kernel_assets "$@"
+	find_device_trees "$@"
+	find_device_tree_overlays "$@"
+}
+
+atomic_cp() {
+	# An "atomic" cp operation that will copy $1 to $2. This is only atomic in
+	# the sense that, afterward, the destination $2 is guaranteed to be either
+	# its original content (if an error occurred) or the new content from $1
+	# (if no error occurred), and not some in-between state. It is NOT atomic
+	# in the sense of preventing simultaneous operations on the target.
+
+	local src="$1"
+	local dest="$2"
+	if [ -d "$dest" ]; then
+		dest="${dest%/}"/"$(basename "$src")"
+	fi
+	local tmp="$(mktemp "$dest".XXX)"
+
+	if ! cp "$src" "$tmp"; then
+		rm "$tmp"
+		return 1
+	fi
+	if ! mv "$tmp" "$dest"; then
+		rm "$tmp"
+		return 1
+	fi
+	return 0 # true
+}
+
+needs_migrate() {
+	# Determines if the boot files under $1 are laid out in the legacy manner
+	# (everything in the root of the boot partition).
+
+	local boot_mnt="$1"
+
+	if  [ -f "$boot_mnt"/current/state ] || \
+		grep -q -e "^os_prefix=" "$boot_mnt"/config.txt 2>/dev/null
+	then
+		return 1 # false
+	else
+		return 0 # true
+	fi
+}
+
+write_autoboot() {
+	local boot_mnt="$1"
+	local boot_dev
+	local first_dev
+	local mnt
+
+	boot_dev="$(findmnt -n -o SOURCE --target "$boot_mnt")"
+	first_dev="$(echo "$boot_dev" | sed -e 's/[0-9][0-9]*$//')1"
+	(
+		if [ "$first_dev" != "$boot_dev" ]; then
+			echo "Mounting recovery partition" >&2
+			mnt=$(mktemp -d)
+			mount "$first_dev" "$mnt"
+			cleanup() {
+				echo "Unmounting recovery partition" >&2
+				umount $1
+				rmdir $1
+			}
+			trap "cleanup $mnt" EXIT
+		else
+			mnt="$boot_mnt"
+		fi
+		"${FK_CHECKOUT:-$FK_DIR}"/migrate-autoboot "$mnt"/autoboot.txt
+	)
+}
+
+migrate() {
+	# Migrates boot files under $1 from the legacy layout (everything under
+	# a single directory) to the new layout (all assets stored under current/
+	# with a config.txt pointing at this).
+
+	local boot_mnt="$1"
+	local src
+	local dest
+
+	echo "Removing backup boot files to make space for migration" >&2
+	find_all_assets --suffix .bak "$boot_mnt" | {
+		while read src; do
+			rm -f "$src"
+		done
+	}
+
+	if [ -f "$boot_mnt"/boot.scr ]; then
+		echo "Removing legacy u-boot assets" >&2
+		rm -f "$boot_mnt"/uboot*.bin \
+			"$boot_mnt"/uboot*.bin.bak \
+			"$boot_mnt"/boot.scr \
+			"$boot_mnt"/boot.scr.bak
+	fi
+
+	echo "Copying current boot files to current/ directory" >&2
+	mkdir -p "$boot_mnt"/current
+	find_all_assets "$boot_mnt" | {
+		while read src; do
+			# We deliberately avoid basename here as we want to strip *only*
+			# $boot_mnt, leaving sub-directories like overlays/ intact
+			dest="${src#"$boot_mnt"}"
+			dest="${dest#/}"
+			dest="$boot_mnt"/current/"$dest"
+			mkdir -p "$(dirname "$dest")"
+			cp "$src" "$dest"
+		done
+	}
+	set_state "$boot_mnt" current good
+	sync
+
+	echo "Adjusting config.txt to point to current/ directory" >&2
+	local tmp="$(mktemp "$boot_mnt"/config.XXX)"
+	"${FK_CHECKOUT:-$FK_DIR}"/migrate-config "$boot_mnt"/config.txt > "$tmp"
+	mv "$tmp" "$boot_mnt"/config.txt
+
+	echo "Writing autoboot.txt" >&2
+	write_autoboot "$boot_mnt"
+	sync
+
+	echo "Removing unneeded files" >&2
+	{
+		find_kernel_assets "$boot_mnt"
+		find_device_trees "$boot_mnt"
+		find_device_tree_overlays "$boot_mnt"
+	} | {
+		while read src; do
+			rm -f "$src"
+		done
+		rmdir "$boot_mnt"/overlays
+	}
+
+	echo "Migration completed successfully" >&2
+}
+
+stable_1() {
+	# Step 1 of the transition to stable state. Atomically exchanges the "new/"
+	# and "current/" folders. This guarantees current/ exists, and points to
+	# "known good" boot assets at all times in the transition. $1 is the boot
+	# partition mount point.
+
+	local boot_mnt="$1"
+
+	# NOTE: mv --exchange requires coreutils 9.5 or above (plucky onwards)
+	# NOTE: rust-coreutils does not (currently) support --exchange
+	gnumv -T --no-copy --exchange "$boot_mnt"/new "$boot_mnt"/current
+}
+
+stable_2() {
+	# Step 2 of the transition to stable state. Atomically rename the "new/"
+	# folder (previously "current/" before step 1) to "old/". $1 is the boot
+	# partition mount point.
+
+	local boot_mnt="$1"
+
+	mv "$boot_mnt"/new "$boot_mnt"/old
+}
+
+stable_3() {
+	# Step 3 (final) of the transition to stable state. Atomically re-write the
+	# "current/" state to "good". This must be performed last so that we can
+	# detect partially executed transitions and recover from them. $1 is the
+	# boot partition mount point.
+
+	local boot_mnt="$1"
+
+	set_state "$boot_mnt" current good
+}
+
+set_state() {
+	# Atomically replace the "state" file under the specified directory. $1 is
+	# the boot partition mount point. $2 is the boot assets sub-directory
+	# (typically "new" or "current"). $3 is the new state to write (e.g.
+	# "good", "bad", "unknown" or "trying").
+	#
+	# NOTE: This has the same limitations as atomic_cp above.
+
+	local boot_mnt="$1"
+	local dir="$2"
+	local state="$3"
+	local tmp="$(mktemp "$boot_mnt"/"$dir"/state.XXX)"
+
+	if ! echo "$state" > "$tmp"; then
+		rm -f "$tmp"
+		return 1
+	fi
+	if ! mv "$tmp" "$boot_mnt"/"$dir"/state; then
+		rm -f "$tmp"
+		return 1
+	fi
+	return 0 # true
+}
+
+boot_service_key() {
+	# Calculates the "key" for the boot-service. This is essentially the
+	# amalgamation (actually simple concatenation) of the tryboot status, and
+	# the old, current, and new boot asset states. This "key" dictates which
+	# transition (if any) a given service should be performing.
+	#
+	# The state graph for the whole system, along with which service carries
+	# out each transition is as follows:
+	#
+	# ┌────────┐         p-t-validate         ┌────────┐
+	# │ stable │◂─────────────────────────────┤ trying ├─┐
+	# └───┬────┘                              └────────┘ │
+	#     │               ┌─────┐                  ▴     │
+	#     │               ▾ f-k │                  │     │
+	#     │           ┌─────────┴┐    p-t-reboot   │     │ p-t-reboot /
+	#     └──────────▸│ untested ├─────────────────┘     │ p-t-validate
+	#        f-k      └──────────┘                       │
+	#                      ▴                             │
+	#                      │         ┌────────┐          │
+	#                      └─────────┤ failed │◂─────────┘
+	#                          f-k   └────────┘
+	#
+	#   f-k = an execution of flash-kernel
+	#   p-t-reboot = the (early) piboot-try-reboot service
+	#   p-t-validate = the (late) piboot-try-validate service
+	#
+	# Refer to comments within the case statements of the boot_service_*
+	# functions to see which transition a given key corresponds to.
+
+	local boot_mnt="$1"
+	local tryboot_status
+	local current_state
+	local old_state="-"
+	local new_state="-"
+
+	tryboot_status=$(
+		od -A n -t u4 --endian big "$PROC_DT_BOOTLOADER"/tryboot |
+		tr -d '[:space:]')
+	current_state=$(cat "$boot_mnt"/current/state)
+	if [ -f "$boot_mnt"/new/state ]; then
+		new_state=$(cat "$boot_mnt"/new/state)
+	fi
+	if [ -f "$boot_mnt"/old/state ]; then
+		old_state=$(cat "$boot_mnt"/old/state)
+	fi
+
+	echo "${tryboot_status}/${old_state}/${current_state}/${new_state}"
+}
+
+boot_service_reboot() {
+	# Implements piboot-try --reboot. $1 is the boot partition mount point
+
+	local boot_mnt="$1"
+	local key="$(boot_service_key "$boot_mnt")"
+	local boot_partition
+
+	boot_partition=$(
+		od -A n -t u4 --endian big "$PROC_DT_BOOTLOADER"/partition |
+		tr -d '[:space:]')
+
+	case "$key" in
+		0/-/good/-|[01]/good/good/-|[01]/-/good/good)
+			# stable states with / without older / restored kernels
+		;;
+		0/-/good/bad)
+			# failed state, fallen back to "known good" kernel
+		;;
+		[01]/-/good/unknown)
+			# untested->trying transition
+			set_state "$boot_mnt" new trying
+			# No need to sync as the reboot will do this anyway
+			echo "Rebooting to test new boot assets" >&2
+			reboot "$boot_partition tryboot"
+		;;
+		1/-/good/trying)
+			# trying state, awaiting validation by later service
+		;;
+		0/-/good/trying)
+			# trying->failed transition due to reboot
+			# This MUST be handled by piboot-try-reboot otherwise a race exists
+			# with the piboot-try-validate service which may cause the latter
+			# to mark boot assets about to be tested as "bad" before the
+			# tryboot reboot can occur
+			set_state "$boot_mnt" new bad
+			echo "Marked new boot assets bad" >&2
+		;;
+		0/-/trying/good|0/good/trying/-)
+			# trying->stable transition interrupted; leave this for
+			# piboot-try-validate to correct
+		;;
+		*)
+			unexpected_state "$key"
+		;;
+	esac
+
+	return 0
+}
+
+boot_service_validate() {
+	# Implements piboot-try --validate. $1 is the boot partition mount point
+
+	local boot_mnt="$1"
+	local key="$(boot_service_key "$boot_mnt")"
+	local boot_partition
+
+	boot_partition=$(
+		od -A n -t u4 --endian big "$PROC_DT_BOOTLOADER"/partition |
+		tr -d '[:space:]')
+
+	case "$key" in
+		0/-/good/-|[01]/good/good/-|[01]/-/good/good)
+			# stable states with / without older / restored kernels
+		;;
+		0/-/good/bad)
+			# failed state, fallen back to "known good" kernel
+		;;
+		[01]/-/good/unknown)
+			# untested->trying transition; piboot-try-reboot about to reboot
+		;;
+		0/-/good/trying)
+			# trying->failed transition due to reboot; piboot-try-reboot
+			# handles this case
+		;;
+		1/-/good/trying)
+			if ${FK_ETC_VALIDATE}; then
+				# trying->stable transition
+				stable_1 "$boot_mnt"
+				stable_2 "$boot_mnt"
+				stable_3 "$boot_mnt"
+				echo "Switched new boot assets to current successfully" >&2
+			else
+				# trying->failed transition due to validate script failure
+				echo "Validation failed" >&2
+				set_state "$boot_mnt" new bad
+				echo "Marked new boot assets bad" >&2
+				echo "Rebooting to known good boot assets" >&2
+				reboot "$boot_partition"
+			fi
+		;;
+		0/-/trying/good)
+			# trying->stable transition interrupted after stable_1; continue
+			stable_2 "$boot_mnt"
+			stable_3 "$boot_mnt"
+			echo "Switched new boot assets to current successfully" >&2
+		;;
+		0/good/trying/-)
+			# trying->stable transition interrupted after stable_2; continue
+			stable_3 "$boot_mnt"
+			echo "Switched new boot assets to current successfully" >&2
+		;;
+		*)
+			unexpected_state "$key"
+		;;
+	esac
+
+	return 0
+}
+
+boot_service_test() {
+	# Implements piboot-try --test. $1 is the boot partition mount point
+
+	local boot_mnt="$1"
+	local key="$(boot_service_key "$boot_mnt")"
+
+	case "$key" in
+		[01]/-/good/unknown)
+			# untested->trying transition; we will double boot next time
+			return 0 # true
+		;;
+		0/-/good/-|[01]/good/good/-|[01]/-/good/good)
+			# stable states with / without older / restored kernels
+			return 1 # false
+		;;
+		0/-/good/bad)
+			# failed state, fallen back to "known good" kernel
+			return 1 # false
+		;;
+		*)
+			unexpected_state "$key"
+		;;
+	esac
+}
+
+boot_service_status() {
+	# Implements piboot-try --status. $1 is the boot partition mount
+	# point
+
+	local boot_mnt="$1"
+	local key="$(boot_service_key "$boot_mnt")"
+
+	case "$key" in
+		[01]/-/good/unknown)
+			# untested->trying transition; we will double boot next time
+			echo
+			echo piboot-try:
+			fmt << EOF
+Untested boot assets present in $boot_mnt/new. Next boot will double-boot; use
+piboot-try --reboot to reboot and test new assets immediately without
+double-booting
+EOF
+		;;
+		0/-/good/bad)
+			# failed state, fallen back to "known good" kernel
+			echo
+			echo piboot-try:
+			fmt << EOF
+New boot assets in $boot_mnt/new failed. Fallen back to known good state. Use
+piboot-try --reset-new to re-test boot assets. If you are able to determine
+the boot failure is due to a bug, please file an issue: ubuntu-bug flash-kernel
+EOF
+		;;
+		0/-/good/-|[01]/good/good/-|[01]/-/good/good)
+			# stable states with / without older / restored kernels
+		;;
+		*)
+			unexpected_state "$key"
+		;;
+	esac
+}
+
+unexpected_state() {
+	local key="$1"
+
+	echo "piboot is in an invalid or unexpected state: ${key}" >&2
+	echo "Please file an issue: ubuntu-bug flash-kernel" >&2
+	return 2
+}
+
+help() {
+	cat << EOF
+Usage: $0 [OPTION]
+
+Manages boot assets on the boot partition (under $FK_BOOT_MOUNT).
+
+Options:
+  -h, --help     Display this help
+  --test         If new, untested boot assets are present, return 0 (indicating
+                 that the next boot will be a double-boot). Otherwise, return 1
+  --reboot       If new, untested boot assets are present on the boot partition
+                 (under $FK_BOOT_MOUNT/new) then immediately reboot to test
+                 them. This is used by the piboot-try-reboot service
+  --validate     If new boot assets are actively being tested, mark them as
+                 "good" or "bad" depending on whether we have fallen back from
+                 tryboot mode. This is used by the piboot-try-validate service
+  --reset-new    If new boot assets have been marked "bad", reset their state
+                 to "unknown"
+  --restore-old  Restore "old" boot assets to "current", and "current" to
+                 "new"
+
+This may be used by those wishing to avoid the double-boot by initiating it
+manually with piboot-try --reboot (in the event that piboot-try --test
+indicates that new, untested boot assets are present). See piboot-try(8) for
+further information.
+EOF
+	return 0
+}
+
+piboot_try() {
+	# A parser for the piboot-try executable
+
+	local op
+	local ops=0
+
+	eval set -- $(getopt -o "h" -l "help,reboot,validate,test,reset-new,restore-old,status" -- "$@")
+	while true; do
+		case "$1" in
+			-h|--help)
+				help
+				return 0
+			;;
+			--restore-old)
+				ops=$((ops | 0x01))
+			;;
+			--reset-new)
+				ops=$((ops | 0x02))
+			;;
+			--test)
+				ops=$((ops | 0x04))
+			;;
+			--validate)
+				ops=$((ops | 0x08))
+			;;
+			--reboot)
+				ops=$((ops | 0x10))
+			;;
+			--status)
+				ops=$((ops | 0x20))
+			;;
+			--)
+				shift
+				break
+			;;
+			*)
+				printf "internal error %s" "$0"
+				return 1
+			;;
+		esac
+		shift
+	done
+
+	# Test for invalid option combinations
+	if [ "$ops" -eq 0 ]; then
+		echo "No command specified; showing --help" >&2
+		help
+		return 1
+	fi
+	if [ "$((ops & 0x08 && ops != 0x08))" -ne 0 ]; then
+		echo "Cannot specify --validate with other options" >&2
+		return 1
+	fi
+	if [ "$((ops & 0x04 && ops != 0x04))" -ne 0 ]; then
+		echo "Cannot specify --test with other options" >&2
+		return 1
+	fi
+	if [ "$((ops & 0x11 == 0x11))" -ne 0 ]; then
+		echo "--restore-old --reboot makes no sense without --reset-new" >&2
+		return 1
+	fi
+
+	# If the method defined by flash-kernel is not pi-try (if the user has
+	# decided to stay on the "pi" method, for instance), bail out
+	local method="$(get_machine; get_machine_field "$machine" "Method")"
+	if [ "$method" != "pi-try" ]; then
+		if [ "$((ops & 0x1F))" -ne 0 ]; then
+			echo "flash-kernel method is not pi-try" >&2
+			return 1
+		else
+			return 0
+		fi
+	fi
+
+	# Carry out options in a specific order; reboot must always be last,
+	# restore-old must always be first, etc.
+	if [ "$((ops & 0x01))" -ne 0 ]; then
+		if ! [ -d "$FK_BOOT_MOUNT"/old ]; then
+			echo "No old boot assets to restore" >&2
+			return 1
+		else
+			gnumv -T --no-copy --exchange \
+				"$FK_BOOT_MOUNT"/old "$FK_BOOT_MOUNT"/current
+			mv "$FK_BOOT_MOUNT"/old "$FK_BOOT_MOUNT"/new
+			echo "Restored old boot assets to current, and current to new" >&2
+			echo "Former current assets will not be booted unless --reset-new is used" >&2
+		fi
+	fi
+	if [ "$((ops & 0x02))" -ne 0 ]; then
+		if ! [ -d "$FK_BOOT_MOUNT"/new ]; then
+			echo "No new boot assets to reset" >&2
+			return 1
+		else
+			set_state "$FK_BOOT_MOUNT" new unknown
+			echo "Marked new boot assets unknown" >&2
+			echo "Please be aware next reboot will boot twice" >&2
+		fi
+	fi
+	if [ "$((ops & 0x04))" -ne 0 ]; then
+		boot_service_test "$FK_BOOT_MOUNT"
+	fi
+	if [ "$((ops & 0x08))" -ne 0 ]; then
+		boot_service_validate "$FK_BOOT_MOUNT"
+	fi
+	if [ "$((ops & 0x10))" -ne 0 ]; then
+		boot_service_reboot "$FK_BOOT_MOUNT"
+	fi
+	if [ "$((ops & 0x20))" -ne 0 ]; then
+		boot_service_status "$FK_BOOT_MOUNT"
+	fi
+}
diff -pruN 3.109/initramfs-tools/hooks/flash_kernel_set_root 3.109ubuntu7/initramfs-tools/hooks/flash_kernel_set_root
--- 3.109/initramfs-tools/hooks/flash_kernel_set_root	2025-04-08 22:26:17.000000000 +0000
+++ 3.109ubuntu7/initramfs-tools/hooks/flash_kernel_set_root	2025-07-16 14:25:31.000000000 +0000
@@ -55,6 +55,13 @@ FK_DIR="/usr/share/flash-kernel"
 
 . /usr/share/initramfs-tools/hook-functions
 
+# Do not run inside an LXC container unless explicitly asked
+if [ "$FK_FORCE" != "yes" ]; then
+    if systemd-detect-virt --quiet --container; then
+        exit 0
+    fi
+fi
+
 # Record the root filesystem device for use during boot
 rootdev=$(egrep '^[^# 	]+[ 	]+/[ 	]' /etc/fstab | awk '{print $1}') || true
 
diff -pruN 3.109/its/arm64/image-kria.its 3.109ubuntu7/its/arm64/image-kria.its
--- 3.109/its/arm64/image-kria.its	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/its/arm64/image-kria.its	2025-05-08 10:08:03.000000000 +0000
@@ -0,0 +1,161 @@
+/*
+ * Simple U-Boot uImage source file containing a single kernel, ramdisk and FDT blob
+ */
+
+/dts-v1/;
+
+/ {
+    description = "Simple image with single Linux kernel, ramdisk and FDT blob";
+    #address-cells = <1>;
+
+    images {
+        kernel-1 {
+            description = "Ubuntu kernel";
+            data = /incbin/("@@LINUX_IMAGE_FILE@@");
+            type = "kernel";
+            arch = "arm64";
+            os = "linux";
+            compression = "gzip";
+            load = <0x00200000>;
+            entry = <0x00200000>;
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+        ramdisk-1 {
+            description = "Ubuntu ramdisk";
+            data = /incbin/("@@INITRD_FILE@@");
+            type = "ramdisk";
+            arch = "arm64";
+            os = "linux";
+            compression = "none";
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+        fdt-zynqmp-smk-k26-revA.dtb {
+            description = "Flattened device tree blob - zynqmp-smk-k26-revA";
+            data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/xilinx/zynqmp-smk-k26-revA.dtb");
+            type = "flat_dt";
+            arch = "arm64";
+            compression = "none";
+            load = <0x44000000>;
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+        fdt-smk-k26-revA-sck-kr-g-revA.dtb {
+            description = "Flattened device tree blob - smk-k26-revA-sck-kr-g-revA";
+            data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/xilinx/zynqmp-smk-k26-revA-sck-kr-g-revA.dtb");
+            type = "flat_dt";
+            arch = "arm64";
+            compression = "none";
+            load = <0x44000000>;
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+        fdt-smk-k26-revA-sck-kv-g-revA.dtb {
+            description = "Flattened device tree blob - smk-k26-revA-sck-kv-g-revA";
+            data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/xilinx/zynqmp-smk-k26-revA-sck-kv-g-revA.dtb");
+            type = "flat_dt";
+            arch = "arm64";
+            compression = "none";
+            load = <0x44000000>;
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+        fdt-smk-k26-revA-sck-kr-g-revB.dtb {
+            description = "Flattened device tree blob - smk-k26-revA-sck-kr-g-revB";
+            data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/xilinx/zynqmp-smk-k26-revA-sck-kr-g-revB.dtb");
+            type = "flat_dt";
+            arch = "arm64";
+            compression = "none";
+            load = <0x44000000>;
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+        fdt-smk-k26-revA-sck-kv-g-revB.dtb {
+            description = "Flattened device tree blob - smk-k26-revA-sck-kv-g-revB";
+            data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/xilinx/zynqmp-smk-k26-revA-sck-kv-g-revB.dtb");
+            type = "flat_dt";
+            arch = "arm64";
+            compression = "none";
+            load = <0x44000000>;
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+        fdt-smk-k24-revA-sck-kd-g-revA.dtb {
+            description = "Flattened device tree blob - smk-k24-revA-sck-kd-g-revA";
+            data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/xilinx/zynqmp-smk-k24-revA-sck-kd-g-revA.dtb");
+            type = "flat_dt";
+            arch = "arm64";
+            compression = "none";
+            load = <0x44000000>;
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+    };
+
+    configurations {
+        default = "conf-zynqmp-smk-k26-revA";
+        conf-zynqmp-smk-k26-revA {
+            description = "Boot Ubuntu on kria SOM";
+            kernel = "kernel-1";
+            ramdisk = "ramdisk-1";
+            fdt = "fdt-zynqmp-smk-k26-revA.dtb";
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+        conf-zynqmp-smk-kd-g-revA {
+            description = "Boot Ubuntu on Kria KD SOM";
+            kernel = "kernel-1";
+            ramdisk = "ramdisk-1";
+            fdt = "fdt-smk-k24-revA-sck-kd-g-revA.dtb";
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+        conf-smk-k26-revA-sck-kr-g-revA {
+            description = "Boot Ubuntu on kria SOM";
+            kernel = "kernel-1";
+            ramdisk = "ramdisk-1";
+            fdt = "fdt-smk-k26-revA-sck-kr-g-revA.dtb";
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+        conf-smk-k26-revA-sck-kv-g-revA {
+            description = "Boot Ubuntu on kria SOM";
+            kernel = "kernel-1";
+            ramdisk = "ramdisk-1";
+            fdt = "fdt-smk-k26-revA-sck-kv-g-revA.dtb";
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+        conf-smk-k26-revA-sck-kr-g-revB {
+            description = "Boot Ubuntu on kria SOM";
+            kernel = "kernel-1";
+            ramdisk = "ramdisk-1";
+            fdt = "fdt-smk-k26-revA-sck-kr-g-revB.dtb";
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+        conf-smk-k26-revA-sck-kv-g-revB {
+            description = "Boot Ubuntu on kria SOM";
+            kernel = "kernel-1";
+            ramdisk = "ramdisk-1";
+            fdt = "fdt-smk-k26-revA-sck-kv-g-revB.dtb";
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+    };
+};
diff -pruN 3.109/its/arm64/image-mediatek-aiot-i1200.its 3.109ubuntu7/its/arm64/image-mediatek-aiot-i1200.its
--- 3.109/its/arm64/image-mediatek-aiot-i1200.its	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/its/arm64/image-mediatek-aiot-i1200.its	2025-05-08 10:08:03.000000000 +0000
@@ -0,0 +1,111 @@
+/dts-v1/;
+
+/ {
+        description = "U-Boot fitImage for Mediatek AIoT i1200 board";
+        #address-cells = <1>;
+
+        images {
+                kernel-1 {
+                        description = "Linux kernel";
+                        data = /incbin/("@@LINUX_IMAGE_FILE@@");
+                        type = "kernel";
+                        arch = "arm64";
+                        os = "linux";
+                        compression = "gzip";
+                        load = <0x40200000>;
+                        entry = <0x40200000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                ramdisk-1 {
+                        description = "Ubuntu ramdisk";
+                        data = /incbin/("@@INITRD_FILE@@");
+                        type = "ramdisk";
+                        arch = "arm64";
+                        os = "linux";
+                        compression = "none";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                fdt-mt8195-demo.dtb {
+                        description = "i1200 flattened device tree blob";
+                        data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/mediatek/mt8195-demo.dtb");
+                        type = "flat_dt";
+                        arch = "arm64";
+                        compression = "none";
+                        load = <0x44000000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                fdt-panel-boe-ne135fbm.dtbo {
+                        description = "panel-boe-ne135fbm tree blob";
+                        data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/mediatek/panel-boe-ne135fbm.dtbo");
+                        type = "flat_dt";
+                        arch = "arm64";
+                        compression = "none";
+                        load = <0x44c00000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                fdt-display-dp.dtbo {
+                        description = "display-dp tree blob";
+                        data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/mediatek/display-dp.dtbo");
+                        type = "flat_dt";
+                        arch = "arm64";
+                        compression = "none";
+                        load = <0x44c00000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                fdt-vcodec-vcu-mt8395.dtbo {
+                        description = "vcodec-vcu-mt8395 tree blob";
+                        data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/mediatek/vcodec-vcu-mt8395.dtbo");
+                        type = "flat_dt";
+                        arch = "arm64";
+                        compression = "none";
+                        load = <0x44c00000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+        };
+
+        configurations {
+                default = "conf-mt8195-demo.dtb";
+                conf-mt8195-demo.dtb {
+                        description = "Linux kernel, mt8195-demo FDT blob";
+                        kernel = "kernel-1";
+                        ramdisk = "ramdisk-1";
+                        fdt = "fdt-mt8195-demo.dtb";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                conf-panel-boe-ne135fbm.dtbo {
+                        description = "panel-boe-ne135fbm FDT blob";
+                        fdt = "fdt-panel-boe-ne135fbm.dtbo";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                conf-display-dp.dtbo {
+                        description = "display-dp FDT blob";
+                        fdt = "fdt-display-dp.dtbo";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                conf-vcodec-vcu-mt8395.dtbo {
+                        description = "vcodec-vcu-mt8395 FDT blob";
+                        fdt = "fdt-vcodec-vcu-mt8395.dtbo";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+        };
+};
diff -pruN 3.109/its/arm64/image-mediatek-aiot-i500.its 3.109ubuntu7/its/arm64/image-mediatek-aiot-i500.its
--- 3.109/its/arm64/image-mediatek-aiot-i500.its	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/its/arm64/image-mediatek-aiot-i500.its	2025-05-08 10:08:03.000000000 +0000
@@ -0,0 +1,255 @@
+/dts-v1/;
+
+/ {
+        description = "U-Boot fitImage for Mediatek AIoT i500 boards";
+        #address-cells = <1>;
+
+        images {
+                kernel-1 {
+                        description = "Linux kernel";
+                        data = /incbin/("@@LINUX_IMAGE_FILE@@");
+                        type = "kernel";
+                        arch = "arm64";
+                        os = "linux";
+                        compression = "gzip";
+                        load = <0x40200000>;
+                        entry = <0x40200000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                ramdisk-1 {
+                        description = "Ubuntu ramdisk";
+                        data = /incbin/("@@INITRD_FILE@@");
+                        type = "ramdisk";
+                        arch = "arm64";
+                        os = "linux";
+                        compression = "none";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                fdt-mt8183-pumpkin.dtb {
+                        description = "i500 flattened device tree blob";
+                        data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/mediatek/mt8183-pumpkin.dtb");
+                        type = "flat_dt";
+                        arch = "arm64";
+                        compression = "none";
+                        load = <0x44000000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                fdt-camera-ap1302-ar0144-dual.dtbo {
+                        description = "camera-ap1302-ar0144-dual tree blob";
+                        data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/mediatek/camera-ap1302-ar0144-dual.dtbo");
+                        type = "flat_dt";
+                        arch = "arm64";
+                        compression = "none";
+                        load = <0x44c00000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                fdt-camera-ap1302-ar0144-single.dtbo {
+                        description = "camera-ap1302-ar0144-single tree blob";
+                        data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/mediatek/camera-ap1302-ar0144-single.dtbo");
+                        type = "flat_dt";
+                        arch = "arm64";
+                        compression = "none";
+                        load = <0x44c00000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                fdt-camera-ap1302-ar0330-dual-ar0144-dual.dtbo {
+                        description = "camera-ap1302-ar0330-dual-ar0144-dual tree blob";
+                        data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/mediatek/camera-ap1302-ar0330-dual-ar0144-dual.dtbo");
+                        type = "flat_dt";
+                        arch = "arm64";
+                        compression = "none";
+                        load = <0x44c00000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                fdt-camera-ap1302-ar0330-single-ar0144-dual.dtbo {
+                        description = "camera-ap1302-ar0330-single-ar0144-dual tree blob";
+                        data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/mediatek/camera-ap1302-ar0330-single-ar0144-dual.dtbo");
+                        type = "flat_dt";
+                        arch = "arm64";
+                        compression = "none";
+                        load = <0x44c00000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                fdt-camera-ap1302-ar0330-single-ar0144-single.dtbo {
+                        description = "camera-ap1302-ar0330-single-ar0144-single tree blob";
+                        data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/mediatek/camera-ap1302-ar0330-single-ar0144-single.dtbo");
+                        type = "flat_dt";
+                        arch = "arm64";
+                        compression = "none";
+                        load = <0x44c00000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                fdt-camera-ap1302-ar0330-single.dtbo {
+                        description = "camera-ap1302-ar0330-single tree blob";
+                        data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/mediatek/camera-ap1302-ar0330-single.dtbo");
+                        type = "flat_dt";
+                        arch = "arm64";
+                        compression = "none";
+                        load = <0x44c00000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                fdt-camera-ap1302-ar1335-single.dtbo {
+                        description = "camera-ap1302-ar1335-single tree blob";
+                        data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/mediatek/camera-ap1302-ar1335-single.dtbo");
+                        type = "flat_dt";
+                        arch = "arm64";
+                        compression = "none";
+                        load = <0x44c00000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                fdt-camera-ar0330-dual.dtbo {
+                        description = "camera-ar0330-dual tree blob";
+                        data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/mediatek/camera-ar0330-dual.dtbo");
+                        type = "flat_dt";
+                        arch = "arm64";
+                        compression = "none";
+                        load = <0x44c00000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                fdt-camera-ar0330-single.dtbo {
+                        description = "camera-ar0330-single tree blob";
+                        data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/mediatek/camera-ar0330-single.dtbo");
+                        type = "flat_dt";
+                        arch = "arm64";
+                        compression = "none";
+                        load = <0x44c00000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                fdt-panel-raspberrypi.dtbo {
+                        description = "panel-raspberrypi tree blob";
+                        data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/mediatek/panel-raspberrypi.dtbo");
+                        type = "flat_dt";
+                        arch = "arm64";
+                        compression = "none";
+                        load = <0x44c00000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                fdt-panel-urt-umo9465md.dtbo {
+                        description = "panel-urt-umo9465md tree blob";
+                        data = /incbin/("/lib/firmware/@@KERNEL_VERSION@@/device-tree/mediatek/panel-urt-umo9465md.dtbo");
+                        type = "flat_dt";
+                        arch = "arm64";
+                        compression = "none";
+                        load = <0x44c00000>;
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+        };
+
+        configurations {
+                default = "conf-mt8183-pumpkin.dtb";
+                conf-mt8183-pumpkin.dtb {
+                        description = "Linux kernel, mt8183-pumpkin FDT blob";
+                        kernel = "kernel-1";
+                        ramdisk = "ramdisk-1";
+                        fdt = "fdt-mt8183-pumpkin.dtb";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                conf-camera-ap1302-ar0144-dual.dtbo {
+                        description = "camera-ap1302-ar0144-dual FDT blob";
+                        fdt = "fdt-camera-ap1302-ar0144-dual.dtbo";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                conf-camera-ap1302-ar0144-single.dtbo {
+                        description = "camera-ap1302-ar0144-single FDT blob";
+                        fdt = "fdt-camera-ap1302-ar0144-single.dtbo";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                conf-camera-ap1302-ar0330-dual-ar0144-dual.dtbo {
+                        description = "camera-ap1302-ar0330-dual-ar0144-dual FDT blob";
+                        fdt = "fdt-camera-ap1302-ar0330-dual-ar0144-dual.dtbo";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                conf-camera-ap1302-ar0330-single-ar0144-dual.dtbo {
+                        description = "camera-ap1302-ar0330-single-ar0144-dual FDT blob";
+                        fdt = "fdt-camera-ap1302-ar0330-single-ar0144-dual.dtbo";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                conf-camera-ap1302-ar0330-single-ar0144-single.dtbo {
+                        description = "camera-ap1302-ar0330-single-ar0144-single FDT blob";
+                        fdt = "fdt-camera-ap1302-ar0330-single-ar0144-single.dtbo";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                conf-camera-ap1302-ar0330-single.dtbo {
+                        description = "camera-ap1302-ar0330-single FDT blob";
+                        fdt = "fdt-camera-ap1302-ar0330-single.dtbo";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                conf-camera-ap1302-ar1335-single.dtbo {
+                        description = "camera-ap1302-ar1335-single FDT blob";
+                        fdt = "fdt-camera-ap1302-ar1335-single.dtbo";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                conf-camera-ar0330-dual.dtbo {
+                        description = "camera-ar0330-dual FDT blob";
+                        fdt = "fdt-camera-ar0330-dual.dtbo";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                conf-camera-ar0330-single.dtbo {
+                        description = "camera-ar0330-single FDT blob";
+                        fdt = "fdt-camera-ar0330-single.dtbo";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                conf-panel-raspberrypi.dtbo {
+                        description = "panel-raspberrypi FDT blob";
+                        fdt = "fdt-panel-raspberrypi.dtbo";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+                conf-panel-urt-umo9465md.dtbo {
+                        description = "panel-urt-umo9465md FDT blob";
+                        fdt = "fdt-panel-urt-umo9465md.dtbo";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+        };
+};
diff -pruN 3.109/its/arm64/image-nxp-s32.its 3.109ubuntu7/its/arm64/image-nxp-s32.its
--- 3.109/its/arm64/image-nxp-s32.its	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/its/arm64/image-nxp-s32.its	2025-05-08 10:08:03.000000000 +0000
@@ -0,0 +1,61 @@
+/dts-v1/;
+
+/ {
+	description = "Ubuntu kernel, ramdisk, FDT blob and boot config for a NXP S32x board";
+	#address-cells = <1>;
+
+	images {
+		kernel-1 {
+			description = "Ubuntu kernel";
+			data = /incbin/("@@LINUX_IMAGE_FILE@@");
+			type = "kernel";
+			arch = "arm64";
+			os = "linux";
+			compression = "none";
+			load =  <0x80000000>;
+			entry = <0x80000000>;
+
+			hash-1 {
+				algo = "sha256";
+			};
+		};
+
+		ramdisk-1 {
+			description = "Ubuntu ramdisk";
+			data = /incbin/("@@INITRD_FILE@@");
+			type = "ramdisk";
+			arch = "arm64";
+			os = "linux";
+			compression = "none";
+			load =  <0x90000000>;
+
+			hash-1 {
+				algo = "sha256";
+			};
+		};
+
+		fdt-1 {
+			description = "Device tree for a NXP S32x board";
+			data = /incbin/("@@DEVICE_TREE_FILE@@");
+			type = "flat_dt";
+			arch = "arm64";
+			compression = "none";
+			load =  <0x83000000>;
+
+			hash-1 {
+				algo = "sha256";
+			};
+		};
+	};
+
+	configurations {
+		default = "nxp-s32";
+
+		nxp-s32 {
+			description = "Boot config for a NXP S32x board";
+			kernel = "kernel-1";
+			ramdisk = "ramdisk-1";
+			fdt = "fdt-1";
+		};
+	};
+};
diff -pruN 3.109/its/arm64/image-zcu.its 3.109ubuntu7/its/arm64/image-zcu.its
--- 3.109/its/arm64/image-zcu.its	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/its/arm64/image-zcu.its	2025-05-08 10:08:03.000000000 +0000
@@ -0,0 +1,50 @@
+/*
+ * Simple U-Boot uImage source file containing a single kernel, ramdisk and FDT blob
+ */
+
+/dts-v1/;
+
+/ {
+    description = "Simple image with single Linux kernel, ramdisk and FDT blob";
+    #address-cells = <1>;
+
+    images {
+        kernel-1 {
+            description = "Ubuntu kernel";
+            data = /incbin/("@@LINUX_IMAGE_FILE@@");
+            type = "kernel";
+            arch = "arm64";
+            os = "linux";
+            compression = "gzip";
+            load = <0x00200000>;
+            entry = <0x00200000>;
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+
+        ramdisk-1 {
+            description = "Ubuntu ramdisk";
+            data = /incbin/("@@INITRD_FILE@@");
+            type = "ramdisk";
+            arch = "arm64";
+            os = "linux";
+            compression = "none";
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+    };
+
+    configurations {
+        default = "conf-zcu-vck";
+        conf-zcu-vck {
+            description = "Boot Ubuntu on zcu/vck boards";
+            kernel = "kernel-1";
+            ramdisk = "ramdisk-1";
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+    };
+};
diff -pruN 3.109/migrate-autoboot 3.109ubuntu7/migrate-autoboot
--- 3.109/migrate-autoboot	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/migrate-autoboot	2025-08-04 11:01:38.000000000 +0000
@@ -0,0 +1,78 @@
+#!/usr/bin/python3
+
+import os
+import sys
+import tempfile
+
+def main(filename):
+    try:
+        with open(filename, 'r', encoding='ascii') as autoboot:
+            lines = [
+                line.rstrip()
+                for line in autoboot
+            ]
+    except FileNotFoundError:
+        lines = []
+
+    # Parse autoboot.txt into a mapping of section headers to mappings of
+    # keys to values (all strings). This deliberately ignores blank lines or
+    # any lines that are not section headers or key=value
+    sections = {}
+    section = '[all]'
+    for line in lines:
+        if '=' in line:
+            key, value = line.split('=', 1)
+            key = key.strip()
+            value = value.strip()
+            sections.setdefault(section, {})[key] = value
+        elif line.startswith('['):
+            section = line.rstrip()
+
+    # If the value we want to add is already present, we're done. We shouldn't
+    # edit the file unless we absolutely have to
+    if sections.get('[all]', {}).get('tryboot_a_b', '') == '1':
+        return 0
+    if sections.get('[tryboot]', {}).get('tryboot_a_b', '') == '1':
+        return 0
+
+    # Otherwise, try and add to an existing [all] or [tryboot] section (doesn't
+    # matter which). If neither exist, add an [all] section. Bear in mind that
+    # autoboot.txt is limited to one sector (512 bytes) in size, so we try and
+    # keep our changes as minimal as possible
+    if '[all]' in sections:
+        sections['[all]']['tryboot_a_b'] = '1'
+    elif '[tryboot]' in sections:
+        sections['[tryboot]']['tryboot_a_b'] = '1'
+    else:
+        sections['[all]'] = {'tryboot_a_b': '1'}
+
+    # Re-write the file. This will necessary remove blank lines and other
+    # things we ignored when parsing. But given the stringent file limit, and
+    # the fact we are adding content, this is desirable
+    with tempfile.NamedTemporaryFile(
+        'w', dir=os.path.dirname(filename), encoding='ascii', delete=False
+    ) as temp:
+        for header, section in sections.items():
+            temp.write(header)
+            temp.write('\n')
+            for key, value in section.items():
+                temp.write(key)
+                temp.write('=')
+                temp.write(value)
+                temp.write('\n')
+
+        if temp.tell() > 512:
+            os.unlink(temp.name)
+            raise ValueError(f'Generated {filename} is too large')
+        os.rename(temp.name, filename)
+
+
+if __name__ == '__main__':
+    try:
+        main(*sys.argv[1:])
+    except (ValueError, OSError, TypeError) as err:
+        sys.stderr.write(str(err))
+        sys.stderr.write('\n')
+        sys.exit(1)
+    else:
+        sys.exit(0)
diff -pruN 3.109/migrate-config 3.109ubuntu7/migrate-config
--- 3.109/migrate-config	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/migrate-config	2025-08-24 20:43:17.000000000 +0000
@@ -0,0 +1,43 @@
+#!/usr/bin/awk -f
+
+# Always output the os_prefix settings first
+BEGIN {
+	print "[all]";
+	print "os_prefix=current/";
+	print "";
+	print "[tryboot]";
+	print "os_prefix=new/";
+	print "";
+}
+
+BEGIN {
+	section = "[tryboot]";
+	first_line = 1;
+	watchdog_enabled = 0;
+}
+
+first_line==1 && /[^ ]/ {
+	first_line = 0;
+	if ($0 != "[all]") print "[all]";
+	section = "[all]";
+}
+
+/^\[.*\]/ {
+	section = $0;
+}
+
+/^dtparam=watchdog=on/ && section == "[all]" {
+	watchdog_enabled = 1;
+}
+
+{ print; }
+
+# We need to enable the watchdog in an [all] section after the os_prefix
+# settings; if at the end of the file we're not in an [all] section, then
+# make one
+END {
+	if (!watchdog_enabled) {
+		if (section != "[all]") print "[all]";
+		print "dtparam=watchdog=on";
+	}
+}
diff -pruN 3.109/piboot-try 3.109ubuntu7/piboot-try
--- 3.109/piboot-try	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/piboot-try	2025-10-17 14:51:57.000000000 +0000
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# Copyright (C) 2025 Dave Jones <dave.jones@canonical.com>
+
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+set -e
+
+FK_DIR="/usr/share/flash-kernel"
+FK_BOOT_MOUNT="${FK_BOOT_MOUNT:-/boot/firmware}"
+
+. "${FK_CHECKOUT:-$FK_DIR}/functions"
+. "${FK_CHECKOUT:-$FK_DIR}/functions-piboot"
+
+piboot_try "$@"
diff -pruN 3.109/piboot-try.8 3.109ubuntu7/piboot-try.8
--- 3.109/piboot-try.8	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/piboot-try.8	2025-08-04 11:01:38.000000000 +0000
@@ -0,0 +1,319 @@
+.\" -*- nroff -*-
+.TH PIBOOT-TRY 8
+.
+.SH NAME
+piboot-try \- manages A/B boot assets for the Raspberry Pi bootloader
+.
+.
+.SH SYNOPSIS
+.SY piboot-try
+.OP \-\-reboot
+.OP \-\-validate
+.OP \-\-test
+.OP \-\-reset\-new
+.OP \-\-restore\-old
+.YS
+.
+.SY piboot-try
+.B \-h
+.SY piboot-try
+.B \-\-help
+.YS
+.
+.
+.SH DESCRIPTION
+.
+.B piboot-try
+implements the A/B boot mechanism on the Raspberry Pi for those boards using
+the "pi\-try" method in the
+.BR flash\-kernel (8)
+database. The script expects to find boot assets in three locations on the boot
+partition, typically mounted under /boot/firmware (see
+.B FK_BOOT_MOUNT
+under
+.BR "ENVIRONMENT VARIABLES" ).
+.TP
+.B current/
+This sub-directory must always exist and contains the current "known good" boot
+assets.
+.
+.TP
+.B new/
+If this sub-directory exists, it typically contains new, as yet untested boot
+assets, or assets that have been tested but failed and are marked "bad".
+.
+.TP
+.B old/
+If this sub-directory exists, it contains older "known good" boot assets. These
+exist purely as a backup and are never implicitly booted.
+.RE
+.
+.
+.P
+Each time
+.B flash\-kernel
+is run, the
+.B old/
+sub\-directory will be removed (if it exists), and new boot assets will be
+written to the
+.B new/
+sub\-directory. A
+.B state
+file will also be written (under
+.BR new/state )
+indicating the status of the new boot assets. This will contain one of the
+following strings:
+.
+.TP
+unknown
+The initial state for new, untested boot assets.
+.
+.TP
+trying
+The state boot assets are set to immediately before rebooting to try them.
+.
+.TP
+bad
+Indicates the boot assets failed to boot successfully.
+.
+.TP
+good
+Indicates the boot assets booted successfully and passed validation.
+.RE
+.
+.P
+The next time the Pi is booted (or rebooted), the
+.I piboot-try-reboot
+service will check the
+.B new/state
+file. If it contains "unknown", this will be updated to "trying" and the
+machine will be immediately rebooted into the
+.I tryboot
+mode to test the new boot assets. In the
+.I tryboot
+mode, the boot configuration (found in
+.BR config.txt )
+will direct the bootloader load assets from
+.B new/
+instead of
+.B current/
+as usual. Because the
+.I tryboot
+mode is ephemeral, any failure of the boot will cause the next boot to be from
+the "known good" assets under
+.B current/
+instead. In this case, the
+.I piboot-try-reboot
+service will write "bad" to the
+.B new/state
+file to prevent further attempts.
+.P
+Alternatively, if the boot succeeds and
+reaches the point of running the (later)
+.I piboot-try-validate
+service, this will switch the sub\-directories around such that
+.B current/
+becomes
+.B old/
+and
+.B new/
+becomes
+.BR current/ .
+The
+.B old/state
+and
+.B current/state
+files always contain the state "good" under normal circumstances.
+.
+.
+.SH OPTIONS
+.
+.TP
+.BR \-\-test
+Test whether new, untested boot assets are present. If they are, exit with 0,
+otherwise with 1. This can be used in scripts to test whether the next reboot
+will be a double-boot (see
+.B DOUBLE BOOT
+below).
+.
+.TP
+.BR \-\-reboot
+If new, untested boot assets are present, mark them as "trying" and immediately
+reboot into the
+.I tryboot
+mode to test them. This can be used in scripts to avoid the double-boot which
+would otherwise occur (see
+.B DOUBLE BOOT
+below).
+.
+.TP
+.BR \-\-validate
+Invoke the validation phase. This is typically called from the
+piboot-try-validate service. If we are in the
+.I tryboot
+state, mark the new assets "good" and move the
+.B current/
+and
+.B new/
+directories to
+.B old/
+and
+.B current/
+respectively. There should never be a need to execute this mode manually.
+.
+.TP
+.BR \-\-reset\-new
+Reset the
+.B state
+of the boot assets under
+.B new/
+to "unknown". This can be used to re-test boot assets after they have failed.
+This option merely resets the state. The
+.I \-\-reboot
+option should additionally be specified if you wish to immediately test the
+reset assets.
+.
+.TP
+.BR \-\-restore\-old
+Move the boot assets under
+.B current/
+back to
+.B new/
+and the boot assets under
+.B old/
+back to
+.BR current/ .
+.
+.IP
+Note that after this operation, the system will be in the unusual state of
+having the assets under
+.B new/
+marked "good". In this state, these assets will not be used. They will not be
+tested, or swapped in at the next boot which will simply proceed with the
+assets under
+.BR current/ .
+In this state, the next run of
+.B flash\-kernel
+will overwrite the assets under
+.BR new/ .
+Alternatively, if you wish to re\-test the assets under
+.B new/
+directly, you may use the
+.I \-\-reset\-new
+option to do so.
+.
+.
+.SH DOUBLE BOOT
+.
+This setup does have the (potentially undesirable) side-effect that, when new
+boot assets are present the next boot (warm or cold) will necessarily be a
+double-boot. While this is a mild inconvenience for the assurance of a reliable
+boot setup, it is possible to avoid by triggering the
+.I tryboot
+mode manually.
+.P
+The
+.B piboot-try
+script may be executed with the
+.I \-\-test
+option. If there are new, untested boot assets present, this will return 0,
+indicating that the next boot would be a double-boot. If no untested boot
+assets exist, this will return 1. If new assets are present, you may invoke
+.B piboot-try
+with
+.I \-\-reboot
+to manually trigger a
+.I tryboot
+mode reboot directly.
+.
+.
+.
+.SH FILES
+.
+.TP
+.B /etc/flash-kernel/piboot-validate
+This script is used by
+.B piboot\-try
+to validate whether a set of boot assets has produced a "good" boot. It is
+called by the
+.I piboot-try-validate
+service, and must return 0 in the event that a boot is "good", and non-zero if
+a boot is "bad". In the latter case, after marking the assets under
+.B new/
+"bad", the system will be immediately rebooted into the "known good" assets
+under
+.BR current/ .
+.
+.IP
+The default script simply returns 0, in other words simply getting to the point
+the script can run is considered a "good" boot. If additional tests are
+defined in this script, it is recommended that such tests are confined to
+checking for the
+.I existence
+of kernel devices, rather than testing their operation. This avoids potentially
+transient issues (e.g. failure of a DHCP server) from causing a false negative,
+i.e. from boot assets being marked "bad" when they should not be.
+.
+.P
+The boot assets managed by
+.B piboot\-try
+(and by
+.BR flash\-kernel )
+consist of the following files (which can be found under the three
+sub\-directories of the boot partition):
+.
+.TP
+.BR bootcode.bin ", " start*.elf ", " fixup*.dat
+The Pi's bootloader files (for those models where these are not present in the
+EEPROM).
+.
+.TP
+.B bcm*\-rpi\-*.dtb
+The base device\-trees.
+.
+.TP
+.B vmlinuz
+The Linux kernel.
+.
+.TP
+.B cmdline.txt
+The Linux kernel command line.
+.
+.TP
+.B initrd.img
+The initial ram-disk image.
+.
+.TP
+.B overlays/*.dtbo
+The sub-directory containing all device\-tree overlays (along with the HAT and
+overlay maps, and README).
+.
+.TP
+.B state
+The current state of this set of boot assets. May contain one of the strings
+"good", "bad", "unknown", or "trying".
+.RE
+.
+.
+.SH ENVIRONMENT VARIABLES
+.
+.TP
+FK_BOOT_MOUNT
+Specify the mount point of the (FAT formatted) boot partition. Defaults to
+.BR /boot/firmware .
+.
+.TP
+FK_ETC_VALIDATE
+Specify the script (or binary) to execute in order to validate the current
+boot assets. Defaults to
+.BR /etc/flash-kernel/piboot-validate .
+Ideally, you should edit the script rather than override this variable, but if
+you need to do so, override the environment of the piboot-try-validate service.
+.
+.
+.SH SEE ALSO
+.BR flash\-kernel (8)
+.
+.SH AUTHOR
+.
+Dave Jones <dave.jones@canonical.com>
diff -pruN 3.109/post-base-installer.d/01flash-kernel-diversion 3.109ubuntu7/post-base-installer.d/01flash-kernel-diversion
--- 3.109/post-base-installer.d/01flash-kernel-diversion	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/post-base-installer.d/01flash-kernel-diversion	2025-05-08 10:08:03.000000000 +0000
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+# divert update-initramfs
+file=usr/sbin/update-initramfs
+
+in-target dpkg-divert --add --local --divert /${file}.flash-kernel-diverted --rename /${file}
+cp /target/bin/true /target/$file
diff -pruN 3.109/test_db 3.109ubuntu7/test_db
--- 3.109/test_db	2022-03-23 14:22:28.000000000 +0000
+++ 3.109ubuntu7/test_db	2025-07-16 14:25:31.000000000 +0000
@@ -22,7 +22,7 @@
 MACHINE_DB="$(cat "${FK_CHECKOUT:-$FK_DIR}/db/"*.db)"
 
 test_no_unknown_fields() {
-    local expected='Android-Boot-Device Boot-Device Boot-DTB-Path Boot-Initrd-Path Boot-Kernel-Path Boot-Multi-Path Boot-Script-Path Bootloader-Sets-Incorrect-Root DTB-Append DTB-Append-From DTB-Id Kernel-Flavors Machine Machine-Id Method Mtd-Initrd Mtd-Kernel Optional-Packages Required-Packages U-Boot-Initrd-Address U-Boot-Kernel-Address U-Boot-Kernel-Entry-Point U-Boot-Multi-Address U-Boot-Script-Address U-Boot-Script-Name'
+    local expected='Android-Boot-Device Boot-Device Boot-DTB-Path Boot-FIT-Path Boot-Initrd-Path Boot-ITS-File-Name Boot-Kernel-Path Boot-Multi-Path Boot-Script-Path Bootloader-Sets-Incorrect-Root DTB-Append DTB-Append-From DTB-Id Kernel-Flavors Machine Machine-Id Method Mtd-Initrd Mtd-Kernel Optional-Packages Required-Packages U-Boot-Initrd-Address U-Boot-Kernel-Address U-Boot-Kernel-Entry-Point U-Boot-Multi-Address U-Boot-Script-Address U-Boot-Script-Name'
     expected="$(echo "$expected" | sed 's/ /\n/g' | sort -u | xargs)"
     local fields="$(echo "$MACHINE_DB" | sed -n '/^[^#]*:/s/:.*//p' | sort -u | xargs)"
     if [ "$fields" != "$expected" ]; then
diff -pruN 3.109/test_functions 3.109ubuntu7/test_functions
--- 3.109/test_functions	2022-03-23 14:22:28.000000000 +0000
+++ 3.109ubuntu7/test_functions	2025-08-04 11:01:38.000000000 +0000
@@ -397,6 +397,9 @@ Machine: Machine C
 Kernel-Flavors: machinec
 Machine: Invalid
 Dummy: Dummy
+
+Machine: Generic * Machine
+Method: pi
 EOF
     (
         FK_ETC_DB="$mock_etc_db"
@@ -490,6 +493,12 @@ EOF
             exit 1
         fi
 
+        machine="Generic Foo Machine"
+        method=$(get_machine_field "$machine" "Method")
+        if [ "$method" != "pi" ]; then
+            echo "Expected Method field to be pi but got $method" >&2
+            exit 1
+        fi
     )
 }
 add_test test_get_machine_field
@@ -561,7 +570,9 @@ test_set_machine_id() {
 }
 add_test test_set_machine_id
 
-test_mkimage_kernel() {
+_test_mkimage_kernel() {
+    local kdata="$1"
+    local expected="$2"
     (
         mkimage() {
             saved_args="$@"
@@ -569,16 +580,31 @@ test_mkimage_kernel() {
         . "$functions"
         saved_args=""
         mkarch="arm"
-        mkimage_kernel "0xdeadbeef" "0xbaddcafe" "desc" "input" "output" 2>/dev/null
-        expected="-A arm -O linux -T kernel -C none -a 0xdeadbeef -e 0xbaddcafe -n desc -d input output"
+        mkimage_kernel "0xdeadbeef" "0xbaddcafe" "desc" "$kdata" "output" 2>/dev/null
         if [ "$expected" != "$saved_args" ]; then
             echo "Expected mkimage_kernel to be called with \"$expected\" but it was called with \"$saved_args\"" >&2
             exit 1
         fi
     )
 }
+
+test_mkimage_kernel() {
+    local kdata="/dev/zero"
+    local expected="-A arm -O linux -T kernel -C none -a 0xdeadbeef -e 0xbaddcafe -n desc -d $kdata output"
+    _test_mkimage_kernel "$kdata" "$expected"
+}
 add_test test_mkimage_kernel
 
+test_mkimage_kernel_gzip() {
+    get_tempfile
+    local kdata="$last_tempfile"
+    gzip < /dev/null > "$kdata"
+
+    local expected="-A arm -O linux -T kernel -C gzip -a 0xdeadbeef -e 0xbaddcafe -n desc -d $kdata output"
+    _test_mkimage_kernel "$kdata" "$expected"
+}
+add_test test_mkimage_kernel_gzip
+
 test_mkimage_initrd() {
     (
         mkimage() {
@@ -597,6 +623,60 @@ test_mkimage_initrd() {
 }
 add_test test_mkimage_initrd
 
+test_mkimage_script() {
+    get_tempfile
+    mock_fk_defaults="$last_tempfile"
+    cat >"$mock_fk_defaults" <<EOF
+LINUX_KERNEL_CMDLINE="baz quux"
+LINUX_KERNEL_CMDLINE_DEFAULTS="foo"
+EOF
+    get_tempfile
+    mock_script="$last_tempfile"
+    cat >"$mock_script" <<EOF
+setenv bootargs @@LINUX_KERNEL_CMDLINE_DEFAULTS@@ bar @@LINUX_KERNEL_CMDLINE@@
+@@UBOOT_ENV_EXTRA@@
+bar
+@@UBOOT_PREBOOT_EXTRA@@
+end
+EOF
+    (
+        mkimage() {
+            saved_args="$@"
+            shift 15
+            generated_script="$(cat $1)"
+        }
+        . "$functions"
+        # Duplicate (some of) cleanups and tmpdir from main()
+        cleanups() {
+            rm -rf "$tmpdir"
+        }
+        trap cleanups EXIT HUP INT QUIT ILL KILL SEGV PIPE TERM
+        tmpdir="$(mktemp -dt "test_mkimage_script.XXXXXXXX")"
+        gen_ubootenv() {
+            echo foo
+        }
+        gen_preboot() {
+            echo baz
+        }
+        FK_DEFAULTS=$mock_fk_defaults
+        saved_args=""
+        generated_script=""
+        mkarch="arm"
+        mkimage_script "0xdeadbeef" "desc" "$mock_script" "script" 2>/dev/null
+        expected="-A arm -O linux -T script -C none -a 0xdeadbeef -e 0xdeadbeef -n desc -d $tmpdir/$(basename $mock_script).out script"
+        expected_script="$(printf "setenv bootargs foo bar baz quux\n\nfoo\nbar\n\nbaz\nend")"
+        if [ "$expected" != "$saved_args" ]; then
+            echo "Expected mkimage_script to be called with \"$expected\" but it was called with \"$saved_args\"" >&2
+            exit 1
+        fi
+        if [ "$generated_script" != "$expected_script" ]; then
+            echo "The script generated by mkimage_script did not match the expected output" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_mkimage_script
+
 test_mkimage_multi() {
     (
         mkimage() {
@@ -689,6 +769,193 @@ test_dtb_append_from() {
 }
 add_test test_dtb_append_from
 
+test_abootimg_get_image_size() {
+    abootimg_output="
+
+Android Boot Image Info:
+
+* file name = boot.img
+
+* image size = 8388608 bytes (8.00 MB)
+  page size  = 2048 bytes
+
+* Boot Name = \"\"
+
+* kernel size       = 3002744 bytes (2.86 MB)
+  ramdisk size      = 1639626 bytes (1.56 MB)
+
+* load addresses:
+  kernel:       0x10008000
+  ramdisk:      0x11000000
+  tags:         0x10000100
+
+* cmdline = mem=448M@0M nvmem=64M@448M vmalloc=320M video=tegrafb console=tty0 usbcore.old_scheme_first=1 quiet splash elevator=noop tegraboot=sdmmc cmdpart=1:7168:10240,2:17408:16384,3:35840:614400,4:4004864:27096064
+
+* id = 0x07571070 0x13950a6a 0x185c996f 0x9ab7b64d 0xcccd09bd 0x00000000 0x00000000 0x00000000
+"
+    (
+        . "$functions"
+        size=$(abootimg_get_image_size "$abootimg_output")
+        if [ "$size" -ne 8388608 ]; then
+            echo "Expected 8388608 but got $size" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_abootimg_get_image_size
+
+test_android_flash() {
+    (
+        abootimg() {
+            saved_args="$@"
+        }
+        . "$functions"
+        saved_args=""
+        kfile="vmlinuz"
+        ifile="initrd.img"
+        android_flash /dev/some-dev 2>/dev/null
+        expected="-u /dev/some-dev -k vmlinuz -r initrd.img"
+        if [ "$expected" != "$saved_args" ]; then
+            echo "Expected abootimg to be called with \"$expected\" but it was called with \"$saved_args\"" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_android_flash
+
+test_include_only_flavors() {
+    available="\
+5.15.0-1023
+5.15.0-1023-generic
+5.15.0-1023-generic-64k
+5.15.0-1023-raspi
+5.15.0-1023-raspi-nolpae
+5.15.0-1024-raspi"
+    (
+        . "$functions"
+        expected_raspi="\
+5.15.0-1023-raspi
+5.15.0-1024-raspi"
+        expected_raspi_all="\
+5.15.0-1023-raspi
+5.15.0-1023-raspi-nolpae
+5.15.0-1024-raspi"
+        expected_generic_64k="\
+5.15.0-1023-generic-64k"
+        if [ "$(echo "$available" | include_only_flavors any)" != "$available" ]; then
+            echo "include_only_flavors failed with 'any' filter" >&2
+            exit 1
+        fi
+        if [ "$(echo "$available" | include_only_flavors raspi)" != "$expected_raspi" ]; then
+            echo "include_only_flavors failed with 'raspi' filter" >&2
+            exit 1
+        fi
+        if [ "$(echo "$available" | include_only_flavors raspi raspi-nolpae)" != "$expected_raspi_all" ]; then
+            echo "include_only_flavors failed with 'raspi raspi-nolpae' filter" >&2
+            exit 1
+        fi
+        if [ "$(echo "$available" | include_only_flavors generic-64k)" != "$expected_generic_64k" ]; then
+            echo "include_only_flavors failed with 'generic-64k' filter" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_include_only_flavors
+
+test_get_kernel_status() {
+    available="
+5.15.0-1021-generic /boot/vmlinuz-5.15.0-1021-generic
+5.15.0-1022-raspi /boot/vmlinuz-5.15.0-1022-raspi
+5.15.0-1022-raspi-nolpae /boot/vmlinuz-5.15.0-1022-raspi-nolpae
+5.15.0-1023-raspi /boot/vmlinuz-5.15.0-1023-raspi"
+    (
+        linux_version() {
+            case "$1" in
+                list)
+                    if [ "$2" = "--paths" ]; then
+                        echo "$available"
+                    else
+                        echo "$available" | while read -r ver path; do
+                            echo "$ver"
+                        done
+                    fi
+                    ;;
+                compare)
+                    case "$3" in
+                        eq) [ "$2" = "$4" ] ;;
+                        ne) [ "$2" != "$4" ] ;;
+                        *)
+                            echo "Unexpected arg in test-case"
+                            exit 1
+                            ;;
+                    esac
+                    ;;
+            esac
+        }
+        dpkg_query() {
+            case "$1" in
+                --search)
+                    shift
+                    while [ -n "$1" ]; do
+                        case "$1" in
+                            /boot/vmlinuz-5.15.0-*)
+                                echo "linux-image-${1#/boot/vmlinuz-}: $1"
+                                ;;
+                            *)
+                                echo "Unexpected arg in test-case"
+                                exit 1
+                                ;;
+                        esac
+                        shift
+                    done
+                    ;;
+                --show)
+                    shift
+                    while [ -n "$1" ]; do
+                        case "$1" in
+                            --showformat)
+                                shift
+                                ;;
+                            linux-image-5.15.0-1022-raspi*)
+                                echo -n installed
+                                ;;
+                            linux-image-5.15.0-1023-*)
+                                echo -n triggers-pending
+                                ;;
+                            linux-image-*)
+                                echo -n not-installed
+                                ;;
+                            *)
+                                echo "Unexpected arg in test-case"
+                                exit 1
+                                ;;
+                        esac
+                        shift
+                    done
+                    ;;
+            esac
+        }
+        # Can't define a function with a hyphen in the name but luckily, dash
+        # does permit them in alias names
+        alias dpkg-query=dpkg_query
+        alias linux-version=linux_version
+        . "$functions"
+        if [ "$(get_kernel_status 5.15.0-1022-raspi)" != "installed" ]; then
+            echo "get_kernel_status did not output the expected result" >&2
+            exit 1
+        fi
+        if [ "$(get_kernel_status 5.15.0-1023-raspi)" != "triggers-pending" ]; then
+            echo "get_kernel_status did not output the expected result" >&2
+            exit 1
+        fi
+        if [ "$(get_kernel_status 5.15.0-1021-generic)" != "not-installed" ]; then
+            echo "get_kernel_status did not output the expected result" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_get_kernel_status
+
 test_main
 
 # vim:syntax=sh
diff -pruN 3.109/test_functions-piboot 3.109ubuntu7/test_functions-piboot
--- 3.109/test_functions-piboot	1970-01-01 00:00:00.000000000 +0000
+++ 3.109ubuntu7/test_functions-piboot	2025-08-24 20:43:17.000000000 +0000
@@ -0,0 +1,887 @@
+#!/bin/sh
+
+# Copyright (C) 2011  Loïc Minier <lool@dooz.org>
+# Copyright (C) 2025 Dave Jones <dave.jones@canonical.com>
+
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+# Let the function library know that it is called from the testsuite.
+FK_TESTSUITE_RUNNING="yes"
+
+. ./testlib
+
+functions="${FK_CHECKOUT:-$FK_DIR}/functions"
+functions_piboot="${FK_CHECKOUT:-$FK_DIR}/functions-piboot"
+
+mock_bootloader_assets() {
+    local dir="$1"
+    local suffix="${2:-}"
+    mkdir -p "$dir"
+    touch \
+        "$dir"/bootcode.bin"$suffix" \
+        "$dir"/start.elf"$suffix" \
+        "$dir"/start4.elf"$suffix" \
+        "$dir"/fixup.dat"$suffix" \
+        "$dir"/fixup4.dat"$suffix"
+    # NOTE: this is a legacy config.txt; call mock_new_config (below) to adjust
+    # this to the new config.txt, where required
+    cat > "$dir"/config.txt"$suffix" << EOF
+[all]
+kernel=vmlinuz
+initramfs initrd.img followkernel
+cmdline=cmdline.txt
+
+# Enable serial pins
+enable_uart=1
+
+[pi4]
+max_framebuffers=2
+arm_boost=1
+
+[all]
+EOF
+}
+
+mock_new_config() {
+    local dir="$1"
+    local target="${2:-current}"
+    # Adjust existing $1/config.txt to point to $2/ (defaults to current)
+    awk -v target="$target" '
+    BEGIN { found_all=0; }
+    { print; }
+    /^\[all\]/ && found_all==0 { found_all=1; print "os_prefix=" target "/"; }
+    END { if (!found_all) { print "[all]"; print "os_prefix=" target "/"; } }
+    ' "$dir"/config.txt > "$dir"/config.new
+    mv "$dir"/config.new "$dir"/config.txt
+}
+
+mock_kernel_assets() {
+    local dir="$1"
+    local suffix="${2:-}"
+    mkdir -p "$dir"
+    touch \
+        "$dir"/vmlinuz"$suffix" \
+        "$dir"/initrd.img"$suffix" \
+        "$dir"/cmdline.txt"$suffix"
+}
+
+mock_device_trees() {
+    local dir="$1"
+    local suffix="${2:-}"
+    mkdir -p "$dir"
+    touch \
+        "$dir"/bcm2710-rpi-2-b.dtb"$suffix" \
+        "$dir"/bcm2710-rpi-3-b-plus.dtb"$suffix" \
+        "$dir"/bcm2711-rpi-4-b.dtb"$suffix" \
+        "$dir"/bcm2712d0-rpi-5-b.dtb"$suffix"
+}
+
+mock_device_tree_overlays() {
+    local dir="$1"
+    local suffix="${2:-}"
+    mkdir -p "$dir"/overlays
+    touch \
+        "$dir"/overlays/gpio-poweroff.dtbo"$suffix" \
+        "$dir"/overlays/w1-gpio.dtbo"$suffix" \
+        "$dir"/overlays/vc4-kms-v3d.dtbo"$suffix" \
+        "$dir"/overlays/overlay_map.dtb"$suffix" \
+        "$dir"/overlays/hat_map.dtb"$suffix" \
+        "$dir"/overlays/README"$suffix"
+}
+
+test_parse_find_opts() {
+    (
+        . "$functions"
+        . "$functions_piboot"
+        expected="suffix=.bak foo bar"
+        if [ "$(parse_find_opts foo --suffix .bak bar)" != "$expected" ]; then
+            echo "parse_find_opts did not output the expected arguments" >&2
+            exit 1
+        fi
+        if [ "$(parse_find_opts --suffix .bak foo bar)" != "$expected" ]; then
+            echo "parse_find_opts did not output the expected arguments" >&2
+            exit 1
+        fi
+        if [ "$(parse_find_opts foo bar -s .bak)" != "$expected" ]; then
+            echo "parse_find_opts did not output the expected arguments" >&2
+            exit 1
+        fi
+        if [ "$(parse_find_opts foo bar)" != "suffix= foo bar" ]; then
+            echo "parse_find_opts did not output the expected arguments" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_parse_find_opts
+
+test_unique_filenames() {
+    (
+        . "$functions"
+        . "$functions_piboot"
+        input="\
+/foo/quux
+/foo/bar
+/bar/quux"
+        expected="\
+/foo/quux
+/foo/bar"
+        if [ "$(echo "$input" | unique_filenames)" != "$expected" ]; then
+            echo "unique_filenames did not output the expected filenames" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_unique_filenames
+
+test_find_bootloader_assets() {
+    get_tempdir
+    bootloader_dir="$last_tempfile"
+    mock_bootloader_assets "$bootloader_dir"
+    expected="\
+$bootloader_dir/bootcode.bin
+$bootloader_dir/fixup.dat
+$bootloader_dir/fixup4.dat
+$bootloader_dir/start.elf
+$bootloader_dir/start4.elf"
+    (
+        . "$functions"
+        . "$functions_piboot"
+        if [ "$(find_bootloader_assets "$bootloader_dir" | sort)" != "$(echo "$expected" | sort)" ]; then
+            echo "find_bootloader_assets did not output the expected list of files" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_find_bootloader_assets
+
+test_find_bootloader_assets_with_suffix() {
+    get_tempdir
+    bootloader_dir="$last_tempfile"
+    mock_bootloader_assets "$bootloader_dir" ".bak"
+    expected="\
+$bootloader_dir/bootcode.bin.bak
+$bootloader_dir/start.elf.bak
+$bootloader_dir/start4.elf.bak
+$bootloader_dir/fixup.dat.bak
+$bootloader_dir/fixup4.dat.bak"
+    (
+        . "$functions"
+        . "$functions_piboot"
+        if [ "$(find_bootloader_assets --suffix .bak "$bootloader_dir" | sort)" != "$(echo "$expected" | sort)" ]; then
+            echo "find_bootloader_assets did not output the expected list of files" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_find_bootloader_assets_with_suffix
+
+test_find_device_trees() {
+    get_tempdir
+    firmware_dir="$last_tempfile"
+    kvers="3.14"
+    mkdir -p "$firmware_dir"/"$kvers"/device-tree/broadcom
+    mkdir -p "$firmware_dir"/"$kvers"/device-tree/overlays
+    mock_device_trees "$firmware_dir"/"$kvers"/device-tree/broadcom
+    mock_device_tree_overlays "$firmware_dir"/"$kvers"/device-tree/overlays
+    expected="\
+$firmware_dir/$kvers/device-tree/broadcom/bcm2710-rpi-2-b.dtb
+$firmware_dir/$kvers/device-tree/broadcom/bcm2710-rpi-3-b-plus.dtb
+$firmware_dir/$kvers/device-tree/broadcom/bcm2711-rpi-4-b.dtb
+$firmware_dir/$kvers/device-tree/broadcom/bcm2712d0-rpi-5-b.dtb"
+    (
+        . "$functions"
+        . "$functions_piboot"
+        if [ "$(find_device_trees "$firmware_dir"/"$kvers"/device-tree/broadcom | sort)" != "$(echo "$expected" | sort)" ]; then
+            echo "find_device_trees did not output the expected list of files" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_find_device_trees
+
+test_find_device_tree_overlays() {
+    get_tempdir
+    firmware_dir="$last_tempfile"
+    kvers="3.14"
+    mkdir -p "$firmware_dir"/"$kvers"/device-tree/broadcom
+    mock_device_trees "$firmware_dir"/"$kvers"/device-tree/broadcom
+    mock_device_tree_overlays "$firmware_dir"/"$kvers"/device-tree
+    expected="\
+$firmware_dir/$kvers/device-tree/overlays/gpio-poweroff.dtbo
+$firmware_dir/$kvers/device-tree/overlays/w1-gpio.dtbo
+$firmware_dir/$kvers/device-tree/overlays/vc4-kms-v3d.dtbo
+$firmware_dir/$kvers/device-tree/overlays/overlay_map.dtb
+$firmware_dir/$kvers/device-tree/overlays/hat_map.dtb
+$firmware_dir/$kvers/device-tree/overlays/README"
+    (
+        . "$functions"
+        . "$functions_piboot"
+        cd "$firmware_dir"
+        if [ "$(find_device_tree_overlays "$firmware_dir"/"$kvers"/device-tree | sort)" != "$(echo "$expected" | sort)" ]; then
+            echo "find_device_tree_overlays did not output the expected list of files" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_find_device_tree_overlays
+
+test_find_device_tree_overlays_with_suffix() {
+    get_tempdir
+    bootloader_dir="$last_tempfile"
+    mock_device_tree_overlays "$bootloader_dir" ".bak"
+    expected="\
+$bootloader_dir/overlays/gpio-poweroff.dtbo.bak
+$bootloader_dir/overlays/w1-gpio.dtbo.bak
+$bootloader_dir/overlays/vc4-kms-v3d.dtbo.bak
+$bootloader_dir/overlays/overlay_map.dtb.bak
+$bootloader_dir/overlays/hat_map.dtb.bak
+$bootloader_dir/overlays/README.bak"
+    (
+        . "$functions"
+        . "$functions_piboot"
+        if [ "$(find_device_tree_overlays --suffix .bak "$bootloader_dir" | sort)" != "$(echo "$expected" | sort)" ]; then
+            echo "find_device_tree_overlays did not output the expected list of files" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_find_device_tree_overlays_with_suffix
+
+test_find_kernel_assets_with_suffix() {
+    get_tempdir
+    bootloader_dir="$last_tempfile"
+    mock_kernel_assets "$bootloader_dir" ".bak"
+    expected="\
+$bootloader_dir/vmlinuz.bak
+$bootloader_dir/initrd.img.bak
+$bootloader_dir/cmdline.txt.bak"
+    (
+        . "$functions"
+        . "$functions_piboot"
+        if [ "$(find_kernel_assets --suffix .bak "$bootloader_dir" | sort)" != "$(echo "$expected" | sort)" ]; then
+            echo "find_kernel_assets did not output the expected list of files" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_find_kernel_assets_with_suffix
+
+test_atomic_cp() {
+    get_tempdir
+    test_dir="$last_tempfile"
+    echo foo > "$test_dir"/foo
+    echo bar > "$test_dir"/bar
+    (
+        . "$functions"
+        . "$functions_piboot"
+        if atomic_cp "$test_dir"/foo "$test_dir"/bar; then
+            if [ "$(cat "$test_dir"/foo)" != "foo" ]; then
+                echo "atomic_cp altered source" >&2
+                exit 1
+            fi
+            if [ "$(cat "$test_dir"/bar)" != "foo" ]; then
+                echo "atomic_cp failed to modify destination" >&2
+                exit 1
+            fi
+            if [ "$(ls "$test_dir")" != "$(echo "foo\nbar" | sort)" ]; then
+                echo "atomic_cp left temp assets in test_dir" >&2
+                exit 1
+            fi
+        else
+            echo "atomic_cp failed unexpectedly" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_atomic_cp
+
+test_atomic_cp_other_dir() {
+    get_tempdir
+    test_dir="$last_tempfile"
+    mkdir "$test_dir"/foo
+    echo bar > "$test_dir"/bar
+    echo foo > "$test_dir"/foo/bar
+    (
+        . "$functions"
+        . "$functions_piboot"
+        if atomic_cp "$test_dir"/bar "$test_dir"/foo; then
+            if [ "$(cat "$test_dir"/bar)" != "bar" ]; then
+                echo "atomic_cp altered source" >&2
+                exit 1
+            fi
+            if [ "$(cat "$test_dir"/foo/bar)" != "bar" ]; then
+                echo "atomic_cp failed to modify destination" >&2
+                exit 1
+            fi
+            if [ "$(ls "$test_dir")" != "$(echo "foo\nbar" | sort)" ]; then
+                echo "atomic_cp left temp assets in test_dir" >&2
+                exit 1
+            fi
+            if [ "$(ls "$test_dir"/foo)" != "bar" ]; then
+                echo "atomic_cp left temp assets in test_dir/foo" >&2
+                exit 1
+            fi
+        else
+            echo "atomic_cp failed unexpectedly" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_atomic_cp_other_dir
+
+test_atomic_cp_broken_cp() {
+    get_tempdir
+    test_dir="$last_tempfile"
+    echo foo > "$test_dir"/foo
+    echo bar > "$test_dir"/bar
+    (
+        cp() {
+            local src="$1"
+            local dest="$2"
+            head -c 1 "$src" > "$dest"
+            return 1
+        }
+        . "$functions"
+        . "$functions_piboot"
+        if atomic_cp "$test_dir"/foo "$test_dir"/bar; then
+            echo "atomic_cp did not fail as expected" >&2
+            exit 1
+        else
+            if [ "$(cat "$test_dir"/foo)" != "foo" ]; then
+                echo "atomic_cp altered source" >&2
+                exit 1
+            fi
+            if [ "$(cat "$test_dir"/bar)" != "bar" ]; then
+                echo "atomic_cp unexpectedly modified destination" >&2
+                exit 1
+            fi
+            if [ "$(ls "$test_dir")" != "$(echo "foo\nbar" | sort)" ]; then
+                echo "atomic_cp left temp assets in test_dir" >&2
+                exit 1
+            fi
+        fi
+    )
+}
+add_test test_atomic_cp_broken_cp
+
+test_atomic_cp_broken_mv() {
+    get_tempdir
+    test_dir="$last_tempfile"
+    echo foo > "$test_dir"/foo
+    echo bar > "$test_dir"/bar
+    (
+        mv() {
+            return 1
+        }
+        . "$functions"
+        . "$functions_piboot"
+        if atomic_cp "$test_dir"/foo "$test_dir"/bar; then
+            echo "atomic_cp did not fail as expected" >&2
+            exit 1
+        else
+            if [ "$(cat "$test_dir"/foo)" != "foo" ]; then
+                echo "atomic_cp altered source" >&2
+                exit 1
+            fi
+            if [ "$(cat "$test_dir"/bar)" != "bar" ]; then
+                echo "atomic_cp unexpectedly modified destination" >&2
+                exit 1
+            fi
+            if [ "$(ls "$test_dir")" != "$(echo "foo\nbar" | sort)" ]; then
+                echo "atomic_cp left temp assets in test_dir" >&2
+                exit 1
+            fi
+        fi
+    )
+}
+add_test test_atomic_cp_broken_mv
+
+test_set_state() {
+    get_tempdir
+    test_dir="$last_tempfile"
+    mkdir "$test_dir"/current
+    echo good > "$test_dir"/current/state
+    (
+        . "$functions"
+        . "$functions_piboot"
+        if set_state "$test_dir" current unknown; then
+            if [ "$(cat "$test_dir"/current/state)" != "unknown" ]; then
+                echo "set_state failed to alter state" >&2
+                exit 1
+            fi
+        else
+            echo "set_state failed unexpectedly" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_set_state
+
+test_set_state_broken_echo() {
+    get_tempdir
+    test_dir="$last_tempfile"
+    mkdir "$test_dir"/current
+    echo good > "$test_dir"/current/state
+    (
+        bad_echo() {
+            return 1
+        }
+        alias echo=bad_echo
+        . "$functions"
+        . "$functions_piboot"
+        if set_state "$test_dir" current unknown; then
+            unalias echo
+            echo "set_state did not fail as expected" >&2
+            exit 1
+        else
+            unalias echo
+            if [ "$(cat "$test_dir"/current/state)" != "good" ]; then
+                echo "set_state altered current/state unexpectedly" >&2
+                exit 1
+            fi
+            if [ "$(ls "$test_dir"/current)" != "state" ]; then
+                echo "set_state left temp assets in test_dir" >&2
+                exit 1
+            fi
+        fi
+    )
+}
+add_test test_set_state_broken_echo
+
+test_set_state_broken_mv() {
+    get_tempdir
+    test_dir="$last_tempfile"
+    mkdir "$test_dir"/current
+    echo good > "$test_dir"/current/state
+    (
+        mv() {
+            return 1
+        }
+        . "$functions"
+        . "$functions_piboot"
+        if set_state "$test_dir" current unknown; then
+            echo "set_state did not fail as expected" >&2
+            exit 1
+        else
+            if [ "$(cat "$test_dir"/current/state)" != "good" ]; then
+                echo "set_state altered current/state unexpectedly" >&2
+                exit 1
+            fi
+            if [ "$(ls "$test_dir"/current)" != "state" ]; then
+                echo "set_state left temp assets in test_dir" >&2
+                exit 1
+            fi
+        fi
+        export rc
+    )
+}
+add_test test_set_state_broken_mv
+
+test_needs_migrate() {
+    get_tempdir
+    bootloader_dir="$last_tempfile"
+    # Set up $bootloader_dir like a pre-migration state
+    mock_bootloader_assets "$bootloader_dir"
+    mock_bootloader_assets "$bootloader_dir" ".bak"
+    mock_kernel_assets "$bootloader_dir"
+    mock_kernel_assets "$bootloader_dir" ".bak"
+    mock_device_trees "$bootloader_dir"
+    mock_device_trees "$bootloader_dir" ".bak"
+    mock_device_tree_overlays "$bootloader_dir"
+    mock_device_tree_overlays "$bootloader_dir" ".bak"
+    rm "$bootloader_dir"/config.txt.bak
+    rm "$bootloader_dir"/cmdline.txt.bak
+    (
+        . "$functions"
+        . "$functions_piboot"
+        if ! needs_migrate "$bootloader_dir"; then
+            echo "needs_migrate unexpectedly returned false" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_needs_migrate
+
+test_migrate() {
+    get_tempdir
+    bootloader_dir="$last_tempfile"
+    # Set up $bootloader_dir like a pre-migration state
+    mock_bootloader_assets "$bootloader_dir"
+    mock_bootloader_assets "$bootloader_dir" ".bak"
+    mock_kernel_assets "$bootloader_dir"
+    mock_kernel_assets "$bootloader_dir" ".bak"
+    mock_device_trees "$bootloader_dir"
+    mock_device_trees "$bootloader_dir" ".bak"
+    mock_device_tree_overlays "$bootloader_dir"
+    mock_device_tree_overlays "$bootloader_dir" ".bak"
+    rm "$bootloader_dir"/config.txt.bak
+    rm "$bootloader_dir"/cmdline.txt.bak
+    (
+        sync() {
+            # Keep the tests quick
+            return 0
+        }
+        findmnt() {
+            echo /dev/mmcblk0p10
+            return 0
+        }
+        mount() {
+            mount_what="$1"
+            mount_where="$2"
+            cat > "$mount_where"/autoboot.txt << EOF
+[all]
+partition=1
+EOF
+            # Both mount and umount will execute in a sub-shell, so we need
+            # some we can't just read their variables
+            echo "$mount_what" > "$bootloader_dir"/env
+            return 0
+        }
+        umount() {
+            mv "$1"/autoboot.txt "$bootloader_dir"
+            return 0
+        }
+        . "$functions"
+        . "$functions_piboot"
+        migrate "$bootloader_dir" 2>/dev/null
+        if [ -e "$bootloader_dir"/*.bak ]; then
+            echo "migrate left backup files in the bootloader dir" >&2
+            ls "$bootloader_dir"
+            exit 1
+        fi
+        if ! [ -d "$bootloader_dir"/current ]; then
+            echo "migrate failed to create current/ directory" >&2
+            exit 1
+        fi
+        if ! grep -q "os_prefix=current/" "$bootloader_dir"/config.txt; then
+            echo "migrate failed to add os_prefix=current/" >&2
+            exit 1
+        fi
+        if ! grep -q "os_prefix=new/" "$bootloader_dir"/config.txt; then
+            echo "migrate failed to add os_prefix=new/" >&2
+            exit 1
+        fi
+        if ! grep -q "dtparam=watchdog=on" "$bootloader_dir"/config.txt; then
+            echo "migrate failed to add dtparam=watchdog" >&2
+            exit 1
+        fi
+        mount_what="$(cat "$bootloader_dir"/env)"
+        if [ "$mount_what" != "/dev/mmcblk0p1" ]; then
+            echo "mount_what = x${mount_what}x" >&2
+            echo "autoboot migration failed to mount first partition" >&2
+            exit 1
+        fi
+        if ! grep -q "tryboot_a_b=1" "$bootloader_dir"/autoboot.txt; then
+            echo "migrate failed to manipulate autoboot.txt" >&2
+            exit 1
+        fi
+        if needs_migrate "$bootloader_dir"; then
+            echo "needs_migrate unexpectedly returned true after migrate" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_migrate
+
+test_boot_service_reboot() {
+    get_tempdir
+    bootloader_dir="$last_tempfile"
+    # Set up $bootloader_dir like a post-migration state, with new assets to
+    # test
+    mock_bootloader_assets "$bootloader_dir"
+    mock_new_config "$bootloader_dir"
+    mock_bootloader_assets "$bootloader_dir"/current
+    rm "$bootloader_dir"/current/config.txt
+    mock_kernel_assets "$bootloader_dir"/current
+    mock_device_trees "$bootloader_dir"/current
+    mock_device_tree_overlays "$bootloader_dir"/current
+    mock_bootloader_assets "$bootloader_dir"/new
+    echo "good" > "$bootloader_dir"/current/state
+    rm "$bootloader_dir"/new/config.txt
+    mock_kernel_assets "$bootloader_dir"/new
+    mock_device_trees "$bootloader_dir"/new
+    mock_device_tree_overlays "$bootloader_dir"/new
+    echo "unknown" > "$bootloader_dir"/new/state
+    # Add some content to the kernel assets to test with
+    echo old > "$bootloader_dir"/current/vmlinuz
+    echo new > "$bootloader_dir"/new/vmlinuz
+
+    get_tempdir
+    FK_PROC_DT_BOOTLOADER="$last_tempfile"
+    # Set up /proc/device-tree/chosen/bootloader/tryboot with a "normal boot"
+    # state
+    printf '\000\000\000\000' > "$FK_PROC_DT_BOOTLOADER"/tryboot
+    printf '\000\000\000\012' > "$FK_PROC_DT_BOOTLOADER"/partition
+    (
+        sync() {
+            # Keep the tests quick
+            return 0
+        }
+        reboot() {
+            reboot_args="$1"
+            return 0
+        }
+        . "$functions"
+        . "$functions_piboot"
+        if ! boot_service_reboot "$bootloader_dir" 2>/dev/null; then
+            echo "boot_service_reboot failed unexpectedly" >&2
+            exit 1
+        else
+            if [ "$(cat "$bootloader_dir"/new/state)" != "trying" ]; then
+                echo "boot_service_reboot did not adjust new/state" >&2
+                exit 1
+            fi
+            if [ "$reboot_args" != "10 tryboot" ]; then
+                echo "boot_service_reboot did not call reboot with tryboot" >&2
+                exit 1
+            fi
+            if [ "$(cat "$bootloader_dir"/current/vmlinuz)" != "old" ]; then
+                echo "old kernel is not old after boot_service_reboot" >&2
+                exit 1
+            fi
+            if [ "$(cat "$bootloader_dir"/new/vmlinuz)" != "new" ]; then
+                echo "new kernel is not new after boot_service_reboot" >&2
+                exit 1
+            fi
+        fi
+    )
+}
+add_test test_boot_service_reboot
+
+test_boot_service_reboot_bad() {
+    get_tempdir
+    bootloader_dir="$last_tempfile"
+    # Set up $bootloader_dir like a post-migration state, with new assets set
+    # up as though during a boot test
+    mock_bootloader_assets "$bootloader_dir"
+    cp "$bootloader_dir"/config.txt "$bootloader_dir"/config.orig
+    mock_new_config "$bootloader_dir" "new"
+    mv "$bootloader_dir"/config.txt "$bootloader_dir"/tryboot.txt
+    mv "$bootloader_dir"/config.orig "$bootloader_dir"/config.txt
+    mock_bootloader_assets "$bootloader_dir"/current
+    rm "$bootloader_dir"/current/config.txt
+    mock_kernel_assets "$bootloader_dir"/current
+    mock_device_trees "$bootloader_dir"/current
+    mock_device_tree_overlays "$bootloader_dir"/current
+    mock_bootloader_assets "$bootloader_dir"/new
+    echo "good" > "$bootloader_dir"/current/state
+    rm "$bootloader_dir"/new/config.txt
+    mock_kernel_assets "$bootloader_dir"/new
+    mock_device_trees "$bootloader_dir"/new
+    mock_device_tree_overlays "$bootloader_dir"/new
+    echo "trying" > "$bootloader_dir"/new/state
+    # Add some content to the kernel assets to test with
+    echo old > "$bootloader_dir"/current/vmlinuz
+    echo new > "$bootloader_dir"/new/vmlinuz
+
+    get_tempdir
+    FK_PROC_DT_BOOTLOADER="$last_tempfile"
+    # Set up /proc/device-tree/chosen/bootloader/tryboot with a "normal boot"
+    # state
+    printf '\000\000\000\000' > "$FK_PROC_DT_BOOTLOADER"/tryboot
+    printf '\000\000\000\001' > "$FK_PROC_DT_BOOTLOADER"/partition
+    (
+        sync() {
+            # Keep the tests quick
+            return 0
+        }
+        reboot() {
+            reboot_args="$1"
+            # This should not be called by this test
+            return 1
+        }
+        . "$functions"
+        . "$functions_piboot"
+        # Marking "bad" is actually handled by the early service to avoid a
+        # race condition (see comments in boot_service_reboot function)
+        if ! boot_service_reboot "$bootloader_dir" 2>/dev/null; then
+            echo "boot_service_reboot failed unexpectedly" >&2
+            exit 1
+        else
+            if ! [ -d "$bootloader_dir"/new ]; then
+                echo "new directory was moved/removed" >&2
+                exit 1
+            fi
+            if [ -d "$bootloader_dir"/old ]; then
+                echo "old directory was created" >&2
+                exit 1
+            fi
+            if [ "$(cat "$bootloader_dir"/new/state)" != "bad" ]; then
+                echo "new/state is not good" >&2
+                exit 1
+            fi
+            if [ "$(cat "$bootloader_dir"/current/state)" != "good" ]; then
+                echo "current/state is not good" >&2
+                exit 1
+            fi
+            if [ "$reboot_args" != "" ]; then
+                echo "boot_service_reboot called reboot unexpectedly" >&2
+                exit 1
+            fi
+        fi
+    )
+}
+add_test test_boot_service_reboot_bad
+
+test_boot_service_validate_good() {
+    get_tempdir
+    bootloader_dir="$last_tempfile"
+    # Set up $bootloader_dir like a post-migration state, with new assets set
+    # up as though during a boot test
+    mock_bootloader_assets "$bootloader_dir"
+    cp "$bootloader_dir"/config.txt "$bootloader_dir"/config.orig
+    mock_new_config "$bootloader_dir" "new"
+    mv "$bootloader_dir"/config.txt "$bootloader_dir"/tryboot.txt
+    mv "$bootloader_dir"/config.orig "$bootloader_dir"/config.txt
+    mock_bootloader_assets "$bootloader_dir"/current
+    rm "$bootloader_dir"/current/config.txt
+    mock_kernel_assets "$bootloader_dir"/current
+    mock_device_trees "$bootloader_dir"/current
+    mock_device_tree_overlays "$bootloader_dir"/current
+    mock_bootloader_assets "$bootloader_dir"/new
+    echo "good" > "$bootloader_dir"/current/state
+    rm "$bootloader_dir"/new/config.txt
+    mock_kernel_assets "$bootloader_dir"/new
+    mock_device_trees "$bootloader_dir"/new
+    mock_device_tree_overlays "$bootloader_dir"/new
+    echo "trying" > "$bootloader_dir"/new/state
+    # Add some content to the kernel assets to test with
+    echo old > "$bootloader_dir"/current/vmlinuz
+    echo new > "$bootloader_dir"/new/vmlinuz
+
+    get_tempdir
+    FK_PROC_DT_BOOTLOADER="$last_tempfile"
+    FK_ETC_VALIDATE="${FK_CHECKOUT}/etc/piboot-validate"
+    # Set up /proc/device-tree/chosen/bootloader/tryboot with a tryboot active
+    # state
+    printf '\000\000\000\001' > "$FK_PROC_DT_BOOTLOADER"/tryboot
+    printf '\000\000\000\001' > "$FK_PROC_DT_BOOTLOADER"/partition
+    (
+        sync() {
+            # Keep the tests quick
+            return 0
+        }
+        reboot() {
+            reboot_args="$1"
+            # This should not be called by this test
+            return 1
+        }
+        . "$functions"
+        . "$functions_piboot"
+        if ! boot_service_validate "$bootloader_dir" 2>/dev/null; then
+            echo "boot_service_validate failed unexpectedly" >&2
+            exit 1
+        else
+            if [ -d "$bootloader_dir"/new ]; then
+                echo "new directory was not moved/removed" >&2
+                exit 1
+            fi
+            if ! [ -d "$bootloader_dir"/old ]; then
+                echo "old directory was not created" >&2
+                exit 1
+            fi
+            if [ "$(cat "$bootloader_dir"/old/state)" != "good" ]; then
+                echo "old/state is not good" >&2
+                exit 1
+            fi
+            if [ "$(cat "$bootloader_dir"/current/state)" != "good" ]; then
+                echo "current/state is not good" >&2
+                exit 1
+            fi
+            if [ "$reboot_args" != "" ]; then
+                echo "boot_service_validate called reboot unexpectedly" >&2
+                exit 1
+            fi
+        fi
+    )
+}
+add_test test_boot_service_validate_good
+
+test_piboot_try_help() {
+    get_tempfile
+    output="$last_tempfile"
+    (
+        . "$functions"
+        . "$functions_piboot"
+
+        piboot_try --help | head -n 1 > "$output"
+        if ! grep -q "^Usage:" "$output"; then
+            echo "piboot-try --help output did not start with Usage:"
+            exit 1
+        fi
+    )
+}
+add_test test_piboot_try_help
+
+test_piboot_try_bad_ops() {
+    (
+        . "$functions"
+        . "$functions_piboot"
+
+        if piboot_try --test --validate 2>/dev/null; then
+            echo "piboot-try succeeded when it should not"
+            exit 1
+        fi
+    )
+}
+add_test test_piboot_try_bad_ops
+
+test_piboot_try_status() {
+    get_tempdir
+    bootloader_dir="$last_tempfile"
+    # Set up $bootloader_dir like a post-migration state, with new assets set
+    # up as though after a failed test
+    mock_bootloader_assets "$bootloader_dir"
+    cp "$bootloader_dir"/config.txt "$bootloader_dir"/config.orig
+    mock_new_config "$bootloader_dir" "new"
+    mv "$bootloader_dir"/config.txt "$bootloader_dir"/tryboot.txt
+    mv "$bootloader_dir"/config.orig "$bootloader_dir"/config.txt
+    mock_bootloader_assets "$bootloader_dir"/current
+    rm "$bootloader_dir"/current/config.txt
+    mock_kernel_assets "$bootloader_dir"/current
+    mock_device_trees "$bootloader_dir"/current
+    mock_device_tree_overlays "$bootloader_dir"/current
+    mock_bootloader_assets "$bootloader_dir"/new
+    echo "good" > "$bootloader_dir"/current/state
+    rm "$bootloader_dir"/new/config.txt
+    mock_kernel_assets "$bootloader_dir"/new
+    mock_device_trees "$bootloader_dir"/new
+    mock_device_tree_overlays "$bootloader_dir"/new
+    echo "bad" > "$bootloader_dir"/new/state
+    # Add some content to the kernel assets to test with
+    echo old > "$bootloader_dir"/current/vmlinuz
+    echo new > "$bootloader_dir"/new/vmlinuz
+
+    get_tempdir
+    FK_PROC_DT_BOOTLOADER="$last_tempfile"
+    # Set up /proc/device-tree/chosen/bootloader/tryboot with a "normal boot"
+    # state
+    printf '\000\000\000\000' > "$FK_PROC_DT_BOOTLOADER"/tryboot
+    printf '\000\000\000\001' > "$FK_PROC_DT_BOOTLOADER"/partition
+    (
+        . "$functions"
+        . "$functions_piboot"
+
+        if ! piboot_try --status | grep -q "New boot assets .* failed"; then
+            echo "piboot-try --status did not report failure"
+            exit 1
+        fi
+    )
+}
+
+test_main
+
+# vim:syntax=sh
diff -pruN 3.109/testlib 3.109ubuntu7/testlib
--- 3.109/testlib	2022-03-23 14:22:28.000000000 +0000
+++ 3.109ubuntu7/testlib	2025-08-04 11:01:38.000000000 +0000
@@ -70,7 +70,7 @@ last_tempfile=""
 cleanup_tempfiles(){
     for t in $tempfiles "$last_tempfile"; do
         if [ -n "$t" ]; then
-            rm -f "$t"
+            rm -rf "$t"
         fi
     done
 }
@@ -81,6 +81,11 @@ get_tempfile() {
     tempfiles="$tempfiles $last_tempfile"
 }
 
+get_tempdir() {
+    last_tempfile="$(mktemp -d -t "$self.XXXXXXXX")"
+    tempfiles="$tempfiles $last_tempfile"
+}
+
 
 test_main() {
     if [ $# = 0 ]; then
