Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Improving the updater to support folders #498

Merged
merged 1 commit into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,20 @@ jobs:
zip -9 "arpl-${{ steps.build.outputs.VERSION }}.vmdk-dyn.zip" arpl-dyn.vmdk
zip -9 "arpl-${{ steps.build.outputs.VERSION }}.vmdk-flat.zip" arpl.vmdk arpl-flat.vmdk
sha256sum update-list.yml > sha256sum
yq '.replace | explode(.) | to_entries | map([.key])[] | .[]' update-list.yml | while read F; do
(cd `dirname ${F}` && sha256sum `basename ${F}`) >> sha256sum
done
yq '.replace | explode(.) | to_entries | map([.key])[] | .[]' update-list.yml | xargs zip -9j "update.zip" sha256sum update-list.yml

zip -9j update.zip update-list.yml
while read F; do
if [ -d "${F}" ]; then
FTGZ="`basename "${F}"`.tgz"
tar czf "${FTGZ}" -C "${F}" .
sha256sum "${FTGZ}" >> sha256sum
zip -9j update.zip "${FTGZ}"
rm "${FTGZ}"
else
(cd `dirname ${F}` && sha256sum `basename ${F}`) >> sha256sum
zip -9j update.zip "${F}"
fi
done < <(yq '.replace | explode(.) | to_entries | map([.key])[] | .[]' update-list.yml)
zip -9j update.zip sha256sum
# Upload artifact
- name: Upload
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0-beta11
1.0-beta11a
2 changes: 1 addition & 1 deletion files/board/arpl/overlayfs/opt/arpl/include/consts.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

ARPL_VERSION="1.0-beta11"
ARPL_VERSION="1.0-beta11a"

# Define paths
TMP_PATH="/tmp"
Expand Down
14 changes: 10 additions & 4 deletions files/board/arpl/overlayfs/opt/arpl/menu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1026,14 +1026,20 @@ function updateMenu() {
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--infobox "Installing new files" 0 0
# Process update-list.yml
while IFS="=" read KEY VALUE; do
mkdir -p "`dirname "${VALUE}"`"
mv /tmp/`basename "${KEY}"` "${VALUE}"
done < <(readConfigMap "replace" "/tmp/update-list.yml")
while read F; do
[ -f "${F}" ] && rm -f "${F}"
[ -d "${F}" ] && rm -Rf "${F}"
done < <(readConfigArray "remove" "/tmp/update-list.yml")
while IFS="=" read KEY VALUE; do
if [ "${KEY: -1}" = "/" ]; then
rm -Rf "${VALUE}"
mkdir -p "${VALUE}"
gzip -dc "/tmp/`basename "${KEY}"`.tgz" | tar xf - -C "${VALUE}"
else
mkdir -p "`dirname "${VALUE}"`"
mv "/tmp/`basename "${KEY}"`" "${VALUE}"
fi
done < <(readConfigMap "replace" "/tmp/update-list.yml")
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--yesno "Arpl updated with success to ${TAG}!\nReboot?" 0 0
[ $? -ne 0 ] && continue
Expand Down
2 changes: 1 addition & 1 deletion files/board/arpl/p1/ARPL-VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0-beta11
1.0-beta11a
18 changes: 14 additions & 4 deletions img-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,18 @@ zip -9 "arpl-${VERSION}.img.zip" arpl.img
zip -9 "arpl-${VERSION}.vmdk-dyn.zip" arpl-dyn.vmdk
zip -9 "arpl-${VERSION}.vmdk-flat.zip" arpl.vmdk arpl-flat.vmdk
sha256sum update-list.yml > sha256sum
yq '.replace | explode(.) | to_entries | map([.key])[] | .[]' update-list.yml | while read F; do
(cd `dirname ${F}` && sha256sum `basename ${F}`) >> sha256sum
done
yq '.replace | explode(.) | to_entries | map([.key])[] | .[]' update-list.yml | xargs zip -9j "update.zip" sha256sum update-list.yml
zip -9j update.zip update-list.yml
while read F; do
if [ -d "${F}" ]; then
FTGZ="`basename "${F}"`.tgz"
tar czf "${FTGZ}" -C "${F}" .
sha256sum "${FTGZ}" >> sha256sum
zip -9j update.zip "${FTGZ}"
rm "${FTGZ}"
else
(cd `dirname ${F}` && sha256sum `basename ${F}`) >> sha256sum
zip -9j update.zip "${F}"
fi
done < <(yq '.replace | explode(.) | to_entries | map([.key])[] | .[]' update-list.yml)
zip -9j update.zip sha256sum
rm -f sha256sum
6 changes: 2 additions & 4 deletions update-list.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
remove:
replace:
".buildroot/output/images/bzImage": "/mnt/p3/bzImage-arpl"
".buildroot/output/images/rootfs.cpio.xz": "/mnt/p3/initrd-arpl"
"files/board/arpl/p1/grub/grub.cfg": "/mnt/p1/grub/grub.cfg"
"files/board/arpl/p1/ARPL-VERSION" : "/mnt/p1/ARPL-VERSION"
"files/board/arpl/p1/grub/fonts/unicode.pf2": "/mnt/p1/grub/fonts/unicode.pf2"
remove:
"/mnt/p1/grub/locales"
"files/board/arpl/p1/grub/": "/mnt/p1/grub/"