Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 420015 - sys-fs/cryptsetup - add support for UUIDs to /etc/init.d/dmcrypt
Summary: sys-fs/cryptsetup - add support for UUIDs to /etc/init.d/dmcrypt
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-06-07 02:24 UTC by Marios Andreopoulos
Modified: 2013-01-18 11:29 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marios Andreopoulos 2012-06-07 02:24:44 UTC
I think that the dmcrypt init script should support UUIDs as sources in /etc/conf.d/dmcrypt.

I wrote a tiny patch for /etc/init.d/dmcrypt which adds this capability without modifying script's restrictions (not being bash specific, not using binaries in /usr), so one can use in /etc/conf.d/dmcrypt something like this:
source=UUID="f47ac10b-58cc-4372-a567-0e02b2c3d479"

It needs blkid, but this is part of sys-apps/util-linux which is already a dependency for cryptsetup and resides in /sbin

Here it is:

--- original/etc/init.d/dmcrypt    2012-06-07 04:53:26.090158313 +0300
+++ modified/etc/init.d/dmcrypt    2012-06-07 05:04:48.200632821 +0300
@@ -39,6 +39,9 @@
        else
                return
        fi
+       if echo "${source}" | egrep -q "^UUID=" ; then
+               source="$(blkid -U $(echo "${source}" | cut -d "=" -f2))"
+       fi
        if [ -z "${source}" ] && [ ! -e "${source}" ] ; then
                ewarn "source \"${source}\" for ${target} missing, skipping..."
                return

Reproducible: Always
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2013-01-17 23:33:19 UTC
InCVS for >=1.5.1