mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 13:03:28 +01:00
remove quotes from --label creation for bcachefs
fixes device groups, for example where the disko config given looks like: label = "fast.dev1"; after formatting, the device has a literal label of "fast.dev1" which breaks bcachefs device groups: echo fast > /sys/fs/bcachefs/<id>/options/foreground_target gives the error Invalid argument, echo fast.dev1 fails as well echo "\"fast\"" fails the same, however echo "\"fast.dev1\"" succeeds after this, device labels and groups work as expected and any component of the label can be used for a *_target
This commit is contained in:
1 parent
a4f7deb49f
commit
d74db625a5
2 files changed
+5
-5
No files matched your search
@@ -66,7 +66,7 @@
|
||||
default = ''
|
||||
# Write device arguments to temporary directory for bcachefs_filesystem.
|
||||
{
|
||||
printf '%s\n' '--label="${config.label}"';
|
||||
printf '%s\n' '--label=${config.label}';
|
||||
${lib.concatMapStrings (args: ''printf '%s\n' '${args}';'') config.extraFormatArgs}
|
||||
printf '%s\n' '${config.device}';
|
||||
} >> "$disko_devices_dir/bcachefs-${lib.escapeShellArg config.filesystem}";
|
||||
|
||||
+4
-4
@@ -48,10 +48,10 @@ diskoLib.testLib.makeDiskoTest {
|
||||
# Verify device membership and labels.
|
||||
machine.succeed("bcachefs show-super /dev/vda2 | grep 'Devices:' | grep -q '3'");
|
||||
machine.succeed("bcachefs show-super /dev/vdd1 | grep 'Devices:' | grep -q '1'");
|
||||
machine.succeed("bcachefs show-super /dev/vda2 | grep 'Label:' | grep -q 'vdb2'");
|
||||
machine.succeed("bcachefs show-super /dev/vda2 | grep 'Label:' | grep -q 'vdc1'");
|
||||
machine.succeed("bcachefs show-super /dev/vda2 | grep 'Label:' | grep -q 'vdd1'");
|
||||
machine.succeed("bcachefs show-super /dev/vdd1 | grep 'Label:' | grep -q 'vde1'");
|
||||
machine.succeed("bcachefs show-super /dev/vda2 | grep -qE '^[[:space:]]+Label:[[:space:]]+vdb2[[:space:]]\([[:digit:]]+\)'");
|
||||
machine.succeed("bcachefs show-super /dev/vda2 | grep -qE '^[[:space:]]+Label:[[:space:]]+vdc1[[:space:]]\([[:digit:]]+\)'");
|
||||
machine.succeed("bcachefs show-super /dev/vda2 | grep -qE '^[[:space:]]+Label:[[:space:]]+vdd1[[:space:]]\([[:digit:]]+\)'");
|
||||
machine.succeed("bcachefs show-super /dev/vdd1 | grep -qE '^[[:space:]]+Label:[[:space:]]+vde1[[:space:]]\([[:digit:]]+\)'");
|
||||
machine.fail("bcachefs show-super /dev/vda2 | grep 'Label:' | grep -q 'non-existent'");
|
||||
|
||||
# @todo Verify format arguments.
|
||||
|
||||
Reference in new issue
Block a user