Shrink the ISOs: no GPU drivers in the live initrd, server without GPU and sound firmware
- build-iso.sh patches the container's mklive copy: dracut omits amdgpu, radeon, nouveau, i915 and xe (and so their firmware) from the live initrd, mksquashfs uses 1 MB blocks with the x86 BCJ filter. initrd 245 -> 89 MB. - das-server 0.2.0 ships /etc/xbps.d/das-server.conf that ignores linux-firmware-nvidia, sof-firmware and alsa-firmware; the server ISO passes the same list to mklive -g. - das-install-common 0.2.0: postinstall drops mklive-ignore.conf. Desktop ISO 1.96 -> 1.72 GB, server ISO 1.57 -> 1.14 GB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
set -euo pipefail
|
||||
|
||||
profile=${1:-desktop}
|
||||
ignore=""
|
||||
repo=/work/out/hostdir/binpkgs
|
||||
version=$(< /work/VERSION)
|
||||
|
||||
@@ -25,6 +26,9 @@ case $profile in
|
||||
# Both consoles: a screen and a serial line (IPMI, VPS consoles, QEMU -nographic).
|
||||
# mklive starts a login on ttyS0 when it sees console=ttyS0.
|
||||
cmdline="live.user=live loglevel=4 console=tty0 console=ttyS0,115200"
|
||||
# das-server keeps these packages out of the installed system; the image
|
||||
# is built before das-server is installed, so tell mklive as well
|
||||
ignore=$(sed -n 's/^ignorepkg=//p' /work/srcpkgs/das-server/files/xbps-ignore.conf | xargs)
|
||||
;;
|
||||
*)
|
||||
echo "build-iso: unknown profile '$profile' (desktop, server)" >&2
|
||||
@@ -81,6 +85,22 @@ sed -i -e 's/echo void-live >/echo dasos >/' -e 's/voidlinux/live/g' "$adduser"
|
||||
# how to log in to the live system; its installer writes a neutral one).
|
||||
cp "$dir/branding/issue" /opt/void-mklive/data/issue
|
||||
|
||||
# Size, also patched into this container's mklive copy:
|
||||
# - the live initrd only has to find and mount the image, the GPU drivers and
|
||||
# their firmware (~150 MB) load from the root file system after switch_root;
|
||||
# - squashfs with 1 MB blocks and the x86 BCJ filter packs binaries tighter.
|
||||
mklive=/opt/void-mklive/mklive.sh
|
||||
for pattern in '--add-drivers "ahci"' '-comp "${SQUASHFS_COMPRESSION}"'; do
|
||||
if ! grep -qF -- "$pattern" "$mklive"; then
|
||||
echo "build-iso: '$pattern' not found in $mklive, mklive changed; update this script" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
sed -i \
|
||||
-e 's/--add-drivers "ahci"/& --omit-drivers "amdgpu radeon nouveau i915 xe"/' \
|
||||
-e 's/-comp "${SQUASHFS_COMPRESSION}"/& -b 1M -Xbcj x86/' \
|
||||
"$mklive"
|
||||
|
||||
rsvg-convert /work/live/branding/splash.svg --output "$work/splash.png"
|
||||
rm -f "$iso"
|
||||
|
||||
@@ -91,6 +111,7 @@ SPLASH_IMAGE=$work/splash.png ./mklive.sh \
|
||||
-c /var/cache/xbps \
|
||||
-p "$(read_list "$dir/packages.x86_64")" \
|
||||
-S "$(read_list "$dir/services")" \
|
||||
${ignore:+-g "$ignore"} \
|
||||
-I "$include" \
|
||||
-l "$locale" \
|
||||
-k us \
|
||||
|
||||
Reference in New Issue
Block a user