Discussion:
[U-Boot] list files on tftp / large kernel-image
Frank Wunderlich
2018-11-14 15:24:48 UTC
Permalink
Hi,

is it possible to list files on tftp so i can write a script to let user select kernel-image to load?

have anybody tried to load a kernelimage larger than 20MB?

i use dnsmasq as tftp and uboot 2014-version (because 2018-11 für mt7623 currently has no ethernetdriver).
If kernelimage is larger than ~20MB loading file hangs...tried setting blocksize, but it's the same behaviour, only more/less #-symbols. I don't know how much data is loaded, because there is loadedbytes-counter (i only can count the # and multiply with blocksize if i know it). do i have any chance to debug that or is this already known/fixed?

regards Frank
Simon Goldschmidt
2018-11-14 15:34:14 UTC
Permalink
Post by Frank Wunderlich
Hi,
is it possible to list files on tftp so i can write a script to let user select kernel-image to load?
Unless I'm mistaken, the tftp protocol does not support file listing.
Post by Frank Wunderlich
have anybody tried to load a kernelimage larger than 20MB?
We are successfully loading FIT images of > ~26 MByte via tftp
(containing Kernel, FPGA and Initrd) without problems.
Post by Frank Wunderlich
i use dnsmasq as tftp and uboot 2014-version (because 2018-11 für mt7623 currently has no ethernetdriver).
I'm using current mainline, of course. Things might have changed in the
last 4 years... ;-)

