cd87
![]() |
|
|
|
|
|||||||
| General General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I want to automate the mounting of the ports tree with ezjail. By default ezjail mounts the basejail into each new jail and links some directories up to this one. Code:
# ls -al /usr/local/jails/build/usr total 73 drwx------ 5 root wheel 15 May 2 17:46 . drwx------ 12 root wheel 22 May 2 17:46 .. lrwxr-xr-x 1 root wheel 17 May 2 17:46 bin -> /basejail/usr/bin drwx------ 2 root wheel 2 Jan 3 08:55 games lrwxr-xr-x 1 root wheel 21 May 2 17:46 include -> /basejail/usr/include lrwxr-xr-x 1 root wheel 17 May 2 17:46 lib -> /basejail/usr/lib lrwxr-xr-x 1 root wheel 19 May 2 17:46 lib32 -> /basejail/usr/lib32 lrwxr-xr-x 1 root wheel 21 May 2 17:46 libdata -> /basejail/usr/libdata lrwxr-xr-x 1 root wheel 21 May 2 17:46 libexec -> /basejail/usr/libexec drwx------ 3 root wheel 3 May 3 17:33 local drwx------ 2 root wheel 2 Jan 3 08:55 obj lrwxr-xr-x 1 root wheel 19 May 2 17:46 ports -> /basejail/usr/ports lrwxr-xr-x 1 root wheel 18 May 2 17:46 sbin -> /basejail/usr/sbin lrwxr-xr-x 1 root wheel 19 May 2 17:46 share -> /basejail/usr/share lrwxr-xr-x 1 root wheel 17 May 2 17:46 src -> /basejail/usr/src mount_nullfs /usr/ports /usr/local/jails/basejail/usr/portsLogically this should provide all jails with the ports tree (except the distfiles). Unfortunatly this doesn't work. The symlink is still active in the new jail. How do you solve this issue? Last edited by bsus; May 5th, 2012 at 20:46. |
|
#2
|
|||
|
|||
|
You are trying to mount a path tree (/usr/ports) on top of a path (/usr/jails/basejail/usr/ports), while /usr/jails/basejail is later mounted inside another path (/usr/jails/build/basejail).
This shrieks for trouble. Piggyback mounting with nullfs isn't supported. If you want to consolidate both ports-trees from /usr/ports and /usr/jails/basejail/usr/ports just populate /usr/jails/basejail/usr/ports with # ezjail-admin update -P and mount this tree in /usr/ports.Otherwise rename (or remove) the ports link to ports-basejail and create /usr/jails/build/usr/ports. Then you are able to mount /usr/ports to this directory inside build jail. Put your mount points in your /etc/fstab.hostname for automatic mounting. In your case in /etc/fstab.build: Code:
/usr/ports /usr/jails/build/usr/ports nullfs ro 0 0 /usr/ports/distfiles /usr/jails/build/var/ports/distfiles nullfs rw 0 0 |
|
#3
|
|||
|
|||
|
So the ports tree is mounted the other way. Actually quite simple and logical
![]() Thank you for the help! I now just fail fetching the ports tree into the basejail and making this writable for the build jail. Code:
ezjail-admin update -P Looking up portsnap.FreeBSD.org mirrors... 4 mirrors found. Fetching snapshot tag from portsnap1.FreeBSD.org... done. Fetching snapshot metadata... done. Updating from Sat May 5 02:33:32 CEST 2012 to Sat May 5 08:40:25 CEST 2012. Fetching 4 metadata patches... done. Applying metadata patches... done. Fetching 0 metadata files... done. Fetching 11 patches.....10 done. Applying patches... done. Fetching 1 new ports or files... done. /usr/jails/basejail/usr/ports was not created by portsnap. You must run 'portsnap extract' before running 'portsnap update'. Error: Updating ports failed. Last edited by DutchDaemon; May 6th, 2012 at 01:48. |
|
#4
|
|||
|
|||
# ezjail-admin update -p should invoke # portsnap -p "${ezjail_jailbase/usr/ports}" extract thus extracting new ports-tree into /usr/jails/basejail/usr/ports.
|
|
#5
|
|||
|
|||
|
I had to build the world and csup sources.
Last edited by DutchDaemon; May 6th, 2012 at 01:49. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ezjail, multiple IP | schasd | Networking | 1 | August 17th, 2011 21:32 |
| Memcached and ezjail | cgigeek | Web & Network Services | 1 | May 21st, 2011 01:30 |
| ezjail with racoon | beaute | Networking | 3 | August 18th, 2010 02:05 |
| Macros With Ezjail? | ssanbeg | General | 1 | July 26th, 2010 11:52 |
| [Solved] ezjail clone | gpatrick | Web & Network Services | 1 | July 23rd, 2010 23:53 |