PXE Boot example?
#1
Hi all,

I'm a noob here, so please go gentle!

I have a dnsmasq server (DHCP disabled) set up on my network which currently supplies Centos7 to a handful of i386 machines. This works perfectly!

I would now like to also boot my new Rock64 machine off the same server.

My problem is that I have no idea what files to install into the tftp directory to accomplish this.

I know that I need to configure the 'main' DHCP server (Windowz) to point at the correct file (not pxelinux.0).

I have loaded u-boot into the board's rom and it loos as though it is talking to the DHCP server...

... that's where I'm up to!

1) What files do I need to copy into the TFTP server? I am looking to install  https://github.com/ayufan-rock64/linux-b...m64.img.xz

2) How can I tell that the machine connecting to the DHCP server is a Rock64?


Kind regards
  Reply
#2
(03-05-2018, 02:38 PM)lewis Wrote: Hi all,

I'm a noob here, so please go gentle!

I have a dnsmasq server (DHCP disabled) set up on my network which currently supplies Centos7 to a handful of i386 machines. This works perfectly!

I would now like to also boot my new Rock64 machine off the same server.

My problem is that I have no idea what files to install into the tftp directory to accomplish this.

I know that I need to configure the 'main' DHCP server (Windowz) to point at the correct file (not pxelinux.0).

I have loaded u-boot into the board's rom and it loos as though it is talking to the DHCP server...

... that's where I'm up to!

1) What files do I need to copy into the TFTP server? I am looking to install  https://github.com/ayufan-rock64/linux-b...m64.img.xz

2) How can I tell that the machine connecting to the DHCP server is a Rock64?


Kind regards

The ayufan's SPI Flash implementation has PXE boot capability. Here the link: http://wiki.pine64.org/index.php/NOOB#Fl..._SPI_Flash
  Reply
#3
(03-07-2018, 01:12 AM)coldfish Wrote:
(03-05-2018, 02:38 PM)lewis Wrote: Hi all,

I'm a noob here, so please go gentle!

I have a dnsmasq server (DHCP disabled) set up on my network which currently supplies Centos7 to a handful of i386 machines. This works perfectly!

I would now like to also boot my new Rock64 machine off the same server.

My problem is that I have no idea what files to install into the tftp directory to accomplish this.

I know that I need to configure the 'main' DHCP server (Windowz) to point at the correct file (not pxelinux.0).

I have loaded u-boot into the board's rom and it loos as though it is talking to the DHCP server...

... that's where I'm up to!

1) What files do I need to copy into the TFTP server? I am looking to install  https://github.com/ayufan-rock64/linux-b...m64.img.xz

2) How can I tell that the machine connecting to the DHCP server is a Rock64?


Kind regards

The ayufan's SPI Flash implementation has PXE boot capability. Here the link: http://wiki.pine64.org/index.php/NOOB#Fl..._SPI_Flash
Thanks for the info.

I already have the board flashed. I need to know what to put in the tftpboot directory and where to get it from...


Cheers
  Reply
#4
If you're still around and looking for how to do this... I'm in the process of working on that, and am half-way there Wink

I also have a dnsmasq (proxyDHCP) PXE setup, and have gotten my rock64 to start booting from it.

You basically need the following in your pxe boot menu, and the matching files -
Code:
default rock64-kernel-4.4
prompt 0
timeout 3

menu title Boot options

label rock64-kernel-4.4
   kernel /Image
   initrd /initrd.img
   fdt /dtb
   append earlycon=uart8250,mmio32,0xff130000 rw root=/dev/nfs nfsroot=${serverip}:/data/rootfs/rock64-1 rootwait init=/sbin/init mtdparts=spi32766.0:32k(system),4064k(loader),3840k(reserved),256k(vendor),4M(uboot),4M(atf)

As I noticed once the rock64 started it's PXE requests that it was requesting via it's MAC, I created it's own config file with menu containing that, so that once I'm done it will have both a boot menu and auto-boot config.

