Solved Any issues building world and kernel for RELENG_9 on 11-CURRENT?

Greetings everyone,
I'm creating traditional jails on an box running -CURRENT (11). I use the following procedure:
Code:
cd /usr/src
make installworld DESTDIR=/jails/releng_9
make distribution DESTDIR=/jails/releng_9
...
So the "world" that I'm using for these jails will be an "11-CURRENT" world. Is there/will there be any issues performing the following in those jails:
Code:
svn co svn://svn.freebsd.org/base/stable/9 /usr/src
to build kernel, and world for a RELENG_9 box?

and performing:
Code:
svn co svn://svn.freebsd.org/ports/head /usr/ports
to build ports/packages for the same?

Thank you for all your time, and consideration.

--Chris
 
Thanks for the reply, Remington.
I think you misunderstood my intent, or perhaps I was too vague.
What I am attempting to do, is build kernels, and world, for my other boxes. I have setup jails on my 11-CURRENT (development) box, in an effort to accomplish this.
I suppose it might be possible to "downgrade" the jail environment, with the information in the link you provided. But I think that that would be counter-productive for my intent.

I hope I was clearer this time. :)

Thanks again!

--Chris
 
Well. My efforts to use the jail(8) "hosts" world, seems to be impossible for my intents (creating RELENG_9 world, and kernels). I'm going to try using a world from one of the RELENG_9 boxes on this 11-CURRNET box, in a jail(8), and see where it leads...

--Chris
 
What is actually happening? Is it failing to compile?
Hello, junovitch!
Honestly, I should have known it wouldn't work. But was hoping I could be lazy! :)
The -CURRENT ABI is incompatible (of course).
So for those who want to know, and perhaps haven't already tried/done this; here's the fast-track to get 'er done:
= on one of the RELENG_9 boxes you want to upgrade, that has already had "world" built
Code:
# mkdir /tmp/RELENG_9
# cd /usr/src
# make installworld DESTDIR=/tmp/RELENG_9
# make distribution DESTDIR=/tmp/RELENG_9
# cd /tmp
# tar -cvzf RELENG_9.tar.gz RELENG_9
OK. now you need to get that "world" to your jail(8) host. So just ftp(1) it, or otherwise get it over to that box. Once it's there. Move it to the base directory that you host jails from, eg; /jails:
Code:
# mv RELENG_9.tar.gz /jails
# tar -xvzf RELENG_9.tar.gz
Assuming you want to call the new jail(8) "releng9":
Code:
# mkdir /jails/releng9
# cd /jails/releng9
# rsync /jails/RELENG_9/ .
Now your new jail has been populated. I chose this method, so that I can use the RELENG_9 folder for a template to populate other jails with a pristine world, in the future.
OK. For the sake of this example that the jail(8) host has the following IP address, and netmask defined in rc.conf(5) on the nfe0 interface:
ifconfig_nfe0="inet 192.168.1.1 netmask 0xffffff00
That said, on the jail(8) host, edit it's rc.conf(5), adding the following:
Code:
ifconfig_nfe0_alias0="inet 192.168.1.2/32"
inetd_flags="-wW -a 192.168.1.1"
jail_enable="YES"
Export the devfsrules section from /etc/defaults/devfs.rules on the jail(8) host, to /etc/devfs.rules. It looks like this:
Code:
# Devices usually found in a jail.
#
[devfsrules_jail=4]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path zfs unhide
Again, on the jail(8) host. Edit, or create /etc/jail.conf(5) to add the following:
Code:
allow.raw_sockets = 1;

releng9 {
path = /jails/releng9;
host.hostname = releng9;
ip4.addr = 192.168.1.2;
interface = nfe0;
exec.clean;
mount.devfs;
mount.fdescfs;
mount.procfs;
exec.start =   "/bin/sh /etc/rc";
exec.stop = "/bin/sh   /etc/rc.shutdown";
}
You will need to adjust to your own environment. Read both jail(8), and jail.conf(5) man(1) pages. You can nearly copy the examples verbatim, with minor adjustments.
Right. Now it's time to prime the new jail(8) and perform a few tasks on it. Prior to actual usage. Let's go!
Code:
# mount -t devfs devfs /jails/releng9/dev
# devfs -m /jails/releng9/dev rule -s 4 applyset
# touch /jails/releng9/etc/fstab
Great. Now we're going to login(1) directly to our new jail(8) to perform some important tasks that are necessary before actual usage:
root password (passwd(1)), add a regular user (adduser(8)), newaliases(1), tzsetup(8).
Code:
# jail -c path=/jails/releng9 command=/bin/sh
passwd root
OK while still logged in, add a regular user, and assign that user to the group wheel:
Code:
adduser
Again, while still looged in, edit /etc/mail/aliases and assign root's alias to the user you just created.
Code:
ee /etc/mail/aliases
now you can update the aliases db (ignore the localhost resolution error that's emitted)
Code:
newaliases
Great. Almost done. Setup the time zone
Code:
tzsetup
One last thing before logging out. We need to add at least the following in the jails rc.conf(5):
Code:
hostname="releng9"
sshd_enable="YES"
This is mainly to ensure you will be able to login(1) to the jail(8) from outside the host.
WARNING you'll need to secure any services you enable in the jail!
OK. We're done with the initial setup. You can log out now
Code:
# exit
# umount /jails/releng9/dev
Whoohoo! Now it's time for the "smoke test". If your box doesn't blow up after you do this. Pat yourself on the back. It'll work.
Code:
jail -c releng9
The system in your jail(8) will initialize. If your box doesn't blow up. Your ready to go!
When it's done, kill it.
Code:
jail -r releng9
Look for errors. If none. We need to install pkg, subversion-static and populate /usr/ports and /usr/src. Then deinstall svn-static, and cd /usr/ports/devel/subversion && make install clean.

This time, we'll login(1) directly into the jail(8) as the regular user, we created earlier. Let's call him "joeuser".
Start the jail(8) back up
Code:
# jail -c releng9
login(1) (to the jail) as "joeuser". See jexec(8) for details
Code:
# jexec -u joeuser releng9 /bin/csh
# su
OK now you're logged in, and have become root. First we'll need to install pkg(8), followed by devel/subversion-static. Just calling pkg(8) will initiate the install of pkg(8)
Code:
# pkg
...

# pkg install devel/subversion-static
...
Great. Now we can populate /usr/ports, and /usr/src. This jail(8) is otherwise pretty useless.
Code:
# rm /usr/ports
# rm /usr/src
# svn checkout svn://svn.freebsd.org/ports/head /usr/ports
...

# svn checkout svn://svn.freebsd.org/base/stable/9 /usr/src
...
Now we have an initiated, and fully populated system. Only 2 things left to do, before we can start any real development on it
Code:
# pkg delete subversion-static
...

# cd /usr/ports/devel/subversion
# make install clean
...
Done!
Code:
# exit
# jail -r releng9
Now would be the perfect time to take a "snapshot" of the jail(8), using the rsync(1) method I mentioned above, or make a tar(1)ball, or whatever your usual method is. That way you can re-purpose it, or use it to replace this one, should anything ever go wrong with it.

Well. There you have it; the fast-track to a "traditional" FreeBSD jail(8).
ezjail, and poudriere are all well, and good, I guess. But they lack the flexibility that a "traditional" jail(8) provides. Which is why I never use them (ezjail, and poudriere). In the end, you'll actually save a lot more time, and get a lot more done, if you use the traditional way -- really.

I hope you found this useful, and happy jail(8)ing! :)

--Chris
 
Last edited:
Back
Top