File tree Expand file tree Collapse file tree 4 files changed +14
-7
lines changed
Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,18 @@ install_cleanup_trap
88
99BUNDLED="OctoPrint-FileCheck OctoPrint-FirmwareCheck OctoPrint-PiSupport"
1010
11+ USER=pi
12+ VENV=/opt/octopi/oprint
13+ [ -f $VENV ] || VENV=/home/pi/oprint
14+
1115if [ -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
1418else
15- sudo -u pi /home/pi/oprint /bin/pip install -U OctoPrint $BUNDLED
19+ sudo -u $USER $VENV /bin/pip install -U OctoPrint $BUNDLED
1620fi
1721
1822# make sure to mark the file check wizard as seen
1923if [ $(/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
2125fi
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export LC_ALL=C
66source /common.sh
77install_cleanup_trap
88
9- apt-get install --yes --reinstall raspberrypi-bootloader raspberrypi-kernel
9+ apt-get install --yes raspberrypi-bootloader raspberrypi-kernel
1010
1111kernel_version=$(dpkg -s raspberrypi-kernel | grep -i version | awk '{print $2}')
1212if [ "$kernel_version" = "1:1.20230317-1" ]; then
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -6,7 +6,10 @@ export LC_ALL=C
66source /common.sh
77install_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
1013grep -q 'from octoprint._version import' /home/pi/scripts/welcome || exit 0
1114
1215sed -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
You can’t perform that action at this time.
0 commit comments