# tftp



## balanga (Feb 16, 2019)

I was looking at instructions for installing OpenWrt on a GoFlex Home unit:-






						Seagate GoFlexHome
					

Seagate GoFlexHome  Supported Versions  Hardware Highlights  Hardware  Info  Architecture    ARM   armv5te  Vendor          Marvell  bootloader  U-Boot  System-On-Chip  Marvell MV88F6281 A0 (DDR2) with ARM926EJ-S CPU (Marvell Feroceon)  CPU Speed     1200 Mhz




					openwrt.org
				




Among other things it mentions:-


```
tftp 0x6400000 openwrt-kirkwood-goflexhome-uImage
```

Would FreeBSD's tftpd understand such a request?


----------



## Phishfry (Feb 17, 2019)

balanga said:


> Would FreeBSD's tftpd understand such a request?





			Netbooting ARM/MIPS devices: kinds of kernel and u-boot | FreeBSD developer's notebook


----------



## Phishfry (Feb 17, 2019)

Looking here:


			FreeBSDMarvell - FreeBSD Wiki
		

It looks like they pull from the device side with uboot and tftpboot over the network.

`Marvell>> tftpboot 900000 mv5281/kernel.bin`

With your command you are trying to push the tftp server to boot it. That might not work.
The devices uboot needs to pull it.
I am really talking out of my competency here.
I only use tftp for router/pdu/switch firmware upgrades, not remote booting.


----------



## Phishfry (Feb 17, 2019)

balanga said:


> Among other things it mentions:-


Right above this it explains what it is doing:


> download from tftp-server file *openwrt-kirkwood-goflexhome-uImage* to RAM start offset 0x6400000



So this step is uploading uboot from the tftp server to the device.
Then you would need to run tftpboot to call up your kernel image from the network using the tftp uploaded uboot.
uboot is the loader,  so you need to have the proper env settings.

The FreeBSD wiki does not upload a uboot image (like OpenWRT) but uses the stock uboot so the instructions are different.


----------



## Phishfry (Feb 17, 2019)

I see the difference now. 
The OpenWRT instructions are more like a "firmware upgrade" by erasing old uboot and kernel and installing new.

With the FreeBSD Wiki instructions you boot off a tftp setup without modifying any of the device files.


----------



## balanga (Feb 17, 2019)

Phishfry said:


> Looking here:
> 
> 
> FreeBSDMarvell - FreeBSD Wiki



It looks like a useful guide, except I don't see any mention of the device being used, or the origin of the uBoot. It says:-


> __  __                      _ _
> |  \/  | __ _ _ *__   ___*| | |
> | |\/| |/ _` | '__\ \ / / _ \ | |
> | |  | | (_| | |   \ V /  __/ | |
> ...



but where do I get it or how do I build it? 

In the other article - https://kernelnomicon.org/?p=327

It mentions that you need  bootelf ..





> Now, *bootelf* or ELF support in general is not always available in boot loaders.


 
I don't have bootelf capability in my uBoot so am unable to run FreeBSD on it.


----------



## Phishfry (Feb 17, 2019)

balanga said:


> But where do I get it or how do I build it?


uBoot is onboard in hardware. Probably in NAND. The memory address shows where it is stashed.
You can use the pre-existing uboot or if that is hosed you need to start by uploading the proper uboot to it.
Because it resides in NAND there may be some different setting needed to compile uboot versus booting from an sd card uboot.
Think of it as the devices bios and bootloader.


----------



## balanga (Feb 17, 2019)

What I meant was where do I get this particular uBoot which is capable of *bootelf *?


----------



## Phishfry (Feb 18, 2019)

balanga said:


> where do I get this particular uBoot which is capable of *bootelf*


You compile in ELF when you make uboot.(Remember the uboot patching needed for FreeBSD)




Phishfry said:


> So stock uboot needs API and ELF support.


Remember this post from 2017?


----------



## balanga (Feb 18, 2019)

Ah yes... Also this uBoot stuff was all very new and even more incomprehensible then than it is now.  I think I'll continue in that thread as it will be more appropriate


----------

