summaryrefslogtreecommitdiffhomepage
path: root/once
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-12-12 15:42:50 +0000
committermidipix <writeonce@midipix.org>2021-12-13 03:23:08 +0000
commit2ddf27de2a304d096e64b1b44a5fa7f0dc8de7b8 (patch)
tree63efa42b3eea84e4691cf3b57173019fd5a39fed /once
parente06f87944efabb35a183813b9a74f44167f04053 (diff)
downloadmpackage-2ddf27de2a304d096e64b1b44a5fa7f0dc8de7b8.tar.bz2
mpackage-2ddf27de2a304d096e64b1b44a5fa7f0dc8de7b8.tar.xz
once: provide a simple mechanism to update the live (minipix) environment.
Diffstat (limited to 'once')
-rwxr-xr-xonce/get_updates.sh17
-rwxr-xr-xonce/update.sh5
2 files changed, 19 insertions, 3 deletions
diff --git a/once/get_updates.sh b/once/get_updates.sh
index 7e779db..8a8a6fa 100755
--- a/once/get_updates.sh
+++ b/once/get_updates.sh
@@ -10,7 +10,15 @@ mb_script="$0"
mb_success=no
mb_obtain=no
mb_state=true
-mb_dlopt="${1:-}"
+mb_opt="${1:-}"
+
+if [ "${mb_opt}" = '--mpackage' ]; then
+ mb_mpackage="${mb_opt}"
+ mb_dlopt="${2:-}"
+else
+ mb_dlopt="${mb_opt}"
+ mb_mpackage="${2:-}"
+fi
error_msg()
{
@@ -89,7 +97,12 @@ mb_vendor=$(cat /etc/vendor.host)
# obtain list of advertised updates
obtain_remote_file /updates/updates.sha256
-mb_tarballs=$(cut -d' ' -f3 /updates/updates.sha256)
+
+if [ "${mb_mpackage}" = '--mpackage' ]; then
+ mb_tarballs=$(cut -d' ' -f3 /updates/updates.sha256 | grep 'updater.tar.gz' || true)
+else
+ mb_tarballs=$(cut -d' ' -f3 /updates/updates.sha256)
+fi
# simple argument parsing
if [ "${mb_dlopt}" = '--obtain-tarballs' ]; then
diff --git a/once/update.sh b/once/update.sh
index d93a461..04b274a 100755
--- a/once/update.sh
+++ b/once/update.sh
@@ -31,7 +31,10 @@ for tarball in $tarballs; do
echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
echo extracting files from /updates/$tarball
echo ..................................................
- tar -xpvf /updates/$tarball -C "$SYSROOT" || exit 2
+
+ if [ "$tarball" != 'updater.tar.gz' ]; then
+ tar -xpvf /updates/$tarball -C "$SYSROOT" || exit 2
+ fi
echo archiving old $tarball
echo ..................................................