diff options
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 4 | ||||
-rw-r--r-- | openswap.hook | 10 |
3 files changed, 13 insertions, 5 deletions
@@ -1,7 +1,7 @@ pkgbase = mkinitcpio-openswap pkgdesc = mkinitcpio hook to open swap at boot time pkgver = 0.1.0 - pkgrel = 2 + pkgrel = 3 url = https://aur.archlinux.org/packages/mkinitcpio-openswap/ install = usage.install arch = any @@ -11,7 +11,7 @@ pkgbase = mkinitcpio-openswap source = openswap.hook source = openswap.install source = openswap.conf - sha256sums = b3ba16919450c229093adfbb758b72e2b31a8cbbc25e42e47693b9d0f4cc8a5b + sha256sums = 84ef428386b7f4353af036ccfbd4c60901a76e2d0c7a38dd3be2000219ea9d23 sha256sums = 94dd98a953bab2244215a2b20767cdc9500fc438bed9ec27cae72a73766c6b86 sha256sums = 3308f2679bb7c962d98adf2684d25390025d025e3d30bc1e773e3522311ad325 @@ -2,7 +2,7 @@ # Contributors: https://aur.archlinux.org/account/f4bio pkgname=mkinitcpio-openswap pkgver=0.1.0 -pkgrel=2 +pkgrel=3 pkgdesc="mkinitcpio hook to open swap at boot time" arch=(any) license=('unknown') @@ -13,7 +13,7 @@ install="usage.install" source=('openswap.hook' 'openswap.install' 'openswap.conf') -sha256sums=('b3ba16919450c229093adfbb758b72e2b31a8cbbc25e42e47693b9d0f4cc8a5b' +sha256sums=('84ef428386b7f4353af036ccfbd4c60901a76e2d0c7a38dd3be2000219ea9d23' '94dd98a953bab2244215a2b20767cdc9500fc438bed9ec27cae72a73766c6b86' '3308f2679bb7c962d98adf2684d25390025d025e3d30bc1e773e3522311ad325') diff --git a/openswap.hook b/openswap.hook index 9aad79a29c2d..9a96ad4b3ced 100644 --- a/openswap.hook +++ b/openswap.hook @@ -1,7 +1,15 @@ run_hook () { ## read openswap configurations - source openswap.conf + source /openswap.conf + + ## Optional: To avoid race conditions + x=0; + while [ ! -b "$keyfile_device" ] && [ $x -le 10 ]; do + x=$((x+1)) + sleep .2 + done + ## End of optional if [ -z "$keyfile_device" ] || [ -z "$keyfile_filename" ] then |