FreeBSD-12.1 on laptop

Polytropon freebsd at
Fri Nov 29 13:11:46 UTC 2019

On Fri, 29 Nov 2019 00:59:46 -0600, Scott Bennett wrote:
> Tomasz CEDRO <tomek at> wrote:
> > Do this as root:
> >
> > pkg install Xorg hal dbus
>      Bzzzt!  Please do not send innocent victims into the hal nightmare.
> That package is *not* needed and *should be avoided whenever possible*.

It seems to be unavoidable as soon as you want to install a
desktop environment (Gnome, KDE, Xfce, LXDE). But X itself
works fine without HAL, so do lots of window managers and
application programs. HAL seems to be abandoned in Linux land,
but still many GUI ports make it a dependency... :-/

> > portsnap fetch update
> > cd /usr/ports/graphics/drm-fbsd12.0-kmod/
> > make
> > make deinstall
> > make install
> > kldunload drm
> > kldunload i915kms
>      Yeah?  Good luck with that.  One it has the graphics device, I
> doubt it will allow itself to be unloaded.  A reboot will most likely
> be necessary.

Depends. Especially if you haven't entered X yet, it seems to
be possible. However, a clean reboot is usually the better way.
For this to work, it's neccessary (!) that no further references
to such kernel modules exist in any of the relevant configuration

> > kldload /boot/modules/drm.ko
>      It shouldn't be necessary to load drm.ko manually.

It's a dependency of the i915kms module. I have a laptop that
runs FreeBSD 12.0-p7 where I have in /boot/loader.conf:


And then kldstat reports drm2.ko to be loaded as well.

> > kldload /boot/modules/i915kms.ko
>      There can be problems with the above method of loading this, IIRC.
> Using
> kld_list="/boot/modules/i915kms.ko"
> in /etc/rc.conf.local (or /etc/rc.conf if you don't separate your own
> added choices from the system's) is the preferred method.

Technically, it doesn't seem to matter, as only the point in
time is affected when the module is loaded. Manually loading
it and then using this as a starting point for further experiments
with X is okay.

Also see my note above - it also seems to work when loaded
via /boot/loader.conf.


There was also a case where "manually" executing "kldload <something>"
was required in /etc/rc.local. :-)

> > startx
> >
> > You can also generate Xorg configuration with:
> > Xorg -configure
> > cp /root/ /etc/X11/xorg.conf
> > startx
>      Note that manual configuration should be used only as a last resort.
> Most users should let xorg autoconfigure unless there is a problem in
> getting particular devices, fonts, drivers, etc. recognized or for special
> screen, keyboard, and/or pointing device setups.

Exactly. That's why any existing configuration file should be
removed, just to be sure. X can generate one if needed, but in
most cases, it's _not_ needed. Sometimes you only need a
partial file in /usr/local/etc/X11/xorg.conf.d/ to regulate
a specific aspect of X, like keyboard settings or s forced
screen size.

> > Note that you have to compile the DRM kernel driver on your machine,
>      True, except for users who run -RELEASE GENERIC.
> > also you need to load /boot/modules/drm.ko and
>      Not true AFAIK.  I don't do that, and it works just fine.

Automated dependency.

> > /boot/modules/i915kms.ko from that location otherwise you will load
> > default drm/i915 drivers that does not work with modern GPU.
>      Yes, this one most likely does need to be specified for Intel's
> integrated graphics.

In this case, knowing the exact hardware configuration is
neccessary. FreeBSD system tools can provide this information,
and it needs to be reflected by the kernel modules loaded,
the X11 drivers installed, and what X detects (checked with
the log file).

It isn't that complicated. ;-)

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list