optimize Gentoo with tmpfs

Posted by Mathieu Jobin Thu, 23 Aug 2007 09:40:52 GMT | no comments

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.

Posted in , ,

Internet speedtest

Posted by Mathieu Jobin Thu, 05 Apr 2007 05:35:23 GMT | 1 comment

Wireless

Cable

Conclusion

My wireless router(BLW-HPMM) and my wireless card(SMC2835W) are very good ;)

Posted in ,

Trying out KDE4

Posted by Mathieu Jobin Sat, 17 Feb 2007 05:35:30 GMT | no comments

So I wanted to have a sneak preview at KDE4 and also have the development environment ready in case I find some time to fool around.

So I compiled KDE on my gentoo system. I simply followed the various instruction found on the developer website. I created a kdefour user. Installed cmake and Qt 4.2.2 normally using gentoo portage system. and from kdelibs into the user home directory.

that's what my .bash_profile looks like

kdefour@krypton ~/usr/build $ cat ~/.bash_profile
# /etc/skel/.bash_profile

# This file is sourced by bash for login shells.  The following line
# runs your .bashrc and is recommended by the bash info pages.
[[ -f ~/.bashrc ]] && . ~/.bashrc
export YACC='byacc -d'
#export QTDIR=$HOME/usr/qt
export QTDIR=/usr
export KDEDIR=$HOME/usr/kde
export CMAKE_BUILD_TYPE=debugfull
export PATH=$HOME/bin:$HOME/unsermake:$QTDIR/bin:$KDEDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$KDEDIR/lib:$LD_LIBRARY_PATH
function cmakekde { cmake -DCMAKE_INSTALL_PREFIX=$KDEDIR \
-DCMAKE_BUILD_TYPE=debugfull $@ && make VERBOSE=1 && make install
}

kdefour@krypton ~/usr/build $            

and I created myself a small rebuild script

kdefour@krypton ~/usr/build $ cat rebuild
#!/bin/sh

source ~/.bash_profile

modules="kdelibs kdepimlibs kdebase koffice kdegames"
modules="koffice kdeutils kdenetwork kdemultimedia kdepim"
build_dir="/home/kdefour/usr/build/"
src_dir="/home/kdefour/usr/src/"

for i in $modules
do
        echo $i
        #echo $build_dir$i
        #rm -fr $i
        mkdir -p $build_dir$i
        if [ -d $src_dir$i ]
        then
                (cd $src_dir$i; svn up)
        else
                svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/$i $src_dir$i
        fi
        cd $build_dir$i
        time cmakekde $src_dir$i
        if [ $? -ne 0 ]
        then
                cd -
                echo $?
                break
        fi
        cd -
done

kdefour@krypton ~/usr/build $     

and here is a small screenshot for the curious

kde4 snapshot 1

Posted in ,

How to not being forced to XOrg 7.1 on Gentoo

Posted by Mathieu Jobin Fri, 17 Nov 2006 15:28:42 GMT | no comments

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.

Posted in , , ,

Gentoo Binary Packages repository

Posted by Mathieu Jobin Thu, 12 Oct 2006 02:37:00 GMT | 1 comment

Like I heard many people saying, I really like gentoo very much but sometimes I just one this package real quick. For that, a Binary Packages Repository (BPR) would be quite appreciated.

There was the Chinstrap Project that unfortunately being abandoned. I think it is very sad such a project is abandoned. There is also klik which actually is VERY GOOD, but aimed for (cross-distrib) desktop use, not as a core system solution. I think gentoo needs something on its own to his image.

There has been discussion about it before, and apparently the problem with binary distribution is that it breaks and needs to be reinstalled. My personal problem with Binary package distribution just as Mandrake or SuSE is package availability. some and few packages that I want are not available. and/or you need to manage a list of download sources, which is a pain in the butt. Then it finally comes down to compiling it from source except that it won't be registered in your system database. which I don't like. I want everything and every-file to be registered, removable and manageable.

That is why I like gentoo. every single packages are there. even proprietary stuff like CrossOver. The Gentoo portage won't be able to download it, because its paid software. but if you download it, put the file in your distfiles directory. it will check the digest and record this package into your system package database. THAT is GOOOOD.

What I am thinking is having emerge being modified to upload packages after the compilation is done. so everyone in the world would be uploading package unless already found, in which case it would have got downloaded. So If found, download, if not, compile and upload.

In order to keep system stability, I'm not sure how many duplicates of the packages we should need to store. I would be thinking....

http://gentoo.packages.example.com/gentoo/[arch]/[CHOST]/[gcc version]/[glibc version]/[package group]/[package name]/[package version]/file

that might become crazy, but it might be what it needs. even USE flags might have to be thrown in there.

I'm not sure how would be best to organize the use flags. but one way which would not be human browsable but flexible would be to assign a unique bit-flag to every USE flags. just like filesystem permission, where r-x becomes 5 the total would become a huge number but it would not matter I think.

so it might become something like

http://gentoo.packages.example.com/gentoo/x86/i686-pc-linux-gnu/gcc4.1.1/glibc2.4/kde-base/kdebase/3.5.5/kdebase-3.5.5.gentoo-bin.tgz

that would required a lot of space and bandwidth I would guess, but I think its worth the try. problems can be fix in time.

opinion?

Posted in , ,

Updating E17 on Gentoo

Posted by Mathieu Jobin Sat, 12 Aug 2006 07:35:00 GMT | no comments

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

Read more...

Posted in , , ,

ALSA we love you

Posted by Mathieu Jobin Sat, 15 Apr 2006 06:59:00 GMT | no comments

Anyone had fun with ALSA before ? Some would say its much better than OSS and much more powerful. Some would simply say the it supports more cards (well of course, development on OSS is kinda stopped for a while already) anyway.

Who need this kinda of configuration ? why there is so many options to this config file ? its like your computer could really have 5 different sound card and reroute them in some weird way. well, buy a mixer. got true use for all the power ALSA offer ? please comment below.

I'm just to a point where, even though you are a geek programmer, if all you want to do is software or web development. You don't really want to understand the fully underlying sound system of your operating system to chat with your girlfriend. There is advantage Linux has I can't live without but there is huge whack of extra time that you have to spend in order to get things working. And some of you who does not have problem, well either you have not used it long enough or you are just as picky as I can be.

anyway, I did not want to troll about anything today. I'm just very tired of rebooting on windows when I have to do my phone calls. And the good news is: I found this little hack that I need to get both my soundcard device and my USB microphone as default device.

somekool@krypton ~ $ cat /etc/asound.conf
pcm.!default {
        type asym
        playback.pcm {
                type plug
                slave.pcm "hw:0,0"
        }
        capture.pcm {
                type plug
                slave.pcm "hw:1,0"
        }
}
somekool@krypton ~ $

that's it. so now I can just use arecord to record my voice without needing any options to specify the proper device.

somekool@krypton ~ $ arecord file.wav

well am I happy ? not really. skype needs OSS or OSS emulation to work. it does not use ALSA directly. but OSS is too old. and I can't really switch my system to it. so I'm not sure if I can get an OSS-emulated device for my USB microphone or If I really need to get arts to see my microphone. arts seems the easiest way to get everything working. but for some reason, it still does not see my microphone.

Hey you out there who knows all about it but are just a little to shy to help. show yourself off it will be highly appreciated.

Posted in , , , ,