aboutsummaryrefslogtreecommitdiff
path: root/resources/ct1986.sh
diff options
context:
space:
mode:
authortslil clingman <tslil@posteo.de>2021-01-20 22:49:49 -0500
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commit2ac4a6e1d3b6440de22d95f48454d6282c78726d (patch)
tree2496adbdf994c0bf574fbcc62486d244d9673d8b /resources/ct1986.sh
parent1b0338a0546b760e8a7ffa61b38c410a166aae7c (diff)
parent36cecb722fb66d35cdbf69ebcf2aa6f49bfc082b (diff)
Merge branch 'pi'
Diffstat (limited to 'resources/ct1986.sh')
-rwxr-xr-xresources/ct1986.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/resources/ct1986.sh b/resources/ct1986.sh
new file mode 100755
index 0000000..fac57d5
--- /dev/null
+++ b/resources/ct1986.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+set -u
+set -e
+
+BOARD_DIR="$(dirname $0)"
+BOARD_NAME="$(basename ${BOARD_DIR})"
+GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+cp output/build/linux-custom/arch/arm/boot/dts/overlays/hd44780-lcd.dtbo "${BINARIES_DIR}/rpi-firmware/overlays/"
+
+echo "root=/dev/mmcblk0p2 rootwait console=ttyAMA0,115200 hdmi_blanking=2" \
+ > "${BINARIES_DIR}/rpi-firmware/cmdline.txt"
+
+cat > "${BINARIES_DIR}/rpi-firmware/config.txt" <<EOF
+start_file=start.elf
+fixup_file=fixup.dat
+kernel=zImage
+gpu_mem_256=0
+gpu_mem_512=0
+gpu_mem_1024=0
+dtoverlay=hd44780-lcd.dtbo
+dtparam=pin_d4=26,pin_d5=19,pin_d6=13,pin_d7=6,pin_en=20,pin_rs=21
+EOF
+
+# Pass an empty rootpath. genimage makes a full copy of the given rootpath to
+# ${GENIMAGE_TMP}/root so passing TARGET_DIR would be a waste of time and disk
+# space. We don't rely on genimage to build the rootfs image, just to insert a
+# pre-built one in the disk image.
+
+trap 'rm -rf "${ROOTPATH_TMP}"' EXIT
+ROOTPATH_TMP="$(mktemp -d)"
+
+rm -rf "${GENIMAGE_TMP}"
+
+genimage \
+ --rootpath "${ROOTPATH_TMP}" \
+ --tmppath "${GENIMAGE_TMP}" \
+ --inputpath "${BINARIES_DIR}" \
+ --outputpath "${BINARIES_DIR}" \
+ --config "${GENIMAGE_CFG}"
+
+exit $?