Skip to content

Commit 1fdf7d5

Browse files
authored
Merge pull request #3958 from cmitu/image-compression
image: switch to LZMA for compression
2 parents afbf914 + 5503e73 commit 1fdf7d5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scriptmodules/admin/image.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -364,15 +364,15 @@ function platform_image() {
364364
[[ "$make_bb" -eq 1 ]] && rp_callModule image create_bb "$dest/${image_base}-berryboot.img256"
365365

366366
printMsgs "console" "Compressing ${image_name} ..."
367-
gzip -c "$image_file" > "${image_file}.gz"
367+
xz -v --compress --stdout "$image_file" > "${image_file}.xz"
368368

369369
printMsgs "console" "Generating JSON data for rpi-imager ..."
370370
local template
371371
template="$(<"$md_data/template.json")"
372-
template="${template/IMG_PATH/$__version\/${image_name}.gz}"
372+
template="${template/IMG_PATH/$__version\/${image_name}.xz}"
373373
template="${template/IMG_EXTRACT_SIZE/$(stat -c %s $image_file)}"
374374
template="${template/IMG_SHA256/$(sha256sum $image_file | cut -d" " -f1)}"
375-
template="${template/IMG_DOWNLOAD_SIZE/$(stat -c %s ${image_file}.gz)}"
375+
template="${template/IMG_DOWNLOAD_SIZE/$(stat -c %s ${image_file}.xz)}"
376376
template="${template/IMG_VERSION/$__version}"
377377
template="${template/IMG_PLATFORM/$image_title}"
378378
template="${template/IMG_DATE/$(date '+%Y-%m-%d')}"

0 commit comments

Comments
 (0)