aboutsummaryrefslogtreecommitdiffstats
path: root/libinstaller
diff options
context:
space:
mode:
authorShao Miller <shao.miller@yrdsb.edu.on.ca>2010-07-03 03:47:25 -0400
committerShao Miller <shao.miller@yrdsb.edu.on.ca>2010-07-03 05:28:00 -0400
commit591ab24b42b606caf4dabbb8bf33dbc421e8f005 (patch)
tree710bba25ca4b1f233c5c625208e4f4120c75a327 /libinstaller
parentc8c991a6a094f4678e7f9b36faf1fb0534328fc1 (diff)
downloadsyslinux-591ab24b42b606caf4dabbb8bf33dbc421e8f005.tar.gz
syslinux-591ab24b42b606caf4dabbb8bf33dbc421e8f005.tar.xz
syslinux-591ab24b42b606caf4dabbb8bf33dbc421e8f005.zip
libinstaller: Add --mbr, --active, and --force options
In order to consolidate the installer option-parsing system, we add the --mbr (-m), --active (-a), and --force (-f) options from the DOS, Win32, and mtools installers to libinstaller. Since the -m and -a options are not currently valid for the Linux 'syslinux' and 'extlinux' installers, we add error messages to both of these. The -f option is allowed but does nothing for them. Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Diffstat (limited to 'libinstaller')
-rwxr-xr-x[-rw-r--r--]libinstaller/syslxopt.c19
-rwxr-xr-x[-rw-r--r--]libinstaller/syslxopt.h3
2 files changed, 20 insertions, 2 deletions
diff --git a/libinstaller/syslxopt.c b/libinstaller/syslxopt.c
index 0ff2efbb..8aee160e 100644..100755
--- a/libinstaller/syslxopt.c
+++ b/libinstaller/syslxopt.c
@@ -40,10 +40,13 @@ struct sys_options opt = {
.device = NULL,
.offset = 0,
.menu_save = NULL,
+ .install_mbr = 0,
+ .activate_partition = 0,
+ .force = 0,
};
const struct option long_options[] = {
- {"force", 0, NULL, 'f'}, /* dummy option for compatibility */
+ {"force", 0, NULL, 'f'}, /* DOS/Win32/mtools only */
{"install", 0, NULL, 'i'},
{"directory", 1, NULL, 'd'},
{"offset", 1, NULL, 't'},
@@ -59,10 +62,12 @@ const struct option long_options[] = {
{"clear-once", 0, NULL, 'O'},
{"reset-adv", 0, NULL, OPT_RESET_ADV},
{"menu-save", 1, NULL, 'M'},
+ {"mbr", 0, NULL, 'm'}, /* DOS/Win32 only */
+ {"active", 0, NULL, 'a'}, /* DOS/Win32 only */
{0, 0, 0, 0}
};
-const char short_options[] = "t:fid:UuzS:H:rvho:OM:";
+const char short_options[] = "t:fid:UuzS:H:rvho:OM:ma";
void __attribute__ ((noreturn)) usage(int rv, enum syslinux_mode mode)
{
@@ -97,6 +102,9 @@ void __attribute__ ((noreturn)) usage(int rv, enum syslinux_mode mode)
" --clear-once -O Clear the boot-once command\n"
" --reset-adv Reset auxilliary data\n"
" --menu-save= -M Set the label to select as default on the next boot\n"
+ " --mbr -m Install an MBR (DOS/Win32 installers only)\n"
+ " --active -a Mark partition as active (DOS/Win32 installers only)\n"
+ " --force -f Ignore precautions (DOS/Win32/mtools installers only)\n"
"\n"
" Note: geometry is determined at boot time for devices which\n"
" are considered hard disks by the BIOS. Unfortunately, this is\n"
@@ -119,6 +127,7 @@ void parse_options(int argc, char *argv[], enum syslinux_mode mode)
long_options, NULL)) != EOF) {
switch (o) {
case 'f':
+ opt.force = 1;
break;
case 'z':
opt.heads = 64;
@@ -183,6 +192,12 @@ void parse_options(int argc, char *argv[], enum syslinux_mode mode)
case 'M':
opt.menu_save = optarg;
break;
+ case 'm':
+ opt.install_mbr = 1;
+ break;
+ case 'a':
+ opt.activate_partition = 1;
+ break;
case 'v':
fprintf(stderr,
"%s " VERSION_STR " Copyright 1994-" YEAR_STR
diff --git a/libinstaller/syslxopt.h b/libinstaller/syslxopt.h
index 446ab9af..6fdf1d98 100644..100755
--- a/libinstaller/syslxopt.h
+++ b/libinstaller/syslxopt.h
@@ -14,6 +14,9 @@ struct sys_options {
const char *device;
unsigned int offset;
const char *menu_save;
+ int force;
+ int install_mbr;
+ int activate_partition;
};
enum long_only_opt {