From owner-freebsd-arm@freebsd.org Fri Sep 25 19:26:03 2015 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD061A08F28 for ; Fri, 25 Sep 2015 19:26:02 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B253B1771 for ; Fri, 25 Sep 2015 19:26:02 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Fri, 25 Sep 2015 19:26:36 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t8PJPxnD006136; Fri, 25 Sep 2015 13:25:59 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1443209159.1224.361.camel@freebsd.org> Subject: Re: netboot configuration [was: Re: NFS Root with Raspberry Pi (nfs_diskless: no interface)] From: Ian Lepore To: freebsd-arm@freebsd.org Date: Fri, 25 Sep 2015 13:25:59 -0600 In-Reply-To: References: <20150922052522.GA62140@gmail.com> <00C49FEB-E8EF-4469-85E2-0F901215CD11@cs.huji.ac.il> <20150923050414.GB43653@gmail.com> <91AAC64E-4C38-47AA-8910-48F7654A7524@cs.huji.ac.il> <20150923174445.GE43653@gmail.com> <1443105426.1224.272.camel@freebsd.org> <20150924163658.GC32257@gmail.com> <560438C5.3090404@selasky.org> <1443142468.1224.322.camel@freebsd.org> Content-Type: text/plain; charset="iso-8859-7" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2015 19:26:03 -0000 On Fri, 2015-09-25 at 11:37 +0300, Daniel Braniss wrote: > > On 25 Sep 2015, at 03:54, Ian Lepore wrote: > > > > On Thu, 2015-09-24 at 19:54 +0200, Hans Petter Selasky wrote: > >> On 09/24/15 18:36, Randy Westlund wrote: > >>> On Thu, Sep 24, 2015 at 08:37:06AM -0600, Ian Lepore wrote: > >> [...stuff about problems netbooting...] > > hi Ian, > can you help me here? > I need the magics to get ubldr to boot from the net, > i¢m using an image built via crochet. > > cheers, > danny I've been struggling with how to set up a new default u-boot environment in our ports to make netbooting easier. The problem is that there are as many ways to netboot as there are different people wanting to do it. What I've been doing for years is loading both ubldr and the kernel from nfs, by configuring my dhcp server to provide all the info needed (board ip and netmask, server ip, ubldr file to load, and nfs root path), all based on the mac address of the board. I've learned that doesn't work well for most people who don't have easy control over their dhcp server. To try to keep this relatively simple, I'm going to assume that what most folks want to do is: * Load ubldr from the sdcard that has u-boot on it (not from nfs). * Make ubldr load the freebsd kernel from nfs. * Use an nfs root filesystem. So I'm assuming you've got an nfs server already serving up the root filesystem (I'm not going to detail configuring that here). That filesystem must contain an /etc/fstab that includes the ip:/rootpath entry for the root filesystem. In other words, even though the software must already know the ip:/rootpath to find the fstab file, the file still must contain a root path entry. (I find this annoying.) Now on the u-boot side you need to add a few lines to the uEnv.txt file on the FAT partition (create the file there if it doesn't already exist). You can configure a static IP address or get the IP from dhcp: For static IP (On RPi only, add one line: UserPreboot=usb start) loaderdev=net rootpath=192.168.0.240:/wand ipaddr=192.168.0.233 netmask=255.255.255.0 For DHCP (On RPi only, last line is: UserPreboot=usb start && dhcp) loaderdev=net rootpath=192.168.0.240:/wand autoload=no UserPreboot=dhcp BTW, you may notice a Netboot command in the standard u-boot env. Do NOT set bootcmd=run Netboot, that would make u-boot try to load ubldr over the network, which requires running a tftp server. -- Ian