Showing posts with label Gentoo. Show all posts
Showing posts with label Gentoo. Show all posts

Sunday, 8 August 2010

OpenSUSE 11.3, the best binary KDE distribution or best KDE distribution?

I have been using Gentoo for a few months and it has been a good experience but generally I can't see myself continuing to use it.

The advancement of modern day hardware has made using Gentoo a less time consuming experience.

What would once take days or weeks, now takes hours.

The end result is an optimized system tailored to your needs.

My needs are quite simple, good multimedia functionality, web browsing and office use. So with Gentoo I am able to create a system that can meet my needs and there is the added benefit of that little extra nippy feel and quicker application load times.

Initially I was relying on default use flags set by the kde desktop profile, lets look at an emerge --info output for this profile.

USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif gpm gtk hal iconv ipv6 jpeg kde lcms ldap libnotify mad mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl nptlonly ogg opengl openmp pam pango pcre pdf perl png ppds pppd python qt3support qt4 readline reflection sdl session spell spl sse sse2 ssl startup-notification svg sysfs tcpd tiff truetype unicode usb vorbis x264 xcb xml xorg xulrunner xv xvid zlib"

It seems like a lot but that isn't necessarily a bad thing. If a software package has support for ipv6 and it is defined in your use flags, it will be built to support it. If however, it doesn’t have support for ipv6 it wont magically be built in.

I was quite happy with the performance my Gentoo install had using the kde desktop profile but decided to see if I could improve it. So after much tweaking I was able to reduce the use flags to the following,

USE="3dnow X a52 aac acpi alsa amd64 bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr encode exif firefox flac gif gpm hal jpeg kde libnotify mad mmx modules mp3 mp4 mpeg mudflap multilib ncurses ogg opengl pam pcre pdf perl png ppds python qt3support qt4 readline reflection samba sdl session spell sse sse2 ssl startup-notification svg sysfs tcpd tiff truetype usb vorbis x264 xcb xml xorg xv xvid zlib"

So what was the outcome?

The outcome was, packages had fewer dependencies and as a result a few less packages were installed.

Performance / memory consumption wise, absolutely no difference.

Not that I expected to see any. Most of the 485+ packages I happen to have installed use few to none of the use flags.

You can only tweak your system so far. Beyond that you are only engaging in a pointless exercise.

Based on my experience, I see no point in trying to tweak the kde desktop profile.

Infact I am now wondering what would happen if I build all packages to support as much as possible, which is what all your major distributions do.

Will I notice a difference?

I have my doubts.

I stated above that the modern day hardware has made using Gentoo a less time consuming experience but there is also another consequence of having more powerful hardware.

As software packages support more and are built with more functionality, its code size typically increases. Memory consumption therefore goes up and so does execution time. However modern day hardware is having a counter effect on these negative aspects.

Modern day hardware can process code quicker and more memory is readily available. So despite your binary distribution being compiled with generic optimizations and software packages being built to support as much as possible, the performance in most cases is getting better providing your system isn’t old.

Gentoo has lost its appeal on the performance front because for many users the gain ranges from minor to negligible. When you also take into consideration to time it takes to setup / update Gentoo, it simply isn't worth it.

Infact what is the general consensus concerning Gentoo today?

Is it about performance or control?

Interestingly, OpenSUSE 11.3 was released not so long ago and the performance is very nippy. If you haven’t tried it, I suggest you do.

My utter disappointment with OpenSUSE 11.2 (it was very sluggish) is what made me try out Gentoo.

Funnily enough, OpenSUSE 11.3 has changed some of my thoughts about Gentoo.

I once said,

"Gentoo, If you have the time and are willing to put in the effort then why not?"

I now say, because the gain is so small it becomes a pointless effort.

OpenSUSE 11.3 takes 10 to 15 minutes to install and performance is great. Even though I can still feel a little more nippiness in Gentoo and applications load that bit quicker, common sense rules in favour of OpenSUSE.

A superb effort by the OpenSUSE team, they have delivered a well polished and professional product with good performance.

I still believe Gentoo is the most innovating distribution to exist, their package management portage is truly a piece of art. The level of control, the ability to tailor the system and the learning experience cannot be matched by anything else.

The only problem is I am just using it for the wrong reason.

Gentoo and KDE 4.4.5 - A snapshot of the past...

Gentoo isn't about performance, that is only a side effect. The real power behind Gentoo is it's control.

Wednesday, 4 August 2010

How to install Gentoo using a Ubuntu 10.04 Live CD

