$Id: installEeePC.txt,v 1.21 2012/01/08 08:48:10 guru Exp $ How I have installed FreeBSD 10-CURRENT in the Asus EeePC 900 1. Installing the system itself First prepare an USB key with: a booting FreeBSD 10-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 is 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/ada0 (4 GByte) /dev/ada1 (16 GByte) even if you can boot /dev/ada1 from the boot-menu (press ESC during power-on selftest), 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/ada0; we will use /dev/ada1 for /usr/local and place as well the users HOME there as /usr/local/guru/ let's start... create a new partition table on /dev/ada0 with a default slice 1 and make it boot-able: # fdisk -I /dev/ada0 # fdisk -B /dev/ada0 (ignore any errors) label it for booting freebsd: # bsdlabel -w ada0s1 auto # bsdlabel -B ada0s1 edit the disk label and change partition "a" from "unused" to "4.2BSD" as partition type: # setenv EDITOR /usr/bin/vi # bsdlabel -e ada0s1 create the future root-filesystem on it and mount it to /mnt for the installation: # newfs -m 0 -o space /dev/ada0s1a # mount /dev/ada0s1a /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/ada0s1a / 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 << EOF >/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" EOF # chmod 0755 /mnt/etc/rc.conf.local set a new root password manually, if you want (default="") # chroot /mnt /usr/bin/passwd root and add some unpriv user to be able to SSH into your new system once it is up: # chroot /mnt /usr/sbin/adduser if you have enriched your USB key with WPA secrets, copy them to the new system: # 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/ada1 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/ada1 count=2 # fdisk -I /dev/ada1 # newfs -m 0 -o space /dev/ada1s1a # echo "/dev/ada1s1a /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-r226986 # cd PKGDIR-r226986 # pkg_create -Rnb xorg-7.5.1 # pkg_create -Rnb kde-3.5.10_8 ... copy all this as well to the USB key to later just install whatever you have fun from; enable the mouse daemon (rc.conf.local moused_enable="YES") and start it; now install Xorg (...) from the USB key mounted as /mnt: # cd /mnt/PKGDIR-r226986 # pkg_add xorg-7.5.1.tbz # pkg_add kde-3.5.10_8.tbz # pkg_add es-kde-i18n-3.5.10_4.tbz # pkg_add es-koffice-i18n-1.6.3_4.tbz # Xorg -configure add the line: Option "AllowEmptyInput" "false" copy it over to the right place and start KDE # cp xorg.conf.new /etc/X11/xorg.conf 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 time to add more application packages, for example: # pkg_add stardict-3.0.1_5.tbz # pkg_add stardict-3.0.3.tbz # pkg_add skype-2.1.0.81,1.tbz # pkg_add firefox-3.6.24,1.tbz # pkg_add bash-4.1.11.tbz # pkg_add vim-7.3.121.tbz # pkg_add ispell-3.3.02_5.tbz # pkg_add lsof-4.86A,6.tbz # pkg_add lynx-2.8.7.1_1,1.tbz # pkg_add xbatt-1.2.1_1.tbz # pkg_add kdenetwork-kopete-0.12.8_5.tbz # pkg_add tangogps-0.99.4_1.tbz # pkg_add kdepim-3.5.10_10.tbz # pkg_add xv-3.10a_14.tbz # pkg_add nspluginwrapper-1.4.4.tbz # pkg_add linux_base-f10-10_4.tbz # pkg_add mplayer-1.0.r20110329_3.tbz # pkg_add mplayer-skins-1.1.2_6.tbz # pkg_add kmplayer-0.10.0c_6,2.tbz # pkg_add mutt-devel-1.5.21_3.tbz # pkg_add kermit-9.0.302.tbz # pkg_add hot-babe-0.2.2_7.tbz # pkg_add evince-2.32.0_6.tbz # pkg_add webcopy-0.98b7.tbz # pkg_add xbattbar-1.4.2_6.tbz # pkg_add unrar-4.00,5.tbz # pkg_add wget-1.13.4_1.tbz # pkg_add vnc-4.1.3_4.tbz # pkg_add x11vnc-0.9.13.tbz # pkg_add vpnc-0.5.3_6.tbz # pkg_add tor-devel-0.2.3.7.a.tbz # pkg_add privoxy-3.0.17.tbz # pkg_add youtube_dl-2011.10.19.tbz # pkg_add chexedit-0.9.7.tbz # pkg_add lyx-2.0.1.tbz # pkg_add es-aspell-1.11.2,1.tbz # pkg_add boost-python-libs-1.45.0_1.tbz # pkg_add kdeaddons-konq-plugins-3.5.10_5.tbz # pkg_add gwenview-1.4.2_9.tbz # pkg_add gwenview-i18n-1.4.2_5.tbz # pkg_add gwenview-i18n-1.4.2_5.tbz # pkg_add gconf-editor-2.32.0,1.tbz # pkg_add jhead-2.90.tbz # pkg_add freemind-0.8.1_1,1.tbz # pkg_add ImageMagick-6.7.3.4.tbz # pkg_add gnupg-idea-1.0.6_3.tbz # pkg_add rsync-3.0.9.tbz # pkg_add xmag-1.0.4 # pkg_add kdenetwork-kopete-0.12.8_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 add you (for example 'guru') in /etc/group to some groups to be able to access devices like /dev/video0, modems, etc.: # fgrep guru /etc/group network:*:69:guru webcamd:*:145:guru dialer:*:68:guru set the timezone in which we are in with: # tzsetup 4. What should work for me (i.e. list for tests) [v] Xorg, mouse, zaping [v] USB key for UMTS and PPP [v] ssh over USB to my phone XXX investigate changes in devd/moko.conf [v] KDE, PIM [v] mutt [v] Pidgin [v] vim, bash [v] tangoGPS [v] uRxvt [v] stardict [v] sound [v] Skype [v] firefox && addons [v] sendmail (SMPTAUTH) [v] webcamd [v] ispell && vim [v] gnupg [v] flash, testpage: http://www.adobe.com/software/flash/about/ [v] compjuga [?] does the NIC work (XXX still untested/unused) 5. Current problems to solve problems to solve are: - high: USB network devices does not attach to ue0 via devd hook --WIP - medium: syslogd should write to /tmp/*.log insert 'REQUIRE: tmp' in /etc/rc.d/syslogd 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 6. PPP The USB HSDPA modem from Huawei, I tested the E220 and the E1750, are supported; the SIM PIN is sent down on device attach via devd(8) hooks: /usr/local/etc/devd/simPin.conf #-------------#-------------#-------------#-------------#-------------# # Vodafone USB dongle # ati2: # Manufacturer: huawei # Model: E220 # Revision: 11.112.01.00.35 attach 1 { match "device-name" "u3g0"; match "vendor" "0x12d1"; match "product" "0x1003"; action "/usr/local/etc/devd/simPin.sh $device-name"; }; # Fonic USB stick # ati2: # Manufacturer: huawei # Model: E1750 # Revision: 11.126.08.01.00 # attach 1 { match "device-name" "u3g0"; match "vendor" "0x12d1"; match "product" "0x140c"; action "/usr/local/etc/devd/simPin.sh $device-name"; }; #-------------#-------------#-------------#-------------#-------------# /usr/local/etc/devd/simPin.sh #-------------#-------------#-------------#-------------#-------------# #!/bin/sh # chat -vs < /dev/cuaU0.0 > /dev/cuaU0.0 2>> /var/log/devd.out '' \ AT OK \ 'AT+CPIN=4xxx' OK #-------------#-------------#-------------#-------------#-------------# In CURRENT we now just 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.0 set speed 230400 set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \ \"\" AT OK-AT-OK ATZ OK \ AT+CFUN=1 OK \ AT+COPS=0 OK \ AT+CGDCONT=1,\\\"IP\\\",\\\"pinternet.interkom.de\\\" OK \ \\dATDT\\T TIMEOUT 40 CONNECT" set logout "ABORT BUSY ABORT ERROR TIMEOUT 30 \"\" +++ATH O ATH OK" set phone *99*1\# set authname "fonic" set authkey "fonic" set timeout 300 set ifaddr 10.64.64.64/0 10.64.64.64/0 255.255.255.255 0.0.0.0 add default HISADDR # Add a (sticky) default route enable dns disable ipv6cp #-------------#-------------#-------------#-------------#-------------# the file should have not 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 (for example from a desktop icon) as: $ ppp -auto umts 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; I do this with devd(8) hooks: /usr/local/etc/devd/moko.conf #-------------#-------------#-------------#-------------#-------------# # When the FR is attached on USB we have to assign IP ... # notify 1 { match "vendor" "0x1457"; match "product" "0x5122"; # action "/usr/local/etc/devd/moko.sh $device-name"; action "/usr/local/etc/devd/moko.sh $ugen"; }; #-------------#-------------#-------------#-------------#-------------# /usr/local/etc/devd/moko.sh #-------------#-------------#-------------#-------------#-------------# #!/bin/sh # echo `date`: $0 $* >> /tmp/devd.out case $1 in 'ugen1.3') usbconfig -u 1 -a 3 set_config 1 sleep 1 ifconfig ue0 192.168.0.200 netmask 255.255.255.0 exit 0 ; ;; 'ugen1.2') usbconfig -u 1 -a 2 set_config 1 sleep 1 ifconfig ue0 192.168.0.200 netmask 255.255.255.0 exit 0 ; ;; 'ugen0.2') usbconfig -u 0 -a 2 set_config 1 sleep 1 ifconfig ue0 192.168.0.200 netmask 255.255.255.0 exit 0 ; ;; esac exit 0 #-------------#-------------#-------------#-------------#-------------# ********** 10-CURRENT changes done until here ***************************** 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' f. no cores to write kern.coredump=0 10. Audio && Skype It took me some while to figure out the correct mixer(1) settings for the snd_hda(4) driver; I'm using now: $ mixer vol 94:94 pcm 88:88 mic 53:53 mix 60:60 rec 59:59 ogain 53:53 monitor 66:66 =rec mix which records fine from Jack when the headset is plug'ed in, and otherwise from the build-in mic; Btw: You can do easy tests of recording and play-back with: $ dd if=/dev/dsp of=/tmp/rec $ cat /tmp/rec > /dev/dsp