[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Latest module-init-tools update breaks D-I and kernel-images



Hi,

the latest module-init-tool update introduces R/w file locking on
modules in modprobe. This of course fails on any read-only filesystem,
like the cramfs initrd.

This affects any initrd build with the new modprobe so all netboot and
businesscard D-I CDs are broken now and the daily build images
starting today probably too.

Also anyone installing a kernel-image package will run into the same
problem.

I patched module-init-tools to fall back to a read-only lock on
EROFS but that lock is probably only usefull to lockup in loops.
Anyway, please test this patch:

MfG
        Goswin

======[ module-init-tools-3.1-pre2/debian/patches/modprobe.ro-lock ]======

--- module-init-tools-3.1-pre2.orig/modprobe.c	2004-06-15 22:54:51.000000000 +0000
+++ module-init-tools-3.1-pre2/modprobe.c	2004-06-18 21:12:55.935619059 +0000
@@ -207,6 +207,19 @@
 		lock.l_start = 0;
 		lock.l_len = 1;
 		fcntl(fd, F_SETLKW, &lock);
+	} else {
+		if (errno == EROFS) {
+			fd = open(filename, O_RDONLY, 0);
+	
+			if (fd >= 0) {
+				struct flock lock;
+				lock.l_type = F_RDLCK;
+				lock.l_whence = SEEK_SET;
+				lock.l_start = 0;
+				lock.l_len = 1;
+				fcntl(fd, F_SETLKW, &lock);
+			}
+		}
 	}
 	return fd;
 }



Reply to: