Jan 262014
 

As mentioned in my previous post, if FreshPorts is to display commits from every branch, it is going to need one check-out of each branch of the ports tree. Tonight I started looking into that and hit a snag in an unexpected area: name length.

I do most of my development work from within jails. In this particular case, I was working in the jail called mydev.unixathome.org. In that jail, I checked out a copy of the ports tree via this command:

svn co -r 307162 svn://svn.freebsd.org/ports/branches/RELENG_9_1_0 PORTS-RELENG_9_1_0

The mydev jail is already working for ports HEAD. The fstab you will see below reflects that.

That revision number appears in my previous post and refers to the test commit I am currently using.

FreshPorts uses a chroot solution to ensure a clean-environment for running make. The FreshPorts terminology is jail, but in reality it is just a chroot. But to achieve that chroot, I make use of symlinks and mount_nullfs. It turns out there is a limitation to the path names.

I discovered this when I tried to restart my jail:

$ sudo ezjail-admin restart mydev_unixathome_orgorg
Stopping jails: mydev.unixathome.org.
Configuring jails:.
Starting jails:mount_nullfs: /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/usr/ports: File name too long
mount_nullfs: /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/usr/share/mk: File name too long
mount_nullfs: /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/usr/sbin: File name too long
mount_nullfs: /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/usr/bin: File name too long
mount_nullfs: /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/libexec: File name too long
mount_nullfs: /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/usr/lib: File name too long
mount_nullfs: /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/sbin: File name too long
mount_nullfs: /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/lib: File name too long
mount_nullfs: /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/bin: File name too long
mount: none: File name too long
 mydev.unixathome.org.

The /etc/fstab.mydev_unixathome_org file contains this:

$ cat /etc/fstab.mydev_unixathome_org
/usr/local/jails/basejail /usr/local/jails/mydev.unixathome.org/basejail nullfs ro 0 0

# for my dev jail in a jail
/usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/PORTS-SVN  /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail/usr/ports     nullfs  ro,nosuid,noexec  0   0
/usr/local/jails/basejail/usr/share/mk                                /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail/usr/share/mk  nullfs  ro,nosuid,noexec  0   0
/usr/local/jails/basejail/usr/sbin                                    /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail/usr/sbin      nullfs  ro,nosuid         0   0
/usr/local/jails/basejail/usr/bin                                     /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail/usr/bin       nullfs  ro,nosuid         0   0
/usr/local/jails/basejail/usr/libexec                                 /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail/usr/libexec   nullfs  ro,nosuid         0   0
/usr/local/jails/basejail/libexec                                     /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail/libexec       nullfs  ro,nosuid         0   0
/usr/local/jails/basejail/usr/lib                                     /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail/usr/lib       nullfs  ro,nosuid         0   0
/usr/local/jails/basejail/sbin                                        /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail/sbin          nullfs  ro,nosuid         0   0
/usr/local/jails/basejail/lib                                         /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail/lib           nullfs  ro,nosuid         0   0
/usr/local/jails/basejail/bin                                         /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail/bin           nullfs  ro,nosuid         0   0
none                                                                  /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail/dev           devfs   rw                0   0


/usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/PORTS-RELENG_9_1_0             /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/usr/ports        nullfs  ro,nosuid,noexec        0       0
/usr/share/mk                   /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/usr/share/mk     nullfs  ro,nosuid,noexec        0       0
/usr/sbin                       /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/usr/sbin         nullfs  ro,nosuid               0       0
/usr/bin                        /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/usr/bin          nullfs  ro,nosuid               0       0
/libexec                        /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/libexec          nullfs  ro,nosuid               0       0
/usr/lib                        /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/usr/lib          nullfs  ro,nosuid               0       0
/sbin                           /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/sbin             nullfs  ro,nosuid               0       0
/lib                            /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/lib              nullfs  ro,nosuid               0       0
/bin                            /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/bin              nullfs  ro,nosuid               0       0
none                            /usr/local/jails/mydev.unixathome.org/usr/local/FreshPorts/ports-jail-RELENG_9_1_0/dev              devfs   rw                      0       0

As swills said on IRC: I think the path issue is literally the length of the path, so shortening a little might help… mydev.unixathome.org -> mydev, FreshPorts -> fp, etc.

I may try that. I am also considering using a single chroot solution but with multiple checkouts of the ports tree. Both solutions seem to contain their own set of complications.

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

  2 Responses to “Multiple ports trees for FreshPorts”

  1. Changing the jail name to mydev worked. That shortened everything enough to get past this block.

  2. FYI, I’ve decided to go with a single jail, but with multiple svn repositories within that jail.