# Acer Aspire One 150 - Setting up 7-STABLE with KDE4 and Flash 10 from scratch.



## graedus (Oct 1, 2009)

I hereby release this guide to the *public domain*.

The objective of this guide is to get a full working FreeBSD-STABLE installation, with a complete desktop environment (KDE4), Linux f10 compatibility, and a full set of web ammenities (Firefox, Opera, Java and Flash 10) on the Acer Aspire One 150.

_*- Continues in this thread -*_


----------



## graedus (Oct 1, 2009)

*Part 1*

*- Part 1 -*

*AOA 150-1063 | P/N LU.S410B.014 | Model # ZG5*

*Specifications:*

Intel Atom Processor N270 (512KB L2 CACHE, 1.60GHz, 533MHz FSB)
1GB (512MB onboard/512MB SODIMM slot) DDR2 533 SDRAM
160GB HDD
Multi-card reader, SD Card reader
8.9" WSVGA (1024 x 600) TFT display, Acer CrystalBrite Technology
Intel Graphics Media Accelerator 950
802.11b/g WLAN, 10/100 LAN
Webcam
Spanish Keyboard
3-cell battery

*Link to the DMESG output*

_This guide assumes you're a bit acquainted with the *NIX shell and *NIX-like systems in general. It provides instructions to start up from the default Windows XP installation from factory state.

This guide also assumes having available a local network with a DHCP enabled 10/100 switch, and high speed internet access, 

This procedure doesn't require a CD or DVD drive, just a couple of bootable USB sticks. Having a second computer enabled as a FTP server is desirable, though other accommodations may be necessary._


*A. Preparations from scratch from the default Windows XP installation.*

0. Create a bootable linux "System Rescue CD" on a 1 GB USB-stick with Gparted. 
Follow the instructions at the end of this guide to do so.​
1. Download the GAG boot manager from this link.
Extract the contents of the zip file, browse the directory (folder), and copy the "linux" directory to the top level directory of the USB-stick, renaming it as "gag". Edit *copy-files.sh* in the linux directory with the Notepad, and replace its contents with this:


```
#!/bin/bash
mkdir /boot/gag
#cp *.COM /boot/gag/
cp bable.com /boot/gag/BABLE.COM
cp boot.com /boot/gag/BOOT.COM
cp brazilia.com /boot/gag/BRAZILIA.COM
cp catalan.com /boot/gag/CATALAN.COM
cp czech.com /boot/gag/CZECH.COM
cp danish.com /boot/gag/DANISH.COM
cp dutch.com /boot/gag/DUTCH.COM
cp english.com /boot/gag/ENGLISH.COM
cp espanol.com /boot/gag/ESPANOL.COM
cp euskera.com /boot/gag/EUSKERA.COM
cp french.com /boot/gag/FRENCH.COM
cp galego.com /boot/gag/GALEGO.COM
cp german.com /boot/gag/GERMAN.COM
cp hdboot.com /boot/gag/HDBOOT.COM
cp hungar.com /boot/gag/HUNGAR.COM
cp install.com /boot/gag/INSTALL.COM
cp italian.com /boot/gag/ITALIAN.COM
cp japan.com /boot/gag/JAPAN.COM
cp norwe.com /boot/gag/NORWE.COM
cp polish.com /boot/gag/POLISH.COM
cp portugal.com /boot/gag/PORTUGAL.COM
cp rusian.com /boot/gag/RUSIAN.COM
cp swedish.com /boot/gag/SWEDISH.COM
cp turkish.com /boot/gag/TURKISH.COM
cp gag-install /sbin
chmod 755 /sbin/gag-install
echo GAG files copied to the hard disk. Now  can install it
echo using "gag-install" as root
# End of file
```
_The script copies each file one by one because uppercase filenames at the FAT filesystem will be recognized as lowercase by the linux live-USB._​
2. Prepare the hard disk drive for the FreeBSD installation.

Boot with the SystemRescueCD USB-Stick, select the keyboard layout (in this case is 13-spanish) and once it finish booting up, issue the following command:


```
wizard
```

Then press enter to select the default option. X will launch.
Press the bottom left icon to see the menu and launch gparted. 
Read the GPARTED documentation for instructions on how to use it: http://gparted.sourceforge.net/larry/generalities/gparted.htm
Make space for the FreeBSD installation at the end of the disk layout (I recommend at least 24 GB: 20 GB for /, 1 GB for swap and a minimum of 3 GB for /home. 30GiB is enough for a test drive). 
After resizing the current partitions, create a dummy ext2 partition on the space to install FreeBSD.

3. Installing GAG.
_This is the way I've found to do so without a cdrom drive or an in-disk linux installation._

Fire up a terminal and issue the following commands:


```
cd /mnt/cdrom/gag
sh copy-files.sh
cd /sbin
./gag-install /dev/sda
```

This installs the default english qwerty configuration. In order to install other keyboard layout or language, use the following syntax (all in small caps):


```
gag-install -k keyboardlayout -l language /dev/sda
```
_Where language is any name (in smallcaps) of the list contained in the *copy-files.sh* script that was replaced previously, and the keyboard layouts are the following: *qwerty, azerty, qwertz, dvorak, or cyrilli*c._​
Check the "Configuring and using" section of the documentation (instruc2.html) included with gag in the "docs" directory (folder), in order to learn how to set it up once it boots.


*B. Installation Procedure*

0. Download the latest stable dvd1 and bootonly .iso files for 7.2-STABLE i386 (at the time of writing this guide, the latest snapshot was 2009-06) from one of the FTP mirrors.
The stable snapshots are located at this general path:​

