Recently in gentoo Category

GIMP Plugin (update 2)

| | Comments (0) | TrackBacks (0)

Once again, here is an update to my gimp plugin. NVIDIA released the first beta for CUDA 3.0 a few weeks ago and I updated the plugin for this version. Mainly the SDK layout changed a lot and the way the SDK is incorporated needed some updates. I hope I didn’t break any backward compatibility ;)

The plugin is still here available for download. It should work with any CUDA version from 2.0 up to 3.0 on GNU Linux and Mac OS X.

suspend to disk (µswsusp)

| | Comments (0) | TrackBacks (0)

After I set up a new boot system a few weeks ago, I tried to get also suspend to disk working. First I tried the suspend to disk support built directly into the Linux kernel. However it turned soon out that this wouldn’t suit my needs as it support neither resume from encrypted devices nor from raid devices. Thus I tried my luck with userspace suspend.
First I added the ~x86 keyword for suspend to /etc/portage/package.keywords and emerged the package into the boot image:

ROOT=/boot_image USE=”static” emerge -av suspend

Used /usr/sbin/s2disk to write the image to my encrypted raid1 swap partition and rebooted. When I called the resume binary (/usr/lib/suspend/resume) nothing happened, even no warning or error message. So I compiled the resume binary myself and added some debug information to the resume binary and got the following message:

The system snapshot image could not be read.

It turned out that the resume image was corrupted. After some googling I found this thread, which says basically that s2disk doesn’t handle raid properly. As a matter of this when the raid is assembled on reboot the disks are not in a clean state and resync themselves, which leads probably to the corrupted image (at least resume thinks so). In the thread they suggest to set a variable in the sysfs that the raid should be assembled read-only and hence the resync would be delayed:

echo 1 > /sys/module/mdmod/parameters/startro

However it turned out that this doesn’t help anything, the raid starts to resync anyway. After some more investigations I found the solution: You can tell mdadm to assemble the raid under the assumption that the raid is clean avoiding the rebuild of the raid:

mdadm —build —assume-clean /dev/md1 —level=1 —raid-devices=2 /dev/sda1 /dev/sdb1

Finally I got it up and running :) After I added this to my init script I could resume from the resume image on my encrypted raid1 swap partition. Unfortunately after I removed all the debug stuff and used the resume binary from the boot image again, it stopped to work :/ I got the following error message although I didn’t use encryption of the image:

resume: Encryption not supported

As it turned out the 32bit resume binary can’t read the image stored by the 64bit s2disk binary. Thus I used a 64bit binary also on the boot system and got suspend to disk eventually working.

xfig problems

| | Comments (0) | TrackBacks (0)

This week I needed xfig to edit some figures, however my font path wasn’t set up correctly on gentoo, at least for xfig, and I got the following message (despite of ugly tiny default fonts):

File /home/ritschi/thesis/graphics/mrfilt.fig:
Can’t find --helvetica-medium-r-narrow—13------ISO8859-, using 6x13
Can’t find -
-helvetica-medium-r-narrow—10------ISO8859-, using 6x13

In order to get the fonts working, I had to add the following line to my xorg config (/etc/X11/xorg.conf ) and to restart X:

FontPath “/usr/share/fonts/default/ghostscript”

Installing xfig on my MacBook from MacPorts yielded first the following warning:

Either you have a very old app-defaults file installed (Fig), or there is none installed at all. You should install the correct version or you may lose some features. This may be done with “make install” in the xfig source directory.

This is because MacPorts mixes the paths and X11 uses /usr/X11/lib/X11/app-defaults, while MacPorts installs the files in /opt/local/lib/X11/app-defaults. Just copy the files to the X11 folder and the warning will go away. Anyway in order to get rid of the first message, the font path for X11 has to be corrected. Till now I haven’t found a way to do this permanently, so I have to do it every time currently:

cd /usr/X11/lib/X11/fonts
ln -sf /opt/local/share/ghostscript/fonts/ ghostscript
fc-cache ghostscript
xset fp+ /usr/X11/lib/X11/fonts/ghostscript
xset fp rehash
xfig

Yesterday I updated my boot system, which I use to boot my system from an USB flash drive. It’s consists basically of BusyBox, the swiss army knife of embedded Linux and uClibc, a small c library for embedded systems plus some more tools, which I need to setup Raid and to decrypt my devices before switching to my main system. Here are the steps needed to build the system based on a stage3 snapshot of gentoo sources:

First get the snapshot, unpack it and update it:

wget http://de-mirror.org/distro/gentoo/experimental/x86/embedded/stages/stage3-x86-uclibc-2008.0.tar.bz2
tar xvfz stage3-x86-uclibc-2008.0.tar.bz2 -C bootsystem/
mount -t proc proc /boot/boot
system/proc
cp -L /etc/resolv.conf /boot/bootsystem/etc/
chroot /boot/boot
system /bin/bash
env-update && source /etc/profile
emerge sync
emerge -auDv world

after that make a directory for your boot system and emerge all required packages:

mkdir /bootimage
ROOT=/boot
image USE=”static make-symlinks” emerge -av busybox mdadm
ROOT=/boot_image USE=”static” emerge -av =gnupg-1.4.9 cryptsetup

create the config for mdadm:

/sbin/mdadm —detail —scan >> /boot_image/etc/mdadm.conf

Having the system set up, we still need to build an initrd or initramfs, which can be both loaded at boot time. I choose the latter one and you have just to tell the kernel where your boot system resides. This is done by setting the CONFIGINITRAMFSSOURCE in the kernel config. Mine looks like this:

CONFIGINITRAMFSSOURCE=”/boot/bootimage /boot/cpiolist”

/boot/bootimage is the system create above and /boot/cpiolist contains some nodes required at bootup (early userspace), which are not created by busybox:

# supporting directories
dir /proc 0755 0 0
dir /sys 0755 0 0
dir /root 0755 0 0
dir /dev 0755 0 0
#initial device files required (mdev creates the rest)
nod /dev/console 0600 0 0 c 5 1
nod /dev/null 0666 0 0 c 1 3

About this Archive

This page is a archive of recent entries in the gentoo category.

Mac OS X is the previous category.

linux is the next category.

Find recent content on the main index or look in the archives to find all content.