Non-Linear

20 April 2006

Fedora Core 5 - Updates (my god!)


Sat down and though I'd run some updates today having been looking around and seen notices for a couple of vulnes.

My good lord! 300 Megs worth of updates, I only did them at the weekend?

I pitty the fool who has the computer on all day whilest at work, uses it for about an hour and dosen't check if there are any updates (me).

The NTL account holder with whom I live has subsribed to NTLs lowests serivce level (fair enough) but updates take eons. Still makes you think, if NTL can do this with two tin cans and a semi-taught piace of damp string, imagine what we'll be able to do when they start 1000tx-to-the curb!

17 April 2006

Fedora Core 5 - Kernel Source from src.rpm


This is all nicked form mjmwired


Thought I'd reproduce it in a place I know where to get it quickly. Cheers MJM :-)

Installing the kernel source is typically NOT needed unless you wish to
re-compile your kernel or for some special development. However in most
cases the kernel headers are required.

There are 3 basic steps involved in installing the kernel source.
1. Download the desired kernel source (matching your current kernel if required)
2. Installing the SRC.RPM package
3. Using rpmbuild to prepare the source into a usable state

NOTE: Following these steps will consume over 570MB of disk space!

Obtaining Kernel Source (for default FC5 kernel)

The default kernel source can be found through any Fedora mirror. Look in the
directory "/SRPMS/" under the "/5/" directory . For example:
http://download.fedora.redhat.com/pub/fedora/linux/core/5/source/SRPMS/.

Select: kernel-2.6.15-1.2054_FC5.src.rpm 14-Mar-2006 18:28 46M


Obtaining Kernel Source (for updated FC5 kernel)

If you updated your kernel, then the typically the last 2 or 3 releases of the
source of the kernel will be available though the Fedora updates.
IF YOU REQUIRE you can (try to) match the kernel source with your running kernel.

The following is an EXAMPLE
[root@charon fc5]# uname -r
2.6.15-1.2059_FC5

Look in the update directory on most Fedora mirror sites. For example:
http://download.fedora.redhat.com/pub/fedora/linux/core/updates/5/SRPMS/.


Obtaining Kernel Source through 'yum'

There are yum utilities which will download the LATEST kernel source.

[root@charon fc5]# yum install yum-utils
[root@charon fc5]# yumdownloader --source kernel


Install the SRC.RPM file and Prepare source

Install the kernel.src.rpm that you chose to install in the previous steps.

Install:
[root@charon fc5]# rpm -ivh kernel-2.6.15-1.1955_FC5.src.rpm
1:kernel ########################################### [100%]

Set it up:

[root@charon fc5]# rpmbuild -bp --target=noarch /usr/src/redhat/SPECS/kernel-2.6.spec

The source files will be properly located in '/usr/src/redhat/BUILD/kernel-2.6.15/'
There are 2 useful directories:
'linux-2.6.15.noarch/'
This will have the standard kernel.org kernel WITH Fedora patches and updates
'vanilla/'

This will have the standard kernel.org kernel ONLY (no patches or updates)

13 April 2006

Fedroa Core 5 Post Install Steps



I've had FC5 on my laptop since beta 2, wnet to beta3 and finally squashed and installed the full release version.

Over all I'm pritty happy with it (other tan the ssmbfs issue see other articles) most admirably my battery monitor now works on my Acer 5002.

* See cautionary note at bottom of article

Last weekend I squashed and installed Fc5 on my main linux box, all wne fairly smoothly, decided not to upgrade as it wasn;t to much trouble to do a ground up install and thought this probably safer with the huge software revision upgrades involved.

As with most Fc installs of mine, it's become a matter of course to perform a few post install tasks , heres what I did.

Update stright away

As soon as I got the box up and running I performed an update with the default repo files installed, modified them to use a nearer mirror serivce, in my case heanet.ie (mirror.ac.uk seems to be missing fedora site and the spped stinks at the moment, might be to do with all the SuperJanet5 work going of at the moment).

I used Yum Extender.

