You are not logged in.

#1 2007-10-26 22:02:45

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Encrypt hook not finding USB stick [SOLVED]

I recently encrypted a partition on my laptop and would like to see its mounting fully automated. For that, I followed the Wiki entry on encrypted root partitions. Whereas it by default the encrypt hook only supports encrypted root partitions, you can easily change the cryptdev and cryptname variables to make it support another partition by default. Now Arch boots fine, runs the encrypt hook, but does not find the USB stick (where a second key is located on) and falls back to the prompt asking the passphrase.
Once I fill in this passphrase, booting continues and the encrypted partition gets mounted correctly.


I have followed the instructions on the wiki page (included vfat module and codepage module and udev rules the cpio image), yet it fails to see the stick. Grub has been configured accordingly too. The encrypt hook waits for the device to come up, then displays the prompt asking for the passphrase.

I suppose this part of the encrypt hook is the culprit, but I'm not sure:

        # Get keyfile if specified
        ckeyfile="/crypto_keyfile.bin"
        if [ "x${cryptkey}" != "x" ]; then
            set -- $(/bin/replace "${cryptkey}" ':'); ckdev=$1; ckarg1=$2; ckarg2=$3
            try=10
            echo "Waiting for ${ckdev} ..."
            while [ ! -b ${ckdev} -a ${try} -gt 0 ]; do
                sleep 1
                try=$((${try}-1))
            done
            if [ -b ${ckdev} ]; then
                case ${ckarg1} in
                    *[!0-9]*)
                        # Use a file on the device
                        # ckarg1 is not numeric: ckarg1=filesystem, ckarg2=path
                        mkdir /ckey
                        mount -r -t ${ckarg1} ${ckdev} /ckey
                        dd if=/ckey/${ckarg2} of=${ckeyfile} >/dev/null 2>&1
                        umount /ckey
                        ;;
                    *)
                        # Read raw data from the block device
                        # ckarg1 is numeric: ckarg1=offset, ckarg2=length
                        dd if=${ckdev} of=${ckeyfile} bs=1 skip=${ckarg1} count=${ckarg2} >/dev/null 2>&1
                        ;;
                esac
            fi
            [ ! -f ${ckeyfile} ] && echo "Keyfile could not be opened. Reverting to passphrase."
        fi

I'd be quite obliged if anyone could help me out on this one smile.

Last edited by B (2007-10-27 00:51:44)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#2 2007-10-27 00:44:53

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Encrypt hook not finding USB stick [SOLVED]

Solved - just forgot the USB hook big_smile. Props to wide-eye for pointing me to the obvious!


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

Board footer

Powered by FluxBB