5 if ! command -v systemd-repart
&>/dev
/null
; then
6 echo "no systemd-repart" >/skipped
10 export SYSTEMD_LOG_LEVEL
=debug
13 rm -f /var
/tmp
/testsuite-58.img
/var
/tmp
/testsuite-58.2.img
/tmp
/testsuite-58.dump
14 mkdir
-p /tmp
/testsuite-58-defs
/
16 # First part: create a disk image and verify its in order
18 cat >/tmp
/testsuite-58-defs
/esp.conf
<<EOF
25 cat >/tmp
/testsuite-58-defs
/usr.conf
<<EOF
33 cat >/tmp
/testsuite-58-defs
/root.conf
<<EOF
38 MakeDirectories=/usr /efi
41 systemd-repart
--definitions=/tmp
/testsuite-58-defs
/ \
44 --seed=750b6cd5c4ae4012a15e7be3c29e6a47 \
45 /var
/tmp
/testsuite-58.img
47 sfdisk
--dump /var
/tmp
/testsuite-58.img |
tee /tmp
/testsuite-58.dump
49 grep -qxF '/var/tmp/testsuite-58.img1 : start= 2048, size= 20480, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=39107B09-615D-48FB-BA37-C663885FCE67, name="esp"' /tmp
/testsuite-58.dump
50 grep -qxF '/var/tmp/testsuite-58.img2 : start= 22528, size= 20480, type=4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709, uuid=60F33797-1D71-4DCB-AA6F-20564F036CD0, name="root-x86-64", attrs="GUID:59"' /tmp
/testsuite-58.dump
51 grep -qxF '/var/tmp/testsuite-58.img3 : start= 43008, size= 20480, type=8484680C-9521-48C6-9C11-B0720656F69E, uuid=7E3369DD-D653-4513-ADF5-B993A9F20C16, name="usr-x86-64", attrs="GUID:60"' /tmp
/testsuite-58.dump
53 # Second part, duplicate it with CopyBlocks=auto
55 cat >/tmp
/testsuite-58-defs
/esp.conf
<<EOF
61 cat >/tmp
/testsuite-58-defs
/usr.conf
<<EOF
68 cat >/tmp
/testsuite-58-defs
/root.conf
<<EOF
74 systemd-repart
--definitions=/tmp
/testsuite-58-defs
/ \
77 --seed=750b6cd5c4ae4012a15e7be3c29e6a47 \
78 --image=/var
/tmp
/testsuite-58.img \
79 /var
/tmp
/testsuite-58.2.img
81 cmp /var
/tmp
/testsuite-58.img
/var
/tmp
/testsuite-58.2.img
83 rm /var
/tmp
/testsuite-58.img
/var
/tmp
/testsuite-58.2.img
/tmp
/testsuite-58.dump
84 rm -r /tmp
/testsuite-58-defs
/