This chronicles my recent experiences building, installing, and configuring Gentoo on a Sylvania gBook (a VIA C7-based netbook). Essentially, it's the same hardware layout as the 1GB memory version of the Everex Cloudbook.
There are some hardware and/or configuration quirks with these machines, so the latest tips are captured here, as well as updated below. I've had this thing run for days on the 2.6.31 ACPI kernel without any lockups or i8042 input issues, but it still locks up after 4 hours or so with the 2.6.32-gentoo kernel.
Set the minimum allowed CPU frequency to 600 MHz (using cpufreqd or your tool of choice) and use the ACPI cpufreq driver (not the e_powersaver driver).
Enable all of the latest ACPI features in your kernel config (including the PM timer) and disable the deprecated ones.
Use hdparm on the hard disk with the following parameters: pata_all_args="-d1" and sda_args="-q -S12". The IDE driver gave errors with hdparm, but the pata drivers work fine. Note the 3600 rpm drive will always be slow, but if you're good with tools you can try the "best internal storage hack of all time" described on the Netbook Forum.
With some kernels and/or runtime configurations, the i8042 driver seems to lose state information, which takes out all the input devices attached to it (ie, the keyboard, touchpad, power button, and lid switch). The manual workarounds include plugging in an external USB mouse or (last resort) removing the battery. One of the Netbook Forum users posted a manual technique to rebind the driver, along with some C code to monitor the idle state and launch the rebind script. I've enhanced the script to work both manually and with the above code, which you can download here: i8042 rebind script.
If you're building your own packages for this platform, by all means build in a chroot or similar build environment on a faster box. For reference, it takes 4-5 hours to build a full kernel on this machine...
/dev/hdc (old IDE drivers) or /dev/sda (VIA PATA
driver).snd-hda-intel driver (with specific options).This machine boots readily from an external (USB) CD/DVD drive, so you can pretty much follow the normal Gentoo x86 install guide. I chose to setup an x86 chroot on a fast machine (a dual-core amd64 box) and build the majority of the packages that way; as long as the build host supports the same CFLAGS as the target host, this should be perfectly safe (and has worked fine so far).
Essentially, I have an external USB hard drive with an LVM volume, where I created a 30 MB logical volume (to mimic the 30 GB drive in the netbook) and "installed" the latest Gentoo i686 stage3. Now I can build binary packages on a fast machine with fast RAID disks, and then emerge them later on the netbook. Whether you use LVM or an internal drive for this purpose, you can either scp/rsync the resulting packages to the netbook drive (or just plug the external drive in) or you can use NFS to export some (or all) of your portage tree on your local network (make sure you have "buildpkg" set in your FEATURES)..
Following a few other resources I found on the IntarWeb, I used this for my CFLAGS on the C7:
CFLAGS="-march=i686 -mmmx -msse -msse2 -msse3 -Os -pipe -fomit-frame-pointer"
See the full make.conf file here. There seem to be some odd hardware issues with this machine; see the kernel section for more details.
A few netbook-specific installation tips:
# fdisk -l /dev/sda
Disk /dev/sda: 30.0 GB, 30005821440 bytes
255 heads, 63 sectors/track, 3648 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xdd6cdd6c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 3488 28017328+ 83 Linux
/dev/sda2 3489 3644 1253070 82 Linux swap / Solaris
/dev/sda3 3645 3648 32130 83 Linux
ACPI cpufreq driver - required for full CPU speed (use the P-States driver under CPU frequency scaling in the ACPI section). Also needed for the various CPU frequency governors to control the clock speed. Can be modules. The VIA C7 Enhanced PowerSaver module is now marked dangerous.
Realtek 8187 USB support and generic Wireless LAN support; can be modules. The current in-kernel driver seems to have range and/or connection dropping issues; I don't have this one sorted out yet (the Ubuntu folks work around it by using their "compat-wireless" driver package).
RealTek RTL-8129/8130/8139 PCI Fast Ethernet Adapter support; can be modules (8139too).
Userspace VESA VGA graphics support - this is compiled directly into the kernel (not as a module) and no other framebuffer drivers are enabled. The VESA driver can't seem to handle the right VBE modes, and the VIA driver is even worse. If you want the proper console resolution (and a working console once X starts) then you'll need this. See below for grub and splash options.
VIA PATA support - This is compiled into the kernel, along with the required SCSI disk drivers, etc (the old ATA/ATAPI/MFM/RLL support is completely disabled).
Input Device Support - Here I compiled all the relevant drivers directly into the kernel, including atkbd, evdev, the i8042 PC Keyboard controller, and Raw access to serio ports (psmouse is still a module so it's a bit easier to pass options to it).
USB Support - pretty much whatever you need, in addition to the required VIA drivers for UHCI and EHCI.
This is pretty much the minimum boot configuration needed for the right console resolution; in fact, without it you're likely to get nothing but squiggly lines on the other VTs once X takes over. Note the kernel line should be one long line:
title=Gentoo 2.6.29-acpi test (uvesafb, no splash)
root (hd0,2)
kernel /boot/vmlinuz-2.6.29-acpi root=/dev/sda1 screen=800x480 video=uvesafb:800x480-16@60
Remember the root line above points to sda3 (i.e., my /boot partition). Modify
it to match your setup.
The standard Alsa configuration works fine after you adjust the mixer controls; it may need additional module options to get the correct behavior when the headphone/mic jacks are used.
Xorg also works great with the latest ebuild and my updated config (ie, no more drawing artifacts or other issues) and seems both fast and stable. Just don't enable the ShadowFB option, or your 3D acceleration will fallback from hardware to software. The touchpad requires an InputDevice section for proper config, or you could try a custom hal .fdi file instead. Here's my Xorg config file. Seems like xorg is ignoring the synaptics config in favor of hal. Looks like I'll need that custom .fdi file after all...
Since a working ACPI configuration (including BIOS settings) is pretty much required for most hardware to function properly these days, I made a patched vanilla sources ebuild a while back (mostly because the latest acpi patch release will only apply to the vanilla kernel source, and even then with some effort). The C7 netbook hardware appears to be the most stable on the patched acpi-sources, at least compared to the straight vanilla-sources or gentoo-sources.
You can still download the 2.6.29 acpi-soures ebuild and patch as a tarball here: 2.6.29-acpi-sources ebuild and 2.6.29-acpi-sources patch. Unpack the ebuild in your local portage overlay and place the patch in your distfiles, generate a new manifest, etc.
Many BIOSes seem to be broken in some fashion; your best bet is usually to download and install the latest BIOS update from your vendor. That said, an update could very well introduce new bugs, and may or may not fix your issues. These days, even if you can find a vendor BIOS update, they may only provide a DOS-based (or even Windows-based) flash utility, and if you don't have a floppy drive, you may be SOL anyway... So look around for something like the Netbook User Forum and you may find a bootable CD iso to update your BIOS.
Although loading your own BIOS tables at runtime is discouraged, you may want the option of using a custom DSDT. There is one on the above forum for the Cloudbook, and I made one for the Sylvania version (download it here and use at your own risk). The initrd loading method didn't work for me, but compiling the updated dsdt.hex directly into the kernel works as advertised.
Although the lm_sensors script will detect the C7 sensor interface, the module is not part of any mainstream kernel source. Use the above patch to add a sensor for temperature and core voltage (sorry, that's all the driver currently implements). Update: the patched 2.6.31 ACPI kernel above (with custom DSDT) seems to see a total of three cooling devices, the processor and two fans, but I haven't yet tried manipulating them. Latest dmesg output.
You can also use the above kernel config with gentoo-sources, and follow the normal fbsplash instructions. I had to make my own splash config for the 800x480 resolution, but it works as long as your images are the correct size, etc. I modified the images provided with the emergence theme to the proper sizes and it looks very nice. I'll update this page if the gentoo-sources kernel appears to be stable with the latest config. The acpi-sources kernel is still the current winner for stability...
Overall, the optimized binaries run pretty fast; lxde is snappy, and even a base Gnome install isn't bad... I haven't tried OpenOffice yet, but I wasn't planning on doing any real work on this machine, mostly web browsing, photos, and GPS. I'll see how well ekiga works with the onboard camera once I get a few other things sorted out. Update: ekiga seems to detect the camera with no problems, but cheese is not working yet (still sorting this one out).
last update: 02/11/2010 22:33