# Multiple /usr/local and packages



## BlueCoder2 (Dec 2, 2011)

I'm interested in making my own live CD with my own packages for laptops.  I want to have some default packages installed on the CD but I would also like to be able to mount an NFS share /usr/local and be able to compile/install other ports/packages.

What I'm trying to do is have a general purpose CD I can pop in any laptop. Without a net connection I have access to default software on the CD. When I am in range of my home router I can use an NFS share for /usr/local and have updated apps as well as being able to install new ones.  When I'm away if I need to I can tunnel into my home network and likewise remount /usr/local from across the internet.

The reasoning is you'll want more packages than you can install on a CD/DVD or more likely you want a package that you didn't anticipate you wanted and don't want and or have time to reburn a new disc with the package.

Overlapping /usr/local means I have to either launch from single user mode or more likely hack an rc.d script or two to do what I want.  Maybe write my own forth language loader boot menu.

I'm also trying to figure out if I could have multiple /usr/local, e.g. /usr/local1 /usr/local2 /usr/local3 and what the implementation and ramifications might be.  This is an extension of the /usr/local concept but I doubt the ports system can handle it.

The more obvious solution is using a USB flash drive and only booting the kernel from the CD on a system that doesn't support USB booting.

Just rambling a bit and looking for some feedback.


----------



## toddnni (Dec 2, 2011)

I am also interested in this subject. 

First the ports system (and packages) should respect the PREFIX environment variable, which determines the location where the ports will be installed.

Second the new location needs to be added to system's PATH, /etc/manpath.conf and ldconfig(8).

These are just thought and I haven't really done this. I hope that someone more experienced would join to the discussion. For example I don't currently have a clue where I should configure ldconfig settings.


----------



## phoenix (Dec 2, 2011)

mount_nullfs(8) may be what you are looking for.

Mount /usr/local/ read-only off the CD.  NFS mount remotehost:/usr/local to somewhere.  Then use something like: `# mount -t nullfs /somewhere/ /usr/local`

May or may not work, never tested.  But I think that's the direction you should be looking.


----------

