#!/bin/sh # License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree. # cd-source.sh -- the source DVD: the one source set, on its own medium. # # usage: cd-source.sh # # The install DVD carries the system and the programs; the sources are their # own DVD (Konrad, 2026-11-15). It is a data DVD, ISO 9660 with Rock Ridge, # made with the build's own makefs (nbmakefs). ISO 9660 stores a file size # in 32 bits, and makefs truncated the 5.8 GB set at 4 GB (measured # 2026-11-15: the installer's gzip saw a 1.5 GB file and stopped with # "unexpected end of file"). The set is therefore split into parts of 2 GiB # and sysinst cats them; the layout the installer looks for is # # source/sets/src.tgz MD5 SHA512 the one set, unpacked to /usr/src # README the commands to install it # # Written to RELEASEDIR/images/Makronix--amd64-source.iso. Run by # `make isosrc' after `make sourcesets'. The set is 5.5 GB (2026-11-15), so # the medium is a dual-layer DVD (8.5 GB), not a DVD-5. set -eu TOP=$(cd "$(dirname "$0")/.." && pwd) # This tool writes build/obj or releasedir: only inside the build lock. if [ -z "${BUILD_LOCK_HELD:-}" ] || [ ! -d "$BUILD_LOCK_HELD" ]; then echo "${0##*/}: run this through make or tools/build-lock.sh" >&2 exit 1 fi OBJ=$TOP/build/obj REL=$OBJ/releasedir SETS=$REL/source/sets STAGE=$TOP/build/cdsource VER=$(cat "$TOP/src/sys/conf/makronix-release") die() { echo "cd-source: $*" >&2 exit 1 } MAKEFS=$(ls "$OBJ"/tooldir.*/bin/nbmakefs 2>/dev/null | head -1) [ -x "$MAKEFS" ] || die "no nbmakefs in $OBJ/tooldir.*/bin" [ -f "$SETS/src.tgz" ] || die "no $SETS/src.tgz (make sourcesets first)" [ -f "$SETS/MD5" ] || die "no $SETS/MD5 (make sourcesets first)" [ -f "$SETS/SHA512" ] || die "no $SETS/SHA512 (make sourcesets first)" rm -rf "$STAGE" mkdir -p "$STAGE/source/sets" # ISO 9660 stores a file size in 32 bits: split the set into parts below # 2 GiB. sysinst cats them (set_file_exists_p, extract_file_to) and the # README says how to do it by hand. split -b 2000m "$SETS/src.tgz" "$STAGE/source/sets/src.tgz." cp -p "$SETS/MD5" "$SETS/SHA512" "$STAGE/source/sets/" if [ -f "$SETS/SHA512.sig" ]; then cp -p "$SETS/SHA512.sig" "$STAGE/source/sets/" fi cat > "$STAGE/README" < release key, signify); check it before you unpack: signify -V -p /etc/signify/makronix-root.pub -m /etc/signify/makronix-0.99.pub -x /etc/signify/makronix-0.99.pub.sig signify -V -p /etc/signify/makronix-0.99.pub -m /mnt/source/sets/SHA512 -x /mnt/source/sets/SHA512.sig The install DVD carries the system and the programs, not the sources; this DVD is the one that does. EOF mkdir -p "$REL/images" OUT=$REL/images/Makronix-$VER-amd64-source.iso rm -f "$OUT" "$MAKEFS" -t cd9660 -o rockridge,label=MAKRONIX_SOURCE,publisher=Makronix \ "$OUT" "$STAGE" echo "cd-source: ${OUT#$TOP/}: $(du -h "$OUT" | cut -f1)"