diff -pruN 3.106/bootscript/all/bootscr.exynos5 3.106ubuntu4/bootscript/all/bootscr.exynos5
--- 3.106/bootscript/all/bootscr.exynos5	1970-01-01 00:00:00.000000000 +0000
+++ 3.106ubuntu4/bootscript/all/bootscr.exynos5	2022-05-17 13:58:15.000000000 +0000
@@ -0,0 +1,10 @@
+echo Starting Ubuntu...
+setenv bootargs console=ttySAC0,115200 nosplash mem=2048M@0x80000000 mem=6144M@0x100000000
+sata init
+test -n "$kernel_addr_r" || setenv kernel_addr_r 0x80007000
+test -n "$ramdisk_addr_r" || setenv ramdisk_addr_r 0x81000000
+test -n "$fdt_addr_r" || setenv fdt_addr_r 0x82000000
+ext2load sata 0 $kernel_addr_r uImage
+ext2load sata 0 $ramdisk_addr_r uInitrd
+imi $ramdisk_addr_r || setenv ramdisk_addr_r -
+bootm $kernel_addr_r $ramdisk_addr_r
diff -pruN 3.106/bootscript/all/bootscr.rpi 3.106ubuntu4/bootscript/all/bootscr.rpi
--- 3.106/bootscript/all/bootscr.rpi	1970-01-01 00:00:00.000000000 +0000
+++ 3.106ubuntu4/bootscript/all/bootscr.rpi	2022-06-15 14:21:33.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.106/bootscript/all/bootscr.xgene 3.106ubuntu4/bootscript/all/bootscr.xgene
--- 3.106/bootscript/all/bootscr.xgene	1970-01-01 00:00:00.000000000 +0000
+++ 3.106ubuntu4/bootscript/all/bootscr.xgene	2022-05-17 13:58:47.000000000 +0000
@@ -0,0 +1,5 @@
+setenv bootargs "console=ttyS0,${baudrate}n8r ro"
+@@UBOOT_ENV_EXTRA@@
+load scsi 0 ${kernel_addr_r} uImage
+load scsi 0 ${ramdisk_addr_r} uInitrd
+bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
diff -pruN 3.106/bootscript/all/bootscr.xgene-mustang 3.106ubuntu4/bootscript/all/bootscr.xgene-mustang
--- 3.106/bootscript/all/bootscr.xgene-mustang	1970-01-01 00:00:00.000000000 +0000
+++ 3.106ubuntu4/bootscript/all/bootscr.xgene-mustang	2022-05-17 13:58:47.000000000 +0000
@@ -0,0 +1,6 @@
+setenv bootargs 'console=ttyS0,115200n8 ro'
+@@UBOOT_ENV_EXTRA@@
+ext4load scsi 0 ${kernel_addr_r} uImage
+ext4load scsi 0 ${ramdisk_addr_r} uInitrd
+ext4load scsi 0 ${fdt_addr_r} apm-mustang.dtb
+bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
diff -pruN 3.106/bootscript/arm64/bootscr.mediatek-aiot 3.106ubuntu4/bootscript/arm64/bootscr.mediatek-aiot
--- 3.106/bootscript/arm64/bootscr.mediatek-aiot	1970-01-01 00:00:00.000000000 +0000
+++ 3.106ubuntu4/bootscript/arm64/bootscr.mediatek-aiot	2022-06-15 14:21:33.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.106/bootscript/arm64/bootscr.zynqmp 3.106ubuntu4/bootscript/arm64/bootscr.zynqmp
--- 3.106/bootscript/arm64/bootscr.zynqmp	1970-01-01 00:00:00.000000000 +0000
+++ 3.106ubuntu4/bootscript/arm64/bootscr.zynqmp	2022-07-14 12:19:57.000000000 +0000
@@ -0,0 +1,184 @@
+# 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/111
+#
+# 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    |
+#
+################
+
+@@UBOOT_ENV_EXTRA@@
+
+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
+
+		# 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
+		# Check for KR/KV260 board and choose the proper device tree
+		if test "${card1_name}" = "SCK-KV-G" || test "${card1_name}" = "SCK-KR-G"; then
+			setenv kria 1
+			echo "Selecting DT for Kria boards"
+			if test "${card1_name}" = "SCK-KV-G"; then
+				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"; then
+					# revB dtb also supports rev1 boards
+					boot_conf=#conf-smk-k26-revA-sck-kv-g-revB
+				fi
+			elif test "${card1_name}" = "SCK-KR-G"; then
+				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
+				fi
+			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 "earlycon root=LABEL=writable rootwait"
+		if test "${card1_name}" = "SCK-KR-G" || test "${card1_name}" = "SCK-KV-G"; then
+			setenv bootargs "${bootargs} 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} 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*
+		fdt get value model_test / model
+		if  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"
+		else
+			# zcu102, zcu111
+			cma="1000M"
+		fi
+		echo "cma=${cma}"
+		setenv bootargs "${bootargs} cma=${cma}"
+
+		# 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.106/bootscript/armhf/bootscr.armadaxp 3.106ubuntu4/bootscript/armhf/bootscr.armadaxp
--- 3.106/bootscript/armhf/bootscr.armadaxp	1970-01-01 00:00:00.000000000 +0000
+++ 3.106ubuntu4/bootscript/armhf/bootscr.armadaxp	2022-05-17 13:58:05.000000000 +0000
@@ -0,0 +1,42 @@
+echo Starting Ubuntu...
+if test -n ${fs} && test -n ${interface} && test -n ${device} && test -n ${prefix}; then
+	${fs}load ${interface} ${device} 0x02000000 ${prefix}uImage
+	${fs}load ${interface} ${device} 0x20000000 ${prefix}uInitrd
+	setenv bootargs  ro quiet splash
+	bootm 0x02000000 0x20000000
+fi
+
+echo boot information not recieved from u-boot, scanning for startup device
+
+if test -e ${reinitalize_devices}; then
+	usb start;
+	ide reset;
+fi
+
+for i in usb ide; do
+	for j in 0 1; do
+		for l in / /boot/; do
+			for m in fat ext2; do
+				setenv interface $i;
+				setenv device $j;
+				setenv prefix $l;
+				setenv fs $m;
+
+				echo Scanning ${fs} ${interface} ${device} on prefix ${prefix} ...;
+
+				# This "if" avoids loading an old image but
+				# doesn't work in stock u-boot 1.3.4 and is
+				# only fixed in Canonical u-boot from October
+				# 1st or later
+
+				if ${fs}load ${interface} ${device} 0x1000 ${prefix}boot.scr; then
+					if imi 0x1000; then
+						echo boot.scr found! Executing ...;
+						autoscr 0x1000;
+					fi;
+				fi
+			done;
+		done;
+	done;
+done
+echo No boot device found.;
diff -pruN 3.106/bootscript/armhf/bootscr.highbank 3.106ubuntu4/bootscript/armhf/bootscr.highbank
--- 3.106/bootscript/armhf/bootscr.highbank	2022-03-23 14:22:28.000000000 +0000
+++ 3.106ubuntu4/bootscript/armhf/bootscr.highbank	2022-05-17 13:58:04.000000000 +0000
@@ -1,5 +1,7 @@
-setenv bootargs @@LINUX_KERNEL_CMDLINE_DEFAULTS@@ ${bootargs} @@LINUX_KERNEL_CMDLINE@@
-@@UBOOT_ENV_EXTRA@@
-ext2load scsi 0 ${kernel_addr_r} vmlinuz
-ext2load scsi 0 ${ramdisk_addr_r} initrd.img
-bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr}
+echo Starting Ubuntu...
+setenv bootargs console=ttyAMA0 nosplash
+mw.l 800000 0 10000
+scsi scan
+ext2load scsi 0 0x800000 vmlinuz
+ext2load scsi 0 0x2000000 initrd.img
+bootz 0x800000 0x2000000:${filesize} 0x1000
diff -pruN 3.106/bootscript/armhf/bootscr.keystone2 3.106ubuntu4/bootscript/armhf/bootscr.keystone2
--- 3.106/bootscript/armhf/bootscr.keystone2	1970-01-01 00:00:00.000000000 +0000
+++ 3.106ubuntu4/bootscript/armhf/bootscr.keystone2	2022-05-17 13:58:47.000000000 +0000
@@ -0,0 +1,5 @@
+setenv bootargs "console=ttyS0,${baudrate}n8r ro pci=firmware rio-scan.static_enum=1 rio-scan.scan=0"
+@@UBOOT_ENV_EXTRA@@
+load scsi 0 ${kernel_addr_r} vmlinuz
+load scsi 0 ${ramdisk_addr_r} initrd.img
+bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
diff -pruN 3.106/bootscript/armhf/bootscr.omap 3.106ubuntu4/bootscript/armhf/bootscr.omap
--- 3.106/bootscript/armhf/bootscr.omap	2022-03-23 14:22:28.000000000 +0000
+++ 3.106ubuntu4/bootscript/armhf/bootscr.omap	2022-05-17 14:01:29.000000000 +0000
@@ -1,4 +1,4 @@
 fatload mmc 0:1 0x82000000 uImage
 fatload mmc 0:1 0x83000000 uInitrd
-setenv bootargs ro
+setenv bootargs ro quiet splash
 bootm 0x82000000 0x83000000
diff -pruN 3.106/bootscript/armhf/uEnvtxt.omap 3.106ubuntu4/bootscript/armhf/uEnvtxt.omap
--- 3.106/bootscript/armhf/uEnvtxt.omap	1970-01-01 00:00:00.000000000 +0000
+++ 3.106ubuntu4/bootscript/armhf/uEnvtxt.omap	2022-05-17 14:01:29.000000000 +0000
@@ -0,0 +1,2 @@
+bootcmd=fatload mmc 0:1 0x80000000 uImage;fatload mmc 0:1 0x81600000 uInitrd; bootm 0x80000000 0x81600000
+uenvcmd=boot
diff -pruN 3.106/bootscript/armhf/uEnvtxt.wandboard 3.106ubuntu4/bootscript/armhf/uEnvtxt.wandboard
--- 3.106/bootscript/armhf/uEnvtxt.wandboard	1970-01-01 00:00:00.000000000 +0000
+++ 3.106ubuntu4/bootscript/armhf/uEnvtxt.wandboard	2022-05-17 14:12:20.000000000 +0000
@@ -0,0 +1,6 @@
+loadpreenv=load mmc ${mmcdev}:${mmcpart} 0x12000000 preenv.txt; env import -t 0x12000000 ${filesize}
+loadkernel=load mmc ${mmcdev}:${mmcpart} 0x12000000 uImage
+loadinitrd=load mmc ${mmcdev}:${mmcpart} 0x12A00000 uInitrd
+
+bootcmd=run loadpreenv; run loadkernel; run loadinitrd; bootm 0x12000000 0x12A00000
+uenvcmd=boot
diff -pruN 3.106/db/all.db 3.106ubuntu4/db/all.db
--- 3.106/db/all.db	2022-04-22 23:48:49.000000000 +0000
+++ 3.106ubuntu4/db/all.db	2022-07-14 12:19:57.000000000 +0000
@@ -29,6 +29,13 @@ DTB-Id: sun8i-a83t-allwinner-h8homlet-v2
 U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
+Machine: Allwinner D1 Nezha
+Kernel-Flavors: allwinner riscv64
+DTB-Id: allwinner/sun20i-d1-nezha.dtb
+Boot-Script-Path: /boot/boot.scr
+U-Boot-Script-Name: bootscr.uboot-generic
+Required-Packages: u-boot-tools
+
 Machine: Allwinner GA10H Quad Core Tablet (v1.1)
 Kernel-Flavors: armmp armmp-lpae
 Boot-Script-Path: /boot/boot.scr
@@ -57,10 +64,15 @@ U-Boot-Script-Address: 0x4004000000
 U-Boot-Script-Name: bootscr.xgene-mustang
 Boot-Kernel-Path: /boot/uImage
 Boot-Initrd-Path: /boot/uInitrd
+Boot-DTB-Path: /boot/apm-mustang.dtb
 Boot-Script-Path: /boot/boot.scr
 Required-Packages: u-boot-tools
 DTB-Id: apm-mustang.dtb
 
+Machine: Asus NovaGo TP370QL
+Kernel-Flavors: arm64
+DTB-Id: qcom/msm8998-asus-novago-tp370ql.dtb
+
 Machine: Auxtek t003 A10s hdmi tv-stick
 Kernel-Flavors: armmp
 Boot-Script-Path: /boot/boot.scr
@@ -278,11 +290,17 @@ Boot-Initrd-Path: /boot/initrd.buffalo
 Required-Packages: u-boot-tools
 Bootloader-Sets-Incorrect-Root: yes
 
-Machine: Calxeda Highbank
-Kernel-Flavors: armmp
+Machine: Calxeda ECX-2000
+Kernel-Flavors: generic-lpae generic highbank
+Required-Packages: u-boot-tools
 Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.highbank
+
+Machine: Calxeda Highbank
+Kernel-Flavors: generic highbank
 Required-Packages: u-boot-tools
+Boot-Script-Path: /boot/boot.scr
+U-Boot-Script-Name: bootscr.highbank
 
 Machine: Chuwi V7 CW0825
 Kernel-Flavors: armmp
@@ -386,6 +404,9 @@ DTB-Id: sun4i-a10-dserve-dsrv9703c.dtb
 U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
+## qemu instance on armhf
+Machine: Dummy Virtual Machine
+
 Machine: Empire Electronix D709 tablet
 Kernel-Flavors: armmp
 Boot-Script-Path: /boot/boot.scr
@@ -421,6 +442,9 @@ Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
+## ARMv8 Foundation Model
+Machine: Foundation-v8A
+
 Machine: Freescale i.MX53 Quick Start Board
 Machine: Freescale MX53 LOCO Board
 Kernel-Flavors: armmp mx5
@@ -555,6 +579,12 @@ Boot-Initrd-Path: uInitrd
 Boot-DTB-Path: dtb
 Required-Packages: u-boot-tools
 
+Machine: grouper
+Method: android
+Android-Boot-Device: /dev/mmcblk0
+Required-Packages: abootimg
+Bootloader-sets-root: yes
+
 Machine: GTA02
 Method: multi
 Kernel-Flavors: s3c24xx
@@ -633,6 +663,10 @@ Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
+Machine: HP Envy x2
+Kernel-Flavors: arm64
+DTB-Id: qcom/msm8998-hp-envy-x2.dtb
+
 Machine: HP Media Vault mv2120
 Kernel-Flavors: orion5x marvell
 Machine-Id: 1693
@@ -644,6 +678,21 @@ Optional-Packages: mv2120-utils
 Required-Packages: u-boot-tools
 Bootloader-Sets-Incorrect-Root: yes
 
+Machine: HP ProLiant m400 Server Cartridge
+U-Boot-Kernel-Address: 0x80000
+U-Boot-Initrd-Address: 0x0
+U-Boot-Script-Address: 0x4004000000
+U-Boot-Script-Name: bootscr.xgene
+Required-Packages: u-boot-tools
+Boot-Kernel-Path: /boot/uImage
+# A kernel too large can over-run the firmware-provided dtb
+# ${fdt_addr_r} - ${kern_addr_r} - uImageEnvelope =
+# 0x4003000000  - 0x4002000000   - 64
+Boot-Kernel-Max-Size: 16777152
+Boot-Initrd-Path: /boot/uInitrd
+Boot-Script-Path: /boot/boot.scr
+Bootloader-Has-Broken-Ext4-Extent-Support: yes
+
 Machine: HP t5325 Thin Client
 Kernel-Flavors: kirkwood marvell
 DTB-Id: kirkwood-t5325.dtb
@@ -895,6 +944,14 @@ DTB-Id: sun7i-a20-bananapro.dtb
 U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
+Machine: Lenovo Miix 630
+Kernel-Flavors: arm64
+DTB-Id: qcom/msm8998-lenovo-miix-630.dtb
+
+Machine: Lenovo Yoga C630
+Kernel-Flavors: arm64
+DTB-Id: qcom/sdm850-lenovo-yoga-c630.dtb
+
 Machine: Lichee Pi Zero
 Kernel-Flavors: armmp armmp-lpae
 Boot-Script-Path: /boot/boot.scr
@@ -923,6 +980,9 @@ DTB-Id: sun7i-a20-pcduino3-nano.dtb
 U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
+## qemu instance on arm64
+Machine: linux,dummy-virt
+
 Machine: Marvell 8040 MACCHIATOBin
 Machine: Marvell 8040 MACCHIATOBin Double-shot
 Machine: Marvell 8040 MACHIATOBin
@@ -931,6 +991,7 @@ 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
+Bootloader-sets-root: no
 
 Machine: Marvell 8040 MACCHIATOBin Single-shot
 Kernel-Flavors: arm64
@@ -946,6 +1007,16 @@ Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
+Machine: Marvell Armada XP Development Board
+Kernel-Flavors: armadaxp
+U-Boot-Kernel-Address: 0x8000
+U-Boot-Initrd-Address: 0x0
+U-Boot-Script-Address: 0x1000
+U-Boot-Script-Name: bootscr.armadaxp
+Boot-Kernel-Path: /boot/uImage
+Boot-Initrd-Path: /boot/uInitrd
+Required-Packages: u-boot-tools
+
 # Marvell dev board has different names depending on how it's booted,
 # via DTB or older ATAGS
 Machine: Marvell Armada XP GP Board
@@ -1300,17 +1371,34 @@ Machine: OLPC XO-1.75
 Kernel-Flavors: armmp
 Method: olpc
 
+Machine: OMAP3 Beagle Board
+Method: generic
+U-Boot-Kernel-Address: 0x80008000
+U-Boot-Initrd-Address: 0x0
+U-Boot-Script-Address: 0x0
+U-Boot-Script-Name: uEnvtxt.omap
+Boot-Device: /dev/mmcblk0p1
+Boot-Kernel-Path: uImage
+Boot-Initrd-Path: uInitrd
+Boot-Script-Path: preEnv.txt
+Required-Packages: u-boot-tools
+Bootloader-sets-root: yes
+
 Machine: OMAP4 Panda board
+Machine: TI OMAP4 PandaBoard
 Method: generic
 U-Boot-Kernel-Address: 0x80008000
 U-Boot-Initrd-Address: 0x0
 U-Boot-Script-Address: 0x0
-U-Boot-Script-Name: bootscr.omap
+U-Boot-Script-Name: uEnvtxt.omap
 Boot-Device: /dev/mmcblk0p1
 Boot-Kernel-Path: uImage
 Boot-Initrd-Path: uInitrd
-Boot-Script-Path: boot.scr
+Boot-Script-Path: preEnv.txt
 Required-Packages: u-boot-tools
+Bootloader-sets-root: yes
+DTB-Append-From: 3.11
+DTB-Id: omap4-panda-es.dtb
 
 Machine: Orange Pi
 Kernel-Flavors: armmp armmp-lpae
@@ -1448,6 +1536,15 @@ 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
 DTB-Id: freescale/imx8mq-librem5-devkit.dtb
@@ -1503,6 +1600,20 @@ DTB-Id: sun8i-a33-q8-tablet.dtb
 U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
+Machine: QCT APQ8064 CDP
+Kernel-Flavors: link-sbc-apq8064
+Method: android
+Android-Boot-Device: /dev/disk/by-partlabel/boot
+Required-Packages: abootimg
+Bootloader-sets-root: yes
+
+Machine: QCT APQ8064 MAKO
+Method: android
+Android-Boot-Device: /dev/block/platform/msm_sdcc.1/by-name/boot
+Android-Skip-Initrd: yes
+Required-Packages: abootimg
+Bootloader-sets-root: yes
+
 Machine: QNAP TS-109/TS-209
 Kernel-Flavors: orion5x marvell
 Machine-Id: 1565
@@ -1628,33 +1739,81 @@ 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
+Machine: Raspberry Pi 2 Model B
+Machine: Raspberry Pi 2 Model B Rev 1.1
+Machine: Raspberry Pi 2 Model B Rev 1.2
+Kernel-Flavors: raspi raspi-nolpae
+Method: pi
+DTB-Id: bcm2709-rpi-2-b.dtb
+U-Boot-Script-Name: bootscr.rpi
+Required-Packages: u-boot-tools
+
+Machine: Raspberry Pi 3 Model A+
+Machine: Raspberry Pi 3 Model A Plus
+Machine: Raspberry Pi 3 Model A Plus Rev 1.0
+Kernel-Flavors: raspi raspi-nolpae
+Method: pi
+DTB-Id: bcm2710-rpi-3-b-plus.dtb
+U-Boot-Script-Name: bootscr.rpi
 Required-Packages: u-boot-tools
-Boot-Script-Path: /boot/boot.scr
+# 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
+Machine: Raspberry Pi 3 Model B Rev 1.2
+Kernel-Flavors: raspi raspi-nolpae
+Method: pi
+DTB-Id: bcm2710-rpi-3-b.dtb
+U-Boot-Script-Name: bootscr.rpi
 Required-Packages: u-boot-tools
