-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve compatibility of consolidated build with older software
- Loading branch information
1 parent
02b0478
commit f236bd2
Showing
4 changed files
with
93 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/sh | ||
|
||
# This is a consolidated update script (shim) targeted | ||
# at pre-2.0 updaters with a more primitive update system | ||
# It does most of the heavy lifting itself, with some of | ||
# the scripts that come with the new updater picking up once | ||
# that code is down. | ||
|
||
# Write mount the disk | ||
mount -w -o remount / | ||
|
||
# Kill the running services | ||
systemctl stop fabmo fabmo-updater | ||
|
||
sleep 3 | ||
|
||
# Expand consolidated update package | ||
mkdir /tmp/consolidated-update | ||
cd /tmp/consolidated-update | ||
tar -xvzf /tmp/consolidated.fmp | ||
|
||
# Obliterate and recreate the engine/updater directories | ||
rm -rf /fabmo/updater /fabmo/engine | ||
mkdir /fabmo/updater /fabmo/engine | ||
|
||
# Lay down the engine and updater | ||
cd /fabmo/updater | ||
tar -xvzf /tmp/consolidated-update/updater.tar.gz | ||
|
||
cd /fabmo/engine | ||
tar -xvzf /tmp/consolidated-update/engine.tar.gz | ||
|
||
# Flush to disk | ||
sync | ||
|
||
# Update the G2 firmware | ||
/fabmo/updater/hooks/linux/edison/update_firmware.sh /fabmo/engine/firmware/g2.bin | ||
|
||
# Mark done | ||
touch /fabmo/engine/install_token | ||
touch /fabmo/updater/install_token | ||
|
||
# Clear the app root | ||
rm -rf /opt/fabmo/approot | ||
sync | ||
|
||
# Re-lock the disk | ||
mount -r -o remount / | ||
|
||
# Start everyhting back up | ||
systemctl restart fabmo fabmo-updater |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description=One time updater consolidated update | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/bin/sh /tmp/do-consolidated-update.sh | ||
StandardOutput=journal | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
mount -w -o remount / | ||
|
||
FMUDIR=$(pwd) | ||
|
||
rm -rf /opt/fabmo/updater/install_token | ||
|
||
systemctl stop fabmo | ||
|
||
# expandArchive src: updater-stub.tar.gz dest: /fabmo/engine | ||
cd /fabmo/engine; tar -xvzf $FMUDIR/updater-stub.tar.gz | ||
|
||
# expandArchive src: tmp dest: /tmp | ||
cd /tmp; tar -xvzf $FMUDIR/consolidated.tar.gz | ||
|
||
# expandArchive src: service.tar.gz dest: /etc/systemd/system | ||
# cd /etc/systemd/system; tar -xvzf $FMUDIR/service.tar.gz | ||
cp $FMUDIR/fabmo-temp-updater.service /etc/systemd/system | ||
cp $FMUDIR/do-consolidated-update.sh /tmp | ||
|
||
systemctl restart fabmo |