ref: fb1e05080b0662f50da7e551b4f8823b9fd10387
parent: 0760494889f56e7e2f765aa1e4352d78e4e1f7ca
author: Natanael Copa <ncopa@alpinelinux.org>
date: Thu Oct 22 09:27:02 CDT 2015
nlplug-findfs: support search for /dev/<devname> this is so we also can specify cryptroot=/dev/sdaX at boot prompt
--- a/nlplug-findfs.c
+++ b/nlplug-findfs.c
@@ -430,7 +430,9 @@
if (searchdev == NULL && bootrepos == NULL && apkovls == NULL)
return 0;
- if (searchdev && strcmp(devname, searchdev) == 0) {
+ snprintf(devnode, sizeof(devnode), "/dev/%s", devname);
+ if (searchdev && (strcmp(devname, searchdev) == 0
+ || strcmp(devnode, searchdev) == 0)) {
return FOUND_DEVICE;
}
@@ -437,7 +439,6 @@
if (cache == NULL)
blkid_get_cache(&cache, NULL);
- snprintf(devnode, sizeof(devnode), "/dev/%s", devname);
type = blkid_get_tag_value(cache, "TYPE", devnode);
if (searchdev != NULL) {