-Boot-Script-Path: /boot/boot.scr
 
 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
+Machine: Raspberry Pi 3 Model B Plus
+Machine: Raspberry Pi 3 Model B Plus Rev 1.3
+Kernel-Flavors: raspi raspi-nolpae
+Method: pi
+DTB-Id: bcm2710-rpi-3-b-plus.dtb
+U-Boot-Script-Name: bootscr.rpi
+Required-Packages: u-boot-tools
+
+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 *
+Kernel-Flavors: raspi raspi-nolpae
+Method: pi
+DTB-Id: bcm2711-rpi-4-b.dtb
+U-Boot-Script-Name: bootscr.rpi
+Required-Packages: u-boot-tools
+
+Machine: Raspberry Pi 400 Rev 1.0
+Machine: Raspberry Pi 400 Rev 1.1
+Kernel-Flavors: raspi raspi-nolpae
+Method: pi
+DTB-Id: bcm2711-rpi-400.dtb
+U-Boot-Script-Name: bootscr.rpi
+Required-Packages: u-boot-tools
+
+Machine: Raspberry Pi Compute Module 3 Rev 1.0
+Machine: Raspberry Pi Compute Module 3 Plus Rev 1.0
+Kernel-Flavors: raspi raspi-nolpae
+Method: pi
+DTB-Id: bcm2710-rpi-cm3.dtb
+U-Boot-Script-Name: bootscr.rpi
+Required-Packages: u-boot-tools
+
+Machine: Raspberry Pi Compute Module 4 Rev 1.0
+Kernel-Flavors: raspi raspi-nolpae
+Method: pi
+DTB-Id: bcm2711-rpi-cm4.dtb
+U-Boot-Script-Name: bootscr.rpi
 Required-Packages: u-boot-tools
-Boot-Script-Path: /boot/boot.scr
 
 Machine: Raspberry Pi Zero
 Kernel-Flavors: rpi
@@ -1670,6 +1829,9 @@ U-Boot-Script-Name: bootscr.uboot-generi
 Required-Packages: u-boot-tools
 Boot-Script-Path: /boot/boot.scr
 
+## qemu instance on risc-v
+Machine: riscv-virtio,qemu
+
 Machine: Rockchip RK3288 Tinker Board
 Kernel-Flavors: armmp armmp-lpae
 DTB-Id: rk3288-tinker.dtb
@@ -1684,6 +1846,34 @@ Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
+Machine: SAMSUNG SD5v1 board based on EXYNOS5440
+Kernel-Flavors: exynos5 generic
+U-Boot-Kernel-Address: 0x80008000
+U-Boot-Initrd-Address: 0x80000000
+U-Boot-Script-Address: 0x80001000
+U-Boot-Script-Name: bootscr.exynos5
+DTB-Id: exynos5440-sd5v1.dtb
+DTB-Append-From: 3.11
+Boot-Kernel-Path: /boot/uImage
+Boot-Initrd-Path: /boot/uInitrd
+Boot-Script-Path: /boot/boot.scr
+Required-Packages: u-boot-tools
+Bootloader-sets-root: no
+
+Machine: SAMSUNG SSDK5440 board based on EXYNOS5440
+Kernel-Flavors: exynos5 exynos generic
+U-Boot-Kernel-Address: 0x80008000
+U-Boot-Initrd-Address: 0x80000000
+U-Boot-Script-Address: 0x80001000
+U-Boot-Script-Name: bootscr.exynos5
+DTB-Id: exynos5440-ssdk5440.dtb
+DTB-Append-From: 3.11
+Boot-Kernel-Path: /boot/uImage
+Boot-Initrd-Path: /boot/uInitrd
+Boot-Script-Path: /boot/boot.scr
+Required-Packages: u-boot-tools
+Bootloader-sets-root: no
+
 Machine: Seagate Blackarmor NAS220
 Kernel-Flavors: kirkwood marvell
 DTB-Id: kirkwood-blackarmor-nas220.dtb
@@ -1778,6 +1968,13 @@ DTB-Id: sun6i-a31s-sinovoip-bpi-m2.dtb
 U-Boot-Script-Name: bootscr.sunxi
 Required-Packages: u-boot-tools
 
+Machine: Sipeed Lichee RV
+Kernel-Flavors: allwinner riscv64
+DTB-Id: allwinner/sun20i-d1-lichee-rv.dtb
+Boot-Script-Path: /boot/boot.scr
+U-Boot-Script-Name: bootscr.uboot-generic
+Required-Packages: u-boot-tools
+
 Machine: SolidRun Clearfog A1
 Kernel-Flavors: armmp
 Boot-Script-Path: /boot/boot.scr
@@ -1953,6 +2150,13 @@ Boot-Script-Path: /boot/boot.scr
 U-Boot-Script-Name: bootscr.uboot-generic
 Required-Packages: u-boot-tools
 
+Machine: StarFive VisionFive V1
+Kernel-Flavors: starfive riscv64
+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
 DTB-Id: rockchip/rk3399-puma-haikou.dtb
@@ -2000,6 +2204,7 @@ Machine: Toshiba AC100 / Dynabook AZ
 Method: android
 Android-Boot-Device: /dev/mmcblk0
 Required-Packages: abootimg
+Bootloader-sets-root: no
 
 Machine: Udoo i.MX6 Dual-lite Board
 Kernel-Flavors: armmp
@@ -2037,11 +2242,19 @@ U-Boot-Script-Name: bootscr.imx-base boo
 Required-Packages: u-boot-tools
 
 Machine: Wandboard i.MX6 Quad Board
-Kernel-Flavors: armmp
-DTB-Id: imx6q-wandboard.dtb
-Boot-Script-Path: /boot/boot.scr
-U-Boot-Script-Name: bootscr.imx-base bootscr.uboot-generic
+Method: generic
+U-Boot-Kernel-Address: 0x10008000
+U-Boot-Initrd-Address: 0x0
+U-Boot-Script-Address: 0x0
+U-Boot-Script-Name: uEnvtxt.wandboard
+Boot-Device: /dev/disk/by-path/platform-2198000.usdhc-part1
+Boot-Kernel-Path: uImage
+Boot-Initrd-Path: uInitrd
+Boot-Script-Path: preEnv.txt
 Required-Packages: u-boot-tools
+Bootloader-sets-root: yes
+DTB-Append-From: 3.12
+DTB-Id: imx6q-wandboard.dtb
 
 Machine: Wandboard i.MX6 Quad Board rev B1
 Kernel-Flavors: armmp
@@ -2134,3 +2347,48 @@ 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 *K26*
+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-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.106/debian/changelog 3.106ubuntu4/debian/changelog
--- 3.106/debian/changelog	2022-04-22 23:55:41.000000000 +0000
+++ 3.106ubuntu4/debian/changelog	2022-08-01 15:13:38.000000000 +0000
@@ -1,3 +1,220 @@
+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.
@@ -38,6 +255,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 ]
@@ -66,6 +511,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
@@ -116,6 +715,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
@@ -157,6 +927,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 ]
@@ -303,6 +1294,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 ]
@@ -1467,6 +2658,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.106/debian/control 3.106ubuntu4/debian/control
--- 3.106/debian/control	2022-04-22 23:43:42.000000000 +0000
+++ 3.106ubuntu4/debian/control	2022-07-14 12:19:57.000000000 +0000
@@ -1,7 +1,8 @@
 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
@@ -15,9 +16,11 @@ Architecture: arm64 armel armhf riscv64
 Depends: ${misc:Depends},
          devio,
          initramfs-tools (>= 0.92f),
+         systemd,
          linux-base (>= 3.2),
          mtd-utils,
-         ucf
+         ucf,
+         awk
 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
@@ -32,7 +35,7 @@ Priority: standard
 Package-Type: udeb
 Build-Profiles: <!noudeb>
 Architecture: arm64 armel armhf riscv64
-XB-Subarchitecture: kirkwood orion5x s3c24xx mx5 generic
+XB-Subarchitecture: armadaxp exynos5 generic-lpae kirkwood orion5x s3c24xx mx5 omap omap4 xgene generic
 Provides: bootable-system
 Depends: cdebconf-udeb, installed-base
 XB-Installer-Menu-Item: 7300
diff -pruN 3.106/debian/flash-kernel-installer.install 3.106ubuntu4/debian/flash-kernel-installer.install
--- 3.106/debian/flash-kernel-installer.install	2022-03-23 14:22:28.000000000 +0000
+++ 3.106ubuntu4/debian/flash-kernel-installer.install	2022-05-17 14:12:20.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.106/debian/flash-kernel-installer.isinstallable 3.106ubuntu4/debian/flash-kernel-installer.isinstallable
--- 3.106/debian/flash-kernel-installer.isinstallable	2022-03-23 14:22:28.000000000 +0000
+++ 3.106ubuntu4/debian/flash-kernel-installer.isinstallable	2022-06-15 14:21:33.000000000 +0000
@@ -2,6 +2,15 @@
 set -e
 
 case "`archdetect`" in
+	arm*/armadaxp)
+		exit 0
+	;;
+	arm*/exynos5)
+		exit 0
+	;;
+	arm*/generic-lpae)
+		exit 0
+	;;
 	arm*/kirkwood)
 		exit 0
 	;;
@@ -14,6 +23,15 @@ case "`archdetect`" in
 	arm*/s3c24xx)
 		exit 0
 	;;
+	arm*/omap)
+		exit 0
+	;;
+	arm*/omap4)
+		exit 0
+	;;
+	arm64/xgene)
+		exit 0
+	;;
 	arm*/generic)
 		FK_DIR="/usr/share/flash-kernel"
 
diff -pruN 3.106/debian/flash-kernel-installer.postinst.in 3.106ubuntu4/debian/flash-kernel-installer.postinst.in
--- 3.106/debian/flash-kernel-installer.postinst.in	2022-03-23 14:22:28.000000000 +0000
+++ 3.106ubuntu4/debian/flash-kernel-installer.postinst.in	2022-05-17 14:12:20.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
 
@@ -121,6 +130,14 @@ fi
 trap - EXIT HUP INT QUIT TERM
 mv /target/tmp/flash-kernel.$$ /target/usr/sbin/flash-kernel
 
+# set ubuntu defaults
+if echo $(get_machine_field "$machine" "U-Boot-Script-Name") | grep -q "uEnvtxt"; then
+		export VOLID=$(blkid -o value -s UUID $(findfs /))
+		# hide the boot partition from udisks automounting
+		bootdev=$(get_machine_field "$machine" "Boot-Device")
+		[ -b $bootdev ] && in-target dosfslabel $bootdev "SERVICEV001"
+fi
+
 # We need the udev /dev which has the MTD devices
 mount -o bind /dev /target/dev
 if ! in-target flash-kernel; then
diff -pruN 3.106/debian/flash-kernel.postinst 3.106ubuntu4/debian/flash-kernel.postinst
--- 3.106/debian/flash-kernel.postinst	2022-03-23 14:22:28.000000000 +0000
+++ 3.106ubuntu4/debian/flash-kernel.postinst	2022-05-17 14:12:20.000000000 +0000
@@ -24,20 +24,20 @@ case "$1" in
 		. /usr/share/debconf/confmodule
 
 		tmp_default_fk="$(mktemp -t flash-kernel.XXXXXXXXXX)"
-		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.106/debian/rules 3.106ubuntu4/debian/rules
--- 3.106/debian/rules	2022-03-23 14:22:28.000000000 +0000
+++ 3.106ubuntu4/debian/rules	2022-06-15 14:21:33.000000000 +0000
@@ -17,7 +17,7 @@ override_dh_auto_install:
 	install -m0755 -p -d debian/flash-kernel/etc/flash-kernel/bootscript
 	set -ex ; for arch in all $(DEB_HOST_ARCH) ; do \
 		[ -d bootscript/$${arch} ] || continue ; \
-		install -m0644 bootscript/$${arch}/bootscr.* \
+		install -m0644 bootscript/$${arch}/* \
 			debian/flash-kernel/etc/flash-kernel/bootscript/ ; \
 	done
 ifeq (armhf,$(DEB_HOST_ARCH))
@@ -25,6 +25,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:
diff -pruN 3.106/functions 3.106ubuntu4/functions
--- 3.106/functions	2022-04-12 19:43:15.000000000 +0000
+++ 3.106ubuntu4/functions	2022-08-01 15:11:24.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
@@ -146,6 +148,10 @@ get_boot_cmd() {
         esac
 }
 
+get_root_uuid() {
+	echo $(blkid -o value -s UUID $(mount | grep "on /${1%/} " | tail -n1 | cut -d' ' -f1))
+}
+
 get_cpuinfo_hardware() {
 	grep "^Hardware" "$PROC_CPUINFO" | sed 's/Hardware\s*:\s*//'
 }
@@ -172,6 +178,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"
@@ -191,7 +214,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
@@ -430,24 +453,97 @@ 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"
 }
 
+maybe_defrag() {
+	local file="$1"
+
+	if [ "$broken_ext4" != "yes" ]; then
+	    return
+	fi
+	if [ "$(df --output=fstype ${file} | sed -e 1d)" != "ext4" ]; then
+	    return
+	fi
+	if ! command -v e4defrag > /dev/null; then
+	    error "e4defrag command not found, unable to defrag $file"
+	fi
+	if ! e4defrag "$file" > /dev/null 2>&1; then
+	    error "e4defrag of $file failed. Try freeing up space in /boot and re-executing flash-kernel"
+	fi
+}
+
+check_kernel_size() {
+    local kdata="$1"
+    local kdatasize
+    local maxsize
+
+    maxsize="$(get_machine_field "$machine" "Boot-Kernel-Max-Size")"
+    if [ -z "$maxsize" ]; then
+	return 0
+    fi
+    kdatasize=$(stat -c '%s' "$kdata")
+    if [ "$kdatasize" -le "$maxsize" ]; then
+	return 0
+    fi
+    return 1
+}
+
+try_shrink_kernel() {
+    local kdata="$1"
+    local kdataz
+    local comptype
+
+    comptype="$(compress_type $kdata)"
+    if [ "$comptype" != "none" ]; then
+	echo "WARNING: try_shrink_kernel: $kdata is already compressed." >&2
+	echo "$kdata"
+	return
+    fi
+    kdataz="$(mktemp -p $tmpdir)"
+    gzip -9 < "$kdata" > "$kdataz"
+    echo "$kdataz"
+}
+
 mkimage_kernel() {
 	local kaddr="$1"
 	local epoint="$2"
 	local kdesc="$3"
 	local kdata="$4"
 	local uimage="$5"
+	local comp
+
+	if ! check_kernel_size "$kdata"; then
+	    printf "$kdata is too large for this machine, attempting to compress..." >&2
+	    kdata="$(try_shrink_kernel "$kdata")"
+	    if ! check_kernel_size "$kdata"; then
+		error "Compressed file $kdata is too large for this machine"
+	    fi
+	fi
+
+	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
 }
@@ -490,7 +586,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
@@ -516,9 +612,63 @@ 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
+}
+
+create_boot_script() {
+	case $usname in
+		bootscr*)
+			boot_script_path="$boot_mnt_dir/$boot_script_path"
+			boot_script="$tmpdir/bootscript"
+			for script in $usname ; do
+				echo "\n#\n# flash-kernel: $script\n#\n" >> "$boot_script"
+				cat "$BOOTSCRIPTS_DIR/$script" >> "$boot_script"
+			done
+			mkimage_script "$usaddr" "boot script" "$boot_script" \
+				"$tmpdir/boot.scr"
+			boot_script="$tmpdir/boot.scr"
+			backup_and_install "$boot_script" "$boot_script_path"
+		;;
+		uEnvtxt*)
+			VOLID=${VOLID:-"$(get_root_uuid)"}
+			boot_script_in="$BOOTSCRIPTS_DIR/$usname"
+			boot_script="$boot_mnt_dir/$usname"
+			cp $boot_script_in $boot_script
+
+			boot_script_path="$boot_mnt_dir/uEnv.txt"
+			boot_script_env="$boot_mnt_dir/preEnv.txt"
+			env_script="$tmpdir/preEnv.txt"
+
+			[ -e /etc/default/flash-kernel ] && . /etc/default/flash-kernel
+			echo "bootargs=ro $(LINUX_KERNEL_CMDLINE) root=UUID=$VOLID" > $env_script
+
+			backup_and_install "$env_script" "$boot_script_env"
+			backup_and_install "$boot_script" "$boot_script_path"
+		;;
+	esac
+}
+
 # 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 ;;
@@ -527,7 +677,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}";;
@@ -558,6 +708,21 @@ backup_and_install() {
 	fi
 	echo "Installing new $(basename "$dest")." >&2
 	mv "$source" "$dest"
+	maybe_defrag "$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
@@ -576,7 +741,6 @@ nslu2_swap() {
 	fi
 }
 
-# XXX needs testsuite coverage
 abootimg_get_image_size() {
 	local abootimg="$1"
 
@@ -587,18 +751,46 @@ dtb_append_required() {
 	linux-version compare "$kvers" ge "$dtb_append_from"
 }
 
-# XXX needs testsuite coverage
 android_flash() {
 	local device="$1"
 
-	printf "Flashing kernel and initramfs to $device... " >&2
-	abootimg -u "$device" -k "$kfile" -r "$ifile" >/dev/null ||
-		error "failed."
-	echo "done." >&2
+	if [ -z "$android_skip_initrd" ]; then
+		printf "Flashing kernel and initramfs to $device... " >&2
+		abootimg -u "$device" -k "$kfile" -r "$ifile" >/dev/null ||
+			error "failed."
+		echo "done." >&2
+	else
+		printf "Flashing the kernel (skipping initrd) to $device... " >&2
+		abootimg -u "$device" -k "$kfile" >/dev/null || error "failed."
+		echo "done." >&2
+	fi
+}
+
+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 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
 }
 
 find_dtb_file() {
-	local dtb
+	local dtb path
 	case "$dtb_dir" in
 	/*)
 		dtb="$dtb_dir/$dtb_name"
@@ -607,18 +799,55 @@ 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
 	echo $dtb
 }
 
+unique_filenames() {
+	awk '
+	{
+		file=$0;
+		sub("^.*/", "", file);
+		if (!(file in files)) files[file]=$0;
+	}
+	END {
+		for (file in files) print files[file];
+	}'
+}
+
+find_all_dtbs() {
+	# NOTE: The following assumes that "find" processes and outputs
+	# filenames in the same order as starting points ($paths) are specified
+	paths="/etc/flash-kernel/dtbs /usr/lib/linux-image-$kvers /lib/firmware/$kvers/device-tree/"
+	find $paths -name "*.dtb" -a \! -name "overlay_map.dtb" 2>/dev/null | unique_filenames
+}
+
+find_all_overlays() {
+	paths="/etc/flash-kernel/dtbs /usr/lib/linux-image-$kvers /lib/firmware/$kvers/device-tree/"
+	find $paths -name "*.dtbo" -o -name "overlay_map.dtb" 2>/dev/null | unique_filenames
+	find $paths -path "*/overlays/README" 2>/dev/null
+}
+
+find_pi_firmware() {
+	paths="/usr/lib/linux-firmware-raspi /usr/lib/linux-firmware-raspi2"
+	find $paths -name "*.bin" -o -name "*.elf" -o -name "*.dat" 2>/dev/null | unique_filenames
+}
+
+find_pi_uboot() {
+	paths="/usr/lib/u-boot"
+	find $paths -name "u-boot.bin" 2>/dev/null
+}
+
 handle_dtb() {
 	if [ "x$dtb_name" = "x" ]; then
 		return
@@ -674,6 +903,13 @@ handle_dtb() {
 }
 
 main() {
+# Do not run inside an LXC container unless explicitly asked
+if [ "$FK_FORCE_CONTAINER" != "yes" ]; then
+    if systemd-detect-virt --quiet --container; then
+        exit 0
+    fi
+fi
+
 force="no"
 if [ "x$1" = "x--force" ]; then
 	force="yes"
@@ -708,7 +944,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
@@ -733,10 +978,7 @@ if [ "$kvers" != "$latest_version" ] &&
 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
+		exit 0
 	fi
 	kvers="$latest_version"
 	# Make sure we install the DTB for $latest_version
@@ -800,10 +1042,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"
@@ -839,8 +1077,12 @@ 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")" || :
+android_skip_initrd="$(get_machine_field "$machine" "Android-Skip-Initrd")" || :
+broken_ext4="$(get_machine_field "$machine" "Bootloader-Has-Broken-Ext4-Extent-Support")" || :
 
 if [ -n "$dtb_append_from" ]; then
     if dtb_append_required; then
@@ -885,7 +1127,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
 }
@@ -897,18 +1139,22 @@ tmpdir="$(mktemp -dt "$self.XXXXXXXX")"
 case "$method" in
 	"android")
 		[ -n "$ifile" ] || error "Initrd required for android method"
