Kernel-Module: Unterschied zwischen den Versionen

Aus Shea Wiki
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
(Änderung 276 von Suelmann (Diskussion) rückgängig gemacht.)
Markierung: Rückgängigmachung
 
(6 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 5: Zeile 5:
<pre><nowiki>
<pre><nowiki>
rpmdev-setuptree
rpmdev-setuptree
yumdownloader --source kernel
dnf download --source kernel
KERNEL=$(ls kernel-*.src.rpm|tail -1)
KERNEL=$(ls kernel-*.src.rpm|tail -1)
su -c "yum-builddep $KERNEL"
sudo dnf builddep $KERNEL
rpm -Uvh $KERNEL
rpm -Uvh $KERNEL
cd ~/rpmbuild/SPECS
cd ~/rpmbuild/SPECS
Zeile 13: Zeile 13:
</nowiki></pre>
</nowiki></pre>


== Patch für dvbdev ==
=== Patchdatei (~/linux-3.7.1-dvb-mutex.patch) ===
<pre><nowiki>
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);
</nowiki></pre>
=== Patchdatei (~/linux-3.13-dvb-mutex.patch) ===
<pre><nowiki>
--- linux-3.13/drivers/media/dvb-core/dvbdev.c  2014-03-07 00:07:50.866909615 +0100
+++ linux-3.13/drivers/media/dvb-core/dvbdev.c.orig    2014-01-20 03:40:07.000000000 +0100
@@ -81,11 +81,8 @@
                        goto fail;
                file->private_data = dvbdev;
                replace_fops(file, new_fops);
-              if (file->f_op->open) {
-                      mutex_unlock(&dvbdev_mutex);
+              if (file->f_op->open)
                        err = file->f_op->open(inode,file);
-                      mutex_lock(&dvbdev_mutex);
-              }
                up_read(&minor_rwsem);
                mutex_unlock(&dvbdev_mutex);
                return err;
</nowiki></pre>


=== Patch Einspielen ===
=== Patch Einspielen ===
Wenn das Modul für einen neuen Kernel benötigt wird und der Kernel keine Änderungen in dvb-core hatte, kann man ab hier starten und die <code><nowiki>patch</nowiki></code>-Zeile weglassen.
Wenn das Modul für einen neuen Kernel benötigt wird und der Kernel keine Änderungen in dvb-core hatte, kann man ab hier starten und die <code><nowiki>patch</nowiki></code>-Zeilen und das cp weglassen.


<pre><nowiki>
<pre><nowiki>
KERNELDIR=$(uname -r | perl -e '<> =~ /(\d+)\.(\d+)\..*(fc\d+)/; print "kernel-$1.$2.$3\n"')
KERNELDIR=$(uname -r | perl -e '<> =~ /(\d+)\.(\d+)\..*(fc\d+)/; print "kernel-$1.$2.$3\n"')
cd ~/rpmbuild/BUILD/$KERNELDIR/linux*
cd ~/rpmbuild/BUILD/$KERNELDIR/linux*
patch -p1 < ~/linux-3.13-dvb-mutex.patch
sudo sh -c "echo 'CONFIG_DVB_LOOPBACK_ADAPTER=m' >> /usr/src/kernels/$(uname -r)/include/config/auto.conf"
patch -p0 < /data/src/dvbloopback/3.13-dvb-core.patch
patch -p0 < /data/src/dvbloopback/dvbloopback.patch
cp -a /data/src/dvbloopback/dvbloopback drivers/media/pci
cd drivers/media/dvb-core
cd drivers/media/dvb-core
make -C /lib/modules/`uname -r`/build M=`pwd` modules
make -C /lib/modules/`uname -r`/build M=`pwd` modules
su -c "mv /usr/lib/modules/`uname -r`/kernel/drivers/media/dvb-core/dvb-core.ko.xz /usr/lib/modules/`uname -r`/kernel/drivers/media/dvb-core/dvb-core.ko.xz.orig"
#sudo mv /usr/lib/modules/`uname -r`/kernel/drivers/media/dvb-core/dvb-core.ko.xz /usr/lib/modules/`uname -r`/kernel/drivers/media/dvb-core/dvb-core.ko.xz.orig
su -c "make -C /lib/modules/`uname -r`/build M=`pwd` modules_install"
sudo make -C /lib/modules/`uname -r`/build M=`pwd` modules_install
cd ../pci/dvbloopback
ln -s ../../dvb-core/dvbdev.h .
make -C /lib/modules/`uname -r`/build M=`pwd` modules
sudo make -C /lib/modules/`uname -r`/build M=`pwd` modules_install
</nowiki></pre>
</nowiki></pre>


