[Yaird-devel] Bug#356087: yaird: Proposed fix for this bug

Tuomas Jormola tjormola at cc.hut.fi
Sun Mar 12 17:19:44 UTC 2006


Package: yaird
Version: 0.0.12-7
Followup-For: Bug #356087


Here's my take on fixing this bug and #354247. Works for me. Comments
regarding the patch in the attachment.

Tuomas Jormola <tjormola at cc.hut.fi>

-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.15
Locale: LANG=C, LC_CTYPE=fi_FI at euro (charmap=ISO-8859-15)

Versions of packages yaird depends on:
ii  cpio                       2.5-1.3       GNU cpio -- a program to manage ar
ii  dash                       0.5.2-5       The Debian Almquist Shell
ii  libc6                      2.3.2.ds1-22  GNU C Library: Shared libraries an
ii  libhtml-template-perl      2.6-2         HTML::Template : A module for usin
ii  libparse-recdescent-perl   1.94-4        Generates recursive-descent parser
ii  perl                       5.8.4-8sarge3 Larry Wall's Practical Extraction 

-- no debconf information
-------------- next part --------------
--- yaird-0.0.12/debian/patches/1004_fix_ide_block_device_detection.patch	1970-01-01 02:00:00.000000000 +0200
+++ yaird-0.0.12/debian/patches/1004_fix_ide_block_device_detection.patch	2006-03-12 19:09:38.000000000 +0200
@@ -0,0 +1,25 @@
+The name of a symlink to a block device under /sys/devices/.../ideX/X.X/
+varies between various 2.6 kernels. Earlier versions use name "block" while
+later (circa 2.6.16-rc1) use "block:hdX" format. This patch adds support for
+both formats by first globbing "block*" in the directory and thus resolving the
+real name of the symlink instead of using hard-coded name that only works in
+the former case.
+
+Index: yaird/perl/IdeDev.pm
+===================================================================
+--- yaird.orig/perl/IdeDev.pm	2006-01-26 00:15:49.000000000 +0200
++++ yaird/perl/IdeDev.pm	2006-03-12 18:48:12.000000000 +0200
+@@ -49,7 +49,12 @@
+ 	$self->SUPER::fill();
+ 	$self->takeArgs ('path');
+ 	my $path = $self->path;
+-	my $link = readlink ("$path/block");
++	my $block = "$path/block";
++	my @link = <$block*>;
++	if (scalar @link != 1) {
++		Base::fatal ("no suitable candidate link to block device found in $path");
++	}
++	my $link = readlink (shift @link);
+ 	if (! defined ($link)) {
+ 		Base::fatal ("no link to block device in $path");
+ 	}
--- yaird-0.0.12/debian/patches/series	2006-03-12 18:04:17.000000000 +0200
+++ yaird-0.0.12/debian/patches/series	2006-03-12 19:09:38.000000000 +0200
@@ -2,3 +2,4 @@
 1001_ignore_parisc_sysfs_subdir.patch
 1002_use_xdigit_in_regexes.patch
 1003_drop_ide-generic_workaround.patch
+1004_fix_ide_block_device_detection.patch


More information about the Yaird-devel mailing list