Saturday, March 31, 2007

Start building Ubuntu/Debina packages

Hans asked a while ago about packaging software for Ubuntu/Debian. Here are some hints and good pointers, I hope.

I have for a long time build RPM-packages for various distributions. When I began to create .debs this was booth good and bad to have a good knowledge about RPMs. Debian has a lot of utilities that makes things very smoothly, there are a lot of these tools I miss when creating RPM:s now days. On the other hand when you are used to describe your package in one .spec-file you may be a bit scared of all files you got in your debian-directory. Briefly described, the debian directory and .spec file has the same goal. They describe how to build the package from the source. I would say that if you are building a very simple package RPM:s are easier but as soon as you want to do more complex things deb:s are easier. for instance one thing you get help with creating debs is restarting daemons correct after upgrades etc, this is a mes for RPMs.

I will not describe exactly what to do when creating a package, instead I want to point out good sources and give some hints from my own experience.

Debian New Maintainers' Guide as well as Debian Policy Manual are must to use as a references. Ubuntu also has its own The Ubuntu Packaging Guide.

One thing that made it hard for me in the beginning were that there are so may ways that you can create packages in. Today, I think the easiest way to get a kick start in packaging is to follow the Debian New Maintainers' Guide. Start the from the beginning and create your package when you read it. Remember, the first one is the hardest.

You may need to install some packages before you start:

  • build-essential, which is a meta packages that install development tools.
  • dh-make, converts source archives into debian package source.
  • fakeroot, gives a fake root environment. I think it is much easier to work with than be in a change rooted environment.
  • dpkg-dev, several tools to maintain build debs.
  • dpkg-dev-el, a must if you use Emacs. Helps you edit the debian files.
  • module-assistant, if you will create kernel module packages. This packages also include a good how to.
As always, you want to use a version control system to trace your changes. It had been a discussion on the Ubuntu-devel-list about how to do it. I interpreted it as the most common and convenient way is to only have the debian directory under revision control and use dpatch and the patches subdirectory to handle your changes in the code. You should of course also submit the patches back to upstream, the project that develop the software you are building a package for. If you are responsible for the source your self, you may have the debian directory in the same repository as the rest of the source.

You may also take advantage by look how other packages are done. Download the source for packages with apt-get source sourcepackage.

When you are ready and your package may be of interest for others, please upload it to REVU.

AppArmor is in Universe for Feisty

This morning I got a mail from Kees Cook that told me that the AppArmor packages now is a part of Ubuntus Universe repository for Feisty. I hope we will make it to a really good packages including all the AppArmor functionality for Feisty+1.

Friday, March 30, 2007

In the enterprise world

Except from having a terrible cold this week I have been at two seminaries.

The first one was Red Hat and JBoss Value² Tour. Red Hat clearly show that they have entered into the offices of managers, CEOs, CIOs, VPs etc. They also show that they want to lock you in as any other vendor, but they can defend themself that at least the source is open. From a commercial and organizational perspective I think they do one important thing wrong. They are still not shipping proprietary drivers such as wireless, graphic cards, codecs etc. This means that as a system manager one must still handle these things to give the users a pleasant drive on the desktop. Here is an area where other providers such as Suse and also Ubuntu have done a tremendous job. On the other hand Suse trie to lock us in with Yast, even if it is open source, which makes it harder to manage from central point. Ubuntu on the other hand lack of kerberos/ldap/AD integration in main, which is a demand in many organizations.

Red Hat, like Novell, constantly talk about the better quality etc of the Enterprise editions than of the community editions. Here is where I have a big problem. This is not true; there are no quality differences. What Red Hat and Novell are selling is security. Not security in the perspective of computer security but security in the perspective of the managers being comfortable with their environment. Unfortunately, they are not willing to confirm this and instead throw FUD on the community distributions. This irritates me as an open source person. Managers are used to deal with a supplier that invites them to seminaries, dinners, and visits them to get them to feel that they are valuable. When we technicians point this out no one will accept it. The problem is not that they want to buy the enterprise distributions, but that they do not know why they are doing it.
Anyway, it is better that they select Linux instead of Windows or commercial Unixes.

The other seminar was a presentation from IBM about their blade solution. I got the "same" presentation from HP last fall. It is not easy to determine who is best or fits my needs best. Someone is better than the other in some points and vice versa. The two most interesting things were SAN over infiniband and local disk based on flash. The infiniband solution gives the possibility to stack several blade racks and use one common fibre channel switch out. The local flash disk is 4GB which is enough for the system disk. If you do not want to use a SAN for some reason you can have your system on a local disc and access your data via NAS (NFS or SMB). Why a flash disk instead of a normal disk? No moving parts and less power consumption is the easy answer.

IBM and HP, please start to certify your hardware for Ubuntu.

