FreeBSD current on Lenovo T420 Laptop (dogfood)

Posted: March 1st, 2013 | Author: | Filed under: dogfood, FreeBSD | Tags: , , , , | 5 Comments »

I used PC-BSD for about 6 months on my laptop. It is nice but it has it’s own issues. I thought of PC-BSD as a closed source project but to my ignorance, it is also an open source project. It does some serious magic foo with the wrappers around all the GUI things, though. I do not even know how it fetches/emulates FreeBSD from underneath those wrappers. Anyways, I did not feel like spending more time on it.

I recently switched to running freebsd-current on my Lenovo T420. Here is what I had to do to set it up:

1) Picked up the latest snap from here and put it on a usb stick.

2) Because T420s cannot do gpt based installs (more details here), I followed this from FreeBSD wiki to setup mbr with zfs. Setting up ZFS is a huge PIA. I am still not sure why this is not a part of the installer like regular ufs setup.

3) Checked out ports and installed devel/subversion so that I can checkout stuff (and things).

4) I checked out FreeBSD head, did buildworld/installworld and buildkernel/installkernel.

5) To setup basic Display/X setup:
For X:
x11/xdm
x11-servers/xorg-server

For nvidia display drivers:
x11/nvidia-driver
x11/nvidia-settings
x11/nvidia-xconfig

I also added nvidia_load="YES" to /boot/loader.conf to load nvidia driver module /dev/nvidiactl on bootup.

For keyboard:
x11-drivers/xf86-input-keyboard
if not installed, you may see following error in Xorg.0.log:
(EE) Failed to load module “keyboard” (module does not exist, 0)

For Mouse:
x11-drivers/xf86-input-mouse
if not installed, you may see following error in Xorg.0.log:
(EE) Failed to load module “mouse” (module does not exist, 0)

For mouse, I also have following in /etc/rc.conf

moused_port="/dev/psm0"
moused_enable="YES"

Now, I am not sure why xf86-input-keyboard and xf86-input-mouse have to be explicitly installed and not as dependencies to xorg-server. Who likes an X without a keyboard or a mouse? But again, what do I know?

For fonts:
x11-fonts/xorg-fonts
x11-fonts/webfonts

Now to get xorg.conf, do:
# Xorg -configure

For nvidia drivers, also do:
# nvidia-xconfig

Then I tinkered with xorg.conf for a bit to get it all working the way I wanted.

In particular, I had to edit “Screen” section to be:

Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1024x768"
EndSubSection
EndSection

Just for reference, my “InputDevice” section looks like this:

Section "InputDevice"
Identifier "Keyboard0"
Driver "keyboard"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/sysmouse"
Option "ZAxisMapping" "4 5"
EndSection

Xorg logs i.e /var/log/Xorg.0.log is your friend. Use is if you have trouble setting things up.

6) Window manager
I use spectrwm as my window manager. After installing it from ports, to start it automatically with X, my ~/.xinitrc looks like this:

$ cat .xinitrc
#!/bin/sh

/usr/local/bin/spectrwm
/usr/local/bin/xscreensaver

xscreensaver is obviously for screen saver functionality.

7) Browsers:
I primarily use firefox with vimperator plugin.

To make flash work on firefox, I followed instructions in section 7.2.1.2 of this from freebsd handbook.

I also keep chromium around for any other sane soul who does not like browsing on my default firefox+vimperator setup.

Other needed ports:
vim
screen


5 Comments on “FreeBSD current on Lenovo T420 Laptop (dogfood)”

  1. 1 Alfred Perlstein said at 3:56 am on March 2nd, 2013:

    PCBSD is open source. Can you please update your blog?

  2. 2 hpanchasara said at 4:13 am on March 2nd, 2013:

    Thanks for the correction. Updated the blog.

  3. 3 Abhijit Soman said at 12:19 pm on June 9th, 2013:

    I have got a T420 with Intel HD graphics card and installed FreeBSD 9.1 on it. The only problem I’m facing is with ACPI fan control and screen brightness. Did you face any such issues with your installation?

  4. 4 hpanchasara said at 7:05 pm on June 9th, 2013:

    Hi Abhijit,

    I have NVIDIA graphics card and brightness control works for me with: Option “RegistryDwords” “EnableBrightnessControl=1″

    “Screen” section of my xorg.conf looks like this:

    Section “Screen”
    Identifier “Screen0″
    Device “Card0″
    Monitor “Monitor0″
    DefaultDepth 24
    Option “RegistryDwords” “EnableBrightnessControl=1″
    SubSection “Display”
    Viewport 0 0
    Depth 24
    Modes “1024×768″
    EndSubSection
    EndSection

    And I’ve not seen any Fan related issues in general. What problem are you facing?

  5. 5 Abhijit said at 5:04 pm on June 15th, 2013:

    I had tried the RegistryDWords option, but it does not seem to be working with Intel Graphics. Sysctl for controlling brightness does not work either.
    The problem with fan is that it is on all the time and never stops.
    Even though acpi_ibm module is loaded, I could not find any sysctl for fan control. My older thinkpad T61 had that sysctl too.

    Anyways… Thanks for the help…


Leave a Reply