This blog post will show you how to use a Ubuntu 10.04 Live CD to install Gentoo. You can also easily adapt this guide to work with other Live distributions or installed distributions.

Important Rule:

For a Gentoo (32-bit) install, use a Ubuntu 10.04 (32-bit) Live CD 
For a Gentoo (64-bit) install, use a Ubuntu 10.04 (64-bit) Live CD

You may wish to refer to the Gentoo Handbook throughout,

Gentoo (32-bit) - http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?style=printable&full=1
Gentoo (64-bit) - http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?style=printable&full=1

Once you have successfully chrooted into your Gentoo system, the fact that Ubuntu was used becomes irrelevant. I therefore see no point in reiterating the Gentoo Handbook after this stage.

However, when you exit the chrooted environment you return to Ubuntu. As a result I have updated step 10.d from the Gentoo Handbook to reflect this.

Please also bare in mind Gentoo is a very customizable platform, certain choices I have made may not suit everyone or you may have your own preferences.

For example, the Gentoo Handbook suggests a separate /boot partition, I will not be doing this.

This guide also assumes you wish to install Gentoo 64-bit, 32-bit users must modify steps accordingly.

Start

Boot from the Ubuntu 10.04 Live CD and make sure you have internet access.


Prepare your Hard Disk

Use Gparted to prepare your hard disk for Gentoo.


I will be formatting my 465.76GB (aka 500GB) disk drive /dev/sda to the following layout,

Click on the picture for a bigger view

As can be seen from the screenshot, the partition setup is the following,

/dev/sda1 formatted to ext4 with 58.59GB ---> This will be my /root partition
/dev/sda2 formatted to ext4 with 403.17GB ---> Intended /home partition
/dev/sda3 as the swap partition with 4096MB

Once Gparted has created the partitions, right click on the swap partition and select 'swapon' from the context menu.

Use Gparted to activate the swap

Close Gparted and open a terminal.



Use the terminal to type the commands presented below.

Mounting your /root partition

sudo mkdir /mnt/gentoo
sudo mount /dev/sda1 /mnt/gentoo
cd /mnt/gentoo

Remember to mount your intended /root partition as /mnt/gentoo. In my case, /dev/sda1

Download and extract Stage3 tarball

Modify the mirrors if necessary, You can find the list of mirrors here, http://www.gentoo.org/main/en/mirrors2.xml

sudo wget -r -l1 -H -t1 -nd -N -np -A.bz2 -erobots=off http://gentoo.virginmedia.com/releases/amd64/autobuilds/current-stage3/

sudo tar xvjpf stage3-*.tar.bz2

Download and extract portage tarball

sudo wget http://gentoo.virginmedia.com/snapshots/portage-latest.tar.bz2
sudo tar xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr

Modify your make.conf to suit your system

sudo nano -w /mnt/gentoo/etc/make.conf

Chrooting into Gentoo

sudo cp -L /etc/resolv.conf /mnt/gentoo/etc/
sudo mount -t proc none /mnt/gentoo/proc
sudo mount -o bind /dev /mnt/gentoo/dev
sudo chroot /mnt/gentoo /bin/bash

The use of sudo is now no longer required!

env-update
source /etc/profile
export PS1="(chroot) $PS1"

At this point you have successfully chrooted into your Gentoo environment. Just follow the Gentoo Handbook to complete your install.



Remember to replace step 10.d with the following,

Rebooting the system

exit
cd
sudo umount /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo
sudo reboot
Misc Notes

If you do decide to follow my partition setup, remember to add an entry in the /etc/fstab for the /home partition and enable ext4 in the kernel.

Enjoy Gentoo!

Saturday, 15 May 2010

Gentoo KDE 4.x – Epson Stylus C84 Photo Edition support

(Gentoo installation notes - Printing)

What good is a desktop PC if it can't print?

Here are some simple steps to get the above printer and many others working since the gutenprint package contains support for a lot of printers by various vendors such as Cannon, Brother, HP, Dell ......

See the below link for a full list of supported printers.

http://gutenprint.sourceforge.net/p_Supported_Printers.php

Open a terminal and with root access type the following,

emerge -av cups gutenprint
/etc/init.d/cupsd start
rc-update add cupsd default

KDE users can now configure their printer using System Settings > Printer Configuration

Or if you prefer the cups browser interface, http://localhost:631

Wednesday, 12 May 2010

Gentoo just makes sense!

After using Gentoo for a just over a month I am beginning to realize it makes sense. An initial conclusion I made about Gentoo was that most people should,

