[SLOF] [PATCH v2 07/11] libnet: Wire up pxelinux.cfg network booting

Thomas Huth thuth at redhat.com
Fri May 25 18:53:14 AEST 2018


On 25.05.2018 10:22, Alexey Kardashevskiy wrote:
> On 25/5/18 5:29 pm, Thomas Huth wrote:
>> On 25.05.2018 09:08, Alexey Kardashevskiy wrote:
>>> On 19/5/18 1:45 am, Thomas Huth wrote:
>>>> In case the normal network loading failed, try to load a pxelinux.cfg
>>>> config file. If that succeeds, load the kernel and initrd with the
>>>> information that could be found in this file.
>>>
>>> Without that, my test setup would report error like this:
>>>
>>>
>>> Trying to load:  from: /pci at 800000020000000/ethernet at 1 ...
>>>  Initializing NIC
>>>   Reading MAC address from device: c0:41:49:4b:00:30
>>>   Requesting information via DHCP: done
>>>   Using IPv4 address: 10.61.191.48
>>>   Requesting file "image.aiktest48" via TFTP from 10.61.2.7
>>>   Receiving data:  0 KBytes
>>> E3009 (net) file not found: image.aiktest48
>>>
>>> E3407: Load failed
>>>
>>>
>>>
>>> With this patch applied:
>>>
>>> Trying to load:  from: /pci at 800000020000000/ethernet at 1 ...
>>>  Initializing NIC
>>>   Reading MAC address from device: c0:41:49:4b:00:30
>>>   Requesting information via DHCP: done
>>>   Using IPv4 address: 10.61.191.48
>>>   Requesting file "image.aiktest48" via TFTP from 10.61.2.7
>>>   Receiving data:  0 KBytes
>>> E3009 (net) file not found: image.aiktest48
>>> Trying pxelinux.cfg files...
>>>   TFTP error: TFTP buffer of 2047 bytes is too small for pxelinux.cfg/default
>>>
>>> E3407: Load failed
>>>
>>>
>>> this is because....
>> [...]
>>>> @@ -689,6 +744,10 @@ int netload(char *buffer, int len, char *args_fs, int alen)
>>>>  	/* Do the TFTP load and print error message if necessary */
>>>>  	rc = tftp_load(&fn_ip, buffer, len);
>>>>  
>>>> +	if (rc <= 0 && !obp_tftp_args.filename[0]) {
>>>
>>> .... obp_tftp_args.filename == "" in this particular case as tftp_load()
>>> does not seem to store the filename if loading fails.
>>>
>>>> +		rc = net_pxelinux_cfg_load(&fn_ip, buffer, len, own_mac);
>>>> +	}
>>
>> Sorry, I don't quite understand what you want to say here?
>>
>> How big is your pxelinux.cfg/default file in this case? Was it smaller
>> than 2047 bytes, so that the above error message is not right? Or do
>> you rather complain that SLOF is trying to boot via pxelinux at all in
>> case you've set a bootfile name?
> 
> I thought we should stop and not try PXE if a filename is set. But now I
> wonder what do others do in this case? Keep trying all PXE options if they
> are present (these 209 and 210 DHCP options)?

I think we should continue. x86 folks are used to set the pxelinux.0
binary in the DHCP options and then expect that the pxelinux loader
continues loading with the appropriate base directory. Since we do not
have a dedicated pxelinux.0 loader binary on ppc, we should just take
the information from DHCP to get the base directory (by the way, I think
I still got that slightly wrong and should insert a "pxelinux.cfg"
directory in there...). See here for details:
https://www.syslinux.org/wiki/index.php?title=PXELINUX#Configuration_filename

Alternatively, we also might only continue if the file name ends in a
slash - so we are really sure that the user wanted to configure a base
directory in this case...

 Thomas



More information about the SLOF mailing list