aboutsummaryrefslogtreecommitdiffstats
path: root/com32/mboot/solaris.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/solaris.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/solaris.c')
-rw-r--r--com32/mboot/solaris.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/com32/mboot/solaris.c b/com32/mboot/solaris.c
index 3b316606..1b153ddb 100644
--- a/com32/mboot/solaris.c
+++ b/com32/mboot/solaris.c
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------- *
*
- * Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ * Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
@@ -35,12 +35,21 @@
#include "mboot.h"
#include <syslinux/pxe.h>
+#include <syslinux/config.h>
+
+bool kernel_is_solaris(const Elf32_Ehdr *eh)
+{
+ return eh->e_ident[EI_OSABI] == 6; /* ABI == Solaris */
+}
void mboot_solaris_dhcp_hack(void)
{
void *dhcpdata;
size_t dhcplen;
+ if (syslinux_derivative_info()->c.filesystem != SYSLINUX_FS_PXELINUX)
+ return;
+
if (!pxe_get_cached_info(PXENV_PACKET_TYPE_DHCP_ACK, &dhcpdata, &dhcplen)) {
mbinfo.drives_addr = map_data(dhcpdata, dhcplen, 4, 0);
if (mbinfo.drives_addr) {