rtems-tftp server not working with iPXE.

Chris Johns chrisj at rtems.org
Sun Sep 6 22:29:03 UTC 2020


On 7/9/20 8:14 am, Karel Gardas wrote:
> On 9/7/20 12:07 AM, Chris Johns wrote:
>> On 7/9/20 5:28 am, Karel Gardas wrote:
>>>
>>> Hi,
>>>
>>> I'm using latest rtems-tools, my HEAD is on
>>> eb3608133b41b9cb7b4dd55cb15d77691d2300c6.
>>>
>>> I'm trying to use rtems-tftp-server to serve 5.1 pc686 BSP's tests to
>>> the target hardware. On target hardware side I'm using fairly recent
>>> iPXE code base (ISO downloaded last month) booting from USB stick and
>>> then tftp booting RTEMS application. At least that was theory, in
>>> practice I'm not able to tftp boot from iPXE since rtems tftp server
>>> complains about python errors:
>>>
>>> ] tftp: server: all:69
>>> ] tftp: 1: start: 10.0.30.128:3419
>>> ] tftp: 1: error: <type 'exceptions.TypeError'>: unsupported operand
>>> type(s) for <<: 'str' and 'int'
>>> ] tftp: 1: end: 10.0.30.128:3419
>>> ] tftp: 2: start: 10.0.30.128:3419
>>> ] tftp: 2: error: <type 'exceptions.TypeError'>: unsupported operand
>>> type(s) for <<: 'str' and 'int'
>>> ] tftp: 2: end: 10.0.30.128:3419
>>> ] tftp: 3: start: 10.0.30.128:3419
>>> ] tftp: 3: error: <type 'exceptions.TypeError'>: unsupported operand
>>> type(s) for <<: 'str' and 'int'
>>> ] tftp: 3: end: 10.0.30.128:3419
>>> ] tftp: 4: start: 10.0.30.128:3419
>>> ] tftp: 4: error: <type 'exceptions.TypeError'>: unsupported operand
>>> type(s) for <<: 'str' and 'int'
>>> ] tftp: 4: end: 10.0.30.128:3419
>>> ] tftp: 5: start: 10.0.30.128:3419
>>> ] tftp: 5: error: <type 'exceptions.TypeError'>: unsupported operand
>>> type(s) for <<: 'str' and 'int'
>>> ] tftp: 5: end: 10.0.30.128:3419
>>> ] tftp: 6: start: 10.0.30.128:3419
>>> ] tftp: 6: error: <type 'exceptions.TypeError'>: unsupported operand
>>> type(s) for <<: 'str' and 'int'
>>> ] tftp: 6: end: 10.0.30.128:3419
>>
>> Could you please add `raise` after this line ...
>>
>> https://git.rtems.org/rtems-tools/tree/tester/rt/tftpserver.py#n442
>>
>> and report back the exception trace back?
> 

Awesome and thanks.

> Exception happened during processing of request from ('10.0.30.128', 1025)
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/SocketServer.py", line 599, in

Ah Python2. I will do some testing with that version.

> process_request_thread
>     self.finish_request(request, client_address)
>   File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
>     self.RequestHandlerClass(request, client_address, self)
>   File "/usr/lib/python2.7/SocketServer.py", line 655, in __init__
>     self.handle()
>   File
> "/export/home/karel/git/rtems/rtems-tools/tester/rt/tftpserver.py", line
> 451, in handle
>     self.handle_session(self.server.tftp.next_session())
>   File
> "/export/home/karel/git/rtems/rtems-tools/tester/rt/tftpserver.py", line
> 399, in handle_session
>     response = session.process(client_ip, client_port, self.request[0])
>   File
> "/export/home/karel/git/rtems/rtems-tools/tester/rt/tftpserver.py", line
> 272, in process
>     opcode = (data[0] << 8) | data[1]
> TypeError: unsupported operand type(s) for <<: 'str' and 'int'

Hmm looks like the socket returns a string in Python 2 and bytes in Python 3. I
will need to play around to find a suitable solution for this.

Chris


More information about the users mailing list