Merge pull request #1138 from CvH/media_build_stable

media_build for Generic and RPi
This commit is contained in:
Christian Hewitt 2017-01-08 09:57:02 +04:00 committed by GitHub
commit 4455d4d826
12 changed files with 158 additions and 24 deletions

View File

@ -0,0 +1,49 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2016 Team LibreELEC
#
# LibreELEC 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.
#
# LibreELEC 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 LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="media_build"
PKG_VERSION="2016-12-28"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/crazycat69/linux_media"
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_BUILD_DEPENDS_TARGET="toolchain linux"
PKG_SECTION="driver"
PKG_SHORTDESC="DVB drivers that replace the version shipped with the kernel"
PKG_LONGDESC="DVB drivers that replace the version shipped with the kernel"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
pre_make_target() {
export KERNEL_VER=$(get_module_dir)
export LDFLAGS=""
}
make_target() {
cd media_build
make dir DIR=../media
make VER=$KERNEL_VER SRCDIR=$(kernel_path) allyesconfig
make VER=$KERNEL_VER SRCDIR=$(kernel_path)
}
makeinstall_target() {
mkdir -p $INSTALL/usr/lib/modules/$KERNEL_VER/updates
find $ROOT/$PKG_BUILD/media_build/v4l/ -name \*.ko -exec cp {} $INSTALL/usr/lib/modules/$KERNEL_VER/updates \;
}

View File

