From owner-freebsd-hackers@FreeBSD.ORG Tue Jun 16 05:18:12 2015 Return-Path: Delivered-To: freebsd-hackers@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7E6AE84 for ; Tue, 16 Jun 2015 05:18:12 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qc0-x232.google.com (mail-qc0-x232.google.com [IPv6:2607:f8b0:400d:c01::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 861CDF78 for ; Tue, 16 Jun 2015 05:18:12 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by qcsf5 with SMTP id f5so1522664qcs.2 for ; Mon, 15 Jun 2015 22:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=skuwigmyyVlygFgOpJVA0+iaUR7/oHsrICR6rINQLBM=; b=avXzaGHkAt7299uDt8wil6J9ZWCujZd8dL26yzpCu37Ws7I4hfQrh41TpEgm3TAf2J Il9uLyU2JvK5P36M86uvwrprDqEriYNf3bnciSvzDf7s2xNtR05AldboAZgezNJdemM5 ZeM8EbIo42M2l5UW30Dv7eVoEAz/YG5YPadiNrDPTYj8JfZ3m7PxOKE+TTBnDtSdwqLw 2kVKQRQjYP/Z1UIa84NYPzSm2RM6y06eA0IQfNSwKgKiv189AA8e8FVtO98OW3SckKHq JqKALSf1XM2UNwQOdfUVx4QAe0oeoMOQeq8Og1gpcJgxpEIsdInAj7YDrbXn+bDf03t1 wtng== MIME-Version: 1.0 X-Received: by 10.55.52.12 with SMTP id b12mr65757814qka.22.1434431891606; Mon, 15 Jun 2015 22:18:11 -0700 (PDT) Received: by 10.140.98.73 with HTTP; Mon, 15 Jun 2015 22:18:11 -0700 (PDT) In-Reply-To: <557C073E.1060702@gmx.com> References: <557C073E.1060702@gmx.com> Date: Mon, 15 Jun 2015 22:18:11 -0700 Message-ID: Subject: Re: PXE boot an XIP image? From: NGie Cooper To: Don whY Cc: FreeBSD-Hackers Mailing List Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2015 05:18:12 -0000 On Sat, Jun 13, 2015 at 3:34 AM, Don whY wrote: > Hi, > > Apologies as to whether this belongs here... or on -embedded. :< > > I'd like to PXE boot a kernel then fetch (any choice of protocol) > a *single* image to load into RAM thereafter not requiring any > access to external media to operate. I.e., as if the image > had resided in the device all along. > > A crude approach *might* be something like crunchgen'ing init > with all of the (static linked) binaries that are required > and letting the loaded kernel NFS read (load) that init(1). > Obviously, I'd trim the kernel and other binaries down to the > bare essentials to minimize RAM requirements (as there would be no > swap, etc.) > > [I.e., creating a tiny filesystem that simply links every executable > back to this *one* image] > > In practice, this won't (?) really work as hoped. Any pointers on > a proven technique to achieve these results? > > Thanks! This may or may not be helpful: http://blog.hostileadmin.com/2012/05/04/pxe-booting-into-a-freebsd-installation/ (note: it's using grub). If you do are using loader(8) though, `load -t mfs_root /path/to/mfsroot.gz`, will load the mfsroot into RAM. You could employ tricks used by NanoBSD-based platforms, etc to say "boot diskless" as well (look for rc.initdiskless). You don't need to boot over NFS. That and you could use what kib described later on, but that requires additional scripting. There's mdconfig as well, but some folks I know didn't care for it because it "wasn't really well documented". Cheers! -NGie PS Thank you for the reminder about documenting -t mfs_root in loader(8).