Kernel-Module

Aus Shea Wiki
Version vom 20. Dezember 2021, 13:27 Uhr von Suelmann (Diskussion | Beiträge) (16 Versionen importiert)
Zur Navigation springen Zur Suche springen

Kernel-Module für Fedora erzeugen

Erzeugen einer Buildumgebung mit aktuellem Kernel

rpmdev-setuptree
yumdownloader --source kernel
KERNEL=$(ls kernel-*.src.rpm|tail -1)
su -c "yum-builddep $KERNEL"
rpm -Uvh $KERNEL
cd ~/rpmbuild/SPECS
rpmbuild -bp --target=$(uname -m) kernel.spec

Patch für dvbdev

Patchdatei (~/linux-3.7.1-dvb-mutex.patch)

diff -Nur linux-3.7.1/drivers/media/dvb-core/dvbdev.c linux-3.7.1/drivers/media/dvb-core/dvbdev.c
--- linux-3.7.1/drivers/media/dvb-core/dvbdev.c
+++ linux-3.7.1/drivers/media/dvb-core/dvbdev.c
@@ -83,8 +83,11 @@ static int dvb_device_open(struct inode *inode, struct file *file)
 			file->f_op = old_fops;
 			goto fail;
 		}
-		if(file->f_op->open)
+		if(file->f_op->open) {
+			mutex_unlock(&dvbdev_mutex);
 			err = file->f_op->open(inode,file);
+			mutex_lock(&dvbdev_mutex);
+		}
 		if (err) {
 			fops_put(file->f_op);
 			file->f_op = fops_get(old_fops);
--

Patch Einspielen

KERNELDIR=$(echo $KERNEL | perl -e '<> =~ /(\d+)\.(\d+)\..*(fc\d+)/; print "kernel-$1.$2.$3\n"')
cd ~/rpmbuild/BUILD/$KERNELDIR
patch -p1 < ~/linux-3.7.1-dvb-mutex.patch
cd drivers/media/dvb-core