StuRa:Install-Party/FreeBSD

Aus Wiki StuRa HTW Dresden
Zur Navigation springen Zur Suche springen

FreeBSD 8.1/9.0 on ThinkPad X60[Bearbeiten]

This posting has information relating to FreeBSD 8.1 / FreeBSD 8.2 on the Lenovo Thinkpad X60 and getting things working. I will update this post as things change and new information is available.

First things first. I chose the i386 netinstall .iso as I have the Core Duo CPU which doesn’t support x64. I also like newest packages, so I prefer to install from the network. I have the X6 UltraBase, so I was able to use a CD boot as opposed to worrying about a USB.

Once I fired up the CD, I chose “Custom install” as I want to know what’s going on. Under “Distributions” I chose: base, kernels, man, proflibs, src (all of it), ports, local. Of course, you may select whatever feels right to you. Commit the changes and let the installation do its thing. After it’s finished, you may want to add some packages, however, I prefer to compile from /usr/ports/ as opposed to using binaries. Your call.

I like to install vim prior to doing anything. You can get it from /usr/ports/editors/vim. Now we can begin the fun stuff. I don’t like sitting next to a router, so I configure wifi first.

ACPI[Bearbeiten]

Suspend to RAM is buggy in 8. Goes to sleep but doesn’t resume. I have commented related lines. You may experiment with them.

Edit /boot/loader.conf

acpi_ibm_load=”YES”

If you wish to build it directly into a custom kernel, add these lines to the kernel configuration (worked with 9.0)

device acpi_ibm

Next, edit /etc/sysctl.conf and add the following

hw.acpi.reset_video=1
hw.acpi.power_button_state=S5
hw.acpi.verbose=1
hw.syscons.sc_no_suspend_vtswitch=0
dev.acpi_ibm.0.events=1

If you want to experiment with resume/suspend, you can also add the following to /etc/devd.conf

notify 10 {
match “system” “ACPI”;
match “subsystem” “IBM”;
match “notify” “0×04";
action “/usr/sbin/acpiconf -s 3";
};

Power saving[Bearbeiten]

Enable CPU throttling in /boot/loader.conf

cpufreq_load=”YES”

If you wish to build it directly into a custom kernel, add these lines to the kernel configuration (worked with 9.0 default)

device cpufreq

Then in /etc/rc.conf

powerd_enable=”YES”
powerd_flags=”-a hiadaptive -b adaptive”

-a is for AC power, -b is for battery power

Sound[Bearbeiten]

To get the sound to work properly, add the following module to /boot/loader.conf

snd_hda_load=”YES”

If you wish to build it directly into a custom kernel, add these lines to the kernel configuration (worked with 9.0 default)

device sound
device snd_hda

To disable the speaker beep, add the following to /etc/sysctl.conf

hw.syscons.bell=0

Use $ mixer to see current sound settings. I like to set

$ mixer vol 90:90
$ mixer pcm 90:90

and then just control volume with hardware buttons.

Wireless[Bearbeiten]

Edit the following files to get Intel PRO/Wireless 3945ABG working under FreeBSD. These examples use WPA as it is most work to setup.

  1. vim /etc/rc.conf
wlans_wpi0=”wlan0?
ifconfig_wlan0=”WPA DHCP “
  1. vim /boot/loader.conf
legal.intel_wpi.license_ack=1
wpifw_load="YES"
if_wpi_load="YES"
firmware_load="YES"
wlan_amrr_load="YES"

Next, I generate my WPA passphrase and modify the wpa_supplicant file which holds WPA configuration:

# wpa_passphrase ESSIDNAME “password” >> /etc/wpa_supplicant.conf
# vim /etc/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
ap_scan=1
fast_reauth=1

network={
ssid=”network”
scan_ssid=1
proto=WPA
psk=PREVIOUSLY_GENERATED_KEY
}
# join free open networks
network={
       key_mgmt=NONE
       priority=0
}

I add scan_ssid=1 because my essid is hidden (no broadcast). Wireless is now setup.

Don't forget to startup your physical and virtual wlan adapter.

eduroam[Bearbeiten]

Meine /etc/wpa_supplicant.conf hat (anteilig) folgenden Eintrag:

ctrl_interface=/var/run/wpa_supplicant

