Permalink
Browse files

sysinit: remove cryptsetup compat

We haven't had the static binary in nearly 2 years, so simply call this
without a PATH lookup.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
  • Loading branch information...
1 parent 28ec5b7 commit cb1ddfc15431f2e6498c93cd4da53e14f1147659 @falconindy falconindy committed with teg Feb 20, 2012
Showing with 7 additions and 18 deletions.
  1. +0 −11 functions
  2. +7 −7 rc.sysinit
View
11 functions
@@ -379,17 +379,6 @@ activate_vgs() {
(( $? == 0 )) && stat_done || stat_fail
}
-# 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
-for CS in /sbin/cryptsetup /usr/sbin/cryptsetup \
- /sbin/cryptsetup.static ''; do
- [[ -x $CS ]] && break
-done
-
read_crypttab() {
# $1 = function to call with the split out line from the crypttab
local line nspo failed=0
View
14 rc.sysinit
@@ -89,7 +89,7 @@ udevd_modprobe sysinit
activate_vgs
# Set up non-root encrypted partition mappings
-if [[ -f /etc/crypttab && $CS ]] && grep -q ^[^#] /etc/crypttab; then
+if [[ -f /etc/crypttab ]] && type -p cryptsetup >/dev/null; then
stat_busy "Unlocking encrypted volumes:"
modprobe -q dm-crypt 2>/dev/null
do_unlock() {
@@ -102,7 +102,7 @@ if [[ -f /etc/crypttab && $CS ]] && grep -q ^[^#] /etc/crypttab; then
# Ordering of options is different if you are using LUKS vs. not.
# Use ugly swizzling to deal with it.
# isLuks only gives an exit code but no output to stdout or stderr.
- if $CS isLuks "$2" 2>/dev/null; then
+ if cryptsetup isLuks "$2" 2>/dev/null; then
open=luksOpen
a=$2
b=$1
@@ -125,13 +125,13 @@ if [[ -f /etc/crypttab && $CS ]] && grep -q ^[^#] /etc/crypttab; then
fi
if (( _overwriteokay == 0 )); then
false
- elif $CS -d /dev/urandom $4 $open "$a" "$b" >/dev/null; then
+ elif cryptsetup -d /dev/urandom $4 $open "$a" "$b" >/dev/null; then
stat_append "creating swapspace.."
mkswap -f -L $1 /dev/mapper/$1 >/dev/null
fi;;
ASK)
printf "\nOpening '$1' volume:\n"
- $CS $4 $open "$a" "$b" < /dev/console;;
+ cryptsetup $4 $open "$a" "$b" < /dev/console;;
/dev*)
local ckdev=${3%%:*}
local cka=${3#*:}
@@ -153,13 +153,13 @@ if [[ -f /etc/crypttab && $CS ]] && grep -q ^[^#] /etc/crypttab; then
# cka is numeric: cka=offset, ckb=length
dd if=${ckdev} of=${ckfile} bs=1 skip=${cka} count=${ckb} >/dev/null 2>&1;;
esac
- $CS -d ${ckfile} $4 $open "$a" "$b" >/dev/null
+ cryptsetup -d ${ckfile} $4 $open "$a" "$b" >/dev/null
dd if=/dev/urandom of=${ckfile} bs=1 count=$(stat -c %s ${ckfile}) conv=notrunc >/dev/null 2>&1
rm ${ckfile};;
/*)
- $CS -d "$3" $4 $open "$a" "$b" >/dev/null;;
+ cryptsetup -d "$3" $4 $open "$a" "$b" >/dev/null;;
*)
- echo "$3" | $CS $4 $open "$a" "$b" >/dev/null;;
+ echo "$3" | cryptsetup $4 $open "$a" "$b" >/dev/null;;
esac
if (( $? )); then
failed=1

0 comments on commit cb1ddfc

Please sign in to comment.