Craig Box's journeys, stories and notes...


Archive for July, 2006

Using udev to set network card order

Friday, July 14th, 2006

Don't you hate it when you update a Linux machine, and the order that the network cards are detected, changes?

Code:

ifconfig | grep HWaddr | awk ' { printf"KERNEL==\"eth*\",SYSFS{address}==\"%s\", NAME=\"%s\"\n", $5, $1; }' > /etc/udev/rules.d/10-network-cards.rules

The cables don't change around, so neither should the order in which they come up.

lvm2 pre-installation script returned exit status 10

Friday, July 7th, 2006

Tracking down bugs in Debian and Ubuntu packages is fun for the whole family. Found this one while upgrading from Hoary to Dapper on a test box:

root@unassigned-firewall:~ # apt-get install lvm2..
Preparing to replace lvm2 2.00.32-1 (using .../lvm2_2.02.02-1ubuntu1_i386.deb) ...
dpkg: error processing /cdrom//pool/main/l/lvm2/lvm2_2.02.02-1ubuntu1_i386.deb (--unpack): subprocess pre-installation script returned error exit status 10
Errors were encountered while processing:
/cdrom//pool/main/l/lvm2/lvm2_2.02.02-1ubuntu1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Straight to Google. Nothing for this package, but some other packages with a similar error are reported. Eventually, I find a similar example, and work through the steps:

root@unassigned-firewall:~ # export DEBCONF_DEBUG=developer
root@unassigned-firewall:~ # apt-get install lvm2
..
Preparing to replace lvm2 2.00.32-1 (using .../lvm2_2.02.02-1ubuntu1_i386.deb) ...
debconf (developer): frontend started
debconf (developer): frontend running, package name is lvm2
debconf (developer): starting /var/lib/dpkg/tmp.ci/preinst upgrade 2.00.32-1
debconf (developer): <-- VERSION 2.0
debconf (developer): --> 0 2.0
debconf (developer): <-- CAPB backup
debconf (developer): --> 0 multiselect escape backup
debconf (developer): <-- TITLE LVM2
debconf (developer): --> 0
debconf (developer): <-- FSET lvm2/kernel seen false
debconf (developer): --> 10 lvm2/kernel doesn't exist
dpkg: error processing /cdrom//pool/main/l/lvm2/lvm2_2.02.02-1ubuntu1_i386.deb (--unpack):
subprocess pre-installation script returned error exit status 10
debconf (developer): frontend started
debconf (developer): frontend running, package name is lvm2
debconf (developer): starting /var/lib/dpkg/info/lvm2.postinst abort-upgrade 2.02.02-1ubuntu1
Errors were encountered while processing:
/cdrom//pool/main/l/lvm2/lvm2_2.02.02-1ubuntu1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Aha! Eventually, the problem presents itself, in the postinst - but of the new package, not the one that is in /var/lib/dpkg/info:

if ! dpkg --compare-versions $(uname -r) ge '2.6.12'; then
db_fset lvm2/kernel seen false
db_input critical lvm2/kernel || true
db_go
exit 1
fi

Which neatly matches this Debian bug. I built me a package without this block (you're going to be running a new kernel when the upgrade that includes this package is done - the new version wouldn't cleanly backport), and the upgrade continued.

The moral of this story is I should have gone to Launchpad first, as the bug is recorded there. Google just didn't see it.

Craig's Way

Thursday, July 6th, 2006

Open letters seem to be all the rage these days. How about we just go with "Craig, as benevolent dictator, says How It Is":

Microsoft are hereby instructed to publish Open Office XML as a royalty and patent free open standard. Everyone else is hereby instructed to change to use it (they can call it OpenDocument 2.0 if required), and then people won't have to care about OpenOffice.org if they don't want, because the standard is standard.

Microsoft will then be forced to operate exactly to the published standard, publishing changes under the same license and arrangement if they wish to extend the standard (well before the release of their product), and maintaining backwards compatibility.

There, everyone wins. Why does it always take me deciding how it has to be, to get results like this?

Vote Quimby.

IE7 and WGA

Monday, July 3rd, 2006

Such beautiful praise from Paul Thurrott:

Internet Explorer 7.0 Beta 3 is a solid, feature-packed browser that all IE users should flock to immediately. While it's not enough to make me switch from Firefox yet--I still love certain Firefox features such as inline search--it's no longer an object of ridicule either.

What I do dislike, however:

validate.jpg

Is this happening with everything? Will WGA ever stop? (Well, yes, in that case. But you know they want to do it.)

The copy of Windows XP I'm using is the one that came preloaded with my laptop, but we deal a lot also in volume license versions for our customers (more Office than Windows, as there's little point in buying Windows twice, and we can't exactly buy PCs without it now, can we?) I don't appreciate being made to feel like a criminal every time I want to do anything.