[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Right MAC address to PXE boot Arndale board



On Wed, 2013-05-01 at 23:13 +0100, Birin Sanchez wrote:
> Hi Xen-devel community!!
> 
> I'm new to xen development (not new to Xen ;) ). I'm learning the Xen 
> internals and playing with Xen ARM so bear with me if I say/ask 
> something silly.
> 
> I have a Arndale board and following the wiki instructions for PXE boot 
> here:
> 
> http://wiki.xen.org/wiki/Xen_ARMv7_with_Virtualization_Extensions/Arndale#Booting_via_PXE
> 
> I realised that generating a random MAC address won't work because the 
> MAC address is hard-coded in U-Boot binary. The only MAC address that 
> will work is "00:40:5c:26:0a:5b".

Hardcoding a MAC address in the bootloader seems to me to be obviously
wrong in the general case, however CONFIG_PREBOOT says:

        - Pre-Boot Commands:
                        CONFIG_PREBOOT
        
                        When this option is #defined, the existence of the
                        environment variable "preboot" will be checked
                        immediately before starting the CONFIG_BOOTDELAY
                        countdown and/or running the auto-boot command resp.
                        entering interactive mode.
        
                        This feature is especially useful when "preboot" is
                        automatically generated or modified. For an example
                        see the LWMON board specific code: here "preboot" is
                        modified when the user holds down a certain
                        combination of keys on the (special) keyboard when
                        booting the systems

It sounds to me like this is intended as some sort of "factory
provisioning" mode or perhaps as unbrick functionality, but it should
only be activated if certain keys are held down. e.g. picking another
random board from the u-boot source (board/manroland/mucmc52/mucmc52.c):
        #ifdef CONFIG_PREBOOT
                struct kbd_data_t kbd_data;
                /* Decode keys */
                char *str = strdup (key_match (get_keys (&kbd_data)));
                /* Set or delete definition */
                setenv ("preboot", str);
                free (str);
        #endif /* CONFIG_PREBOOT */
Other boards set it to things like "run gs_slow_boot" iff some button is
pressed.

So I think the arndale support in u-boot is simply wrong to
unconditionally set preboot=CONFIG_PREBOOT, it supposed to be
*conditionally* set to some sort of recovery command.

Likewise it is wrong to hardcode a macaddress if CONFIG_PREBOOT is set.

I notice that mainline u-boot.git[0] doesn't have this code, so I expect
it is a Linaro u-boot special. Perhaps Anthony or Julien can recommend
where the bug report should go.

[0] git://git.denx.de/u-boot.git

> Obviously if you modify this piece of code:

IMHO this change is necessary, but not the whole story...

> diff --git a/board/samsung/smdk5250/smdk5250.c 
> b/board/samsung/smdk5250/smdk5250.c
> index d70976d..acb31f0 100644
> --- a/board/samsung/smdk5250/smdk5250.c
> +++ b/board/samsung/smdk5250/smdk5250.c
> @@ -226,7 +226,7 @@ int board_late_init(void)
>   {
>   #ifdef CONFIG_PREBOOT
>          setenv("preboot", CONFIG_PREBOOT);
> -       setenv("usbethaddr", "00:40:5c:26:0a:5b");
> +       //setenv("usbethaddr", "00:40:5c:26:0a:5b");
>   #endif
>   }
>   #endif
> 
> You will be able to use the random MAC generator on that page without 
> any trouble.
> 
> I hope this is not something too obvious or too silly :P

Well, (IMHO at least) it's not *you* which is being silly ;-)

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.