Skip to content

Commit

Permalink
Bug/update device tree link after upgrade (#392)
Browse files Browse the repository at this point in the history
* After an upgrade, relink the hardware revisions device tree binary

* Add revisoin binaries

* Do not fail on AWS servers

* Correct the bash statement

* Disable system updates for the end user. There are too many unknowns at this point. It can still be done from the command line for expert users.
  • Loading branch information
eliasbakken authored Dec 4, 2023
1 parent 796a64a commit c54a15a
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 2 deletions.
2 changes: 1 addition & 1 deletion roles/install_moonraker/files/moonraker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ trusted_clients:

# this enables moonraker's update manager
[update_manager]
enable_system_updates: True
enable_system_updates: False

#[update_manager mainsail]
#type: web
Expand Down
2 changes: 1 addition & 1 deletion roles/linux_preparation/files/100update
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DPkg::Pre-Invoke {"mount -o remount,rw /boot";};
DPkg::Post-Invoke {"mount -o remount,ro /boot";};
DPkg::Post-Invoke {"mount -o remount,ro /boot; /usr/local/bin/update-recore-revision";};
17 changes: 17 additions & 0 deletions roles/linux_preparation/files/get-recore-revision
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

OUTFILE="/dev/"`lsblk -n -o NAME | grep 'mmcblk[0-2]$'`

if ! test -b ${OUTFILE}boot0p1; then
partx -a ${OUTFILE}boot0
fi

mkdir -p /mnt/config
if ! grep -qs '/mnt/config ' /proc/mounts; then
mount -r ${OUTFILE}boot0p1 /mnt/config/
fi

CONFIG=`ls /mnt/config/*.json`
REVISION=`cat "$CONFIG" | jq -r ".Revision" | tr '[:upper:]' '[:lower:]'`

echo $REVISION
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 8 additions & 0 deletions roles/linux_preparation/files/update-recore-revision
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

if ! lscpu | grep -q Cortex-A53; then
exit 0
fi

REVISION=`get-recore-revision`
set-recore-revision $REVISION
10 changes: 10 additions & 0 deletions roles/linux_preparation/tasks/recore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,13 @@
src: 100update
dest: /etc/apt/apt.conf.d/100update
mode: '0644'

- name: Recore - add files for updating dtb
copy:
src: '{{item}}'
dest: /usr/local/bin
mode: '0755'
loop:
- get-recore-revision
- set-recore-revision
- update-recore-revision

0 comments on commit c54a15a

Please sign in to comment.