aboutsummaryrefslogtreecommitdiffstats
path: root/libinstaller
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 /libinstaller
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 'libinstaller')
-rw-r--r--libinstaller/syslxopt.c9
-rw-r--r--libinstaller/syslxopt.h1
2 files changed, 9 insertions, 1 deletions
diff --git a/libinstaller/syslxopt.c b/libinstaller/syslxopt.c
index e081a00e..dde4969f 100644
--- a/libinstaller/syslxopt.c
+++ b/libinstaller/syslxopt.c
@@ -66,6 +66,7 @@ const struct option long_options[] = {
{"menu-save", 1, NULL, 'M'},
{"mbr", 0, NULL, 'm'}, /* DOS/Win32 only */
{"active", 0, NULL, 'a'}, /* DOS/Win32 only */
+ {"device", 1, NULL, OPT_DEVICE},
{0, 0, 0, 0}
};
@@ -87,7 +88,8 @@ void __attribute__ ((noreturn)) usage(int rv, enum syslinux_mode mode)
/* Mounted fs installation (extlinux) */
/* Actually extlinux can also use -d to provide a directory too... */
fprintf(stderr,
- "Usage: %s [options] directory\n",
+ "Usage: %s [options] directory\n"
+ " --device Force use of a specific block device (experts only)\n"
program);
break;
@@ -210,6 +212,11 @@ void parse_options(int argc, char *argv[], enum syslinux_mode mode)
case 'a':
opt.activate_partition = 1;
break;
+ case OPT_DEVICE:
+ if (mode != EXTLINUX_MODE)
+ usage(EX_USAGE, mode);
+ opt.device = optarg;
+ break;
case 'v':
fprintf(stderr,
"%s " VERSION_STR " Copyright 1994-" YEAR_STR
diff --git a/libinstaller/syslxopt.h b/libinstaller/syslxopt.h
index bcbe0352..042301f6 100644
--- a/libinstaller/syslxopt.h
+++ b/libinstaller/syslxopt.h
@@ -24,6 +24,7 @@ enum long_only_opt {
OPT_NONE,
OPT_RESET_ADV,
OPT_ONCE,
+ OPT_DEVICE,
};
enum syslinux_mode {