Testing update checksum check

This commit is contained in:
Fabio Belavenuto 2022-09-19 10:07:41 -03:00
parent 8b9b1439b3
commit 2ad2825c46
4 changed files with 21 additions and 3 deletions

View File

@ -87,12 +87,16 @@ jobs:
#qemu-img convert -O vmdk arpl.img arpl.vmdk
qemu-img convert -O vmdk -o adapter_type=lsilogic arpl.img -o subformat=monolithicFlat arpl.vmdk
# Zip image
# Zip image and generate checksum
- name: Pack
shell: bash
run: |
zip -9 "arpl-${{ steps.build.outputs.VERSION }}.img.zip" arpl.img
zip -9 "arpl-${{ steps.build.outputs.VERSION }}.vmdk.zip" arpl*.vmdk
sha256sum .buildroot/output/images/bzImage .buildroot/output/images/rootfs.cpio.xz \
"arpl-${{ steps.build.outputs.VERSION }}.img.zip" "arpl-${{ steps.build.outputs.VERSION }}.vmdk.zip" \
> sha256sum
# Upload artifact
- name: Upload
@ -114,3 +118,4 @@ jobs:
arpl-${{ steps.build.outputs.VERSION }}.vmdk.zip
.buildroot/output/images/bzImage
.buildroot/output/images/rootfs.cpio.xz
sha256sum

View File

@ -1 +1 @@
0.4-alpha8
0.4-alpha9

View File

@ -1,5 +1,5 @@
ARPL_VERSION="0.4-alpha8"
ARPL_VERSION="0.4-alpha9"
# Define paths
TMP_PATH="/tmp"

View File

@ -797,6 +797,13 @@ function updateMenu() {
fi
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--infobox "Downloading last version ${TAG}" 0 0
# Download checksum
STATUS=`curl --insecure -s -w "%{http_code}" -L "https://github.com/fbelavenuto/arpl/releases/download/${TAG}/sha256sum" -o /tmp/sha256sum`
if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--msgbox "Error downloading checksums" 0 0
continue
fi
STATUS=`curl --insecure -s -w "%{http_code}" -L "https://github.com/fbelavenuto/arpl/releases/download/${TAG}/bzImage" -o /tmp/bzImage`
if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
@ -811,6 +818,12 @@ function updateMenu() {
fi
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--infobox "Installing new files" 0 0
(cd /tmp && sha256sum -c sha256sum)
if [ $? -ne 0 ]; then
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--msgbox "Checksum do not match!" 0 0
continue
fi
mv /tmp/bzImage "${ARPL_BZIMAGE_FILE}"
mv /tmp/rootfs.cpio.xz "${ARPL_RAMDISK_FILE}"
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \