Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Apr 2009 07:43:24 +0200
From:      David Naylor <naylor.b.david@gmail.com>
To:        Travis Daygale <anti_spamsys@yahoo.com>
Cc:        freebsd-hackers@freebsd.org, Sam Leffler <sam@freebsd.org>
Subject:   Re: compiling root filesystem into kernel (preferably tmpfs root filesystem)
Message-ID:  <200904100743.28140.naylor.b.david@gmail.com>
In-Reply-To: <104771.62272.qm@web37103.mail.mud.yahoo.com>
References:  <104771.62272.qm@web37103.mail.mud.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart1429101.k2Q3nErVYx
Content-Type: multipart/mixed;
  boundary="Boundary-01=_8xt3J28kuX58opI"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

--Boundary-01=_8xt3J28kuX58opI
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Thursday 09 April 2009 08:34:22 Travis Daygale wrote:
> David, thank you for the great information! =A0Yes, I would appreciate se=
eing
> the scripts and hearing about the other method you outline. =A0 Yes, you
> understand what I want to achieve exactly.

Please see attached for the scripts.  There is now a README file, that=20
*should* explain everything, I hope.  If you are running FreeBSD 7 then=20
usbbt.sh needs to be edited (newfs and du have options only supported=20
by -current). =20

> I see what you're saying about not needing to put it in the kernel file,
> though for a variety of reasons, I do prefer a single file in the end.=20

Although testing is made much easier by having it as a module (and not havi=
ng=20
to rebuild the kernel every time). =20

> And=20
> I did find this after posting (didn't see it on previous searches, though=
 I
> invested a lot of time looking before I
> posted):http://lists.freebsd.org/pipermail/freebsd-hackers/2006-November/=
01
>8662.html I have built a root image that I put in the kernel as described =
in
> the Nov 2006 post. =A0My UFS root image consists of /sbin/init, where ini=
t is
> a statically compiled C program that just spits out "Hello world" and
> sleeps, this binary runs fine under FBSD. =A0At this point, I have the ke=
rnel
> booting but it panics because it says it can't find init.... =A0Hmmm... =
=A0I
> believe (haven't had time to test) that it is finding root? =A0

The kernel complains when there is no root (and asks for one). =20
Here is a hint:
/> grep init_ /boot/defaults/loader.conf
#init_path=3D"/sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init:/stand/sys=
install"
#init_shell=3D"/bin/sh"   # The shell binary used by init(8).
#init_script=3D""         # Initial script to run by init(8) before chrooti=
ng.
#init_chroot=3D""         # Directory for init(8) to chroot into.

If you need further help on this please provide more information (the outpu=
t=20
produced by the kernel, for starters).

> Not sure=20
> though what loader args I might need to be providing? =A0Could it be a /d=
ev
> issue (though I'm not needing sh, etc., since my init is not a real init)?
> =A0Still figuring this out.

The kernel automatically mounts /dev/ for you (just make sure there is a mo=
unt=20
point). =20

Just to point out.  There are two other scripts (that I know of) that also=
=20
produce live images: freesbie and nanobsd.  Neither do RAM based images=20
(again, as far as I know). =20

Sam: I've cc'ed you so you can have a look at my scripts, if you are=20
interested. I'll send you an e-mail once I've read through nanobsd carefull=
y. =20

Regards

--Boundary-01=_8xt3J28kuX58opI--

--nextPart1429101.k2Q3nErVYx
Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)

iEYEABECAAYFAkne3IAACgkQUaaFgP9pFrLtnwCeOvEM/3Vf/gMrHQElyPtIiWwR
S/0AoIjUTRFwB4Km05NyZrlfGbg60/Jd
=rI8I
-----END PGP SIGNATURE-----

--nextPart1429101.k2Q3nErVYx--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904100743.28140.naylor.b.david>