"stick with your current distribution or use something else as the speed improvements are small and for most people not worth the hassle"

http://linuxtweaking.blogspot.com/2010/04/gentoo-sweet-dream-or-beautiful.html

However I am not most people, I say this on the basis that I like to tweak my system for performance.

Unfortunately the problem I have been facing with every binary distribution I have used is the bloat and noticeable sluggish performance.

My solution which doesn't improve things much is to try and tweak various settings / services until I am satisfied. But here is the real problem, I often find myself spending far too much time trying to make it work how I want.

This is why Gentoo makes sense. It is logical, I spend the time installing it with the added benefit that after installation  it works how things should work. Fast, efficient and no bloat.

With other distributions such as OpenSUSE, Ubuntu and Fedora after dedicating time to install it, I then have to spend additional time trying to make it work how I want it to work. This isn't right, it is illogical.

Why buy a boat with the intention of using it as a car, you would be better off making a car from scratch.

Out of the recent distributions I have tried, Gentoo has to be the most innovating I have used to date. It has provided me with the ability to create the perfect setup with positive results and in a satisfying manner.

I have lost count the amount of times I have felt disappointed after installing  a recently released distribution. Disappointed with its speed, system responsiveness and general assumptions made as to which applications or services should be running by default.

This disappointment is only further enhanced when I take the plunge in an attempt to try and tweak the system to make it work how I want it to work.

Linux distributions are too generic and performance is compromised as a result. My Gentoo experience has enlightened me even further on this aspect.

Being too generic is a bad thing, some may say it is advantageous because it is more adaptable but desktop users do not require this. If Linux overall is to succeed in taking over the desktop it must become more streamlined to desktop users.

I find it ironic when a Linux kernel that is part of a distribution is labeled as a desktop kernel, for example in OpenSUSE 11.2 you may notice the -desktop at the end of your kernel but when you view the kernel configuration it has support for 64 processor cores, extended non-PC platforms and extensive debugging options enabled.

These are simply bumping up the kernel size, adding more subroutines and slowing it down.

Looking at the distribution itself, security features such as AppArmor and SELinux have no real benefit to your average desktop user and further add a performance penalty.

So this is why I have decided to give Gentoo a whopping 500GB of disk space on its own dedicated Samsung F3 hard disk drive.

It works so well, it is fast, has nippy performance and is tailored for my needs. This is exactly the same reason why I always build my own PC's.

Gentoo, a waste of time and effort?

If you have the time and are willing to put in the effort then why not?

Gentoo 10.1 x64 - KDE 4.4.3

I am not giving up on the other distributions and will continue to evaluate their progress but Gentoo has earned its place on my system, at least for now.

Tuesday, 6 April 2010

Gentoo, sweet dream or a beautiful nightmare?

The Gentoo penguin, the fastest underwater swimming bird capable of reaching speeds of 36 km/h or 22.3 mph, but in the world of Linux Gentoo is another distribution with some very interesting differences.

http://www.gentoo.org/

Your average distribution consists of many software packages which have already been compiled from source and ready to install.

The distribution vendor is responsible for compiling all the software packages from source and grouping it together to create the distribution you download.

This also applies to software updates, the distribution vendor compiles the updates from source and stores it on a server ready for users to download.

One big disadvantage with this approach is all the software packages are compiled with very generic options and optimizations so that they are compatible on as many systems as possible.

As a result performance is sacrificed in favour of compatibility.

Another problem with your average distribution and I quote from the Gentoo Manual,

"Most distributions compile their packages with support for as much as possible, increasing the size of the programs and startup time, not to mention an enormous amount of dependencies"

Unfortunately this is standard practice with most distributions.

Is there an alternative?

Distributions could be provided in more flavours giving the user the choice to download a version which has been specifically compiled with optimizations for their processor architecture only.

Typically with your popular distribution you can download either an x86 or x86_64 bit version but why not provide more specific choices within these categories?

Hang on a minute, how many different processor types are there?

A quick look at the GCC (compiler program used to compile most Linux source code) documentation reveals, quite a bit. I count 39.

http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html

We can therefore conclude the practicality of providing more specific fine tuned distributions and software packages is far from practical.

The distribution vendor would have to provide 39 different operating systems to download and also maintain a software repository containing 39 variations of the same piece of software for updates.

In addressing the second issue of compiling programs with much support as possible, given that all code is compiled in a generic fashion it just makes sense to follow the trend of compatibility and to support as much as possible.

So is there an alternative, at this point you would be right to think no.

However you would be wrong. There is an alternative and it is called Gentoo.

