[gPXE-devel] Weak pxe_menu_boot()
Stefan Hajnoczi
stefanha at gmail.com
Sat Jul 3 12:57:06 EDT 2010
On Sat, Jul 3, 2010 at 2:06 PM, Miller, Shao
<shao.miller at yrdsb.edu.on.ca> wrote:
> Good day to All,
>
> Steve Jones (carbon-copied) reported an issue with a gpxe.iso from
> ROM-O-Matic not producing a PXE boot menu when used with "LTSP" and
> dnsmasq.
>
> Steve says he didn't use any custom options. We tried several .lkrn
> builds (we chained to them) which I built from current, but to no avail.
>
> Investigation revealed that as soon as I '#if 0'd out the __weak
> pxe_menu_boot(), the boot menu appeared.
The following technique is stolen from glibc and it works, but I don't
understand why the original technique fails.
diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c
index d76751b..7712d28 100644
--- a/src/usr/autoboot.c
+++ b/src/usr/autoboot.c
@@ -45,9 +45,10 @@ int shutdown_exit_flags = 0;
/**
* Perform PXE menu boot when PXE stack is not available
*/
-__weak int pxe_menu_boot ( struct net_device *netdev __unused ) {
+static int pxe_menu_boot_dummy ( struct net_device *netdev __unused ) {
return -ENOTSUP;
}
+extern int pxe_menu_boot ( struct net_device *netdev ) __attribute__
((weak, alias ("pxe_menu_boot_dummy")));
/**
* Identify the boot network device
Any ideas on why using __weak, which is defined as __attribute__
((weak)), does not work?
Before we commit anything we should understand what is going on here.
Stefan
More information about the gPXE-devel
mailing list