From owner-freebsd-hackers@FreeBSD.ORG Sat Jun 13 13:10:59 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 131714B8 for ; Sat, 13 Jun 2015 13:10:59 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D3F3CCE6 for ; Sat, 13 Jun 2015 13:10:58 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-248-228.lns20.per4.internode.on.net [121.45.248.228]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id t5DDArOr079628 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 13 Jun 2015 06:10:56 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <557C2BD7.1000104@freebsd.org> Date: Sat, 13 Jun 2015 21:10:47 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Don whY , FreeBSD-Hackers Mailing List Subject: Re: PXE boot an XIP image? References: <557C073E.1060702@gmx.com> In-Reply-To: <557C073E.1060702@gmx.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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: Sat, 13 Jun 2015 13:10:59 -0000 On 6/13/15 6:34 PM, 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. what do you mean by "single"? any PXE boot is by definition a number of transactions. The regular PXE boot code from FreeBSD is capable of loading a kernel and a matching ram filesystem, which when executed, will boot up as a running system and not touch any medium. I haven't done it for a while but at one stage there used to be a suitable memory filesystem on one fo the boot media. (that may no longer be true) you can also boot a completely NFS system as well, and that will not touch media either. Finally, if having the network boot loader load TWO modules (kernel and FS) is too much, you could make a kernel that has the filesystem statically linked into it. But that's more work. > > 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? I don't know why that wouldn't work, but what you put in your memory filesystem is up to you. You dont say what your limits are. How much RAM is on the machine? All this is documented on many blogs, man pages, etc. so spend a while on google and you should be able to patch it together. remember: the bootblocks/loader used for Regular PXE booting can load using NFS or tftp. teh loader can link a file with the kernel that is just a filesystem image.. (I forget the exact 'type' is needs to use.. I'm sure the man pages would have it) teh filesystem image is just that.. you make it bu making a memory based drive, and formatting and filling it just as you would a regular drive. We DID at one stage have the ability to have the filesystem loaded be compressed. (in fact at one stag the kernel could also be compressed. I presume we cna stil do that but as I said, I haven't done this for some time. finally you can load the filesystem image and kernel from GRUB too, so if you get the net lodaing capable version of grub going you should be able to do exactly the same thing. it's just a case of giving the right 'type' and name for the image, and giving the right "mountfrom" value (ufs:md0 would be an expected value for example). > > Thanks! > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org" > >