Gentoo addresses the above issues because it is not supplied in a ready to use compiled state.

Gentoo is a source based distribution.

When you download Gentoo, you get a live installation setup CD / DVD. You then have the joy of setting up your system from near enough scratch.

Part of the Gentoo install process involves compiling all software packages and the kernel from source!

Prior to compiling, you have to setup the GCC compiler options meaning you can tune the compiler to compile all source code in a way that is optimized for your processor.

You can also set various USE flags used to compile software, so you can decided overall what your software should support and avoid doing what most vendors do, to make software packages support as much as possible.

Sounds cool?

It does indeed but there are very big disadvantages with the Gentoo approach.

It is very time consuming, compiling a complete system with a graphical desktop environment can take a number of hours or days depending on your processor and available memory.

You must know what you are doing.

And whilst not a disadvantage, does the optimization benefits justify going through this long process, are the speed improvements worthwhile?

There is only one way to find out.

I have never tried Gentoo before, so this will be quite interesting. Is it really as good as some people say?

After consulting the manual I proceeded to download and create the Gentoo 10.1 installation DVD.

Booting from the DVD takes you to a KDE desktop environment. I used Konqueror web browser to open the Gentoo manual and followed the procedure.

Was it straight forward?

Gentoo provide enough documentation and a good wiki but it is assumed you have the relevant experience and/or knowledge.

Going through the Gentoo install process requires using the terminal with root access. The live DVD does not allow you by default to use the KDE environment with root access but does default to root access in the virtual terminals.

So if you want to consult the manual online in KDE and use a root terminal you have to keep switching between a virtual terminal and graphical environment (KDE).

However the way around this is to enable root access in the KDE desktop environment so you can have Konqueror open to view the manual and use the KDE Konsole to setup your Gentoo install.

I simply typed in the virtual terminal, passwd. It will ask you to enter the new password for root.

Now switch back to KDE (Ctrl-Alt-F7) and you can become root using the password created above. As a result you can view Konsole and Konqueror side by side.

And that's an example of where knowledge is assumed. Would I even have thought about this as a newbie?

Another benefit due to the above is that rather than using command line to create your disk partitions you can now use the Kpartition application on the Gentoo DVD, which is a nice GUI interface.

Less typing on the keyboard means you are reducing your chances of developing RSI.

Creating partitions

When is comes to setting up your disk partitions the manual uses the example of creating the following,

/boot (ext3)
/root (ext3)
swap partition

A more preferable setup would be to create a separate home partition as follows,

/root (ext4)
/home (ext4)
swap partition

I went for ext4 because it is default for most recent distributions and better than ext3 in terms of design, performance and reliability.

As a result of choosing an ext4 filesystem, I had to enable ext4 support in the kernel.

Compilier options

The most interesting part for me during the install process was setting up the compiler options. As a first time Gentoo user I have never done this before and had to spend a bit of time researching GCC.

If you want your Gentoo system optimized for your system the compiler options must be selected accordingly.

With my current system featuring an AMD Athlon II X2 250 AM3, I worked out the appropriate -march type was amdfam10.

Here are the options I used.

CFLAGS="-march=amdfam10 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j3"

Kernel Configuration

Configuring the Kernel is something I have done many times. Mainly to tweak things or just experiment. In my early days with Linux I set myself little missions :-)

How small can I make the kernel without having any negative impact on my system, what happens if I do this, what does that do.

I remember during Fedora Core 4 I was playing around with Dazuko and AntiVir, which required setting the default Linux capabilities in the kernel as a module in order for Dazuko to work. It may sound so easy now but back then it was a great learning experience.

Back to Gentoo, the manual states you have two options regarding the configuration of the kernel. First, manual configuration and second is using GenKernel.

You can guess I went for a manual.

I left most of the kernel options to their default values as at this stage I am more concerned with getting Gentoo up and running rather than tweaking the kernel which can be done well after install at any time.

I did set the processor type and also noticed the kernel was set to compile with the option 'optimize for size' which means passing -Os to the gcc compiler. Not something I want, so this was changed.

After the kernel compiled, its just a case of setting up various things.

Grub, manual is safer

Again with the grub configuration I went for a manual approach, I have two hard disks in the system and wanted to ensure no mistakes.

After the grub configuration your Gentoo install is more or less complete.

Rebooting the system 'should' take you to your nice new Gentoo base system.

After my first reboot I noticed an error message about dchp cant find eth0 and no network module was present. I realized I must have missed out the appropriate module in the kernel configuration.

