by Richard Bergmair
...this wizard will guide you through the rest of this installation procedure. Set up your own Gentoo system in 73 easy steps.
I'm not really a big fan of laptops. I like my machines large, especially display and keyboard. When it comes to mobile computing, all I need is to run LaTeX and Acrobat Reader and maybe to listen to MP3s from my collection, which fits on a 16GB SD. But, given these humble application requirements, I do want real mobility.
Previously, I had a 13" iBook and was very satisfied with it. -- I actually poured a glass of water into it once by mistake, and it didn't give up on me. -- Yet, even the 13" format is not quite mobile enough for me. I found it was still too big for working comfortably in the crammed rows of an airplane or a train. Furthermore, my iBook tended to get rather warm, which made it uncomfortable to actually have it sitting on my lap. And, as I didn't have the foresight to pay that premium to get the black iBook, I found that, after about two years, it did look rather disgusting, a phenomenon that's somewhat universal to white laptops. After three years, it's now finally broken, and I decided to get a new laptop. This time I thought I'd go for a shorter lifetime and get something smaller and cheaper.
The Acer Aspire One (AA1) seemed to be just that, so I got the A110L edition that comes with Linpus Linux. It does have a bit of a plasticy, cheap feel to it. I would assume the iBook is better quality. But in the past I have also had a very positive user experience with other Acer laptops, and the important point is that you can break your AA1, throw it away, and get a new one, three times, before you've spent the money that would buy you an iBook. By that time, any warranty you might have had on the iBook would long have run out.
So, I think hardware-wise the AA1 is not a bad deal. It has a soundcard with microphone and earphone plugs, ethernet, wireless, and a webcam. Yet the software just doesn't put that to use. The media player lacks a media library of the kind iTunes has, and there is no instant messaging tool like Skype. It's probably not an exaggeration to say that most mobile phones offer more functionality than Linpus, except for the fact that Linpus comes with OpenOffice. Annoyingly, the system is also heavily locked down. You can't even get a terminal window, if you don't know exactly where to look.
So I spent about two days, applying hacks and workarounds described in the AA1 user forum to unlock and customize the system. But when I started installing software, for example different media players, they all failed for different reasons with different bugs. I guess, you can't really blame Linpus for that. IMHO, the real problem is that there is no reliable testbed for linux in general. Software developers test against specific distributions, so the more differnet your linux distro is from the most common ones, the harder your live will be as a user. And it seems that Linpus, although it's based on Fedora, has been quite heavily modified.
The one thing that Linpus was originally designed to do was to support Asian languages on devices that are in some sense "embedded" or otherwise heavily locked down. This ability to deal with Asian languages, which is still one of the more exotic requirements for a linux distro, probably appeals to Acer, as Asia is an important market for the AA1. This is less important for me, however, as my working languages are German and English, which work perfectly fine on any linux.
For these reasons, I finally gave up on Linpus and decided to install Gentoo on my AA1. I'm not going to go into why I chose Gentoo over other linux distros. I suspect, the ability to compile everything with processor options optimized for the Intel Atom, which is quite unusual for end user PCs, is potentially important, but, frankly, I haven't tried to verify that experimentally.
This guide for installing Gentoo on your AA1 addresses three problems I ran into, when trying to install Gentoo in October 2008.
If you are reading this guide at some point later than October 2008, try to find out whether these problems are still an issue. If not, there are bound to be simpler installation procedures than the one described here. If you do find a simpler installation procedure, drop me an e-mail, so I can update this guide, or take it offline altogether once it's deprecated.
If you want to install a standard Gentoo distro on your AA1, I'd recommend you do the following:
| I. | Install Linpus from the recovery CD to a USB stick. |
| II. | Boot from that USB stick, and use the network to install a minimal Gentoo system onto the SSD. |
| III. | Boot from the SSD, set up the network, install some more packages, optimize and configure your minimal system. |
| IV. | Configure the software and hardware you need. |
We will set the system up in stage III using the ethernet first, and, only in stage IV, we will configure wireless, together with X11 and other hardware. In many cases, this is a good strategy. Many wireless networks send you through a web-based portal, which requires a webbrowser, which requires a properly working desktop system. When you are sitting in your office trying to set up the AA1, chances are you have an ethernet available anyway that's faster than a wireless network. If you really need to set things up directly from the wireless network, the information in this guide will still be useful, but you'll have to pull some of the steps from stage IV to stage III.
Obviously, there are other strategies for going about this than the one followed here. Let me explain, quickly, what other strategies I've tried and failed with, so you can avoid going down the wrong path and wasting a lot of time.
The first problem is that neither the Gentoo installation CD, nor the Gentoo Live CD support the r8101 ethernet card in my AA1. This is hinted out in this entry on the AA1 in the Gentoo wiki. It suggests, therefore, to do a networkless install. For mysterious reasons, however, the textmode networkless installation script "installer-dialog" provided by the Gentoo Live CD, didn't work for me due to some issue that might not have anything to do with the AA1 whatsoever. The graphical installation script didn't work, since the Live CD failed to autoconfigure X11 on my AA1. Besides, the networkless install is not the most efficient way of going about this anyway, as it would mean doing a lot of updating once the system is up and running, when it would be possible to install the newest packages directly.
Other options I tried were to use the Gentoo Live CD and Knoppix, but load the proper network card driver (available here) to do a network-based install. But this is anything but straightforward. The LiveCD doesn't come with kernel sources, so I wasn't able to compile and load the kernel module because I didn't have the right kernel used for the Live CD handy, together with its configuration. The Knoppix DVD, on the other hand, does come with its own kernel sources plus configuration, so here I could easily compile the module. But now the problem was this: The r8101 network card had been incorrectly detected at boot-time as an r8169. This module didn't work however, and I couldn't rmmod it, because, for some reason, the system claimed to be using it. Hence, I couldn't insmod the correct r8101 module. I would have had to replace the module included with the system, or fiddle with the module configuration, so that it gets properly loaded at boot-time, but this is pretty hard to do, since the SquashFS used by the Gentoo Live CD and the compressed loop-devices used by Knoppix are extremely tedious to modify.
I've made some attempt here, to put together all the relevant information from a number of sources.
Relevant AA1 references
Relevant Gentoo documentation:
More stuff
Besides the AA1, I invested in a 16GB SD card. I knew I would have to do that, since the 8GB SSD is abit too small for me, in any case. I guess, I'll use the 16GB SD card later to store my MP3 collection. ...but for now, I am recruiting it for system installation stuff.
I am using my SD card with a USB card reader. This way everything looks like a USB stick to the system. If you want to use a USB stick instead, that's perfectly fine. If you have an SD card, but no USB card reader, check out blackhawk's guide to get your system to boot from the SD card. The rest of this HOWTO still applies.
In general, what you need is some USB storage device that can hold at least a 2800MB partition, which you will have to dedicate entirely to this purpose. If you don't have a blank USB key or some USB key with unpartitioned space of this kind available, look into resizing partitions on an existing USB key, or copying around some data, to free up the key. It shouldn't be a big deal, as 4GB USB keys are really quite cheap these days.
You will also need to get your hands on the AA1 recovery DVD that comes with the system, but I'm assuming you bought it new, and you have it. Otherwise, I don't really know how to get it.
It's probably needless to say this, but we will erase the SSD of your AA1 in the course of this installation, so you will want to back up any relevant data you might have. If you don't have any user data on your AA1, don't bother with this. An out-of-the-box installation can always be restored using the recovery DVD.
This is based on blackhawk's guide.
According to blackhawk, the files you need from the AA1 recovery DVD are the following:
hdc._.tar.bz2 addon/audio.tar.bz2 addon/desktop.tar.bz2 addon/euscen.tar.bz2 addon/pcm_patch0622.tar.bz2 addon/release103E.tar.bz2 addon/translate.tar.bz2
And then, you also need blackhawk-boot.tar.bz2, containing a boot directory prepared by blackhawk for this purpose. It contains a special initrd. I don't know exactly what it does, but I've tried doing this without the modified boot directory, and failed. Use whatever means are convenient to you to put this to some location on your AA1. For example you might use your USB key to transfer the files, using a computer with a DVD drive. Instead of using the AA1, you could also execute this stage of the installation on some other linux machine that you have root access to, and where you can work with the recovery DVD and the USB key at the same time. When I tried this, I didn't have such a machine handy, which is why I used the AA1 itself.
Just click on "My Documents", then "Terminal", then
[user@localhost Documents]$ su Password: [root@localhost Documents]#
using the password you provided at installation time.
1. insert the USB key and find out its device name. On your AA1, the USB key will probably be called /dev/sdb, and chances are, there is some filesystem already on the key, which has just been automounted. In that case, check the output of "mount" to find out the device name. Then unmount it by clicking the "eject" button. Otherwise, "dmesg" or "cat /proc/partitions" might provide clues as to the device name of your USB key. Let's say you suspect it is "/dev/sdb". Check the partition table and storage capacity of the device with "fdisk -l /dev/sdb", to see whether it looks like your USB key. If you're doing this on a computer that stores important data, you don't want to get it confused with a disk, because we are now going to erase it!
2. partition the USB key with fdisk. In the following, we will erase the partition table on your USB key, and create a partition of size 2800MB, which is just enough to hold the linpus system. If you are going to use this USB key to work with this linpus installation productively it might be a good idea to make the partition bigger than that. Let's say the device is "/dev/sdb". Try this:
[root@localhost Documents]# fdisk /dev/sdb Command (m for help): o Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-15488, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-15488, default 15488): +2800M Command (m for help): a Partition number (1-4): 1 Command (m for help): w [root@localhost Documents]#
When fdisk re-reads the partition table, it might be that a filesystem you have previously had on your USB key will get automounted. If this happens unmount it, by pressing the "eject" button. You don't need to reboot your system. Just remove the key, and put it back in. This will properly re-read the new partition table. You need to do this, because otherwise mkfs will get confused about the size of the partition you are trying to format.
3. format the partition with mkfs.ext2.
[root@localhost Documents]# mkfs.ext2 -L linpus /dev/sdb1
Then remove the USB stick, and insert it again, to get the new filesystem automounted. Check with "df", to see that you actually have at least 2800MB available on your new filesystem. If you don't, return to step 2, and create a bigger partition.
[root@localhost Documents]# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 6720248 3433808 2945064 54% / none 252364 0 252364 0% /dev/shm none 6720248 3433808 2945064 54% /mnt/home /dev/sdb1 2692116 4008 2551356 1% /media/linpus [root@localhost Documents]#
4. unpack linpus into your new partition. This is assuming you have the stuff mentioned in I.1. in /stuff.
[root@localhost Documents]# cd /media/linpus [root@localhost linpus]# tar xvfj /stuff/hdc1._.tar.bz2 [root@localhost linpus]# tar xvfj /stuff/audio.tar.bz2 [root@localhost linpus]# tar xvfj /stuff/desktop.tar.bz2 [root@localhost linpus]# tar xvfj /stuff/euscen.tar.bz2 [root@localhost linpus]# tar xvfj /stuff/pcm_patch0622.tar.bz2 [root@localhost linpus]# tar xvfj /stuff/release103E.tar.bz2 [root@localhost linpus]# tar xvfj /stuff/translate.tar.bz2 [root@localhost linpus]# mkdir dev proc sys tmp usr/src [root@localhost linpus]#
5. set up the boot loader on the USB key First you'll need blackhawk's configuration in place.
[root@localhost linpus]# mv boot/grub boot/grub.old [root@localhost linpus]# tar xvfj /stuff/blackhawk-boot.tar.bz2 [root@localhost linpus]#
Then, we chroot into the linpus system
[root@localhost linpus]# mount -t proc none proc [root@localhost linpus]# mount -o bind /dev dev [root@localhost linpus]# chroot . [root@localhost /]#
Try to find out the name which grub assigns to your USB key. In my case this was hd1, and the partition I was using was the first, so (hd1,0), is the right name. Install grub as follows:
[root@localhost /]# grub --no-floppy grub> root (hd1,0) grub> setup (hd1) grub> quit
Then, do some more stuff recommended by blackhawk.
# vi etc/fstab LABEL=linpus / ext2 defaults,noatime 1 1 ... #/dev/sda2 swap swap defaults 0 0 /dev/sda1 /mnt/windows vfat user,exec,umask=0 0 0
# vi etc/rc.d/rc.S ... /sbin/fsck.ext2 -fy LABEL=linpus ... echo "LABEL=linpus / ext2 rw 0 0">/etc/mtab & ...
6. set the root password on your new system.
[root@localhost /]# passwd Changing password for user root. New UNIX password: Retype new UNIX password: [root@localhost /]#
7. leave the chroot environment and unmount everything.
[root@localhost /]# exit exit [root@localhost linpus]# umount proc [root@localhost linpus]# umount dev [root@localhost linpus]# cd .. [root@localhost media]# umount linpus [root@localhost media]#
You can now reboot your system with the USB key in. When the AA1 comes up again, you can press F12 to enter the boot menu, where you can select to boot from your USB stick. Alternatively, you can press F2 to enter BIOS setup and permanently configure the BIOS to boot from USB stick per default, whenever one is inserted. This sort of thing used to be considered a security risk, back in the days when viruses were spread by people exchanging floppy disks and forgetting to remove them from their drives before turning their computers on. Nowadays, I guess, boot sector viruses aren't really that much of a concern any more.
You are now running linpus from your USB stick, but you shouldn't trust that system too well. I've experienced weird phenomena like the computer going to sleep and not awaking afterwards. Furthermore, there is a strange process that seems to live inside blackhawk's initrd, which constantly takes up a major share of CPU utilization. That's why I've somewhat changed the installation procedure, to get us up and running under Gentoo as soon as possible. We can then play around with the configuration and optimize the system while running under Gentoo.
Now that you're running linpus from your USB stick, you can safely fiddle around with the SDD, which will probably be called /dev/sda. Check fdisk -l /dev/sda to verify this. If you previously had an out-of-the-box linpus on that system, you'll see two partitions: A linux partition extending from cylinder 1 to 850 and a linux swap partition from 851 to 981.
Go to step 4 of the installation chapter in the Gentoo handbook.
The ArchLinux wiki points out some important considerations to take into account when setting up an SSD for linux. They take a number of measures to limit write operations on the disk, as an SSD is rather slow at executing them, and it can only handle a limited number of them over its lifetime. Their estimate is that you can write about 2GB worth of data each day, if you want a three-year lifetime.
Therefore, they do not use a swap partition. The standard linpus configuration, however, does use a 1GB swap partition. I guess the question is what applications you will be using. With memory-hungry applications, the 512MB of physical RAM might just not be enough.
Furthermore, they recommend not to use a journalling filesystem. The linpus configuration seems to agree on that, in using an ext2 instead of an ext3 root partition. Journalling does come in handy in many situations though. Laptops are perhaps bound to run out of power every now and then, and you don't want to destroy your filesystem that way.
Generally, you want to decide on whether or not to use swapping and journalling, on the basis of your desired lifetime. Since I'm not going for a very long lifetime, I wasn't very conservative here. I used the journalling ext3 filesystem, but I only commit the journal every 5 minutes, rather than the default, which commits every 15 seconds. I have a swap partition on my disk, but I only activate it manually, when I really need to.
They make some more suggestions, that strike me as a good idea in any case: Use the noatime and nodiratime options to prevent writing file access timestamps and put directories for temporary files and logs onto a tmpfs in memory, rather than writing to the disk all the time.
1. erase the existing disk config on the SSD: To ensure, my system was completely cleaned of previous installations of a bootloader, partition table, filesystem, etc. I did the following:
[root@localhost Documents]# dd if=/dev/zero of=/dev/sda
Then I pressed CTRL-C after a while. I'm not absolutely sure, you really need to do this, though.
2. partition the SSD: Generally, refer to the Gentoo handbook for this. What I did was this:
[root@localhost Documents]# fdisk /dev/sda Command (m for help): o Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-981, default 1): Last cylinder or +size or +sizeM or +sizeK (1-981, default 981): +32M Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 2 First cylinder (6-981, default 6): Last cylinder or +size or +sizeM or +sizeK (6-981, default 981): 851 Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 3 First cylinder (852-981, default 852): Last cylinder or +size or +sizeM or +sizeK (852-981, default 981): Command (m for help): t Partition number (1-4): 3 Hex code (type L to list codes): 82 Command (m for help): a Partition number (1-4): 1 Command (m for help): p Disk /dev/sda: 8069 MB, 8069677056 bytes 255 heads, 63 sectors/track, 981 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xf75cbbc1 Device Boot Start End Blocks Id System /dev/sda1 * 1 5 40131 83 Linux /dev/sda2 6 851 6795495 83 Linux /dev/sda3 852 981 1044225 82 Linux swap / Solaris Command (m for help): w [root@localhost Documents]#
Drop the swap partition, if you want to.
3. create the filesystems.
[root@localhost Documents]# mke2fs /dev/sda1 [root@localhost Documents]# mke2fs -j /dev/sda2
Drop the "-j" if you've decided not to use journalling
4. create the swap space if you have a swap partition.
[root@localhost Documents]# mkswap /dev/sda3
5. mount everything.
[root@localhost Documents]# mkdir /mnt/gentoo [root@localhost Documents]# mount /dev/sda2 /mnt/gentoo [root@localhost Documents]# mkdir /mnt/gentoo/boot [root@localhost Documents]# mount /dev/sda1 /mnt/gentoo/boot [root@localhost Documents]# cd /mnt/gentoo [root@localhost gentoo]#
Go to step 5 of the installation chapter in the Gentoo handbook.
Your date will already be set properly. You will then need to download a stage tarball and a portage snapshot. If you've followed my above instructions, and have made the USB key rather small, you won't have space left on the USB key for the .tar.bz2 files you are going to download from the internet, so you can put them on the SSD instead.
1. get the stage3 tarball
[root@localhost gentoo]# touch stage3-x86-2008.0.tar.bz2 [root@localhost gentoo]# chmod 777 stage3-x86-2008.0.tar.bz2
Now you can use Firefox to find and download this file. Go to the Gentoo mirrors list, select a mirror close to you, then go to "releases/x86/2008.0/stages", and right-click on "stage3-x86-2008.0.tar.bz2", select "save link as", and overwrite the file you've just created in /mnt/gentoo. Then proceed to unpack and delete the file.
[root@localhost gentoo]# tar xvjpf stage3-x86-2008.0.tar.bz2 [root@localhost gentoo]# rm -f stage3-x86-2008.0.tar.bz2
2. get a portage snapshot.
[root@localhost gentoo]# touch portage-2008.0.tar.bz2 [root@localhost gentoo]# chmod 777 portage-2008.0.tar.bz2
Now download and overwrite the file from "releases/snapshots/2008.0". Then unpack and delete it.
[root@localhost gentoo]# tar xvjf portage-2008.0.tar.bz2 -C usr [root@localhost gentoo]# rm -f portage-2008.0.tar.bz2
Use lspci to see if you have an r8101 or an r8169 ethernet card.
3. get the r8101 network card driver if you have this card. If you have an r8169 instead, skip this.
[root@localhost gentoo]# touch usr/src/r8101-1.009.00.tar.bz2 [root@localhost gentoo]# chmod 777 usr/src/r8101-1.009.00.tar.bz2
Then overwrite this empty file with the one from the RealTek support site.
[root@localhost gentoo]# tar xvfj usr/src/r8101-1.009.00.tar.bz2 -C usr/src [root@localhost gentoo]# rm -f usr/src/r8101-1.009.00.tar.bz2
4. get the linux kernel sources,
[root@localhost gentoo]# touch usr/src/linux-2.6.27.4.tar.bz2 [root@localhost gentoo]# chmod 777 usr/src/linux-2.6.27.4.tar.bz2
Then overwrite it with the file you can get at you can get at kernel.org. Then unpack and delete the archive.
[root@localhost gentoo]# tar xvfj usr/src/linux-2.6.27.4.tar.bz2 -C usr/src [root@localhost gentoo]# rm -f usr/src/linux-2.6.27.4.tar.bz2
5. get the linux kernel configuration,
[root@localhost gentoo]# touch usr/src/linux-2.6.27.4/.config [root@localhost gentoo]# chmod 777 usr/src/linux-2.6.27.4/.config
Then overwrite it with the file with this one.
[root@localhost gentoo]# chmod `umask` usr/src/linux-2.6.27.4/.config
Go to step 6 of the installation chapter in the Gentoo handbook.
1. select a mirror and configure make for emerge. The Gentoo handbook asks you to use the mirrorselect utility first. This utility is to be found neither in Linpus linux, nor in the stage3 tarball of Gentoo, so we simply don't have it. However, you can select a mirror by manually editing make.conf. For example, what I did was this:
[root@localhost gentoo]# nano etc/make.conf ... SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" GENTOO_MIRRORS="ftp://ftp.mirrorservice.org/sites/www.ibiblio.org/gentoo/" MAKEOPTS="-j3"
Of course, you shouldn't blindly use my settings for SYNC and GENTOO_MIRRORS, but select mirrors that are near you. At this point, it is also useful to configure the "-j" option emerge will pass to make. Since the Intel Atom is a dualcore processor, it will benefit from some parallelism, which is why I've set make here to run three parallel compilation processes. Leave the rest of this configuration file as it is, for now. We will return to it later to apply optimizations.
2. chroot into your Gentoo system.
[root@localhost gentoo]# cp -L /etc/resolv.conf ./etc [root@localhost gentoo]# mount -t proc none proc [root@localhost gentoo]# mount -o bind /dev dev [root@localhost gentoo]# chroot . localhost / # env-update >> Regenerating /etc/ld.so.cache... localhost / # source /etc/profile localhost / #
3. check the time. Use the "date" command to make sure the system time in your chroot environment is correct.
4. update the portage tree.
localhost / # emerge --sync
Forget the rest of step 6 of the installation chapter in the Gentoo handbook for now. We will return to these steps later.
5. emerge any packages essential to your survival. At this point, I would do
localhost / # emerge vim
because I really don't like nano that much.
Go to step 7 of the installation chapter in the Gentoo handbook.
1. configure the kernel.
localhost / # ln -s /usr/src/linux-2.6.27.4 /usr/src/linux localhost / # cd /usr/src/linux localhost linux # make menuconfig
This will now load the dialog-based configuration utility for the linux kernel, loading the configuration you just downloaded before. If you need to make any changes, do it now. You want to check out that the configuration is generally compatible with what is described in the Gentoo handbook and the Gentoo wiki.
2. compile and install the kernel.
localhost linux # make localhost linux # make modules_install localhost linux # cp arch/i386/boot/bzImage /boot/kernel
Go to step 10 of the installation chapter in the Gentoo handbook. We are skipping steps 8 and 9 for now, and will return to them later.
3. emerge the bootloader.
localhost / # emerge grub
4. configure the bootloader.
localhost / # vi /boot/grub/ default 0 timeout 5 title Gentoo root (hd0,0) kernel /boot/kernel root=/dev/sda2
5. install the bootloader.
localhost / # grub --no-floppy grub> root (hd0,0) Filesystem type is ext2fs, partition type 0x83 grub> setup (hd0) grub> quit
We will now do certain parts of step 8 of the installation chapter in the Gentoo handbook.
1. configure /etc/fstab.
localhost / # vi /etc/fstab /dev/sda1 /boot ext2 defaults,noatime,nodiratime 1 2 /dev/sda2 / ext3 defaults,noatime,nodiratime 0 1 # /dev/sda3 none swap sw 0 0 shm /dev/shm tmpfs nodev,nosuid,noexec,size=40M 0 0 none /var/log tmpfs defaults,size=10M 0 0 none /tmp tmpfs defaults,size=100M 0 0 # none /var/tmp tmpfs defaults,size=20M 0 0
Remove the comment marker for the third line, if you want to automatically activate a swap partitoin on /dev/sda3. Remove the comment marker for the last line, if you want /var/tmp to be a tmpfs by default. You will then have to remember unmounting it before you use emerge, because /var/tmp/portage is where the builds take place, and they will likely require more than 20M. Use "ext2" instead of "ext3" for the second line, if you've decided not to use journalling.
2. name the computer.
localhost / # vi /etc/conf.d/hostname HOSTNAME="aa1" [root@localhost /]# vi /etc/conf.d/net dns_domain_lo="lcl"
Skip the part about configuring the network. We will return to this later.
3. set the root password.
localhost / # passwd Changing password for user root. New UNIX password: Retype new UNIX password: localhost / #
If you're currently working with a US layout on a non-US keyboard, don't forget to account for that while typing your password! You might want to just set it to something simple now, and do it properly later, when your keyboard cooperates.
4. set the keymap.
localhost / # vi /etc/conf.d/keymaps KEYMAP="de" ...
This would, for example, set the layout to German. Have a look at the files in /usr/share/keymaps if you don't know what your layout is called.
5. emerge essential networking packages. When we reboot, we initially won't have a network, so it is important to emerge any packages we are going to need later for setting up the network, now while we still have connectivity. For example, if you are going to use a dhcp client, do this:
localhost / # emerge dhcpcd
6. leave the chroot environment and reboot.
localhost / # exit [root@localhost gentoo]# umount boot [root@localhost gentoo]# umount proc [root@localhost gentoo]# umount dev [root@localhost gentoo]# cd .. [root@localhost mnt]# umount gentoo
Now close the terminal window, Firefox, and any other applications you might have running and shut down the machine. Remove the USB stick from the drive and turn the computer back on. It will now boot the minimal Gentoo system from the SSD.
You should now be running Gentoo from your SSD.
1. configure the timezone. Let's say your bios clock is set in UTC, and you live in Britain, then
aa1 ~ # cp /usr/share/zoneinfo/GB /etc/localtime aa1 ~ # vi /etc/conf.d/clock CLOCK="UTC" TIMEZONE="GB" ...
2. set the time using the "date" command.
If you have an r8101, you will first need to compile and install it. The procedure here is based on the mone mentioned in this guide. If you have the r8169, skip this step.
1. compile and install the r8101 driver.
aa1 ~ # cd /usr/src/r8101-1.009.00 aa1 r8101-1.009.00 # make aa1 r8101-1.009.00 # depmod -a
2. configure the modules.
aa1 r8101-1.009.00 # cd ~ aa1 ~ # vi /etc/modprobe.d/blacklist blacklist r8169 blacklist memstick blacklist snd-pcsp ...
If you have an r8169, you don't want to blacklist it, of course. This is only for r8101 users. The other modules have been rumored to cause trouble on the AA1.
3. load the r8101 module.
aa1 ~ # rmmod r8169 aa1 ~ # modprobe r8101
Again: don't do this, if you have an r8169.
Then, we set up the network as described in step 8 of the installation chapter in the Gentoo handbook.
4. configure the network.
aa1 ~ # ln -s /etc/init.d/net.lo /etc/init.d/net.eth0 aa1 ~ # vi /etc/conf.d/net
Have a look at the Gentoo handbook to see how this works. I didn't have to do anything to this file for using dhcp.
The Gentoo handbook also suggests automatically starting the networking at boot time. Personally, I prefer not to do this, because I have no way to know how my laptop is connected each time I boot. I prefer to start the networking when I need it.
5. start the network. Right now, we do need the network, though, for emerge.
aa1 ~ # /etc/init.d/net.eth0 start
We now return to step 6 of the installation chapter in the Gentoo handbook, to configure the profile, USE variable and glibc locales.
1. choose the right profile. I just decided to stick with the default, so no action was required there. Have a look at the Gentoo handbook for a description of what this is about.
2. configure the glibc locales
aa1 ~ # vi /etc/locale.gen
You now want to compile and update the whole system according to the settings you've just made. At the moment, this process is somewhat complicated by the fact that you would ideally want to use the "-march=native" option to gcc in order to compile everything in a way that's optimized for the Intel Atom in the AA1. This is what's suggested in the Gentoo wiki. For more details, it refers to this thread on the Gentoo forums. Now, the problem is that this option is not supported by the gcc version that comes with the stage3 tarball, so you would have to update your compiler.
You now have to decide whether or not you want to do this. Updating to the newer version of the compiler means you get to use "-march=native", and any other features a newer version of the compiler might offer. However, newer versions of the gcc have been masked. Your choice is now as follows. (a) You can boldly ignore any warnings the Gentoo developers would throw your way concerning the fact that these newer versions of the gcc have not been sufficiently tested in Gentoo. You can then follow the following steps under 3.a., which will basically use this guide for updating the compiler, and then recompiling and updating the system. This will take quite a while. (b) Alternatively, you can be conservative about it and just forget about those optimizations. This is faster and, potentially, safer. In that case, go to step 3.b.
You have decided to apply the optimizations? Follow the following steps, and skip step 3.b.
3.a.1 unmask the newest versions of the gcc toolchain.
aa1 ~ # mkdir /etc/portage aa1 ~ # vi /etc/portage/package.keywords sys-devel/gcc ~x86 sys-devel/gcc-config ~x86 sys-libs/glibc ~x86 sys-devel/binutils ~x86
3.a.2 emerge the newest versions of the gcc toolchain.
aa1 ~ # emerge gcc-config glibc binutils gcc
This took about 4.5 hours, when I did it.
3.a.3. configure the CFLAGS.
aa1 ~ # vi etc/make.conf
...
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
...
3.a.4. select the default c compiler.
aa1 ~ # gcc-config -l [1] i486-pc-linux-gnu-4.1.2 [2] i486-pc-linux-gnu-4.3.1 aa1 ~ # gcc-config 2 aa1 ~ # env-update aa1 ~ # source /etc/profile
3.a.5. recompile the gcc toolchain.
aa1 ~ # emerge gcc-config glibc binutils gcc
This is going to give us a version of the new gcc toolchain, which has been compiled with the new gcc toolchain. Again, allow about 4.5 hours for this.
3.a.6. recompile and update "world" packages.
[root@localhost gentoo]# emerge -e world [root@localhost gentoo]# emerge -e world
We do this twice in order to ensure that the system has been built using the newest and best optimized versions of itself and its depedencies. This took about 9 hours 12 minutes each time. If emerge fails with an error message, you can skip the ebuild that produced it by using "emerge --resume --skipfirst". A more useful thing would be to mask the particular version of the package that has caused problems by adding it to /usr/portage/profiles/package.mask.
3.a.7. recompile the kernel and restart.
[root@localhost gentoo]# cd /usr/src/linux [root@localhost linux]# make clean [root@localhost linux]# make [root@localhost linux]# make modules_install [root@localhost linux]# cp arch/i386/boot/bzImage /boot/kernel
Then restart the machine, to make sure the new kernel is running.
You have decided to do this the quick way? Simply do this.
3.b. update the system and (un)install packages according to USE flags.
[root@localhost gentoo]# emerge --deep --newuse --update world
We are now finished fiddling with compilers, bootloaders, kernels, and basic network connectivity and can concentrate on the userland. More precisely, what I did with my system was to set up all the hardware for use with a nice KDE desktop running OpenOffice, Firefox, Amarok, Skype, Acrobat Reader, LaTeX, and some other usefull utilities like kile, kdegraphics, kontakt, and korganizer.
The hardware configuration described here is largely based on the entry in the Gentoo wiki.
Throughout this stage of the installation, we will install software components, and chances are that builds will fail every now and then. I find that, generally, the Gentoo developers are doing a really good job maintaining the system, but they do take their time to test things. This leads to a rather conservative configuration with many packages being masked which, actually, sometimes creates, rather than prevents, problems, as some build routines implicitly assume newer versions of certain packages, etc. The key to survival is to use /etc/portage/package.keywords and /usr/portage/profiles/package.mask to mask and unmask package versions until you find a combination that works. What I ended up with was this:
aa1 ~ # vi /etc/portage/package.keywords ...
1. configure the USE variable.
aa1 ~ # vi /etc/make.conf
Refer to this chapter on USE flags in the Gentoo handbook, and configure it in /etc/make.conf according to your needs. I used the following
... VIDEO_CARDS="intel" INPUT_DEVICES="keyboard synaptics mouse" USE="X kde qt4 qt3support hal dbus alsa acpi apm pmu" ...
Make sure you use intel, not i810, as was erroneously claimed in the Gentoo wiki at some point.
2. install some software.
aa1 ~ # emerge gentoolkit pciutils ethtool wireless-tools wpa_supplicant alsa-utils xorg-x11 xdm linux-uvc luvcview
1. associate keycodes with hotkeys
aa1 ~ # vi /etc/conf.d/local.start ... # Set up the wifi-key setkeycodes e055 159 setkeycodes e056 158 # Set up the function keys setkeycodes e025 130 setkeycodes e026 131 setkeycodes e027 132 setkeycodes e029 122 setkeycodes e071 134 setkeycodes e072 135
1. create an xorg.conf.
aa1 ~ # xorgcfg
2. configure the graphics card in xorg.conf.
aa1 ~ # vi /etc/X11/xorg.conf
...
Section "Device"
Identifier "Card0"
Driver "intel"
VendorName "Intel Corporation"
BoardName "Mobile 915GM/GMS/910GML Express Graphics Controller"
BusID "PCI:0:2:0"
Option "AccelMethod" "exa"
Option "MigrationHeuristic" "greedy"
Option "NoDDC" # You need this to set correct DPI (HUGE font issue).
EndSection
...
Section "Monitor"
...
DisplaySize 195 113 # This whill set correct DPI (96 x 96)
...
EndSection
...
Section "Screen"
...
SubSection "Display"
Viewport 0 0
Modes "1024x600"
Depth 24
EndSubSection
EndSection
Make sure you use intel as a driver, not i810, as was erroneously claimed in the Gentoo wiki at some point.
3. configure the touch pad.
Section "InputDevice" Identifier "Mouse0" Driver "synaptics" # This will enable scrolling, etc... Option "Protocol" "auto" Option "Device" "/dev/input/mouse0" # Touchpad. Option "ZAxisMapping" "4 5 6 7" Option "CorePointer" EndSection
4. configure any external USB mouse.
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Device" "/dev/input/mouse1"
Option "Protocol" "auto"
Option "ZAxisMapping" "4 5"
Option "Buttons" "5"
Option "SendCoreEvents" # '''DON'T FORGET THIS'''
EndSection
5. tell the X server about your hotkeys.
aa1 ~ # vi ~/.Xmodmap keycode 160 = XF86AudioMute keycode 174 = XF86AudioLowerVolume keycode 176 = XF86AudioRaiseVolume keycode 223 = XF86Standby keycode 239 = XF86KbdBrightnessDown keycode 123 = XF86KbdBrightnessUp keycode 210 = XF86Display aa1 ~ # echo "xmodmap ~/.Xmodmap" > ~/.xinitrc
6. test the system.
aa1 ~ # echo "exec xterm" >> ~/.xinitrc aa1 ~ # startx
7. write a script to manage any external screen. One of my main applications of my AA1 is to use acrobat reader to give slide presentations on an external screen. At a conference, you don't want to have to start fiddling with your X11 config, so the following script might be useful. It uses xrandr to detect whether an external screen is connected. If so, it toggles through three modes, activating both screens the first time it is called, then only the external, when it is called again, then only the internal. It ensures that an external screen is always activated at 1024x768 resolution. You might want to
aa1 ~ # vi /usr/bin/screenswitch.sh
#!/bin/bash
internal() {
xrandr --output VGA --off --output LVDS --auto --mode 1024x600
echo "internal" > /tmp/screenstate
}
both() {
xrandr --output VGA --auto --mode 1024x768 --output LVDS --auto --mode 1024x600
echo "both" > /tmp/screenstate
}
external() {
xrandr --output LVDS --off --output VGA --auto --mode 1024x768
echo "external" > /tmp/screenstate
}
if xrandr | grep -e "^VGA disconnected" > /dev/null
then
internal
else
if ! [ -f /tmp/screenstate ]
then
both
else
SCREENSTATE=`cat /tmp/screenstate`
case "${SCREENSTATE}_" in
internal_) both ;;
both_) external ;;
external_) internal ;;
esac
fi
fi
If everything works, you might want to use the graphical xdm login manager, rather than starting X.org by hand every time.
aa1 ~ # rc-update add xdm default
For further information, have a look at The X Server Configuration HOWTO of the Gentoo Desktop documentation.
1. run alsaconf.
aa1 ~ # alsaconf
Then answer the questions in the interactive dialog system.
2. configure the module.
aa1 ~ # vi /etc/modules.d/alsa ... options snd-hda-intel model=quanta-il1 ... aa1 ~ # modules-update aa1 ~ # /etc/init.d/alsa restart
The problem here is that there are some issues with the sound card of the AA1 not being properly supported by ALSA. You want to play with the "model=" option. You might want to try "basic", "toshiba", or "acer". This setting of "quanta-il1" was the only one, where I could get the external microphone to work properly, where the sound still works after going to suspend, and where the external speakers are muted when I connect headphones. I couldn't get the internal microphone to work though.
3. set the mixer levels.
aa1 ~ # alsamixer
Set "headphone", "pcm", "speaker" to gain 100% (0db), then set "master" to a gain that's comfortable for your listening. Press F4 to see the faders for capturing. I set Mic and Digital to the maximum gain in the green range, and everything else to 0%. You might want to experiment a little with the levels, using "arecord" and "aplay".
4. test the configuration.
aa1 ~ # aplay /usr/share/sounds/alsa/*
If everything works fine, you might want to start alsa at boot-time.
aa1 ~ # rc-update add alsasound default
For further information, have a look at the Gentoo Linux ALSA Guide of the Gentoo Desktop documentation.
1. modprobe the kernel module.
aa1 ~ # modprobe uvcvideo
2. test the webcam, by running the following under X11:
aa1 ~ # luvcview -f yuv
A window should pop up, showing the video streaming in from the webcam.
If you want to enable all your users (not just root) to access the camera, do this.
aa1 ~ # vi /etc/conf.d/local.start ... # give all users access to the webcam chmod a+rw /dev/v4l/video0 ...
aa1 ~ # echo "pciehp" >> /etc/modules.autoload.d/kernel-2.6 aa1 ~ # echo "options pciehp pciehp_force=1" > /etc/modprobe.d/pciehp aa1 ~ # modules-update
Otherwise, an SD card could only be detected if you insert it at boottime.
1. enable CPU frequency scaling and other power management options.
aa1 ~ # echo "acpi_cpufreq" >> /etc/modules.autoload.d/kernel-2.6 aa1 ~ # vi /etc/conf.d/local.start ... # enable CPU scaling echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor # dirty writeback tactics echo 1500 > /proc/sys/vm/dirty_writeback_centisecs echo 20 > /proc/sys/vm/dirty_ratio echo 10 > /proc/sys/vm/dirty_background_ratio # some more power saving options echo 1 > /sys/devices/system/cpu/sched_smt_power_savings echo 10 > /sys/module/snd_hda_intel/parameters/power_save echo 5 > /proc/sys/vm/laptop_mode # decrease power usage of USB while idle [ -L /sys/bus/usb/devices/1-5/power/level ] && echo auto > /sys/bus/usb/devices/1-5/power/level [ -L /sys/bus/usb/devices/5-5/power/level ] && echo auto > /sys/bus/usb/devices/5-5/power/level # disable wake-on-lan for the ethernet card ethtool -s eth0 wol d # enable power management for the wlan card iwconfig wlan0 power on ...
2. set up ACPI to shutdown on power-button.
aa1 ~ # emerge acpid aa1 ~ # vi /etc/acpi/events/power event=button/power.* action=/sbin/poweroff aa1 ~ # rc-update add acpid default aa1 ~ # /etc/init.d/acpid start
3. set up pm-utils for suspend-to-ram
aa1 ~ # emerge pm-utils
aa1 ~ # echo "SUSPEND_MODULES=\"ath5k\"" > /etc/pm/config.d/ath5k
ao1 ~ # vi /etc/pm/sleep.d/eth0up.sh
#!/bin/sh
if [ "${1}_" == "suspend_" ]
then
ifconfig eth0 up
fi
This is because of some odd behaviour I've observed where, after suspending and resuming, I couldn't get the X server or the ethernet card to work. If the ethernet interface is up before the suspend, everything works. I've got no idea what's going on, but this hack seems to work quite reliably.
4. try suspend.
aa1 ~ # pm-suspend
The AA1 is quite slow at going to suspend. When you see the LED in the power button blinking orange, you're in suspend. Press any button to resume. It also takes quite a while to resume, but seems to work reliably. After you're back, make sure everything still works. Try playing some sound, restarting an X server, etc. These things have been known to break after a suspend/resume.
5. set up ACPI to suspend on lid.
aa1 ~ # vi /etc/acpi/events/lid event=button/lid.* action=/usr/sbin/pm-suspend
The great thing about having a computer without a hard disk, is that it can be very silent, provided you know what to do with the fan. Fortunately Rachel Greenham has written a script to take care of that.
1. download the files acerfand and acer_ec.pl Rachel Greenham's site, put them in your /usr/sbin directory and make them executable.
2. run acerfand on startup
aa1 ~ # vi /etc/conf.d/local.start ... /usr/sbin/acerfand
If you haven't restarted the computer in a while, this would be a good time to do so, and make sure, everything starts up okay and works as designed.
The Gentoo Desktop documentation will show you how to set up your desktop. Use one of the KDE, Gnome, Fluxbox, or Xfce HOWTOs or any other desktop configuration you would like.
Once your desktop is up and running, use it to associate hotkeys with commands. For example in KDE, go to the Control Center, then "Regional & Accessibility", then "Input Actions". Here are some useful commands, you might want to associate with your hotkeys:
The problem with pm-suspend is that only root can execute it.
Since emerge never deletes any files it downloads, chances are that the humble 6GB disk on the AA1 is starting to fill up now. We need to free up some space. You will need to return to this step every now and then, when your disk fills up.
1. unmerge orphaned packages
aa1 ~ # emerge --depclean aa1 ~ # revdep-rebuild
2. clean distfiles and packages
aa1 ~ # eclean distfiles aa1 ~ # eclean packages
Personally, I think these tools are way too conservative. On your AA1 you will have to be rather stingy with filespace.
3. delete remaining distfiles.
aa1 ~ # rm -f /usr/portage/distfiles/*
4. delete kernel sources unless you plan on doing some more fiddling about with hardware drivers.
aa1 ~ # rm -rf /usr/src/linux*
1. OpenOffice? If you need OpenOffice, make sure you install openoffice-bin, not openoffice. The temporary directory for the openoffice build would otherwise fill up the entire disk and fail. The openoffice-bin build does not do that.
aa1 ~ # emerge openoffice-bin
2. Firefox?
aa1 ~ # emerge mozilla-firefox net-www/netscape-flash
3. More stuff?
aa1 ~ # emerge skype acroread
Now that you have a browser, etc., you might want to get ready for mobile networking.
This is largely based on the Wireless Networking chapter in the Gentoo handbook.
1. check that your interface is there
aa1 ~ # iwconfig ... wlan0 IEE 802.11bg ... ...
2. configure Gentoo networking scripts
aa1 ~ # ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0 aa1 ~ # vi /etc/conf.d/net ... modules=( "wpa_supplicant" ) wpa_supplicant_wlan0="-Dhostap"
3. configure /etc/wpa_supplicant/wpa_supplicant.conf
aa1 ~ # vi /etc/wpa_supplicant/wpa_supplicant.conf
network = {
ssid="mynetwork"
key_mgmt=NONE
}
This would set up a very simple unencrypted network with ESSID "mynetwork". Check out the Gentoo handbook for more detail on how to configure your WLAN.
4. start the network
aa1 ~ # /etc/init.d/net.wlan0 start
5. check that the interface is there
aa1 ~ # ifconfig ... wlan0 ... ...
You might have to wait for a bit until you get assigned an IP address, but if you don't, then something is wrong. Once your interface is up and you can ping your standard gateway, etc., start your webbrowser to see if there is a captive portal you have to go through, before you get outward connectivity.
For further information, have a look at the Wireless Networking chapter in the Gentoo handbook.
Hopefully, your system is now up and running. Make sure everything still works after a reboot.
To use an SSD, you will have to insert it at boot-time. Obviously, the linpus guys figured out some way of making this work during runtime, but I haven't yet had the time to reverse-engineer this, and set it up on my Gentoo.
Feel free to drop me an email. My address, spelt backwards, is gro dot mca at riamgrebr. However, I cannot promise a response. In particular, I don't have time to troubleshoot particular software or hardware problems. I only put up this installation procedure, in the hope that it might be useful.
...which reminds me.
This documentation is provided on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing this documentation and assume any risks associated. Should the information prove incorrect or defective, You assume the cost of all necessary servicing, repair or correction.
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor to this documentation be liable to You or any third party for damages, including any general, special, direct, indirect, incidental, or consequential damages of any character arising from Your using this documentation, or Your inability to use it. This shall be the case, even if such Contributor has been advised of the possibility of such damages. This applies, without limitation, to damages for loss of data or data being rendered inaccurate. It also includes loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. Furthermore, it includes losses sustained by You or any third party.
Copyright (c) 2008 Richard Bergmair.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.