I did this out of preferance really, been using it for a while an I like it. FC5 comes with PUP (update manager) and has been sorta slated because of it's lack of granular control over update selection.

Anyway, ran the updates from Extra and Core and it seemed to take everything, later I noticed that there where a few things which didn't install quite so right. Mainly the kernel update and avahi failed to install, i tried a couple more times using yumex but no cigar.

Finaly i tried running the updates for the kernel, avahi, sendmail etc thorugh PUP and sure enough it worked. Rebooted and was using the new (kernel 2.6.16-1.2080_FC5), don't know why but it worked?

Slightly perturbed by this i tried installing some software via yumex and that installed fine, tride some update through yumex and that worked fine to!

Not worrying to much I moved onto the next phase of the post install process and installed my essential time saver custom repo files.

Customer Yum Repository Files

Redhat / Fedora don't ship a load of really popular and handy apps in thier repos because of 'ugly' license issues and brakes in GNU compliance, most notably mp3 decoders.

To work around this issue whilest side stepping 'dependancy hell' some non RH/FC affiliated groups have setup thier own repositorys that contain these extra apps and enhancements. This enables the user/SA to install the stuff through yum without having to worry to much about meeting the dependacies, a job no one envies.

On FC3 and grater the repository files (the files that tell yum where to look) are located in /etc/yum.repo.d/ and end in the exstension .repo. most third party repository sites have repo files you can save direct into this location and yum will use when it's next invoked. Below are the third party repo's I use, seems to cover pritty much everything.

In order to use these config files just create them within /etc/yum.repo.d/ as root perhaps using a command from the shell such as:

[root@localhost /]# vi /etc/yum.repos.d/atrpms.repo

You shell should change to a view with highphens down the left had side. Press the i key to insert and type or past the configs below into each file. To save tha changed do the following
  • Press the escape key on the keyboard to come out of insert mode.
  • Press Control key and Colon key together (should get a : prompt in the bottom left of the screen).
  • Type in wq and hit enter (wq stand for w=write q=quit)
This should take you back to the shell. A little time save to typing in each entry is to highlight and copy the config text from this page and paste it into the document once your in insert mode by pressing the shift key and insert key simultaneously the procedure as normal from the first bullet point above.

Remeber to create a new file for each config with a sensible name ending in .repo .

Yum repo file configs

Follow the instructions above to use the configs. The actual file content starts at the first open square bracket '[' .

ATRPMS Repository

[atrpms]
name=Fedora Core $releasever - $basearch - ATrpms
baseurl=http://dl.atrpms.net/fc$releasever-$basearch/atrpms/stable
enabled=1
gpgcheck=1

Dries Repository

[dries]
name=Extra Fedora rpms dries - $releasever - $basearch
baseurl=http://ftp.ipv4.heanet.ie/pub/freshrpms/pub/dag/dries/fedora/fc5/i386/dr
ies/RPMS/
enabled=1
gpgcheck=1

Livna Repoistory

[livna]
name=Livna for Fedora Core $releasever - $basearch - Base
baseurl=
http://rpm.livna.org/fedora/$releasever/$basearch/
http://livna.cat.pdx.edu/fedora/$releasever/$basearch/
http://wftp.tu-chemnitz.de/pub/linux/livna/fedora/$releasever/$basearch/
http://ftp-stud.fht-esslingen.de/pub/Mirrors/rpm.livna.org/fedora/$relea
sever/$basearch/
failovermethod=priority
#mirrorlist=http://rpm.livna.org/mirrorlist-5
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-livna

[livna-debuginfo]
name=Livna for Fedora Core $releasever - $basearch - Debug
baseurl=
http://rpm.livna.org/fedora/$releasever/$basearch/debug/
http://livna.cat.pdx.edu/fedora/$releasever/$basearch/debug/
http://wftp.tu-chemnitz.de/pub/linux/livna/fedora/$releasever/$basearch/
debug/
http://ftp-stud.fht-esslingen.de/pub/Mirrors/rpm.livna.org/fedora/$relea
sever/$basearch/debug/
/etc/yum.repos.d/livna.repo