Sunday, March 25, 2007

Debian package patches

The small amount of time I have spent on Apparmor to day have been to merge my and Kees Cooks work. Then I updated to the latest subversion revision. Now I run into problems with dpatch, which I never have used before. I have to spend some time to look into more details, but it have to be another day.

I have not released any new packages to day, but Kees uploaded his packages to revu a few days ago.

I will soon watch on Jamie Oliver on TV.

Saturday, March 24, 2007

New release of Apparmor packages

I have now repackage the Apparmor packages for Ubuntu as a Multibinary package. This means that the source is one tar.gz-file and I will only need to do one upload to a central repository.
Other changes are that they are based on the March 2007 snapshot and include build dependencies. But also minor changes to better conform with Ubuntu/Debian policies.

Packages can be found at:

Unfortunately, I can at the moment see any possibility to get them into Feisty. It have to be for Feisty+1. If my assumption is correct I will host my own repository or try to get them in the official backports repository.

Monday, March 19, 2007

Apparmor packages availiable

As I wrote yesterday I am packaging AppArmor for Ubuntu. When I got home from work today I continued my packaging.

I have fixed so the kernel modules are loading at boot. Kees was kind to provide me a module-assistant enabled package for the kernel modules. That saved med a lot of work and time, since I never had packaged kernel modules before. Further, I added some dependencies, did some testing and packaged the documentation. You can find the packages here. They are built for Ubuntu Feisty.

Normally when building packages from a project you take one tar.gz-file and build one or several packages. With AppArmor it is a bit different. The project provides snapshots of the Subversion tree in several tar.gz-files. As a beginning I build one package from each of the provided tar.gz-files. Later, I hope AppArmor starts to do regular normal releases. I will then revamp the packages to build all packages from one tar.gz-file.

Sunday, March 18, 2007

AppArmor for Ubuntu

Last summer I did an effort to build packages of AppArmor (project page) to Ubuntu. Unfortunately, I needed at that time patch and recompile the kernel. That took a lot of work and time. I did not manage to spend all that work to maintain the packages. A few days ago I got a mail from Crispin Cowan that Kees Cook had told him that patching the kernel is not necessary any more.

Yesterday and today I have spent some time to refresh my packages. The last snapshot of AppArmor from October last year did not compile in Feisty. Instead I took the last subversion revision. The status looks not to good for that either, some of the Perl scripts refers to an undefined variable. I hope I will get some help from the AppArmor guys.

Saturday, March 17, 2007

Command not found

Today, I found the command-not-found feature in Ubuntu Feisty. The feature is useful when running commands in bash. If the command you tries to run is not installed you get a suggestion what to install.

$ svn checkout
The program 'svn' is currently not installed. You can install it by typing:
sudo apt-get install subversion
bash: svn: command not found

I like!

The functionality is included as standard in Fesity.

Naked PC saga continues

I wrote about Dell and Linux a few days ago. ZDnet confirms the problem. They called all five top vendors in UK and asked about buy a naked PC. Some of the vendors said that they could, but when ZDnet tried to they failed. Just as I did with Dell.

Up to proof all big suppliers. I want to buy a laptop for my wife. The one of you that let me choose any, not just one, of your models in Sweden without an operating system or with a free Linux pre-installed (preferably Ubuntu) will get the order. Of course it must be cheaper than with Microsoft windows, last time a got €130 in rebate. So you need to be close to that.

Wednesday, March 14, 2007

Dell and Linux

There have been a lot of discussion about Dell and Linux for a while. Both at Dell's Idea Storm, different news and blogs. It had not only been at Linux and Open source news sites, but also in major computer magazines. Dell seems and confess that they are confused about Linux and how to fit in their business model. Mark describes it pretty well in his blog. He also mentions that taking part in Microsofts marketing budget is important money. This is impossible for the suppliers to admit officially, but several suppliers have told me this of the record.

When I bought my new laptop this Christmas, I looked for a specific configuration but also for the possibility to buy one without an OS or with Linux pre installed. Any Linux is better than Windows, even if I replace it with Ubuntu. At a fair here in Sweden early last fall a Dell representative told me that I could buy a laptop without Windows if I called them, but not on the site. When it was time for me to buy my laptop mailed Dell and asked what rebate I would get if I bought a specific computer without Windows. I never got an answer.

Since I got no answer, I bought a MSI S271 from Komplett without Windows. I saved more than 1200 Swedish crowns (€130). Unfortunately, it seams that Komplett had stopped selling the MSI laptops. I hope the market looks better next time I need to buy a laptop.

Suppliers, if you can't decide what distribution to deliver pre installed. At leas deliver computers without an operating system.

Sunday, March 11, 2007

Bazaar Version Control

