diff -ruN yaird-0.0.12/ChangeLog yaird/ChangeLog
--- yaird-0.0.12/ChangeLog	2005-12-08 23:42:32.000000000 +0100
+++ yaird/ChangeLog	2005-12-25 06:52:28.000000000 +0100
@@ -2,6 +2,155 @@
 # arch-tag: automatic-ChangeLog--ekonijn@xs4all.nl--debian/yaird--devo--0.1
 #
 
+2005-12-13 21:29:59 GMT	Erik van Konijnenburg <ekonijn@xs4all.nl>	patch-133
+
+    Summary:
+      amd74xx suffers from ide-generic
+    Revision:
+      yaird--devo--0.1--patch-133
+
+    	And for amd74xx same ide-generic problem reported earlier.
+    
+    	Should we always demand ide-generic?  No, because there are
+    	machines that have proper driver which does not need ide-generic,
+    	so ide-generic need not be part of the driver.
+    	Making ide-generic optional (as it was in earlier versions) is also
+    	far from ideal, since that would end up with silently non-booting
+    	kernels on piix machine without ide-generic in the kernel.
+    
+    	For this reason the ugly enumeration as a fix.
+
+    modified files:
+     ChangeLog perl/Hardware.pm
+
+
+2005-12-12 22:22:51 GMT	Erik van Konijnenburg <ekonijn@xs4all.nl>	patch-132
+
+    Summary:
+      add todo entry
+    Revision:
+      yaird--devo--0.1--patch-132
+
+    add todo entry
+    
+
+    modified files:
+     ChangeLog TODO
+
+
+2005-12-12 21:36:55 GMT	Erik van Konijnenburg <ekonijn@xs4all.nl>	patch-131
+
+    Summary:
+      ide-generic for piix
+    Revision:
+      yaird--devo--0.1--patch-131
+
+    	Hmm, complaints about piix not booting start when ide-generic
+    	workaround is limited to via82cxxx only.
+    	As an experiment, do ide-generic for piix as well.
+    
+    	Cf Debian bugs #343042, #343048.
+
+    modified files:
+     ChangeLog perl/Hardware.pm
+
+
+2005-12-11 19:43:38 GMT	Erik van Konijnenburg <ekonijn@xs4all.nl>	patch-130
+
+    Summary:
+      know about compiled in sun modules
+    Revision:
+      yaird--devo--0.1--patch-130
+
+    	sermouse and sunkbd may be compiled in rather than modular.
+
+    modified files:
+     ChangeLog perl/KConfig.pm
+
+
+2005-12-11 18:52:16 GMT	Erik van Konijnenburg <ekonijn@xs4all.nl>	patch-129
+
+    Summary:
+      support sunkbd somewhat
+    Revision:
+      yaird--devo--0.1--patch-129
+
+    	note some sparcs under some kernels have serio as well:
+    	$ cd /sys/devices
+    	$ readlink /sys/devices/serio0/driver
+    	../../bus/serio/drivers/sermouse
+    	$ readlink /sys/devices/serio1/driver
+    	../../bus/serio/drivers/sunkbd
+    	$
+    
+    	Still need to build proper modalias support;
+    	the tricky bit there is how to recognise 
+    	modules that need eg the ehci/ohci or via82cxxx/ide-generic hack.
+
+    modified files:
+     ChangeLog perl/Hardware.pm
+
+
+2005-12-11 17:14:48 GMT	Erik van Konijnenburg <ekonijn@xs4all.nl>	patch-128
+
+    Summary:
+      USB storage now tested; adapt docs accordingly
+    Revision:
+      yaird--devo--0.1--patch-128
+
+    USB storage now tested; adapt docs accordingly
+    
+
+    modified files:
+     ChangeLog doc/spec.xml man/yaird.8
+
+
+2005-12-11 17:06:03 GMT	Erik van Konijnenburg <ekonijn@xs4all.nl>	patch-127
+
+    Summary:
+      no output on error
+    Revision:
+      yaird--devo--0.1--patch-127
+
+    	Bugfix: yaird is supposed to not produce output if an error
+    	is detected, but it appeared that output was only suppressed
+    	if the error is immediately fatal (which most are).
+
+    modified files:
+     ChangeLog perl/Base.pm perl/Pack.pm
+
+
+2005-12-10 10:00:09 GMT	Erik van Konijnenburg <ekonijn@xs4all.nl>	patch-126
+
+    Summary:
+      support crypto_aes_586
+    Revision:
+      yaird--devo--0.1--patch-126
+
+    	KConfig keeps an overview of modules that may be compiled
+    	into the kernel.
+    	This is complicated by the fact that modules may be aliases
+    	for each other.  Point in case: aes.  There is both CRYPTO_AES,
+    	CRYPTO_AES_586 and CRYPTO_AES_X86_64.  All are three-state, the
+    	first is generic, and module aes_i586 contains a line MODULE_ALIAS
+    	("aes") that makes modprobe decide that aes_i586 is just as good
+    	as aes.  Thus for the code that loads an encryption algorithm
+    	just before cryptsetup, the difference between aes and aes_i865
+    	is transparant.  However, the code in yaird that decides aes is
+    	built into the kernel so no modprobe is required to understand
+    	that CRYPTO_AES_586 is equivalent to CRYPTO_AES.
+    
+    	Extended isBuiltIn to recognise that a module is built in
+    	if any of the possible variants is built in; dropped the
+    	isOmmited() function, since its broken by this change and
+    	no longer needed by the rest of the code.
+    
+    	This should solve Debian Bug#342652.
+
+    modified files:
+     ChangeLog perl/KConfig.pm
+
+
 2005-12-08 22:37:24 GMT	Erik van Konijnenburg <ekonijn@xs4all.nl>	patch-125
 
     Summary:
diff -ruN yaird-0.0.12/doc/spec.xml yaird/doc/spec.xml
--- yaird-0.0.12/doc/spec.xml	2005-12-08 23:42:32.000000000 +0100
+++ yaird/doc/spec.xml	2005-12-25 06:52:26.000000000 +0100
@@ -207,7 +207,7 @@
 
       <listitem>
 	<para>
-	  Understands SATA, IDE, DASD devices.
+	  Understands SATA, IDE, DASD and USB storage devices.
 	</para>
       </listitem>
 
@@ -301,13 +301,6 @@
 
       <listitem>
 	<para>
-	  Understands USB storage, no special provisions
-	  are needed for code generation, but it's not tested yet.
-	</para>
-      </listitem>
-
-      <listitem>
-	<para>
 	  Swsusp is not supported yet.
 	</para>
       </listitem>
diff -ruN yaird-0.0.12/exec/nfsmount/README.locking yaird/exec/nfsmount/README.locking
--- yaird-0.0.12/exec/nfsmount/README.locking	1970-01-01 01:00:00.000000000 +0100
+++ yaird/exec/nfsmount/README.locking	2005-12-25 06:52:05.000000000 +0100
@@ -0,0 +1,27 @@
+I have implemented portmap spoofing in klibc nfsmount (released as
+klibc-0.144) This is basically a vestigial portmap daemon which gets
+launched before the mount() call and then just records any
+transactions it gets to a file and sends back an affirmative reply.
+
+There are two ways to use it (this belongs in a README file, but it's
+too late at night right now):
+
+a) Set a fixed portnumber in /proc/sys/nfs/nlm_tcpport and
+/proc/sys/nfs/nlm_udpport before calling nfsmount; once the portmapper
+starts feed that fixed portnumber to pmap_set(8).  In this case the
+pmap_file can be /dev/null.
+
+b) Allow the kernel to bind to any port and use the file produced by
+nfsroot to feed to pmap_set (it should be directly compatible); this
+means the file needs to be transferred to a place where the "real
+root" can find it before run-init.
+
+In either case, it is imperative that the real portmapper is launched
+before any program actually tries to create locks!
+
+To use it:
+
+	# We need the loopback device to be up before we do this!
+	ipconfig 127.0.0.1:::::lo:none
+	nfsroot -p pmap_file -o lock server:/pathname /realpath
+
diff -ruN yaird-0.0.12/man/yaird.8 yaird/man/yaird.8
--- yaird-0.0.12/man/yaird.8	2005-12-08 23:42:33.000000000 +0100
+++ yaird/man/yaird.8	2005-12-25 06:52:26.000000000 +0100
@@ -40,11 +40,9 @@
 these actions are handled by the boot image; this separation makes it
 relatively simple to customise the generated images.
 .P
-The following configurations are supported: SATA, SCSI, IDE, DASD, LVM2, mdadm,
+The following configurations are supported: SATA, SCSI, IDE, USB storage, DASD, LVM2, mdadm,
 cryptsetup, cryptsetup-luks, USB keyboards, NFS root, EVMS.
 .P
-The following are untested: USB storage.
-.P
 Not yet supported: swsusp, firewire, loopback, loopaes, dmraid.
 .\"
 .SH OPTIONS
diff -ruN yaird-0.0.12/perl/Base.pm yaird/perl/Base.pm
--- yaird-0.0.12/perl/Base.pm	2005-12-08 23:42:33.000000000 +0100
+++ yaird/perl/Base.pm	2005-12-25 06:52:26.000000000 +0100
@@ -28,6 +28,7 @@
 # error -- not good, processing continues, exit status non-zero,
 # 		program should not make changes to environment
 # 		such as writing output files.
+# getExitCode -- seen an error so far?
 # fatal -- not good, exit immediately with non-zero status.
 # bug -- fatal error in the program, not environment.
 # assert -- if condition not met, it's a bug.
@@ -59,6 +60,9 @@
 
 
 my $exitCode = 0;