```
ftp*.freebsd.org/pub/FreeBSD/snapshots/
```


1. Prepare sysinstall bootable usb-stick with bootonly ISO file.
_I've reached dead end on finding a way to convert a FreeBSD .iso file into an .img file on a windows system. Supposedly, Unetbootin works with 7.0-RELEASE, but this procedure requires the latest 7-STABLE snapshot. So I decided to make a 7.2-STABLE-200906-i386-bootonly.img and upload it to mediafire. Making available the dvd1.iso converted to img file for download is unfeasable this time._

*Download the bootonly.img here.*

And copy the img file to a USB-stick from a windows system using Image Writer. Other dd clones haven't made the cut.

Alternatively, you can do this same procedure from a FreeBSD installation (if available). 

Use the following script to convert from iso to img:​

```
#!/bin/sh
# This script is released to the Public Domain. It is a minor modification
# of the script submitted to the freebsd-questions mailing list on
# Sat Aug 4 12:42:38 UTC 2007 by fbsd2 at a1poweruser.com . Hyperlink:
# http://lists.freebsd.org/pipermail/freebsd-questions/2007-August/154956.html
#
#Purpose = Use to convert the FreeBSD install cd1, dvd1, or bootonly iso to 
#          a bootable, flashable img file so it can be used to install from. 
#          First fetch the desired iso file to your hard drive, then
#          execute this script from the command line:
#
# sh img2iso /path/to/file.iso /path/to/file.img
#
# You can later transfer the img file to a usb drive by issuing dd. In the 
# following example, /dev/da0 is the location of the usb drive. It must not
# be mounted.
#
# dd if=/path/to/file.img of=/dev/da0 bs=1m
#
# Change system bios to boot from USB-dd and away you go. 
#
# You can set some variables here. Edit them to fit your needs.
#
# Set serial variable to 0 if you don't want serial console at all,
# 1 if you want comconsole and 2 if you want comconsole and vidconsole
serial=0

set -u

if [ $# -lt 2 ]; then
    echo "Usage: $0 source-iso-path output-img-path"
    exit 1
fi

isoimage=$1; shift
imgoutfile=$1; shift

# Temp  directory to be used later
#export tmpdir=$(mktemp -d -t fbsdmount)
export tmpdir=$(mktemp -d /usr/fbsdmount)

export isodev=$(mdconfig -a -t vnode -f ${isoimage})

ISOSIZE=$(du -k ${isoimage} | awk '{print $1}')
SECTS=$((($ISOSIZE + ($ISOSIZE/5))*4))
#SECTS=$((($ISOSIZE + ($ISOSIZE/5))*2))


echo " "
echo "### Initializing image File started ###"
echo "### This will take about 4 minutes ###"
date
dd if=/dev/zero of=${imgoutfile} count=${SECTS}
echo "### Initializing image File completed ###"
date

echo " "
ls -l ${imgoutfile}
export imgdev=$(mdconfig -a -t vnode -f ${imgoutfile})

bsdlabel -w -B ${imgdev}
newfs -O1 /dev/${imgdev}a

mkdir -p ${tmpdir}/iso ${tmpdir}/img

mount -t cd9660 /dev/${isodev} ${tmpdir}/iso
mount /dev/${imgdev}a ${tmpdir}/img

echo " "
echo "### Started Copying files to the image now ###"
echo "### This will take from 2 to 30 minutes ###"
date

( cd ${tmpdir}/iso && find . -print -depth | cpio -dump ${tmpdir}/img )

echo "### Completed Copying files to the image file ###"
date


if [ ${serial} -eq 2 ]; then
        echo "-D" > ${tmpdir}/img/boot.config
        echo 'console="comconsole, vidconsole"' >> ${tmpdir}/img/boot/loader.conf
elif [ ${serial} -eq 1 ]; then
        echo "-h" > ${tmpdir}/img/boot.config
        echo 'console="comconsole"' >> ${tmpdir}/img/boot/loader.conf
fi

echo " "
# Uncomment the next few lines if you wish this script to write
# the img file to a usb drive located at /dev/da0
#
#echo "### Started Copying files to the image now ###"
#echo "### This will take about 15 minutes ###"
#date
#
#( cd ${tmpdir}/iso && find . -print -depth | cpio -dump ${tmpdir}/img )
#
#echo "### Completed Copying files to the image ###"
#date

cleanup() {
    umount ${tmpdir}/iso
    mdconfig -d -u ${isodev}
    umount ${tmpdir}/img
    mdconfig -d -u ${imgdev}
    rm -rf ${tmpdir} 
}

cleanup

ls -lh ${imgoutfile}

echo "### Script finished ###"
```
 
*- Continues in this thread -*


----------



## graedus (Oct 1, 2009)

*Part 2*

*- Part 2 -*

The script is based on the one submitted here:
http://lists.freebsd.org/pipermail/freebsd-questions/2007-August/154956.html​
*2. Prepare FTP server for local network install*

*In Windows*
Mount dvd1-iso image:

Using DaemonTools 3.47 with Windows XP, or
VirtualCloneDrive in Windows Vista / Windows 7.

Setting up a FTP server:
http://lifehacker.com/130806/how-to-set-up-a-home-ftp-server

_Make sure the location where the iso file is mounted is available within the FTP server!_​


*Alternate procedure using a working FreeBSD FTP server:*

FreeBSD Handbook section on setting up FTP (Network Servers)

Mount the dvd1 iso image:​

