|
|
# $2 = recognition file | # $2 = recognition file |
# $3 = variable to have the device path | # $3 = variable to have the device path |
# $4 = directory before /mnt, like NEW_ROOT | # $4 = directory before /mnt, like NEW_ROOT |
|
# $5 = mount type for devices |
# args remaining are possible devices | # args remaining are possible devices |
| |
local media=$1 recon=$2 vrbl=$3 |
(( $# < 6 )) && \ |
|
bad_msg "Bad invocation of function findmediamount, please file a bug \ |
|
report with this message" && exit 1 |
|
|
|
local media=$1 recon=$2 vrbl=$3 mnttype=$5 |
local mntdir="${4}/mnt/${media}" | local mntdir="${4}/mnt/${media}" |
shift 4 |
shift 5 |
| |
good_msg "Looking for the ${media}" ${CRYPT_SILENT} | good_msg "Looking for the ${media}" ${CRYPT_SILENT} |
| |
|
|
then | then |
good_msg "Attempting to mount media:- ${x}" ${CRYPT_SILENT} | good_msg "Attempting to mount media:- ${x}" ${CRYPT_SILENT} |
| |
# if [ "${media}" = "cdrom" ]; then |
mount -r -t ${mnttype} ${x} ${mntdir} >/dev/null 2>&1 |
# mount -r -t iso9660 ${x} ${mntdir} &>/dev/null |
|
# else |
|
# mount -r -t auto ${x} ${mntdir} &>/dev/null |
|
# fi |
|
mount -r -t ${CDROOT_TYPE} ${x} ${mntdir} &>/dev/null |
|
if [ "$?" = '0' ] | if [ "$?" = '0' ] |
then | then |
# Check for the media | # Check for the media |
|
|
# a bunch of extra devices | # a bunch of extra devices |
[ -n "${CDROOT_DEV}" ] && DEVICES="${CDROOT_DEV}" | [ -n "${CDROOT_DEV}" ] && DEVICES="${CDROOT_DEV}" |
| |
findmediamount "cdrom" "${SUBDIR}/livecd" "REAL_ROOT" "${NEW_ROOT}" ${DEVICES} |
findmediamount "cdrom" "${SUBDIR}/livecd" "REAL_ROOT" "${NEW_ROOT}" "${CDROOT_TYPE}" ${DEVICES} |
} | } |
| |
bootstrapKey() { | bootstrapKey() { |
|
|
local KEYDEVS=`devicelist` | local KEYDEVS=`devicelist` |
eval local keyloc='"${CRYPT_'${1}'_KEY}"' | eval local keyloc='"${CRYPT_'${1}'_KEY}"' |
| |
findmediamount "key" "${keyloc}" "CRYPT_${1}_KEYDEV" "" ${KEYDEVS} |
findmediamount "key" "${keyloc}" "CRYPT_${1}_KEYDEV" "" "auto" ${KEYDEVS} |
} | } |
| |
cache_cd_contents() { | cache_cd_contents() { |