$Id: installEeePC.txt,v 1.17 2009/12/30 13:18:10 guru Exp $ How I have installed FreeBSD 8-CURRENT in the Asus EeePC 900 1. Installing the system itself First prepare an USB key with: a booting FreeBSD 8-CURRENT on it and having a compiled kernel below /usr/src and /usr/obj, ready to 'make installworld' and 'make installkernel'; this is pretty much simple if you have another CURRENT up and well documented, for example here: http://bsdimp.blogspot.com/2007/10/building-bootable-freebsdi386-images.html 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 -I /dev/ad2 # fdisk -B /dev/ad2 (ignore any errors) label it for booting freebsd: # bsdlabel -w ad2s1 auto # bsdlabel -B ad2s1 edit the disk label and change partition "a" from "unused" to "4.2BSD" as partition type: # setenv EDITOR /usr/bin/vi # bsdlabel -e 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 the kernel and userland in /usr/src and /usr/obj ready to be installed; # cd /usr/src # make installworld DESTDIR=/mnt # make installkernel DESTDIR=/mnt KERNCONF=GENERIC INSTALL_NODEBUG=t # make distrib-dirs DESTDIR=/mnt # make distribution DESTDIR=/mnt 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 for the first reboot (complete file see below): # cat </mnt/etc/rc.conf.local #!/bin/sh tmpmfs="YES" tmpsize="128m" hostname="tiny" keyrate="fast" wlans_ath0="wlan0" ifconfig_wlan0="WPA DHCP" sshd_enable="YES" EOFRCCONF # chmod 0755 /mnt/etc/rc.conf.local set a new root password manually, if you want (default="") # chroot /mnt /usr/bin/passwd root # cp /etc/wpa_supplicant.conf /mnt/etc unmount the new root /mnt and reboot the eeePC: # cd # umount /mnt # reboot 2nd SSD: on the second disk /dev/ad3 I created one big file system and mounted this as /usr/local which contains also my HOME as /usr/local/guru now; # dd if=/dev/zero of=/dev/ad3 count=2 # fdisk -I /dev/ad3 # newfs -m 0 -o space /dev/ad3s1a # echo "/dev/ad3s1a /usr/local ufs rw,noatime 1 1" >> /etc/fstab # mount /usr/local 2. Installation and configuration of Xorg and KDE As well in some other (and faster) machine I have already compiled all the /usr/ports stuff I'm used to use and have created installable packages from them like: # mkdir /PKGDIR-CURRENT # pkg_create -Rnb xorg-7.4.tbz # pkg_create -Rnb kde-3.5.10_1.tbz ... move all this with the USB key to the eeePC and just install whatever you have fun from; # mount -o ro /dev/da0s1a /mnt # cp -Rp /mnt/PKGDIR-CURRENT / # umount /mnt run sysinstall to enable the mouse daemon and reboot; now install Xorg: # cd /PKGDIR-CURRENT # pkg_add xorg-7.4.tbz # pkg_add kde-3.5.10_1.tbz # pkg_add es-kde-i18n-3.5.10.tbz # pkg_add es-koffice-i18n-1.6.3.tbz # Xorg -configure add the line: Option "AllowEmptyInput" "false" to the Section "ServerLayout" in /root/xorg.conf.new and merge in as well the Monitor section (saved from the Tandros Linux): 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 enable (load) sound on next re-boot: snd_hda_load="YES" other desktop related stuff: /etc/sysctl.conf: compat.linux.osrelease=2.6.16 /etc/fstab: linproc /compat/linux/proc linprocfs rw 0 0 # mount /compat/linux/proc # /etc/rc.d/abi start # /etc/rc.d/sysctl start # pkg_add stardict-3.0.1.tbz # pkg_add skype-2.0.0.72,1.tbz # pkg_add firefox-3.0.7,1.tbz # pkg_add bash-3.2.48_1.tbz # pkg_add vim-7.2.132.tbz # pkg_add ispell-3.3.02_4.tbz # pkg_add lsof-4.82E,3.tbz # pkg_add lynx-2.8.6.5_5,1.tbz # pkg_add xbatt-1.2.1_1.tbz # pkg_add kdenetwork-kopete-0.12.8_1.tbz # pkg_add tangogps-0.9.6.tbz # pkg_add -f kdepim-3.5.8.tbz (from RELENG_7) # pkg_add xv-3.10a_7.tbz # pkg_add linux-flashplugin-9.0r159.tbz # pkg_add nspluginwrapper-1.2.2_2.tbz # pkg_add linux_base-f8-8_11.tbz # pkg_add mplayer-0.99.11_11.tbz (from RELENG_7) # pkg_add mplayerplug-in-3.55_1.tbz # pkg_add kmplayer-0.10.0c_2,2.tbz # pkg_add mutt-1.4.2.3_3.tbz copy over ~/.muttrc ... # pkg_add kermit-8.0.211.tbz # pkg_add hot-babe-0.2.2_4.tbz # pkg_add evince-2.24.2.tbz # pkg_add webcopy-0.98b7.tbz # pkg_add xbattbar-1.4.2_5.tbz # pkg_add unrar-3.80,5.tbz # pkg_add wget-1.11.4.tbz # pkg_add vnc-4.1.3_1.tbz # pkg_add x11vnc-0.9.6_1.tbz # pkg_add vpnc-0.5.3_1.tbz # pkg_add tor-devel-0.2.1.12.a.tbz # pkg_add privoxy-3.0.12.tbz # pkg_add youtube_dl-2009.02.07.tbz # pkg_add chexedit-0.9.7.tbz # pkg_add lyx-1.5.7.tbz # pkg_add es-aspell-1.1_1,1.tbz # pkg_add boost-python-1.34.1.tbz (to make lyx-1.5.7 happy) # pkg_add kdeaddons-konq-plugins-3.5.10_1.tbz # pkg_add gwenview-1.4.2_4.tbz # pkg_add gwenview-i18n-1.4.2_1.tbz # pkg_add gconf-editor-2.24.1,1.tbz # pkg_add jhead-2.87.tbz # pkg_add freemind-0.8.1_1,1.tbz # pkg_add ImageMagick-6.5.0.5.tbz # pkg_add gnupg-idea-1.0.6_3.tbz # pkg_add rsync-3.0.5.tbz copy from real laptop: /usr/local/compjuga/compjuga.dat /usr/local/bin/compjuga 3. Other system changes MANPATH and whatis database: # MANPATH=/usr/share/man:/usr/local/man # export MANPATH # makewhatis now 'man -k ...' should work # man -k mysql 4. Current problems to solve actual problems to solve - high: USB network devices does not attach to ue0 via devd hook --WIP - low: X crashes on KDE exit v medium: syslogd should write to /tmp/*.log --DONE insert 'REQUIRE: tmp' in /etc/rc.d/syslogd v high: X crashes on exit --DONE terminate X with Ctrl-Alt-BS, but needs further debugging v medium: for UMTS accounting: which tunX interface uses ppp in this moment? --DONE v high: make NIC working --DONE (works out of the kernel now) v high: copy from Rebelión /usr/local/share/ispell/espanol.hash --DONE v high: install tangoGPS --DONE v low: kaddressbook not ported (PIM) --DONE v low: mplayer (stolen from RELENG_7) --DONE adjust /etc/rc.conf.local file with some special options to reduce write cycles to the SSD: #!/bin/sh tmpmfs="YES" tmpsize="128m" hostname="tiny" keyrate="fast" wlans_ath0="wlan0" ifconfig_wlan0="WPA DHCP" sshd_enable="YES" syslogd_enable="YES" syslogd_flags="-s -C" sendmail_enable="NONE" cron_enable="NO" newsyslog_enable="NO" openvpn_enable="YES" openvpn_if="tun" XXX: still todo but it seems that syslogd comes up before tmpfs is mounted!!! concerning syslogd_enable="YES": I have now set this to YES an directed the files to /tmp in the /etc/syslog.conf; so they exist at least during uptime of the system; syslogd creates them because of the flag -C 5. The Atheros wireless NIC and Atheros L2 FastEthernet In CURRENT now supported as ath0 / wlan0 interface, details see /etc/rc.conf.local As well Atheros L2 FastEthernet works with the GENERIC kernel now, just enable it in BIOS if you need it. 6. PPP and OpenVPN The USB HSDPA modem from Huawei, the E220, is supported; In CURRENT we now have to use Userland PPP; even more simple: put the user 'guru' in /etc/group in group 'network' and install a file /etc/ppp/ppp.conf (from my CVS) like this lines: /etc/ppp/ppp.conf #-------------#-------------#-------------#-------------#-------------#------------- default: set log Phase Chat LCP IPCP CCP tun command umts: # set device /dev/cuaU0 # device name in RELENG_7 set device /dev/cuaU0.0 # device name in CURRENT set speed 230400 # # change the PIN XXXX to some good value # set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \ \"\" AT OK-AT-OK ATZ OK \ AT+CFUN=1 OK \ at+cpin="XXXX" O \ AT+COPS=0 OK \ AT+CGDCONT=1,\\\"IP\\\",\\\"web.vodafone.de\\\" OK \ \\dATDT\\T TIMEOUT 40 CONNECT" set logout "ABORT BUSY ABORT ERROR TIMEOUT 30 \"\" +++ATH O ATH OK" # NAT (not used by me) # nat enable yes # alias enable yes # nat port tcp 192.168.0.0:ftp ftp # nat port tcp 192.168.0.0:http http set phone *99***1\# set authname "UMTS_CHAP_SRVR" set authkey "UMTS_CHAP_SRVR" set timeout 300 set ifaddr 0.0.0.0/0 10.64.64.64/0 255.255.255.0 0.0.0.0 add default HISADDR # Add a (sticky) default route enable dns disable ipv6cp #-------------#-------------#-------------#-------------#-------------#------------- the file should have no more then 0600 perms, i.e.: # chown root /etc/ppp/ppp.conf # chmod 0600 /etc/ppp/ppp.conf now you launch PPP from user land as: $ ppp -auto umts OpenVPN is also no problem with: # pkg_add openvpn-2.0.6_9.tbz # mkdir /usr/local/etc/openvpn copy in the key file from my CVS and start OpenVPN # /usr/local/etc/rc.d/openvpn start 7. USB networking for the Openmoko Freerunner In CURRENT for the attach we need now: # usbconfig -u 1 -a 2 set_config 1 The parameters to -u N and -a M will vary depending on which ugen device it gets detected as: ugenN.M; My EeePC gives on left slot ugen0.2 and on right slot ugen1.2 (!!!) The above usbconfig(1M) must be done *after* device attach and the interface will now show up as ue0 # ifconfig ue0 192.168.0.200 netmask 255.255.255.0 XXX: still pending devd hook for this 8. Hints and tricks Kopete fails to connect to MSN it seems that Kopete makes use of parts of Konqueror to talk HTTPS; I managed it to connect to MSN setting in Konqueror - use OpenSSL in /usr/local/lib - use SSLv2 only 9. Additional configrations to save the lifetime of SSD 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' 10. 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: http://www.chicony.com.tw/products/cm_module/cm.html actually there is no support there is a project about UVC cams in NetBSD, see: http://mail-index.netbsd.org/tech-kern/2008/07/14/msg002099.html http://netbsd-soc.sourceforge.net/projects/uvc/