# Ports and jail



## vand777 (Jun 20, 2010)

Hi

I setup jails as advised on http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails-application.html

I didn't forget to add WRKDIRPREFIX?=  /s/portbuild to /home/j/skel/etc/make.conf

Unfortunately, when I try to compile port inside jail, I get the following error message:


```
svn# cd /usr/ports/ports-mgmt/portmaster
svn# make install clean
===>  Vulnerability check disabled, database not found
===>  License accepted by the user
===>  Found saved configuration for portmaster-2.32
mkdir: /usr/ports/distfiles: Read-only file system
*** Error code 1

Stop in /usr/ports/ports-mgmt/portmaster.
*** Error code 1

Stop in /usr/ports/ports-mgmt/portmaster.
svn#
```

From inside the jail, there is no such directory as /usr/ports/distfiles.

Any help how to solve this problem is very much appreciated. Thank you.


----------



## anomie (Jun 20, 2010)

Note the error message, "Read-only file system". That is your most immediate problem. (How you got there is another issue.) 

Did you read the *Warning* at the top of the FreeBSD Handbook section you followed?


----------



## vand777 (Jun 20, 2010)

I understand the problem. I just do not understand how to fix it. Any ideas?


----------



## vand777 (Jun 20, 2010)

I have feeling that things started getting wrong at step 5:


```
Now, symlink the read-write file system to the read-only file system. Please make sure that the symlinks are created in the correct s/ 
locations. Real directories or the creation of directories in the wrong locations will cause the installation to fail.

# cd /home/j/mroot
# mkdir s
# ln -s s/etc etc
# ln -s s/home home
# ln -s s/root root
# ln -s ../s/usr-local usr/local
# ln -s ../s/usr-X11R6 usr/X11R6
# ln -s ../../s/distfiles usr/ports/distfiles
# ln -s s/tmp tmp
# ln -s s/var var
```

The directory /home/j/mroot/s is empty in my case.


----------



## vand777 (Jun 20, 2010)

I found temp solution:


```
make install clean DISTDIR=/tmp/distfiles
```

But I'm still keen to find out why distfiles was not attached correctly in my installation. Please help.


----------



## anomie (Jun 21, 2010)

vand777 said:
			
		

> The directory /home/j/mroot/s is empty in my case.



Then run through the steps again to create the symlinks, right? 

The documented process you're following is clever, but contrived (IMO), and prone to human error. If you're not able to troubleshoot, please consider the advice in the *Warning* section (i.e. the sysutils/ezjail port).


----------



## vand777 (Jun 21, 2010)

Thank you for your comments. I know that sysutils/ezjail is the easiest solution but I've never given up in my life so quickly and I will do all my best to find out how to fix distfiles problem.


----------



## vand777 (Jun 27, 2010)

Solved. It was a typo mistake :-(


----------

