diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-10-22 14:27:02 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-10-22 14:27:02 +0000 |
commit | fb1e05080b0662f50da7e551b4f8823b9fd10387 (patch) | |
tree | 8ebd1f1ff90b08ee095d48c4df20d64d40a5e0a2 /nlplug-findfs.c | |
parent | 0760494889f56e7e2f765aa1e4352d78e4e1f7ca (diff) | |
download | mkinitfs-fb1e05080b0662f50da7e551b4f8823b9fd10387.tar.bz2 mkinitfs-fb1e05080b0662f50da7e551b4f8823b9fd10387.tar.xz |
nlplug-findfs: support search for /dev/<devname>
this is so we also can specify cryptroot=/dev/sdaX at boot prompt
Diffstat (limited to 'nlplug-findfs.c')
-rw-r--r-- | nlplug-findfs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nlplug-findfs.c b/nlplug-findfs.c index 547fb76..f1a58fd 100644 --- a/nlplug-findfs.c +++ b/nlplug-findfs.c @@ -430,14 +430,15 @@ int searchdev(char *devname, const char *searchdev, char *bootrepos, 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; } 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) { |