Yum Fun !

This has been on my to do list for a while… I have finally converted my little reporsitory of rpm’s into a proper yum repo !

The old xfce repo has been mergered into a new Whitebox repo, which in fact can be used for CentOS, WBEL or Red Hat Enterprise Linux (RHEL).

A new fedora repo exists as well, those with a keen eye will see new rpm sections for FC5 64_86 (my new pc!).

All packages will be signed with my gpg key, and config files can be found here:

  • linickx-fedora.repo
    [LINICKX]
    name=LINICKX Fedora Yum Repo
    baseurl=http://www.linickx.com/files/rpm/fedora/$releasever/$basearch/
    gpgkey=http://www.linickx.com/files/GPG-KEY-NICK
    gpgcheck=1
    
  • linickx-whitebox.repo
    [LINICKX]
    name=LINICKX WBEL Yum Repo
    baseurl=http://www.linickx.com/files/rpm/whitebox/$releasever/$basearch/
    gpgkey=http://www.linickx.com/files/GPG-KEY-NICK
    gpgcheck=1
    

copy the .repo’s into your /etc/yum.repo.d dir and you should be away ! Let me know if you have any problems :cool:

Firefox i386 on x86_64 rpm – ( Fedora Core 5 )

There are loads of posts on this and they all miss out a couple of pieces of information

How ?
Well I downloaded the latest firefox from fedora’s update page , then I ran: (as root)

rpm -ev firefox

then from the directory I downloaded firefox to:

rpm -ivh –nodeps firefox-VERSION-.i386.rpm

What happens Next ?
The first time I ran it, I got a pop up complaining about an install.rdf, I ignored this, and firefox loaded fine, but without any of my extensions in my profile. I then closed firefox, and the second time it ran by extension loaded :-) ….. finally I noticed that the beagle index extension wasn’t loaded, so within firefox, I did a file open

/usr/lib64/beagle/beagle.xpi

and that seemed to do the job – Bring on the Java & Flashy plug-in goodness

Feed is not a registered protocol – Firefox , gnome and Fedora Core

I’ve put up with this error message for some time now:

Feed: is not a registered protocol

I run a firefox on gnome on fedora core, installation on my laptop. No matter how much googleing I did, I could not work out which part of the puzzle was at fault.

Well, today I sussed it, if I visit feed:myfeed the feed opens in google reader :cool:

So what have I done ?
Well it turns out that gnome was at fault :( Basically firefox passed the Feed: protocol back to the os (which gnome handles), what you need to do, is tell gnome what to do with Feed:. on my laptop there are two directories of interest:

  • /home/nick/.gconf/desktop/gnome/url-handlers
  • /etc/gconf/gconf.xml.defaults/schemas/desktop/gnome/url-handlers

what I did, was go into each of these can copy the http directory as feed.
This will cause the feed protocol to be opened with your web-browser (you may need to log in & out each time you change these file or directories), In my case this is firefox, and firefox doesn’t know what to do with the links. So to change where to send the feed protocol else where I edited /etc/gconf/gconf.xml.defaults/schemas/desktop/gnome/url-handlers/feed/%gconf.xml so that the command ran was “feed %s” (rather than firefox %s) I then created a bash script called feed (and placed it in my $PATH).

#!/bin/bash
FEED=${1#*:}
firefox http://www.google.com/reader/preview/*/feed/$FEED

Now when I click feed:myfeed it previews the feed in google :D

FC3 X11 On a Sony PCG-C1F

So I’ve been clearing out some stuff and I found another thing of use.

When I had a Sony Vaio, I remember the most annoying thing to get working was X11, specifically finding the right Fedora Core xorg.conf. I’ve uploaded my working xorg.conf here , now if you’re a really newbie and need some steps read-on, else you’re probably done ;)

Firstly, if you boot the PCG-C1F from the CD-ROM, and just hit enter at the install prompt, anaconda will try and start X, and when it does it can’t set the resolution right. So, the best thing to do is install in text mode. Text mode is started at the install prompt with:

linux text

The install should go fine, upon 1st reboot, Fedora will try to load X (assuming you’ve installed it) , and you won’t be able to go any further as you need to select I agree on the user agreement, but the button is off the screen :’(

To go further you’re probably gonna need a USB disk, copy my xorg.conf onto the disk, and boot the Vaio from the Fedora Core Install CD with your USB disk plugged in (If the disk isn’t plugged in, the drivers won’t be loaded), But this time from the install prompt go into rescue mode….

linux rescue

Copy the xorg.conf from the USB disk to /etc/X11 and reboot.

X11 will boot up and now you can accept the user agreement, you’ll hit next, next, next and find on your 2nd reboot that X is broken again :mad:

This time hold down ctrl & alt at the same time and hit F2 and you’ll get a shell prompt, log in as root, mount your USB disk and overwrite /etc/xorg.conf again, final reboot, and all is good :D

Look a screen-shot to prove I got it working ! :cool:

Sony Vaio PCG-C1F

B4 I forget – SSL XMMS

A while ago I put some effort into getting SSL support working with XMMS on Fedora Core 3, unfortunatley I didn’t get very far :(

Ages a go Dustin Kirkland was kind enough to help me out (he wrote an SSL patch for XMMS), but I never got a change to finish, Since this message has been flagged for follow up for soooooo long now, I thought it only fair to share what Dustin sent me, when (& if) I get this finished I’ll publish an rpm :cool: good luck !

———- message ———-
From: Dustin kirkland
Date: May 27, 2005 1:15 PM
Subject: Re: [Bug 1579] – Https / SSL support for streaming mp3 and ogg
To: “bugzilla-daemon@bugs.xmms.org”

Nick-

I, too, am running Fedora Core 3 and I also cannot build the version
straight out of CVS. I’ve tried a handful of different back- and
forward-level auto* tools and I still get problems with some of the
macros.

You can try this, though, as it did work on my FC3 system:

> cd /tmp
> wget http://www.xmms.org/files/1.2.x/xmms-1.2.10.tar.gz
> tar zxvf xmms-1.2.10.tar.gz
> cd xmms-1.2.10
> wget http://bugs.xmms.org/attachment.cgi?id=320&action=view
> patch -p1 < attachment.cgi\?id\=320

At this point, I have 1 minor hunk that fails. It's like 4 lines that
you can manually plop in. Take a look at Input/mpg123/mpg123.c.rej
and at the lines that start with + into Input/mpg123/mpg123.c. I
replaced lined 927 with:

#ifdef HTTP_SSL
if (strncasecmp(filename, "http:// " , 7 ) &&
strncasecmp(filename, "https://", 8 ))
#else
if (strncasecmp(filename, "http:// " , 7 ) )
#endif

> ./configure
> make
> make install

Hope that takes care of you. If anyone else figures out how to
extract from CVS and compile XMMS on FC3, I’m all ears. I asked this
question earlier on the mailing list and didn’t find a silver bullet:

http://lists.xmms.org/pipermail/xmms-devel/2005-January/002965.html

———- end of message ———-

thanks again Dustin

Downloader for X… for FC3

ok, so it’s been a while since I’ve needed to rebuild an rpm, I guess it just goes to show what a good job those repo-boys are doing !

Well I’ve just noticed Solaris 10 is available and I needed a download manager. Normally the built in download manager in firefox will do, but today I wanted to be able to control the speed at which I downloaded ;) … et voila d4x, an rpm hasn’t been build since fc2 so I built one.

Here’s a screen shot to keep you interested !

Download d4x

Fedora Core 3 – A working Beagle !

I’ve been trying to get beagle working on my FC3 machine for a while now, but without much success :( . I have two fc3 machines at my disposal , what I ended up with was one where the beagle daemon would load & index data, but the best (search) gui didn’t work – So I couldn’t easily search what I had indexed – and on the other the best gui worked, but the daemon wouldn’t start – DOH , a gui but nothing to search !

Last night was a turning point in my beagle experience, on the 1st of June beagle version 0.10 was released, and I successfully installed it on my 1st machine that had a working daemon, and to my surprise the gui instantly worked! :cool:

If I get it successfully working on my other box I’ll document what I’ve done ! – Watch this space ;)

Gnome-Blog: A new RPM & way to post.

I’m forever looking for ways to make things easier for myself ;)

Today I came across gnome-blog it’s a small gnome applet that allows you to post direct from your desktop, Infact that’s exactly how this was written ! (h)

The default FC3 rpm on seths website didn’t install for me, it complained about a python(abi) dependancy – which I just couldn’t find :( – I did however find this similar rpm which I installed before installing gnome-blog, so if you have problems installing my rpm, then this may help. ( http://dl.atrpms.net/~/pythonabi-2.3.4-1.rhfc3.at.i386.rpm )

This is the screenshot from seth’s site, although I can’t work out how to preview like his !

screen shot

Oh yeah – my rpm is here: gnome-blog-0.8-1.i386.rpm

Getting started with ACPI

Hardware stuff, especially laptops is usually window$/manufacturer specifc so getting some of it work work can be a bit of a pain. In FC1 low batteries & standby is handled by APM, in FC2 upwards APM is replaced with ACPI & this is a quick text on getting going.

There are two folders & a service :

  • /etc/acpi/actions
  • /etc/acpi/events
  • /etc/init.d/acpid

The service , I think runs in the background monitoring the hardware, you can then put events into /etc/acpi/events and get things to happen when the deamon spots them .

I originally tested this on an HP Omnbook 6000, but now I’m using a compaq nc6000 . To replace apm I need to

  1. Monitor Battery / Power Status
  2. React when power button / standby pressed
  3. Do Something when the lid is closed

Documentation :

http://acpi.sourceforge.net/documentation/index.html


To get started I had a look at the documentation ;) also there is an example in FC3 ( /etc/acpi/events/sample.conf )

Sample.conf

 # This is a sample ACPID configuration
event=button/power.*
action=/sbin/shutdown -h now
 

the Documentation explains that all acpi “real time” info is stored in /proc/acpi .

If you look /proc/acpi there is a directory “button” and in there “power” , so sample.conf seems to suggest if anything under “power” changes do action (in this case shutdown the machine).

Armed with this I could “test” with something a little quicker than switching on/off the machine; like opening / closing the lid….

So, in /proc/acpi/button/lid/C139 (the C139 is laptop specific) there is a file called state, and when it will tell you if the lid is open or closed (just in case you didn’t know ;) ), now it is this “lid” directory that acpi will be looking for, so what you do is create a file called /etc/acpi/events/lid and put in it

/etc/acpi/events/lid

# This is a sample ACPID configuration – what to do when a laptop lid is closed.
event=button/lid.*
action=/etc/acpi/actions/lid “%e”

You’ll notice that the action is set to /etc/acpi/actions/lid “%e” this will be a script, but you could point it to any script/executable you like. In /etc/acpi/actions/lid I have put

/etc/acpi/actions/lid

#!/bin/bash

# Make sure we recieve something !
if [ "$1" = "" ]
then
echo “Script Failed, NO Input !!!”
exit
fi

# what we got from the acpi deamon
acpi_in=”$1″
# what the lid code was…
lidstatus=`echo “$acpi_in” | awk ‘{print $4}’`

# the lid code in dec
dec_lidstatus=`printf “%d\n ” 0x$lidstatus`

#prepare for the maths
x=$dec_lidstatus
y=2

# was the lid code odd or even ?
mod=$(($x % $y)) # get the remainder of x / y and assign it to variable mod

# If %mod is 0 then the number is even, if it is 1 then the number is odd !
if [ $mod = 0 ]
then
# even numbers mean the lid is open !!!
# wall lid open
exit
else
# odd means closed !!!
# wall lid closed

# so lets lock the desktop !
su – nick -c “xscreensaver-command -lock”
fi

Now, this needs a little explaining…..

There a couple of things you need to know about acpi

  1. acpi runs as root, so any event get’s executed with root priveleges :D
  2. %e is an incremental number, odd numbers for lid closed & even for lid open
  3. To get these changes to work you need to restart the acpi service

So as you can see my lid open/close script gets a little complicated. To play if you remove the comments in from of the “wall” commands, save an open an empty shell, when you open & close the lid you get broadcast messages from root ! :cool: or if you just leave it as it is it’ll try and run “nick”‘s screen saver :D

Now my old laptop had both a standby or sleep button and a power button, but getting events to happen is exactly the same, simply create a script doing what you want it to do, create a file ine /etc/acpi/events and set the event to event=button/power.* (or event=button/sleep.*) and voila !

Now finally, monitoring battery status, thankfully gnome already has a nice applet

or if you want to check it your self /proc/acpi/battery/C138/state (again C138 is laptop specific) this file will tell you !

I hope you’ve found this of some use !

Building the inotify kernel

I’m in the process of tring to get beagle working on my FC3 Laptop, being my usual read the instructions later self, I added the yum repo suggested on Beaglewiki.org and it resolved all it’s dependencies, and I thought all was good, but it wasn’t :( .

Turns out my laptop installed the latest kernel from the official fedora updates, rather than a custom one that i needed… So I decided to have a go at building it myself :D

The beagle guys provide their own src.rpm so I just tried using the “patch” info in that to patch the latest proper kernel from Fedora/Redhat… but no joy :’( …but then I found a cracking thread on fedoraforum.org

http://www.fedoraforum.org/forum/showthread.php?t=29434&page=1&pp=15

So this is what I did….

(1) Install the “proper” source kernel rpm kernel-2.6.10-1.770_FC3.src.rpm
(2) From the src.rpm provided by beaglewiki/Ben Konrath I extracted inotify.patch
(3) Then from my ~/rpmbuild/SPEC dir I ran

$SHELL>rpmbuild -bp –target=i686 kernel-2.6.spec

(4) make your custom kernel custom edit ~/rpmbuild/BUILD/kernel-2.6.10/linux-2.6.10/Makefile

EXTRAVERSION = -inotify_linickx

(5) apply the inotify patch from ~/rpmbuild/BUILD/kernel-2.6.10/

$SHELL>

patch -p0 < /path/to/patch/inotify-0.19.patch

(6)Check the patch went on…. run:

$SHELL> make menuconfig

and check that Device Drivers -> Character Devies – Inotify is “stared”
(7) Build your kernel/rpm

$SHELL>time make rpm

time show how long the command took

Now that I’d built my kernel, I needed to install it…

(8) the rpm/kernel is in ~/rpmbuild/RPMS/i386, so I installed it

$SHELL>sudo rpm ivh kernel-2.6.10inotify_linickx-1.i386.rpm

but for some reason this isn’t enough… :( so the next step was to …
(9)

$SHELL>cd /boot
$SHELL> sudo /sbin/mkinitrd /boot/initrd-2.6.10-inotify_linickx 2.6.10-inotify_linickx

(10) and finally /etc/grub.conf needs some new entries… mine look like:

title Fedora Core (2.6.10-inotify_linickx)
root (hd0,2)
kernel /boot/vmlinuz-2.6.10-inotify_linickx ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.10-inotify_linickx

and then I was able to reboot into my new kernel :)

Please note: If you want to use the inotify device you will also have to add a line to your /etc/udev/permissions.d/udev.permissions. You will need to add

inotify:root:root:666

to the very bottom so that it will hold its permissions on each reboot.

Hopefully now I can press on getting the beagle to work ;)

References
kernels = http://www.bagu.org/inotify/
orriginal patches = http://www.kernel.org/pub/linux/kernel/people/rml/inotify/v2.6/0.19/
inotify 4 linux = http://www.edoceo.com/creo/inotify/
custom kernel rpms = http://www.fedoraforum.org/forum/showthread.php?t=29434&page=1&pp=15

Using Legacy Sound Cards In FC3

For a short time I had a Sony PCG-C1F laptop …

Now these boxes are quite old, so it get sound working in Fedora Core 3 we’d need some legacy sound card support. Sound cards in FC3 are powered by ALSA & the alsa project is very comprehensive, and support the sound card in this box… BUT surprisingly, on a clean install of fedora it doesn’t work :(

So what do we need to do to get legacy sound cards to work ?

According to the ALSA documentation we need to run a configuration utility called alsaconf.. but it doesn’t exist. I found a thread on the fedora list that explained this…

https://www.redhat.com/archives/fedora-list/2004-November/msg08614.html

As you can see bug was filed, and closed, since aslaconf was removed by the FC team due to the possabiliy that the probe it runs may crash your machine…

So to get alsaconf back we need to 1st un-install the current version & it’s depandancies.

[root@localhost ~]# rpm -ev firstboot-1.3.33-1.noarch
[root@localhost ~]# rpm -ev system-config-soundcard-1.2.10-1.noarch
[root@localhost ~]# rpm -ev alsa-utils

Now we need to get a new version, you now have a choice.

  1. Install my RPM http://www.linickx.com/files/rpm/fedora/alsa-utils-1.0.6-3.i386.rpm
  2. Build your own ! :)

Installing my RPM
This is quite simple as root

[root@localhost ~]#rpm -ivh http://www.linickx.com/files/rpm/fedora/alsa-utils-1.0.6-3.i386.rpm

Building your own RPM
again.. not too complicated ;)

To start with you need the source rpm from redhat:

http://download.fedora.redhat.com/pub/fedora/linux/core/3/SRPMS/alsa-utils-1.0.6-3.src.rpm

Then install it into your build directory.. if you don’t know how.. have a quick read of this Rebuilding RPMS – Getting started guide

In alsa-utils.spec you need to remove the following lines:

%{__rm} -f $RPM_BUILD_ROOT/sbin/alsaconf \
$RPM_BUILD_ROOT%{_mandir}/man*/alsaconf*

then rebuild the rpm

$SHELL>rpmbuild -ba alsa-utils.spec

and install the rpm

[root@localhost ~]#rpm -ivh alsa-utils-1.0.6-3.i386.rpm

And FINALLY Configuring the Sound Card

to configure your sound card run /sbin/alsaconf , follow the onscreen instuctions and you’re sorted, further documentation on configuration is available at alsa-project.org

ahh, it’s all music to my ears !

Rebuilding RPMS – Getting Started Guide.

I’ve got a few posts in my wordpress drafts that are based around rebuilding RPMS, I figure that before I finish them it makes sense to wrte a Getting Started Guide.

The first thing is based around the “Unix Golden Rule”: Only use root when you have to.

To rebuild rpms you need a cirtain directory stucture, it is located in /usr/src/redhat, but since it is owned by root you’re gonna need on in your $HOME. The following does the job:

$SHELL>cd $HOME
$SHELL>cp -a /usr/src/redhat/ rpmbuild
$SHELL>echo ‘%_topdir %(echo $HOME)/rpmbuild’ >> .rpmmacros

Next: you need a Source RPM, these are usually found with any other RPM, except they end .src.rpm rather than .i386.rpm or similar. Start with something simple like wget; (Sometimes building rpms requires dependancies) now this import, install as your normal user NOT root.

$SHELL>rpm -ivh wget-1.9.1-17.src.rpm
1:wget ########################################### [100%]
$SHELL>

This will put all of the source in wget-1.9.1-17.src.rpm into your $HOME/rpmbuild directory, specifically you’lll find the actual sources in $HOME/rpmbuild/SOURCES and a SPEC file in $HOME/rpmbuild/SPEC. The Sources are all the files you need; so the source.tar.gz that you’d usually run the “holy trinity” (configure, make, make install ) against, and any patches. The SPEC file is what turns the sources & patches into the RPM, so if you want to change the RPM in anyway, like change the changelog (i.e. packaged by [NICK] ) you edit the spec file.

So to turn the src.rpm into an installable file you run.

$SHELL>cd $HOME/rpmbuild/SPECS
$SHELL>rpmbuild -ba wget.spec

and in $HOME/rpmbuild/arch/will be wget-1.9.1-17.arch.rpm (in my case arch is i386; oh and sometimes you get a debug rpm, which gives you some developemnt stuff you might need), and now you have an exact copy of the wget RPM built by Redhat but this one was built by your fair hands ;)

So to Install as root or using sudo

rpm -ivh wget-1.9.1-17.i386.rpm

& you’re done ! So now if you find a src.rpm but not one to install, now you can build your own.

Here are some useful References :

Better Living Through RPM, Part 1
Better Livig Though RPM, Part 2
How to Sign Custom RPM Pakages with GPG
How to create rpmbuild directory