分类: BSD
2008-09-28 14:45:53
Source:
$Id: installEeePC.txt,v 1.8 2008/08/06 09:13:36 guru Exp $
How I have installed FreeBSD 7.0-RELEASE in the Asus eeePC 900
1. Installing the system itself
First prepare an USB key with:
- a booting FreeBSD 7.0R
- the tree of the disk1 below /disk1, as minimum:
disk1/7.0-RELEASE
disk1/packages
How to do this is documented on Internet already, see for example:
The eeePC 900 comes with two separate SSD's which will show up
in FreeBSD as
/dev/ad2 (4 GByte)
/dev/ad3 (16 GByte)
even if you can boot /dev/ad3 from the boot-monitor (press ESC after power-on),
it seems that the BIOS by its own can only boot from the first SSD, the
so called OB (on board) SSD; so we will install the system in /dev/ad2;
create a new partition table on /dev/ad2 with a default slice 1 and make it
boot-able:
# fdisk -BI /dev/ad2
(ignore any errors)
label it for booting freebsd:
# bsdlabel -wB /dev/ad2s1
edit the disk label and change partition a from "unused" to "4.2BSD"
as partition type:
# setenv EDITOR /usr/bin/vi
# bsdlabel -e /dev/ad2s1
create the future root-filesystem on it and mount it to /mnt for the
installation:
# newfs -m 0 -o space /dev/ad2s1a
# mount /dev/ad2s1a /mnt
install freebsd into /mnt; this assumes that you have copied the FreeBSD
distribution into your USB key below /disk1/7.0-RELEASE:
# setenv DESTDIR /mnt
# cd /disk1/7.0-RELEASE
# cd base
# ./install.sh
You are about to extract the base distribution into /mnt - are you SURE
you want to do this over your installed system (y/n): y
# cd ../manpages
# ./install.sh
# cd ../catpages
# ./install.sh
go to the kernels directory and install a kernel of your choice:
[default is GENERIC kernel; change to "smp" for smp-machines]
# rmdir /mnt/boot/kernel
# cd ../kernels;
# cat generic.?? | tar --unlink -xpzf - -C /mnt/boot
# cd /mnt/boot
# mv GENERIC kernel
now, tell FreeBSD to mount later the correct root-filesystem:
# echo "/dev/ad2s1a / ufs rw,noatime 1 1" >/mnt/etc/fstab
create your rc.conf.local in /mnt/etc to redefine some settings:
# cat </mnt/etc/rc.conf.local
#!/bin/sh
tmpmfs="YES"
tmpsize="128m"
hostname="tiny"
keyrate="fast"
EOFRCCONF
# chmod 0755 /mnt/etc/rc.conf.local
set a new root password manually, if you want (default="")
# chroot /mnt /usr/bin/passwd root
unmount the new root /mnt and reboot the eeePC:
# cd
# umount /mnt
# reboot
when the system comes up again, use 'sysinstall' for installation of Xorg
mount the USB key as:
# mount -o ro /dev/da0s1a /mnt
2. Installation and configuration of Xorg and KDE
# sysinstall-->Configure-->Distributions-->X.org
from installation media 'File System' and pointed to /mnt/disk1; again
this assumes that you have copied the FreeBSD distribution into your USB
key below /disk1/packages:
remove the package 'xf86-video-i810-1.6.5_3' and install correct video drivers
for the Intel chip-set; the package must be pulled from FreeBSD web sites, i.e.
it is not part of the default 7.0-R distribution CD:
# pkg_delete -f xf86-video-i810-1.6.5_3
# cd /mnt/eeePC
# pkg_add xf86-video-intel-2.1.1.tbz
login again to refresh the PATH only
use 'sysinstall' to activate the mouse daemon and configure the X server:
# Xorg -configure
before deleting the Linux on the eeePC I saved the original xorg.conf
and merged the Monitor section into the generated xorg.conf as:
Section "Monitor"
Identifier "Monitor0"
VendorName "ASUS"
ModelName "Eee PC P900"
Modeline "1024x600" 48.96 1024 1064 1168 1312 600 601 604 622 -HSync +Vsync
EndSection
# cp xorg.conf.new /etc/X11/xorg.conf
adjust /etc/rc.conf file with to reduce write cycles to the SSD:
syslogd_enable="NO"
sendmail_enable="NONE"
cron_enable="NO"
newsyslog_enable="NO"
adjust /boot/loader.conf file with:
snd_hda_load="YES"
on the second disk /dev/ad3 I created one big file system and mounted this as /usr/home;
on my 'normal' laptop with the same FreeBSD version I've created packages of all
ports I have installed on this, around 640 ports which are in packages around
1.2 GByte; I moved them with the USB key (network was not yet up in this moment)
to /usr/home/PKGDIR and installed the KDE environment (and all other stuff) just with:
# cd /usr/home/PKGDIR
# pkg_add kde-3.5.8.tbz
3. The wireless NIC
There is a patch from 'madwifi' for the HAL needed by the Atheos card, see:
and:
but I have used Sam's HAL from ~sam
you have to CVS update the kernel to RELANG_7 (at least); as well change
the kernel so that 'if_ath' is not compiled into the kernel, but as a
loadable if_ath.ko file; before compiling update 'ath' by Sam's archive
ath_hal-20080528.tgz:
# cd /usr/src/sys/contrib/dev
# mv ath ath.RELENG_7
# tar xzf ~guru/myThings/FreeBSD/eeePC/ath_hal-20080528.tgz
# mv ath_hal-20080528 ath
# vi /usr/src/sys/i386/conf/REBELION
...
# cd /usr/src/sys/i386/compile/REBELION
# make depend
# make
# make install
# cd /boot
# mv kernel kernel.sam-hal
# mv kernel.old kernel
# tar czf ~guru/myThings/FreeBSD/eeePC/kernel.sam-hal.tar.gz kernel.sam-hal
move over the tar'ed kernel to the eeePC and unpack it there into /boot:
and rename it correctly:
# cd /boot
# mv kernel kernel.old
# tar xzf ....../kernel.sam-hal.tar.gz
# mv kernel.sam-hal kernel
put the load of the kernel module into /boot/loader.conf
acpi_asus_load="YES"
if_ath_load="YES"
4. devd(8) hooks for IF_UP / IF_DOWN and power-off/on of the NIC
as well I moved from my normal laptop the /etc/wpa_supplicant.conf and the
devd(8) hooks from /usr/local/etc/devd/*
the ath0 comes up and works normaly with 'wpa_supplicant' and the hooks
in devd(8) on IF_UP / IF_DOWN
here are the bits /usr/local/etc/devd/ath.conf
+-----snipp-------------------------------------------------+
notify 1 {
match "system" "ACPI";
action "/usr/local/etc/devd/ath.sh $system $subsystem $notify";
};
notify 1 {
match "system" "IFNET";
match "subsystem" "ath0";
match "type" "LINK_UP";
action "/usr/local/etc/devd/ath.sh $system $subsystem $type";
};
notify 1 {
match "system" "IFNET";
match "subsystem" "ath0";
match "type" "LINK_DOWN";
action "/usr/local/etc/devd/ath.sh $system $subsystem $type";
};
+-----snipp-------------------------------------------------+
and /usr/local/etc/devd/ath.sh
+-----snipp-------------------------------------------------+
#!/bin/sh
#
# $1: system ACPI, IFNET, ...
# $2: subsystem: ath0 for system ACPI
# ASUS-Eee for system ACPI
# $3: type/notify: LINK_UP/LINK_DOWN for IFNET+ath0
# 0x11 (off) 0x10 (on) for ACPI+ASUS-Eee
# see also ath.conf
echo `date`: $0 $* >> /tmp/devd.out
case $1 in
'ACPI')
case $3 in
# Fn+F2
0x10)
echo "Wlan On" > /dev/console &
kldload if_ath
;;
0x11)
echo "Wlan Off" > /dev/console &
kldunload if_ath
;;
esac
exit 0 ;
;;
esac
case $3 in
'LINK_DOWN')
killall dhclient ;
exit 0 ;
;;
esac
case $3 in
'LINK_UP')
ap=`/sbin/ifconfig ath0 list sta | awk '{print $1;}' | fgrep -v ADDR`
case ${ap} in
'xx:xx:xx:xx:xx:xx')
printf "ap [%s] seems to be the OH office\n" "${ap}" >> /tmp/devd.out ;
ifconfig ath0 -bgscan
dhclient ath0
;;
*)
printf "ap [%s] not known in %s\n" "${ap}" $0 >> /tmp/devd.out ;
;;
esac
exit 0
;;
esac
exit 0
+-----snipp-------------------------------------------------+
having 'if_ath' as a loadable kernel module you may switch the wireless
NIC off with ``Fn+F2´´ and switch it on again; Note: switch it on again brings
the if_ath only correctly in function if the system was booted with
the wireless NIC turned on; so it is a good advice to switch it always on
before shutdown or re-boot.
5. Additional configrations to save the lifetime of SSD
after installation of base, Xorg and KDE the disk space is like this:
# df -kh
Filesystem Size Used Avail Capacity Mounted on
/dev/ad2s1a 3.6G 2.1G 1.5G 58% /
/dev/ad3s1a 15G 1.3G 13G 9% /usr/home
/dev/md0 124M 46K 114M 0% /tmp
i.e. maybe we must later put all /usr/local stuff into /usr/home with
a sym link.
a. additional things to get rid of log files in SSD or other unnesessary
writes which steal lifetime of the SSD:
# mv /var/log /var/log.old
# ln -s /tmp /var/log
b. set in /etc/login.conf coredumpsize=0 and run
# cap_mkdb /etc/login.conf
c. disable caching in the web browser(s)
d. if you edit a lot of text with vim(1) shift the backup's done by vim(1) to
the memory /tmp file system, in ~/.vimrc:
set backupdir=/tmp
set dir=/tmp
e. mount all SSD hosted file systems with 'noatime'
6. The wired NIC
the wired NIC Attansic L2 FastEthernet "ae0" works with the driver from
I have compiled it and have it in ~/if_ae.ko just for the case I need to
load it (or load it at boot with an entry in /boot/loader.conf);
7. UMTS for accessing the Internet
The USB HSDPA modem from Huawei, the E220, is supported; you need
patches from cgi/query-pr.cgi?pr=usb/118686
and you have to remove 'umass' from the kernel and make it loadable at
boot time in /boot/loader.conf; note: 'ubsa' must be loaded before 'umass'
so it sees the card first on attach:
ubsa_load="YES"
umass_load="YES"
now my card says in a terminal (kermit) about itself:
ati2
Manufacturer: huawei
Model: E220
Revision: 11.117.09.04.00
IMEI: xxxxxxxxxxxxxxxx
+GCAP: +CGSM,+DS,+ES
OK
the bits for PPP are:
/etc/ppp/peers/huawei:
+-----snipp-------------------------------------------------+
cuaU0 230400 crtscts
connect '/usr/bin/chat -v -f /etc/ppp/chat-huawei ; \
sleep 5'
name UMTS_CHAP_SRVR
noipdefault
:10.64.64.64
novj
noccp
defaultroute
ipcp-max-configure 20
ipcp-max-failure 20
ipcp-max-terminate 20
ipcp-accept-local
ipcp-accept-remote
debug
+-----snipp-------------------------------------------------+
and /etc/ppp/chat-huawei:
+-----snipp-------------------------------------------------+
'' AT
#
# We can not send down the PIN twice, it gives 'ERROR' 2nd time;
# so we're just especting an 'O' as response which is part of 'OK'
# and 'ERROR' as well, what a dirty hack. :-((
#
OK\r at+cpin="XXXXXXX"
O AT+CGDCONT=1,"IP","web.vodafone.de"
OK\r ATD*99***1#
CONNECT
+-----snipp-------------------------------------------------+
Having done this you just bring up the Internet with
# pppd call huawei
8. Other stuff to test or which does not work yet
UVC cam:
the (deleted) Linux saw the on board video cam with these messages:
[ 11.540000] Linux video capture interface: v2.00
[ 11.560000] uvcvideo: Found UVC 1.00 device CNF7129 (04f2:b071)
[ 11.690000] usbcore: registered new interface driver uvcvideo
[ 11.690000] USB Video Class driver (SVN r2008.02.27)
the vendorID 0x04f2 points to ""Chicony Electronics Co., Ltd."
and perhaps is that item:
actually there is no support
there is a project about UVC cams in NetBSD, see:
UMTS cards:
other UMTS card, whci might be supported (not yet tested):
usb/122621: New driver for Sierra Wireless 3G USM modem 875U
for the touchpad there is a better driver as (not yet tested):
Touchpad driver:
Touchpad (synaptics) configuration
Disable moused in rc.conf
Add hw.psm.synaptics_support=1 to loader.conf
pkg_add -r synaptics and edit Xorg.conf according to synaptic's pkg-message
(the pkg could be compiled from the ports but will pull the whole Xorg-server)
Port: ksynaptics-0.3.1_1
Path: /usr/ports/sysutils/ksynaptics
Info: KDE control center module for Synaptics touchpads