Skip to content

Commit 7c622bb

Browse files
authored
Stop mounting partition 1 as /boot (#120)
Raspberry Pi OS's prior to Bookworm would mount partition 1 as /boot. This is the default behavior for the arm-runner-action that we were using to create images and this behavior was copied in the photon-image-runner that we now use. However, mounting this partition as /boot shadows the real /boot and prevents modifying the contents of that directory. This turns up as a problem when we try to modify the dtoverlay. On Raspberry Pi images from Bookworm, partition 1 is mounted as /boot/firmware. On the Orange Pi images we use, partition 1 is a data folder for cloud-init and should be mounted at /CIDATA. This PR overrides the automatic mounting of partition 1 and instead leaves it to the appropriate install script to mount any partitions other than root as appropriate for that image.
1 parent 85558ff commit 7c622bb

File tree

10 files changed

+78
-21
lines changed

10 files changed

+78
-21
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,13 @@ jobs:
9898
minimum_free_mb: 2000
9999
image_url: ${{ matrix.base_image }}
100100
root_location: ${{ matrix.root_location || 'partition=2' }}
101+
boot_partition:
101102
shrink_image: ${{ matrix.shrink_image || 'yes' }}
102103
commands: |
103104
set -e
104105
echo "Running ${{ matrix.script }}"
105106
chmod +x "${{ matrix.script }}"
106-
"./${{ matrix.script }}"
107+
"./${{ matrix.script }}" "Dev"
107108
echo "Running install_common.sh"
108109
chmod +x "./install_common.sh"
109110
"./install_common.sh"

install_dev_pi.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
# Exit on errors, print commands, ignore unset variables
44
set -ex +u
55

6+
# mount partition 1 as /boot/firmware
7+
mkdir --parent /boot/firmware
8+
mount "${loopdev}p1" /boot/firmware
9+
ls -la /boot/firmware
10+
611
# silence log spam from dpkg
712
cat > /etc/apt/apt.conf.d/99dpkg.conf << EOF
813
Dpkg::Progress-Fancy "0";
@@ -15,8 +20,8 @@ chmod +x ./install.sh
1520
./install.sh --install-nm=yes --arch=aarch64
1621

1722
# and edit boot partition
18-
install -m 644 config.txt /boot/
19-
install -m 644 userconf.txt /boot/
23+
install -m 644 config.txt /boot/firmware
24+
install -m 644 userconf.txt /boot/firmware
2025

2126
# configure hostname
2227
echo "photonvision" > /etc/hostname
@@ -46,3 +51,5 @@ apt-get clean
4651

4752
rm -rf /usr/share/doc
4853
rm -rf /usr/share/locale/
54+
55+
umount /boot/firmware

install_limelight.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
# Exit on errors, print commands, ignore unset variables
44
set -ex +u
55

6+
# mount partition 1 as /boot/firmware
7+
mkdir --parent /boot/firmware
8+
mount "${loopdev}p1" /boot/firmware
9+
ls -la /boot/firmware
10+
611
# silence log spam from dpkg
712
cat > /etc/apt/apt.conf.d/99dpkg.conf << EOF
813
Dpkg::Progress-Fancy "0";
@@ -15,11 +20,11 @@ chmod +x ./install.sh
1520
./install.sh --install-nm=yes --arch=aarch64 --version="$1"
1621

1722
# edit boot partition
18-
install -m 644 limelight/config.txt /boot/
19-
install -m 644 userconf.txt /boot/
23+
install -m 644 limelight/config.txt /boot/firmware/
24+
install -m 644 userconf.txt /boot/firmware/
2025

2126
# install LL DTS
22-
dtc -O dtb limelight/gloworm-dt.dts -o /boot/dt-blob.bin
27+
dtc -O dtb limelight/gloworm-dt.dts -o /boot/firmware/dt-blob.bin
2328

2429
# Kill wifi and other networking things
2530
install -v -m 644 -D -t /etc/systemd/system/dhcpcd.service.d/ files/wait.conf
@@ -45,3 +50,5 @@ apt-get clean
4550

4651
rm -rf /usr/share/doc
4752
rm -rf /usr/share/locale/
53+
54+
umount /boot/firmware

install_limelight3.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ set -ex +u
55

66
# Run the pi install script
77
chmod +x ./install_pi.sh
8-
./install_pi.sh
8+
./install_pi.sh "$1"
9+
10+
# mount partition 1 as /boot/firmware
11+
mkdir --parent /boot/firmware
12+
mount "${loopdev}p1" /boot/firmware
13+
ls -la /boot/firmware
914

1015
# Add the one extra file for the LL3
11-
wget https://datasheets.raspberrypi.org/cmio/dt-blob-cam1.bin -O /boot/dt-blob.bin
16+
wget https://datasheets.raspberrypi.org/cmio/dt-blob-cam1.bin -O /boot/firmware/dt-blob.bin
17+
18+
umount /boot/firmware

install_limelight3g.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,17 @@ set -ex +u
55

66
# Run the pi install script
77
chmod +x ./install_pi.sh
8-
./install_pi.sh
8+
./install_pi.sh "$1"
9+
10+
# mount partition 1 as /boot/firmware
11+
mkdir --parent /boot/firmware
12+
mount "${loopdev}p1" /boot/firmware
13+
ls -la /boot/firmware
914

1015
# Install our new config.txt with OV9281 overlay
11-
install -m 644 limelight3g/config.txt /boot/
16+
install -m 644 limelight3g/config.txt /boot/firmware
1217

1318
# Add the one extra file for the LL3
14-
wget https://datasheets.raspberrypi.org/cmio/dt-blob-cam1.bin -O /boot/dt-blob.bin
19+
wget https://datasheets.raspberrypi.org/cmio/dt-blob-cam1.bin -O /boot/firmware/dt-blob.bin
20+
21+
umount /boot/firmware

install_limelight4.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ set -ex +u
55

66
# Run the pi install script
77
chmod +x ./install_pi.sh
8-
./install_pi.sh
8+
./install_pi.sh "$1"
9+
10+
# mount partition 1 as /boot/firmware
11+
mkdir --parent /boot/firmware
12+
mount "${loopdev}p1" /boot/firmware
13+
ls -la /boot/firmware
914

1015
# Install our new config.txt with OV9281 overlay
11-
install -m 644 limelight4/config.txt /boot/
16+
install -m 644 limelight4/config.txt /boot/firmware
17+
18+
umount /boot/firmware

install_luma_p1.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@ set -ex +u
55

66
# Run the pi install script
77
chmod +x ./install_pi.sh
8-
./install_pi.sh
8+
./install_pi.sh "$1"
9+
10+
# mount partition 1 as /boot/firmware
11+
mkdir --parent /boot/firmware
12+
mount "${loopdev}p1" /boot/firmware
13+
ls -la /boot/firmware
914

1015
# Install our new config.txt with OV9281 overlay
11-
install -m 644 luma_p1/config.txt /boot/
16+
install -m 644 luma_p1/config.txt /boot/firmware
1217

1318
# Add the database file for the p1 hardware config and default pipeline
1419
mkdir -p /opt/photonvision/photonvision_config
1520
install -v -m 644 luma_p1/photon.sqlite /opt/photonvision/photonvision_config/photon.sqlite
21+
22+
umount /boot/firmware

install_opi5.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
# Exit on errors, print commands, ignore unset variables
44
set -ex +u
55

6+
# mount partition 1 as /CIDATA
7+
mkdir --parent /CIDATA
8+
mount "${loopdev}p1" /CIDATA
9+
ls -la /CIDATA
10+
611
# Create pi/raspberry login
712
if id "pi" >/dev/null 2>&1; then
813
echo 'user found'
@@ -62,9 +67,9 @@ apt-get --yes -qq install libc6 libstdc++6
6267
rm -f /etc/netplan/00-default-nm-renderer.yaml
6368

6469
# set NetworkManager as the renderer in cloud-init
65-
cp -f ./OPi5_CIDATA/network-config /boot/network-config
70+
cp -f ./OPi5_CIDATA/network-config /CIDATA/network-config
6671
# add customized user-data file for cloud-init
67-
cp -f ./OPi5_CIDATA/user-data /boot/user-data
72+
cp -f ./OPi5_CIDATA/user-data /CIDATA/user-data
6873

6974
# modify photonvision.service to enable big cores
7075
sed -i 's/# AllowedCPUs=4-7/AllowedCPUs=4-7/g' /lib/systemd/system/photonvision.service
@@ -96,3 +101,5 @@ apt-get --yes -qq clean
96101

97102
rm -rf /usr/share/doc
98103
rm -rf /usr/share/locale/
104+
105+
umount /CIDATA

install_pi.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
# Exit on errors, print commands, ignore unset variables
44
set -ex +u
55

6+
# mount partition 1 as /boot/firmware
7+
mkdir --parent /boot/firmware
8+
mount "${loopdev}p1" /boot/firmware
9+
ls -la /boot/firmware
10+
611
# silence log spam from dpkg
712
cat > /etc/apt/apt.conf.d/99dpkg.conf << EOF
813
Dpkg::Progress-Fancy "0";
@@ -12,11 +17,11 @@ EOF
1217

1318
# Run normal photon installer
1419
chmod +x ./install.sh
15-
./install.sh -v "$1" --install-nm=yes --arch=aarch64 --version="$1"
20+
./install.sh --install-nm=yes --arch=aarch64 --version="$1"
1621

1722
# and edit boot partition
18-
install -m 644 config.txt /boot/
19-
install -m 644 userconf.txt /boot/
23+
install -m 644 config.txt /boot/firmware
24+
install -m 644 userconf.txt /boot/firmware
2025

2126
# configure hostname
2227
echo "photonvision" > /etc/hostname
@@ -46,3 +51,5 @@ apt-get clean
4651

4752
rm -rf /usr/share/doc
4853
rm -rf /usr/share/locale/
54+
55+
umount /boot/firmware

install_snakeyes.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -ex +u
55

66
# Run the pi install script
77
chmod +x ./install_pi.sh
8-
./install_pi.sh
8+
./install_pi.sh "$1"
99

1010
# Add the one extra file for the snakeyes hardware config
1111
mkdir -p /opt/photonvision/photonvision_config

0 commit comments

Comments
 (0)