diff options
author | Bruno Cichon <ebrasca@librepanther.com> | 2018-10-01 01:51:03 +0200 |
---|---|---|
committer | Bruno Cichon <ebrasca@librepanther.com> | 2018-10-01 01:51:03 +0200 |
commit | 56f955aca6231693fe797de4793f77ed58ab116e (patch) | |
tree | 17daeabce98174f288bab94b47961dc9e9931e66 /libre-testing/lvm2/lvm2_hook | |
parent | 75ff40baa049bae7e9270d20ef86a88b733006ab (diff) | |
download | abslibre-56f955aca6231693fe797de4793f77ed58ab116e.tar.gz abslibre-56f955aca6231693fe797de4793f77ed58ab116e.tar.bz2 abslibre-56f955aca6231693fe797de4793f77ed58ab116e.zip |
Add some base packages for ppc64le
Diffstat (limited to 'libre-testing/lvm2/lvm2_hook')
-rw-r--r-- | libre-testing/lvm2/lvm2_hook | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libre-testing/lvm2/lvm2_hook b/libre-testing/lvm2/lvm2_hook new file mode 100644 index 000000000..3c28d67ff --- /dev/null +++ b/libre-testing/lvm2/lvm2_hook @@ -0,0 +1,25 @@ +#!/usr/bin/ash + +run_earlyhook() { + mkdir /run/lvm + lvmetad +} + +# We are suffering a race condition in non-systemd initramfs: If lvmetad is +# killed before pvscan processes finish we have stale processes and +# uninitialized physical volumes. So wait for pvscan processes to finish. +# Break after 10 seconds (50*0.2s) to avaid infinite loop. +run_latehook() { + local i=50 + + while pgrep -f pvscan >/dev/null 2>/dev/null && [ $i -gt 0 ]; do + sleep 0.2 + i=$((i - 1)) + done +} + +run_cleanuphook() { + kill $(cat /run/lvmetad.pid) +} + +# vim: set ft=sh ts=4 sw=4 et: |