linux

To /boot or not to /boot

in

A couple of Linux distros suggest making a separate partition for the /boot folder. Well, they must have a reason for it but I never understood why. For an usual desktop it might make no sense to spend a partition just for something that is at most 100MB and the obvious step is to leave /boot a regular folder on the root partition. I've considered having /boot a separate partition an overkill until I discovered a couple of reasons that look fine to me.

First reason is that GRUB (I imply that the obvious choice for a boot loader is GRUB) can still load it's stage2 files if somehow the root partition is damaged. You may boot with no worry other operating systems, ie if you have another Linux installed or even Windows from another disk (using the map tricks).

Another reason may be more suitable for development machines where the software configuration changes depending on the project requirements. Having /boot a separate partition can save some time when removing the Linux root partition. And, one of the incomprehensible solutions, to use GRUB for managing several windows operating systems on the same machine. Sounds weird but there is nothing wrong with it, GRUB implements multiboot specification and it can handle more than it's used for.

Hacking in Debian

Debian is one of those things that are so meticulously prepared that sometimes it gets boring. When you install it (from cd, usb stick or even windows) takes you through several well thought steps where few things can go wrong (your entire hard disk can be erased, but that's just your own fault) and when its over, it just works. Need anything? Just run apt-cache search rss reader to get a rough description of all matched applications. Something looks interesting? Run apt-cache show akregator to see the description or directly apt-get install akregator to install it. I cannot stand it. I envy users of those operating systems that allow them to spend time defragmenting disks, hunting viruses, installing security updates, restarting the computer to the extent that I think of paying money for those moments of pure enjoyment. And what do I get from Debian? A boring system that works.

Apt pinning

It's very hard not to try to mess something up to make your day brighter, to wipe that plain look from your face, to put back that evil grin. I usually keep only the stable version cd just to be sure, you can never trust anything else but stable. That's why the first thing after installing a fresh debian I switch to testing/unstable/experimental version. It's a lot of fun! Besides this, enable contrib and non-free pools to bring in those dirty and nasty packages on my computer. How do you do that? There is a magical trick to do that and it's called apt pinning. There is a nonexisting file /etc/apt/preferences that should contain the following spell:

Package: *
Pin: release a=testing
Pin-Priority: 650

Package: *
Pin: release a=unstable
Pin-Priority: 600

Package: *
Pin: release a=experimental
Pin-Priority: 550

This tells apt to prefer packages from testing over other pools. And there is how a part /etc/apt/sources.list looks like:

deb http://ftp.lug.ro/debian/ testing main non-free contrib
deb-src http://ftp.lug.ro/debian/ testing main non-free contrib

deb http://ftp.lug.ro/debian/ unstable main
deb-src http://ftp.lug.ro/debian/ unstable main

deb http://ftp.lug.ro/debian/ experimental main

deb http://www.debian-multimedia.org testing main

But the question "why do I need unstable and experimental if testing is preferred?" arises and the answer is simple: to have access to the list of packages, their description and possibility to install them from other versions. To install a package from experimental pool you can use this:

# apt-get -t experimental install kde4

And what's with contrib and non-free? Well, some of the good stuff is illegal but that's not a reason not to have it. Especially if that's a NVidia video card driver.

Resources

Debian Multimedia

No no, I did not forget! There is that multimedia word in sources.list that implies fun stuff. And it really does. Check out the stuff on Debian Multimedia project to see all those nice codecs and applications. And a tip: do not ignore the FAQ page on Debian Multimedia. This repo is a must for a desktop system.

Resources

Building from source

A keen eye could not have missed the deb-src keywords. They specify the possibility to get the sources for the packages you have installed. Why would you want to do that? For the same reason you are still reading this article - you're a hacker. So, how do I get those sources? Here is it how:

$ apt-get source pidgin

And you don't have to be root! You can look through the sources as an user and the ones you see are the same you would get from the upstream maintainer. Yes, Debian keeps patches for the fixes (some are Debian specific, some did not get into upstream version yet) in ./debian folder along with the build scripts. If you decide to build your own version of the package, possibly with modified sources, you need first to bring all the development packages necessary for building that specific package with the following command:

# apt-get build-dep pidgin

Once apt is done installing them you can build the package. It is usually done as user and needs fakeroot command. After cd-ing in the uncompressed folder issue:

$ dpkg-buildpackage -rfakeroot -b

Maybe you want also to use -nc to prevent loosing your changes in the case the source files are overwritten before building (this depends on the package and may be not true for all cases). Sometimes I even used git or bzr to keep the history of the changes. The result is a set of files among which one or more .dpkg files. You can easily install them with dpkg:

# dpkg -i *.deb

but keep in mind that your package has a lower priority than a Debian package of the same version so you might need to instruct apt to hold it. And in case you find you change useful, feel free to send your patch to the package maintainer using reportbug or reportbug-ng application.

Resources

Building the kernel

Oh, you're a kernel freak downloading the latest versions? Or just rebuilding a Debian kernel? Debian has a tool that helps you build a kernel that integrates nicely with the rest of the system. It's called kernel-package and it provides the command make-kpkg. An usual invocation would look like this:

$ make-kpkg --rootcmd fakeroot kernel_image

And it's not over! There is module-assistant package that provides the m-a command. It helps building external modules for your current kernel. I use it for building nvidia and lirc modules. Here is how I run it:

# m-a auto-install lirc nvidia-kernel-legacy-96xx

Most of the spells are just spoilers and there is no reason for you not to read the man pages for those application or the Debian documentation. You learn to get your driver's permit, learn the tools you're using.

Resources

Salvează și încarcă adrese dintr-un fișier: extensie pentru Epiphany

Citirea neregulată a știrilor de pe reddit are ca efect deschiderea a prea multor file în navigator. Și mă mai ținea să trimit vreo cinci-zece adrese prin pidgin dar mai mult de-atâta mă enerva, sunt leneș. Așa că am decis să scriu o extensie pentru Epiphany care să-mi rezolve problema.

Hmm, de ce Epiphany? Ultima vreme folosesc pe măsură egală Iceweasel și Epiphany. De ce se utilizează Firefox/Iceweasel știm toți. La Epiphany ar mai fi câteva chestii de spus. Chestia care mi-a plăcut cel mai mult e că suportă (deocamdată) două motoare de randare de pagini – Gecko și WebKit. Pe lângă asta e ușor și scriptabil în Python.

Așa că am scris extensia în Python inspirându-mă din nenumăratele resurse găsite pe net. Evident, voi fi recunoscător pentru orice comentariu sau ajutor. Pentru o utilizare plăcută și fructuoasă, copiați fișierele .py și .ephy-extension în ~/.gnome2/epiphany/extensions/ și apoi activați extensia.

Reiser și Reiser4

Am folosit ReiserFS odată cu prima instalare de Debian, cred că acu trei–patru ani. Are jurnal, viteză, tot ce-mi trebuia ca să meargă bine sistemul. Cum am obișnuința să-mi bag nasul prin ceea ce se întâmplă în kernel, aflasem de existența sistemului de fișiere Reiser4 care ar revoluționa prin conceptele sale tot ce era legat de sisteme de fișiere. Am rămas doar curios și urmăream zgomotul în jurul acestui sistem.

În toamnă am aflat că Hans Reiser, inițiatorul companiei NameSys, a fost acuzat de omorul fostei sale soții. De atunci am urmărit cu atenție știrile legate de Hans și Reiser4. Poate din motiv că e un caz fără precedent în care un geek o asemenea talie a apărut într-un context așa de sumbru. Până acum aveam un stereotip clar pentru cei din rasa „geeks” – oameni pașnici care-și văd de lumea lor virtuală și nu omoară nici măcar o muscă (poate doar în jocuri, preferabil cu un railgun).

Pe Slashdot a apărut un articol despre arestarea lui Hans și lumea s-a agitat la comentarii. Senzația pe care am avut-o când citeam comentariile era asemânătoare cu cea în timpul vizionării filmului Severance – nu știi dacă e momentul să râzi sau să-ți pui mâinile-n cap. În orice caz, e destul să te gândești la faptul că Nina nu a fost găsită, Hans e băgat la dubă și doi copii au rămas fără părinți.

Însă geek-ul din mine nu poate să nu să se gândească și la al patrulea factor: Reiser4. Novell și-a băgat picioarele în Reiser4 imediat după arestarea lui Hans. Se gândeau că vor fi judecați și ei dacă folosesc Reiser4? Probabil e doar un joc politic (urăsc dacă politica e îmbinată cu ceva, mai ales cu programarea). E păcat ca un proiect de asemenea amploare să rămână în gol din cauza celor întâmplate.

LPIC-1

in

Today I got by mail my LPIC-1 certificate. The first reaction was fury because the envelope was wide open, jammed into the box and it didn't look like it was opened only for a couple of house (I checked the box in the morning and the envelope was there at noon). Actually I was (am) furious at Romanian Postal Service as I can't imagine how hard is to deliver an envelope without beating the hell out of it. Ok, getting back to the envelope.

Syndicate content