+sub getExitCode () {
+	return $exitCode;
+}
 
 
 sub debug ($) {
diff -ruN yaird-0.0.12/perl/Hardware.pm yaird/perl/Hardware.pm
--- yaird-0.0.12/perl/Hardware.pm	2005-12-08 23:42:33.000000000 +0100
+++ yaird/perl/Hardware.pm	2005-12-25 06:52:28.000000000 +0100
@@ -182,12 +182,30 @@
 			# they offer.
 			# Serio is loaded implicitly via modprobe dependency.
 			#
+			# But note some sparcs under some kernels have serio as well:
+			# cd /sys/devices
+			# $ readlink /sys/devices/serio0/driver
+			# ../../bus/serio/drivers/sermouse
+			# $ readlink /sys/devices/serio1/driver
+			# ../../bus/serio/drivers/sunkbd
+			#
+			#
 			if (-f "$abspath/softrepeat") {
 				$modules = [ "atkbd" ];
 			}
 			elsif (-f "$abspath/resolution") {
 				$modules = [ "psmouse" ];
 			}
+			elsif ( -l "$abspath/driver" ) {
+				# not all kernels have the driver symlink,
+				# and anyway assuming host kernel and target kernel
+				# will have the same driver names is dubious.
+				# This will need to be replaced by modalias support.
+				my $driver = Base::basename (
+					Base::expandLink ("$abspath/driver"));
+				Base::warning ("unrecognised legacy device: $abspath; trying $driver");
+				$modules = [ $driver ];
+			}
 			else {
 				Base::error ("unrecognised legacy device: $abspath");
 			}
@@ -216,7 +234,19 @@
 	# The above error persists in 2.6.12, and is solved
 	# in 2.6.14.
 	#
+	# Similar error seems to exist in 2.6.14 for piix.
+	# And for amd74xx.
+	#
+	# Should we always demand ide-generic?  No, because there are
+	# machines that have proper driver which does not need ide-generic,
+	# so ide-generic need not be part of the driver.
+	# Making ide-generic optional (as it was in earlier versions) is also
+	# far from ideal, since that would end up with silently non-booting
+	# kernels on piix machine without ide-generic in the kernel.
+	#
 	$result = [ map { $_ eq "via82cxxx" ?  ($_, "ide-generic") : $_ } @{$result} ];
+	$result = [ map { $_ eq "piix" ?  ($_, "ide-generic") : $_ } @{$result} ];
+	$result = [ map { $_ eq "amd74xx" ?  ($_, "ide-generic") : $_ } @{$result} ];
 
 	return $result;
 }
diff -ruN yaird-0.0.12/perl/KConfig.pm yaird/perl/KConfig.pm
--- yaird-0.0.12/perl/KConfig.pm	2005-12-08 23:42:33.000000000 +0100
+++ yaird/perl/KConfig.pm	2005-12-25 06:52:27.000000000 +0100
@@ -30,6 +30,16 @@
 # but it does help with filesystems, where an 'ext3' line in /etc/fstab
 # means the ext3 module needs to be loaded unless its compiled in.
 #
+# All this is complicated by the fact that modules may be aliases for each
+# other.  Point in case: aes.  There is both CRYPTO_AES, CRYPTO_AES_586
+# and CRYPTO_AES_X86_64.  All are three-state, the first is generic,
+# and module aes_i586 contains a line MODULE_ALIAS ("aes") that makes modprobe
+# decide that aes_i586 is just as good as aes.  Thus for the code that loads
+# an encryption algorithm just before cryptsetup, the difference between
+# aes and aes_i865 is transparant.  However, the code in yaird that decides
+# aes is built into the kernel so no modprobe is required to understand
+# that CRYPTO_AES_586 is equivalent to CRYPTO_AES.
+#
 
 use strict;
 use warnings;
