mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
Improving the updater to support folders
This commit is contained in:
parent
86350062d2
commit
aa6473e37e
19
.github/workflows/main.yml
vendored
19
.github/workflows/main.yml
vendored
@ -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
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
ARPL_VERSION="1.0-beta11"
|
||||
ARPL_VERSION="1.0-beta11a"
|
||||
|
||||
# Define paths
|
||||
TMP_PATH="/tmp"
|
||||
|
@ -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
|
||||
|
@ -1 +1 @@
|
||||
1.0-beta11
|
||||
1.0-beta11a
|
||||
|
18
img-gen.sh
18
img-gen.sh
@ -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
|
||||
|
@ -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/"
|
||||
|
Loading…
x
Reference in New Issue
Block a user