From 3fe037dde45fb86ac77b97636277e35eab14a788 Mon Sep 17 00:00:00 2001 From: Elias Bakken Date: Tue, 11 Aug 2026 18:02:04 +0200 Subject: [PATCH 1/2] Remove dead scripts save-setting (singular, one key=value at a time) - superseded by save-settings (plural, bulk-writes the whole file), which is what's actually called from server.go. delete-recore-config, flash-direct, set-boot-media, and get-boot-media aren't called from anywhere - server.go, any other script, mkimage.sh, or the Makefile beyond a stale chmod line for the latter two. set-boot-media/get-boot-media had no bin/prod equivalent to begin with, only these unused bin/dev copies. flash-recore (also chmod'd in install_bins, also otherwise uncalled) is left alone for now - its bin/prod equivalent still exists under a new name (flash-from-file). --- Makefile | 2 -- bin/dev/flash-direct | 30 ------------------------------ bin/dev/get-boot-media | 3 --- bin/dev/set-boot-media | 20 -------------------- bin/prod/delete-recore-config | 9 --------- bin/prod/save-setting | 25 ------------------------- 6 files changed, 89 deletions(-) delete mode 100755 bin/dev/flash-direct delete mode 100755 bin/dev/get-boot-media delete mode 100755 bin/dev/set-boot-media delete mode 100755 bin/prod/delete-recore-config delete mode 100755 bin/prod/save-setting diff --git a/Makefile b/Makefile index c4b4a3c..78b1e5c 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,6 @@ install_bins: chmod +x /usr/local/bin/flash-recore chmod +x /usr/local/bin/reboot-board chmod +x /usr/local/bin/shutdown-board - chmod +x /usr/local/bin/set-boot-media - chmod +x /usr/local/bin/get-boot-media chmod +x /usr/local/bin/get-emmc-version chmod +x /usr/local/bin/get-recore-serial-number chmod +x /usr/local/bin/rotate-screen diff --git a/bin/dev/flash-direct b/bin/dev/flash-direct deleted file mode 100755 index 61e8a11..0000000 --- a/bin/dev/flash-direct +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -set -euo pipefail - -info() { - echo "[info] $1" >> /var/log/reflash.log - echo "$1" -} - -info "----------------------------" -info "Starting flash direct script" -info "----------------------------" - -URL=$1 -OUTFILE="/dev/null" - -REVISION="a7" - -info "Found Recore hardware revision $REVISION" -info "Flashing file name $URL" -info "Overwriting block device $OUTFILE" - -info "Umounting /dev/mmcblk*" -info "Starting flashing..." -(wget -q -O - "$URL" | pv -f -n -b | xz -T 0 -d -c > "$OUTFILE") 2> /tmp/recore-flash-progress -info "Flashing done" -info "Checking filesystems" -info "Creating new UUIDs" -info "Updating fstab with new UUIDs" -info "Symlinking device tree" -info "Install script done!" diff --git a/bin/dev/get-boot-media b/bin/dev/get-boot-media deleted file mode 100755 index b6c6f40..0000000 --- a/bin/dev/get-boot-media +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -cat /opt/reflash/media diff --git a/bin/dev/set-boot-media b/bin/dev/set-boot-media deleted file mode 100755 index 358c366..0000000 --- a/bin/dev/set-boot-media +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -NEW_MEDIA=$1 - -info() { - echo "[info] $1" >> /var/log/reflash.log - echo "$1" -} - -if [ "x${NEW_MEDIA}" == "xusb" ]; then - NEW_DEV="usb" -elif [ "x${NEW_MEDIA}" == "xemmc" ]; then - NEW_DEV="emmc" -else - echo "usage $0 usb/emmc" - exit 1 -fi - -echo "${NEW_MEDIA}" > /opt/reflash/media -info "Setting boot media to ${NEW_MEDIA}" \ No newline at end of file diff --git a/bin/prod/delete-recore-config b/bin/prod/delete-recore-config deleted file mode 100755 index 3e0c463..0000000 --- a/bin/prod/delete-recore-config +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -DEV=`lsblk -n -o NAME | grep 'mmcblk[0-2]$'` - -echo 0 > "/sys/block/${DEV}boot0/force_ro" -dd if=/dev/zero of=/dev/${DEV}boot0 -partprobe -echo 1 > "/sys/block/${DEV}boot0/force_ro" -echo "Done" diff --git a/bin/prod/save-setting b/bin/prod/save-setting deleted file mode 100755 index da4451f..0000000 --- a/bin/prod/save-setting +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -KEY=$1 -VALUE=$2 - -EMMC=/dev/mmcblk2 -SETTINGS_FILE="/mnt/emmc/etc/rebuild-settings" - -info() { - echo "[info] $1" >> /var/log/reflash.log - echo "$1" -} - -mkdir -p /mnt/emmc -umount -q /mnt/emmc/ -mount "${EMMC}p2" /mnt/emmc - - -if [ $(grep "${KEY}=" $SETTINGS_FILE) ]; then - sed -i "s/${KEY}=.*/${KEY}=${VALUE}/" "${SETTINGS_FILE}" -else - echo "${KEY}=${VALUE}" >> $SETTINGS_FILE -fi -chmod 600 "$SETTINGS_FILE" -umount /mnt/emmc From 0aaf5fb6b4b5f6b82364adc43b0802258b1c431d Mon Sep 17 00:00:00 2001 From: Elias Bakken Date: Tue, 11 Aug 2026 18:06:17 +0200 Subject: [PATCH 2/2] Remove first-boot Looked dead by the earlier survey and is - it's a partial prototype toward #86 (writes a hardcoded klipper-led_effect provisioning script to the eMMC, missing the UI text editor and the runner service that would actually execute it on first boot), not something usable as-is. The actual #86 implementation should start fresh rather than build on this. --- bin/prod/first-boot | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100755 bin/prod/first-boot diff --git a/bin/prod/first-boot b/bin/prod/first-boot deleted file mode 100755 index 2a2825b..0000000 --- a/bin/prod/first-boot +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -EMMC=/dev/mmcblk2 -PROVISIONING_FILE="/mnt/emmc/root/provisioning.sh" - -info() { - echo "[info] $1" >> /var/log/reflash.log - echo "$1" -} - -usage(){ - echo "Usage: $0" -} - -update_provisioning(){ - mkdir -p /mnt/emmc - umount -q /mnt/emmc/ - mount "${EMMC}p2" /mnt/emmc - -cat > $PROVISIONING_FILE <