From fcd23d1cb75932b0edc0f439ee6a47df227830a2 Mon Sep 17 00:00:00 2001 From: Andrwe Lord Weber Date: Sun, 12 Jun 2011 19:50:13 +0200 Subject: [PATCH] UUID support for kernel cmdline argument cryptdevice I just encoutered the problem that my system couldn't boot because the devices changed and the encrypt hook couldn't decrypt my system. Because UUIDs are more reliable in such cases I added a new syntax to the hook. if you set cryptdevice=UUID=:root UUID will be used to get the real device using "blkid -U". Signed-off-by: Andrwe Lord Weber --- cryptsetup/trunk/PKGBUILD | 2 +- cryptsetup/trunk/encrypt_hook | 4 ++++ 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/cryptsetup/trunk/PKGBUILD b/cryptsetup/trunk/PKGBUILD index 0af6df5..8afc931 100644 --- a/cryptsetup/trunk/PKGBUILD +++ b/cryptsetup/trunk/PKGBUILD @@ -15,7 +15,7 @@ source=(http://cryptsetup.googlecode.com/files/${pkgname}-${pkgver}.tar.bz2 encrypt_hook encrypt_install) sha256sums=('7ceb18a0c91fa1546077b41b93463dd2ec9d7f83e6fd93757fb84cc608206a6a' - '64601eae6fbf3e3afceccec5877557aa208a82497c33cc94ad0a686b4022b5dc' + 'd72171315559585c1e679aeb15d104f24f78469b6b67e9de87b07168f2a8cfef' '07918fc349b3a7c4a73e8ad1cc3d97a2a79ebc7655090ab9ebb00b1e092c85aa') build() { diff --git a/cryptsetup/trunk/encrypt_hook b/cryptsetup/trunk/encrypt_hook index e84bc6e..11cddab 100644 --- a/cryptsetup/trunk/encrypt_hook +++ b/cryptsetup/trunk/encrypt_hook @@ -39,6 +39,10 @@ run_hook () if [ -n "${cryptdevice}" ]; then DEPRECATED_CRYPT=0 cryptdev="$(echo "${cryptdevice}" | cut -d: -f1)" + if [ "${cryptdev:0:5}" = 'UUID=' ]; then + # get device of given UUID and set it as cryptdev + cryptdev=$(blkid -t "$cryptdev" -o device) + fi cryptname="$(echo "${cryptdevice}" | cut -d: -f2)" else DEPRECATED_CRYPT=1 -- 1.7.5.2