-		part=""
-		largest_size="-1"
-		for p in "$android_boot_device"*[0-9]; do
-			if ! abootimg="$(LC_ALL=C abootimg -i "$p" 2>/dev/null)"; then
-				continue
-			fi
-			image_size="$(abootimg_get_image_size "$abootimg")"
-			if [ -n "$image_size" ] &&
-				[ "$image_size" -gt "$largest_size" ]; then
-				part="$p"
-			fi
-		done
+		if abootimg -i "$android_boot_device" > /dev/null 2>&1; then
+			part="$android_boot_device"
+		else
+			part=""
+			largest_size="-1"
+			for p in "$android_boot_device"*[0-9]; do
+				if ! abootimg="$(LC_ALL=C abootimg -i "$p" 2>/dev/null)"; then
+					continue
+				fi
+				image_size="$(abootimg_get_image_size "$abootimg")"
+				if [ -n "$image_size" ] &&
+					[ "$image_size" -gt "$largest_size" ]; then
+					part="$p"
+				fi
+			done
+		fi
 		if [ -z "$part" ]; then
 			error "Couldn't find Android boot partition on $android_boot_device"
 		fi
@@ -956,6 +1202,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
@@ -1011,16 +1265,7 @@ case "$method" in
 			rm -f "$tmpdir/uInitrd"
 		fi
 		if [ -n "$boot_script_path" ]; then
-			boot_script_path="$boot_mnt_dir/$boot_script_path"
-			boot_script="$tmpdir/bootscript"
-			for script in $usname ; do
-				echo "\n#\n# flash-kernel: $script\n#\n" >> "$boot_script"
-				cat "$BOOTSCRIPTS_DIR/$script" >> "$boot_script"
-			done
-			mkimage_script "$usaddr" "boot script" "$boot_script" \
-				"$tmpdir/boot.scr"
-			boot_script="$tmpdir/boot.scr"
-			backup_and_install "$boot_script" "$boot_script_path"
+			create_boot_script
 		fi
 		if [ -n "$boot_dtb_path" ] && [ "$dtb_append" != "no" ]; then
 			boot_dtb_path="$boot_mnt_dir/$boot_dtb_path"
@@ -1033,6 +1278,58 @@ case "$method" in
 			backup_and_install "$dtb" "$boot_dtb_path"
 		fi
 	;;