network={
 ssid="eduroam"
## priority
### Mein Halbwissen: Kann benutzt werden, um die Priorität des Netzwerkes festzulegen. Die Priorität legt fest,
### wie die Reihenfolge der Netzwerke ist, die zum erfolgreichen Verbinden mit einem Netzwerk abgearbeitet wird.
### Jedoch müsste es auch auskommentieren (mit # als erstes Zeichen der Zeile) funktionieren.
### Die Priorität wird bei PC-BSD automatisch mit eingetragen. Der Wert beim Eintrag des ersten Netzwerkes
### beträgt ''145''. Die kommenden erhalten den ''geringsten Wert'' -1''.
 priority=145
## scan_ssid
### Mein Halbwissen: Kann benutzt werden, um die Suche nach dem Netzwerk festzulegen. Der Wert ''0'' lehnt das ab.
### Der Wert ''1'' lässt das zu. Jedoch müsste es auch auskommentieren (mit # als erstes Zeichen der Zeile)
### funktionieren.
### Das Scanning wird bei PC-BSD automatisch mit ''1'' eingetragen.
 scan_ssid=1
 proto=WPA
 key_mgmt=WPA-EAP
 eap=TTLS
 identity="XXXXX@htw-dresden.de"
## anonymous_identity
### Mein Halbwissen: Kann fuer das Tunneln mit EAP benutzt werden.
### Wahrscheinlich bedarf es der Angabe der anonymen Identitaet nur bei der Anwendung an anderen Hochschulen.
## anonymous_identity="anonymous@domain"
 password="XXXXX"
## ca_cert
### Mein Halbwissen: Definiert den Pfad mit Dateiname des (lokalen) Ablageortes zum notwendigen Zertifikat.
### Offensichtlich bedarf es (aber) keinem Zertifikat. Daher muss die gesamte Zeile (mit # als erstes Zeichen der
### Zeile) auszukommentieren oder entfernt werden. Nur keinen Ablageort einzutragen ist unasreichend.
# ca_cert=""
 phase2="auth=PAP"
}

Getestet ist die Nutzung an unserer HTW Dresden und an der TU Dresden.

Video[Bearbeiten]

My main concern was video. X60 has Intel Graphics Media Accelerator 950. Luckily, latest driver combine with FreeBSD 8.1 gives no problems. Get the driver from /usr/ports/x11-drivers/xf86-video-intel/.

Xorg[Bearbeiten]

If you didn’t install Xorg during FreeBSD setup, now is the time to do it. The next sections explain how to get various things working properly. I had mostly everything working without xorg.conf file. You might have to edit the file to add things so you can generate it and edit to your preference. I didn’t have to use one, but you might want to.

# Xorg -configure
# mv /root/xorg.conf.new /etc/X11/xorg.conf

The handbook suggest you enable hal and dbus. I had to in order to get my mouse and keyboard to respond.

  1. vim /etc/rc.conf
hald_enable=”YES”
dbus_enable=”YES”
Keyboard[Bearbeiten]

Set the Keyboardlayout to German in Xorg

Worked in FreeBSD 9.0 Create in /usr/local/etc/hal/fdi/policy a file named x11-input.fdi and write in

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
<device>
 <match key="info.capabilities" contains="input.keyboard">
  <merge key="input.x11_options.XkbModel" type="string">pc105</merge>
  <merge key="input.x11_options.XkbLayout" type="string">de</merge>
 </match>
</device>
</deviceinfo>

Set the Keyboardlayout to German on FreeBSD Console

  1. vim /etc/rc.conf
font8x16="iso-8x16"
font8x14="iso-8x14"
font8x8="iso-8x8"
keymap="german.iso"

Trackpad scrolling[Bearbeiten]

This is the easiest and fastest way to get middle button wheel emulation so you can scroll. In /etc/rc.conf

moused_enable=”YES”
moused_flags=”-V”

Worked in FreeBSD 9.0 Create in /usr/local/etc/hal/fdi/policy a file named x11-input.fdi and write in

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
 <device>
  <match key="info.capabilities" contains="input.mouse">
   <merge key="input.x11_options.GrabDevice" type="string">False</merge>
   <merge key="input.x11_options.EmulateWheel" type="string">True</merge>
   <merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
   <merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
   <merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
  </match>
 </device>
</deviceinfo>

Fonts[Bearbeiten]

I add some fonts as I like things to look nicely. In my install I added /usr/local/lib/X11/fonts/TrueType/, /usr/local/lib/X11/fonts/webfonts/, /usr/local/lib/X11/fonts/xorg-font-cyrillic/. Then I modify xorg.conf to add

Modules
Load “freetype”
Files
FontPath “/usr/local/lib/X11/fonts/webfonts/

Flash[Bearbeiten]

worked on 9.0