```
mdconfig -a -t vnode -f /path/to/7.2-STABLE-200906-i386-dvd1.iso -u 1
mount -t cd9660 /dev/md1 /mnt/iso0
```

Make sure the mountpoint is accessible to (or inside) the FTP anonymous account. This can be accomplished by symlinking. For example, if the ftp directory is /home/ftp :​

```
ln -s /mnt/iso /home/ftp/freebsd-distribution
```



Alternate procedure in Linux:

Mount an ISO image.
Setting up a FTP server in Fedora, or in Ubuntu.


*Finally, a remote-ftp installation can be executed as well. Check the next section for details.*


References:

http://www.freebsddiary.org/iso-mount.php
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/install-diff-media.html



*3. Boot up from the USB-stick and perform a sysinstall.*
Read throughly and follow the sysinstall section of the FreeBSD Handbook.    

And follow the next installation suggestions:​
Upon start, select your location and enter the keymap layout. Select the "spanish" keymap (the particular layout of your system can differ, the most common is "us").
Select Standard installation. Pick the ad0 drive. The FDISK screen will appear.
With the arrow keys highlight the last slice (the ext2 dummy slice created at the preparations section) and press D to delete. Then C to create slice, select the default type ( 165 ), and press enter. Press Q to continue.
Press enter on the next screen to enter the disclabel editor. For the layout used for this guide, create an UFS / partition of 20G, a swap space of 1G, and use the rest for a UFS /home partition. Other layouts are possible, but out of the scope of this guide. Press Q to continue.
On the "Choose Distributions" section, select "4 Developer" and select OK. A dialogue asking to install the ports collection appears. Select NO at this point.
On the "Choose Installation Media" section, select "2 FTP". If installing locally, select the URL option, provide the local address of the ftp server and the directory containing the installation iso (/freebsd-distribution was defined at the setting up the FTP section). If installing remotely, select a server from a nearby location. 
In both cases, the network controlled must be configured. The network consist of a IPv4 DHCP enabled router/switch, connected via ethernet with RJ-45 cables. Your network setup may differ. Select the re0 "RealTek 8101E/8102E/8102EL PCIe 10/100baseTX" adapter. Chooset NO at the IPv6 configuration dialogue, and YES at DHCP configuration dialogue. Enter any name at the "Host" field, and select OK. 
At the post installation section, enable ssh, and refuse to enable the gateway, internet services, anonymous ftp, nfs, linux compatibility, mouse, and system console settings at this time.
Set the root password. Its a good idea to add one user besides root at this point.
Finish the installation and reboot.

*References:*​
http://www.freebsd.org/doc/en/books/handbook/install-start.html
http://www.freebsd.org/doc/en/books...freebsd.org/doc/en/books/handbook/basics.html
[/INDENT]



*5. Run csup to sync with -STABLE.*

Tweak the stable-supfile in the examples directory:


```
cp /usr/share/examples/cvsup/stable-supfile /root/
```

Select a cvsup mirror in a nearby location at this address:
Modify the supfile ( /root/supfile ):


```
-	*default host=CHANGE_THIS.FreeBSD.org
+	*default host=cvsup18.us.FreeBSD.org
```

Issue the following command to invoke the csup update:


```
csup -L 2 /root/stable-supfile
```

*References:*

Staying in-sync: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html#STABLE
Manpage for csup: http://www.freebsd.org/cgi/man.cgi?...ion=0&manpath=FreeBSD+7.2-RELEASE&format=html
Using CVSup: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html


*5. Compile from source and update (this can take at least 4 hours!)*

Issue the following commands:


```
cd /usr/src
make -j4 buildworld
make -j4 buildkernel
make installkernel
shutdown -r now
```

Boot once again in single user mode, and issue:


```
adjkerntz -i
mount -a -t ufs
mergemaster -p
cd /usr/src
make installworld
mergemaster -Ui ***CHECK***
reboot
```

Free up some space (This can take at least 20 minutes!):


```
chflags -R noschg /usr/obj/usr
rm -rf /usr/obj/usr
cd /usr/src
make cleandir
make cleandir
```

*Reference:*

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
/usr/src/UPDATING


*6. Configuring system files.*
These modifications allow to:​
Enable linux emulation (further configuration proceeds afterwards).
Enable to get information of the core temperature of the processor.
Enable power saving flags.
Enable sound / sound mixer.
Set up the network:
[*]enable wired ethernet,
[*]enable wireless network (with encryption) and LED indicators,
[*]enable background DHCP,
[*]enable SSH,
[*]enable NFS client/server mode,
[*]and set up hosts, exports and wpa_supplicant.​
Set up the defaul keyboard layout.
Disable mouse daemon (necessary for HAL in X.org)
Enable fusefs-ntfs (NTFS r/w driver) (further configuration proceeds afterwards).
Allow unprivileged (non-root) users to mount media.

*References:*

Power options:​
http://lists.freebsd.org/pipermail/freebsd-current/2009-May/006436.html
http://forums.freebsd.org/showthread.php?t=5350

Wireless LED's and system beep:​
http://forums.freebsd.org/showthread.php?t=5350

Network and wireless configuration:​
http://www.freebsd.org/doc/en/books/handbook/config-network-setup.html
http://www.freebsd.org/doc/en/books/handbook/network-wireless.html
http://www.freebsd.org/doc/en/books/handbook/network-nfs.html

Mounting (USB) devices as non-root:​
http://www.freebsd.org/doc/en/books/handbook/usb-disks.html
http://www.sigio.com/articles/usermount.html
http://caia.swin.edu/reports/041130A/
http://lantech.geekvenue.net/chucktips/jason/chuck/987270955/index_html

