Update pi image generation zip/xz confusion (#555)

* Add prints to image generation

* Make xz multithreaded

* More rename copypasta
This commit is contained in:
Matt
2022-10-31 11:27:57 -04:00
committed by GitHub
parent 1412155c50
commit 0f99044468
3 changed files with 11 additions and 6 deletions

View File

@@ -310,7 +310,7 @@ jobs:
if: github.event_name != 'pull_request'
with:
name: image
path: photonvision*.zip
path: photonvision*.xz
- uses: pyTooling/Actions/releaser@r0
with:
@@ -319,7 +319,7 @@ jobs:
rm: true
files: |
photon-server/build/libs/*.jar
photonvision*.zip
photonvision*.xz
if: github.event_name == 'push'
photon-release:

1
.gitignore vendored
View File

@@ -30,6 +30,7 @@ backend/settings/
*.nar
*.ear
*.zip
*.xz
*.tar.gz
*.rar

View File

@@ -1,11 +1,16 @@
# We need to look for a JAR with the "-raspi" suffix so we don't accidentally bundle the big jar
# Not that it really matters, but it'll save us 50 megs or so
NEW_JAR=$(realpath $(find . -name photonvision\*-raspi.jar))
echo "Using jar: " $NEW_JAR
sudo apt install xz-utils
curl -sk https://api.github.com/repos/photonvision/photon-pi-gen/releases/tags/v2023.1.0-beta-1 | grep "browser_download_url.*xz" | cut -d : -f 2,3 | tr -d '"' | wget -qi -
ls
FILE_NAME=$(ls | grep image_*.xz)
xz -v --decompress $FILE_NAME
echo "Downloaded " $FILE_NAME
xz -T0 -v --decompress $FILE_NAME
IMAGE_FILE=$(ls | grep *.img)
ls
echo "Unziped image: " $IMAGE_FILE
TMP=$(mktemp -d)
LOOP=$(sudo losetup --show -fP "${IMAGE_FILE}")
sudo mount ${LOOP}p2 $TMP
@@ -16,8 +21,7 @@ sudo cp $NEW_JAR photonvision.jar
popd
sudo umount ${TMP}
sudo rmdir ${TMP}
rm $FILE_NAME
NEW_IMAGE=$(basename "${NEW_JAR/jar/img}")
mv $IMAGE_FILE $NEW_IMAGE
xz -v -z $NEW_IMAGE
mv $NEW_IMAGE.xz $(basename "${NEW_JAR/.jar/-image.zip}")
xz -T0 -v -z $NEW_IMAGE
mv $NEW_IMAGE.xz $(basename "${NEW_JAR/.jar/-image.xz}")