As you know, native flash support is not available in FreeBSD still. You may speed things up by clicking on the links in the top right corner of the website to sign the petition and vote up the bug report on Adobe website.

We can get flash working with Linux emulation. My setup was straightforward.

Edit /etc/rc.conf:

linux_enable="YES"

Install:

  • general:
/usr/ports/emulators/linux_base-f10/
/usr/ports/www/linux-f10-flashplugin10/ or linux-f10-flashplugin11/
  • Ports for Opera:
/usr/ports/www/opera/
/usr/ports/www/opera-linuxplugins/

I didn’t have to add any path in Opera or setup any symlinks to get flash working.

  • Ports for Firefox:
www/nspluginwrapper
    • continue:

exec

nspluginwrapper -v -a -i

edit fstab

linproc /compat/linux/proc linprocfs rw  0   0

I'm not need it: Putting a link of libflashplayer.so to /usr/local/lib/firefox/plugins and ~/.mozilla/plugins directories and running nspluginwrapper again.

Card Reader[Bearbeiten]

I was able to get card reader working with an SD card in KDE with the following enabled in /boot/loader.conf

mmc_load=”YES”
mmcsd_load=”YES”   #für SD
sdhci_load="YES"   #für SDHC Cards

If you wish to build it directly into a custom kernel, add these lines to the kernel configuration (worked with 9.0)

device        mmc
device        mmcsd
device        sdhci

Bluetooth disable[Bearbeiten]

I like to hardware disable bluetooth so I get longer battery life. Once IBM acpi is loaded, I can Fn+F5. It will switch on and off the bluetooth without touching wireless (I don’t know if it’s a bug or not, but this works better for me rather than shuffling through wifi as well).

Communication[Bearbeiten]

mcabber[Bearbeiten]
  • patch mcabber for using libotr v4
    • fetch files from OpenBSD git repository the patches
https://github.com/toddfries/OpenBSD-ports-patches/tree/2dc03c301749b462889226d4b738cd07773623ee/net/mcabber
  • rewrite filenames

patch-configure_ac   -->   patch-configure.ac
patch-mcabber_otr_c  -->   patch-mcabber_otr.c
patch-mcabber_otr_h  -->   patch-mcabber_otr.h

and move them to ${PORTDIR}/net-im/mcabber/files/

additionaly I had modify my "Makefile"

Makefile

use only libotr v4


LIB_DEPENDS+=	otr.4:${PORTSDIR}/security/libotr3   -->   LIB_DEPENDS+=	otr:${PORTSDIR}/security/libotr

Dienste[Bearbeiten]

Verwaltung von Diensten mit sysrc[Bearbeiten]
"der Standard"

man:sysrc

WLAN[Bearbeiten]

Hardware für WLAN[Bearbeiten]

Bei pciconf mal nach wifi suchen.

pciconf -lv | grep -i wifi

einzelne Treiber für WLAN[Bearbeiten]

Treiber urtwn[Bearbeiten]

etwa beim Thinkpad L530

pciconf -lv | grep -i wifi
    device     = 'RTL8188CE 802.11b/g/n WiFi Adapter'
$EDITOR /boot/loader.conf

if_urtwn_load="YES"
legal.realtek.license_ack=1

reboot

nette Gefälligkeiten[Bearbeiten]

automatische Vervollständigung einschalten[Bearbeiten]

automatische Vervollständigung einschalten bei zsh[Bearbeiten]
Eintragungen bei der Datei für die persönlichen Einstellungen für zsh[1]
$EDITOR ~/.zshrc

autoload -U compinit
compinit

automatische Vervollständigung einschalten bei bash[Bearbeiten]
Eintragungen bei der Datei für die persönlichen Einstellungen für bash
$EDITOR ~/.bash

if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi

wenn mal wer umzieht[Bearbeiten]

Sachen packen[Bearbeiten]

… Ich packe meinen Koffer und nehme mit …

Dinge, die Mensch wohl gern mitnehmen möchten:

Datei bzw. Ordner üblicher Ort Zweck
wpa_supplicant.conf /etc/wpa_supplicant.conf Verwaltung von Zugängen für Netzwerkverbindungen (insbesondere auch für Passwörter für drahtlose Netzwerke)

Umzugsservice[Bearbeiten]

Umziehen von einem Pool von ZFS[Bearbeiten]

Dank ZFS kann Umziehen richtig einfach sein.

Es kann ein jeder Pool in einem Dataset eines externen Pools zwischengespeichert werden.

Weblinks[Bearbeiten]