Fuse extra cautions:​
http://forums.freebsd.org/showpost.php?p=7115&postcount=5
[/list]

*- Continues in this thread -*


----------



## graedus (Oct 1, 2009)

*Part 3*

*- Part 3 -*

*Files to set up:*

/boot/loader.conf (new)
/etc/rc.conf (new)
/etc/sysct.conf (append)
/etc/fstab (append)
/etc/devfs.rules (new)
/etc/hosts (diff)
/etc/wpa_supplicant.conf
/etc/devfs.conf (append)
/etc/exports (new)

Key:

new == create if it doesn't exist or replace all its contents with the one indicated.
append == add to the end of the file.
diff == locate lines starting with (-), remove them and add in their place lines starting with (+).


*Content of files to configure:*

New */boot/loader.conf* :​

```
#Linux Emulation
linprocfs_load="YES"
linsysfs_load="YES"

#CPU power saving and temperature
coretemp_load="YES"
kern.hz=100

#Sound Card
snd_hda_load="YES"

#Wireless Card
if_ath_load="YES"
wlan_scam_ap_load="YES"
wlan_scan_ap_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
```


New */etc/rc.conf* :

```
# Please make all changes to this file, not to /etc/defaults/rc.conf.   #
# This file now contains just the overrides from /etc/defaults/rc.conf. #

#Linux options
linux_enable="YES"

#Power options
powerd_enable="YES"
powerd_flags="-a maximum -i 85 -r 60 -p 100"

#Input devices
keymap="spanish.iso"
moused_enable="NO"

#File systems (external and ntfs-3g)
devfs_system_ruleset="localrules"
fusefs_enable="YES"
fusefs_safe="YES"
fusefs_safe_evil="YES"

#Network
hostname="aspireone"
inetd_enable="NO"
sshd_enable="YES"
background_dhclient="YES"
ifconfig_re0="DHCP"
ifconfig_ath0="WPA DHCP"

#Enable NFS client
nfs_cilent_enable="YES"
nfs_client_flags="-n 4"

#Enable NFS server
rcpbind_enable="YES"
nfs_server_enable="YES"
nfs_server_flags="-u -t -n 4"
mountd_flags="-r"

#Sound mixer
mixer_enable="YES"

#HAL (X.org/KDE4)
hald_enable="YES"
dbus_enable="YES"
```


Append to */etc/sysctl.conf* :

```
#Update linux compatibility
compat.linux.osrelease=2.6.16

#Allow non-root mounting
vfs.usermount=1

#Disable system beep
hw.syscons.bell=0

#Enable wireless LEDs
dev.ath.0.ledpin=3
dev.ath.0.softled=1
```


Append to */etc/fstab* :

```
linproc /usr/compat/linux/proc  linprocfs       rw              0       0
```


New */etc/devfs.rules* :

```
# Allow mounting of USB devices as non-root
[localrules=5]
add path 'da*' mode 0660 group operator
```


Diff */etc/hosts* with:

```
-	::1                    localhost localhost.my.domain
+	::1                    localhost localhost.my.domain aspireone.localhost aspireone
-	127.0.0.1              localhost localhost.my.domain
+	127.0.0.1              localhost localhost.my.domain aspireone.localhost aspireone
```


New */etc/wpa_supplicant.conf* :
_Quick WEP setup. Check the wpa_supplicant manual page for other examples_

```
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
network={
        ssid="MYSSID"
        scan_ssid=1
        key_mgmt=NONE
        wep_tx_keyidx=0
        wep_key0=0123456789
}
```


Append to */etc/devfs.conf* :

```
#Access to Intel integrated graphics DRI/drm in X.org
perm    card0   0666
```


New */etc/exports* :

```
#The following examples export /usr to 3 machines named after ducks,
#/usr/src and /usr/obj read-only to machines named after trouble makers,
#/home and all directories under it to machines named after dead rock stars
#and, /a to a network of privileged machines allowed to write on it as root.
#/usr                   huey louie dewie
#/usr/src /usr/obj -ro  calvin hobbes
#/home   -alldirs       janice jimmy frank
#/a      -maproot=0  -network 10.0.1.0 -mask 255.255.248.0
#
# You should replace these lines with your actual exported filesystems.
# Note that BSD's export syntax is 'host-centric' vs. Sun's 'FS-centric' one.
/home   -alldirs        -maproot=root   otherfreebsd
```


*7. Ports management*
Fetch ports with the following command:​

```
portsnap fetch extract
```
Then install ports-mgmt/portupgrade the tradional way:​

```
cd /usr/ports/portupgrade/ports-mgmt/portupgrade && make install clean
```

Alternatively, remotely add the binary package:​

```
pkg_add -r ports-mgmt/portupgrade
```

If a compatible FreeBSD installation is available (from the same major release and architecture), I strongly suggest to pkg_create it and then pkg_add locally (you can get the version installed with pkg_info). Working example:

At the compatible FreeBSD installation:

```
pkg_info | grep portupgrade
mkdir /root/portupgrade
cd /root/portupgrade
pkg_create -Rb portupgrade-2.4.6_3,2
```

At the installation in course:

```
cp -R /path/to/portupgrade /root/portupgrade
cd /root/portupgrade
pkg_add portupgrade-2.4.6_3,2.tbz
```


*Abstract to the the procedure suggested to install ports from binary packages, skipping building dependencies as possible, and compiling only when absolutely necessary*: 

_The Acer Aspire One has not enough muscle to leave it dedicated to compile just everything._

