summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-07-11 16:19:03 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2020-07-13 03:43:26 +0900
commit46072ae35a77bcabf34f47905eb787dbfa59db17 (patch)
tree9193d3299cdb3f3eb5d014e46fe668cd6e05dc5a
parent5553041a623f003ba978d3888c458651f525e647 (diff)
downloadsystemd-46072ae35a77bcabf34f47905eb787dbfa59db17.tar.gz
repart: include more relevant information in the warning message, fix test
The test would always fail with a long uname. In F33 this is right now "5.8.0-0.rc2.20200622git625d3449788f.1.fc33.x86_64" which caused the test to always fail.
-rw-r--r--src/partition/repart.c3
-rwxr-xr-xsrc/partition/test-repart.sh21
2 files changed, 12 insertions, 12 deletions
diff --git a/src/partition/repart.c b/src/partition/repart.c
index 3080521279..69df751563 100644
--- a/src/partition/repart.c
+++ b/src/partition/repart.c
@@ -917,7 +917,8 @@ static int config_parse_label(
if (char16_strlen(recoded) > 36) {
log_syntax(unit, LOG_WARNING, filename, line, 0,
- "Partition label too long for GPT table, ignoring: %s", rvalue);
+ "Partition label too long for GPT table, ignoring: \"%s\" (from \"%s\")",
+ resolved, rvalue);
return 0;
}
diff --git a/src/partition/test-repart.sh b/src/partition/test-repart.sh
index 7d63eb4664..bfb9bcb4c9 100755
--- a/src/partition/test-repart.sh
+++ b/src/partition/test-repart.sh
@@ -12,7 +12,7 @@ SEED=e2a40bf9-73f1-4278-9160-49c031e7aef8
$repart $D/zzz --empty=create --size=1G --seed=$SEED
-sfdisk -d $D/zzz | grep -v -e 'sector-size' -e '^$' > $D/empty
+sfdisk -d $D/zzz | grep -v -e 'sector-size' -e '^$' >$D/empty
cmp $D/empty - <<EOF
label: gpt
@@ -33,10 +33,11 @@ ln -s root.conf $D/definitions/root2.conf
cat >$D/definitions/home.conf <<EOF
[Partition]
Type=home
-Label=home-%v
+Label=home-first
+Label=home-always-too-long-xxxxxxxxxxxxxx-%v
EOF
-cat > $D/definitions/swap.conf <<EOF
+cat >$D/definitions/swap.conf <<EOF
[Partition]
Type=swap
SizeMaxBytes=64M
@@ -47,8 +48,6 @@ $repart $D/zzz --dry-run=no --seed=$SEED --definitions=$D/definitions
sfdisk -d $D/zzz | grep -v -e 'sector-size' -e '^$' >$D/populated
-UNAME=`uname -r`
-
cmp $D/populated - <<EOF
label: gpt
label-id: EF7F7EE2-47B3-4251-B1A1-09EA8BF12D5D
@@ -56,7 +55,7 @@ device: $D/zzz
unit: sectors
first-lba: 2048
last-lba: 2097118
-$D/zzz1 : start= 2048, size= 591856, type=933AC7E1-2EB4-4F13-B844-0E14E2AEF915, uuid=A6005774-F558-4330-A8E5-D6D2C01C01D6, name="home-$UNAME"
+$D/zzz1 : start= 2048, size= 591856, type=933AC7E1-2EB4-4F13-B844-0E14E2AEF915, uuid=A6005774-F558-4330-A8E5-D6D2C01C01D6, name="home-first"
$D/zzz2 : start= 593904, size= 591856, type=4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709, uuid=CE9C76EB-A8F1-40FF-813C-11DCA6C0A55B, name="root-x86-64"
$D/zzz3 : start= 1185760, size= 591864, type=4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709, uuid=AC60A837-550C-43BD-B5C4-9CB73B884E79, name="root-x86-64-2"
$D/zzz4 : start= 1777624, size= 131072, type=0657FD6D-A4AB-43C4-84E5-0933C84B4F4F, uuid=2AA78CDB-59C7-4173-AF11-C7453737A5D1, name="swap"
@@ -75,8 +74,8 @@ Label=custom_label
UUID=a0a1a2a3a4a5a6a7a8a9aaabacadaeaf
EOF
-echo "Label=ignored_label" >> $D/definitions/home.conf
-echo "UUID=b0b1b2b3b4b5b6b7b8b9babbbcbdbebf" >> $D/definitions/home.conf
+echo "Label=ignored_label" >>$D/definitions/home.conf
+echo "UUID=b0b1b2b3b4b5b6b7b8b9babbbcbdbebf" >>$D/definitions/home.conf
$repart $D/zzz --dry-run=no --seed=$SEED --definitions=$D/definitions
@@ -89,7 +88,7 @@ device: $D/zzz
unit: sectors
first-lba: 2048
last-lba: 2097118
-$D/zzz1 : start= 2048, size= 591856, type=933AC7E1-2EB4-4F13-B844-0E14E2AEF915, uuid=A6005774-F558-4330-A8E5-D6D2C01C01D6, name="home-$UNAME"
+$D/zzz1 : start= 2048, size= 591856, type=933AC7E1-2EB4-4F13-B844-0E14E2AEF915, uuid=A6005774-F558-4330-A8E5-D6D2C01C01D6, name="home-first"
$D/zzz2 : start= 593904, size= 591856, type=4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709, uuid=CE9C76EB-A8F1-40FF-813C-11DCA6C0A55B, name="root-x86-64"
$D/zzz3 : start= 1185760, size= 591864, type=4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709, uuid=AC60A837-550C-43BD-B5C4-9CB73B884E79, name="root-x86-64-2"
$D/zzz4 : start= 1777624, size= 131072, type=0657FD6D-A4AB-43C4-84E5-0933C84B4F4F, uuid=2AA78CDB-59C7-4173-AF11-C7453737A5D1, name="swap"
@@ -107,7 +106,7 @@ device: $D/zzz
unit: sectors
first-lba: 2048
last-lba: 4194270
-$D/zzz1 : start= 2048, size= 591856, type=933AC7E1-2EB4-4F13-B844-0E14E2AEF915, uuid=A6005774-F558-4330-A8E5-D6D2C01C01D6, name="home-$UNAME"
+$D/zzz1 : start= 2048, size= 591856, type=933AC7E1-2EB4-4F13-B844-0E14E2AEF915, uuid=A6005774-F558-4330-A8E5-D6D2C01C01D6, name="home-first"
$D/zzz2 : start= 593904, size= 591856, type=4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709, uuid=CE9C76EB-A8F1-40FF-813C-11DCA6C0A55B, name="root-x86-64"
$D/zzz3 : start= 1185760, size= 591864, type=4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709, uuid=AC60A837-550C-43BD-B5C4-9CB73B884E79, name="root-x86-64-2"
$D/zzz4 : start= 1777624, size= 131072, type=0657FD6D-A4AB-43C4-84E5-0933C84B4F4F, uuid=2AA78CDB-59C7-4173-AF11-C7453737A5D1, name="swap"
@@ -135,7 +134,7 @@ device: $D/zzz
unit: sectors
first-lba: 2048
last-lba: 6291422
-$D/zzz1 : start= 2048, size= 591856, type=933AC7E1-2EB4-4F13-B844-0E14E2AEF915, uuid=A6005774-F558-4330-A8E5-D6D2C01C01D6, name="home-$UNAME"
+$D/zzz1 : start= 2048, size= 591856, type=933AC7E1-2EB4-4F13-B844-0E14E2AEF915, uuid=A6005774-F558-4330-A8E5-D6D2C01C01D6, name="home-first"
$D/zzz2 : start= 593904, size= 591856, type=4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709, uuid=CE9C76EB-A8F1-40FF-813C-11DCA6C0A55B, name="root-x86-64"
$D/zzz3 : start= 1185760, size= 591864, type=4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709, uuid=AC60A837-550C-43BD-B5C4-9CB73B884E79, name="root-x86-64-2"
$D/zzz4 : start= 1777624, size= 131072, type=0657FD6D-A4AB-43C4-84E5-0933C84B4F4F, uuid=2AA78CDB-59C7-4173-AF11-C7453737A5D1, name="swap"