Linux.com

Community Blogs



Gentoo Easy Upgrade Script

If you just followed my previous blog about Gentoo you'll probably trying to understand what "easy upgrade" is for me and what I've to do for maintaining my system up to date.

If you take a look at the Gentoo Handbook you'll see how you can install and upgrade your system, expecially read Gentoo Upgrading Guide for making these tasks.

Syncing Gentoo portage is basically like the BSD upgrade, for a quick upgrade I've just made a script few years ago with the same commands listed in Upgrade guide, please feel free to contribute or mail me for corrections on the script.

But before the script it's important to understand the golden rule: read what your computer is writing to you, I think it should be applied to everything but expecially read what is saying, that's why I've placed a pause after each command; for example if you need to upgrade portage because it's telling you so then you've to do this so interrupt the script and upgrade portage, then re-run the script again from the step you're.

Comments and suggestions are welcomed:

#!/bin/bash
keypress() {
echo -n "hit any key to continue..."
read -n1 -e -r 2> /dev/null
echo
}

clear
echo "System Upgrade Script"
echo "--------------------------------------------------------------------------------"
echo
echo -n -e "portage sync ? ([y]/n) "
read key -n1 -e -r 2> /dev/null
if [ "$key" == "n" ]; then
echo
else
echo "Portage Sync"
emerge --sync
fi

echo
echo "Complete system upgrade (emerge --update --deep --newuse world)"
keypress
START=`date`
emerge --update --deep --newuse world
STOP=`date`
echo "Start : "$START
echo "End : "$STOP

echo
echo "Configuration files upgrade (etc-update)"
keypress
etc-update

echo
echo "Dependencies Clean (emerge --depclean)"
keypress
emerge --depclean

echo
echo "Dependencies Check and Rebuild (revdep-rebuild)"
keypress
revdep-rebuild

echo
echo
echo
echo "--------------------------------------------------------------------------------"
echo " System Upgrade Completed"
echo "--------------------------------------------------------------------------------"
echo
echo

RSync connection to gentoo hosts is maded only if you need it,  if you need to upgrade your system just make it once a day, it doesn't make sense to flood gentoo servers with rsync requests, and of course you'll be banned if you do so

Hope it helps

Any hints ?

 

Gentoo and BSD (a primer)

One of the best things from a metadistribution like Gentoo is its approach to upgrades and management

I've started using UNIX systems with Minix and Xenix, in '92-'93 I was rolling my Slackware distro with a brand new kernel called Linux, nobody knows it but it was fine and I was happy with it, never tried other Unices and neither worked with others. After a short period I've started on working with UNIX systems heavily and I've seen a lot of them, one of the biggest complaints were the system upgrades... oh what a mess.

While using Microsoft operating systems, upgrades were not even considered but after facing UNIX and some development movement due to Linux grow I was thinking upgrades are one of the most important parts of an entire system, one of my biggest concerns was:

"ok now I've a full upgraded/stable/configured system, it was a pain to get everything working but now it's fine, how can i maintain it stable forever ?"

Each time a major release came out configuration and reinstallation problems were the most common

After few years, I think '94-'95 I've tried something from the BSD world, I didn't remember what (think OpenBSD), one of my biggest problems there was: "where are my applications ? how can I install packages ?". Hell there weren't available in my system CD and I was searching for them across the net; after few good docs I've learned about package distribution and how my system can handle upgrades, it was a revelation to see source code packages (builds), download the source, auto-patch, compile and then install. The best thing I've ever seen and I was thinking something like: "oh damn, I wish to have something like this for Linux as well".