First, attempt to fetch the latest binary packages. If some dependency fails to be fetched, then force to fetch the available binary packages in the whole dependency chain (even if not the latest). If still some depencencies couldn't be fetched as binary packages, compile those as needed. Or in code:

Let's use as an example, *sysutils/fusefs-ntfs*, which is going to be installed shortly. The package fusefs-ntfs-2009.4.4.tbz example should be replaced as well with the actual version of the port being installed.

A. Attempt to fetch the latest binary packages:

```
pkg_fetch -R sysutils/fusefs-ntfs
```

B. If successful, pkg_add the downloaded tarball (the name of the tarball appears in the pkg_fetch output):

```
pkg_add /usr/ports/packages/All/fusefs-ntfs-2009.4.4.tbz
rehash
pkgdb -u
```

C. If dependency fetching was skipped or failed, force downloading available binary packages:

```
portinstall -fFPPk sysutils/fusefs-ntfs
```

D. If successful pkg_add the downloaded tarball:

```
pkg_add /usr/ports/packages/All/fusefs-ntfs-2009.4.4.tbz
rehash
pkgdb -u
```

E. If forced-fetching failed, then do a direct portinstall, compiling as needed:

```
portinstall -P sysutils/fusefs-ntfs
rehash
```

*References:*

http://www.freebsd.org/doc/en/books/handbook/ports.html
http://www.freshports.org/

For a more detailed procedure for installing ports, with actual examples and output, please check: http://forums.pcbsd.org/viewtopic.php?f=24&t=13669


*10. Mounting NTFS slices in read/write mode*
Install the NTFS-3G driver: *sysutils/fusefs-ntfs*

_Skip the following quoted segment. The instructions in the fuse-ntfs and hal documentation were followed as indicated, but the functionality isn't there. It's included here just as reference._​


> Procedure for executing fusefs-ntfs in unprivileged mode:
> 
> First setuid-root the ntfs-3g binary:
> 
> ...



*Work-around*
To make this (sort-of) work with an internal NTFS slice, I skipped the renaming the mount_ntfs part, and added this entry to /etc/fstab :

Append to */etc/fstab* :

```
/dev/ad0s2              /mnt/ad0s1-rw   ntfs    rw,mountprog=/usr/local/bin/ntfs-3g,late,noauto 0       0
/dev/ad0s2              /mnt/ad0s1      ntfs    ro,noauto               0       0
```
_This assumes the Acer Recovery FAT-32 slice was left intact, and the Windows XP slice is the second in line (default). If you removed altogether the recovery slice and now the Windows XP slice is the first one, replace ad0s2 with ad0s1._

Of course, both mount points have to be created:

```
mkdir -p /mnt/ad0s1-rw
mkdir -p /mnt/ad9s1
```
So, as root, the NTFS slice can be mounted either in read-write-fuse or read-only-non-fuse mode by issuing, respectively:

```
mount /mnt/ad0s1-rw
```
- or -

```
mount /mnt/ad0s1
```

Next is a mount_ntfs-3g shell script to invoke the ntfs-3g binary (no -t ntfs-3g as it was already noticed, the mount types are hardcoded), to mount other devices (such as external USB):

New */sbin/mount_ntfs-3g* :

```
#!/bin/sh
/usr/local/bin/ntfs-3g $*
```

In theory, to give unprivileged functionality, mount_ntfs-3g could added to sudo. This is out of the scope of this guide, and in particular, not recommended.

*References:*
/usr/local/share/doc/ntfs-3g/README.FreeBSD
/usr/local/share/doc/hal-0.5.11/README.fuse
http://www.freebsd.org/gnome/docs/halfaq.html#q3
http://www.tuxera.com/community/ntfs-3g-faq/#useroption
http://forums.freebsd.org/showthread.php?t=2458
http://forums.freebsd.org/showthread.php?t=1165


*- Continues on this thread -*


----------



## graedus (Oct 1, 2009)

*Part 4*

*- Part 4 -*

*11. Installing X.org*
Install the X.org meta-port: x11/xorg
_Wait until the port is fetched and installed!_

Test X.org launches (it should without no xorg.conf), issue:

```
startx
```

Then switch back to the vTTY from where X was started (ctrl+alt+F*) and stop X.org it by pressing ctrl-c.

_At this point, the dri/drm/card access parameters in the devfs.rules and devfs.conf files were already passed and enabled._

References:

http://www.freebsd.org/doc/en/books/handbook/x-config.html

*12. Installing KDE-4*
Install the kdebase4 meta-port (later the full meta-port will be installed): x11/kde4base
_Wait until the port is fetched and installed!_

Once installed, test it. Create on each user's home dirirectory an .xinitrc file with the following:

New *~/.xinitrc*:

```
~/.xinitrc
exec /usr/local/kde4/bin/startkde
```

Then start up kde4 by issuing:

```
startx
```

Now, switch to the desktop environment. Start konsole (alt+F2, konsole, enter) and proceed with the installation.


Setting up kdm as the default desktop manager
Modify the # Virtual terminals section in /etc/ttys :

Diff */etc/ttys* :

```
-	ttyv8   "/usr/local/bin/xdm -nodaemon"  xterm   off secure
+	#ttyv8   "/usr/local/bin/xdm -nodaemon"  xterm   off secure
+	ttyv8   "/usr/local/kde4/bin/kdm -nodaemon"     xterm   on secure
```

Leaving the default xdm-off line is a good idea in case something goes bad.​

*13. Setting up HALd's PolicyKit*
_Reminder: hald and dbus are already enabled from initial configuration._

