aboutsummaryrefslogtreecommitdiffstats
path: root/nlplug-findfs.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-11-25 11:54:01 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2015-11-25 10:57:51 +0000
commitaa84604b4657f1753c8ba1181d4ac709d8eb13b8 (patch)
tree9376ee01f74dcb5bf1a76afd4c4dadcb65adeb52 /nlplug-findfs.c
parentec0acf32171795ff6f108598dff76f9f46b7cf57 (diff)
downloadmkinitfs-aa84604b4657f1753c8ba1181d4ac709d8eb13b8.tar.bz2
mkinitfs-aa84604b4657f1753c8ba1181d4ac709d8eb13b8.tar.xz
nlplug-findfs: print device name user expects
we want print the device name that user is looking for when we prompt for cryptsetup password instead of the devname from kernel uevent. If user specified UUID, then we print kernel provided name.
Diffstat (limited to 'nlplug-findfs.c')
-rw-r--r--nlplug-findfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/nlplug-findfs.c b/nlplug-findfs.c
index acd8955..cccc359 100644
--- a/nlplug-findfs.c
+++ b/nlplug-findfs.c
@@ -713,7 +713,8 @@ static int dispatch_uevent(struct uevent *ev, struct ueventconf *conf)
return rc;
if (searchdev(ev, conf->crypt_device, NULL, NULL)) {
- strncpy(conf->crypt_devnode, ev->devnode,
+ strncpy(conf->crypt_devnode,
+ conf->crypt_device[0] == '/' ? conf->crypt_device : ev->devnode,
sizeof(conf->crypt_devnode));
start_cryptsetup(conf);
}