From 6853e7e15eeae2321a53ffaaf14e482d5cc1fd82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=A4chler?= Date: Mon, 3 May 2010 18:46:07 +0200 Subject: encryption: Look for cryptsetup in various places 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. --- rc.sysinit | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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" -- cgit v1.2.3