From 61efe5bfa3a1fa7fc85d82f5c6d5b7d5bb192012 Mon Sep 17 00:00:00 2001 From: uvok cheetah Date: Mon, 9 Sep 2024 20:56:37 +0200 Subject: Add script for custom image costumizations --- custom-scripts/modify-raspi.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 custom-scripts/modify-raspi.sh 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 -- cgit v1.2.3