After it I've started using Linux from scratch approach (LSB), it was nice but each "major" upgrade was still a pain and I still need to patch and control everything by hand... since a day, a strange day, I was googling around and I saw the latest distribution of the day, it was called Gentoo. I've learned about Gentoo because one of the lead BSD developers ported its experience to Linux, I was following BSD (still I'm on it) and learned about this new distro.

I've tried it for a while and I was so impressed about portage and meta-packages, so I've decided to use it as my Main distro (I'm writing this blog from a Gentoo desktop system). Other features like code optimization and C compiler flags scared me for a while but now I'm fine and I can live with them

Here's how I've approached Gentoo, still using it since a lot of time and still happy with it

 

 

Titling...

Linux.com testing blog service.
 

Tips and Tricks for the openSUSE News

Hi

 I am writing the section in the openSUSE News and I am searching for some nice articles about a good solution how to configure a tool or some usefull code snippets. 

So if you have some nice ideas, write a usefull article or talk to me first and then send the article to me and I will try to add it into the News.

 Contact: go to my homepage and there is a contact section, how to contact me.

 

Sebastian 

 

Slackware officially goes 64bits!

Well, this is a surprise for me! one of the oldest Linux Distributions (which is also my favorite): Slackware, is getting ready to have a X86_64 (aka amd64) version at their next release, currently the 64bit version is available only at the Slackware-current branch and not intended for production use of course.

This version will be multilib which means it will include 32 and 64 bits version of the libraries, contrary to the polemic Bluewhite64 Slackware port which only uses 64 bit libraries.

It will be very interesting what does this means for the unofficial Slackware ports around there and mostly for Slamd64 which was the first 64bit port of Slackware.

 

 

Fedora 11 first impressions

Being impatient, as usual, I couldn't wait for the official release date, heh.

So far I've updated two of my Linux boxes (work and main home PC) using yum.  There were a few hiccups, but nothing I couldn't handle.  Mainly just some depsolving issues that required that I remove packages, and some signing problems that required I do "--nogpgcheck".  I don't recommend doing it this way unless you have a pretty in depth understanding of the packages on your system, what they are for, and yum and RPM in general.  If you care if you hoze your system, or don't feel confident that you can solve whatever problems come up, wait for the DVD release and upgrade that way.

After the updates were all done, /etc/sysconfig/redhat-release shows "Fedora release 11 (Leonidas)", and we're about a week out from the official release, so I figure not much will change before it officially goes to general release.  Here's a gratuitous uname -a as well ;)

"Linux cube64.int.hozed.net 2.6.29.3-140.fc11.x86_64 #1 SMP Tue May 12 10:44:27 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux"

The only disappointment is that the on-board audio on my home system's motherboard still doesn't work properly under PulseAudio.  Not a huge surprise, since it didn't work under 10.  I usually use a USB headset, so it's not a show stopper, but it is a bit annoying.  I really wish that the ALSA driver and Pulse would play nice.  The sound will "work" if I disable glitch free, but it sounds like crap.  I don't hold it against Fedora, because all distros that have switched over to Pulse seem to be having the same problems.  I'm still amazed that the audio subsystem seems to be the most trouble prone part of Linux on the desktop.  I can run DirectX games written for another operating system full screen at 1920x1200, do all sorts of advanced network magic, etc, but can't get sound to work right on a very common audio chipset (Intel HDA).  It just seems so counter-intuitive.  That said, when Pulse/ALSA play nice, it's awesome sauce.  Hopefully by F12 this will all be straightened out, but I'm not holding my breath.  I do think the various distros have jumped the gun a bit on making it THE audio subsystem, but I suppose it wouldn't really get widely tested otherwise. 

On a good note, when using my USB headset, as well as the onboard chipset on my office PC, sound works flawlessly.  Also, Pulse's CPU utilization has dropped to around 1% when playing sounds and under 1% when idle, which is an improvement.  (doesn't hurt that I've got a quad core Phenom II at 3ghz though, heh, so YMMV)

But, anyway, this isn't meant to be an audio rant. ;)

Over all, things look more polished.  I really like the changes to the update app.  The audio preferences overhaul looks nice too, however power users may find it a little overly simplistic.

On a side note, I just upgraded to a 28" widescreen LCD, and everything looks sexier at 1920x1200!

Boot and shutdown times are noticeably faster.  I was actually a little surprised the first time I rebooted.  If it hadn't been for the delay when the Nvidia video driver's init script kicks off, and the time spent acquiring a DHCP lease from my ISP, my boot time from GRUB to GDM would have been under 20 seconds. 

Over all, the system feels snappier, but that may just be my imagination.

Every piece of hardware was recognized perfectly from the first boot, and it "just works" with the exception of the audio stuff mentioned above.  The only third party driver I have installed is the Nvidia driver, but that's for the sake of gaming, not general use.  The video worked fine for normal desktop stuff on the open-source driver.

The virtual machine manager has a nice improvement in that you can assign USB or PCI devices to a virtual guest through the GUI now.  I've been looking forward to that feature.  There looks to be an easy GUI way to migrate hosts as well, though I don't have the setup to test that particular feature.

Over all, I'm very happy with my shiny new Fedora.  I'm looking forward to the MythDora 11 release for my mythbox, and I'll be upgrading my other PC and my laptop, as well as our virtualization server at work to F11 soon as well.

 

Adventures of a noob: Gentoo (part1) - Know your grub!


Learnt with pain:

One of the most important things if not nearly the most important thing in installation of gentoo by a person not considering himself a guru in linux is configuring the bootloader. The reason is very simple. Migrating from other OS, you most probably would like to keep your stable working operating system for a little bit while messing with gentoo. The installation is sometimes long and quite painful process along which any simplest problem might prevent you from actual using gentoo for everyday operations. Example would be an issue with a graphics driver which would not allow you to properly configure xorg and therefore you would have to use console for a while. I don't know about you, but personally I can't use Links and alike to check my email. My eyeballs turn red, nose starts bleeding and all that bad stuff. And because checking e-mail is something so ridiculously important for a University student nowadays, I would need a working X. The workaround for this particular problem is just using LiveCD which has a guied browser. But the point is understood: you would want to keep another working OS unless you install gentoos everyday like crazy and can do it without a monitor! Hence, you should always have a properly configured boot loader.


Personal Experience:

Here I want to illustrate how bad it is to underestimate the importance of configured bootloader.

It was winter of 2008-2009, the winter break at college so I went home. I was an alltime Ubuntu user at the moment and (as mentioned in earlier posts) decided to try Gentoo. I got to the point (about that in the next post) where I had working gentoo with no Xorg and no network. The xorg part at that point was just the matter of learning how to configure it manually. For network - somebody should have told me about DHCP!!! Anyway, I basically couldn't do anything on it (when I said "working gentoo" I meant the kernel was actually loading :-D). The computer at home had Windows (for mama) and Ubuntu for myself. I erased ubuntu during the process of gentoo installation, but of course the grub was still there! And since it was configured long ago automatically by Ubuntu, ...nothing loaded. The only possibility for me was the LiveCD on which I pretty much lived for quite a bit. The most painful part was when my mom came over once and said "I need to check my email". It was very hard to explain a 40-year old piano teacher why the computer could only produce green text on the black screen and why in the hell that "was ok". I loaded the livecd but it turned out she had all the passwords saved on her windows. For a month I was claimed to have broken the family computer and somehow erasing all of the "collected for long time" by real careful users' passwords. I made her happy when I finally figured out GRUB and could eventually load her windows WITH ALL THE PASSWORDS ALREADY THERE!!! So much joy...


Advice from a noob:

Guys on Gentoo.org give a really nice description of GRUB and guidelines of how to work with it in the handbook. Pay attention to that, go to different sources if it doesn't make sense, look up the grub's config on your distro, but you have to know your grub!

 

X-Server-Xorg 1.6 and Input-Hotplug

Little more than a month ago Debian unstable was hit by  Xserver-Xorg 1.6 which brings about some changes and new features.
The main changes are with input device handling (mouse, keyboard, touchpad, etc.), which from now on can be handled by HAL instead of X.org.
HAL (hardware abstraction layer) or more precisely hald (hal-daemon) is a service that governs connected devices in realtime (see [2]).

The most important new feature is input-hotplugging (i-h), which handles input devices dynamically.
This results in a considerably simpler and leaner xorg.conf.
After a few weeks of experience with the new features I recommend switching to input-hotplug.  Unfortunately there is no tool yet to handle switching, so depending on your system there might be more or less manual changes needed.

The following howto  explains the most common cases (desktops and notebooks with 1 monitor connected) Part 2 is soon to come and will describe how to handle more than 1 monitor with xrandr and xorg.conf.
Please also read the related links under Web-Links all down the page, I cannot cover the complexity of the matter in this howto.

First of all we save our "current" xorg.conf:

     # cp /etc/X11/xorg.conf /etc/X11/xorg.conf.old

Now we can clean up xorg.conf, it will look (depending on your graphics card) something like:

Section "ServerFlags"
        Option          "DontZap"       "0"
EndSection

Section "Device"
    Identifier    "Device 0"
    Driver        "radeon"
    BoardName    "ATI Technologies Inc M52 [Mobility Radeon X1300]"
    BusID        "PCI:1:0:0"
EndSection


As you can see all input device sections are gone.

WARNING:
Do not copy the above example but modify your own xorg.conf!

The stanza "DontZap"  in the Section "ServerFlags" provides that the key combination  "Ctrl-Alt-Backspace" to restart the x-server still works.
If you do not want that option, set it to  "1"  (instead of "0") or delete Section "ServerFlags"  completely.
Depending on your graphics device you may or even have to add additional options in Section "Device" (e.g. UXA 3D-Acceleration, TV-Out, etc.).

 To enable touchpads we need to copy a file, depending if your make is Synaptics or Alps.

In the appendix you find a synaptics.fdi file, which needs to be copied to/etc/hal/fdi/policy.
Alternativlly the package xserver-xorg-input-synaptics has a .fdi file as well (see [3]).
The synaptic.fdi in the appendix (as well as the other .fdi files in there) is generic.
For touchpads you might want to install gsynaptics to easily enable and change values after copying the file.

      # cp synaptics.fdi /etc/hal/fdi/policy  (synaptic.fdi is in the appendix)
       or
      # cp /usr/share/hal/fdi/policy/20thirdparty/11-x11-synaptics.fdi /etc/hal/fdi/policy

In [4] there are some example fdi files:
- for touchpads
- for tablets
- for activating  special keys with e.g HP and other notebooks (see [5])

Unfortunatelly not all input devices have working fdi files yet.
Should your touchpad be from Alps please use the file alps.fdi from the appendix.
Accordingly for tablets by Wacom please use wacom.fdi  from the appendix or the fdi file in [6].

Web-Links:

[2] /usr/share/doc/hal-doc/spec/hal-spec.html
[3] /usr/share/hal/fdi/policy/20thirdparty/11-x11-synaptics.fdi
[4] /usr/share/hal/fdi/policy/
[5] /usr/share/hal/fdi/information/10freedesktop/30-keymap-hp.fdi
[6] /usr/share/hal/fdi/policy/20thirdparty/10-linuxwacom.fdi
X-StrikeForce Input Hotplug Guide
sidux wiki xorg howto
Brice Goglin's Blog - X.org Howto

Appendix:

synaptics.fdi
wacom.fdi
alps.fdi

 

 

 

What is a distro?

I recently gave up on the idea that a distro is a set of modified packages and a core system. Because when I made the only major disto change of my linux life, yes, I was changing the way computer looked, and the core system was quite different, but that was a minor change, somthing that I could get over relitivly quickly. So what had changed when I moved?

 It was the expectations. When I had been using Ubuntu, no one expected very much of me, and was willing to acomidate any strange or irrational decisions. However, when I came to Arch Linux, it was compleatly different. I was expected to be quite proficient in comand line, and while this did not mean that help was not provided, it was provided to be concumed, not to be shunned and ignored. Like a teacher, the community expects the student to want to learn, and it gives it's best in return. This isn't a blog about the benefits of the Arch Linux community over the Ubuntu one, it is a blog about how it is not the technology that makes up the distro, it is the community. While the technology gives a central point for the community to form, very quickly it becomes more or less equal to it's child. This isn't a one way relationship though, the community drives the technology, and the technology provides the basis for the community. The community very often takes it's expectations from the technology; the ubuntu forums are beginer friendly, as is ubuntu, but this does not always happen. What I am trying to say here is that the disto as a community is different from the distro as a technology, though the both depend on each other.

In conclusion, a distro is not a technology, yet it is not a community. It is a fusion of all these things, forming one great oblong (I like oblongs) bulge on the computers of  thousands of personas everywhere iver the world.

 

10 days till Fedora 11

Fedora 11 Leonidas has many new features:
  • 20- second startup
  • New versions of desktop environments: Gnome 2.26, KDE 4.2, XFCE 4.6
  • New versions of desktop applications: Firefox 3.5, OpenOffice.org 3.1
  • New package format- rpm 4.7
  •  

    Kubuntu Karmic Alpha 1 Released

    Just a quick note letting you all know that Kubuntu Karmic Alpha 1 has been released. If you are looking to contribute to an open source project, there is no better time than now. The Kubuntu team is looking for a few good contributors. We can always use supporters, documentation writers, packagers, developers, translators and more! If you are interested in contributing, I urge you to join #kubuntu-devel on irc.freenode.net.

    Note: This is an alpha release, so it is not for the faint of heart, it is for those of you who are a bit crazy and like living dangerously. It is not for production use at all, and if you do use it for production use and get fired, it is not our fault!

     
    Page 17 of 18

    Upcoming Linux Foundation Courses

    1. LFD312 Developing Applications For Linux
      05 Jan » 09 Jan - Virtual
      Details
    2. LFS220 Linux System Administration
      05 Jan » 08 Jan - Virtual
      Details
    3. LFD331 Developing Linux Device Drivers
      12 Jan » 16 Jan - Virtual
      Details

    View All Upcoming Courses


    Who we are ?

    The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

    More About the foundation...

    Frequent Questions

    Join / Linux Training / Board