# xorg, and confusion about association with linux_base-c6



## sidetone (Jun 15, 2016)

I noticed that x11/xorg and x11/xorg-minimal now installs linux emulators/linux_base-c6, so that implies that linux emulation is not in the base of FreeBSD 10.3. Linux must be KLD loaded before xorg and many other graphical programs can be installed. Many ports (even xorg related ones) also no longer have maintainers, and a few programs fail to build. Is there any information on what major changes happened to ports? Thank you.


----------



## SirDice (Jun 15, 2016)

sidetone said:


> I noticed that x11/xorg and x11/xorg-minimal now installs linux emulators/linux_base-c6,


Not on any of my systems. And neither port depends on it.



> so that implies that linux emulation is not in the base of FreeBSD 10.3.


linux(4) is part of the base, the required Linux libraries and utilities are not and never were.


----------



## kpa (Jun 15, 2016)

This comes out empty on my system:


```
freebsd10 /usr/ports/x11/xorg-minimal % make all-depends-list | grep linux
```


```
freebsd10 /usr/ports % svnlite info
Path: .
Working Copy Root Path: /usr/ports
URL: svn://svn.freebsd.org/ports/head
Relative URL: ^/head
Repository Root: svn://svn.freebsd.org/ports
Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5
Revision: 416915
Node Kind: directory
Schedule: normal
Last Changed Author: pi
Last Changed Rev: 416915
Last Changed Date: 2016-06-15 08:40:38 +0300 (Wed, 15 Jun 2016)
```

The only Xorg related port that could install Linux related ports is the NVidia driver port. Are you sure that the linux base port was indeed depended on by the x11/xorg port and not by something else you just happened to be rebuilding at the same time?


----------



## SirDice (Jun 15, 2016)

Maybe a botched setting in /etc/make.conf causes things to depend on it?


----------



## sidetone (Jun 15, 2016)

kpa
I think you're right, I was considering the possibility that it had to do with the order I installed the drivers first, but of ati, and excluding nvidia, then I used packages to overlap that, to save time. Either that or my computer went haywire.

How would I remove all options from the entire ports tree, not just dependencies of one port directory `rmconfig-recursive`. `portsnap fetch extract` will do it right?

SirDice 
There's not much in my /etc/make.conf file. There's a lot in my src.conf file, but the problem didn't happen when first doing those settings, weeks ago.


----------



## SirDice (Jun 15, 2016)

sidetone said:


> How would I remove all options from the entire ports tree, not just dependencies of one port directory  rmconfig-recursive.


Simplest way: `rm -rf /var/db/ports/*`. Don't confuse this with /var/db/pkg/!



> `portsnap fetch extract` will do it right?


No, this will only refresh the files in /usr/ports. The options are saved in /var/db/ports.


----------



## kpa (Jun 15, 2016)

Yeah, the ports tree is (with exceptions, see below) designed so that nothing in it contains saved information. This allows it to be nullfs(5) read-only mounted to jails for example.

There are however some unfortunate decisions made in the past and nobody has been able to change them yet. One of them is the work directory for the port that defaults to a work directory inside the port directory, it can be overridden with WRKDIRPREFIX in make.conf(5) or environment and that's used by the package builders extensively. The other one is the packages directory that defaults to /usr/ports/packages, can be overridden with the PACKAGES variable. This default for the packages is insane imo and should have been changed long ago to a directory under /var.


----------



## SirDice (Jun 15, 2016)

kpa said:


> The other one is the packages directory that defaults to /usr/ports/packages, can be overridden with the PACKAGES variable. This default for the packages is insane imo and should have been changed long ago to a directory under /var.


The same could be said for /usr/ports/distfiles/. You can set DISTDIR if you want. Even the ports directory itself can live somewhere else by setting PORTSDIR. See ports(7) for more interesting variables.


----------



## sidetone (Jun 15, 2016)

I removed /var/db/ports and /var/db/pkg yesterday after removing all packages. By running `pkg remove -af` /usr/local/ was almost entirely empty, with the exception of a few user custom files. So now I know if I damaged my /var/db/pkg directory, it only damages /usr/local/ and not the base system. What kpa said, would explain a few things. It is odd that linux emulation can't be removed from the base system through src.conf.

The only possibility of an error in my make.conf is 
	
	



```
NO_PROFILE=yes
```
, that didn't cause me trouble before, but which I'll remove.



kpa said:


> Yeah, the ports tree is (with exceptions, see below) designed so that nothing in it contains saved information. This allows it to be nullfs(5) read-only mounted to jails for example.
> 
> There are however some unfortunate decisions made in the past and nobody has been able to change them yet. One of them is the work directory for the port that defaults to a work directory inside the port directory, it can be overridden with WRKDIRPREFIX in make.conf(5) or environment and that's used by the package builders extensively. The other one is the packages directory that defaults to /usr/ports/packages, can be overridden with the PACKAGES variable. This default for the packages is insane imo and should have been changed long ago to a directory under /var.



The overlapping work directories inside the ports tree, and the var structure suggestion sound like they can be bug reports. It would be a good idea to just have a file fetch directory with subdirectories of src and portsnap so it can be mounted on one partition of nosoftupdates, or fast harddrive settings, where a loss of src and Makefile data can be quickly replaced. A consideration for /var is not to use it on memory disk, (except for on a read only operating system) because on reboot, /var/db/ports and /var/db/pkg deletes, and the information on the installed packages is lost.

My make.conf has 
	
	



```
WRKDIRPREFIX=/tmp/customdirectory
```
, where /tmp/ is mounted as a memory disk.


----------



## SirDice (Jun 15, 2016)

sidetone said:


> So now I know if I damaged my /var/db/pkg directory, it only damages /usr/local/ and not the base system.


Really the only important file is /var/db/pkg/local.sqlite. This is the database that contains all your installed packages. Everything else in that directory could be removed without issues. 



> It is odd that linux emulation can't be removed from the base system through src.conf.


The _only_ bit that's part of the base is the linux(4) kernel module. Nothing else. As with all other modules, everything is always built. Unless you set WITHOUT_MODULES.


```
WITHOUT_MODULES
                   (str) Set to a list of modules to exclude from the build.
                   This provides a somewhat easier way to exclude modules you
                   are certain you will never need than specifying
                   MODULES_OVERRIDE.  This is applied after MODULES_OVERRIDE.
```
See make.conf(5).


----------

