Skip to Content

Linux

Compiling Ruby 1.9.1-p376 on Fedora 12

Posted in

Get the following errors while compiling Ruby 1.9.1-p376?

ossl_ssl.c: In function ‘ossl_sslctx_get_ciphers’:
ossl_ssl.c:626: error: ‘STACK’ undeclared (first use in this function)
ossl_ssl.c:626: error: (Each undeclared identifier is reported only once
ossl_ssl.c:626: error: for each function it appears in.)
ossl_ssl.c:626: error: expected expression before ‘)’ token
ossl_ssl.c:629: error: expected expression before ‘)’ token
ossl_ssl.c:629: error: too few arguments to function ‘sk_value’
ossl_ssl.c: In function ‘ossl_ssl_get_peer_cert_chain’:
ossl_ssl.c:1198: warning: passing argument 1 of ‘sk_num’ from incompatible pointer type
/usr/include/openssl/stack.h:79: note: expected ‘const struct _STACK *’ but argument is of type ‘struct stack_st_X509 *’
ossl_ssl.c:1201: warning: passing argument 1 of ‘sk_value’ from incompatible pointer type
/usr/include/openssl/stack.h:80: note: expected ‘const struct _STACK *’ but argument is of type ‘struct stack_st_X509 *’
ossl_ssl.c: In function ‘ossl_ssl_get_cipher’:
ossl_ssl.c:1223: warning: assignment discards qualifiers from pointer target type
make[1]: *** [ossl_ssl.o] Error 1

Try the patch in this post.

ruby-1.9.1-p376 $ tar zxf fix_stack_not_found.tgz
ruby-1.9.1-p376 $ cat fix_stack_not_found.patch | patch -p1
patching file ext/openssl/ossl.c
patching file ext/openssl/ossl_pkcs7.c
patching file ext/openssl/ossl_ssl.c

ruby-1.9.1-p376 $ make
...

The compilation is now able to complete. However, I didn't verify whether the SSL is working properly.

Fedora 10 Problem: Cannot find CTL module "transform_RRT"

Posted in

On Fedora 64bit, exrdisplay is not able to display an .exr image.

$ exrdisplay lighting.exr 
Warning: Environment variable CTL_DISPLAY_TRANSFORM is not set; using default value ("transform_display_video").
Warning: Environment variable CTL_DISPLAY_CHROMATICITIES is not set; using default value (chromaticities according to Rec. ITU-R BT.709).
Warning: Environment variable CTL_DISPLAY_WHITE_LUMINANCE  is is not set; using default value (120 candelas per square meter).
Warning: Environment variable CTL_DISPLAY_SURROUND_LUMINANCE  is is not set; using default value (12 candelas per square meter).
Cannot find CTL module "transform_RRT".

Solution I: Set the CTL module path manually.

user$ CTL_MODULE_PATH=/usr/lib64/CTL exrdisplay lighting.exr

or

Solution II: Install the 32bit CTL library (OpenEXR_CTL-libs.i386)

root% yum install OpenEXR_CTL-libs.i386
user$ exrdisplay lighting.exr

or

Solution III: Link the expected CTL module path.

# This assumes the 32bit CTL library (OpenEXR_CTL-libs.i386) is not installed.
root% cd /usr/lib
root% ln -s ../lib64/CTL
user$ exrdisplay lighting.exr

Fedora 10 Problem: Broken XFCE Windows Manager

Posted in

After installing Fedora 10 with XFCE, when you try to customize your windows interface, you'll get the following:

"These settings cannot work with your current window manager (imsetting-xim)"

According to Fedora Project website, a bug in GTK2 is to blame. But we can't just wait for the bug to be fixed.

I simply use KDE display manager by setting /etc/sysconfig/desktop.

% cat /etc/sysconfig/desktop
DISPLAYMANAGER="KDE"

and restart your X windows (ctrl-alt-backspace) or restart your system.

Fedora 10 Problem: Cannot Type in Textbox in Java Applet

