optimize Gentoo with tmpfs

Today has been a very rewarding day for finding interesting articles. Apart from the articles that I will mentioned in my next article here is one for my readers who runs the Gentoo operating system.

http://apcmag.com/6636/Gentoo tip for the love of tmpfs

Basically the idea is to mount a virtual file-system over the directory that stores temporary files used during compilation of new software (/var/tmp/portage). As most you you might know, Gentoo includes a system that automatically compile and install software for you. The great part is that it is very easy to use, the down part however is that it sometimes takes hours to install a certain software. The Hard Drive being the slowest part in the equation has just to be removed.

To try it out simply add this line to your /etc/fstab file and mount it as root or reboot.

none /var/tmp/portage tmpfs size=212M,nr_inodes=1M 0 0

You might also want to kill the content for the directory before, as it most probably contains lost of useless data which would then be hidden behind the mount.

rm -fr /var/tmp/portage ; mkdir /var/tmp/portage

Now the guy in the article use a 1412M sized tmpfs virtual partition on a 2G of RAM system. I really wonder how this would work on a 512MB RAM system. It might just swap all the time removing the whole idea. So I'm not sure this tricks helps people who really needs help. (the people with regular hardware)

What I really would like to understand is how the tmpfs kernel module know when to delete or not a file from the memory. I'd be afraid that it kills some .o out of the memory before the full compilation comes to an end. Or that it keeps all these temporary files in memory for hours after the compilation is done. I'd like to understand the magic.

For more Linux related article, checkout their Kernel Knowledge page

Update: Then later I found in the comment it is useless to add an extra tmpfs as Gentoo always have one enabled.

And I Quote .... "You can always do this by using the existing tmpfs, /dev/shm. /dev/shm will allocate up to 1/2 of your system RAM for tmpfs and it should already exist. To use it change/add the following three lines to your gentoo /etc/make.conf file:"

PORTAGE_TMPFS="/dev/shm"
PORTAGE_TMPDIR="/dev/shm"
BUILD_PREFIX="/dev/shm"

Good luck in your trials. And please post comments on your experimentations.

Tags , , , , , , ,

Posted in , , | Posted on 23 Aug 2007 02:38by somekool | 4 comments

How to not being forced to XOrg 7.1 on Gentoo

If you are like me, you like system that works and you care much more about the latest version of KDE than the latest version of XOrg. especially when updating KDE is pain-less and bug-free while XOrg means talking with God, backup-ing your Mother and what not.

So I wanted to be able to run

emerge -avUNt world

like everyone else, while staying on XOrg 6.9 Like you might know, the recent portage are not forcing us to do the update. you cannot run 'emerge world' without upgrading. and upgrading is far from being easy. While preventing portage from forcing is not as easy as it sound. It is not that hard. thanks to /etc/portage system.

here is how to do it.

  • first add the following lines in /etc/portage/package.mask

### I dont want to update X
>=x11-base/xorg-x11-7.0
>=app-doc/doxygen-1.4.5
>=media-gfx/imagemagick-6.2.5.6
>=x11-libs/qt-4.1.4-r1
>=media-gfx/graphviz-1.16-r2
>=app-office/openoffice-bin-2.0.3
>=media-libs/libsdl-1.2.8-r2
x11-libs/libXScrnSaver
### END
  • then add the following line in /etc/portage/package.unmask
<x11-base/xorg-x11-7.0

after that you might get 1 or 2 more problem. I remember I also had to modify an ebuild and remove a useless dependency on a package. if it does not work for you. please comment below. I'm gonna help you to go through it and I'll update this post for a more accurate information.

have a nice day.

Tags , , , , , , , ,

Posted in , , , | Posted on 17 Nov 2006 07:20by somekool | no comments

Updating E17 on Gentoo

Maybe some of you have tried the excellent Enlightenment 17. Although still under heavy development, its definitly worth the look. Luckily for us gentoo user, there is ebuilds already done which makes the compiling task easy. Still, when is time to upgrade, it's a not all automatic. The problem is; all packages keeps de same version (9999 for development). So, if you re-emerge e, it will not re-emerge all the dependencies, because they are already installed and the version number has NOT changed. So You have to check all the dependencies and make sure to re-emerge them all, in order. its a bit of a pain in the butt when you just want to see the latest development the team has made. So I wrote a script to make it even easier. I wrote it few months ago while I was doing it by hand. and Few days ago, I thought I might upgrade E17 again and check it out. so I tried out my script which worked with not too many bug fixes ;) hehe.

click more for the script and to send comments

It's not 100% production quality, but it does the job ;) maybe you'll laugh on the incomplete part, maybe not.

$ cat ~/bin/emerge_e17
#!/bin/sh
# krypton ~ # epm -qa | grep 9999 | cut -d \- -f 1 | xargs  echo
# eet embryo engrave e_utils examine edje epsilon epeg engage ewl evas ecore esmart e
# http://www0.get-e.org/EFL_User_Guide/English/_pages/print.html

e17_ignored_libs="imlib2 edb"
e17_libs="eet evas ecore epeg embryo edje epsilon esmart emotion ewl engrave emotion"
e17_wm="e"
e17_dm="entrance"
e17_apps="entice elicit embrace eclair evfs entropy exhibit eclair ephoto erss evidence"
e17_misc="e_utils examine engage"
e17_proto="etk exhibit entropy"
e_modules="calendar flame monitor mount rain screenshot slideshow snow tclock weather"
default="$e17_libs e engage entice elicit eclair"


function choose_packages() {
        if [ -f /tmp/.e17.package_list ]
        then
                echo `cat /tmp/.e17.package_list`
        else
                echo "what would you like to (re)install ?"
                echo "-1 - The Default ($default)"
                echo "0 - imlib2"
                echo "1 - libraries ($e17_libs)"
                echo "2 - Window Manager (e17)"
                echo "3 - Extra packages ($e17_apps $e17_misc $e17_proto)"
                echo "4 - Extra Modules ($e_modules)"
                echo "5 - Themes (none)"
                read answer
                echo "you choose ($answer) but I'll go anyway with the default because I'm lazy."
                echo "$default" > /tmp/.e17.package_list
                echo `cat /tmp/.e17.package_list`
        fi
}

function compile_app_list() {
        did_something=0
        for package in $1
        do
                if [ ! -e /tmp/.e17.$package ]
                then
                        echo "emerging $package...."
                        emerge $package
                        err_code=$?
                        if [ $err_code -eq 0 ]
                        then
                                touch /tmp/.e17.$package
                                did_something=1
                        else
                                echo "... emerge returned error code $err_code"
                        fi
                fi
        done
        echo $did_something
}

function main() {
        list=`choose_packages`
        rep=`compile_app_list "$list"`
        if [ $rep -eq 0 ]
        then
                echo "All package has already been emerged, you would like to start over ? (y/n)"
                read answer
                if [ "$answer" == "y" ]
                then
                        rm -f /tmp/.e17.*
                        list=choose_packages
                        compile_app_list $list
                fi
        fi
}

main

enjoy

Tags , , , , , , ,

Posted in , , , | Posted on 12 Aug 2006 00:35by somekool | 2 comments

Subscribe

Personal Links

Tags

Categories

Archives

my Xbox 360 gamertag

my last twitter posts

Copyright © Mathieu Jobin's Life and Thoughts

Tech Blue designed by Hive Designs • Ported by Free WordPress Themes and Frédéric de Villamil Powered by Typo