4 4
Rolf Bakker

How to netboot Armbian from u-boot

Recommended Posts

My objective is to boot Armbian on my NanoPi Neo2 from a network server.

 

I've got Armbian running on the NanoPi Neo2 and u-boot recognizes the ethernet interface. Also, I have a DHCP server and TFTP server running. If I press space during start-up, I get in the U-boot environment. When I give the dhcp command in the U-boot environment, the NanoPi Neo2 get's an IP address and loads /boot/boot.scr from the network. So, the pre-requisites seem to work fine.

But then....

 

I just can't figure out how to start Armbian (preferrably in read only mode) from the network.

 

Maybe someone can tell me what needs to be done. I've got the following questions:

I've already searched on-line for countless hours, but I just don't get it.

 

1) I think I need to load boot.scr, initrd.img and dtb and somehow start those from the u-boot environment.

2) I think I need to tell the kernel somehow that it needs to boot from the network instead of the SD.

3) I think there is some command /switch that can be set to make Armbian read-only and prevent changes to the system

4) Which files must remain on the SD as a minimum to make netbooting Armbian from U-boot possible?

 

Regards,

Rolf

Share this post


Link to post
Share on other sites

Just a question: do you just want to boot the kernel from the network, and then use a local file system on SD or USB, or do you want to run Armbian from NFS?

I ask this question because I don't really advise you to run Armbian (either Ubuntu or Debian flavors) from NFS, even on a Gigabit network.

 

Now, yes, a properly built u-boot can initialize the Ethernet interface and load the Linux kernel from the network using the PXE protocol, there are a number of references on the Internet that explain how to do this, sfx2000 above has pointed to two websites and a quick search on Google should turn up a few more.

Share this post


Link to post
Share on other sites
23 hours ago, AndrewDB said:

Just a question: do you just want to boot the kernel from the network, and then use a local file system on SD or USB, or do you want to run Armbian from NFS?

I ask this question because I don't really advise you to run Armbian (either Ubuntu or Debian flavors) from NFS, even on a Gigabit network.

 

Now, yes, a properly built u-boot can initialize the Ethernet interface and load the Linux kernel from the network using the PXE protocol, there are a number of references on the Internet that explain how to do this, sfx2000 above has pointed to two websites and a quick search on Google should turn up a few more.

 

 

Just curious why you advise against it.. I use to run a PXE Boot a Ubuntu Desktop on a C2D and run over NFS and it worked pretty great... I even used docker with it?

 

Is it the network stack on the SBC thats the concern?   

Share this post


Link to post
Share on other sites
4 minutes ago, lanefu said:

 

 

Just curious why you advise against it.. I use to run a PXE Boot a Ubuntu Desktop on a C2D and run over NFS and it worked pretty great... I even used docker with it?

 

Is it the network stack on the SBC thats the concern?   

It's just because of performance expectations. SBC's still have comparatively little RAM to run full-fledged desktops, and NFS latencies would kill any large program load times. On the other hand, if you can run everything from RAM(disk), SBC's have more than enough performance, the reason we have CoreElec, OpenElec, etc...

 

Containers run at the same speed as bare metal so if you have acceptable latencies with NFS, Docker is never a problem.

Share this post


Link to post
Share on other sites

I'm not worried about the performance, its just simple stuff I'm doing.

 

However, I haven't gotten much further. The information on the web is really thin, maybe its because I lack sufficient background that I don't understand it.

 

U-boot reads the files but somehow the boot sequence ends in an error. I wish there was some sort of tutorial that shows me how I can compile Armbian for read only NFS boot.

 

 

Share this post


Link to post
Share on other sites
37 minutes ago, Rolf Bakker said:

I'm not worried about the performance, its just simple stuff I'm doing.

 

However, I haven't gotten much further. The information on the web is really thin, maybe its because I lack sufficient background that I don't understand it.

 

U-boot reads the files but somehow the boot sequence ends in an error. I wish there was some sort of tutorial that shows me how I can compile Armbian for read only NFS boot.

 

 

 

here's some NFS boot breadcrumbs that arent armbian specific

 

but you'll need to update your initrams image with a few settings which uboot will pool.

 

see /etc/initramfs-tools/initramfs.conf  MODULES=netboot

 

also you'll want to set your rootfs  to be something like this

 

# UNCONFIGURED FSTAB FOR BASE SYSTEM
/dev/nfs       /               nfs    defaults          1       1
/proc    /proc    proc    defaults   0 0
/sys     /sys     sysfs   defaults   0 0

/dev/fd0  /mnt/floppy auto user,noauto,sync,exec,umask=000 0 0
/dev/cdrom /mnt/cdrom auto user,noauto,exec,ro   0 0
none            /tmp            tmpfs   defaults        0       0
none            /var/run        tmpfs   defaults        0       0
none            /var/lock       tmpfs   defaults        0       0
none            /var/tmp        tmpfs   defaults        0       0

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
4 4