mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
Merge pull request #30658 from jnohlgard/udevadm-lock-return-code
udevadm: Propagate return code from verb result
This commit is contained in:
commit
e6bca18296
@ -104,9 +104,12 @@ int builtin_main(int argc, char *argv[], void *userdata) {
|
||||
}
|
||||
|
||||
r = udev_builtin_run(event, cmd, arg_command, true);
|
||||
if (r < 0)
|
||||
if (r < 0) {
|
||||
log_debug_errno(r, "Builtin command '%s' fails: %m", arg_command);
|
||||
goto finish;
|
||||
}
|
||||
|
||||
r = 0;
|
||||
finish:
|
||||
udev_builtin_exit();
|
||||
return r;
|
||||
|
@ -137,4 +137,4 @@ static int run(int argc, char *argv[]) {
|
||||
return udevadm_main(argc, argv);
|
||||
}
|
||||
|
||||
DEFINE_MAIN_FUNCTION(run);
|
||||
DEFINE_MAIN_FUNCTION_WITH_POSITIVE_FAILURE(run);
|
||||
|
@ -238,4 +238,17 @@ assert_rc 124 timeout 5 udevadm wait --removed /sys/class/net/$netdev
|
||||
udevadm wait --settle /sys/class/net/$netdev
|
||||
udevadm wait -h
|
||||
|
||||
udevadm lock --help
|
||||
udevadm lock --version
|
||||
for i in /dev/block/*; do
|
||||
udevadm lock --device "$i" --print
|
||||
udevadm lock --device "$i" true
|
||||
(! udevadm lock --device "$i" false)
|
||||
done
|
||||
for i in / /usr; do
|
||||
udevadm lock --backing "$i" --print
|
||||
udevadm lock --backing "$i" true
|
||||
(! udevadm lock --backing "$i" false)
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
@ -396,6 +396,11 @@ EOF
|
||||
|
||||
udevadm control --reload
|
||||
|
||||
# initialize partition table
|
||||
for disk in {0..9}; do
|
||||
echo 'label: gpt' | udevadm lock --device="${devices[$disk]}" sfdisk -q "${devices[$disk]}"
|
||||
done
|
||||
|
||||
# Delete the partitions, immediately recreate them, wait for udev to settle
|
||||
# down, and then check if we have any dangling symlinks in /dev/disk/. Rinse
|
||||
# and repeat.
|
||||
|
Loading…
Reference in New Issue
Block a user