Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Apr 2019 01:53:02 -0700 (PDT)
From:      "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>
To:        Ian Lepore <ian@freebsd.org>
Cc:        Daniel Braniss <danny@cs.huji.ac.il>, ticso@cicely.de, "freebsd-arm@freebsd.org" <arm@freebsd.org>
Subject:   Re: network booting allwinner(nanopi)
Message-ID:  <201904030853.x338r2lm025916@gndrsh.dnsmgr.net>
In-Reply-To: <86cda185c41f215bbd808da32b619678ee0fdc61.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> On Mon, 2019-04-01 at 08:52 +0300, Daniel Braniss wrote:
> > > On 29 Mar 2019, at 22:36, Bernd Walter <ticso@cicely7.cicely.de>
> > > wrote:
> > > 
> > > On Fri, Mar 29, 2019 at 09:34:30AM +0300, Daniel Braniss wrote:
> > > > Hi,
> > > > with last weeks head (r345465),
> > > > I tried - again - to netboot and the old way no longer works
> > > > 	usb start
> > > > 	setenv loaderdev net
> > > > 	boot
> > > > 
> > > > now it complains allot:-) but no dice.
> > > > So, is there a way that netboot works?
> > > 
> > > On a Pi1 project I put the following in loader.conf:
> > > currdev="net0"
> > > This requires the loader.conf to be on the SD card however.
> > > I used an UFS partition for that, but I assume that the msdosfs
> > > partition would work too as the loader can read that filesystem
> > > as well.
> > > 
> > > -- 
> > > B.Walter <bernd@bwct.de> http://www.bwct.de
> > > Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner
> > > uvm.
> > 
> > well, this is what I get:
> > U-Boot SPL 2019.01 (Mar 24 2019 - 10:15:37 +0200)
> > DRAM: 512 MiB
> > Trying to boot from MMC1
> > 
> > 
> > U-Boot 2019.01 (Mar 24 2019 - 10:15:37 +0200) Allwinner Technology
> > 
> > CPU:   Allwinner H3 (SUN8I 1680)
> > Model: FriendlyARM NanoPi NEO
> > DRAM:  512 MiB
> > MMC:   SUNXI SD/MMC: 0
> > Loading Environment from FAT... *** Warning - bad CRC, using default
> > environment
> > 
> > In:    serial
> > Out:   serial
> > Err:   serial
> > Net:   phy interface0
> > 
> > Error: ethernet@1c30000 address not set.
> > eth-1: ethernet@1c30000
> > starting USB...
> > USB0:   USB EHCI 1.00
> > USB1:   USB OHCI 1.0
> > USB2:   USB EHCI 1.00
> > USB3:   USB OHCI 1.0
> > scanning bus 0 for devices... 1 USB Device(s) found
> > scanning bus 2 for devices... 1 USB Device(s) found
> >       scanning usb for storage devices... 0 Storage Device(s) found
> > Hit any key to stop autoboot:  2  0
> > => usb start
> > => boot    setn env loaderdev net
> > => boot
> > switch to partitions #0, OK
> > mmc0 is current device
> > Scanning mmc 0:1...
> > Found U-Boot script /boot.scr
> > 199 bytes read in 1 ms (194.3 KiB/s)
> > ## Executing script at 43100000
> > 375752 bytes read in 19 ms (18.9 MiB/s)
> > ## Starting application at 0x42000000 ...
> > Consoles: U-Boot console  
> > Compatible U-Boot API signature found @0x5bf595c8
> > 
> > FreeBSD/armv7 U-Boot loader, Revision 1.2
> > 
> > DRAM: 512MB
> > Number of U-Boot devices: 1
> > U-Boot env: loaderdev='net'
> > Found U-Boot device: disk
> > Found U-Boot device: net
> > Booting from net0:
> > net_probe: no network devices found, maybe not enumerated yet..?
> > netboot: couldn't probe uboot_eth0
> > net_open: netif_open() failed
> > Startup error in /boot/lua/loader.lua:
> > LUA ERROR: cannot open /boot/lua/loader.lua: device not configured.
> > 
> > net_probe: no network devices found, maybe not enumerated yet..?
> > netboot: couldn't probe uboot_eth0
> > net_open: netif_open() failed
> > net_probe: no network devices found, maybe not enumerated yet..?
> > netboot: couldn't probe uboot_eth0
> > net_open: netif_open() failed
> > net_probe: no network devices found, maybe not enumerated yet..?
> > netboot: couldn't probe uboot_eth0
> > net_open: netif_open() failed
> > net_probe: no network devices found, maybe not enumerated yet..?
> > netboot: couldn't probe uboot_eth0
> > net_open: netif_open() failed
> > net_probe: no network devices found, maybe not enumerated yet..?
> > netboot: couldn't probe uboot_eth0
> > net_open: netif_open() failed
> > net_probe: no network devices found, maybe not enumerated yet..?
> > netboot: couldn't probe uboot_eth0
> > net_open: netif_open() failed
> > net_probe: no network devices found, maybe not enumerated yet..?
> > netboot: couldn't probe uboot_eth0
> > net_open: netif_open() failed
> > net_probe: no network devices found, maybe not enumerated yet..?
> > netboot: couldn't probe uboot_eth0
> > net_open: netif_open() failed
> > net_probe: no network devices found, maybe not enumerated yet..?
> > netboot: couldn't probe uboot_eth0
> > net_open: netif_open() failed
> > can't load 'kernel'
> > 
> > Type '?' for a list of commands, 'help' for more detailed help.
> > loader>
> > 
> 
> Modern u-boot can only netboot using efi.  Doing it with efi requires
> that all your config be set in the dhcpd, there is no way to define the
> server or rootpath on a per-arm-system basis other than by hardcoding
> the mac address of each arm system in the dhcpd config on the server. 
> In the uboot env, 'setenv boot_targets dhcp', and your dhcpd.conf needs
> an entry something like this:
> 
> host rpi2 {
>   hardware ethernet b8:27:eb:e9:04:e8;
>   option host-name "rpi2";
>   next-server 172.22.42.240;
>   filename "/rpi2/boot/loader.efi";
>   option root-path "172.22.42.240:/rpi2/";
> }
> 
> If your dhcpd and tftp servers are the same, you probably don't need
> the next-server option.  If you're not using nfsroot, you probably
> don't need the root-path option.
> 
> -- Ian

What work needs to be done to take this to the next step
of supporting the iPXE style multiboot environment so you
do not have to do this per machine dhcpd hackery and can
set root-path via iPXE menu.  I have this working in a
x86 platform situation, but would love to expand it into
the arm world.

Thanks for any insight,
-- 
Rod Grimes                                                 rgrimes@freebsd.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904030853.x338r2lm025916>