aboutsummaryrefslogtreecommitdiffstats
path: root/com32/mboot/mboot.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-05-03 15:11:10 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-05-03 15:11:10 -0700
commitc2bd46bfc2eddc9bea70edadd203b257527e3583 (patch)
treeedaf31707287ad6881355e88700c476952ae9888 /com32/mboot/mboot.c
parentc8b2b33b46b3384fe1ebbeb1e38475f44c0fdfcf (diff)
downloadsyslinux-c2bd46bfc2eddc9bea70edadd203b257527e3583.tar.gz
syslinux-c2bd46bfc2eddc9bea70edadd203b257527e3583.tar.xz
syslinux-c2bd46bfc2eddc9bea70edadd203b257527e3583.zip
mboot.c32: autodetect Solaris
Autodetect Solaris kernels (based on the ELF header OSABI field) and use the Solaris workarounds in that case. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'com32/mboot/mboot.c')
-rw-r--r--com32/mboot/mboot.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/com32/mboot/mboot.c b/com32/mboot/mboot.c
index d008da0f..915c7857 100644
--- a/com32/mboot/mboot.c
+++ b/com32/mboot/mboot.c
@@ -36,7 +36,7 @@
struct multiboot_info mbinfo;
struct syslinux_pm_regs regs;
-struct my_options opt;
+struct my_options opt, set;
struct module_data {
void *data;
@@ -161,11 +161,21 @@ int main(int argc, char *argv[])
argv++;
while (*argv) {
- if (!strcmp(*argv, "-solaris"))
- opt.solaris = true;
- else if (!strcmp(*argv, "-aout"))
- opt.aout = true;
- else
+ bool v = true;
+ const char *p = *argv;
+
+ if (!memcmp(p, "-no", 3)) {
+ v = false;
+ p += 3;
+ }
+
+ if (!strcmp(p, "-solaris")) {
+ opt.solaris = v;
+ set.solaris = true;
+ } else if (!strcmp(p, "-aout")) {
+ opt.aout = v;
+ set.aout = true;
+ } else
break;
argv++;
}