PolicyKit configuration for removable and fixed drives
_Note: Include in the <match user= fields all users (as for now users belonging to the operator group, separated by pipes "|") allowed to mount media._

New */usr/local/etc/PolicyKit/PolicyKit.conf* :

```
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->

<!DOCTYPE pkconfig PUBLIC "-//freedesktop//DTD PolicyKit Configuration 1.0//EN"
"http://hal.freedesktop.org/releases/PolicyKit/1.0/config.dtd">

<!-- See the manual page PolicyKit.conf(5) for file format -->

<config version="0.1">
    <match user="root">
        <return result="yes"/>
    </match>
    <define_admin_auth group="operator"/>
    <match action="org.freedesktop.hal.storage.mount-removable">
        <match user="dad|mom|kid">
                <return result="yes"/>
        </match>
    </match>
    <match action="org.freedesktop.hal.storage.mount-fixed">
        <match user="dad|mom|kid">
                <return result="yes"/>
        </match>
    </match>
</config>
```


Allowing ctrl-alt-bksp termination:
New */usr/local/etc/hal/fdi/policy/x11-input.fdi* :

```
<?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.XkbOptions" type="string">terminate:ctrl_alt_bksp</merge>
    </match>
  </device>
</deviceinfo>
```


_Reminder: FUSE-HAL interaction is already addressed in the NTFS-3g driver installation section._


*References: *

http://www.daemonforums.org/showthread.php?t=362
http://forums.freebsd.org/showpost.php?p=14497&postcount=13


*14. Setting up xorg.conf and proper 3D-acceleration*


Install graphics/driconf
Execute driconf (alt+F2, driconf, enter). Where it says "Synchronization with vertical refresh", select the option "Inital swap interval 0, obey application's choice".
This is the working xorg.conf, includes 3d-acceleration:

New */etc/X11/xorg.conf* :

```
Section "ServerLayout"
	Identifier     "XFree86 Configured"
	Screen      0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
	Option         "Clone" "Off"
	Option         "AIGLX" "True"
EndSection

Section "Files"
	ModulePath   "/usr/local/lib/xorg/modules"
	FontPath     "/usr/local/lib/X11/fonts/misc/"
	FontPath     "/usr/local/lib/X11/fonts/TrueType"
	FontPath     "/usr/local/lib/X11/fonts/TTF/"
	FontPath     "/usr/local/lib/X11/fonts/OTF"
	FontPath     "/usr/local/lib/X11/fonts/Type1/"
	FontPath     "/usr/local/lib/X11/fonts/100dpi/"
	FontPath     "/usr/local/lib/X11/fonts/75dpi/"
	FontPath     "/usr/local/lib/X11/fonts/bitstream-vera/"
	FontPath     "/usr/local/lib/X11/fonts/cyrilliac/"
        FontPath     "/usr/local/lib/X11/fonts/dejavu/"
EndSection

Section "Module"
	Load         "dbe"
	Load	     "dri"
	Load         "dri2"
	Load         "extmod"
	Load         "glx"
	Load         "record"
	Load         "freetype"
EndSection

Section "InputDevice"
	Identifier    "Keyboard0"
	Driver        "kbd"
	Option        "Protocol" "standard"
	Option        "AutoRepeat" "500 30"
	Option        "XkbRules" "xorg"
	Option        "XkbModel" "pc105"
	Option        "XkbLayout" "es"
	Option        "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

Section "InputDevice"
	Identifier    "Mouse0"
	Driver        "mouse"
	Option        "Protocol" "Auto"
	Option        "Device" "/dev/psm0"
	Option        "Buttons" "9"
	Option        "Sensitivity" "1"
	Option        "ZAxisMapping" "4 5"
	Option        "Emulate3Buttons"
EndSection

Section "DRI"
	Mode 0666
EndSection

Section "Extensions" 
	Option        "Composite" "Enable"
	Option        "Solid" "Enable"
	Option        "Copy" "Enable"
EndSection

Section "Monitor"
	Identifier    "Monitor0"
	VendorName    "Monitor Vendor"
	ModelName     "Monitor Model"
#	Modeline      "1024x600"  54.96  1024 1048 1184 1454  600 603 604 630 -hsync -vsync
EndSection

Section "Device"
	Identifier    "Card0"
	Driver        "intel"
	VendorName    "Intel Corporation"
	BoardName     "Mobile 945GME Express Integrated Graphics Controller"
	BusID         "PCI:0:2:0"
	Option        "Clone" "True"
	Option        "DRI" "True"
	Option        "MonitorLayout" "LVDS,VGA"
	Option        "MigrationHeuristic" "greedy"
	Option        "AccelMethod" "EXA"
EndSection

Section "Screen"
	Identifier     "Screen0"
	Device         "Card0"
	Monitor        "Monitor0"
	DefaultDepth   24
	SubSection     "Display"
        	Depth  24 
        	Modes  "1024x600"
	EndSubSection
EndSection
```


*References:*

http://forums.pcbsd.org/viewtopic.php?f=25&t=13818
http://forums.freebsd.org/showpost.php?p=37118&postcount=2


*15. UTF-8 Support*
Install international fonts:

x11-fonts/dejavu
x11-fonts/cyberbit-ttfonts

Dejavu is a more UTF-8 complete bitstream-vera-type font, and requires these lines in xorg.conf (already included):

```
Load "freetype"
        FontPath "/usr/local/lib/X11/fonts/dejavu/"
```

Cyberbit is a CJK font port.


Do the following file operations for each one of the users in the system:

Append *~/.login_conf* :

