Skip to content

Commit

Permalink
v8.23
Browse files Browse the repository at this point in the history
- CI | DietPi-Software: Update for xz-compressed images
  • Loading branch information
MichaIng committed Oct 1, 2023
1 parent 144d374 commit ef13da5
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/dietpi-software.bash
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ do
done
[[ $DISTRO =~ ^('buster'|'bullseye'|'bookworm'|'trixie')$ ]] || { G_DIETPI-NOTIFY 1 "Invalid distro \"$DISTRO\" passed, aborting..."; exit 1; }
case $ARCH in
'armv6l') image="DietPi_Container-ARMv6-${DISTRO^}" arch=1;;
'armv7l') image="DietPi_Container-ARMv7-${DISTRO^}" arch=2;;
'aarch64') image="DietPi_Container-ARMv8-${DISTRO^}" arch=3;;
'x86_64') image="DietPi_Container-x86_64-${DISTRO^}" arch=10;;
'riscv64') image="DietPi_Container-RISC-V-Sid" arch=11;;
'armv6l') image="DietPi_Container-ARMv6-${DISTRO^}.img" arch=1;;
'armv7l') image="DietPi_Container-ARMv7-${DISTRO^}.img" arch=2;;
'aarch64') image="DietPi_Container-ARMv8-${DISTRO^}.img" arch=3;;
'x86_64') image="DietPi_Container-x86_64-${DISTRO^}.img" arch=10;;
'riscv64') image="DietPi_Container-RISC-V-Sid.img" arch=11;;
*) G_DIETPI-NOTIFY 1 "Invalid architecture \"$ARCH\" passed, aborting..."; exit 1;;
esac
[[ $SOFTWARE =~ ^[0-9\ ]+$ ]] || { G_DIETPI-NOTIFY 1 "Invalid software list \"$SOFTWARE\" passed, aborting..."; exit 1; }
Expand Down Expand Up @@ -254,22 +254,21 @@ done
##########################################
# Dependencies
##########################################
apackages=('7zip' 'parted' 'fdisk' 'systemd-container')
apackages=('xz-utils' 'parted' 'fdisk' 'systemd-container')
(( $G_HW_ARCH == $arch || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $arch ) )) || apackages+=('qemu-user-static' 'binfmt-support')
G_AG_CHECK_INSTALL_PREREQ "${apackages[@]}"

##########################################
# Prepare container
##########################################
# Download
G_EXEC curl -sSfO "https://dietpi.com/downloads/images/$image.7z"
G_EXEC 7zz e "$image.7z" "$image.img"
G_EXEC rm "$image.7z"
G_EXEC truncate -s 8G "$image.img"
G_EXEC curl -sSfO "https://dietpi.com/downloads/images/$image.xz"
G_EXEC xz -d "$image.xz"
G_EXEC truncate -s 8G "$image"

# Loop device
FP_LOOP=$(losetup -f)
G_EXEC losetup "$FP_LOOP" "$image.img"
G_EXEC losetup "$FP_LOOP" "$image"
G_EXEC partprobe "$FP_LOOP"
G_EXEC partx -u "$FP_LOOP"
G_EXEC_OUTPUT=1 G_EXEC e2fsck -fp "${FP_LOOP}p1"
Expand Down

0 comments on commit ef13da5

Please sign in to comment.