+	"pi")
+		boot_dir="/boot/firmware"
+		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_pi_uboot | {
+			while read fw; do
+				fw_name=uboot_$(basename $(dirname $fw)).bin
+				cp "$fw" "$tmpdir/$fw_name"
+				backup_and_install "$tmpdir/$fw_name" "$boot_dir/$fw_name"
+			done
+		}
+		if [ -n "$usname" ]; then
+			boot_script="$tmpdir/boot.scr"
+			for script in $usname ; do
+				echo "\n#\n# flash-kernel: $script\n#\n" >> "$boot_script"
+				cat "$BOOTSCRIPTS_DIR/$script" >> "$boot_script"
+			done
+			mkimage_script "$usaddr" "boot script" "$boot_script" "$tmpdir/boot.scr"
+			backup_and_install "$boot_script" "$boot_dir/boot.scr"
+		fi
+		find_pi_firmware | {
+			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_all_dtbs | {
+			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_all_overlays | {
+			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
+		}
+	;;
 	"symlink")
 		[ -n "$ifile" ] || error "Initrd required for symlink method"
 		rm -f /boot/initrd /boot/zImage
diff -pruN 3.106/initramfs-tools/hooks/flash_kernel_set_root 3.106ubuntu4/initramfs-tools/hooks/flash_kernel_set_root
--- 3.106/initramfs-tools/hooks/flash_kernel_set_root	2022-03-23 14:22:28.000000000 +0000
+++ 3.106ubuntu4/initramfs-tools/hooks/flash_kernel_set_root	2022-07-14 12:19:57.000000000 +0000
@@ -55,6 +55,23 @@ FK_DIR="/usr/share/flash-kernel"
 
 . /usr/share/initramfs-tools/hook-functions
 
+get_machine
+
+# Should we override the root device or merely provide a default root
+# device?
+blsr="$(get_machine_field "$machine" "Bootloader-sets-root")"
+
+if [ "$blsr" = "yes" ]; then
+	exit 0
+fi
+
+# Do not run inside an LXC container unless explicitly asked
+if [ "$FK_FORCE_CONTAINER" != "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.106/its/arm64/image-kria.its 3.106ubuntu4/its/arm64/image-kria.its
--- 3.106/its/arm64/image-kria.its	1970-01-01 00:00:00.000000000 +0000
+++ 3.106ubuntu4/its/arm64/image-kria.its	2022-06-15 14:27:53.000000000 +0000
@@ -0,0 +1,141 @@
+/*
+ * 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/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/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/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/smk-k26-revA-sck-kv-g-revB.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-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.106/its/arm64/image-mediatek-aiot-i500.its 3.106ubuntu4/its/arm64/image-mediatek-aiot-i500.its
--- 3.106/its/arm64/image-mediatek-aiot-i500.its	1970-01-01 00:00:00.000000000 +0000
+++ 3.106ubuntu4/its/arm64/image-mediatek-aiot-i500.its	2022-06-15 14:21:33.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.106/its/arm64/image-zcu.its 3.106ubuntu4/its/arm64/image-zcu.its
--- 3.106/its/arm64/image-zcu.its	1970-01-01 00:00:00.000000000 +0000
+++ 3.106ubuntu4/its/arm64/image-zcu.its	2022-06-15 14:27:53.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 = "zcu";
+        zcu {
+            description = "Boot Ubuntu on zcu board";
+            kernel = "kernel-1";
+            ramdisk = "ramdisk-1";
+            hash-1 {
+                algo = "sha1";
+            };
+        };
+    };
+};
diff -pruN 3.106/post-base-installer.d/01flash-kernel-diversion 3.106ubuntu4/post-base-installer.d/01flash-kernel-diversion
--- 3.106/post-base-installer.d/01flash-kernel-diversion	1970-01-01 00:00:00.000000000 +0000
+++ 3.106ubuntu4/post-base-installer.d/01flash-kernel-diversion	2022-05-17 14:12:20.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.106/README 3.106ubuntu4/README
--- 3.106/README	2022-03-23 14:22:28.000000000 +0000
+++ 3.106ubuntu4/README	2022-06-15 14:21:33.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.106/test_db 3.106ubuntu4/test_db
--- 3.106/test_db	2022-03-23 14:22:28.000000000 +0000
+++ 3.106ubuntu4/test_db	2022-06-15 14:21:33.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 Android-Skip-Initrd Boot-Device Boot-DTB-Path Boot-FIT-Path Boot-Initrd-Path Boot-ITS-File-Name Boot-Kernel-Path Boot-Kernel-Max-Size Bootloader-Has-Broken-Ext4-Extent-Support Bootloader-Sets-Incorrect-Root Bootloader-sets-root Boot-Multi-Path Boot-Script-Path 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.106/test_functions 3.106ubuntu4/test_functions
--- 3.106/test_functions	2022-03-23 14:22:28.000000000 +0000
+++ 3.106ubuntu4/test_functions	2022-06-15 14:21:33.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,33 @@ 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() {
+    get_tempfile
+    local kdata="$last_tempfile"
+    echo "uncompressed" > "$kdata"
+    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 +625,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() {
@@ -615,6 +697,94 @@ test_mkimage_multi() {
 }
 add_test test_mkimage_multi
 
+test_check_kernel_size_no_max() {
+    get_tempfile
+    local kdata="$last_tempfile"
+    # Larger than the smallest Boot-Kernel-Max-Size in all.db
+    dd if=/dev/zero of="$kdata" seek=16777153 bs=1 count=0 status=none
+    (
+	. "$functions"
+	machine="none"
+	if ! check_kernel_size "$kdata"; then
+	    echo "Did not expect an error from check_kernel_size()" >&2
+	    exit 1
+	fi
+    )
+}
+add_test test_check_kernel_size_no_max
+
+test_check_kernel_size_fits() {
+    get_tempfile
+    local kdata="$last_tempfile"
+    # Within the machine's Boot-Kernel-Max-Size
+    dd if=/dev/zero of="$kdata" seek=16777152 bs=1 count=0 status=none
+    (
+	. "$functions"
+	machine="HP ProLiant m400 Server Cartridge"
+	if ! check_kernel_size "$kdata"; then
+	    echo "Did not expect an error from check_kernel_size()" >&2
+	    exit 1
+	fi
+    )
+}
+add_test test_check_kernel_size_fits
+
+test_check_kernel_size_too_big() {
+    get_tempfile
+    local kdata="$last_tempfile"
+    # Larger than the machine's Boot-Kernel-Max-Size
+    dd if=/dev/zero of="$kdata" seek=16777153 bs=1 count=0 status=none
+    (
+	. "$functions"
+	machine="HP ProLiant m400 Server Cartridge"
+	if check_kernel_size "$kdata"; then
+	    echo "Expected an error from check_kernel_size()" >&2
+	    exit 1
+	fi
+    )
+}
+add_test test_check_kernel_size_too_big
+
+test_try_shrink_kernel_should_compress() {
+    get_tempfile
+    local kdata="$last_tempfile"
+    echo uncompressed > "$kdata"
+    (
+	. "$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")"
+	new_kdata="$(try_shrink_kernel "$kdata")"
+	if [ "$new_kdata" = "$kdata" ]; then
+	    echo "Expected a new (compressed) file" >&2
+	    exit 1
+	fi
+	if [ "$(compress_type "$new_kdata")" != "gzip" ]; then
+	    echo "Expected $new_kdata to be gzipped" >&2
+	    exit 1
+	fi
+    )
+}
+add_test test_try_shrink_kernel_should_compress
+
+test_try_shrink_kernel_should_NOT_compress() {
+    get_tempfile
+    local kdata="$last_tempfile"
+    gzip < /dev/null > "$kdata"
+    (
+	. "$functions"
+	new_kdata="$(try_shrink_kernel "$kdata")"
+	if [ "$new_kdata" != "$kdata" ]; then
+	    echo "Expected function to return input file as-is" >&2
+	    exit 1
+	fi
+    )
+}
+add_test test_try_shrink_kernel_should_NOT_compress
+
 test_gen_kernel() {
     get_tempfile
     kernel_input="$last_tempfile"
@@ -689,6 +859,154 @@ 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
+        saved_args=""
+        android_skip_initrd=1 android_flash /dev/some-dev 2>/dev/null
+        expected="-u /dev/some-dev -k vmlinuz"
+        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_find_pi_firmware() {
+    get_tempfile
+    mock_find_output="$last_tempfile"
+    cat >"$mock_find_output" <<EOF
+/usr/lib/linux-firmware-raspi/bootcode.bin
+/usr/lib/linux-firmware-raspi2/bootcode.bin
+/usr/lib/linux-firmware-raspi2/start.elf
+/usr/lib/linux-firmware-raspi2/fixup.dat
+EOF
+    (
+        find() {
+            saved_args="$@"
+            cat "$mock_find_output"
+        }
+        . "$functions"
+        expected="\
+/usr/lib/linux-firmware-raspi/bootcode.bin
+/usr/lib/linux-firmware-raspi2/fixup.dat
+/usr/lib/linux-firmware-raspi2/start.elf"
+        if [ "$(find_pi_firmware | sort)" != "$(echo "$expected" | sort)" ]; then
+            echo "find_pi_firmware did not output the expected list of files" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_find_pi_firmware
+
+test_find_all_dtbs() {
+    kvers="3.14"
+    get_tempfile
+    mock_find_output="$last_tempfile"
+    cat >"$mock_find_output" <<EOF
+/etc/flash-kernel/dtbs/bcm2709-rpi-2-b.dtb
+/lib/firmware/$kvers/device-tree/broadcom/bcm2709-rpi-2-b.dtb
+/lib/firmware/$kvers/device-tree/broadcom/bcm2710-rpi-3-b.dtb
+/lib/firmware/$kvers/device-tree/broadcom/bcm2711-rpi-4-b.dtb
+EOF
+    (
+        find() {
+            saved_args="$@"
+            cat "$mock_find_output"
+        }
+        . "$functions"
+        expected="\
+/etc/flash-kernel/dtbs/bcm2709-rpi-2-b.dtb
+/lib/firmware/$kvers/device-tree/broadcom/bcm2710-rpi-3-b.dtb
+/lib/firmware/$kvers/device-tree/broadcom/bcm2711-rpi-4-b.dtb"
+        if [ "$(find_all_dtbs | sort)" != "$(echo "$expected" | sort)" ]; then
+            echo "find_all_dtbs did not output the expected list of files" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_find_all_dtbs
+
+test_find_all_overlays() {
+    kvers="3.14"
+    get_tempfile
+    mock_find_output="$last_tempfile"
+    cat >"$mock_find_output" <<EOF
+/etc/flash-kernel/dtbs/pi3-disable-bt.dtbo
+/lib/firmware/$kvers/device-tree/overlays/i2c0.dtbo
+/lib/firmware/$kvers/device-tree/overlays/vc4-fkms-v3d.dtbo
+/lib/firmware/$kvers/device-tree/overlays/pi3-disable-bt.dtbo
+/lib/firmware/$kvers/device-tree/broadcom/overlay_map.dtb
+EOF
+    (
+        find() {
+            saved_args="$@"
+            if [ "${saved_args##*README}" = "${saved_args%%README*}" ]; then
+                cat "$mock_find_output"
+            fi
+        }
+        . "$functions"
+        expected="\
+/etc/flash-kernel/dtbs/pi3-disable-bt.dtbo
+/lib/firmware/$kvers/device-tree/overlays/i2c0.dtbo
+/lib/firmware/$kvers/device-tree/overlays/vc4-fkms-v3d.dtbo
+/lib/firmware/$kvers/device-tree/broadcom/overlay_map.dtb"
+        if [ "$(find_all_overlays | sort)" != "$(echo "$expected" | sort)" ]; then
+            echo "find_all_overlays did not output the expected list of files" >&2
+            exit 1
+        fi
+    )
+}
+add_test test_find_all_overlays
+
 test_main
 
 # vim:syntax=sh