```
# UTF-8 support
me:\
        :charset=UTF-8:\
        :lang=en_US.UTF-8:
```

Append *~/.shrc* :

```
# UTF-8 support
LC_ALL="en_US.UTF-8"
LANG="en_US.UTF-8"
export LC_ALL LANG
```

Append *~/.cshrc* :

```
# UTF-8 support
setenv  LC_ALL  en_US.UTF-8
setenv  LANG    en_US.UTF-8
```

Append *~/.xprofile* :

```
# UTF-8 support
export LANG=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
```


Reboot the system and verify that the kdm login dialogue appears. If so, continue.

*References:*

http://forums.freebsd.org/showpost.php?p=20629&postcount=2


*16. Installing the complete KDE4 meta-port*
Install the kde4 meta-port: x11/kde4
_Wait until the port is fetched and installed!_

Log out and log in once more. A complete desktop environment is now available to use.​
*17. Installing linux_base-f10* 
_Reminder: The linux compatibility lines were already included in the configure files (/boot/loader.con, /etc/rc.conf, /etc/sysctl.conf and /etc/fstab), but no actual linux base is installed. _

Before proceeding, some additional tweaking:

Append */etc/make.conf*:

```
OVERRIDE_LINUX_BASE_PORT=f10
OVERRIDE_LINUX_NONBASE_PORTS=f10
```

Make linux_base-f10:

```
cd /usr/ports/emulators/linux_base-f10 && make install clean
```

There are going to be a lot of fetch errors, this behavior is normal. _Wait until the port is fetched and installed!_​

*- Continues in this thread -*


----------



## graedus (Oct 1, 2009)

*Part 5*

*- Part 5 -*

*17. Web browsers with java, and flash-10*

*Fetch the latest diablo (FreeBSD Java) distfiles:*

Download the latest i386 Diablo Caffe 1.6 JDK and JRE from the TARBALLS section from the http://www.freebsdfoundation.org/downloads/java.shtml]FreeBSD's Foundation site.
Download the TZUpdater tool (optional, but advisable) from the java site.
Download the Java Cryptography Extension (optional) from Sun's CDS site

List of latest files available at the time of this guide's writing:

jce_policy-6.zip
tzupdater-1_3_18-2009k.zip
diablo-latte-freebsd7-i386-1.6.0_07-b02.tar.bz2
diablo-caffe-freebsd7-i386-1.6.0_07-b02.tar.bz2

*Move the files downloaded in the /usr/ports/distfiles/ directory*

```
mv /path/containing/only/java/zips/* /usr/ports/distfiles/
```

