Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 378105 | Differences between
and this patch

Collapse All | Expand All

(-)initrd.scripts (-22 / +36 lines)
Lines 766-793 Link Here
766
		else
766
		else
767
			case "${LUKS_DEVICE}" in
767
			case "${LUKS_DEVICE}" in
768
				UUID\=*|LABEL\=*)
768
				UUID\=*|LABEL\=*)
769
					local REAL_LUKS=""
769
					local CONF_DEVICE="${LUKS_DEVICE}"
770
					local retval=1
770
					get_real_device
771
771
					LUKS_DEVICE="${CONF_DEVICE}"
772
					if [ "${retval}" -ne 0 ]; then
773
						REAL_LUKS=`findfs "${LUKS_DEVICE}" 2>/dev/null`
774
						retval=$?
775
					fi
776
777
					if [ "$retval" -ne 0 ]; then
778
						REAL_LUKS=`busybox findfs "${LUKS_DEVICE}" 2>/dev/null`
779
						retval=$?
780
					fi
781
782
					if [ "${retval}" -ne 0 ]; then
783
						REAL_LUKS=`blkid -l -t "${LUKS_DEVICE}" | cut -d ":" -f 1 2>/dev/null`
784
						retval=$?
785
					fi
786
787
					if [ "${retval}" -eq 0 ] && [ -n "${REAL_LUKS}" ]; then
788
						good_msg "Detected device ${REAL_LUKS}"
789
						LUKS_DEVICE="${REAL_LUKS}"
790
					fi
791
				;;
772
				;;
792
			esac
773
			esac
793
774
Lines 804-809 Link Here
804
				then
785
				then
805
					if [ ! -e "${mntkey}${LUKS_KEY}" ] 
786
					if [ ! -e "${mntkey}${LUKS_KEY}" ] 
806
					then
787
					then
788
						case "${LUKS_KEYDEV}" in
789
							UUID\=*|LABEL\=*)
790
								local CONF_DEVICE="${LUKS_KEYDEV}"
791
								get_real_device
792
								LUKS_KEYDEV="${CONF_DEVICE}"
793
							;;
794
						esac
795
						
807
						if [ -b "${LUKS_KEYDEV}" ]
796
						if [ -b "${LUKS_KEYDEV}" ]
808
						then good_msg "Using key device ${LUKS_KEYDEV}." ${CRYPT_SILENT}
797
						then good_msg "Using key device ${LUKS_KEYDEV}." ${CRYPT_SILENT}
809
						else
798
						else
Lines 1143-1145 Link Here
1143
		USE_UNIONFS_NORMAL=0
1132
		USE_UNIONFS_NORMAL=0
1144
	fi
1133
	fi
1145
}
1134
}
1135
1136
get_real_device() {
1137
	local REAL_DEVICE=""
1138
	local retval=1
1139
1140
	if [ "${retval}" -ne 0 ]; then
1141
		REAL_DEVICE=`findfs "${CONF_DEVICE}" 2>/dev/null`
1142
		retval=$?
1143
	fi
1144
1145
	if [ "$retval" -ne 0 ]; then
1146
		REAL_DEVICE=`busybox findfs "${CONF_DEVICE}" 2>/dev/null`
1147
		retval=$?
1148
	fi
1149
1150
	if [ "${retval}" -ne 0 ]; then
1151
		REAL_DEVICE=`blkid -l -t "${CONF_DEVICE}" | cut -d ":" -f 1 2>/dev/null`
1152
		retval=$?
1153
	fi
1154
1155
	if [ "${retval}" -eq 0 ] && [ -n "${REAL_DEVICE}" ]; then
1156
		good_msg "Detected device ${REAL_DEVICE}"
1157
		CONF_DEVICE="${REAL_DEVICE}"
1158
	fi
1159
}

Return to bug 378105