Posts tagged ‘Gentoo’

Optimizing Portage compiling on Gentoo with ccache + shm.

I knew about ccache long time ago, also knew about shm (shared memory) on Linux but I realized that I could:

1. Mount my tmp partition on shm, so all the temporary files would be written on RAM, instead of HDD.

2. Now I set the ccache directory to my tmp directory, this way the ccache files will be written directly to RAM, gaining a better performance than usual.

Now add the following lines to /etc/fstab:

/dev/shm                /tmp              tmpfs           defaults,size=80m,auto 0 0

/dev/shm                /var/tmp          tmpfs           defaults,size=80m,auto 0 0

It is defining 80MB for maximum RAM usage by temporary files, you can define more or less memory, as you wish, of course. The flag “auto” defines that these partitions should be loaded automatically at the boot time.

Now add the folowing line for the /etc/make.conf:

CCACHE_DIR=”/tmp/ccache”

This way, ccache will write to your RAM. Now you can try recompiling your whole system with emerge for a test, you’re gonna realize that your HDD won’t get much stress when compiling the sources, since all the temporary files generated during the compiling process are now written directly to RAM.

I will not get into deeper details about ccache and shm, so I suggest you to read the “references”, if you want to know some more.

References:

#man ccache

http://fscked.org/writings/SHM/shm-1.html#ss1.1

http://en.gentoo-wiki.com/wiki/Ccache

http://blog.flameeyes.eu/2008/06/21/debuking-ccache-myths

http://ccache.samba.org/ (official website)

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=3#doc_chap3

http://www.tuxfiles.org/linuxhelp/fstab.html (fstab tutorial)

Advertisements

Xorg 1.5 Upgrade Guide

Xorg 1.5 Upgrade Guide for Gentoo (though it might be useful for other distros as well)

http://www.gentoo.org/proj/en/desktop/x/x11/xorg-server-1.5-upgrade-guide.xml

EEE-PC 1000HA optimized kernel configuration.

So, after a lot of tweaking, I got a very optmized kernel configuration for my eee-pc 1000HA, which runs on Gentoo. However, considering that the linux kernel is just a part of a whole distro, it doesn’t matter if you are running another distro instead of Gentoo.

By the way, this kernel config may also works to the EEE-PC 901.

So, where’s the beef?  Here it is:

Download–>   eeepc1000ha_kernel

The config file above has been tested for the 2.6.28 kernel release.

Please, if you have found something to improve (features to add or to remove) into this kernel config,  please share your thoughts. Together, we can build it better! 🙂

Unfortunately the kernel driver ath5k (wireless) will not work with atheros chip 5007 (which is the one who comes into the 1000HA), so for this time you’ll need the madwifi driver:

http://madwifi-project.org/ticket/1192

At the moment I’m still testing this driver and will be posting here some instructions when I get it working properly.

Personal note about unmerging python on Gentoo

NEVER unmerge python on a Gentoo system unless you wanna screw up the whole system!

The emerge itself isn’t a binary file, it depends on python to work, so now you understand what I’m talking about, right? I hope so, ’cause I learned it by the pain and I hope someone else will not pass by the same situation as I did. 🙂

However, if you are reading this text and you fell under the same situation, please write me and I can give you some tips on how to fix all the shit without losing all your past configuration.

Disabling xorg 7.4 auto-config function.

I just bought an eee-pc 1000HA, was installing Gentoo Linux on it and I realized I had to update the xorg to the 7.4 version, otherwise the AIGLX (3D acceleration) wouldn’t work at all. But then I fell into another trouble, the 3D accel was working really great but the mice (notebook mouse) wasn’t working at all.

After a lot of time, googling and tweaking like hell, I just have found that the problem was into a new function of xorg 7.4, this new version does auto-configuration and therefore any configuration line  you may try to add to the xorg.conf, related to mouse and keyboard config WILL BE IGNORED.

To avoid it to be ignored, you’ll have to add the following line to your xorg.conf:

Section “ServerFlags”
Option “AutoAddDevices” “False”
EndSection

It might solve the problem.

Speeding up emerge with tmpfs

Very nice text describing how to optimize the Gentoo emerge for a faster source compiling.

http://en.gentoo-wiki.com/wiki/Speeding_up_emerge_with_tmpfs