*Make install either diablo-jdk or diablo-jre *(if you plan on having tools such an openoffice, you'll be needing the developing kit (jdk).

```
cd /usr/ports/java/diablo-jre16 && make install clean
cd /usr/ports/java/diablo-jdk16 && make install clean
```

*Make install Linux Flash 10: www/linux-f10-flashplugin*
_Since the linux base is already installed and enabled, installing the plugin is going to be trivial._
Make install linux-f10-flashplugin10:

```
cd /usr/ports/www/linux-f10-flashplugin10/ && make install clean
```
There's going to be a lot of fetch errors, this is normal. Wait until the port is fetched and installed!​
*Install Firefox Web Browswer: www/firefox35*

*Make install the netscape (mozilla) plugin wrapper: www/nspluginwrapper*

```
cd /usr/ports/www/nspluginwrapper && make install clean
```

*Create a symbolic link to the flash player plugin in the new plugin location:*

```
ln -s /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so /usr/local/lib/browser_plugins/
```

*Each user should issue the following command to enable in the flash plugin in firefox* (except root, since root will attempt to globally install the plugin):

```
nspluginwrapper -v -a -i
```

_Enabling the pluigin for firefox will have it ready and available for Konqueror (KDE's defaul web browser)._

*Install the Opera Web Browser: www/opera*

*Ceate a /usr/local/etc/nasd.conf file *using /usr/local/etc/nasd.conf.eg as a starting point. For shorts, just issue the following command:

```
cp /usr/local/etc/nasd.conf.eg /usr/local/etc/nasd.conf
```
_Customize the file if needed._

*Make install the opera linux plugin wrapper:*

```
cd /usr/ports/www/opera-linuxplugins && make install clean
```
 
To *enable the flash and java plugins in Opera*, open (menu) Tools -> Preferences. On the Advanced tab, select content on the left bar. Check [Enable Java] and click on [Java Options]. Click on choose and go to the following path: /usr/local/diablo-jre1.6.0/lib/i386 , then click [Validate Java Path] and [ok]. A message informing the path is valid appears. Check as well [Enable Plugins] and click on [Plug-in Options]. Click on [Find New]. The flash plugin would now be listed.​

*18. QT-GTK appearance integration*
Install the following ports:

x11-themes/qtcurve-kde4/
x11-themes/gtk-qt4-engine/
x11-themes/qtcurve-gtk2/

These are used to make GTK applications have a fitting look with KDE4, and setup using the "Appearance" module of KDE System Settings.​
*
19. Japanese IME (Anthy input method) (optional)*
_Other input methods, such as uim and canna, are available as well, but out of the scope of this guide. Some general points of this section may apply to Chinese and Korean input methods as well._

Install the following ports:

japanese/scim-anthy
textproc/scim-bridge-qt4
japanese/font-kochi

Configuration file:
Append to ~/.xprofile:

```
# Japanese IME
export XMODIFIERS="@im=SCIM"
export GTK_IM_MODULE=scim
export QT_IM_MODULE=scim-bridge
```

Log out and log in again. The scim input module shall appear now.

*References:*

http://mail.kde.org/pipermail/kde-freebsd/2008-September/003835.html
http://tlug.jp/wiki/Japanese_And_Linux_Howto/Using_scim-anthy
http://grumplicio.us/fbsd_japanese.html
http://linux-cjk.net/IM/computertaijutsu/jpninpt.html


*- The guide ends here -*


----------



## overmind (Oct 1, 2009)

Nice tutorial. I was looking at this topic since I've also installed FreeBSD 7.2 on an acer aspire one. For me everything works except the card reader.

Watching youtube in HD (or other sites with high-consuming cpu flash) from time to time will keep your cpu in 100% and your kde will work very slow. It is useful to have installed htop, from which you can kill flash very easy and also you can see load per each core (well in case of Aspire one you have only one core, but you will see two, because of hyperthreading).


----------



## graedus (Oct 1, 2009)

Since most of the time I just download the mp4 offered by youtube, I've not really faced that issue. Also, firefox's flashblock is handy for reducing the amount of flash floating around.


----------



## CodeBlock (Oct 9, 2009)

Does sleep/hibernate work at all?


----------



## blacksmith (Oct 16, 2009)

*Thanks Alot...*

Thanks for your article... it`s really usefull to me... specially on ntfs-3g part, but use different X`org, I Use Gnome... anyway... thaaaankkkksss so much :stud


----------



## jb_fvwm2 (Oct 16, 2009)

The D150 is featured today on a popular buying site
(today, friday 16th)
...........................
Notes (not to be taken as
absolutely true, I could have 
read something too quickly...)
from that: (just as an aside to this thread).
...........................
one can add a "dell 1390 wifi" upgrade
one can add a bluetooth mouse
one can temporarily use a usb-dvd, say, at home
smaller keyboard than Asus or Samsung notebooks
Over 400 reviews at Amazon, lesser number at
TigerDirect.
Good battery life, but one should recharge it per day
of use probably.
...............
Also mentioned another site with information about it.
..............


----------



## blacksmith (Oct 17, 2009)

i`ve been doing your article in ntfs-3g, when i tried to write some files and foldes it works , but something made me confuse, ... when I reboot it, all the files and foldes are gone..

any suggest??


----------



## DutchDaemon (Oct 17, 2009)

Who are you talking to, blacksmith?


----------



## blacksmith (Oct 19, 2009)

to the article writter, of course... :e


----------



## fjodor (Oct 24, 2009)

Hey thanks for your article! I got a pretty odd problem regarding the gag install. First of all, the copy-files.sh script doens't work properly, as it responses: no such file or directory. I checked the /boot dir and there's just a folder named 'gag?' which appears kinda weird to me?! So I manually created a folder called 'gag' and executed sh copy-files.sh again. Indeed he did copy the files to /boot/gag, but all of them have that question mark at the end of their names. Anyway, changed to /sbin and performed that ./gag-install /dev/sda command, which didn't work cause of 'no such file or directory: ./gag-install'. Well I'm a little desperate in the moment and should add that I'm completely new to FreeBSD, Unix or Linux. Well thanks alot, I hope that's enough information to get a clue what's possibly wrong.


----------



## aikiPupil (Feb 23, 2010)

I see your section on installing Java and have found myself stuck where 'make' asks for the time zone tool -

' Please open http://java.sun.com/javase/downloads/index.jsp
 in a web browser and follow the "Download" link for
 "JDK US DST Timezone Update Tool - 1_3_18" to obtain the
 time zone update file, tzupdater-1_3_18-2009k.zip.'

The file it is asking for is not available that I can find.

I have downloaded the file that is available tzupdater-1_3_25-2009u.zip

I have tried changing the Makefile and distinfo files to point to the file I downloaded, what I am finding is that there is a MD5 Checksum mismatch which makes sense.

So my question is can I generate a MD5 checksum that I could put into the disinfo file or is there some way around this that anyone has come across?


----------



## aikiPupil (Feb 23, 2010)

I found an answer: 

Make config 

On the screen that pops up uncheck the update timezone option on 'ok'

Hope this helps someone else.


----------



## DutchDaemon (Feb 23, 2010)

[cmd=]make makesum[/cmd] creates checksum files (md5 and sha256). You can also do that manually using md5(1).


----------



## nu2fbsd (Mar 22, 2010)

*Config errors*

*1. *In point 14 - Setting up xorg.conf
There is no xorg.conf in /etc/X11/

*2.* point 17. Make install the netscape plugin...
When I did make install clean for nspluginwrapper, it stopped because linux-f10-pango-1.22.3 has known vulnerabilities
pango -- integer overflow
Please update your ports tree and try again 
(#My Ports tree is up to date). So how do I proceed to install the nspluginwrapper?


----------



## sixtydoses (Mar 22, 2010)

nu2fbsd said:
			
		

> *1. *In point 14 - Setting up xorg.conf
> There is no xorg.conf in /etc/X11/


Run `# Xorg -configure`. Then copy /root/xorg.conf.new to /etc/X11/xorg.conf.

http://www.freebsd.org/doc/handbook/x-config.html




			
				nu2fbsd said:
			
		

> *2.* point 17. Make install the netscape plugin...
> When I did make install clean for nspluginwrapper, it stopped because linux-f10-pango-1.22.3 has known vulnerabilities
> pango -- integer overflow
> Please update your ports tree and try again
> (#My Ports tree is up to date). So how do I proceed to install the nspluginwrapper?


http://forums.freebsd.org/showthread.php?t=10460


----------

