Archive for the ‘Linux’ Category

Building RPMs as a normal user

We often told that building an RPM as root is a bad thing. While this is very true, how do you build it as a normal user?

The trick is to use rpmdev-setuptree. This will create a empty build tree in ~/rpmbuild as well as sort out you .rpmmacro file so rpmbuild knows to use it.

It’s really simple actually, so here goes.

  1. As root, install rpm-build, rpmdevtools and yum-utils.
    yum -y install rpm-build rpmdevtools yum-utils
  2. Now as a user, create a rpmbuild tree:
    rpmdev-setuptree
  3. Now as a user, download your RPM source:
    yumdownloader -source sox
  4. Again as a normal user, install the source rpm
    rpm -ivh <rpm>.src.rpm
  5. Go in to ~/rpmbuild and make whatever changes you need to. The Spec file will be in ~/rpmbuild/SPECS and the source will be gzipped in ~/rpmbuild/SOURCES
  6. Now build it!
    rpmbuild -ba ~/rpmbuild/SPECS/<spec file>
  7. Assuming everything went OK, the RPMs will be in ~/rpmbuild/RPMS/, but you’ll need to install them as root.
  8. If you find your rpmbuild is getting full of crap, you can either delete it and rebuild it, or a slightly more elegant way would be to use
    rpmdev-wipetree

Yet another Fedora 10 cock-up

Oh poor Fedora, don’t worry we still love you, even if you do keep cocking up. It’s been a hard few months for my favourite distro. First we had the security problem with the gpg key for the updates, then we had the evil dbus update which broken F10, and now we’ve got the odd day-of-the-week bug for the UK.

The bug is simple, according to the gnome clock applet our week starts on a Tuesday. Opps, but that shouldn’t be too much of a problem to change. Digging around the net, I found some references to locale files in /usr/share/i18n/locales. Although they looked correct, I tried changing them anyway. To absolutly no effect. The answer? To recompile glibc-common! Oh for fucks sake, the bug for this has been opened since Novemeber, should I really have to recompile what is a massive RPM, just for this? Why aren’t these files read at login, or better still, why can’t I used system-config-date to change my preferences.

Anyway for those of you who are interested, you can track the bug on bugzilla or Sourceware.

I’m also rebuilding the glibc-common RPM now, if it works, then I’ll post an updated version when it’s finished

Testing mail servers

Back in the good ol’ days of POP3 it was really easy to test a mail server manually you just simply telnet to port 110 issue some 3 command and done! Now that all ISPs support IMAP things are a little more complicated. Here’s my little guide to manually testing POP3, IMAP and SMTP

Read more

Getting BIOS information

I recently needed to get a load of Dell service tags from some remote servers. Dell very nicely provide a ActiveX component for Windows but nothing for Linux. Fortunately we can use dmidecode. Run it as root and it will output loads of hardware info. If you looking for something specific, then you can run it with -s option and provide a keyword such as:

  • bios-vendor
  • bios-version
  • bios-release-date
  • system-manufacturer
  • system-product-name
  • system-version
  • system-serial-number
  • system-uuid
  • baseboard-manufacturer
  • baseboard-product-name
  • baseboard-version
  • baseboard-serial-number
  • baseboard-asset-tag
  • chassis-manufacturer
  • chassis-type
  • chassis-version
  • chassis-serial-number
  • chassis-asset-tag
  • processor-family
  • processor-manufacturer
  • processor-version
  • processor-frequency

Here’s the output of it:

[root@ajd-laptop ~]# dmidecode -s bios-vendor
Dell Inc.
[root@ajd-laptop ~]# dmidecode -s processor-manufacturer
Intel
[root@ajd-laptop ~]# dmidecode -s processor-frequency
1600 MHz
[root@ajd-laptop ~]# dmidecode -s chassis-type
Portable

Brotherly Love

mfc7820.pngAs you probably guessed, I love Linux in all it’s distros. OK, maybe I have a small hatred for Ubuntu but that because of the fan boy users thinking they invented everything. Anyway, I also know that all Linux users harbour a dark secret. A secret we’ve tried to keep quite for many years. A secret that if we actually admitted all Windows users would laugh and kick sand in our faces. Well I’m not scared! The secret is…. Linux driver support isn’t as good as Windows. You know that new feedback steering wheel – probably won’t work. That sexy new Laptop card reader – Wouldn’t hold your breath.

We’ve just got a shiny new Brother MFC-7820N printer/copier/fax/coffee maker in the office. Great, I thought, the printing will be fine as it’s postscript but I probably won’t be able to use the scanner or the fax part over the network. I’m OK with that and I don’t want to make a fuss else the M$ boys might get wind of our dirty little secret.

So when it arrived, it was with some trepidation I poking around the Brother website and found a Linux section. CUPS drivers, SANE drivers, LPR fax drivers. Wahoo! Even better when I went to install the printer in cups avahi had already spotted it and installed it. The SANE drivers are supplied as a couple of RPMs and a single line to activate then it works just like any other SANE driver. The fax part isn’t quite as polished, but still works. Absolutely amazing. I really am impressed with Brother. The whole ‘install’ took around 30 seconds.

The best thing about all of this was that when we tried to install everything on Windows, it too about 30 minutes to install and then uses a nasty GUI and tray service.

Return top