summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2010-05-03 18:46:07 +0200
committerThomas Bächler <thomas@archlinux.org>2010-05-03 18:46:07 +0200
commit6853e7e15eeae2321a53ffaaf14e482d5cc1fd82 (patch)
treed47fd03fd3a60fd53ff759cd0818bbb5fd790f53
parent89ed24762f3145eaa17af6d9270728825502c90e (diff)
encryption: Look for cryptsetup in various places2010.05-1
The cryptsetup binary will move to /sbin/cryptsetup and the static binary will be removed. Add code that will try /sbin/cryptsetup first, then /usr/sbin/cryptsetup and fall back to the old /sbin/cryptsetup.static if everything else fails.
-rwxr-xr-xrc.sysinit14
1 files changed, 13 insertions, 1 deletions
diff --git a/rc.sysinit b/rc.sysinit
index c4ebd77..fd6e970 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -141,7 +141,19 @@ if [ -f /etc/crypttab -a -n "$(/bin/grep -v ^# /etc/crypttab | /bin/grep -v ^$)"
/sbin/modprobe -q dm-mod 2>/dev/null
stat_busy "Unlocking encrypted volumes:"
csfailed=0
- CS=/sbin/cryptsetup.static
+ # Arch cryptsetup packages traditionally contained the binaries
+ # /usr/sbin/cryptsetup
+ # /sbin/cryptsetup.static
+ # By default, initscripts used the /sbin/cryptsetup.static.
+ # Newer packages will only have /sbin/cryptsetup and no static binary
+ # This ensures maximal compatibility with the old and new layout
+ if [ -x /sbin/cryptsetup ]; then
+ CS=/sbin/cryptsetup
+ elif [ -x /usr/sbin/cryptsetup ]; then
+ CS=/usr/sbin/cryptsetup
+ else
+ CS=/sbin/cryptsetup.static
+ fi
do_crypt() {
if [ $# -ge 3 ]; then
cname="$1"