Posted in

Whether it is Sun Java plugin, IceTea plugin, I simply cannot type in a textbox of a Java applet. After much hacking, I found that scim-bridge is the one causing the problem. Killing off all the im-*, gconf-im-*, imsettings-xim, and scim-* processes immediately solves the problem.

I use scim-bridge because it can work with GTK or QT windows. Now looked like I can just use scim with GTK only.

Fedora 10 Problem: X is hogging CPU

Posted in

I installed Fedora 10 onto my system where the "nv" driver does not work with my display card GF 6600LM. The installation ends up being a text-based installation. Nvidia driver is later installed manually. Surprisingly, now the X windows take up the tty1 instead of usual tty7 (ctrl-alt F7).

The problem occurs when I start the system into runlevel 3 in console, then "init 5" to start X. The X process is then hogging the CPU.

The /var/log/message is showing something like below:

localhost /sbin/mingetty[2369]: tty1: invalid character 0x1f in login name

Now I find that mingetty keeps respawning tty1.

Solution:

Comment out everything in /etc/event.d/tty1 and forget about the existence of tty1.
Or find a way to get the X windows started back at tty7 (ctrl-alt F7).

Compiling VirtualBox 2.0.2 OSE in Fedora 9

Posted in

Unable to compile VirtualBox with the source package? Get errors like the following?

$ ./configure --with-gcc=gcc422 --with-g++=g++422
Checking for environment: Determined build machine: linux.amd64, target machine: linux.amd64, OK.
Checking for kBuild: found, OK.
Checking for gcc: Checking for as86: 
  ** as86 (variable AS86) not found!

Check if the following work helps. ;)

# Install necessary packages, including the following but not exhausive list. This requires root.
% yum install dev86 iasl pulseaudio-devel pulseaudio-libs-devel glibc-devel.i386 libX11-devel.i386 libXt-devel.i386 libXext-devel.i386 libXmu-devel.i386 compat-gcc-34 compat-gcc-34-c++ kernel-devel kernel-headers libxml2-devel libxslt-devel SDL-devel python-devel

# Obtain the source from http://www.virtualbox.org/wiki/Downloads

# Prepare and compile the source.
$ tar jxvf VirtualBox-2.0.2-OSE.tar.bz2
$ cd VirtualBox-2.0.2
$ ./configure --with-gcc=gcc34 --with-g++=g++34    # I was able to build with gcc424 and g++424 too.
$ source env.sh
$ kmk    # This compiles the VirtualBox. You may do 'kmk -j 4' if you have a quad-core processor.
$ cd ./out/linux.ARCH/release/bin/src    # ARCH depends on the architecture of your system.
$ make    # This build the kernel module vboxdrv.
% make install    # Requires root, to copy vboxdrv.ko to /lib/modules/`uname -r`/misc/vboxdrv.ko

# Load the VirtualBox kernel module.
% modprobe vboxdrv    # Requires root.

# Create a group of users for accessing the VirtualBox.
% groupadd vboxusers    # Requires root.
% chown root.vboxusers /dev/vboxdrv
% usermod -a -G vboxusers USERNAME    # USERNAME is your account username who should have accesses to VirtualBox.

# Logout and login for the group information to get updated.
# Check if your user is in group vboxusers.
$ groups    # This should show at least vboxusers

# Try running your newly built VirtualBox.
$ cd VirtualBox-2.0.2/out/linux.ARCH/release/bin
$ LD_LIBRARY_PATH=. ./VirtualBox

If you get the following error (happens in version 2.0.2),

VirtualBox: SUPR3HardenedMain: effective uid is not root (euid=500 egid=501 uid=500 gid=501)

try

% cd VirtualBox-2.0.2/out/linux.ARCH/release/bin
% chmod +s VirtualBox VBoxSDL VBoxHeadless

Save the script below to /etc/init.d/vbox and make sure it's executable. The script helps to load and unload the kernel module during system boot up and shutdown.