I have played a bit with bzr a few days. I have earlier planned to setup a subversion server. The plan was to use subversion instead of cvs. But I thought it was complex to set up, a version control system should be easy to set up and use. I have also heard that there have been some problem when upgrading the repository database and I do not want to loose my repository since I also use it as a backup.
Bzr is nice and easy to set up as well as use. It is easy extensible and have good documentation and tutorials. The tutorials makes it easy to start using it.
Since it is a distributed system, the thinking when using it must be a bit different. You will get good help reading bzr for CVS users.

bzr will be my version control system of choice. It is also used a lot in the Ubuntu community.

Saturday, March 10, 2007

Look at Go-open in the sofa

I gave up on my problems with Hauppauge PVR 500MCE. I think the card is broken. Instead I saw a shop selling a KISS PVR 558 for about €200. So I bought one. The box runs Linux and the GPL-parts of the software can be downloaded as source. I can FTP to the box and read and write videos, pictures and audio files. The box support free format such as OGG as well as propitary formats. Through their web service can I program it to record a show where ever I am.

I have now uploaded the go-open TV-shows and can finally look at them from my sofa, without having the laptop in my knee. The campaign and shows was sponsored by Canonical and HP among others.

Saturday, March 3, 2007

TV card problem, but great Feisty

I did a network install yesterday of Ubuntu Feisty Fawn Herd 5 on my meant to be TV-computer. I have earlier struggled with getting a good picture with my Hauppauge PVR 500MCE. A few weeks ago I noted that Feisty will have full support for the TV-card, including firmware.

Today it was time to try it out. It worked out of the box, I did noting extra. Brilliant!! But, a big BUT ... there is still a bad picture. If I amplify the signal, it get worse. If I reduce the signal then it, also, get worse. It looks like there are two problems; noise and not fully correct tuned signal. So on the picture quality view nothing had been better since last time. Does anyone have any ideas? I start to believe that I have a hardware problem, maybe it is time to buy another card.

The new feature within Feisty that suggests what application or decoder you need to show a file works great. This feature will simplify for a lot of users.