I then created (I'm still trying to piece how this goes together so I can transfer this over to the clusterboard... so could be way off the mark here...)

boot.scr.uimg - empty - Becase uboot keeps looking for it. I suspect it allows for custom uboot commands, so it merely existing allowed things to continue
Image -> /boot/vmlinuz-4.4.114-rockchip-ayufan-193 (ln -s'd from running system but copying would be more better in the long term due to upgrades)
initrd.img -> /boot/initrd.img-4.4.114-rockchip-ayufan-193 (ln -s'd from running system  - above applies)
dtb -> /boot/dtb

and it essentially works now... rock64 will pull down the kernel via the network and boots. And it also now pulls down its root filesystem over the network via NFS.  After going back and editing the /etc/fstab as distributed and commenting out the /boot mount point which was now completely wrong, it seems to be booting up to a usable system just fine so far.

You can also extract those files from the boot.img contained within any of ayufan's minimal images, etc... just keep unpacking the file Wink

One oddity in my setup so far though... it doesn't get the serverip for the TFTP/PXE server automatically like it should... remains 0.0.0.0, although a laptop and VMs on my desktop boot just fine (so I know dnsmasq IS working)... so I have to set it manually until I manage to lock it into the uboot environment properly or work out why the rock64 is misbehaving - just need to work out how to save it to the SPI since it's also booting from that... that plus the PXE menu doesn't autoselect, but that could be because I have to manually intervene atm... work in progress! Wink


Edit (a little while later...):

After frittering around with the settings and it seems to be behaving itself now with the exception of the need to set the serverip at boot... i.e. doing the following on a boot/reboot: 

Code:
set serverip 192.168.0.210
boot

In pursuing an issue which appeared to be resulting from the network interface being disabled before everything was properly written, and thus poweroff/reboot just grinding to a halt... I 
  • added "ASYNCMOUNTNFS=no" to /etc/default/rcS, and
  • commented out both lines of "eth0" in /etc/network/interfaces.d/eth0
and it now seems to be working perfectly. The first change may not be needed, but I'm almost certain the second is so that systemd doesn't try to manage the networking. If things like a static IP are needed that can be specified as part of the kernel arguments, but I didn't want that anyway so it looks good so far.
  Reply
#5
(04-05-2018, 05:09 AM)pfeerick Wrote: If you're still around and looking for how to do this... I'm in the process of working on that, and am half-way there Wink

I also have a dnsmasq (proxyDHCP) PXE setup, and have gotten my rock64 to start booting from it.

You basically need the following in your pxe boot menu, and the matching files -
Code:
default rock64-kernel-4.4
prompt 0
timeout 3

menu title Boot options

label rock64-kernel-4.4
   kernel /Image
   initrd /initrd.img
   fdt /dtb
   append earlycon=uart8250,mmio32,0xff130000 rw root=/dev/nfs nfsroot=${serverip}:/data/rootfs/rock64-1 rootwait init=/sbin/init mtdparts=spi32766.0:32k(system),4064k(loader),3840k(reserved),256k(vendor),4M(uboot),4M(atf)

As I noticed once the rock64 started it's PXE requests that it was requesting via it's MAC, I created it's own config file with menu containing that, so that once I'm done it will have both a boot menu and auto-boot config.

I then created (I'm still trying to piece how this goes together so I can transfer this over to the clusterboard... so could be way off the mark here...)

boot.scr.uimg - empty - Becase uboot keeps looking for it. I suspect it allows for custom uboot commands, so it merely existing allowed things to continue
Image -> /boot/vmlinuz-4.4.114-rockchip-ayufan-193 (ln -s'd from running system but copying would be more better in the long term due to upgrades)
initrd.img -> /boot/initrd.img-4.4.114-rockchip-ayufan-193 (ln -s'd from running system  - above applies)
dtb -> /boot/dtb

and it essentially works now... rock64 will pull down the kernel via the network and boots. And it also now pulls down its root filesystem over the network via NFS.  After going back and editing the /etc/fstab as distributed and commenting out the /boot mount point which was now completely wrong, it seems to be booting up to a usable system just fine so far.

You can also extract those files from the boot.img contained within any of ayufan's minimal images, etc... just keep unpacking the file Wink

One oddity in my setup so far though... it doesn't get the serverip for the TFTP/PXE server automatically like it should... remains 0.0.0.0, although a laptop and VMs on my desktop boot just fine (so I know dnsmasq IS working)... so I have to set it manually until I manage to lock it into the uboot environment properly or work out why the rock64 is misbehaving - just need to work out how to save it to the SPI since it's also booting from that... that plus the PXE menu doesn't autoselect, but that could be because I have to manually intervene atm... work in progress! Wink

Yes, I am still looking into this. I have put it on the back burner for the time being as I have paid work to be doing!

I was getting CRC failures reading from the TFTP server so I did not know if my TFTP boot server or the uboot were at fault...

I am aiming at using the Digital Rebar Provisioner in the long run to build my machines. (Well worth looking at!) The problem at the moment is that the main images that it uses (sledgehammer etc) are not compiled for Arm64 currently, so it is a 'no go' at the moment. It works brilliantly for amd/intel though!

Please keep me updated with your progress. Big Grin

EDIT
Decided to try again...

Sometimes I can get it to load files, other times I get a load of 'UDP wrong checksum 00000010 0000ee36' and then a message saying 'TFTP error: 'read udp [::]:37865: i/o timeout' (1)'

Sad
  Reply
#6
I had the wrong UDP checksum error like yours. It was caused by an old u-boot on SPI(?) The issue was resolved by running /usr/local/sbin/rock64_write_SPI.sh (when booted off sdcard).
I did not have any issues otherwise like the IP address assignment pfeerick mentions. The server is Debian with dnsmasq. pxelinux.0 was put in to TFTP root from the pxelinux debian package.. not sure if its required to be copied there or not.

Is the ton of appended options really required? Where do they come from / where did you find them pfeerick?
  Reply
#7
(04-08-2018, 03:38 PM)ansic Wrote: I had the wrong UDP checksum error like yours.  It was caused by an old u-boot on SPI(?)  The issue was resolved by running /usr/local/sbin/rock64_write_SPI.sh (when booted off sdcard).
I did not have any issues otherwise like the IP address assignment pfeerick mentions.  The server is Debian with dnsmasq.  pxelinux.0 was put in to TFTP root from the pxelinux debian package.. not sure if its required to be copied there or not.

Is the ton of appended options really required?  Where do they come from / where did you find them pfeerick?

The appended options (with the exception the two NFS related ones) are the standard ones for ayufan's images per '/boot/efi/extlinux/extlinux.conf'. The bulk of it is related to correctly addressing the SPI flash partitions.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Boot from USB 3.0 with hub Turbo 0 237 12-20-2020, 02:24 PM
Last Post: Turbo
  Rock64 Rev3 doesn't boot and leds blinking fast dishins 3 1,829 08-16-2020, 07:42 AM
Last Post: aclaret
  Unable to boot armbian fchazal 2 966 05-19-2020, 06:43 PM
Last Post: Rocklobster
  Rock64s will not boot any OS camosoul 2 821 05-19-2020, 06:38 PM
Last Post: Rocklobster
  Help me understand the boot up process olivercfc 0 523 11-10-2019, 08:30 AM
Last Post: olivercfc
Brick Rock64 stuck in boot, please help! Malmgren 7 2,078 11-05-2019, 07:02 AM
Last Post: Malmgren
Question [SOLVED] Alpine Linux won't boot rock7 1 1,655 10-22-2019, 04:30 PM
Last Post: rock7
  Forcing u-boot to detect USB3 storage jandastroy 8 3,118 04-02-2019, 10:06 PM
Last Post: t4_4t
  Consistent boot from SSD? Is it possible? SirRyanTheGeek 1 728 04-02-2019, 12:28 PM
Last Post: SirRyanTheGeek
  Not able to boot Armbian 5.75@Rock64 4GB wundidajah 1 908 03-29-2019, 05:30 AM
Last Post: dkryder

Forum Jump:


Users browsing this thread: 1 Guest(s)