Package: yaird
Version: 0.0.12-24
Severity: serious

Hi,

there is no official patch for problems with kernels >=2.6.23 (yaird
error: unrecognised device: /sys/devices/.../input). I try to fix it and
I was able to boot with generated initrd on the first time. :-)

Patch is attached. Patch contains also fix for problem observed with my
cryptsetup. Encrypted device with keyfile is ignored, if device is not
a root filesystem (yaird-0.0.12/perl/Plan.pm part of patch).

My HW is laptop IBM Lenovo ThinkPad Z61m with rootfs encrypted by LUKS,
LVM partitions encrypted by keyfile, XFS filesystem and runit
(replacement for SysV init).

Please include my patch, because there is a lot of people waiting for
it.

Thanks, best regards

rajo

-- 
  ,''`.  Lubomir Host 'rajo' <rajo AT platon.sk>    ICQ #:  257322664
 : :' :  Jabber: rajo AT jabber.platon.sk      VoIP: callto://rajo207
 `. `'   WWW: http://rajo.platon.sk/  Platon Group: http://platon.sk/
   `-    GnuPG key: DC0C C7EA 55C8 B089 C41D 944A F251 A93A 2361 A82F
diff -Naurp --exclude=Makefile --exclude='.*.sw?' yaird-0.0.12.orig/perl/IdeDev.pm yaird-0.0.12/perl/IdeDev.pm
--- yaird-0.0.12.orig/perl/IdeDev.pm	2005-12-08 23:42:33.000000000 +0100
+++ yaird-0.0.12/perl/IdeDev.pm	2008-01-15 00:58:13.989823441 +0100
@@ -49,7 +49,9 @@ sub fill {
 	$self->SUPER::fill();
 	$self->takeArgs ('path');
 	my $path = $self->path;
-	my $link = readlink ("$path/block");
+	# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=443821
+	# SysFs entries had changed with 2.6.23
+	my $link = readlink ("$path/block") || readlink([ glob("$path/block:*") ]->[0]);
 	if (! defined ($link)) {
 		Base::fatal ("no link to block device in $path");
 	}
diff -Naurp --exclude=Makefile --exclude='.*.sw?' yaird-0.0.12.orig/perl/Input.pm yaird-0.0.12/perl/Input.pm
--- yaird-0.0.12.orig/perl/Input.pm	2005-12-08 23:42:33.000000000 +0100
+++ yaird-0.0.12/perl/Input.pm	2008-01-15 04:03:32.089499793 +0100
@@ -57,7 +57,9 @@ sub fill {
 		if (defined ($hw)) {
 			unless ($hw =~ s!^(\.\./)+devices/!!) {
 				# imagine localised linux (/sys/geraete ...)
-				Base::fatal ("bad device link in $devLink");
+				# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=443821
+				#Base::fatal ("bad device link in $devLink");
+				Base::warning ("bad device link in $devLink");
 			}
 			$self->{hw} = $hw;
 		}
diff -Naurp --exclude=Makefile --exclude='.*.sw?' yaird-0.0.12.orig/perl/InputTab.pm yaird-0.0.12/perl/InputTab.pm
--- yaird-0.0.12.orig/perl/InputTab.pm	2005-12-08 23:42:33.000000000 +0100
+++ yaird-0.0.12/perl/InputTab.pm	2008-01-15 04:03:36.508189068 +0100
@@ -70,6 +70,10 @@ sub init () {
 			# Do not keep track of this.
 			# $work->{sysfs} = $1;
 		}
+		# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=443821
+		elsif ($line =~ /^U: Uniq=(.*)$/) {
+			# kernel >2.6.23 new atributes in /proc/bus/input/devices, just ignore
+		}
 		elsif ($line =~ /^B: ([A-Z]+)=(.*)$/) {
 			$work->{capabilities}{$1} = $2;
 		}
diff -Naurp --exclude=Makefile --exclude='.*.sw?' yaird-0.0.12.orig/perl/KConfig.pm yaird-0.0.12/perl/KConfig.pm
--- yaird-0.0.12.orig/perl/KConfig.pm	2005-12-08 23:42:33.000000000 +0100
+++ yaird-0.0.12/perl/KConfig.pm	2008-01-15 02:29:03.968004316 +0100
@@ -65,8 +65,9 @@ sub init () {
 		if ($value eq 'y'
 			|| $value eq 'm'
 			|| $value =~ /^-?\d+$/
-			|| $value =~ /^0x[0-9a-f]+$/
-			|| $value =~ /^"[-a-zA-Z0-9@,.:_\/= ]*"$/
+			# fix: yaird error: bad value in /boot/config-2.6.23-1-686: CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" (fatal)
+			|| $value =~ /^0x[[:xdigit:]]+$/
+			|| $value =~ /^"[EMAIL PROTECTED],.:_\/= ]*"$/
 		) {
 			$kConfMap->{$key} = $value;
 		}
diff -Naurp --exclude=Makefile --exclude='.*.sw?' yaird-0.0.12.orig/perl/Plan.pm yaird-0.0.12/perl/Plan.pm
--- yaird-0.0.12.orig/perl/Plan.pm	2005-12-08 23:42:33.000000000 +0100
+++ yaird-0.0.12/perl/Plan.pm	2008-01-15 01:31:13.737830064 +0100
@@ -162,10 +162,20 @@ sub tryDmCrypt ($$$) {
 
 	# Check consistency of configuration
 
-	if ($cryptEntry->keyFile) {
+	my $root = FsTab::findByMountPoint('/');
+	if (! defined ($root) or ! defined($root->dev)) {
+		fatal ("requested root device not in fstab");
+	}
+
+	# encrypted root filesystem with key is not supported
+	if ($cryptEntry->keyFile and $cryptEntry->origin eq $root->dev) {
 		my $origin = $cryptEntry->origin;
 		Base::fatal ("encrypted device '$target' has keyfile specified in $origin.  This is not supported.");
 	}
+	# ignore encrypted fs with kyefiles specified in /etc/crypttab
+	elsif ($cryptEntry->keyFile) {
+		return 1;
+	}
 
 	if ($cryptEntry->opts->exists('swap')) {
 		# not thought about what this needs yet.

Reply via email to