@@ -88,114 +98,116 @@
 #
 my $moduleMap = {
 	# user interface devices
-	fbcon => 'FRAMEBUFFER_CONSOLE',
-	vesafb => 'FB_VESA',
-	serio => 'SERIO',
-	i8042 => 'SERIO_I8042',
-	usbhid => 'USB_HID',
-	atkbd => 'KEYBOARD_ATKBD',
-	mousedev => 'INPUT_MOUSEDEV',
-	evdev => 'INPUT_EVDEV',
-	psmouse => 'MOUSE_PS2',
+	fbcon => [ 'FRAMEBUFFER_CONSOLE' ],
+	vesafb => [ 'FB_VESA' ],
+	serio => [ 'SERIO' ],
+	i8042 => [ 'SERIO_I8042' ],
+	usbhid => [ 'USB_HID' ],
+	atkbd => [ 'KEYBOARD_ATKBD' ],
+	sunkbd => [ 'KEYBOARD_SUNKBD' ],
+	mousedev => [ 'INPUT_MOUSEDEV' ],
+	evdev => [ 'INPUT_EVDEV' ],
+	psmouse => [ 'MOUSE_PS2' ],
+	sermouse => [ 'MOUSE_SERIAL' ],
 
 	# file systems
-	ext2 => 'EXT2_FS',
-	ext3 => 'EXT3_FS',
-	jbd => 'JBD',
-	reiserfs => 'REISERFS_FS',
-	jfs => 'JFS_FS',
-	xfs => 'XFS_FS',
-	minix => 'MINIX_FS',
-	romfs => 'ROMFS_FS',
-	isofs => 'ISO9660_FS',
-	udf => 'UDF_FS',
-	fat => 'FAT_FS',
-	msdos => 'MSDOS_FS',
-	vfat => 'VFAT_FS',
-	# broken, and nonmodular: umsdos => 'UMSDOS_FS',
-	ntfs => 'NTFS_FS',
-	adfs => 'ADFS_FS',
-	affs => 'AFFS_FS',
-	hfs => 'HFS_FS',
-	hfsplus => 'HFSPLUS_FS',
-	befs => 'BEFS_FS',
-	bfs => 'BFS_FS',
-	efs => 'EFS_FS',
-	jffs => 'JFFS_FS',
-	jffs2 => 'JFFS2_FS',
-	cramfs => 'CRAMFS',
-	freevxfs => 'VXFS_FS',
-	hpfs => 'HPFS_FS',
-	qnx4 => 'QNX4FS_FS',
-	sysv => 'SYSV_FS',
-	ufs => 'UFS_FS',
-	nfs => 'NFS_FS',
-	smbfs => 'SMB_FS',
-	cifs => 'CIFS',
-	ncpfs => 'NCP_FS',
-	coda => 'CODA_FS',
-	kafs => 'AFS_FS',
+	ext2 => [ 'EXT2_FS' ],
+	ext3 => [ 'EXT3_FS' ],
+	jbd => [ 'JBD' ],
+	reiserfs => [ 'REISERFS_FS' ],
+	jfs => [ 'JFS_FS' ],
+	xfs => [ 'XFS_FS' ],
+	minix => [ 'MINIX_FS' ],
+	romfs => [ 'ROMFS_FS' ],
+	isofs => [ 'ISO9660_FS' ],
+	udf => [ 'UDF_FS' ],
+	fat => [ 'FAT_FS' ],
+	msdos => [ 'MSDOS_FS' ],
+	vfat => [ 'VFAT_FS' ],
+	# broken, and nonmodular: umsdos => [ 'UMSDOS_FS' ],
+	ntfs => [ 'NTFS_FS' ],
+	adfs => [ 'ADFS_FS' ],
+	affs => [ 'AFFS_FS' ],
+	hfs => [ 'HFS_FS' ],
+	hfsplus => [ 'HFSPLUS_FS' ],
+	befs => [ 'BEFS_FS' ],
+	bfs => [ 'BFS_FS' ],
+	efs => [ 'EFS_FS' ],
+	jffs => [ 'JFFS_FS' ],
+	jffs2 => [ 'JFFS2_FS' ],
+	cramfs => [ 'CRAMFS' ],
+	freevxfs => [ 'VXFS_FS' ],
+	hpfs => [ 'HPFS_FS' ],
+	qnx4 => [ 'QNX4FS_FS' ],
+	sysv => [ 'SYSV_FS' ],
+	ufs => [ 'UFS_FS' ],
+	nfs => [ 'NFS_FS' ],
+	smbfs => [ 'SMB_FS' ],
+	cifs => [ 'CIFS' ],
+	ncpfs => [ 'NCP_FS' ],
+	coda => [ 'CODA_FS' ],
+	kafs => [ 'AFS_FS' ],
 
 	# network
-	'af-packet' => 'PACKET',
+	'af-packet' => [ 'PACKET' ],
 
 	# device mapper: raid and lvm.
-	linear => 'MD_LINEAR',
-	raid0 => 'MD_RAID0',
-	raid1 => 'MD_RAID1',
-	raid10 => 'MD_RAID10',
-	raid5 => 'MD_RAID5',
-	raid6 => 'MD_RAID6',
-	multipath => 'MD_MULTIPATH',
-	faulty => 'MD_FAULTY',
-	md => 'BLK_DEV_MD',
-	'dm-mod' => 'BLK_DEV_DM',
-	'dm-crypt' => 'DM_CRYPT',
-	'dm-snapshot' => 'DM_SNAPSHOT',
-	'dm-mirror' => 'DM_MIRROR',
-	'dm-zero' => 'DM_ZERO',
+	linear => [ 'MD_LINEAR' ],
+	raid0 => [ 'MD_RAID0' ],
+	raid1 => [ 'MD_RAID1' ],
+	raid10 => [ 'MD_RAID10' ],
+	raid5 => [ 'MD_RAID5' ],
+	raid6 => [ 'MD_RAID6' ],
+	multipath => [ 'MD_MULTIPATH' ],
+	faulty => [ 'MD_FAULTY' ],
+	md => [ 'BLK_DEV_MD' ],
+	'dm-mod' => [ 'BLK_DEV_DM' ],
+	'dm-crypt' => [ 'DM_CRYPT' ],
+	'dm-snapshot' => [ 'DM_SNAPSHOT' ],
+	'dm-mirror' => [ 'DM_MIRROR' ],
+	'dm-zero' => [ 'DM_ZERO' ],
 
 	# crypto
-	hmac => 'CRYPTO_HMAC',
-	'crypto-null' => 'CRYPTO_NULL',
-	md4 => 'CRYPTO_MD4',
-	md5 => 'CRYPTO_MD5',
-	sha1 => 'CRYPTO_SHA1',
-	sha256 => 'CRYPTO_SHA256',
-	sha512 => 'CRYPTO_SHA512',
-	wp512 => 'CRYPTO_WP512',
-	des => 'CRYPTO_DES',
-	blowfish => 'CRYPTO_BLOWFISH',
-	twofish => 'CRYPTO_TWOFISH',
-	serpent => 'CRYPTO_SERPENT',
-	aes => 'CRYPTO_AES',
-	cast5 => 'CRYPTO_CAST5',
-	cast6 => 'CRYPTO_CAST6',
-	arc4 => 'CRYPTO_ARC4',
-	tea => 'CRYPTO_TEA',
-	khazad => 'CRYPTO_KHAZAD',
-	anubis => 'CRYPTO_ANUBIS',
-	deflate => 'CRYPTO_DEFLATE',
-	'michael-mic' => 'CRYPTO_MICHAEL_MIC',
-	crc32c => 'CRYPTO_CRC32C',
-	tcrypt => 'CRYPTO_TEST',
+	hmac => [ 'CRYPTO_HMAC' ],
+	'crypto-null' => [ 'CRYPTO_NULL' ],
+	md4 => [ 'CRYPTO_MD4' ],
+	md5 => [ 'CRYPTO_MD5' ],
+	sha1 => [ 'CRYPTO_SHA1' ],
+	sha256 => [ 'CRYPTO_SHA256' ],
+	sha512 => [ 'CRYPTO_SHA512' ],
+	wp512 => [ 'CRYPTO_WP512' ],
+	des => [ 'CRYPTO_DES' ],
+	blowfish => [ 'CRYPTO_BLOWFISH' ],
+	twofish => [ 'CRYPTO_TWOFISH' ],
+	serpent => [ 'CRYPTO_SERPENT' ],
+	aes => [ 'CRYPTO_AES', 'CRYPTO_AES_586', 'CRYPTO_AES_X86_64' ],
+	cast5 => [ 'CRYPTO_CAST5' ],
+	cast6 => [ 'CRYPTO_CAST6' ],
+	arc4 => [ 'CRYPTO_ARC4' ],
+	tea => [ 'CRYPTO_TEA' ],
+	khazad => [ 'CRYPTO_KHAZAD' ],
+	anubis => [ 'CRYPTO_ANUBIS' ],
+	deflate => [ 'CRYPTO_DEFLATE' ],
+	'michael-mic' => [ 'CRYPTO_MICHAEL_MIC' ],
+	crc32c => [ 'CRYPTO_CRC32C' ],
+	tcrypt => [ 'CRYPTO_TEST' ],
 
 	# IDE
-	'ide-generic' => 'IDE_GENERIC',
-	'ide-disk' => 'BLK_DEV_IDEDISK',
-	'ide-cd' => 'BLK_DEV_IDECD',
-	'ide-tape' => 'BLK_DEV_IDETAPE',
-	'ide-floppy' => 'BLK_DEV_IDEFLOPPY',
+	'ide-generic' => [ 'IDE_GENERIC' ],
+	'ide-disk' => [ 'BLK_DEV_IDEDISK' ],
+	'ide-cd' => [ 'BLK_DEV_IDECD' ],
+	'ide-tape' => [ 'BLK_DEV_IDETAPE' ],
+	'ide-floppy' => [ 'BLK_DEV_IDEFLOPPY' ],
 
 	# SCSI
-	'sd-mod' => 'BLK_DEV_SD',
-	'st' => 'CHR_DEV_ST',
-	'sr-mod' => 'BLK_DEV_SR',
-	'sg' => 'CHR_DEV_SG',
+	'sd-mod' => [ 'BLK_DEV_SD' ],
+	'st' => [ 'CHR_DEV_ST' ],
+	'sr-mod' => [ 'BLK_DEV_SR' ],
+	'sg' => [ 'CHR_DEV_SG' ],
 
 	# Compaq Smart Array controllers
-	'cpqarray' => 'BLK_CPQ_DA',
-	'cciss' => 'BLK_CPQ_CISS_DA',
+	'cpqarray' => [ 'BLK_CPQ_DA' ],
+	'cciss' => [ 'BLK_CPQ_CISS_DA' ],
 };
 
 