#!/bin/bash
### BEGIN INIT INFO
# Provides: vbox
# Required-Start: $syslog $local_fs
# Required-Stop: $syslog $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: The Virtual Box kernel module
# Description: The Virtual Box kernel module
### END INIT INFO

start () {
        echo -n $"Starting Virtual Box: "
        modprobe vboxdrv
        sleep 1
        [ -c /dev/vboxdrv ] && chown root.vboxusers /dev/vboxdrv && echo " OK"
        [ ! -c /dev/vboxdrv ] && echo "Failed"
        return 0
}

stop () {
        echo -n $"Stopping Virtual Box: "
        [ -c /dev/vboxdrv ] && rmmod vboxdrv && echo " OK"
        [ ! -c /dev/vboxdrv ] && echo
        return 0
}

restart() {
        stop
        start
}

case $1 in
        start)
                start
        ;;
        stop)
                stop
        ;;
        restart)
                restart
        ;;
        status)
                [ -c /dev/vboxdrv ] && echo "Virtual Box is loaded"
                [ ! -c /dev/vboxdrv ] && echo "Virtual Box is not loaded"
        ;;
        *)

        echo $"Usage: vbox {start|stop|restart|status}"
        exit 3
esac

exit 0

Then,

% chkconfig --add vbox    # Add vbox as a service.
% service vbox status    # Check if the Virtual Box module is loaded.
% service vbox start    # Load the Virtual Box kernel module.
% service vbox stop    # Unload the Virtual Box kernel module.

Though the script is rather ugly, it should work ok for our purpose.

Date Time UTC Issue with Fedora 9

Posted in

A system booted up with a wrong date & time is extremely annoying. It happens to me once I installed the Fedora 9.

What happens is that Fedora 9 seems to treat the initialize the system time from hardware clock as UTC time no matter you choose to store it as UTC time or LOCAL time. It works fine if I store the hardware clock as UTC time, but that unfortunately screw up other OS in the system such as Windows.

--- New Solution ---
I simply upgraded to kernel 2.6.26 with CONFIG_HPET_EMULATE_RTC enabled. That solved my time problem.

--- Obsolete ---
I did a little work around for this, setting the system time with hardware clock in LOCAL time in /etc/rc.d/rc.sysinit (about line 745).

# xman: The system seems to read hardware clock as UTC time no matter I set to store hardware clock as local or UTC.
# xman: This force the system time set to local timezone.
hwclock --localtime --hctosys
# xman: Try to correct the timestamp of /proc and /sys.
touch /proc
touch /sys

Solving Fedora 7 (FC7) Nvidia Display Problem

Posted in

The "nv" driver doesn't work on my GeForce 6600LM. Installing Nvidia's driver however gives the following errors when starting X:

(II) LoadModule: "glx"
(WW) Warning, couldn't open module glx
(II) UnloadModule: "glx"
(EE) Failed to load module "glx" (module does not exist, 0)
(II) LoadModule: "nvidia"
(WW) Warning, couldn't open module nvidia
(II) UnloadModule: "nvidia"
(EE) Failed to load module "nvidia" (module does not exist, 0)

The reason being Nvidia's driver by default installs modules to /usr/X11R6/lib64/modules, however, FC7 now installs Xorg related modules to /usr/lib64/xorg/modules

Solution: Specify the module path during installation.

./NVIDIA-Linux-x86_64-1.0-9755-pkg2.run --x-module-path=/usr/lib64/xorg/modules

Let the installation updates xorg.conf automatically.

Done. Enjoy!

Transcoding

Posted in

# Transcode .flv to .avi

time mencoder 01_a.flv -oac mp3lame -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=300 -o a.avi

# Transcode .raw to .avi

time transcode -i a.raw -o a.avi -y ffmpeg -F mpeg4

Edit rake Compilation Flags

Posted in

Edit /usr/lib64/ruby/1.8/x86_64-linux/rbconfig.rb to modify the default compilation flags.

Syndicate content