diff options
author | Jenya Sovetkin | 2017-10-27 16:46:20 +0200 |
---|---|---|
committer | Jenya Sovetkin | 2017-10-27 16:46:20 +0200 |
commit | b2c87aa33c4af2bb4a2bb80f1850b6e8cfe3651e (patch) | |
tree | b131cc61a8fa0d7dc5b3c5eb737f020ff577bd9d | |
parent | a44a836f208d80216087b6187424b2facb5031b7 (diff) | |
download | aur-b2c87aa33c4af2bb4a2bb80f1850b6e8cfe3651e.tar.gz |
fixing path and racing condition
-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 |