Add support for UUID to crypt_root (bug #315467)
authorChristian Giessner <bugzilla@christian-giessner.de>
Sat, 15 Jan 2011 16:51:24 +0000 (17:51 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Sat, 15 Jan 2011 16:51:51 +0000 (17:51 +0100)
defaults/initrd.scripts

index e258d3e2fd919727cf09ddc3dc341cc702ae3974..71f3550a0cc9d3bf8dd98c985d070b9c22931002 100755 (executable)
@@ -761,6 +761,33 @@ openLUKS() {
                        whereis "LUKS_KEYDEV" "${LUKS_NAME} key device"
                        KEYDEV_ERROR=0
                else
+                       case "${LUKS_DEVICE}" in
+                               UUID\=*)
+                                       REAL_LUKS=""
+                                       retval=1
+
+                                       if [ "${retval}" -ne '0' ]; then
+                                               REAL_LUKS=`findfs "${LUKS_DEVICE}" 2>/dev/null`
+                                               retval=$?
+                                       fi
+
+                                       if [ "$retval" -ne '0' ]; then
+                                               REAL_LUKS=`busybox findfs "${LUKS_DEVICE}" 2>/dev/null`
+                                               retval=$?
+                                       fi
+
+                                       if [ "${retval}" -ne '0' ]; then
+                                               REAL_LUKS=`blkid -t "${LUKS_DEVICE}" | cut -d ":" -f 1 2>/dev/null`
+                                               retval=$?
+                                       fi
+
+                                       if [ "${retval}" -eq '0' ] && [ -n "${REAL_LUKS}" ]; then
+                                               good_msg "Detected device ${REAL_LUKS}"
+                                               LUKS_DEVICE="${REAL_LUKS}"
+                                       fi
+                               ;;
+                       esac
+
                        setup_md_device ${LUKS_DEVICE}
                        cryptsetup isLuks ${LUKS_DEVICE}
                        if [ $? -ne 0 ]