Package boot script with u-boot

- Process boot.txt to boot.scr, and install it into /boot.

Change-Id: Iaae76d8a97abf44e40842360bb1397c19fc2e079
diff --git a/debian/boot.txt b/debian/boot.txt
new file mode 100644
index 0000000..0e61229
--- /dev/null
+++ b/debian/boot.txt
@@ -0,0 +1,20 @@
+fdt_addr=0x43000000
+fdt_file=fsl-imx8mq-phanbell.dtb
+image=Image
+script=boot.scr
+mmc_root="PARTUUID=70672ec3-5eee-49ff-b3b1-eb1fbd406bf5"
+sd_root="/dev/mmcblk1p2"
+
+# Check boot device to decide which root partition to use
+if test ${bootdev} = 1; then
+    setenv root ${sd_root}
+else
+    setenv root ${mmc_root}
+fi
+
+cmdline="console=ttymxc0,115200 earlycon=ec_imx6q,0x30860000,115200 root=${root} rootfstype=ext4 rw rootwait init=/sbin/init net.ifnames=0"
+
+ext2load mmc ${bootdev}:1 ${loadaddr} ${image}
+ext2load mmc ${bootdev}:1 ${fdt_addr} ${fdt_file}
+setenv bootargs ${cmdline}
+booti ${loadaddr} - ${fdt_addr}
diff --git a/debian/rules b/debian/rules
index 07afe26..7649388 100755
--- a/debian/rules
+++ b/debian/rules
@@ -26,6 +26,8 @@
 		arch/arm/dts/fsl-imx8mq-phanbell.dtb > u-boot.its
 	tools/mkimage -E -p 0x3000 -f u-boot.its u-boot.itb
 
+	tools/mkimage -A arm -T script -O linux -d debian/boot.txt boot.scr
+
 	$(IMX_FIRMWARE_DIR)/mkimage_imx8 -fit \
 		-signed_hdmi $(IMX_FIRMWARE_DIR)/signed_hdmi_imx8m.bin \
 		-loader u-boot-spl-ddr.bin 0x7E1000 \
@@ -35,4 +37,5 @@
 override_dh_install:
 	install -d debian/uboot-imx/boot
 	install -m 644 -o 0 -g 0 u-boot.imx debian/uboot-imx/boot/u-boot.imx
+	install -m 644 -o 0 -g 0 boot.scr debian/uboot-imx/boot/boot.scr
 	dh_install