Skip to content

Commit 63a864c

Browse files
committed
fix: adapt for bookworm & OctoPi 1.1.0
1 parent 52894eb commit 63a864c

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

scripts/02-update-octoprint

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@ install_cleanup_trap
88

99
BUNDLED="OctoPrint-FileCheck OctoPrint-FirmwareCheck OctoPrint-PiSupport"
1010

11+
USER=pi
12+
VENV=/opt/octopi/oprint
13+
[ -f $VENV ] || VENV=/home/pi/oprint
14+
1115
if [ -n "$OCTOPRINT_VERSION" ]; then
1216
# fetch from GitHub since PyPI might not yet be synced through right after a fresh release
13-
sudo -u pi /home/pi/oprint/bin/pip install -U https://github.com/OctoPrint/OctoPrint/archive/refs/tags/$OCTOPRINT_VERSION.zip $BUNDLED
17+
sudo -u $USER $VENV/bin/pip install -U https://github.com/OctoPrint/OctoPrint/archive/refs/tags/$OCTOPRINT_VERSION.zip $BUNDLED
1418
else
15-
sudo -u pi /home/pi/oprint/bin/pip install -U OctoPrint $BUNDLED
19+
sudo -u $USER $VENV/bin/pip install -U OctoPrint $BUNDLED
1620
fi
1721

1822
# make sure to mark the file check wizard as seen
1923
if [ $(/usr/local/bin/yq '.server.seenWizards.file_check' /home/pi/.octoprint/config.yaml) == "null" ]; then
20-
sudo -u pi FILECHECK_WIZARD=$(sudo -u pi /home/pi/oprint/bin/python -c "import octoprint_file_check; print(octoprint_file_check.WIZARD_VERSION)") /usr/local/bin/yq -i '.server.seenWizards.file_check = env(FILECHECK_WIZARD)' /home/pi/.octoprint/config.yaml
24+
sudo -u $USER FILECHECK_WIZARD=$(sudo -u $USER $VENV/bin/python -c "import octoprint_file_check; print(octoprint_file_check.WIZARD_VERSION)") /usr/local/bin/yq -i '.server.seenWizards.file_check = env(FILECHECK_WIZARD)' /home/pi/.octoprint/config.yaml
2125
fi

scripts/03-update-boot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export LC_ALL=C
66
source /common.sh
77
install_cleanup_trap
88

9-
apt-get install --yes --reinstall raspberrypi-bootloader raspberrypi-kernel
9+
apt-get install --yes raspberrypi-bootloader raspberrypi-kernel
1010

1111
kernel_version=$(dpkg -s raspberrypi-kernel | grep -i version | awk '{print $2}')
1212
if [ "$kernel_version" = "1:1.20230317-1" ]; then

scripts/81-fix-octopi-txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ install_cleanup_trap
1010
[ -f /opt/mjpg-streamer/input_raspi.so ] && exit 0
1111

1212
# if we already have the octopi.txt file updated, we don't need to do anything
13-
grep -q '### Configure which camera to use' /boot/octopi.txt || exit 0
13+
grep -q '### Configure which camera to use' $BOOT_PATH/octopi.txt || exit 0
1414

15-
cp /files/octopi.txt /boot/octopi.txt
15+
cp /files/octopi.txt $BOOT_PATH/octopi.txt

scripts/82-fix-welcome-banner

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ export LC_ALL=C
66
source /common.sh
77
install_cleanup_trap
88

9-
# if we already have the octopi.txt file updated, we don't need to do anything
9+
# if there's no welcome script at /home/pi/scripts/welcome, we don't need to do anything
10+
[ ! -f '/home/pi/scripts/welcome' ] && exit 0
11+
12+
# if we already have the file updated, we don't need to do anything
1013
grep -q 'from octoprint._version import' /home/pi/scripts/welcome || exit 0
1114

1215
sed -i 's#^_OCTOPRINT_VERSION=.*$#_OCTOPRINT_VERSION=$($HOME/oprint/bin/python -c "from octoprint.util.version import get_octoprint_version_string; print(get_octoprint_version_string())" || echo "unknown")#' /home/pi/scripts/welcome

0 commit comments

Comments
 (0)