From 788c4e8c780cf9454800ff93c875d4994fbc3fc3 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sun, 21 May 2017 17:58:45 +0200 Subject: [PATCH 051/325] release/amd64/make-memstick.sh: Limit makefs to a single cpu ... to see if it's sufficient to get reproducible images without having to limit the number of cores for everything. Spoiler alert: Nope. Currently the image checksum is the same when using 1, 2 or 3 cores but changes when using 4: fk@t520 ~ $diffoscope-3.5 /images/ElectroBSD-r318528-2613fdfb3469-bhyve-2c/ElectroBSD-r318528-2613fdfb3469.img --- /images/ElectroBSD-r318528-2613fdfb3469-bhyve-2c/ElectroBSD-r318528-2613fdfb3469.img +++ /images/ElectroBSD-r318528-2613fdfb3469-bhyve-4c/ElectroBSD-r318528-2613fdfb3469.img @@ -7641,16 +7641,16 @@ 000428b0 53 44 2d 31 31 2e 31 2d 50 52 45 52 45 4c 45 41 |SD-11.1-PRERELEA| 000428b0 53 44 2d 31 31 2e 31 2d 50 52 45 52 45 4c 45 41 |SD-11.1-PRERELEA| 000428c0 53 45 2d 61 6d 64 36 00 00 00 00 00 00 00 00 00 |SE-amd6.........| 000428c0 53 45 2d 61 6d 64 36 00 00 00 00 00 00 00 00 00 |SE-amd6.........| 000428d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000428d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * -00042940 00 75 92 01 08 00 00 00 00 79 92 01 08 00 00 00 |.u.......y......| -00042940 00 75 92 01 08 00 00 00 00 79 92 01 08 00 00 00 |.u.......y......| +00042940 00 85 92 01 08 00 00 00 00 89 92 01 08 00 00 00 |................| +00042940 00 85 92 01 08 00 00 00 00 89 92 01 08 00 00 00 |................| 00042950 00 00 00 00 00 00 00 00 00 00 00 00 00 20 00 00 |............. ..| 00042950 00 00 00 00 00 00 00 00 00 00 00 00 00 20 00 00 |............. ..| 00042960 00 00 00 00 00 00 00 00 d8 ec 08 00 00 00 00 00 |................| 00042960 00 00 00 00 00 00 00 00 d8 ec 08 00 00 00 00 00 |................| 00042970 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00042970 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * @@ -7724,16 +7724,16 @@ 000448b0 53 44 2d 31 31 2e 31 2d 50 52 45 52 45 4c 45 41 |SD-11.1-PRERELEA| 000448b0 53 44 2d 31 31 2e 31 2d 50 52 45 52 45 4c 45 41 |SD-11.1-PRERELEA| 000448c0 53 45 2d 61 6d 64 36 00 00 00 00 00 00 00 00 00 |SE-amd6.........| 000448c0 53 45 2d 61 6d 64 36 00 00 00 00 00 00 00 00 00 |SE-amd6.........| 000448d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000448d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * -00044940 00 75 92 01 08 00 00 00 00 79 92 01 08 00 00 00 |.u.......y......| -00044940 00 75 92 01 08 00 00 00 00 79 92 01 08 00 00 00 |.u.......y......| +00044940 00 85 92 01 08 00 00 00 00 89 92 01 08 00 00 00 |................| +00044940 00 85 92 01 08 00 00 00 00 89 92 01 08 00 00 00 |................| 00044950 00 00 00 00 00 00 00 00 00 00 00 00 00 20 00 00 |............. ..| 00044950 00 00 00 00 00 00 00 00 00 00 00 00 00 20 00 00 |............. ..| 00044960 00 00 00 00 00 00 00 00 d8 ec 08 00 00 00 00 00 |................| 00044960 00 00 00 00 00 00 00 00 d8 ec 08 00 00 00 00 00 |................| 00044970 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00044970 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * @@ -1048569,8 +1048569,8 @@ 00871140 84 1e 81 ff 50 38 0f 31 89 04 25 2c 84 1e 81 66 |....P8.1..%,...f| 00871140 84 1e 81 ff 50 38 0f 31 89 04 25 2c 84 1e 81 66 |....P8.1..%,...f| 00871150 c7 04 25 38 84 1e 81 08 01 c6 04 25 3b 84 1e 81 |..%8.......%;...| 00871150 c7 04 25 38 84 1e 81 08 01 c6 04 25 3b 84 1e 81 |..%8.......%;...| 00871160 00 8b 04 25 28 84 1e 81 8d 48 01 89 0c 25 28 84 |...%(....H...%(.| 00871160 00 8b 04 25 28 84 1e 81 8d 48 01 89 0c 25 28 84 |...%(....H...%(.| 00871170 1e 81 88 04 25 3a 84 1e 81 48 c7 c7 30 84 1e 81 |....%:...H..0...| -[ Too much input for diff (SHA1: 6efa7af7add1fe5ba288c5ea10dd9e2328a4c697) ] +[ Too much input for diff (SHA1: 867b19a5d3489d643cdeb48f1950d1d5f6af4f93) ] The changing bytes are in the UFS partition but apparently invisible from above: fk@t520 ~ $sudo /usr/src/release/scripts/image-checksum.sh -v /images/ElectroBSD-r318528-2613fdfb3469-bhyve-2c/ElectroBSD-r318528-2613fdfb3469.img /images/ElectroBSD-r318528-2613fdfb3469-bhyve-4c/ElectroBSD-r318528-2613fdfb3469.img Mounting /dev/md0p2 at /mnt Running mtree, saving spec in /images/ElectroBSD-r318528-2613fdfb3469-bhyve-2c/ElectroBSD-r318528-2613fdfb3469.img.mtree Unmounting /mnt ... Mounting /dev/md0p2 at /mnt Running ls to get inodes, saving output in /images/ElectroBSD-r318528-2613fdfb3469-bhyve-2c/ElectroBSD-r318528-2613fdfb3469.img.ls Unmounting /mnt ... gpart checksum: df93d1be80c1870b38e2e9888c32898f090c72aad8f72838f8ee9117f15a326e Boot code checksum: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 mtree checksum: 758bff96cef51a0fbc8f0aa8386a7c00ef084740d7c185a6d9152a1a9f17e3a3 ls checksum: 2c2d99a9409f9eb1b0d32b0defa65f5454017e29e57f7295c02c495c121f0dd0 Partial image checksum for /images/ElectroBSD-r318528-2613fdfb3469-bhyve-2c/ElectroBSD-r318528-2613fdfb3469.img: dff88a8272549f8e01ad7cc325f5af284ba81f964bcc8001e373af287b5a4b05 Mounting /dev/md0p2 at /mnt Running mtree, saving spec in /images/ElectroBSD-r318528-2613fdfb3469-bhyve-4c/ElectroBSD-r318528-2613fdfb3469.img.mtree Unmounting /mnt ... Mounting /dev/md0p2 at /mnt Running ls to get inodes, saving output in /images/ElectroBSD-r318528-2613fdfb3469-bhyve-4c/ElectroBSD-r318528-2613fdfb3469.img.ls Unmounting /mnt ... gpart checksum: df93d1be80c1870b38e2e9888c32898f090c72aad8f72838f8ee9117f15a326e Boot code checksum: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 mtree checksum: 758bff96cef51a0fbc8f0aa8386a7c00ef084740d7c185a6d9152a1a9f17e3a3 ls checksum: 2c2d99a9409f9eb1b0d32b0defa65f5454017e29e57f7295c02c495c121f0dd0 Partial image checksum for /images/ElectroBSD-r318528-2613fdfb3469-bhyve-4c/ElectroBSD-r318528-2613fdfb3469.img: dff88a8272549f8e01ad7cc325f5af284ba81f964bcc8001e373af287b5a4b05 While this commit doesn't actually solve anything, it's kept for now as it doesn't hurt and it's useful to keep an example difference around. Obtained from: ElectroBSD --- release/amd64/make-memstick.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/release/amd64/make-memstick.sh b/release/amd64/make-memstick.sh index 6476cf812a29..af3e5003bf76 100755 --- a/release/amd64/make-memstick.sh +++ b/release/amd64/make-memstick.sh @@ -41,7 +41,10 @@ mtree -c -k time -p "${1}" | mtree -C -k all | sed \ > "${2}.mtree" || return 1 # The base makefs may not have -T support yet, # thus we use the fresh one that goes into the image. -dist/base/usr/sbin/makefs -T "${EPOCH_DATE-0}" \ +# +# Bind makefs to a single cpu as the output is core dependant +# (XXX: doesn't seem to have the intended effect) +cpuset -l 0 dist/base/usr/sbin/makefs -T "${EPOCH_DATE-0}" \ -B little -o label="${VOLUME_LABEL}" -o version=2 -F "${2}.mtree" ${2}.part ${1} rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local -- 2.32.0