Page 1 of 1

Strip down proto jail

Posted: 03 Feb 2013 22:28
by Mizma
I have followed the guide to strip down proto jail. http://wiki.nas4free.org/doku.php?id=do ... owto:jails

My issue is that it seems all those source files thats being downloaded and used isn't erraces after buildword is done so I end up with a bigger directory than the one i started with. Is it supposed to be this way or shall I remove some temp direcory after im done?

Second when it comes to make a new jail by this building world way. Could someone explain what seems to be obvius for everyone else but me what to whrite
in DESTDIR=/mnt in an embedded install.
Installworld to the www jail mounted on /mnt:

proto# cd /usr/src
proto# make installworld DESTDIR=/mnt

It should be clear what DESTDIR= means:

proto# make distribution DESTDIR=/mnt

Re: Strip down proto jail

Posted: 03 Feb 2013 22:44
by fsbruva
In order to strip down the jail, you are rebuilding the entire world (all the userland programs). Rebuilding is actually parlance for recompiling all of the programs that make up the standard FreeBSD from scratch, using the source code that you downloaded with the cvsup. (Which reminds me, I gotta change the wiki to use svn). Once the source code is downloaded, it doesn't get deleted. After you have completed the installworld and installation builds, you can delete the contents of /usr/src.

In a normal Nas4Free embedded installation, / represents the root of the directory tree. Once you are inside a jail, / represents the root of the JAIL's directory tree. So, as far as the jail in concerned, / is the root. But, if you followed the wiki, / within the jail actually lives at /jail/proto in the real world (Nas4Free). That's why you did a mount_nulls command. So, for doing the buildworld, you will mount a real-life, persistent, Nas4Free location (/mnt/zpool4/jail/albatross) to a location within the jail. Now, the jail will think the mountpoint is /mnt/alby, but in real life, that is located at /jail/proto/mnt/alby. So, you will create a directory called "alby" at /jail/proto/mnt from Nas4free. Then, from Nas4free, you will mount_nullfs where the jail will actually live (/mnt/zpool4/jail/albatross) to the mountpoint (/jail/proto/mnt/alby).

Re: Strip down proto jail

Posted: 03 Feb 2013 22:53
by Mizma
Oki I see
Then how do i remove those files rmdir just sais directory not empty. is there a commado to just remve all, do i have to change any permition flags.

I'll play aroud a bit more build world to understand how it works.

Re: Strip down proto jail

Posted: 03 Feb 2013 23:07
by Mizma
After I deleted the cotents of /usr/src the usr folder still contains 42 583 files at a total of 1,20 GB this compared to a clean install where I haven't downloaded FreeBSD and rebuilt the usr folder contains 41 770 files at a total of 1,62 GB.

Re: Strip down proto jail

Posted: 03 Feb 2013 23:08
by fsbruva
rm -r is the command you want. That will remove (recursively) all the files and the directories contained within.

Re: Strip down proto jail

Posted: 03 Feb 2013 23:12
by Mizma
I used
chflags -R noschg src
rm -rf src