@@ -218,46 +230,30 @@
 
 #
 # isBuiltIn -- true if the module is known to be compiled
-# into the kernel.
+# into the kernel.  Or if something is compiled in that 
+# has the module as an alias.
 #
 sub isBuiltIn ($) {
 	my ($module) = @_;
 	init;
 	$module =~ s!_!-!g;
-	my $confKey = $moduleMap->{$module};
-	if (! defined ($confKey)) {
-		Base::debug ("KConfig::isBuiltIn $module - no");
+	my $confKeys = $moduleMap->{$module};
+	if (! defined ($confKeys)) {
+		Base::debug ("KConfig::isBuiltIn $module - unknown");
 		return 0;
 	}
-	my $confVal = $kConfMap->{"CONFIG_$confKey"};
-	if (! defined ($confVal)) {
-		Base::debug ("KConfig::isBuiltIn $module, $confKey - no");
-		return 0;
+	for my $confKey (@{$confKeys}) {
+		my $confVal = $kConfMap->{"CONFIG_$confKey"};
+		if (defined ($confVal) && $confVal eq 'y') {
+			Base::debug ("KConfig::isBuiltIn $module, $confKey - yes");
+			return 1;
+		}
 	}
 
-	my $result =  ($confVal eq 'y');
-	Base::debug ("KConfig::isBuiltIn $module,$confKey,$confVal - $result");
-	return $result;
+	Base::debug ("KConfig::isBuiltIn $module - no");
+	return 0;
 }
 
-#
-# isOmitted -- true if the module is not part of the kernel:
-# neither compiled in nor module.
-#
-sub isOmitted ($) {
-	my ($module) = @_;
-	init;
-	$module =~ s!_!-!g;
-	my $confKey = $moduleMap->{$module};
-	if (! defined ($confKey)) {
-		# if we don't know what kernel define corresponds
-		# to the module name, we can't know whether it's
-		# compiled in.  Punt.
-		Base::bug ("broken isOmitted check for $module");
-	}
-	my $confVal = $kConfMap->{"CONFIG_$confKey"};
-	return (! defined ($confVal));
-}
 
 1;
 
diff -ruN yaird-0.0.12/perl/Pack.pm yaird/perl/Pack.pm
--- yaird-0.0.12/perl/Pack.pm	2005-12-08 23:42:33.000000000 +0100
+++ yaird/perl/Pack.pm	2005-12-25 06:52:26.000000000 +0100
@@ -56,6 +56,10 @@
 	my ($image, $format, $destination) = @_;
 	Base::assert (knownFormat ($format));
 
+	if (Base::getExitCode() != 0) {
+		Base::fatal ("there were errors in this run, aborting now without output");
+	}
+
 	#
 	# Temp based on destination,to increase likelyhood
 	# of rename being atomic.
diff -ruN yaird-0.0.12/templates/Debian-initrd.cfg yaird/templates/Debian-initrd.cfg
--- yaird-0.0.12/templates/Debian-initrd.cfg	1970-01-01 01:00:00.000000000 +0100
+++ yaird/templates/Debian-initrd.cfg	2005-12-25 06:52:14.000000000 +0100
@@ -0,0 +1,410 @@
+#
+# Debian-initrd -- translate general intentions to exact initrd layout
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# This is written in a special purpose language;
+# see the HTML documentation for syntax definition.
+#
+# These templates define the translation from general intentions in the
+# plan to exact lists of files and script fragments to be included 
+# on the initrd image.  Templates are indexed by an action name, and include:
+# 	- files to be copied from current system to initrd;
+# 	  often executables.
+# 	- directories to be created
+# 	- fragments to be appended to scripts on the image,
+# 	  these are in a hash from script name to script content.
+#
+# Filenames and script fragments are processed by HTML::Template
+# before being added to the image.
+#
+# If you want to implement busybox support, this is the place to do it.
+#
+# Obviously, the template names and the attributes used in the template
+# should match what is provided by the planner.
+#
+
+TEMPLATE SET
+	TEMPLATE prologue
+	BEGIN
+		#
+		# In principle, we don't want device files on the initrd
+		# image: device numbers can change between kernels.
+		# Instead, create device files at boot time based on info
+		# in sysfs.  However, /dev/null and /dev/console are needed
+		# to mount sysfs.
+		#
+		FILE "/dev/null"
+		FILE "/dev/console"
+		FILE "/bin/dash"
+		FILE "/bin/cat"
+		FILE "/bin/mkdir"
+		FILE "/bin/mount"
+		FILE "/bin/umount"
+		FILE "/bin/mknod"
+		FILE "/bin/sleep"
+		FILE "/usr/sbin/chroot"
+		FILE "/sbin/pivot_root"
+
+		DIRECTORY "/mnt"
+		DIRECTORY "/proc"
+		DIRECTORY "/sys"
+		DIRECTORY "/dev"
+		DIRECTORY "/etc"
+		DIRECTORY "/var"
+
+		SCRIPT "/linuxrc"
+		BEGIN
+			!#!/bin/dash
+			!set -x
+			!export PATH=/sbin:/bin
+			!mount -nt proc proc /proc
+			!root=$(cat proc/sys/kernel/real-root-dev)
+			!echo 256 > proc/sys/kernel/real-root-dev
+			!echo "linuxrc: root is $root"
+			!umount -n /proc
+			!exit 0
+		END SCRIPT
+
+		#
+		# We can provide debugging opportunities in the
+		# initramfs image; the question is when and how
+		# to enable this.  Consider two types of user:
+		# - a developer, working on the template
+		# - an end user, who has a boot problem with
+		#   an image that was generated automatically
+		#   after installing a new distribution kernel.
+		#
+		# The developer can simply add debugging code
+		# to the template.
+		# For the end user, adding an option to the kernel
+		# command line is easier to enable debugging
+		# than rebuilding the boot image with special
+		# options or a modified configuration file.
+		#
+		# For this reason, we won't provide a template
+		# parameter to control debugging, instead we
+		# interpret a new kernel command line parameter:
+		# ydebug.
+		#
+		SCRIPT "/sbin/init"
+		BEGIN
+			!#!/bin/dash
+			!#
+			!# Generator version: yaird <TMPL_VAR NAME=appVersion>.
+			!# Kernel version: <TMPL_VAR NAME=version>.
+			!#
+			!INIT_DEBUG=
+			!if [ "$INIT_DEBUG" != "" ]
+			!then
+			!	set -x
+			!fi
+			!
+			!#
+			!#  Utility functions
+			!#
+			!mksymdev () {
+			!	devfile="$1"
+			!	sysfile="$2"
+			!	cb="$3"
+			!	devpair=$(/bin/cat "$sysfile")
+			!	for delay in 1 2 4 8 16
+			!	do
+			!		if [ "$devpair" = "" ]
+			!		then
+			!			echo "Waiting $delay seconds for $sysfile to show up"
+			!			sleep $delay
+			!		fi
+			!		devpair=$(/bin/cat "$sysfile")
+			!	done
+			!
+			!	if [ "$devpair" = "" ]
+			!	then
+			!		echo "Device $sysfile seems to be down."
+			!		echo "Debugging opportunity, type ^D to continue."
+			!		/bin/dash
+			!	fi
+			!
+			!	maj=${devpair%:*}
+			!	min=${devpair#*:}
+			!	/bin/mknod "$devfile" $cb $maj $min
+			!}
+			!mkcdev () {
+			!	mksymdev "$1" "/sys/class/$2/dev" c
+			!}
+			!mkbdev () {
+			!	mksymdev "$1" "/sys/block/$2/dev" b
+			!}
+			!
+			!switchroot () {
+			!	if [ "$INIT_DEBUG" != "" ]
+			!	then
+			!		echo "Debugging opportunity, ^D to continue."
+			!		/bin/dash
+			!	fi
+			!
+			!	echo "Switching root ..."
+			!	cd /mnt
+			!	# unmount /dev/twice, may have devfs planted by kernel
+			!	/bin/umount -n /dev
+			!	/bin/umount -n /dev
+			!	/bin/umount -n /var
+			!	/bin/umount -n /etc
+			!	/bin/umount -n /sys
+			!	/bin/umount -n /proc
+			!	/sbin/pivot_root . initrd
+			!	exec initrd/usr/sbin/chroot . $init "$@" < dev/console > dev/console 2>&1
+			!}
+			!
+			!#
+			!# Setting up mounts
+			!#
+			!/bin/mount -nt sysfs sysfs /sys
+			!/bin/mount -nt proc proc /proc
+			!/bin/mount -nt tmpfs none /dev
+			!# these help for vgchange
+			!/bin/mount -nt tmpfs tmpfs /etc
+			!/bin/mount -nt tmpfs tmpfs /var
+			!# /dev/tty is needed for eg cryptsetup.
+			!mkcdev /dev/tty tty/tty
+			!
+			!#
+			!# Command line processing
+			!# init - first proc to start on next root
+			!# root - to be done: how should it relate
+			!#	to file system selection?
+			!# ro,rw - mount root read-only or read-write.
+			!# 	This is like a mount -r; it overrules
+			!# 	a -o rw.
+			!# noresume, resume - to be done
+			!# ide - options for module ide_core.
+			!# 	need a way to append these to proper
+			!# 	module.  do a check on module name
+			!# 	in insmod template?
+			!# ip=, nfsaddrs=, nfsroot= - support NFS boot
+			!#
+			!ro=-r
+			!ip=
+			!nfsroot=
+			!init=/sbin/init
+			!for i in $(cat /proc/cmdline)
+			!do
+			!	case "$i" in
+			!	init=*)
+			!		init=${i#init=}
+			!		;;
+			!	ro)
+			!		ro=-r
+			!		;;
+			!	rw)
+			!		ro=
+			!		;;
+			!	ip=*|nfsaddrs=*)
+			!		ip="$ip $i"
+			!		;;
+			!	nfsroot=*)
+			!		nfsroot="$i"
+			!		;;
+			!	ydebug)
+			!		INIT_DEBUG=yes
+			!	esac
+			!done
+			!if [ "$INIT_DEBUG" != "" ]
+			!then
+			!	set -x
+			!fi
+		END SCRIPT
+	END TEMPLATE
+
+
+	TEMPLATE insmod
+	BEGIN
+		FILE "<TMPL_VAR NAME=target>"
+		FILE "/sbin/insmod"
+
+		# optionList may be undef
+		# and already is suitably escaped.
+		SCRIPT "/sbin/init"
+		BEGIN
+			!/sbin/insmod '<TMPL_VAR NAME=target>' <TMPL_VAR NAME=optionList>
+		END SCRIPT
+	END TEMPLATE
+
+
+	TEMPLATE mkbdev
+	BEGIN
+		SCRIPT "/sbin/init"
+		BEGIN
+			!mkbdev '<TMPL_VAR NAME=target>' '<TMPL_VAR NAME=sysname>'
+		END SCRIPT
+	END TEMPLATE
+
+
+	#
+	# We cannot make mapper/control any earlier,
+	# since dm-mod needs to be loaded to be able
+	# to determine devno.
+	#
+	TEMPLATE vgchange
+	BEGIN
+		FILE "/lib/lvm-200/vgchange"
+		FILE "/sbin/vgchange"
+		SCRIPT "/sbin/init"
+		BEGIN
+			!if [ ! -c /dev/mapper/control ]
+			!then
+			!	/bin/mkdir /dev/mapper
+			!	mkcdev /dev/mapper/control misc/device-mapper
+			!fi
+			!/sbin/vgchange -a y '<TMPL_VAR NAME=target>'
+		END SCRIPT
+	END TEMPLATE
+
+
+	#
+	# NOTE: mdadm can operate without knowledge
+	# of device numbers; it will assign an unused
+	# one to the new device.  Thus you could have
+	# device name /dev/md/boot that is stable,
+	# regardless of which other raid devices are
+	# operational.  However, debian installer
+	# consistently uses device names like /dev/md0,
+	# where the name depends on earlier minors
+	# that happen to have been assigned.
+	# To work around this problem, we forego
+	# the --auto option, and mknod the device
+	# before putting an md under it.  Better hope
+	# the major number is not going to change ...
+	#
+	TEMPLATE mdadm
+	BEGIN
+		FILE "/sbin/mdadm"
+		SCRIPT "/sbin/init"
+		BEGIN
+			!mknod <TMPL_VAR NAME=target> b <TMPL_VAR NAME=major> <TMPL_VAR NAME=minor>
+			!mdadm --assemble <TMPL_VAR NAME=target> --uuid <TMPL_VAR NAME=uuid> \
+			!	<TMPL_LOOP NAME=components> <TMPL_VAR NAME=dev></TMPL_LOOP>
+		END SCRIPT
+	END TEMPLATE
+
+	#
+	# cryptsetup arguments:
+	# - target
+	# - cipher
+	# - keySize (always there, 0 for NULL crypto)
+	# - hash (hashname or undef)
+	# - src
+	# - verify (yes or undef)
+	#
+	# A loop around 'cryptsetup --verify' can help detect
+	# and correct typo's in the crypt password.
+	#
+	TEMPLATE cryptsetup
+	BEGIN
+		FILE "/sbin/cryptsetup"
+		SCRIPT "/sbin/init"
+		BEGIN
+			!DOCRYPT=1
+			!while [ "$DOCRYPT" != "0" ]
+			!do
+			!	/sbin/cryptsetup \
+			!		-c <TMPL_VAR NAME=cipher> \
+			!		-s <TMPL_VAR NAME=keySize> \
+			!		<TMPL_IF NAME=hash> \
+			!			-h '<TMPL_VAR NAME=hash>' \
+			!		</TMPL_IF> \
+			!		<TMPL_IF NAME=verify>-y </TMPL_IF> \
+			!		create '<TMPL_VAR NAME=target>' \
+			!		'<TMPL_VAR NAME=src>'
+			!	DOCRYPT=$?
+			!done
+		END SCRIPT
+	END TEMPLATE
+
+
+	#
+	# cryptsetup arguments:
+	# - target
+	# - src
+	# - verify (yes or undef)
+	#
+	# A loop around 'cryptsetup --verify' can help detect
+	# and correct typo's in the crypt password.
+	#
+	TEMPLATE cryptsetup_luks
+	BEGIN
+		FILE "/sbin/cryptsetup"
+		SCRIPT "/sbin/init"
+		BEGIN
+			!DOCRYPT=1
+			!while [ "$DOCRYPT" != "0" ]
+			!do
+			!	/sbin/cryptsetup \
+			!		<TMPL_IF NAME=verify>-y </TMPL_IF> \
+			!		luksOpen '<TMPL_VAR NAME=src>' \
+			!		'<TMPL_VAR NAME=target>'
+			!	DOCRYPT=$?
+			!done
+		END SCRIPT
+	END TEMPLATE
+
+
+	#
+	# NOTE: honouring the kernel cmdline option ro,rw
+	# is very nice, but...  If you have an ext3 in a
+	# file loopback-mounted from vfat, it's unlikely
+	# that a remount rw of root will also make the
+	# underlying vfat read-write.  Underlying filesystems
+	# should ignore the kernel ro/rw option; we
+	# have an attribute isRoot that's defined iff
+	# this is the real root.
+	#
+	# always -n, since we dont have writable /etc/mtab.
+	#
+	TEMPLATE mount
+	BEGIN
+		SCRIPT "/sbin/init"
+		BEGIN
+			!/bin/mount -n \
+			!	<TMPL_IF NAME=isRoot>$ro</TMPL_IF> \
+			!	-t <TMPL_VAR NAME=fsType> \
+			!	<TMPL_VAR NAME=options> \
+			!	'<TMPL_VAR NAME=device>' \
+			!	'<TMPL_VAR NAME=target>'
+		END SCRIPT
+	END TEMPLATE
+
+	TEMPLATE nfsstart
+	BEGIN
+		FILE "<TMPL_VAR NAME=auxDir>/trynfs"
+		SCRIPT "/sbin/init"
+		BEGIN
+			!if [ "$ip" != "" ]
+			!then
+			!	<TMPL_VAR NAME=auxDir>/trynfs $ip $nfsroot /mnt
+			!	switchroot "$@"
+			!fi
+		END SCRIPT
+	END TEMPLATE
+
+	TEMPLATE postlude
+	BEGIN
+		SCRIPT "/sbin/init"
+		BEGIN
+			!switchroot "$@"
+		END SCRIPT
+	END TEMPLATE
+END TEMPLATE SET
diff -ruN yaird-0.0.12/TODO yaird/TODO
--- yaird-0.0.12/TODO	2005-12-08 23:42:32.000000000 +0100
+++ yaird/TODO	2005-12-25 06:52:27.000000000 +0100
@@ -1,4 +1,5 @@
 Todo:
+	- consider using a fake /sys, /proc for debugging.
 	- consider $TMPDIR, umask for output.
 	- what if sda,sdb are raid, then a new disk is added,
 	  and the raid is sda,sdc?  we need something like coldplug.