Fresh RPMS Repository

[freshrpms]
name=Fedora Core $releasever - $basearch - Freshrpms
baseurl=http://ftp.ipv4.heanet.ie/pub/freshrpms/pub/freshrpms/fedora/linux/$rele
asever/
#mirrorlist=http://ayo.freshrpms.net/fedora/linux/$releasever/mirrors-freshrpms
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-freshrpms
gpgcheck=1

GPG Keys

The more observant of you might have noticed the gpgcheck=1 option at the bottom of each repo config. This tells rpm to check the GPG signature of each package before it's installed / updated. This is done to help ensure it's authenticity, each repo signs it's packages with a key to say it's from them a pukka.

Out the box you'll only have the fedora GPG keys installed on your system so packages from any other repo will fail beacuse your computer doesn't have the correct key to check its kosha. to remidy this all you need to do is download and install the repsective GPG keys, heres how.

Download the keys to somewhere (dekstop maybe, dosn't mater).

ATRPMS GPG KEY
Dries GPG KEY
FreshRPMs GPG KEY
Livna GPG KEY

Once you've downloaded the public keys above, crack open a shell and cd into the direcotry you've put them in eg. cd /home/moses/Desktop and import them using rpm as shown below.

rpm --import atrpms.gpg.key dries.gpg.key freshrpms.gpg.key livna.gpg.key

Substitue the name for each key file for what ever you saved them as, you can string them together so you don't have to run rpm each time for each key.

Once you've done this your ready to rock'n'roll with the third party repos.


Almost all of the repos above have newer versions of programmes than that which currenlty are available on the Fedora repos.

PUP or what ever won't diffrentiate between these updates and the official ones from Fedorta Core. This can lead to a lot of problems if you aimlessly select update all from within PUP or YumEx without check where the updates are coming from as they'll conflict with the updates which will typically come out at a later date from FC.

One easy way around this is to use YumEx and select which repos you want to use from the button on the left hand side. If your checking for updates for the sysem just select core, extras and updates.

What I'm saying is don't update aything from one of these 3rd party repos unless you installed it from there, if you're not sure don't do it.

NSLU2 Samba Problem with Fedora Core 5


I own an use quite heavly one Linksys NSLU2 SoHo network Attached Storage server. Very cheape ('bout £40 GBP) uses usb hard disks for storgae. As with almost any elelctrical applicance now days, you can install Linux on it thanks to the NSLU-Linux group.

As per the website I have 'unslung' my slug and it's been slimin' away happily for a few months now.

With the relase of Fedora Core 5, one of the changes to be made is the deprecation of smbfs from the kernel in favour of CIFS. CIFS is the replacement affectivly for smbfs and should work however, it dosen't always.

If I try to mount a samba share from my slug onto my FC5 box I get the following error.

[root@localhost moses]# mount //192.168.1.77/music /mnt/nasmusic/
mount: unknown filesystem type 'smbfs'

Fair enough, because the smbfs ident has been removed from the kernel. So lets try it with the -t cifs option (specifying the filesystem).

[root@localhost moses]# mount -t cifs //192.168.1.77/music /mnt/nasmusic/
Password:
retrying with upper case share name
mount error 6 = No such device or address
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

So it takes the password ok then says it can't find the share. I don't know why it does this, I've done a ipkg update and ipkg upgrade on the slug but it still does this. Checked /etc/samba/smb.conf (or equivilent) to see if there was an option for share versions, cifs perferance but couldn't find anything.

Eventually, posed with the prospect of having no media I ended up installing and configuring NFS on the slug. Hopefully it's only temporary, it's fairly easy to do, heres how.

  1. Log onto the slug as root
  2. run ipkg update (this updates the package database)
  3. run ipkg install nfs-utils (this'll install nfs)
  4. Edit the /opt/etc/exports file. This file is where the 'shares' are defines along with there permissions, the files fairly self explanitary.
  5. cd to /opt/etc/init.d
  6. Do a sh S56nfs-utils . This'll export the sghres (make them available)
  7. On the local machine add the required entries into your fstab (if you want it to mount everytime the computer comes up) or with a mount command from the shell if it's a one off.
    Heres an example of the last couple of lines of my /etc/fstab on my FC5 box.
[root@localhost kernkraft_400_data11cds]# tail /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
192.168.1.77:/share/hdd/data/music /media/nasmusic_writable/ nfs rw

You can see from the last line my NFS mount directive. There are some inherent security issues with NFS and also a load of options that you can use whilest mounting, check out google for this info.


DVB-T USB Permission Denied - Fedora Core



I've got a FreeCom DVB-T USB 2.0 freeview stick. To get it to work under FC5 just drop the two firmware files into the /lib/firmware directory and plug it in.



Install Kaffeine to watch TV pritty much instantly (the channels > scan for channels option on the DVB menu takes care of the tzap-esq work which usually needs to be done manually).

One problem you might run into is Kaffeine (or any other prog) sating it either can't find the device or you don;t have permissions to acces it.

Two things could becausing the problem.
  1. You've got a problem with your install
  2. The permissions on the /dev/dvb/adapter are opreventing you from using the device.
I'm not going into the first issue in this article as the causes could be endless, sufice to say that if you have a fresh FC5 install and have copied the to firmware files (dvb-usb-wt220u-01.fw dvb-usb-wt220u-02.f) into the /lib/firmware/ folder it should work. It does for me!

The second issue is more common. First off find out if it is a permissions issue by trying to access the device as root.

  • Open a command prompt and type in SU, you should be prompted for a password. This is the root password and you should know this unless someone else has setup the system (in which case ask them).
  • Now run kaffeine by running the following in a shell
[root@localhost /]# kaffeine&
  • The Kaffeine window should now appear and you should see the DVB option available in the bottom right.

  • Before you clikc this icon goto the DVB menu at the top of the screen and select channels from it. This shiould come up with another screen with a button at the top which says scan.
  • Above the scan button is a drop down entitles 'scan on' , this is suppose to be set to your nearest tansmitter, for me it's waltham (covers a lot of the midlands - uk). Pick the one you thinks closest. Once you've done that it scan and you should start to see the channels appear ont he right hand side. Once it's finished, highlight all the channels you want and click ont he 'add selected' button to transfer them into your 'play list'.
  • O.K all the way out and you should now have a list of channels on the left hand side which you can double click to watch. Give it a go!
Once you've done this and have watched a bit of telly (maybe a bit jittery but TV nether he less) you now need to go about changing the permissions on the /dev files so that everyone can use it (not just root).

Because the device files a re created dynamically by udev when the usb device is attached, you can't just chmod -R 777 /dev/dvb/adapter0/ . If you do, when the computer comes up next ro when you detach and reattach the device, the file permissions on the device files will reset to their original. Instead what we have to do is edit the /etc/udev/rules.d/50-udev.rules file.

This file covers a host of diffrent devices you might want to attach to your compuetr and have hot-mounted . It governs where device files are created and with whayt permissions. The lines we need to edit are percursed with the #DVB title. Crack open you fav editor as root and edit the 50-udev.rules file. The #DVB sectio is about half way down, heres what mine use to look like (line numbers in bold).

1: DVB
2: KERNEL=="dvb", MODE="0660"
3: SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", 4: NAME="%c", MODE="0660"

As you can probably see from the mode operands, the permission octets are set to 0660. This is the problem. simply change the mode to 0777 or something suitable and save the file. Here's my funstional 50-udev.rules file,

1: # DVB
2: KERNEL=="dvb", MODE="0777"
3: SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", 4: NAME="%c", MODE="0777"
Like I said, this works for me and, given the fairly vanilla state of my box, should work for anyone with a FC5 install.

04 April 2006

flange (flnj)

flange

n : a projection used for strength or for attaching to another object [syn: rim]




A Stainless Shank Flange