Simon
Post by Frank Wunderlich
If kernelimage is larger than ~20MB loading file hangs...tried setting blocksize, but it's the same behaviour, only more/less #-symbols. I don't know how much data is loaded, because there is loadedbytes-counter (i only can count the # and multiply with blocksize if i know it). do i have any chance to debug that or is this already known/fixed?
regards Frank
_______________________________________________
U-Boot mailing list
https://lists.denx.de/listinfo/u-boot
Frank Wunderlich
2018-11-14 15:52:05 UTC
Permalink
Hi Simon,
thanks for fast answer

i hope mediatek release ethernet soon (i know it's a more complex driver for r2 than the other 18 patches ), than i can drop the old uboot ;)

for list tftp, it seems to be a protocol limitation.
here https://unix.stackexchange.com/questions/76400/download-directory-structure-from-a-tftp-server the server creates a textfile...this can be a workaround

can i download (to memory) and display it (without writing it)? i only have loaded kernel and executed it's address. I don't know how to print a "Textfile" (if it's in memory i need to know it's size and print this "data block"). maybe there is a way to load the data directly to an env-var

regards Frank
Gesendet: Mittwoch, 14. November 2018 um 16:34 Uhr
Betreff: Re: [U-Boot] list files on tftp / large kernel-image
Post by Frank Wunderlich
is it possible to list files on tftp so i can write a script to let user select kernel-image to load?
Unless I'm mistaken, the tftp protocol does not support file listing.
Post by Frank Wunderlich
have anybody tried to load a kernelimage larger than 20MB?
We are successfully loading FIT images of > ~26 MByte via tftp
(containing Kernel, FPGA and Initrd) without problems.
Post by Frank Wunderlich
i use dnsmasq as tftp and uboot 2014-version (because 2018-11 für mt7623 currently has no ethernetdriver).
I'm using current mainline, of course. Things might have changed in the
last 4 years... ;-)
Simon Goldschmidt
2018-11-19 11:29:21 UTC
Permalink
On Wed, Nov 14, 2018 at 4:52 PM Frank Wunderlich
Post by Frank Wunderlich
Hi Simon,
thanks for fast answer
i hope mediatek release ethernet soon (i know it's a more complex driver for r2 than the other 18 patches ), than i can drop the old uboot ;)
for list tftp, it seems to be a protocol limitation.
here https://unix.stackexchange.com/questions/76400/download-directory-structure-from-a-tftp-server the server creates a textfile...this can be a workaround
can i download (to memory) and display it (without writing it)? i only have loaded kernel and executed it's address. I don't know how to print a "Textfile" (if it's in memory i need to know it's size and print this "data block"). maybe there is a way to load the data directly to an env-var
Have you tried the 'strings' command? Is that enough?

Simon
Frank Wunderlich
2018-12-02 09:33:49 UTC
Permalink
can you give me an example how to download and display it, seems i only have tftpboot which runs kernel directly?

also found no strings-command in https://www.denx.de/wiki/DULG/Manual

Frank
Gesendet: Montag, 19. November 2018 um 12:29 Uhr
Betreff: Re: Re: [U-Boot] list files on tftp / large kernel-image
On Wed, Nov 14, 2018 at 4:52 PM Frank Wunderlich
Post by Frank Wunderlich
Hi Simon,
thanks for fast answer
i hope mediatek release ethernet soon (i know it's a more complex driver for r2 than the other 18 patches ), than i can drop the old uboot ;)
for list tftp, it seems to be a protocol limitation.
here https://unix.stackexchange.com/questions/76400/download-directory-structure-from-a-tftp-server the server creates a textfile...this can be a workaround
can i download (to memory) and display it (without writing it)? i only have loaded kernel and executed it's address. I don't know how to print a "Textfile" (if it's in memory i need to know it's size and print this "data block"). maybe there is a way to load the data directly to an env-var
Have you tried the 'strings' command? Is that enough?
Simon
Frank Wunderlich
2018-12-02 10:32:31 UTC
Permalink
i've walked through code and it seems i've found it in cmd/strings.c

strings
display strings
<addr> [byte count]
- display strings at <addr> for at least [byte count] or first double NUL

does tftp add the "double NUL" if i do this:

tftp 0x80200000 filelist.txt
strings 0x80200000

or do i need to add ${filesize} to strings-command (if this is set via tftp)

regards Frank
Gesendet: Sonntag, 02. Dezember 2018 um 10:33 Uhr
Betreff: Re: [U-Boot] list files on tftp / large kernel-image
can you give me an example how to download and display it, seems i only have tftpboot which runs kernel directly?
also found no strings-command in https://www.denx.de/wiki/DULG/Manual
Frank
Gesendet: Montag, 19. November 2018 um 12:29 Uhr
Betreff: Re: Re: [U-Boot] list files on tftp / large kernel-image
On Wed, Nov 14, 2018 at 4:52 PM Frank Wunderlich
Post by Frank Wunderlich
Hi Simon,
thanks for fast answer
i hope mediatek release ethernet soon (i know it's a more complex driver for r2 than the other 18 patches ), than i can drop the old uboot ;)
for list tftp, it seems to be a protocol limitation.
here https://unix.stackexchange.com/questions/76400/download-directory-structure-from-a-tftp-server the server creates a textfile...this can be a workaround
can i download (to memory) and display it (without writing it)? i only have loaded kernel and executed it's address. I don't know how to print a "Textfile" (if it's in memory i need to know it's size and print this "data block"). maybe there is a way to load the data directly to an env-var
Have you tried the 'strings' command? Is that enough?
Simon
_______________________________________________
U-Boot mailing list
https://lists.denx.de/listinfo/u-boot
Simon Goldschmidt
2018-12-02 10:34:08 UTC
Permalink
Post by Frank Wunderlich
can you give me an example how to download and display it, seems i only have tftpboot which runs kernel directly?
also found no strings-command in https://www.denx.de/wiki/DULG/Manual
=> tftp ${loadaddr} 192.168.1.1:list.txt
Speed: 100, full duplex
Using ***@ff702000 device
TFTP from server 192.168.1.1; our IP address is 192.168.1.101
Filename 'list.txt'.
Load address: 0x1000000
Loading: #
12.7 KiB/s
done
Bytes transferred = 158 (9e hex)
=> strings ${loadaddr} 9e
dhcppkgstyle.xsl
dhcpstyle.xsl
favicon.ico
index.html
ldlinux.c32
list.txt
mini.iso
netboot.tar.gz
pxelinux.0
pxelinux.cfg
RJ45_5.JPG
RJ45_52.JPG
ã(Ðå
=>

The 'strings' command has to be enabled under "Command line interface"
-> "Memory commands". It helps to show the contents, but not really for
scripting...

Simon
Post by Frank Wunderlich
Frank
Gesendet: Montag, 19. November 2018 um 12:29 Uhr
Betreff: Re: Re: [U-Boot] list files on tftp / large kernel-image
On Wed, Nov 14, 2018 at 4:52 PM Frank Wunderlich
Post by Frank Wunderlich
Hi Simon,
thanks for fast answer
i hope mediatek release ethernet soon (i know it's a more complex driver for r2 than the other 18 patches ), than i can drop the old uboot ;)
for list tftp, it seems to be a protocol limitation.
here https://unix.stackexchange.com/questions/76400/download-directory-structure-from-a-tftp-server the server creates a textfile...this can be a workaround
can i download (to memory) and display it (without writing it)? i only have loaded kernel and executed it's address. I don't know how to print a "Textfile" (if it's in memory i need to know it's size and print this "data block"). maybe there is a way to load the data directly to an env-var
Have you tried the 'strings' command? Is that enough?
Simon
Frank Wunderlich
2018-12-02 16:26:53 UTC
Permalink
seems like strings breaks my (older 2014-04) uboot:

BPI-IoT> tftp ${loadaddr} 192.168.0.10:files.lst
Using mtk_eth device
TFTP from server 192.168.0.10; our IP address is 192.168.0.11
Filename 'files.lst'.
Load address: 0x84000000
Loading: #
43 KiB/s
done
Bytes transferred = 89 (59 hex)
BPI-IoT> echo ${filesize}
59
BPI-IoT> strings ${loadaddr} ${filesize}
lߟA�����������������c���_���=�������������w�������{ߟ��wo�W�������������y�_
BPI-IoT> Minicom2.7Minicom2.7�߅_k�|UZ���߿����������0�������Ż��{������� �

also tested with bytecount 20 instead of filesize-var, same result

cannot use here new uboot till ethernet-driver is not ready

regards Frank
Gesendet: Sonntag, 02. Dezember 2018 um 11:34 Uhr
Betreff: Re: [U-Boot] list files on tftp / large kernel-image
Post by Frank Wunderlich
can you give me an example how to download and display it, seems i only have tftpboot which runs kernel directly?
also found no strings-command in https://www.denx.de/wiki/DULG/Manual
=> tftp ${loadaddr} 192.168.1.1:list.txt
Speed: 100, full duplex
TFTP from server 192.168.1.1; our IP address is 192.168.1.101
Filename 'list.txt'.
Load address: 0x1000000
Loading: #
12.7 KiB/s
done
Bytes transferred = 158 (9e hex)
=> strings ${loadaddr} 9e
dhcppkgstyle.xsl
dhcpstyle.xsl
favicon.ico
index.html
ldlinux.c32
list.txt
mini.iso
netboot.tar.gz
pxelinux.0
pxelinux.cfg
RJ45_5.JPG
RJ45_52.JPG
ã(Ðå
=>
The 'strings' command has to be enabled under "Command line interface"
-> "Memory commands". It helps to show the contents, but not really for
scripting...
Simon
Post by Frank Wunderlich
Frank
Gesendet: Montag, 19. November 2018 um 12:29 Uhr
Betreff: Re: Re: [U-Boot] list files on tftp / large kernel-image
On Wed, Nov 14, 2018 at 4:52 PM Frank Wunderlich
Post by Frank Wunderlich
Hi Simon,
thanks for fast answer
i hope mediatek release ethernet soon (i know it's a more complex driver for r2 than the other 18 patches ), than i can drop the old uboot ;)
for list tftp, it seems to be a protocol limitation.
here https://unix.stackexchange.com/questions/76400/download-directory-structure-from-a-tftp-server the server creates a textfile...this can be a workaround
can i download (to memory) and display it (without writing it)? i only have loaded kernel and executed it's address. I don't know how to print a "Textfile" (if it's in memory i need to know it's size and print this "data block"). maybe there is a way to load the data directly to an env-var
Have you tried the 'strings' command? Is that enough?
Simon
Loading...