[U-Boot-Users] How to use tftp to book kernel image and mount remote root fs

Hi,
The manual is not so clear. I want to boot from a remote image and mount remote root filesystem. It seems i've done the server side setup respecting to the manual, but for u-boot usage ( target side ) to do this, i am not so clear. Would anyone please show me simple steps? Thanks in advance.

In message ed4892840805120302l3e9a762bg23be7dbdb858c238@mail.gmail.com you wrote:
The manual is not so clear. I want to boot from a remote image and mount remote root filesystem. It seems i've done the server side setup respecting to the manual, but for u-boot usage ( target side ) to do this, i am not so clear. Would anyone please show me simple steps? Thanks in advance.
Maybe you can point out which parts of the manual are not clear enough, so that we can improve the documentation?
Best regards,
Wolfgang Denk

Dear Denk,
Q1:
Both 5.9.5.1 ( http://www.denx.de/wiki/view/DULG/UBootCmdGroupDownload#Section_5.9.5.1. ) and 5.9.5.6 ( http://www.denx.de/wiki/view/DULG/UBootCmdGroupDownload#Section_5.9.5.6. ) talk about booting image via network, but there are only few lines of description about these commands. I don't know which one I should use, tftpboot or bootp? And, for each one, what's the requirement on server side? I've done works described in 4.6, 4.7, 4.8 to setup the server, but I don't sure which one ( tftp, dhcp, nfs ) will really be used.
Q2:
in 9.6.3 ( Root File System on a cramfs File System ), the manual taught how to make a root filesystem image (cramfs), but in the installation ISO, i dont find necessary files rootfs.tar.gz and devices.tar.gz mentioned in the instructions. Where should I get them? On the other hand, after installed the eldk, I've already got a root filesystem in /installation/path/arm, so i think it will be very good building a root filesystem image from this directory, but in the manual, I dont find instructios telling me how.
Thank you very much.
On Tue, May 13, 2008 at 2:29 AM, Wolfgang Denk wd@denx.de wrote:
In message ed4892840805120302l3e9a762bg23be7dbdb858c238@mail.gmail.com you wrote:
The manual is not so clear. I want to boot from a remote image and mount remote root filesystem. It seems i've done the server side setup respecting to the manual, but for u-boot usage ( target side ) to do this, i am not so clear. Would anyone please show me simple steps? Thanks in advance.
Maybe you can point out which parts of the manual are not clear enough, so that we can improve the documentation?
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de "In matrimony, to hesitate is sometimes to be saved." - Butler

Dear Steven,
in message ed4892840805121852t46d4c4d0rd52a9eb129121f7b@mail.gmail.com you wrote:
Q1:
Both 5.9.5.1 ( http://www.denx.de/wiki/view/DULG/UBootCmdGroupDownload#Section_5.9.5.1. ) and 5.9.5.6 ( http://www.denx.de/wiki/view/DULG/UBootCmdGroupDownload#Section_5.9.5.6. ) talk about booting image via network, but there are only few lines of description about these commands. I don't know which one I should use, tftpboot or bootp? And, for each one, what's the requirement on
That depends on what you want to do. Do you understand the differecne between TFTP and BOOTP (resp. DHCP) protocols?
server side? I've done works described in 4.6, 4.7, 4.8 to setup the server, but I don't sure which one ( tftp, dhcp, nfs ) will really be used.
You can use any of these, depending on what you want to do.
If in doubt, just follow the detailed instructions in section "7. Booting Embedded Linux".
Q2:
in 9.6.3 ( Root File System on a cramfs File System ), the manual taught how to make a root filesystem image (cramfs), but in the installation ISO, i dont find necessary files rootfs.tar.gz and devices.tar.gz mentioned in the instructions. Where should I get
Please re-read section "9.6. Root File System: Design and Building"; it contains a detailed step-by-step instruction.
Best regards,
Wolfgang Denk

On Tue, May 13, 2008 at 2:07 PM, Wolfgang Denk wd@denx.de wrote:
Dear Steven,
in message ed4892840805121852t46d4c4d0rd52a9eb129121f7b@mail.gmail.com you wrote:
Q1:
Both 5.9.5.1 (
http://www.denx.de/wiki/view/DULG/UBootCmdGroupDownload#Section_5.9.5.1.
) and 5.9.5.6 ( http://www.denx.de/wiki/view/DULG/UBootCmdGroupDownload#Section_5.9.5.6. ) talk about booting image via network, but there are only few lines of description about these commands. I don't know which one I should use, tftpboot or bootp? And, for each one, what's the requirement on
That depends on what you want to do. Do you understand the differecne between TFTP and BOOTP (resp. DHCP) protocols?
I understand tftp and bootp as a function of current DHCP, but I don't know how tftp and bootp is related. Would you suggest me something to read? Thank you.
server side? I've done works described in 4.6, 4.7, 4.8 to setup the server, but I don't sure which one ( tftp, dhcp, nfs ) will really be used.
You can use any of these, depending on what you want to do.
If in doubt, just follow the detailed instructions in section "7. Booting Embedded Linux".
Okay, I will re-read section 7 and 9 and go back here if still have questions. So much thank you for your help.
Q2:
in 9.6.3 ( Root File System on a cramfs File System ), the manual taught how to make a root filesystem image (cramfs), but in the installation ISO, i dont find necessary files rootfs.tar.gz and devices.tar.gz mentioned in the instructions. Where should I get
Please re-read section "9.6. Root File System: Design and Building"; it contains a detailed step-by-step instruction.
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de Too many people are ready to carry the stool when the piano needs to be moved.

Steven Woody wrote:
On Tue, May 13, 2008 at 2:07 PM, Wolfgang Denk wd@denx.de wrote:
Dear Steven,
in message ed4892840805121852t46d4c4d0rd52a9eb129121f7b@mail.gmail.com you wrote:
Q1:
Both 5.9.5.1 (
http://www.denx.de/wiki/view/DULG/UBootCmdGroupDownload#Section_5.9.5.1.
) and 5.9.5.6 ( http://www.denx.de/wiki/view/DULG/UBootCmdGroupDownload#Section_5.9.5.6. ) talk about booting image via network, but there are only few lines of description about these commands. I don't know which one I should use, tftpboot or bootp? And, for each one, what's the requirement on
That depends on what you want to do. Do you understand the differecne between TFTP and BOOTP (resp. DHCP) protocols?
I understand tftp and bootp as a function of current DHCP, but I don't know how tftp and bootp is related. Would you suggest me something to read? Thank you.
Bootp is a boot protocol that allows a system to query a server to figure out what IP it is assigned and what executable file to load (typically via TFTP). DHCP is the successor to bootp.
TFTP is a file transfer protocol that allows a system to load its executable (typically) file from the server.
http://www.linuxjournal.com/article/5465 (ignore RARP, it is deprecated).
HTH, gvb

On Wed, May 14, 2008 at 10:05 AM, Jerry Van Baren gvb.uboot@gmail.com wrote:
Steven Woody wrote:
On Tue, May 13, 2008 at 2:07 PM, Wolfgang Denk wd@denx.de wrote:
Dear Steven,
in message ed4892840805121852t46d4c4d0rd52a9eb129121f7b@mail.gmail.com you wrote:
Q1:
Both 5.9.5.1 (
http://www.denx.de/wiki/view/DULG/UBootCmdGroupDownload#Section_5.9.5.1.
) and 5.9.5.6 ( http://www.denx.de/wiki/view/DULG/UBootCmdGroupDownload#Section_5.9.5.6. ) talk about booting image via network, but there are only few lines of description about these commands. I don't know which one I should use, tftpboot or bootp? And, for each one, what's the requirement on
That depends on what you want to do. Do you understand the differecne between TFTP and BOOTP (resp. DHCP) protocols?
I understand tftp and bootp as a function of current DHCP, but I don't know how tftp and bootp is related. Would you suggest me something to read? Thank you.
Bootp is a boot protocol that allows a system to query a server to figure out what IP it is assigned and what executable file to load (typically via TFTP). DHCP is the successor to bootp.
TFTP is a file transfer protocol that allows a system to load its executable (typically) file from the server.
http://www.linuxjournal.com/article/5465 (ignore RARP, it is deprecated).
HTH, gvb
Thank you Jerry, I now understand TFTP and BOOTP should on a same host, the 'filename' parameter in dhcpd.conf specified the boot image file which can be download via tftp by u-boot. And, nfs server can be on another server, the 'next-server' parameter in dhcpd.conf specified the ip address of the nfs server.
But one thing I am not clear: the u-boot's bootargs variable uses nfsroot=${serverip}:${rootpath} are the 'serverip' and 'rootpath' set by querying BOOT server in u-boot's bootp stage? if so, serverip should equals to the next-server parameter in dhcpd.conf, and rootpath should equal to root-path parameter in dhcpd.conf. You see, in u-boot, it is rootpath, but in dhcpd.conf, it is root-path, is there a typo in the u-boot manual?
And, in the u-boot manual, I see, the `filename' parameter in dhcpd.conf is something like /tftproot/uImage, but I think it should be /uImage, because the /tftproot should be the root path of tftp server, to the client, the path name should be /uImage, am I right?
Thank you very much.
$rootpath, was this variable set by querying BOOTP server?

Steven Woody wrote:
On Wed, May 14, 2008 at 10:05 AM, Jerry Van Baren gvb.uboot@gmail.com wrote:
Steven Woody wrote:
On Tue, May 13, 2008 at 2:07 PM, Wolfgang Denk wd@denx.de wrote:
Dear Steven,
in message ed4892840805121852t46d4c4d0rd52a9eb129121f7b@mail.gmail.com you wrote:
Q1:
Both 5.9.5.1 (
http://www.denx.de/wiki/view/DULG/UBootCmdGroupDownload#Section_5.9.5.1.
) and 5.9.5.6 ( http://www.denx.de/wiki/view/DULG/UBootCmdGroupDownload#Section_5.9.5.6. ) talk about booting image via network, but there are only few lines of description about these commands. I don't know which one I should use, tftpboot or bootp? And, for each one, what's the requirement on
That depends on what you want to do. Do you understand the differecne between TFTP and BOOTP (resp. DHCP) protocols?
I understand tftp and bootp as a function of current DHCP, but I don't know how tftp and bootp is related. Would you suggest me something to read? Thank you.
Bootp is a boot protocol that allows a system to query a server to figure out what IP it is assigned and what executable file to load (typically via TFTP). DHCP is the successor to bootp.
TFTP is a file transfer protocol that allows a system to load its executable (typically) file from the server.
http://www.linuxjournal.com/article/5465 (ignore RARP, it is deprecated).
HTH, gvb
Thank you Jerry, I now understand TFTP and BOOTP should on a same host, the 'filename' parameter in dhcpd.conf specified the boot image file which can be download via tftp by u-boot. And, nfs server can be on another server, the 'next-server' parameter in dhcpd.conf specified the ip address of the nfs server.
Next-server is where u-boot will go to with tftp to get the executable file. Usually you don't use this, but it depends on how you have your network and servers configured.
You can download an executable via NFS, but (if I understand correctly), bootp/DHCP doesn't know how to specify to get the linux image over NFS... it is a separate "nfs" command which you can run manually or in a script. In other words, saying "bootp/DHCP" and "NFS" in the same sentence doesn't make sense.
My usage of nfs has only been via linux, in which case linux is running and bootp/dhcp are a fading memory (DHCP provides the IP lease and little else when linux is in control).
But one thing I am not clear: the u-boot's bootargs variable uses nfsroot=${serverip}:${rootpath} are the 'serverip' and 'rootpath' set by querying BOOT server in u-boot's bootp stage? if so, serverip should equals to the next-server
serverip env variable can be set by you to specify to u-boot who to get the information from, or it can be provided by your DHCP (/bootp?) server. It depends on your DHCP server's capabilities and configuration.
Ref: http://www.denx.de/wiki/DULG/UBootEnvVariables (scroll all the way to the bottom of the page).
parameter in dhcpd.conf, and rootpath should equal to root-path parameter in dhcpd.conf. You see, in u-boot, it is rootpath, but in dhcpd.conf, it is root-path, is there a typo in the u-boot manual?
You are challenging the limits of my knowledge. :-/ I'm sure it isn't a typo and I'm too tired right now to improve my knowledge by grepping the code. :-( I believe the env variable rootpath is set to what the DHCP server provides as the root-path option.
And, in the u-boot manual, I see, the `filename' parameter in dhcpd.conf is something like /tftproot/uImage, but I think it should be /uImage, because the /tftproot should be the root path of tftp server, to the client, the path name should be /uImage, am I right?
Whether you need /tftproot or not depends on how you've configured your tftp server. You can configure your tftp server to change its root directory (-s option) or not. If you use -s /tftproot, you don't want the /tftproot. If you don't use -s, you need to specify the full path.
Hint: Use tftp on a "normal" linux system (preferably not your server) to verify you have the right path and permissions and can download the file from your server. You can try different combinations faster that way.
Thank you very much.
$rootpath, was this variable set by querying BOOTP server?
Best regards, gvb
participants (3)
-
Jerry Van Baren
-
Steven Woody
-
Wolfgang Denk