03-14-2024, 09:22 PM
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)?
(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)?
./zstandardize.sh dsl-2024.rc3.iso dsl-2024.rc3.zstd.iso#! /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 \
;(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?