mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-30 20:06:22 -05:00
Updating pi-gen build to use bookworm-arm64 branch.
This commit is contained in:
parent
9eea3dd9f9
commit
179f88d00b
4 changed files with 49 additions and 10 deletions
|
|
@ -2,7 +2,7 @@
|
|||
# https://github.com/RPI-Distro/pi-gen
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
BUILD_DIR=/tmp/wrolpi-build-pi-gen
|
||||
BUILD_DIR=/var/tmp/wrolpi-build-pi-gen
|
||||
|
||||
VERSION=$(cat "${SCRIPT_DIR}/../wrolpi/version.txt")
|
||||
|
||||
|
|
@ -17,15 +17,38 @@ if [ ! -f "${SCRIPT_DIR}/stage2/04-wrolpi/files/map-db-gis.dump" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
CHROOTFS="${BUILD_DIR}/work/WROLPi/stage0/rootfs"
|
||||
|
||||
cleanup() {
|
||||
[ -f /var/tmp/bookworm-arm64.zip ] && rm /var/tmp/bookworm-arm64.zip
|
||||
|
||||
# Only unmount if it is actually a mountpoint
|
||||
for mp in \
|
||||
"${CHROOTFS}/dev/pts" \
|
||||
"${CHROOTFS}/sys" \
|
||||
"${CHROOTFS}/proc" \
|
||||
"${CHROOTFS}/run" \
|
||||
"${CHROOTFS}/tmp" \
|
||||
"${CHROOTFS}/dev"; do
|
||||
|
||||
if mountpoint -q "${mp}" 2>/dev/null; then
|
||||
umount "${mp}" 2>/dev/null || umount -l "${mp}" 2>/dev/null
|
||||
fi
|
||||
done
|
||||
|
||||
# Final safety net – remove the whole build tree
|
||||
rm -rf "${BUILD_DIR}"
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# Clear out old builds.
|
||||
[ -d "${BUILD_DIR}" ] && rm -rf "${BUILD_DIR}"
|
||||
mkdir "${BUILD_DIR}"
|
||||
|
||||
# We need the arm64 branch for modern RPi.
|
||||
git clone --branch arm64 https://github.com/RPI-Distro/pi-gen.git "${BUILD_DIR}"
|
||||
# Get the latest pi-gen code.
|
||||
wget https://github.com/RPi-Distro/pi-gen/archive/refs/heads/bookworm-arm64.zip -O /var/tmp/bookworm-arm64.zip
|
||||
unzip /var/tmp/bookworm-arm64.zip -d /var/tmp
|
||||
mv /var/tmp/pi-gen-bookworm-arm64 /var/tmp/wrolpi-build-pi-gen
|
||||
|
||||
# Copy the configuration and build files into the pi-gen directory.
|
||||
cp "${SCRIPT_DIR}/config.txt" "${BUILD_DIR}/config.txt"
|
||||
|
|
@ -40,7 +63,8 @@ echo 'IMG_SUFFIX="-desktop"' > "${BUILD_DIR}/stage5/EXPORT_IMAGE"
|
|||
(cd "${BUILD_DIR}" && time nice -n 18 "${BUILD_DIR}"/build.sh -c "${BUILD_DIR}"/config.txt | \
|
||||
tee "${SCRIPT_DIR}"/build.log)
|
||||
|
||||
grep "02-run.sh completed" "${SCRIPT_DIR}/build.log" >/dev/null 2>&1 || (echo "script 2 failed!" && exit 1)
|
||||
grep "00-run-chroot.sh completed" "${SCRIPT_DIR}/build.log" >/dev/null 2>&1 || (echo "script 0 failed!" && exit 1)
|
||||
grep "03-run-chroot.sh completed" "${SCRIPT_DIR}/build.log" >/dev/null 2>&1 || (echo "script 3 failed!" && exit 1)
|
||||
grep "03-run-chroot.sh completed" "${SCRIPT_DIR}/build.log" >/dev/null 2>&1 || (echo "script 3 failed!" && exit 1)
|
||||
grep "04-run-chroot.sh completed" "${SCRIPT_DIR}/build.log" >/dev/null 2>&1 || (echo "script 4 failed!" && exit 1)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
IMG_NAME=WROLPi
|
||||
BASE_QCOW2_SIZE=12G
|
||||
BASE_QCOW2_SIZE=48G
|
||||
RELEASE=bookworm
|
||||
LOCALE_DEFAULT=en_US.UTF-8
|
||||
TARGET_HOSTNAME=wrolpi
|
||||
|
|
@ -7,4 +7,4 @@ KEYBOARD_KEYMAP=en_US
|
|||
KEYBOARD_LAYOUT="English (US)"
|
||||
ENABLE_SSH=1
|
||||
DEPLOY_COMPRESSION=xz
|
||||
WPA_COUNTRY=US
|
||||
WPA_COUNTRY=US
|
||||
|
|
|
|||
15
pi-gen/stage2/04-wrolpi/00-run-chroot.sh
Executable file
15
pi-gen/stage2/04-wrolpi/00-run-chroot.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# Preseed debconf answers to avoid interactive prompts during package installation.
|
||||
# iperf3 asks whether to start as a daemon at boot - answer yes since we enable it via systemctl.
|
||||
echo "iperf3 iperf3/start_daemon boolean true" | debconf-set-selections
|
||||
|
||||
set +x
|
||||
|
||||
echo
|
||||
echo "======================================================================"
|
||||
echo "00-run-chroot.sh completed"
|
||||
echo "======================================================================"
|
||||
echo
|
||||
Loading…
Add table
Add a link
Reference in a new issue