The great thing about this was I was able to quickly sort the problem by recompiling the kernel and updating the grub.conf to point to the newly compiled kernel a few minutes.

So what next?

As a desktop user a monitor displaying a black terminal isn't very useful. So we need to install a desktop environment such as Gnome or KDE.

During the install process you are asked to choose a system profile for your Gentoo system, I chose desktop.kde.

The profiles are geared towards making your system more tailored for a particular use, as in my case KDE and it sets appropriate use flags when compiling KDE and applications.

The first step to getting a working KDE environment is to install the X server which is the graphical backend for Linux and is used by desktop environments such as KDE and Gnome.

Consulting the Gentoo documentation provides much needed guidance.

http://www.gentoo.org/doc/en/xorg-config.xml
http://www.gentoo.org/proj/en/desktop/kde/kde4-guide.xml

Both those parts took a very long time, as everything is compiled from source. I would estimate the total time was 6 hours to compile.

I was quite excited when my KDE 4.4.2 compiled and install was complete.

All I had to do was create a new user account, type a few commands and login.

The first KDE 4.4.2 login, the big moment!

It was hard to assess if compiling the base system with optimizations for my system was faster or more responsive, there isn't much that can be observed apart from a blinking cursor.

I was hopeful that in a desktop environment such as KDE I would observe the benefits.

Sluggish and poor system response is something I have experienced on a number of distributions, past Fedora releases in particular (unless you disable SELinux) have been a bit sluggish although Fedora 12 seems quite acceptable.

Something Windows continues to do better than Linux, Windows 7 is the most responsive operating system on my PC and Laptop.

When I first logged in KDE 4.4.2 on my Gentoo system the first thing I noticed was how quiet my hard disk was. The loading was very minimal compared to other distributions.

Working with the GUI, clicking on icons and launching programs was quite responsive. More than I have ever experienced on any Linux distribution.

Overall I can feel the difference, the system is more responsive and the hard disk isn't loading as much. It is a pleasant feel.

However more needs to be done with my Gentoo install, currently there is a lack of applications. No K3b, Kaffeine, Amarok, Open Office...

I did also encounter some minor issues, the OpenGL performance in KDE was slow and I could not enable compiz. A quick Google searched revealed the solution posted on the Gentoo forums, 'eselect opengl set nvidia'

Is it worth using Gentoo over other distributions?

With Gentoo I like the following,

Every software package is compiled and optimized for your system

It does not run a crap load of services that someone else thinks should be running and runs what is needed for your system.

As above but with respect to applications, it starts with a minimalist approach and you have to decide what you want.

The kernel is lightweight by default

The system response is nippy

Extremely customizable and good documentation.

What I do not like,

Unpractical time consuming process

Whilst contradicting my earlier point about documentation, perhaps some more hints and tips could be included to help less experienced users.

You need to know what you are doing.

In addressing the what I do not like category, Gentoo is aimed for the experienced Linux user, and taking that into account the only real problem with Gentoo is its time consuming installation process.

But if you want optimized, responsive and total control then Gentoo seems like the solution.

To answer my question, would I use it over anything else?

Yes and No.

It is very tweakable, I like that but the time to setup vs performance is a big issue and has other consequences.

Compiling puts a high load on the processor.

On my Desktop PC I do not mind leaving it overnight to compile packages or updates. I can do so knowing nothing will go wrong as the cooling my custom built PC currently has is excellent and well up for the job.

My Laptop however, Gentoo is simply one way to shorten its lifespan. Over 6 hours non stop compiling will take its toll and is not something I am prepared to do.

OpenSUSE or Ubuntu would be more practical in this instance and I am happy to live without the performance gain Gentoo can provide.

I have seen many differing views on Gentoo, some say it is a complete waste of time, others say it makes no difference and some its the best thing since transistors.

As with anything Linux, its all about choice and using what your like.

Is it the fastest Linux distribution, available?

Well, with a name like Gentoo the developers believe this to be the case but from my point of view it is the fastest I have ever used in terms of system responsiveness and application load times.

After adding a few more applications, like Open Office, Opera and K3b, I did notice their start up times were quicker compared to other distributions.

Final thoughts

If you have the time, experience and patience then give Gentoo a go, it will be a good learning experience.

If not, stick with your current distribution or use something else as the speed improvements are small and for most people not worth the hassle.

Gentoo is like a high performance car, we like the performance but when you consider the more important issues like fuel consumption and maintenance, it may not be practical.

Screenshot of Gentoo 10.1 with KDE 4.4.2

Gentoo, a beautiful nightmare!