Skip to content

Commit ee8e497

Browse files
committed
dissect: show growfs flag in systemd-dissect table output
1 parent de98f63 commit ee8e497

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/dissect/dissect.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ static int action_dissect(DissectedImage *m, LoopDevice *d) {
467467
return log_oom();
468468
}
469469

470-
t = table_new("rw", "designator", "partition uuid", "partition label", "fstype", "architecture", "verity", "node", "partno");
470+
t = table_new("rw", "designator", "partition uuid", "partition label", "fstype", "architecture", "verity", "growfs", "node", "partno");
471471
if (!t)
472472
return log_oom();
473473

@@ -511,6 +511,10 @@ static int action_dissect(DissectedImage *m, LoopDevice *d) {
511511
if (r < 0)
512512
return table_log_add_error(r);
513513

514+
r = table_add_many(t, TABLE_BOOLEAN, (int) p->growfs);
515+
if (r < 0)
516+
return table_log_add_error(r);
517+
514518
if (p->partno < 0) /* no partition table, naked file system */ {
515519
r = table_add_cell(t, NULL, TABLE_STRING, arg_image);
516520
if (r < 0)

test/units/testsuite-50.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ losetup -d "${loop}"
130130
ROOT_UUID="$(systemd-id128 -u show "$(head -c 32 "${image}.roothash")" -u | tail -n 1 | cut -b 6-)"
131131
VERITY_UUID="$(systemd-id128 -u show "$(tail -c 32 "${image}.roothash")" -u | tail -n 1 | cut -b 6-)"
132132

133-
systemd-dissect --json=short --root-hash "${roothash}" "${image}.gpt" | grep -q '{"rw":"ro","designator":"root","partition_uuid":"'"$ROOT_UUID"'","partition_label":"Root Partition","fstype":"squashfs","architecture":"'"$architecture"'","verity":"yes","node":'
134-
systemd-dissect --json=short --root-hash "${roothash}" "${image}.gpt" | grep -q '{"rw":"ro","designator":"root-verity","partition_uuid":"'"$VERITY_UUID"'","partition_label":"Verity Partition","fstype":"DM_verity_hash","architecture":"'"$architecture"'","verity":null,"node":'
133+
systemd-dissect --json=short --root-hash "${roothash}" "${image}.gpt" | grep -q '{"rw":"ro","designator":"root","partition_uuid":"'"$ROOT_UUID"'","partition_label":"Root Partition","fstype":"squashfs","architecture":"'"$architecture"'","verity":"yes",'
134+
systemd-dissect --json=short --root-hash "${roothash}" "${image}.gpt" | grep -q '{"rw":"ro","designator":"root-verity","partition_uuid":"'"$VERITY_UUID"'","partition_label":"Verity Partition","fstype":"DM_verity_hash","architecture":"'"$architecture"'","verity":null,'
135135
systemd-dissect --root-hash "${roothash}" "${image}.gpt" | grep -q -F "MARKER=1"
136136
systemd-dissect --root-hash "${roothash}" "${image}.gpt" | grep -q -F -f <(sed 's/"//g' "$os_release")
137137

0 commit comments

Comments
 (0)