aboutsummaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2010-12-06 15:41:48 +0100
committerTom Gundersen <teg@jklm.no>2010-12-06 15:41:48 +0100
commit0a2d37b6dfe45c7949952c552f4d0e698d7998f4 (patch)
treead833bfaa1cf156358ab8f4bb0fc5da27c16eb16 /rc.sysinit
parentfeef447b8368244525dd98582b662a369098b2f7 (diff)
downloadinitscripts-0a2d37b6dfe45c7949952c552f4d0e698d7998f4.tar.xz
cryptsetup: fix indentation
It now follows the vim modeline at the bottom of the file.
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-xrc.sysinit78
1 files changed, 41 insertions, 37 deletions
diff --git a/rc.sysinit b/rc.sysinit
index 211ee0a..9b16fb0 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -125,49 +125,53 @@ activate_vgs
if [[ -f /etc/crypttab && $CS ]]; then
/sbin/modprobe -q dm-crypt 2>/dev/null
stat_busy "Unlocking encrypted volumes:"
- do_unlock() {
- # $1 = requested name
- # $2 = source device
- # $3 = password
- # $4 = options
- local open=create a="$1" b="$2" failed=0
- # Ordering of options is different if you are using LUKS vs. not.
- # Use ugly swizzling to deal with it.
- if $CS isLuks "$2"; then
- open=luksOpen
- a="$2"
- b="$1"
- fi
- case $3 in
- SWAP) if [[ $_isluks ]]; then
- # This is DANGEROUS! The only possible safety check
- # is to not proceed in case we find a LUKS device
- # This may cause dataloss if it is not used carefully
- false
- elif $CS -d /dev/urandom $4 $open "$a" "$b" >/dev/null; then
- stat_append "creating swapspace.."
- /sbin/mkswap -f -L $1 /dev/mapper/$1 >/dev/null
- fi;;
- ASK) printf "\nOpening '$1' volume:\n"
- $CS $4 $open "$a" "$b" < /dev/console;;
- /*) $CS -d "$3" $4 $open "$a" "$b" >/dev/null;;
- *) echo "$3" | $CS $4 $open "$a" "$b" >/dev/null;;
- esac
- if (($? != 0)); then
- failed=1
- stat_append "failed "
- else
- stat_append "ok "
- fi
- return $failed
- }
+ do_unlock() {
+ # $1 = requested name
+ # $2 = source device
+ # $3 = password
+ # $4 = options
+ local open=create a="$1" b="$2" failed=0
+ # Ordering of options is different if you are using LUKS vs. not.
+ # Use ugly swizzling to deal with it.
+ if $CS isLuks "$2"; then
+ open=luksOpen
+ a="$2"
+ b="$1"
+ fi
+ case $3 in
+ SWAP)
+ if [[ $_isluks ]]; then
+ # This is DANGEROUS! The only possible safety check
+ # is to not proceed in case we find a LUKS device
+ # This may cause dataloss if it is not used carefully
+ false
+ elif $CS -d /dev/urandom $4 $open "$a" "$b" >/dev/null; then
+ stat_append "creating swapspace.."
+ /sbin/mkswap -f -L $1 /dev/mapper/$1 >/dev/null
+ fi;;
+ ASK)
+ printf "\nOpening '$1' volume:\n"
+ $CS $4 $open "$a" "$b" < /dev/console;;
+ /*)
+ $CS -d "$3" $4 $open "$a" "$b" >/dev/null;;
+ *)
+ echo "$3" | $CS $4 $open "$a" "$b" >/dev/null;;
+ esac
+ if (($? != 0)); then
+ failed=1
+ stat_append "failed "
+ else
+ stat_append "ok "
+ fi
+ return $failed
+ }
if read_crypttab do_unlock; then
stat_done
else
stat_fail
fi
# Maybe someone has LVM on an encrypted block device
- activate_vgs
+ activate_vgs
fi
status "Mounting Root Read-only" /bin/mount -n -o remount,ro /