From: Lennart Poettering Date: Wed, 10 Mar 2021 16:55:15 +0000 (+0100) Subject: dissect: show partition label in table X-Git-Tag: v249-rc1~509^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1474d7ac2d308204e599a2502a8b5625bca76bcc;p=thirdparty%2Fsystemd.git dissect: show partition label in table We nowadays pick up the partition label while dissecting, let's show it if we have it. --- diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c index 57fcbe8d4b8..65ddb1d1493 100644 --- a/src/dissect/dissect.c +++ b/src/dissect/dissect.c @@ -467,7 +467,7 @@ static int action_dissect(DissectedImage *m, LoopDevice *d) { return log_oom(); } - t = table_new("rw", "designator", "partition uuid", "fstype", "architecture", "verity", "node", "partno"); + t = table_new("rw", "designator", "partition uuid", "partition label", "fstype", "architecture", "verity", "node", "partno"); if (!t) return log_oom(); @@ -496,6 +496,7 @@ static int action_dissect(DissectedImage *m, LoopDevice *d) { r = table_add_many( t, + TABLE_STRING, p->label, TABLE_STRING, p->fstype, TABLE_STRING, architecture_to_string(p->architecture)); if (r < 0) diff --git a/test/units/testsuite-50.sh b/test/units/testsuite-50.sh index b4a5fee842e..e2d8ef6da23 100755 --- a/test/units/testsuite-50.sh +++ b/test/units/testsuite-50.sh @@ -30,13 +30,13 @@ roothash="$(cat ${image}.roothash)" os_release=$(test -e /etc/os-release && echo /etc/os-release || echo /usr/lib/os-release) -systemd-dissect --json=short ${image}.raw | grep -q -F '{"rw":"ro","designator":"root","partition_uuid":null,"fstype":"squashfs","architecture":null,"verity":"external"' +systemd-dissect --json=short ${image}.raw | grep -q -F '{"rw":"ro","designator":"root","partition_uuid":null,"partition_label":null,"fstype":"squashfs","architecture":null,"verity":"external"' systemd-dissect ${image}.raw | grep -q -F "MARKER=1" systemd-dissect ${image}.raw | grep -q -F -f $os_release mv ${image}.verity ${image}.fooverity mv ${image}.roothash ${image}.foohash -systemd-dissect --json=short ${image}.raw --root-hash=${roothash} --verity-data=${image}.fooverity | grep -q -F '{"rw":"ro","designator":"root","partition_uuid":null,"fstype":"squashfs","architecture":null,"verity":"external"' +systemd-dissect --json=short ${image}.raw --root-hash=${roothash} --verity-data=${image}.fooverity | grep -q -F '{"rw":"ro","designator":"root","partition_uuid":null,"partition_label":null,"fstype":"squashfs","architecture":null,"verity":"external"' systemd-dissect ${image}.raw --root-hash=${roothash} --verity-data=${image}.fooverity | grep -q -F "MARKER=1" systemd-dissect ${image}.raw --root-hash=${roothash} --verity-data=${image}.fooverity | grep -q -F -f $os_release mv ${image}.fooverity ${image}.verity @@ -127,8 +127,8 @@ losetup -d ${loop} ROOT_UUID=$(systemd-id128 -u show $(head -c 32 ${image}.roothash) -u | tail -n 1 | cut -b 6-) VERITY_UUID=$(systemd-id128 -u show $(tail -c 32 ${image}.roothash) -u | tail -n 1 | cut -b 6-) -systemd-dissect --json=short --root-hash ${roothash} ${image}.gpt | grep -q '{"rw":"ro","designator":"root","partition_uuid":"'$ROOT_UUID'","fstype":"squashfs","architecture":"'$architecture'","verity":"yes","node":' -systemd-dissect --json=short --root-hash ${roothash} ${image}.gpt | grep -q '{"rw":"ro","designator":"root-verity","partition_uuid":"'$VERITY_UUID'","fstype":"DM_verity_hash","architecture":"'$architecture'","verity":null,"node":' +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":' +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":' systemd-dissect --root-hash ${roothash} ${image}.gpt | grep -q -F "MARKER=1" systemd-dissect --root-hash ${roothash} ${image}.gpt | grep -q -F -f $os_release