diff options
| author | Shao Miller <shao.miller@yrdsb.edu.on.ca> | 2010-07-03 16:23:44 -0400 |
|---|---|---|
| committer | Shao Miller <shao.miller@yrdsb.edu.on.ca> | 2010-07-03 17:03:00 -0400 |
| commit | 07aafae7c67b32e432c26ff83279ec83e61592e4 (patch) | |
| tree | 35564427f3b97eb1c579af23100c6c31eaf5f313 /libinstaller | |
| parent | 1d3a1a8a3bcda164c0d9cbe2fff28b0953f7ee2e (diff) | |
| download | syslinux-07aafae7c67b32e432c26ff83279ec83e61592e4.tar.gz | |
win32: Use libinstaller option parser
We will produce an error message if a user attempts
to use an option we don't implement.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Diffstat (limited to 'libinstaller')
| -rwxr-xr-x | libinstaller/syslxopt.c | 14 | ||||
| -rwxr-xr-x | libinstaller/syslxopt.h | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/libinstaller/syslxopt.c b/libinstaller/syslxopt.c index 8aee160e..e7f405a1 100755 --- a/libinstaller/syslxopt.c +++ b/libinstaller/syslxopt.c @@ -43,6 +43,7 @@ struct sys_options opt = { .install_mbr = 0, .activate_partition = 0, .force = 0, + .bootsecfile = NULL, }; const struct option long_options[] = { @@ -88,6 +89,13 @@ void __attribute__ ((noreturn)) usage(int rv, enum syslinux_mode mode) "Usage: %s [options] directory\n", program); break; + + case MODE_SYSLINUX_DOSWIN: + /* For fs installation under Windows (syslinux.exe) */ + fprintf(stderr, + "Usage: %s [options] <drive>: [bootsecfile]\n", + program); + break; } fprintf(stderr, @@ -113,7 +121,7 @@ void __attribute__ ((noreturn)) usage(int rv, enum syslinux_mode mode) "\n" " The -z option is useful for USB devices which are considered\n" " hard disks by some BIOSes and zipdrives by other BIOSes.\n", - mode == MODE_SYSLINUX ? " " : "-o"); + mode == MODE_SYSLINUX ? " " : "-o"); exit(rv); } @@ -211,6 +219,7 @@ void parse_options(int argc, char *argv[], enum syslinux_mode mode) switch (mode) { case MODE_SYSLINUX: + case MODE_SYSLINUX_DOSWIN: opt.device = argv[optind++]; break; case MODE_EXTLINUX: @@ -219,6 +228,9 @@ void parse_options(int argc, char *argv[], enum syslinux_mode mode) break; } + if (argv[optind] && (mode == MODE_SYSLINUX_DOSWIN)) + /* Allow for the boot-sector argument */ + opt.bootsecfile = argv[optind++]; if (argv[optind]) usage(EX_USAGE, mode); /* Excess arguments */ } diff --git a/libinstaller/syslxopt.h b/libinstaller/syslxopt.h index 6fdf1d98..bcbe0352 100755 --- a/libinstaller/syslxopt.h +++ b/libinstaller/syslxopt.h @@ -17,6 +17,7 @@ struct sys_options { int force; int install_mbr; int activate_partition; + const char *bootsecfile; }; enum long_only_opt { @@ -28,6 +29,7 @@ enum long_only_opt { enum syslinux_mode { MODE_SYSLINUX, /* Unmounted filesystem */ MODE_EXTLINUX, + MODE_SYSLINUX_DOSWIN, }; void __attribute__ ((noreturn)) usage(int rv, enum syslinux_mode mode); |
