Skip to content

Prerequisites, Build errors and Rebuilding

tbsiptv edited this page Jan 5, 2022 · 4 revisions

Build prerequisites

Debian/Ubuntu

  1. Kernel headers

    apt-get install linux-headers-generic
    #
    # Or
    #
    apt-get install linux-headers-`uname -r`
  2. /bin/sh: 1: lsdiff: not found

    sudo apt-get install patchutils
  3. Can’t locate Proc/ProcessTable.pm in @INC (you may need to install the Proc::ProcessTable module)

    sudo apt-get install libproc-processtable-perl
  4. make[2]: gcc: Command not found

    sudo apt-get install gcc
  5. Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler

    sudo add-apt-repository ppa:ubuntu-toolchain-r/test
    sudo apt-get update
    sudo apt-get install gcc-4.9 g++-4.9
    sudo rm /usr/bin/gcc
    sudo ln -s /usr/bin/gcc-4.9 /usr/bin/gcc

CentOS 7

  1. Update to new kernel

    #rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
    #rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
    #yum --enablerepo=elrepo-kernel install kernel-lt-devel kernel-lt -y
    #grub2-set-default 0
  2. Restart to load the new kernel and install gcc unzip

    #yum -y install gcc
    #yum -y install unzip
    #reboot
  3. Install required libraries

    #yum -y install perl-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
    #yum -y install patchutils
    #yum -y install patch
  4. Install the SHA

    #wget https://sourceforge.net/projects/moiproamd/files/Files/Digest-SHA-5.93.tar.gz/download -O Digest-SHA-5.93.tar.gz
    #tar xvf Digest-SHA-5.93.tar.gz
    #cd Digest-SHA-5.93
    #perl Makefile.PL
    #make && make install
  5. Install Perl

    #wget https://sourceforge.net/projects/moiproamd/files/Files/perl-proc-processtable-master.zip/download -O perl-proc-processtable-master.zip
    #unzip perl-proc-processtable-master.zip
    #cd perl-proc-processtable-master
    #perl Makefile.PL
    #make && make install

OpenSUSE Tumbleweed (working for 5.2.7 2019-08-10)

zypper install gcc make git kernel-source patchutils perl-Proc-ProcessTable

OpenSUSE Leap (not-working for 15.1 with kernel 4.12.x)

A number of errors occur including EPOLL... vs POLL... headers (an easy edit)
But I've been unable to get a working compilation on this kernel

Can not load the driver after build

Please check the Secure Boot whether is enabled, you can disable it with this guide:
https://wiki.ubuntu.com/UEFI/SecureBoot/DKMS

Build errors

  1. fatal error: drx39xyj/drx39xxj.h: No such file or directory

    mkdir -p v4l/drx39xyj
    cp v4l/drx39xxj.h v4l/drx39xyj/
  2. If you find module load errors like "module has wrong symbol version", this means that there still are old modules from your previous Media Tree installation (usually duplicated modules in two different places). The brute-force approach is to simply do:

    sudo rm -rf /lib/modules/``uname -r``/kernel/drivers/media/*
    ``` 
    
    The other option is to identify, find and remove duplicate modules manually. Example:
    find /lib/modules/uname -r -name "media.ko" sudo rm …​ `

Rebuilding

Upgrading sources and re-installing

~ $ cd media
~/media $ git remote update
~/media $ git pull
~/media $ cd ../media_build
~/media_build $ git remote update
~/media_build $ git pull
~/media_build $ make
~/media_build $ sudo make install
(now you can reboot or unload/reload modules manually:)
~/media_build $ sudo make rmmod
~/media_build $ sudo modprobe ...