aboutsummaryrefslogtreecommitdiffstats
path: root/extlinux/main.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2012-06-20 16:08:53 -0700
committerH. Peter Anvin <hpa@zytor.com>2012-06-20 16:08:53 -0700
commit3f51f9e151e1a0829ae6321320baa3b6e7c61877 (patch)
tree2851149ab46ad263acfea3a570a59ad3aacdbbd4 /extlinux/main.c
parent6be9e52dcb80c910373cc8eaade2de13b0afed00 (diff)
downloadsyslinux-3f51f9e151e1a0829ae6321320baa3b6e7c61877.tar.gz
syslinux-3f51f9e151e1a0829ae6321320baa3b6e7c61877.tar.xz
syslinux-3f51f9e151e1a0829ae6321320baa3b6e7c61877.zip
extlinux: add --device option to override device detect
Add a --device option for scripts and expert users to override the device detection. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'extlinux/main.c')
-rw-r--r--extlinux/main.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/extlinux/main.c b/extlinux/main.c
index 63751669..73f3fbe1 100644
--- a/extlinux/main.c
+++ b/extlinux/main.c
@@ -1028,9 +1028,14 @@ static const char *get_devname(const char *path)
return devname;
}
- if (fs_type == BTRFS) {
- /* For btrfs try to get the device name from btrfs itself */
- devname = find_device_btrfs(path);
+ if (opt.device)
+ devname = opt.device;
+
+ if (!devname){
+ if (fs_type == BTRFS) {
+ /* For btrfs try to get the device name from btrfs itself */
+ devname = find_device_btrfs(path);
+ }
}
if (!devname) {