StuRa:Install-Party/FreeBSD: Unterschied zwischen den Versionen

Aus Wiki StuRa HTW Dresden
Zur Navigation springen Zur Suche springen
 
Zeile 1: Zeile 1:
FreeBSD 8.1 on ThinkPad X60
=== FreeBSD 8.1 on ThinkPad X60 ===


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.
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.
Updated: 1-3-2011 This guide works for FreeBSD 8.2 as well.
Updated: 23-2-2011 (bluetooth disable)
Updated: 6-2-2011 (fixed sound section typo, thanks Markand + wireless update)
Updated: 27-1-2011 (card reader, wireless, power saving)


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.
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.
Zeile 17: Zeile 9:
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.
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
==== ACPI ====


Suspend to RAM is buggy in 8. Goes to sleep but doesn’t resume. I have commented related lines. You may experiment with them.
Suspend to RAM is buggy in 8. Goes to sleep but doesn’t resume. I have commented related lines. You may experiment with them.
Zeile 23: Zeile 15:
Edit /boot/loader.conf
Edit /boot/loader.conf


acpi_ibm_load=”YES”
acpi_ibm_load=”YES”


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


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


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


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




Power saving
==== Power saving ====


Enable CPU throttling in /boot/loader.conf
Enable CPU throttling in /boot/loader.conf


cpufreq_load=”YES”
cpufreq_load=”YES”


Then in /etc/rc.conf
Then in /etc/rc.conf


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


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


Sound
==== Sound ====


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


snd_hda_load=”YES”
snd_hda_load=”YES”


If you wish to build it directly into a custom kernel, add these lines to the kernel configuration
If you wish to build it directly into a custom kernel, add these lines to the kernel configuration


device sound
device sound
device snd_hda
device snd_hda


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


hw.syscons.bell=0
hw.syscons.bell=0


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


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


and then just control volume with hardware buttons.
and then just control volume with hardware buttons.




Wireless
==== Wireless ====


Edit the following files to get Intel PRO/Wireless 3945ABG working under FreeBSD. These examples use WPA as it is most work to setup.
Edit the following files to get Intel PRO/Wireless 3945ABG working under FreeBSD. These examples use WPA as it is most work to setup.
Zeile 85: Zeile 77:
# vim /etc/rc.conf
# vim /etc/rc.conf


wlans_wpi0=”wlan0?
wlans_wpi0=”wlan0?
ifconfig_wlan0=”WPA DHCP “
ifconfig_wlan0=”WPA DHCP “


# vim /boot/loader.conf
# vim /boot/loader.conf


if_wpi_load=”YES”
if_wpi_load=”YES”


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


# wpa_passphrase ESSIDNAME “password” >> /etc/wpa_supplicant.conf
# wpa_passphrase ESSIDNAME “password” >> /etc/wpa_supplicant.conf
# vim /etc/wpa_supplicant.conf
# vim /etc/wpa_supplicant.conf
 
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
ctrl_interface_group=wheel
ap_scan=1
ap_scan=1
fast_reauth=1
fast_reauth=1
 
network={
network={
ssid=”network”
ssid=”network”
scan_ssid=1
scan_ssid=1
proto=WPA
proto=WPA
psk=PREVIOUSLY_GENERATED_KEY
psk=PREVIOUSLY_GENERATED_KEY
}
}


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




Video
==== Video ====


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/.
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
==== Xorg ====


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.
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
# Xorg -configure
# mv /root/xorg.conf.new /etc/X11/xorg.conf
# 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.
The handbook suggest you enable hal and dbus. I had to in order to get my mouse and keyboard to respond.
Zeile 128: Zeile 120:
# vim /etc/rc.conf
# vim /etc/rc.conf


hald_enable=”YES”
hald_enable=”YES”
dbus_enable=”YES”
dbus_enable=”YES”




Trackpad scrolling
==== Trackpad scrolling ====


This is the easiest and fastest way to get middle button wheel emulation so you can scroll. In /etc/rc.conf
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_enable=”YES”
moused_flags=”-V”
moused_flags=”-V”




Fonts
==== Fonts ====


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
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
Modules
Load “freetype”
Load “freetype”
Files
Files
FontPath “/usr/local/lib/X11/fonts/webfonts/
FontPath “/usr/local/lib/X11/fonts/webfonts/




Flash
==== Flash ====


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.
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.
Zeile 156: Zeile 148:
We can get flash working with Linux emulation. My setup was straightforward. I use Opera so my setup was in this order:
We can get flash working with Linux emulation. My setup was straightforward. I use Opera so my setup was in this order:


/usr/ports/emulators/linux_base-f10/
/usr/ports/emulators/linux_base-f10/
/usr/ports/www/opera/
/usr/ports/www/opera/
/usr/ports/www/opera-linuxplugins/
/usr/ports/www/opera-linuxplugins/
/usr/ports/www/linux-f10-flashplugin10/
/usr/ports/www/linux-f10-flashplugin10/


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


Card Reader
==== Card Reader ====


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


mmc_load=”YES”
mmc_load=”YES”
mmcsd_load=”YES”
mmcsd_load=”YES”
 


Bluetooth disable
==== Bluetooth disable ====


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).
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).
Fin

Version vom 24. Januar 2012, 05:49 Uhr

FreeBSD 8.1 on ThinkPad X60

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

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”

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

Enable CPU throttling in /boot/loader.conf

cpufreq_load=”YES”

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

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

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

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
if_wpi_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
}

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


Video

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

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”


Trackpad scrolling

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”


Fonts

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

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. I use Opera so my setup was in this order:

/usr/ports/emulators/linux_base-f10/
/usr/ports/www/opera/
/usr/ports/www/opera-linuxplugins/
/usr/ports/www/linux-f10-flashplugin10/

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

Card Reader

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

mmc_load=”YES”
mmcsd_load=”YES”

Bluetooth disable

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).