On Tue, Apr 14, 2009 at 01:51:59PM -0700, new_guy wrote:
no need for custom kernel, read mount_vnd(8). you can also run this
script at boot to mount your /home after getting correct password from
user:
#!/bin/sh
# mount crypto partition
COUNTER=0
MAX_TRIES=3
SALT=/crypto/home.slt
IMG=/crypto/home.img
ROUNDS=20000
MOUNT_PNT=/home
DISK=svnd0
PART=c
MOUNT_OPTS="rw,nodev,nosuid,softdep"
if [ ! -f $IMG -o ! -f $SALT ]; then
echo "[-] $IMG or $SALT not found"
exit
fi
#echo
while [ $COUNTER -lt $MAX_TRIES ]
do
sleep $(($COUNTER*2))
echo "[+] Mounting $MOUNT_PNT"
/sbin/vnconfig -K $ROUNDS -S $SALT $DISK $IMG
/sbin/fsck -y /dev/$DISK$PART
/sbin/mount -o $MOUNT_OPTS /dev/$DISK$PART $MOUNT_PNT
if [ $? != 0 ] ; then
/sbin/vnconfig -u $DISK
COUNTER=$(($COUNTER+1))
else
echo "[+] Success."
exit #normal exit point
fi
done
echo "[-] Failure."