Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Interest in a lower compression iso optimized for USB booting?
#51
If you still have them and the space/time to kill, perhaps the extra mkisofs step and then time the boot in VBox (if it will w/o new hashes, etc)?
Reply
#52
(03-14-2024, 09:22 PM)grindstone Wrote: If you still have them and the space/time to kill, perhaps the extra mkisofs step and then time the boot in VBox (if it will w/o new hashes, etc)?

Sorry, if you are asking me to try something, I am not sure what you mean. What extra mkisofs step? I replaced linuxfs in the RC1 ISO using ISO Master for the benchmark.
Reply
#53
I have written a script that remasters DSL 2024 ISOs with zstd compression. This way they will boot approximately as quickly as LZ4 but take up less space on your USB drive. The script requires the live SquashFS filesystem to be located at /antiX/linuxfs inside the ISO, which has been the case so far.

Example usage:

Code:
./zstandardize.sh dsl-2024.rc3.iso dsl-2024.rc3.zstd.iso

Script:

Code:
#! /bin/bash
# zstandardize.sh - a script that remasters a DSL 2024 ISO image
# with Zstandard compression for the SquashFS filesystem.
#
# Run this script as root.
# Not running unsquashfs(1) and mksquashfs(1) as root
# will result in a partially broken live CD
# due to incorrect file ownership.
# As of DSL 2024 RC3,
# the live CD will have no wireless networks listed in Connman,
# and sudo(1) and su(1) will not work.
#
# This script has been tested using RC3 ISO images
# on Debian 12 and Ubuntu 22.04.
#
# Dependencies on Debian 12 and similar distributions:
# $ sudo apt install squashfs-tools xorriso
#
# Copyright (c) 2024 D. Bohdan.
# License: MIT.
# https://dbohdan.mit-license.org/@2024/license.txt

set -eu -o pipefail

COMPRESSION_LEVEL=19

usage() {
    printf 'usage: %s src.iso dest.iso\n' "$(basename "$0")"
}

if [[ $# -ne 2 ]]; then
    usage > /dev/stderr
    exit 2
fi

src="$1"
dest="$2"
work_dir="$dest.work"

if ! [[ -f $src ]]; then
    echo "source ISO image path isn't a file" > /dev/stderr
    exit 1
fi

mkdir -p "$work_dir"

# Extract the SquashFS filesystem from the ISO image.
rm "$work_dir"/linuxfs || true

xorriso \
    -osirrox on \
    -indev "$src" \
    -extract /antiX/linuxfs "$work_dir"/linuxfs \
    ;

# Recompress the SquashFS filesystem with Zstandard compression.
rm -rf "$work_dir"/linuxfs-contents || true

unsquashfs \
    -d "$work_dir"/linuxfs-contents \
    "$work_dir"/linuxfs \
    ;

rm "$work_dir"/linuxfs.new || true

mksquashfs \
    "$work_dir"/linuxfs-contents \
    "$work_dir"/linuxfs.new \
    -comp zstd \
    -Xcompression-level "$COMPRESSION_LEVEL" \
    ;

md5sum "$work_dir"/linuxfs.new \
    | awk '{ print $1, " linuxfs" }' > "$work_dir"/linuxfs.new.md5 \
    ;

# Create a new ISO image with the recompressed filesystem.
rm "$dest" || true

xorriso \
    -boot_image isolinux keep \
    -indev "$src" \
    -outdev "$dest" \
    -map "$work_dir"/linuxfs.new /antiX/linuxfs \
    -map "$work_dir"/linuxfs.new.md5 /antiX/linuxfs.md5 \
    ;
Reply
#54
Okay, I have finally benchmarked LZ4 and Zstandard on real hardware. I have measured the boot time for RC3 ISOs on my Eee PC 1001PX. I booted it off a USB drive with Ventoy. The time is between when I pressed enter in the ISOLINUX boot menu and when I saw Conky appear on the desktop.
  • XZ (official) — 1:46
  • LZ4 (official) — 1:05
  • Zstandard (generated with the script) —1:04

This doesn't mean zstd is faster than LZ4. The difference between LZ4 and zstd is too small to mean anything with how I benchmarked them.
Reply
#55
Thank you for providing the script and the benchmarks. What's the MB size of the remastered Zstd iso at compression level 19?
Reply
#56
(04-10-2024, 07:53 PM)John Wrote: Thank you for providing the script and the benchmarks.  What's the MB size of the remastered Zstd iso at compression level 19?

You're welcome. It's 804 MiB for RC3.

Edit: Setting the zstd compression level to 22 does not seem to improve compression. In my test with mksquashfs "version 4.5 (2021/07/22)", the final ISO has exactly the same size in bytes at level 19 and 22.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)