Re: [PATCH] Set up crypto right on dmraid machines that don't have crypttab (#503947)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks ok,

Regards,

Hans


On 06/03/2009 04:28 PM, Peter Jones wrote:
If you don't have a crypttab, and you've got dmraid, we can't count on
the luks-XXXXXX name to be the UUID; instead, it's the device.  But to
be more generic, check and see if it's a valid /dev/mapper/ path, and if
it is, use it.
---
  mkinitrd |   11 +++++++++--
  1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/mkinitrd b/mkinitrd
index b20ee40..e3eb99c 100755
--- a/mkinitrd
+++ b/mkinitrd
@@ -1582,9 +1582,16 @@ emitdmraids

  emitcrypto()
  {
-    local luksuuid=$(grep "^$2 " /etc/crypttab | awk '{ print $2 }')
+    local luksuuid=""
+    if [ -f /etc/crypttab ]; then
+        luksuuid=$(grep "^$2 " /etc/crypttab | awk '{ print $2 }')
+    fi
      if [ -z "$luksuuid" ]; then
-        luksuuid="UUID=${2##luks-}"
+        if [ "$1" == "/dev/mapper/${2##luks-}" ]; then
+            luksuuid="$1"
+        else
+            luksuuid="UUID=${2##luks-}"
+        fi
      fi
      emit "setDeviceEnv LUKSUUID $luksuuid"
      emit "echo Setting up disk encryption: \$LUKSUUID"

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux