NULLFS/NFS mounts inside FreeBSD 8.0 jail for tinderbox

General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

NULLFS/NFS mounts inside FreeBSD 8.0 jail for tinderbox

Postby cbowlby » 13 Apr 2010, 21:42

Hi Guys,

I currently use nullfs to mount my ports folders inside some jails that I have running, but one of the things I'd like to do is create a completely "jailed" tinderbox server, where all elements of the tinderbox are in it's own jail.

As such I have a choice of trying NFS mounts (which wont work), and nullfs based mounts, which also wont work as far as I know. As I am running FreeBSD 8.0, is there anything that I can do to use one or the other?
cbowlby
Junior Member
 
Posts: 8
Joined: 10 Feb 2010, 17:33

Postby SirDice » 14 Apr 2010, 06:45

cbowlby wrote:As such I have a choice of trying NFS mounts (which wont work), and nullfs based mounts, which also wont work as far as I know.

Nullfs works fine:

Code: Select all
dice@molly:~>mount
/dev/ad0s1a on / (ufs, local)
devfs on /dev (devfs, local, multilabel)
/dev/gvinum/temp on /tmp (ufs, local)
/dev/ad0s1d on /var (ufs, local, soft-updates)
/dev/ad0s1e on /usr (ufs, local, soft-updates)
/dev/ad0s2g on /usr/home (ufs, local, soft-updates)
/dev/ad0s1f on /usr/src (ufs, NFS exported, local, soft-updates)
/dev/ad0s1g on /usr/obj (ufs, NFS exported, local, soft-updates)
/dev/ad0s1h on /usr/ports (ufs, NFS exported, local, soft-updates)
/dev/ad0s2d on /jail/j1 (ufs, local)
/dev/ad0s2e on /jail/j2 (ufs, local)
/dev/gvinum/raid5 on /storage (ufs, NFS exported, local)
/storage/MediaTomb/Movies on /jail/j1/exports/Movies (nullfs, local, read-only)
/storage/FreeBSD on /jail/j1/exports/Freebsd (nullfs, local, read-only)
/storage/MediaTomb/Software on /jail/j1/exports/Software (nullfs, local, read-only)
devfs on /jail/j1/dev (devfs, local, multilabel)
/tmp/build on /jail/j2/tmp/build (nullfs, local)
/usr/ports on /jail/j2/usr/ports (nullfs, local)
/storage/FreeBSD/distfiles on /jail/j2/usr/ports/distfiles (nullfs, local)
/usr/src on /jail/j2/usr/src (nullfs, local)
/usr/obj on /jail/j2/usr/obj (nullfs, local)
devfs on /jail/j2/dev (devfs, local, multilabel)
/storage/FreeBSD/packages_20100217 on /jail/j2/usr/ports/packages (nullfs, local)


Just make sure they are mounted on the host side, not from inside a jail. You can use seperate fstabs for them.

Code: Select all
dice@molly:~>cat /etc/fstab.build
/tmp/build   /jail/j2/tmp/build   nullfs   rw   0   0
/usr/ports      /jail/j2/usr/ports      nullfs  rw      0       0
/storage/FreeBSD/distfiles   /jail/j2/usr/ports/distfiles   nullfs   rw   0   0
/usr/src        /jail/j2/usr/src        nullfs  rw      0       0
/usr/obj        /jail/j2/usr/obj        nullfs  rw      0       0
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16166
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby cbowlby » 14 Apr 2010, 12:13

Yes, I know that mounting nullfs file systems works, as I use those already. However, the way tinderbox mounts a nullfs or NFS mounted partition is from inside the jail, through the following steps:

1. tinderbox extracts the "distribution" it is going to build a port on.
2. tinderbox configures and starts (it's a chroot build platform that acts "similar" to a jail, but is not actually a jail).
3. it mounts the ports tree through either a nullfs or nfs partition, depending on what has been specified.
4. builds the port(s).
5. unmounts the partitions and closes down after it's either completed or failed.

Because of step 3, I don't think I can "mount" those partitions in advance from sections external to the jail. Tinderbox wants to do the mounting after extracting and configuring the build "jail" (again, they use the term jail, but it's not a true jail).

So the hierarchical picture looks like:

Code: Select all
host
|- jail 1
|- jail 2
|- ...
|- tinderbox jail
    |--- build jail 1
    |--- build jail 2
    |--- etc.


Thus far, everything up to the point of mounting the ports tree works with out issue.
cbowlby
Junior Member
 
Posts: 8
Joined: 10 Feb 2010, 17:33

Postby SirDice » 14 Apr 2010, 12:33

Ah. I see. I don't actually use tinderbox. I do all the building by hand.
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16166
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby cbowlby » 14 Apr 2010, 13:22

I have been as well, but wanted to play around with tinderbox to see how it worked and if it could speed up some of my turnarounds.
cbowlby
Junior Member
 
Posts: 8
Joined: 10 Feb 2010, 17:33

Postby SirDice » 14 Apr 2010, 13:51

I'm assuming it's just one big script that automates a lot of steps. Perhaps you can modify the code slightly to not mount the ports tree and make sure it's mounted beforehand?
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16166
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby cbowlby » 14 Apr 2010, 18:47

No, it's a bit more then a build script, it's much more then that, here's the readme if your curious:

http://tinderbox.marcuscom.com/README.html
cbowlby
Junior Member
 
Posts: 8
Joined: 10 Feb 2010, 17:33


Return to General

Who is online

Users browsing this forum: vejnovic and 0 guests