Skip to content

Commit

Permalink
use XZ compression
Browse files Browse the repository at this point in the history
  • Loading branch information
mmguero committed Jul 17, 2023
1 parent 4fd0dd2 commit 89d005d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/malcolm-iso-build-docker-wrap-push-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ jobs:
software-properties-common \
squashfs-tools \
virt-what \
xorriso
xorriso \
xz-utils
git clone --depth=1 --single-branch --recurse-submodules --shallow-submodules --branch='debian/1%20210407' 'https://salsa.debian.org/live-team/live-build.git' /tmp/live-build
cd /tmp/live-build
dpkg-buildpackage -b -uc -us
Expand Down Expand Up @@ -102,16 +103,16 @@ jobs:
docker tag "$REPO_IMAGE" "$IMAGE" && \
docker rmi "$REPO_IMAGE"
done
DEST_IMAGES_TGZ=$(pwd)/malcolm_"$(date +%Y.%m.%d_%H:%M:%S)"_${{ steps.extract_commit_sha.outputs.sha }}_images.tar.gz
docker save "${IMAGES[@]}" | gzip --best > "$DEST_IMAGES_TGZ"
DEST_IMAGES_TXZ=$(pwd)/malcolm_"$(date +%Y.%m.%d_%H:%M:%S)"_${{ steps.extract_commit_sha.outputs.sha }}_images.tar.xz
docker save "${IMAGES[@]}" | xz --best > "$DEST_IMAGES_TXZ"
for IMAGE in "${IMAGES[@]}"; do
docker rmi "$IMAGE"
done
pushd ./malcolm-iso
mkdir -p ./shared
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" > ./shared/environment.chroot
sudo /usr/bin/env bash ./build.sh -r -d "$DEST_IMAGES_TGZ"
rm -rf ./shared/ "$DEST_IMAGES_TGZ"
sudo /usr/bin/env bash ./build.sh -r -d "$DEST_IMAGES_TXZ"
rm -rf ./shared/ "$DEST_IMAGES_TXZ"
sudo chmod 644 ./malcolm-*.*
popd
-
Expand Down
6 changes: 3 additions & 3 deletions scripts/github_image_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ function ExtractAndLoadImagesFromGithubWorkflowBuildISO() {
if [[ -e malcolm.iso ]]; then
xorriso -osirrox on -indev malcolm.iso -extract /live/filesystem.squashfs filesystem.squashfs
if [[ -e filesystem.squashfs ]]; then
unsquashfs filesystem.squashfs -f malcolm_images.tar.gz
if [[ -e squashfs-root/malcolm_images.tar.gz ]]; then
docker load -i squashfs-root/malcolm_images.tar.gz
unsquashfs filesystem.squashfs -f malcolm_images.tar.xz
if [[ -e squashfs-root/malcolm_images.tar.xz ]]; then
docker load -i squashfs-root/malcolm_images.tar.xz
else
echo "Failed to images tarball" 2>&1
fi
Expand Down
4 changes: 2 additions & 2 deletions shared/bin/agg-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ if [[ -r "$SCRIPT_PATH"/common-init.sh ]]; then

# if we need to import prebuilt Malcolm docker images, do so now (but not if we're in a live-usb boot)
DOCKER_DRIVER="$(docker info 2>/dev/null | grep 'Storage Driver' | cut -d' ' -f3)"
if [[ -n $DOCKER_DRIVER ]] && [[ "$DOCKER_DRIVER" != "vfs" ]] && [[ -r /malcolm_images.tar.gz ]]; then
docker load -q -i /malcolm_images.tar.gz && rm -f /malcolm_images.tar.gz
if [[ -n $DOCKER_DRIVER ]] && [[ "$DOCKER_DRIVER" != "vfs" ]] && [[ -r /malcolm_images.tar.xz ]]; then
docker load -q -i /malcolm_images.tar.xz && rm -f /malcolm_images.tar.xz
fi

exit 0
Expand Down
4 changes: 2 additions & 2 deletions shared/bin/docker-load-wait.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ function finish {
pkill -f "zenity.*Preparing Malcolm"
}

if [[ -f /malcolm_images.tar.gz ]] || pgrep -f "docker load" >/dev/null 2>&1 || pgrep -f "docker-untar" >/dev/null 2>&1; then
if [[ -f /malcolm_images.tar.xz ]] || pgrep -f "docker load" >/dev/null 2>&1 || pgrep -f "docker-untar" >/dev/null 2>&1; then
trap finish EXIT
yes | zenity --progress --pulsate --no-cancel --auto-close --text "Malcolm Docker images are loading, please wait..." --title "Preparing Malcolm" &
while [[ -f /malcolm_images.tar.gz ]] || pgrep -f "docker load" >/dev/null 2>&1 || pgrep -f "docker-untar" >/dev/null 2>&1; do
while [[ -f /malcolm_images.tar.xz ]] || pgrep -f "docker load" >/dev/null 2>&1 || pgrep -f "docker-untar" >/dev/null 2>&1; do
sleep 2
done
fi

0 comments on commit 89d005d

Please sign in to comment.