File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,11 +24,16 @@ rootfs="$OUT/files/rootfs.squashfs.verity"
2424truncate -s 0 " $rootfs "
2525# Privileged mkosi runs can inherit host default ACLs from their workspace.
2626# The guest rootfs does not rely on xattrs, so exclude this host-only metadata.
27- # A single compressor worker also avoids host-CPU-dependent fragment ordering.
28- env -u SOURCE_DATE_EPOCH mksquashfs " $TREE " " $rootfs " \
29- -noappend -all-root -no-progress \
30- -no-xattrs -processors 1 -comp zstd -mkfs-time " $SOURCE_DATE_EPOCH " \
31- -all-time " $SOURCE_DATE_EPOCH " > /dev/null
27+ # A sorted tar stream also removes backing-filesystem directory/inode order and
28+ # hardlink topology from the input. A single compressor worker then avoids
29+ # host-CPU-dependent fragment ordering.
30+ (cd " $TREE " && tar --sort=name --format=gnu \
31+ --mtime=" @$SOURCE_DATE_EPOCH " --owner=0 --group=0 --numeric-owner \
32+ --hard-dereference -cf - .) | \
33+ env -u SOURCE_DATE_EPOCH mksquashfs - " $rootfs " -tar \
34+ -noappend -all-root -no-progress -exports -no-hardlinks -no-tailends \
35+ -no-xattrs -processors 1 -comp zstd -mkfs-time " $SOURCE_DATE_EPOCH " \
36+ -all-time " $SOURCE_DATE_EPOCH " > /dev/null
3237data_size=$( stat -c %s " $rootfs " )
3338data_size=$(( (data_size + 4095 ) / 4096 * 4096 ))
3439truncate -s " $data_size " " $rootfs "
Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ for service in dstack-guest-agent dstack-prepare app-compose wg-checker; do
2929 grep -q " $service " " $D /mkosi.skeleton/usr/lib/systemd/system-preset/80-dstack.preset"
3030done
3131grep -q ' artifact-manifest.json' " $D /scripts/make-release-artifacts.sh"
32+ grep -q -- ' --hard-dereference' " $D /scripts/make-release-artifacts.sh"
33+ grep -q ' mksquashfs -.*-tar' " $D /scripts/make-release-artifacts.sh"
3234grep -q ' image/assemble.sh' " $D /mkosi.postoutput"
3335grep -q ' ovmf-build.sh' " $D /components/ovmf/ovmf.sh"
3436grep -q ' fbe0805b2091393406952e84724188f8c1941837' " $D /components/ovmf/ovmf-build.sh"
You can’t perform that action at this time.
0 commit comments