Thomas Mathiesen’s Blog


Adding poweroff icon to Gnome desktop
April 30, 2009, 8:43 pm
Filed under: Linux

I have been trying to add a “shutdown icon” to the gnome desktop on Ubuntu 8.10. The goal is for the user to just double-click that icon, and the machine shuts down.
My issue was that triggering the /sbin/poweroff binary would only ask for my password:

myuser@mydesktop:/tmp$ sudo /sbin/poweroff
password:

So, I added myself to the /etc/sudoers file:
myuser ALL = NOPASSWD: /sbin/poweroff

and it simply DID NOT work!

I came across a post telling me why…
The reason is that /etc/sudoers is being read from the bottom and up. So, I was in a group that was mentioned on the bottom, which required passwords for everything. Now I move the line (myuser ALL = NOPASSWD: /sbin/poweroff) to the bottom of the file, and my gnome launcher works fine!



CentOS Xen: Error: 4 Out of memory
April 28, 2009, 10:23 pm
Filed under: Linux | Tags: ,

CentOS + Xen is driving me nuts! I came across a nasty issue, which makes me (try to) pull my hair:

xm create -c whateverdomain
Some pygrub output…
and then.. Error: (4, ‘Out of memory’, “xc_dom_boot_mem_init: can’t allocate low memory for domain\n”).

Googling this for a few hours and actually trying different distros (even trying out Lenny!) gave me nothing. One post (that I finally found) says this issue maybe caused by trying to start an image (created on a 64 bit Xen) on a 32bit Xen.

So now I am installing CentOS 5.3 64bit on my Vaio laptop. It comes with a Centrino (Core 2 Duo I believe).

and runs like a charm :D



Sony Vaio and CentOS 5.3 (using sk98lin driver for xen kernel)
April 28, 2009, 8:08 pm
Filed under: Linux | Tags: , ,

So I got myself a new laptop and busy installing Xen. My problem is that the Sony Vaio comes with a Marvell PCI-E network card, and that isn’t supported by the default CentOS kernel.

Note that I am using the CentOS PLUS kernel with xen, so if you just want the normal kernel, you will have to find the correct package for your kernel.

More people seems to have some issues installing the driver for the network card, as you won’t have any network access (http://www.gossamer-threads.com/lists/atrpms/users/12484)

Here’s how to do it (with Xen kernel):

1. Get kernel sk98lin-kmdl-2.6.18-128.1.6.el5.centos.plusxen-10.50.1.3-12.el5.i686.rpm from http://atrpms.net/dist/el5/sk98lin/

2. Get the centos plus kernel http://mirror.centos.org/centos-5/5.3/centosplus/i386/RPMS/kernel-xen-2.6.18-128.1.6.el5.centos.plus.i686.rpm

3. Copy these to a USB stick and onto your PC (with the Marvell network card).

4. Install the kernel (rpm -ivh kernel-xen-2.6.18-128.1.6.el5.centos.plus.i686.rpm )

5. Install the sk98lin kernel module (rpm -Uvh sk98lin-kmdl-2.6.18-128.1.6.el5.centos.plusxen-10.50.1.3-12.el5.i686.rpm )

6. Reboot

PS: lspci says “Marvell Technology Group Ltd. 88E8040 PCI-E Fast Ethernet Controller (rev 12).
PPS: Thanks to Axel Thimm for packaging the sk98lin kernel module!