Zeile 72: Zeile 38:


<pre><nowiki>
<pre><nowiki>
rmmod dvb_usb_dib0700 dib8000 dib7000m dib0070 dib7000p dvb_usb budget_ci budget_core dvb_core
sudo rmmod dvb_usb_dib0700 dib8000 dib7000m dib0070 dib7000p dvb_usb budget_ci budget_core dvb_core
modprobe budget_ci
sudo modprobe budget_ci
modprobe dvb_usb_dib0700
sudo modprobe dvb_usb_dib0700
</nowiki></pre>
</nowiki></pre>


== Quelle ==
https://github.com/bas-t/dvbloopback


=== Kernelmodul für SASC ===
=== Kernelmodul für SASC ===
Zeile 83: Zeile 52:
----
----
[[KategorieWissen]]
[[KategorieWissen]]

Aktuelle Version vom 20. Dezember 2021, 13:57 Uhr

Kernel-Module für Fedora erzeugen

Erzeugen einer Buildumgebung mit aktuellem Kernel

rpmdev-setuptree
dnf download --source kernel
KERNEL=$(ls kernel-*.src.rpm|tail -1)
sudo dnf builddep $KERNEL
rpm -Uvh $KERNEL
cd ~/rpmbuild/SPECS
rpmbuild -bp --target=$(uname -m) kernel.spec


Patch Einspielen

Wenn das Modul für einen neuen Kernel benötigt wird und der Kernel keine Änderungen in dvb-core hatte, kann man ab hier starten und die patch-Zeilen und das cp weglassen.

KERNELDIR=$(uname -r | perl -e '<> =~ /(\d+)\.(\d+)\..*(fc\d+)/; print "kernel-$1.$2.$3\n"')
cd ~/rpmbuild/BUILD/$KERNELDIR/linux*
sudo sh -c "echo 'CONFIG_DVB_LOOPBACK_ADAPTER=m' >> /usr/src/kernels/$(uname -r)/include/config/auto.conf"
patch -p0 < /data/src/dvbloopback/3.13-dvb-core.patch
patch -p0 < /data/src/dvbloopback/dvbloopback.patch
cp -a /data/src/dvbloopback/dvbloopback drivers/media/pci
cd drivers/media/dvb-core
make -C /lib/modules/`uname -r`/build M=`pwd` modules
#sudo mv /usr/lib/modules/`uname -r`/kernel/drivers/media/dvb-core/dvb-core.ko.xz /usr/lib/modules/`uname -r`/kernel/drivers/media/dvb-core/dvb-core.ko.xz.orig
sudo make -C /lib/modules/`uname -r`/build M=`pwd` modules_install
cd ../pci/dvbloopback
ln -s ../../dvb-core/dvbdev.h .
make -C /lib/modules/`uname -r`/build M=`pwd` modules
sudo make -C /lib/modules/`uname -r`/build M=`pwd` modules_install


Patch aktivieren

sudo rmmod dvb_usb_dib0700 dib8000 dib7000m dib0070 dib7000p dvb_usb budget_ci budget_core dvb_core
sudo modprobe budget_ci
sudo modprobe dvb_usb_dib0700


Quelle

https://github.com/bas-t/dvbloopback

Kernelmodul für SASC

siehe SASC


KategorieWissen