summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcustom-scripts/modify-raspi.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/custom-scripts/modify-raspi.sh b/custom-scripts/modify-raspi.sh
new file mode 100755
index 0000000..69870bf
--- /dev/null
+++ b/custom-scripts/modify-raspi.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# post-build, pre-image script
+# fail-fast
+set -eu
+
+# make /etc/dropbear a directory instead of a symlink to /var...
+# (need to persist keys somehow)
+TARGET_DIR="$1"
+(rm "$TARGET_DIR/etc/dropbear" && mkdir "$TARGET_DIR/etc/dropbear") || true
+
+# add a data partition mount
+if ! grep -q LABEL "$TARGET_DIR/etc/fstab"; then
+ printf "LABEL=data\t/data/\text4\trw,noatime,noauto\t0\t0\n" >> "$TARGET_DIR/etc/fstab"
+fi
+
+# Enable bootcode UART
+sed -i -e "s/BOOT_UART=0/BOOT_UART=1/" "${BINARIES_DIR}/rpi-firmware/bootcode.bin"
+
+# Use "faster" start
+#$ grep start rpi-firmware/config.txt
+#start_file=start.elf
+sed -i -e "/start_file/ s/^.*$/start_file=start_cd.elf/" "${BINARIES_DIR}/rpi-firmware/config.txt"
+
+exit 0