@ -0,0 +1,13 @@
[Patch] without this patch you need to install libproc-processtable-perl at host system
--- a/media_build/v4l/Makefile
+++ b/media_build/v4l/Makefile
@@ -51,7 +51,7 @@
@echo Kernel build directory is $(OUTDIR)
$(MAKE) -C ../linux apply_patches
$(MAKE) -C $(OUTDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules
- ./scripts/rmmod.pl check
+# ./scripts/rmmod.pl check
# $(MAKE) checkpatch
mismatch:: prepare firmware

View File

@ -0,0 +1,15 @@
diff --git a/media_build/backports/backports.txt b/media_build/backports/backports.txt
index 2a6006b..8c7c3de 100644
--- a/media_build/backports/backports.txt
+++ b/media_build/backports/backports.txt
@@ -25,6 +25,10 @@
add pr_fmt.patch
add debug.patch
add drx39xxj.patch
+add linux-203-stb0899_enable_low_symbol_rate.patch
+add linux-212-mantis_stb0899_faster_lock.patch
+add linux-222-stb0899_signal_quality.patch
+add linux-227-ds3000-invalid-symbol-rate.patch
[4.8.255]
add v4.8_user_pages_flag.patch

View File

@ -85,4 +85,4 @@
# for a list of additinoal drivers see packages/linux-drivers # for a list of additinoal drivers see packages/linux-drivers
# Space separated list is supported, # Space separated list is supported,
# e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2" # e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2"
ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS bcm_sta" ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS bcm_sta media_build"

View File

@ -140,4 +140,4 @@
# for a list of additinoal drivers see packages/linux-drivers # for a list of additinoal drivers see packages/linux-drivers
# Space separated list is supported, # Space separated list is supported,
# e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2" # e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2"
ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS" ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS media_build"

View File

@ -136,4 +136,4 @@
# for a list of additinoal drivers see packages/linux-drivers # for a list of additinoal drivers see packages/linux-drivers
# Space separated list is supported, # Space separated list is supported,
# e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2" # e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2"
ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS" ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS media_build"

View File

@ -85,7 +85,7 @@
# for a list of additinoal drivers see packages/linux-drivers # for a list of additinoal drivers see packages/linux-drivers
# Space separated list is supported, # Space separated list is supported,
# e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2" # e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2"
ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS bcm_sta" ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS bcm_sta media_build"
# Xorg Graphic drivers to use (all / i915,i965,r200,r300,r600,nvidia,nouveau,vmware,virtualbox) # Xorg Graphic drivers to use (all / i915,i965,r200,r300,r600,nvidia,nouveau,vmware,virtualbox)
# Space separated list is supported, # Space separated list is supported,

View File

@ -1,41 +1,98 @@
#!/bin/sh #!/bin/sh
################################################################################ ################################################################################
# This file is part of OpenELEC - http://www.openelec.tv # This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv) # Copyright (C) 2016 Team LibreELEC
# #
# OpenELEC is free software: you can redistribute it and/or modify # LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or # the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# OpenELEC is distributed in the hope that it will be useful, # LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>. # along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################ ################################################################################
echo "getting sources..." # name of the package
DVB_MKPKG_NAME="media_build"
DVB_MKPKG_FOLDER="$(pwd)"
# remove old files
echo "removing old sources ..."
rm -rf ${DVB_MKPKG_NAME}
rm -rf ${DVB_MKPKG_NAME}-*
################################################################################
# media_build dl
echo "getting media_build sources ..."
if [ ! -d media_build.git ]; then if [ ! -d media_build.git ]; then
git clone git://linuxtv.org/media_build.git media_build.git git clone --depth=1 https://bitbucket.org/CrazyCat/media_build.git ${DVB_MKPKG_NAME}/media_build
fi fi
cd media_build.git echo "cleaning media_build sources ..."
git pull rm -rf ${DVB_MKPKG_NAME}/media_build/.git
GIT_REV=`git log -n1 --format=%h`
cd ..
echo "copying sources..." # media_tree dl
rm -rf media_build-$GIT_REV echo "getting sources ..."
cp -R media_build.git media_build-$GIT_REV if [ ! -d linux_media.git ]; then
git clone --depth=1 https://github.com/crazycat69/linux_media.git -b latest ${DVB_MKPKG_NAME}/media_tree
fi
echo "cleaning sources..." cd ${DVB_MKPKG_NAME}/media_tree
rm -rf media_build-$GIT_REV/.git git pull
GIT_REV=`git log -n1 --pretty=format:"%ad" --date=short`
echo "packing sources..." cd $DVB_MKPKG_FOLDER/
tar cvJf media_build-$GIT_REV.tar.xz media_build-$GIT_REV
echo "remove temporary sourcedir..." # final folder
rm -rf media_build-$GIT_REV mkdir ${DVB_MKPKG_NAME}/media/
################################################################################
# modify the media_build buildscript
cd ${DVB_MKPKG_NAME}/media_build/linux/
# backup Makefile
cp Makefile Makefile.org
# workaround for crazycat media_build to create a proper named file
sed -i -E "s/TODAY_TAR\ \:\=\ linux\-media\-LATEST\.tar/TODAY_TAR\ \:\=\ linux\-media.tar/g" Makefile
# normal media build
sed -i -E 's/TODAY_TAR\ \:\=\ linux\-media\-\$\{DATE\}\.tar/TODAY_TAR\ \:\=\ linux\-media.tar/g' Makefile
# remove the creation of the archive
sed -i -E 's/bzip2\ \$\(PWD\)\/\$\(TODAY_TAR\)/ /g' Makefile
# collecting files from media_tree
echo "collect source files ..."
make todaytar DIR="../../media_tree/"
# extract resulting tar into media folder
tar xf linux-media.tar -C "../../media/"
# cleanup
rm linux-media.tar
rm Makefile && mv Makefile.org Makefile
cd $DVB_MKPKG_FOLDER
rm -rf ${DVB_MKPKG_NAME}/media_tree/
rm -rf ${DVB_MKPKG_NAME}/media_build/.git/
# rename buildfolder
mv ${DVB_MKPKG_NAME}/ ${DVB_MKPKG_NAME}-$GIT_REV/
################################################################################
# pack sources
echo "packing sources ..."
tar cvJf ${DVB_MKPKG_NAME}-$GIT_REV.tar.xz ${DVB_MKPKG_NAME}-$GIT_REV
echo "remove temporary sourcedir ..."
rm -rf ${DVB_MKPKG_NAME}-$GIT_REV
rm -rf ${DVB_MKPKG_NAME}