By the way, here is a dump of my dmesg output. Everything looks good, from my point of view.
[ 26.060000] ivtv: ==================== START INIT IVTV ====================
[ 26.060000] ivtv: version 0.9.1 (tagged release) loading
[ 26.060000] ivtv: Linux version: 2.6.20-9-generic SMP mod_unload 586
[ 26.060000] ivtv: In case of problems please include the debug info between
[ 26.060000] ivtv: the START INIT IVTV and END INIT IVTV lines, along with
[ 26.060000] ivtv: any module options, when mailing the ivtv-users mailinglist.
[ 26.060000] ivtv0: Autodetected Hauppauge card (cx23416 based)
[ 26.060000] ACPI: PCI Interrupt 0000:02:08.0[A] -> Link [LNKB] -> GSI 12 (level, low) -> IRQ 12
[ 26.060000] ivtv0: Unreasonably low latency timer, setting to 64 (was 32)
[ 26.112000] input: PC Speaker as /class/input/input3
[ 26.216000] irda_init()
[ 26.216000] NET: Registered protocol family 23
[ 26.252000] Floppy drive(s): fd0 is 1.44M
[ 26.272000] FDC 0 is a post-1991 82077
[ 27.592000] ivtv0: loaded v4l-cx2341x-enc.fw firmware (262144 bytes)
[ 27.792000] **WARNING** I2C adapter driver [ivtv i2c driver #0] forgot to specify physical device; fix it!
[ 27.876000] tveeprom 1-0050: Hauppauge model 23559, rev D591, serial# 8104296
[ 27.876000] tveeprom 1-0050: tuner model is Philips FQ1216AME MK4 (idx 91, type 56)
[ 27.876000] tveeprom 1-0050: TV standards PAL(B/G) PAL(I) SECAM(L/L') PAL(D/D1/K) (eeprom 0x74)
[ 27.876000] tveeprom 1-0050: second tuner model is Philips TEA5768HL FM Radio (idx 101, type 62)
[ 27.876000] tveeprom 1-0050: audio processor is CX25843 (idx 37)
[ 27.876000] tveeprom 1-0050: decoder processor is CX25843 (idx 30)
[ 27.876000] tveeprom 1-0050: has radio, has no IR receiver, has no IR transmitter
[ 27.876000] ivtv0: Autodetected WinTV PVR 500 (unit #1)
[ 27.920000] tuner 1-0043: chip found @ 0x86 (ivtv i2c driver #0)
[ 27.920000] tda9887 1-0043: tda988[5/6/7] found @ 0x43 (tuner)
[ 27.928000] tuner 1-0060: TEA5767 detected.
[ 27.928000] tuner 1-0060: chip found @ 0xc0 (ivtv i2c driver #0)
[ 27.928000] tuner 1-0060: type set to 62 (Philips TEA5767HN FM Radio)
[ 27.928000] tuner 1-0061: chip found @ 0xc2 (ivtv i2c driver #0)
[ 27.988000] cx25840 1-0044: cx25843-23 found @ 0x88 (ivtv i2c driver #0)
[ 33.104000] cx25840 1-0044: loaded v4l-cx25840.fw firmware (16382 bytes)
[ 33.264000] wm8775 1-001b: chip found @ 0x36 (ivtv i2c driver #0)
[ 33.352000] ivtv0: Encoder revision: 0x02050032
[ 33.352000] ivtv0: Registered device video0 for encoder MPEG
[ 33.352000] ivtv0: Registered device video32 for encoder YUV
[ 33.352000] ivtv0: Registered device vbi0 for encoder VBI
[ 33.352000] ivtv0: Registered device video24 for encoder PCM audio
[ 33.356000] ivtv0: Registered device radio0 for encoder radio
[ 33.356000] tuner 1-0061: type set to 56 (Philips PAL/SECAM multi (FQ1216AME MK4))
[ 33.744000] ivtv0: Initialized WinTV PVR 500 (unit #1), card #0
[ 33.744000] ivtv: ====================== NEXT CARD ======================
[ 33.744000] ivtv1: Autodetected Hauppauge card (cx23416 based)
[ 33.744000] ACPI: PCI Interrupt 0000:02:09.0[A] -> Link [LNKC] -> GSI 10 (level, low) -> IRQ 10
[ 33.744000] ivtv1: Unreasonably low latency timer, setting to 64 (was 32)
[ 34.424000] ivtv1: loaded v4l-cx2341x-enc.fw firmware (262144 bytes)
[ 34.624000] **WARNING** I2C adapter driver [ivtv i2c driver #1] forgot to specify physical device; fix it!
[ 34.632000] tuner 2-0043: chip found @ 0x86 (ivtv i2c driver #1)
[ 34.632000] tda9887 2-0043: tda988[5/6/7] found @ 0x43 (tuner)
[ 34.636000] tuner 2-0061: chip found @ 0xc2 (ivtv i2c driver #1)
[ 34.664000] cx25840 2-0044: cx25843-23 found @ 0x88 (ivtv i2c driver #1)
[ 39.764000] cx25840 2-0044: loaded v4l-cx25840.fw firmware (16382 bytes)
[ 39.876000] wm8775 2-001b: chip found @ 0x36 (ivtv i2c driver #1)
[ 39.980000] tveeprom 2-0050: Hauppauge model 23559, rev D591, serial# 8104296
[ 39.980000] tveeprom 2-0050: tuner model is Philips FQ1216AME MK4 (idx 91, type 56)
[ 39.980000] tveeprom 2-0050: TV standards PAL(B/G) PAL(I) SECAM(L/L') PAL(D/D1/K) (eeprom 0x74)
[ 39.980000] tveeprom 2-0050: second tuner model is Philips TEA5768HL FM Radio (idx 101, type 62)
[ 39.980000] tveeprom 2-0050: audio processor is CX25843 (idx 37)
[ 39.980000] tveeprom 2-0050: decoder processor is CX25843 (idx 30)
[ 39.980000] tveeprom 2-0050: has radio, has no IR receiver, has no IR transmitter
[ 39.980000] ivtv1: Correcting tveeprom data: no radio present on second unit
[ 39.980000] ivtv1: Autodetected WinTV PVR 500 (unit #2)
[ 40.128000] ivtv1: Encoder revision: 0x02050032
[ 40.128000] ivtv1: Registered device video1 for encoder MPEG
[ 40.128000] ivtv1: Registered device video33 for encoder YUV
[ 40.128000] ivtv1: Registered device vbi1 for encoder VBI
[ 40.128000] ivtv1: Registered device video25 for encoder PCM audio
[ 40.132000] tuner 2-0061: type set to 56 (Philips PAL/SECAM multi (FQ1216AME MK4))
[ 40.516000] ivtv1: Initialized WinTV PVR 500 (unit #2), card #1
[ 40.520000] ACPI: PCI Interrupt 0000:00:11.5[C] -> Link [LNKC] -> GSI 10 (level, low) -> IRQ 10
[ 40.520000] PCI: Setting latency timer of device 0000:00:11.5 to 64
[ 40.524000] ivtv: ==================== END INIT IVTV ====================

Friday, March 2, 2007

Feisty Herd 5 is out

Ubuntu Feisty Fawn Herd 5 is out. I have not seen any official announcement yet, but I am downloading it.

I have also installed Feisty on my laboration computer today. It looks very nice and I have not noticed any major glitches.