Compare commits
160 Commits
master
...
arm64_aura
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a43a05f61 | |||
| eb7cb9ac5b | |||
| 95f56a7bf5 | |||
| 12c5b066fc | |||
| 8086f9e95f | |||
| d49f6dc165 | |||
| ff5e561df3 | |||
| e5283bd57a | |||
| 79332b36e6 | |||
| b703b3e7d9 | |||
| c999eea6a4 | |||
| 4cba035fd0 | |||
| 2e5c932f08 | |||
|
|
b9e30f2e0e | ||
|
|
47958f5efe | ||
|
|
1e780d18c2 | ||
|
|
744c7151fb | ||
|
|
8946f77e4a | ||
|
|
18acfd7f87 | ||
|
|
891df1e21e | ||
|
|
919f1e86b9 | ||
|
|
e335a4e8b6 | ||
|
|
da8f0063ea | ||
|
|
ccc23c6738 | ||
|
|
150246acda | ||
|
|
19fd60cef7 | ||
|
|
6453828cce | ||
|
|
9aa52c467b | ||
|
|
b040e0a64e | ||
|
|
17c8e48534 | ||
|
|
7c7d74f210 | ||
|
|
ecda2579eb | ||
|
|
94f7acf599 | ||
|
|
4cfc6758ff | ||
|
|
fd5a1e93cd | ||
|
|
c94d23e165 | ||
|
|
cdc1467e13 | ||
|
|
def6e65ffb | ||
|
|
36048218e0 | ||
|
|
98f522e64d | ||
|
|
0668700902 | ||
|
|
291f869713 | ||
|
|
48efb5fc54 | ||
|
|
a63eb86d7b | ||
|
|
0755b07f06 | ||
|
|
97aa847ea8 | ||
|
|
72b2dfd634 | ||
|
|
2327c5e28d | ||
|
|
64e205739c | ||
|
|
2c29fc27c5 | ||
|
|
7dd5b7dd59 | ||
|
|
8056aa3bec | ||
|
|
56916d4d84 | ||
|
|
f19ee211dd | ||
|
|
8273e8553b | ||
|
|
dd93d6280f | ||
|
|
3358eb36e1 | ||
|
|
9a13a81115 | ||
|
|
ff2fd5007f | ||
|
|
6fb311e7fb | ||
|
|
b4f2aeabde | ||
|
|
57149546cf | ||
|
|
a34bf65c4c | ||
|
|
62eeab3a86 | ||
|
|
94bb86632d | ||
|
|
70cd6f2a1e | ||
|
|
0fda3224f6 | ||
|
|
caf3d8681b | ||
|
|
1460069163 | ||
|
|
78444eaf07 | ||
|
|
962bf483c8 | ||
|
|
5f2fe0f854 | ||
|
|
5ef8b0d45c | ||
|
|
325123ff22 | ||
|
|
c318daf364 | ||
|
|
77706bd2f6 | ||
|
|
e484aa8581 | ||
|
|
a86d732f58 | ||
|
|
7c750947a9 | ||
|
|
c16e6b7dee | ||
|
|
0defafedd4 | ||
|
|
84746b2bcd | ||
|
|
3e8046da4c | ||
|
|
a2afdf78cb | ||
|
|
60c9ba3199 | ||
|
|
25e2319eff | ||
|
|
04d0dcb46c | ||
|
|
b48040b3f0 | ||
|
|
366bc2c8f3 | ||
|
|
bd2cf0e0e4 | ||
|
|
da6dde2aea | ||
|
|
2bc1f64a57 | ||
|
|
3dff0ce787 | ||
|
|
005a8c73b0 | ||
|
|
b37b47e559 | ||
|
|
3f78c2b444 | ||
|
|
bd85d61c05 | ||
|
|
827affcc11 | ||
|
|
4e9aaac41e | ||
|
|
fb582e2e67 | ||
|
|
ca06d62f2e | ||
|
|
18aee5cfb8 | ||
|
|
27a8050c3c | ||
|
|
151f3ff80f | ||
|
|
e5bd8d5433 | ||
|
|
10a538ff92 | ||
|
|
7073d28f22 | ||
|
|
d1b8a2005b | ||
|
|
a0ba64e5c8 | ||
|
|
733513aa25 | ||
|
|
255288909b | ||
|
|
4721bfe590 | ||
|
|
2b3ba5b2a6 | ||
|
|
fbe448ccdc | ||
|
|
61c6294e23 | ||
|
|
dec2743355 | ||
|
|
43c42bf9e4 | ||
|
|
69cc4146c8 | ||
|
|
ef933ae156 | ||
|
|
0f7ab62ac9 | ||
|
|
f81afa8282 | ||
|
|
45b4cc19d0 | ||
|
|
14a28a729e | ||
|
|
720f4aea86 | ||
|
|
c12b1df4ed | ||
|
|
c61f8b72fa | ||
|
|
edbc8b604d | ||
|
|
5ea223355a | ||
|
|
cd8a82d4fd | ||
|
|
cf938b0549 | ||
|
|
268d4c4f44 | ||
|
|
2e3603d228 | ||
|
|
5971767590 | ||
|
|
535ea6c7f0 | ||
|
|
600f7c1fa4 | ||
|
|
4b59b5a70d | ||
|
|
95ea0ba696 | ||
|
|
071d395635 | ||
|
|
7cfcace573 | ||
|
|
04f9b9bb5f | ||
|
|
2b9e8e9b22 | ||
|
|
4929d829f2 | ||
|
|
cfe65b2e64 | ||
|
|
88e48a8aca | ||
|
|
31aa04e99c | ||
|
|
571fe1e26b | ||
|
|
041b97464c | ||
|
|
fbdcaaf4f8 | ||
|
|
ec4562c7f2 | ||
|
|
8808124cc3 | ||
|
|
bc3970f9e3 | ||
|
|
d3553f5ec4 | ||
|
|
0cab554f7d | ||
|
|
75123fd64e | ||
|
|
0f41e41c8c | ||
|
|
a58e722bee | ||
|
|
c640efa6e1 | ||
|
|
d4049eeffb | ||
|
|
906c587fcd | ||
|
|
99399d30fc |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,8 +1,5 @@
|
|||||||
deploy/*
|
deploy/*
|
||||||
work/*
|
work/*
|
||||||
config
|
|
||||||
postrun.sh
|
postrun.sh
|
||||||
SKIP
|
|
||||||
SKIP_IMAGES
|
|
||||||
.pc
|
.pc
|
||||||
*-pc
|
*-pc
|
||||||
|
|||||||
@@ -443,7 +443,7 @@ To resolve this, ensure that the following files are available (install them if
|
|||||||
|
|
||||||
```
|
```
|
||||||
/lib/modules/$(uname -r)/kernel/fs/binfmt_misc.ko
|
/lib/modules/$(uname -r)/kernel/fs/binfmt_misc.ko
|
||||||
/usr/bin/qemu-arm-static
|
/usr/bin/qemu-aarch64-static
|
||||||
```
|
```
|
||||||
|
|
||||||
You may also need to load the module by hand - run `modprobe binfmt_misc`.
|
You may also need to load the module by hand - run `modprobe binfmt_misc`.
|
||||||
|
|||||||
14
README_AURACAST_SYSTEM.md
Normal file
14
README_AURACAST_SYSTEM.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# Build
|
||||||
|
- Always use the docker build script
|
||||||
|
- sudo bash build-docker.sh
|
||||||
|
|
||||||
|
# System
|
||||||
|
- Extended stage2 with customizations
|
||||||
|
- this builds a 'lite' version of the system, featuring also basic development tools
|
||||||
|
- deactivate wifi and bluetooth (wifi can be deactivated, bt has bt-disable overlay)
|
||||||
|
- install docker
|
||||||
|
- install poetry
|
||||||
|
- install wireguard
|
||||||
|
|
||||||
|
# Migrate
|
||||||
|
- move to rpi-image-gen in the future: https://github.com/raspberrypi/rpi-image-gen
|
||||||
@@ -82,16 +82,7 @@ fi
|
|||||||
# Modify original build-options to allow config file to be mounted in the docker container
|
# Modify original build-options to allow config file to be mounted in the docker container
|
||||||
BUILD_OPTS="$(echo "${BUILD_OPTS:-}" | sed -E 's@\-c\s?([^ ]+)@-c /config@')"
|
BUILD_OPTS="$(echo "${BUILD_OPTS:-}" | sed -E 's@\-c\s?([^ ]+)@-c /config@')"
|
||||||
|
|
||||||
# Check the arch of the machine we're running on. If it's 64-bit, use a 32-bit base image instead
|
${DOCKER} build --build-arg BASE_IMAGE=debian:bookworm -t pi-gen "${DIR}"
|
||||||
case "$(uname -m)" in
|
|
||||||
x86_64|aarch64)
|
|
||||||
BASE_IMAGE=i386/debian:bookworm
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
BASE_IMAGE=debian:bookworm
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
${DOCKER} build --build-arg BASE_IMAGE=${BASE_IMAGE} -t pi-gen "${DIR}"
|
|
||||||
|
|
||||||
if [ "${CONTAINER_EXISTS}" != "" ]; then
|
if [ "${CONTAINER_EXISTS}" != "" ]; then
|
||||||
DOCKER_CMDLINE_NAME="${CONTAINER_NAME}_cont"
|
DOCKER_CMDLINE_NAME="${CONTAINER_NAME}_cont"
|
||||||
@@ -114,10 +105,10 @@ case $(uname -m) in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if qemu-arm-static and /proc/sys/fs/binfmt_misc are present
|
# Check if qemu-aarch64-static and /proc/sys/fs/binfmt_misc are present
|
||||||
if [[ "${binfmt_misc_required}" == "1" ]]; then
|
if [[ "${binfmt_misc_required}" == "1" ]]; then
|
||||||
if ! qemu_arm=$(which qemu-arm-static) ; then
|
if ! qemu_arm=$(which qemu-aarch64-static) ; then
|
||||||
echo "qemu-arm-static not found (please install qemu-user-static)"
|
echo "qemu-aarch64-static not found (please install qemu-user-static)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ ! -f /proc/sys/fs/binfmt_misc/register ]; then
|
if [ ! -f /proc/sys/fs/binfmt_misc/register ]; then
|
||||||
@@ -128,13 +119,13 @@ if [[ "${binfmt_misc_required}" == "1" ]]; then
|
|||||||
fi
|
fi
|
||||||
echo "binfmt_misc mounted"
|
echo "binfmt_misc mounted"
|
||||||
fi
|
fi
|
||||||
if ! grep -q "^interpreter ${qemu_arm}" /proc/sys/fs/binfmt_misc/qemu-arm* ; then
|
if ! grep -q "^interpreter ${qemu_arm}" /proc/sys/fs/binfmt_misc/qemu-aarch64* ; then
|
||||||
# Register qemu-arm for binfmt_misc
|
# Register qemu-aarch64 for binfmt_misc
|
||||||
reg="echo ':qemu-arm-rpi:M::"\
|
reg="echo ':qemu-aarch64-rpi:M::"\
|
||||||
"\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:"\
|
"\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:"\
|
||||||
"\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:"\
|
"\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:"\
|
||||||
"${qemu_arm}:F' > /proc/sys/fs/binfmt_misc/register"
|
"${qemu_arm}:F' > /proc/sys/fs/binfmt_misc/register"
|
||||||
echo "Registering qemu-arm for binfmt_misc..."
|
echo "Registering qemu-aarch64 for binfmt_misc..."
|
||||||
sudo bash -c "${reg}" 2>/dev/null || true
|
sudo bash -c "${reg}" 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
2
build.sh
2
build.sh
@@ -175,7 +175,7 @@ export PI_GEN=${PI_GEN:-pi-gen}
|
|||||||
export PI_GEN_REPO=${PI_GEN_REPO:-https://github.com/RPi-Distro/pi-gen}
|
export PI_GEN_REPO=${PI_GEN_REPO:-https://github.com/RPi-Distro/pi-gen}
|
||||||
export PI_GEN_RELEASE=${PI_GEN_RELEASE:-Raspberry Pi reference}
|
export PI_GEN_RELEASE=${PI_GEN_RELEASE:-Raspberry Pi reference}
|
||||||
|
|
||||||
export ARCH=armhf
|
export ARCH=arm64
|
||||||
export RELEASE=${RELEASE:-bookworm} # Don't forget to update stage0/prerun.sh
|
export RELEASE=${RELEASE:-bookworm} # Don't forget to update stage0/prerun.sh
|
||||||
export IMG_NAME="${IMG_NAME:-raspios-$RELEASE-$ARCH}"
|
export IMG_NAME="${IMG_NAME:-raspios-$RELEASE-$ARCH}"
|
||||||
|
|
||||||
|
|||||||
9
config
Normal file
9
config
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
TIMEZONE_DEFAULT='Europe/Vienna'
|
||||||
|
IMG_NAME='iot-system'
|
||||||
|
DEPLOY_COMPRESSION=xz
|
||||||
|
ENABLE_SSH=1
|
||||||
|
TARGET_HOSTNAME=auracaster
|
||||||
|
FIRST_USER_NAME=caster
|
||||||
|
FIRST_USER_PASS=pw
|
||||||
|
|
||||||
|
STAGE_LIST="stage0 stage1 stage2"
|
||||||
@@ -1,18 +1,15 @@
|
|||||||
{
|
{
|
||||||
"description": "NOOBS_DESCRIPTION",
|
"description": "NOOBS_DESCRIPTION",
|
||||||
"feature_level": 35120124,
|
|
||||||
"kernel": "KERNEL",
|
"kernel": "KERNEL",
|
||||||
"name": "NOOBS_NAME",
|
"name": "NOOBS_NAME",
|
||||||
"password": "raspberry",
|
"password": "raspberry",
|
||||||
"release_date": "UNRELEASED",
|
"release_date": "UNRELEASED",
|
||||||
"supported_hex_revisions": "2,3,4,5,6,7,8,9,d,e,f,10,11,12,14,19,1040,1041,0092,0093,2082",
|
|
||||||
"supported_models": [
|
"supported_models": [
|
||||||
"Pi Model",
|
"Pi Zero 2",
|
||||||
"Pi 2",
|
|
||||||
"Pi Zero",
|
|
||||||
"Pi 3",
|
"Pi 3",
|
||||||
|
"Pi 4",
|
||||||
"Pi Compute Module 3",
|
"Pi Compute Module 3",
|
||||||
"Pi 4"
|
"Pi Compute Module 4"
|
||||||
],
|
],
|
||||||
"url": "http://www.raspbian.org/",
|
"url": "http://www.raspbian.org/",
|
||||||
"username": "pi",
|
"username": "pi",
|
||||||
|
|||||||
204
flash_sdcard.sh
Executable file
204
flash_sdcard.sh
Executable file
@@ -0,0 +1,204 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Script to flash the Auracaster System image to an SD card
|
||||||
|
# This script must be run with sudo privileges
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Configuration
|
||||||
|
IMAGE_FILE="./work/iot-system/export-image/2025-04-23-iot-system-lite.img"
|
||||||
|
AUTO_YES=false
|
||||||
|
|
||||||
|
# Parse command line arguments
|
||||||
|
while getopts "y" opt; do
|
||||||
|
case $opt in
|
||||||
|
y)
|
||||||
|
AUTO_YES=true
|
||||||
|
;;
|
||||||
|
\?)
|
||||||
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
shift $((OPTIND -1))
|
||||||
|
|
||||||
|
# Require image file argument
|
||||||
|
if [ $# -lt 1 ]; then
|
||||||
|
echo "Usage: sudo $0 [-y] <path-to-image-file.img>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
IMAGE_FILE="$1"
|
||||||
|
|
||||||
|
# Check if script is run as root
|
||||||
|
if [ "$(id -u)" -ne 0 ]; then
|
||||||
|
echo "Error: This script must be run as root (sudo)."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if image exists
|
||||||
|
if [ ! -f "$IMAGE_FILE" ]; then
|
||||||
|
echo "Error: Image file not found at $IMAGE_FILE"
|
||||||
|
echo "You need to build the project first."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Find SD cards (both removable devices and mmcblk devices)
|
||||||
|
echo "Looking for SD cards..."
|
||||||
|
echo
|
||||||
|
|
||||||
|
# Get list of potential SD cards (both removable devices and mmcblk devices)
|
||||||
|
SD_CARDS=$(lsblk -d -o NAME,SIZE,MODEL,VENDOR,TRAN,RM | grep -v "loop" | grep -E '(1$|mmcblk)' | awk '{print $1}')
|
||||||
|
SD_CARD_COUNT=$(echo "$SD_CARDS" | grep -v "^$" | wc -l)
|
||||||
|
|
||||||
|
if [ "$SD_CARD_COUNT" -eq 0 ]; then
|
||||||
|
echo "No SD cards found. Please insert an SD card and try again."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Display available SD cards
|
||||||
|
echo "Available SD cards:"
|
||||||
|
echo
|
||||||
|
lsblk -d -o NAME,SIZE,MODEL,VENDOR,TRAN,RM | head -n 1
|
||||||
|
lsblk -d -o NAME,SIZE,MODEL,VENDOR,TRAN,RM | grep -v "loop" | grep -E '(1$|mmcblk)'
|
||||||
|
echo
|
||||||
|
|
||||||
|
# Safety check - get list of internal disks to avoid (exclude mmcblk devices from this check)
|
||||||
|
INTERNAL_DISKS=$(lsblk -d -o NAME,RM | grep -E '0$' | grep -v "mmcblk" | awk '{print $1}')
|
||||||
|
|
||||||
|
# Select SD card
|
||||||
|
DEVICE=""
|
||||||
|
if [ "$SD_CARD_COUNT" -eq 1 ]; then
|
||||||
|
DEVICE=$(echo "$SD_CARDS" | tr -d '[:space:]')
|
||||||
|
echo "Found single SD card: /dev/$DEVICE"
|
||||||
|
else
|
||||||
|
echo "Multiple SD cards found. Please select which one to use:"
|
||||||
|
select DEVICE in $SD_CARDS; do
|
||||||
|
if [ -n "$DEVICE" ]; then
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo "Invalid selection. Please try again."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Safety check - ensure we're not flashing to an internal disk
|
||||||
|
if echo "$INTERNAL_DISKS" | grep -q "$DEVICE"; then
|
||||||
|
echo "ERROR: Selected device /dev/$DEVICE appears to be an internal disk!"
|
||||||
|
echo "This script will only flash to removable devices or mmcblk devices for safety."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Validate device exists
|
||||||
|
if [[ "$DEVICE" == mmcblk* ]]; then
|
||||||
|
DEV_PATH="/dev/$DEVICE"
|
||||||
|
else
|
||||||
|
DEV_PATH="/dev/$DEVICE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -b "$DEV_PATH" ]; then
|
||||||
|
echo "Error: Device $DEV_PATH does not exist or is not a block device."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Double-check with clear warning
|
||||||
|
echo
|
||||||
|
echo "You are about to erase ALL DATA on $DEV_PATH and write the pi-gen built image ($IMAGE_FILE) to it."
|
||||||
|
echo "This operation cannot be undone."
|
||||||
|
echo
|
||||||
|
|
||||||
|
# Check if pv is available for better progress display
|
||||||
|
if command -v pv >/dev/null 2>&1; then
|
||||||
|
# Get image size for pv
|
||||||
|
IMAGE_SIZE=$(stat -c %s "$IMAGE_FILE")
|
||||||
|
|
||||||
|
# Show the command that will be executed with pv
|
||||||
|
FLASH_COMMAND="pv -s $IMAGE_SIZE \"$IMAGE_FILE\" | dd of=\"$DEV_PATH\" bs=4M conv=fsync oflag=direct"
|
||||||
|
echo "The following command will be executed (with progress bar):"
|
||||||
|
echo "$FLASH_COMMAND"
|
||||||
|
else
|
||||||
|
# Fallback to dd with status=progress
|
||||||
|
FLASH_COMMAND="dd if=\"$IMAGE_FILE\" of=\"$DEV_PATH\" bs=4M status=progress conv=fsync oflag=direct"
|
||||||
|
echo "The following command will be executed:"
|
||||||
|
echo "$FLASH_COMMAND"
|
||||||
|
echo "For better progress visualization, consider installing 'pv' (Pipe Viewer)."
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
|
||||||
|
if [ "$AUTO_YES" = true ]; then
|
||||||
|
CONFIRM="y"
|
||||||
|
echo "Auto-confirming with -y flag"
|
||||||
|
else
|
||||||
|
read -p "Are you ABSOLUTELY SURE you want to continue? (y/n): " CONFIRM
|
||||||
|
|
||||||
|
if [ "$CONFIRM" != "y" ]; then
|
||||||
|
echo "Operation cancelled."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Unmount any partitions on the device, reporting failures
|
||||||
|
echo "Unmounting any mounted partitions on $DEV_PATH..."
|
||||||
|
UNMOUNT_FAILED=0
|
||||||
|
if [[ "$DEVICE" == mmcblk* ]]; then
|
||||||
|
for partition in $(lsblk -n -o NAME | grep "^$DEVICE"); do
|
||||||
|
if [ "$partition" != "$DEVICE" ]; then
|
||||||
|
if mount | grep -q "/dev/$partition"; then
|
||||||
|
umount "/dev/$partition" 2>/dev/null || {
|
||||||
|
echo "Warning: Failed to unmount /dev/$partition" >&2
|
||||||
|
UNMOUNT_FAILED=1
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
for partition in $(lsblk -n -o NAME /dev/$DEVICE | grep -v "^$DEVICE$"); do
|
||||||
|
if mount | grep -q "/dev/$partition"; then
|
||||||
|
umount "/dev/$partition" 2>/dev/null || {
|
||||||
|
echo "Warning: Failed to unmount /dev/$partition" >&2
|
||||||
|
UNMOUNT_FAILED=1
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
if [ $UNMOUNT_FAILED -eq 1 ]; then
|
||||||
|
echo "Some partitions could not be unmounted. Please close any open files or applications using the SD card and try again." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# Check for open files on the device
|
||||||
|
if lsof | grep -q "/dev/$DEVICE"; then
|
||||||
|
echo "Warning: Open files detected on /dev/$DEVICE. Please close them before flashing to avoid corruption." >&2
|
||||||
|
lsof | grep "/dev/$DEVICE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Flash the image
|
||||||
|
echo "Flashing image to $DEV_PATH..."
|
||||||
|
echo "This may take several minutes. Please wait..."
|
||||||
|
echo
|
||||||
|
|
||||||
|
# Execute the flashing command
|
||||||
|
eval "$FLASH_COMMAND"
|
||||||
|
|
||||||
|
# Sync to ensure all writes are complete
|
||||||
|
sync
|
||||||
|
|
||||||
|
# Remind user to eject the card safely
|
||||||
|
echo "Flash complete! SD card is ready with the pi-gen built image."
|
||||||
|
echo
|
||||||
|
# Re-read the partition table to ensure the system recognizes the new layout
|
||||||
|
echo "Running partprobe to re-read the partition table on $DEV_PATH..."
|
||||||
|
if partprobe "$DEV_PATH"; then
|
||||||
|
echo "Partition table re-read successfully. The SD card is ready for use."
|
||||||
|
else
|
||||||
|
echo "Warning: partprobe failed. If partitions do not show up, try reinserting the SD card."
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
# Instructions for next steps
|
||||||
|
echo "1. Insert the SD card into your Raspberry Pi 3"
|
||||||
|
echo "2. Power on the device"
|
||||||
|
echo
|
||||||
|
|
||||||
|
exit 0
|
||||||
@@ -9,15 +9,16 @@ bootstrap(){
|
|||||||
|
|
||||||
export http_proxy=${APT_PROXY}
|
export http_proxy=${APT_PROXY}
|
||||||
|
|
||||||
BOOTSTRAP_ARGS+=(--arch armhf)
|
BOOTSTRAP_ARGS+=(--arch arm64)
|
||||||
|
BOOTSTRAP_ARGS+=(--include gnupg)
|
||||||
BOOTSTRAP_ARGS+=(--components "main,contrib,non-free")
|
BOOTSTRAP_ARGS+=(--components "main,contrib,non-free")
|
||||||
BOOTSTRAP_ARGS+=(--keyring "${STAGE_DIR}/files/raspberrypi.gpg")
|
#BOOTSTRAP_ARGS+=(--keyring "${STAGE_DIR}/files/raspberrypi.gpg")
|
||||||
BOOTSTRAP_ARGS+=(--exclude=info,ifupdown)
|
BOOTSTRAP_ARGS+=(--exclude=info,ifupdown)
|
||||||
BOOTSTRAP_ARGS+=(--include=ca-certificates)
|
BOOTSTRAP_ARGS+=(--include=ca-certificates)
|
||||||
BOOTSTRAP_ARGS+=("$@")
|
BOOTSTRAP_ARGS+=("$@")
|
||||||
printf -v BOOTSTRAP_STR '%q ' "${BOOTSTRAP_ARGS[@]}"
|
printf -v BOOTSTRAP_STR '%q ' "${BOOTSTRAP_ARGS[@]}"
|
||||||
|
|
||||||
setarch linux32 capsh $CAPSH_ARG -- -c "'${BOOTSTRAP_CMD}' $BOOTSTRAP_STR" || true
|
capsh $CAPSH_ARG -- -c "'${BOOTSTRAP_CMD}' $BOOTSTRAP_STR" || true
|
||||||
|
|
||||||
if [ -d "$2/debootstrap" ] && ! rmdir "$2/debootstrap"; then
|
if [ -d "$2/debootstrap" ] && ! rmdir "$2/debootstrap"; then
|
||||||
cp "$2/debootstrap/debootstrap.log" "${STAGE_WORK_DIR}"
|
cp "$2/debootstrap/debootstrap.log" "${STAGE_WORK_DIR}"
|
||||||
@@ -100,7 +101,7 @@ on_chroot() {
|
|||||||
mount -t tmpfs tmpfs "${ROOTFS_DIR}/tmp"
|
mount -t tmpfs tmpfs "${ROOTFS_DIR}/tmp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setarch linux32 capsh $CAPSH_ARG "--chroot=${ROOTFS_DIR}/" -- -e "$@"
|
capsh $CAPSH_ARG "--chroot=${ROOTFS_DIR}/" -- -e "$@"
|
||||||
}
|
}
|
||||||
export -f on_chroot
|
export -f on_chroot
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
deb [ arch=armhf ] http://raspbian.raspberrypi.com/raspbian/ RELEASE main contrib non-free rpi
|
deb http://deb.debian.org/debian RELEASE main contrib non-free non-free-firmware
|
||||||
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
|
deb http://deb.debian.org/debian-security/ RELEASE-security main contrib non-free non-free-firmware
|
||||||
#deb-src http://raspbian.raspberrypi.com/raspbian/ RELEASE main contrib non-free rpi
|
deb http://deb.debian.org/debian RELEASE-updates main contrib non-free non-free-firmware
|
||||||
|
# Uncomment deb-src lines below then 'apt-get update' to enable 'apt-get source'
|
||||||
|
#deb-src http://deb.debian.org/debian RELEASE main contrib non-free non-free-firmware
|
||||||
|
#deb-src http://deb.debian.org/debian-security/ RELEASE-security main contrib non-free non-free-firmware
|
||||||
|
#deb-src http://deb.debian.org/debian RELEASE-updates main contrib non-free non-free-firmware
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
initramfs-tools
|
initramfs-tools
|
||||||
raspi-firmware
|
raspi-firmware
|
||||||
linux-image-rpi-v6
|
|
||||||
linux-image-rpi-v7
|
|
||||||
linux-image-rpi-v7l
|
|
||||||
linux-image-rpi-v8
|
linux-image-rpi-v8
|
||||||
linux-headers-rpi-v6
|
linux-image-rpi-2712
|
||||||
linux-headers-rpi-v7
|
linux-headers-rpi-v8
|
||||||
linux-headers-rpi-v7l
|
linux-headers-rpi-2712
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ if [ "$RELEASE" != "bookworm" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d "${ROOTFS_DIR}" ]; then
|
if [ ! -d "${ROOTFS_DIR}" ]; then
|
||||||
bootstrap ${RELEASE} "${ROOTFS_DIR}" http://raspbian.raspberrypi.com/raspbian/
|
bootstrap ${RELEASE} "${ROOTFS_DIR}" http://deb.debian.org/debian/
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ dtparam=audio=on
|
|||||||
# /boot/firmware/overlays/README
|
# /boot/firmware/overlays/README
|
||||||
|
|
||||||
# Automatically load overlays for detected cameras
|
# Automatically load overlays for detected cameras
|
||||||
camera_auto_detect=1
|
camera_auto_detect=0
|
||||||
|
|
||||||
# Automatically load overlays for detected DSI displays
|
# Automatically load overlays for detected DSI displays
|
||||||
display_auto_detect=1
|
display_auto_detect=1
|
||||||
@@ -30,6 +30,9 @@ max_framebuffers=2
|
|||||||
# Use the kernel's default instead.
|
# Use the kernel's default instead.
|
||||||
disable_fw_kms_setup=1
|
disable_fw_kms_setup=1
|
||||||
|
|
||||||
|
# Run in 64-bit mode
|
||||||
|
arm_64bit=1
|
||||||
|
|
||||||
# Disable compensation for displays with overscan
|
# Disable compensation for displays with overscan
|
||||||
disable_overscan=1
|
disable_overscan=1
|
||||||
|
|
||||||
@@ -46,3 +49,15 @@ otg_mode=1
|
|||||||
dtoverlay=dwc2,dr_mode=host
|
dtoverlay=dwc2,dr_mode=host
|
||||||
|
|
||||||
[all]
|
[all]
|
||||||
|
|
||||||
|
# uart debug enable on GPIO14/15
|
||||||
|
enable_uart=1
|
||||||
|
uart_2ndstage=1
|
||||||
|
dtparam=uart0_console
|
||||||
|
dtdebug=1
|
||||||
|
|
||||||
|
# for auracaster project
|
||||||
|
dtoverlay=disable-bt
|
||||||
|
dtoverlay=disable-wifi
|
||||||
|
dtoverlay=uart3,ctsrts
|
||||||
|
dtoverlay=uart4,ctsrts
|
||||||
@@ -1 +0,0 @@
|
|||||||
raspi-copies-and-fills
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash -e
|
|
||||||
|
|
||||||
if [ -f "${ROOTFS_DIR}/etc/ld.so.preload" ]; then
|
|
||||||
mv "${ROOTFS_DIR}/etc/ld.so.preload" "${ROOTFS_DIR}/etc/ld.so.preload.disabled"
|
|
||||||
fi
|
|
||||||
|
|
||||||
111
stage2/04-auracaster_customization/00-run-chroot.sh
Executable file
111
stage2/04-auracaster_customization/00-run-chroot.sh
Executable file
@@ -0,0 +1,111 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# do some checks first
|
||||||
|
echo "DEBUG: Listing /home"
|
||||||
|
ls -l /home
|
||||||
|
echo "DEBUG: Checking for python3"
|
||||||
|
which python3 || echo "python3 not found"
|
||||||
|
echo "DEBUG: Checking user 'caster'"
|
||||||
|
id caster || echo "user caster not found"
|
||||||
|
|
||||||
|
|
||||||
|
# Add Docker's official GPG key:
|
||||||
|
# apt-get update
|
||||||
|
# apt-get install -y ca-certificates curl
|
||||||
|
# install -m 0755 -d /etc/apt/keyrings
|
||||||
|
# curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
|
||||||
|
# chmod a+r /etc/apt/keyrings/docker.asc
|
||||||
|
|
||||||
|
# # Add the repository to Apt sources:
|
||||||
|
# echo \
|
||||||
|
# "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
|
||||||
|
# bookworm stable" | \
|
||||||
|
# tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
# apt-get update
|
||||||
|
# apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
||||||
|
|
||||||
|
# # Ensure docker group exists and add main user to it
|
||||||
|
# DOCKER_GROUP=docker
|
||||||
|
# if ! getent group "$DOCKER_GROUP" > /dev/null; then
|
||||||
|
# groupadd "$DOCKER_GROUP"
|
||||||
|
# fi
|
||||||
|
# # Use FIRST_USER_NAME if set, else default to 'pi'
|
||||||
|
# USER_TO_ADD="${FIRST_USER_NAME:-pi}"
|
||||||
|
# usermod -aG "$DOCKER_GROUP" "$USER_TO_ADD" || true
|
||||||
|
# docker compose version
|
||||||
|
|
||||||
|
# Install Python Poetry for caster user (official installer)
|
||||||
|
su - caster -c "curl -sSL https://install.python-poetry.org | python3 -"
|
||||||
|
|
||||||
|
# Add Poetry to PATH for caster user
|
||||||
|
CASTER_BASHRC="/home/caster/.bashrc"
|
||||||
|
if ! grep -q 'export PATH="/home/caster/.local/bin:$PATH"' "$CASTER_BASHRC" 2>/dev/null; then
|
||||||
|
echo 'export PATH="/home/caster/.local/bin:$PATH"' >> "$CASTER_BASHRC"
|
||||||
|
chown caster: "$CASTER_BASHRC"
|
||||||
|
fi
|
||||||
|
/home/caster/.local/bin/poetry config virtualenvs.in-project true
|
||||||
|
|
||||||
|
# setup audio
|
||||||
|
apt install -y ethtool linuxptp pipewire
|
||||||
|
apt remove -y libportaudio2 portaudio19-dev libportaudiocpp0
|
||||||
|
|
||||||
|
apt install -y --no-install-recommends \
|
||||||
|
git build-essential cmake pkg-config \
|
||||||
|
libasound2-dev libpulse-dev
|
||||||
|
|
||||||
|
if [ ! -d portaudio ]; then
|
||||||
|
git clone https://github.com/PortAudio/portaudio.git
|
||||||
|
# use static commit
|
||||||
|
cd portaudio
|
||||||
|
git checkout 9abe5fe7db729280080a0bbc1397a528cd3ce658
|
||||||
|
rm -rf build
|
||||||
|
# TODO: determine which backends to use, maybe only use pipewire
|
||||||
|
cmake -S . -B build -G"Unix Makefiles" \
|
||||||
|
-DBUILD_SHARED_LIBS=ON \
|
||||||
|
-DPA_USE_ALSA=ON \
|
||||||
|
-DPA_USE_PULSEAUDIO=ON \
|
||||||
|
-DPA_USE_JACK=OFF
|
||||||
|
else
|
||||||
|
cd portaudio
|
||||||
|
fi
|
||||||
|
|
||||||
|
cmake --build build -j$(nproc)
|
||||||
|
cmake --install build # installs to /usr/local/lib
|
||||||
|
ldconfig # refresh linker cache
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# # install openocd
|
||||||
|
apt install git build-essential libtool autoconf texinfo libusb-1.0-0-dev libftdi1-dev libhidapi-dev pkg-config -y
|
||||||
|
apt-get install pkg-config libjim-dev -y
|
||||||
|
if [ ! -d openocd ]; then
|
||||||
|
git clone --recurse-submodules https://github.com/raspberrypi/openocd.git
|
||||||
|
cd openocd
|
||||||
|
git fetch --all
|
||||||
|
git checkout 8b8c9731a514d3e4dd367d4e77826711201b81b3
|
||||||
|
./bootstrap
|
||||||
|
./configure --enable-bcm2835gpio --enable-sysfsgpio
|
||||||
|
else
|
||||||
|
cd openocd
|
||||||
|
fi
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# Install WireGuard
|
||||||
|
#apt-get install -y wireguard wireguard-tools
|
||||||
|
|
||||||
|
# Disable WiFi
|
||||||
|
# Option 1: Mask wpa_supplicant (prevents WiFi client connections)
|
||||||
|
systemctl mask wpa_supplicant.service || true
|
||||||
|
# Option 2: Remove wpa_supplicant package (removes WiFi client capability)
|
||||||
|
# apt-get remove -y wpa_supplicant
|
||||||
|
# Option 3: (Optional, not always necessary) Block WiFi radio with rfkill
|
||||||
|
apt-get install -y rfkill && rfkill block wifi || true
|
||||||
|
# Note: rfkill is not strictly necessary if you mask/remove wpa_supplicant, but it disables the radio at a lower level.
|
||||||
|
|
||||||
|
# Disable Bluetooth service
|
||||||
|
systemctl mask bluetooth.service || true
|
||||||
|
systemctl disable hciuart.service || true
|
||||||
|
|
||||||
|
touch /root/CUSTOM_STAGE_WORKED
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-libav
|
gstreamer1.0-x gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-libav
|
||||||
evince gtk2-engines alsa-utils
|
evince gtk2-engines alsa-utils
|
||||||
desktop-base
|
desktop-base
|
||||||
git
|
git
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
xserver-xorg-video-fbdev xserver-xorg xinit
|
xserver-xorg xinit
|
||||||
mousepad
|
mousepad
|
||||||
eom
|
eom
|
||||||
lxde lxtask menu-xdg
|
lxde lxtask menu-xdg
|
||||||
|
|||||||
0
stage3/SKIP
Normal file
0
stage3/SKIP
Normal file
0
stage4/SKIP
Normal file
0
stage4/SKIP
Normal file
0
stage4/SKIP_IMAGES
Normal file
0
stage4/SKIP_IMAGES
Normal file
0
stage5/SKIP
Normal file
0
stage5/SKIP
Normal file
0
stage5/SKIP_IMAGES
Normal file
0
stage5/SKIP_IMAGES
Normal file
Reference in New Issue
Block a user