I've put together a bash script that will patch the v4l tree and make it into a v4l-updatelee tree. This allows one to use all the work and improvements that UDL put into v4l-updatelee for kernels of most (maybe not all) kinds. The current kernel for v4l-updatelee is 4.6.0-rc2 and I've successfully ran this script against 4.6.0 release version and 4.4.19. I'm still working on the rejects that happen after the UDL_patch is applied and hope to find a way to eliminate them. If that happens, I can make it a one step process that either compiles the patched tree or exits after patching if there are reject files so they can be dealt with. All comments are welcome.
Jim
-------------------manual_media_build.sh starts below----------------------------------
#!/bin/bash
prep(){
WORKDIR=${WORKDIR:-"/tmp/v4l-`date +%b%d%I%M%P`"}
# test WORKDIR for existance and exit if it does with error message
if ; then
echo "$WORKDIR exists!!! Choose another working place or fix this manually"
echo "and rerun this script."
exit
else
echo ""
echo "First we'll create the work directory and change into it."
echo ""
mkdir $WORKDIR
cd $WORKDIR
fi
}
download(){
echo ""
echo "Now we'll get the source code trees."
echo ""
git clone --depth 1 https://bitbucket.org/updatelee/v4l-updatelee
git clone git://linuxtv.org/media_build.git
}
build1(){
echo ""
echo "Next we build the unpatched v4l modules."
echo ""
cd media_build
./build
}
make_UDL_patch(){
echo ""
echo "Here we build the patch where Updatelee's work is added to the v4l tree."
echo ""
cd linux
tar xf linux-media.tar.bz2
cd ../../
diff -ruP media_build/linux/include/uapi/linux/dvb/ v4l-updatelee/include/uapi/linux/dvb/ > UDL_patch.diff
diff -ruP media_build/linux/drivers/media/ v4l-updatelee/drivers/media/ >> UDL_patch.diff
}
add_patches(){
echo ""
echo "Time to apply the patches."
echo ""
cd media_build
patch -s -f -N -p1 -i backports/api_version.patch
patch -s -f -N -p1 -i backports/pr_fmt.patch
patch -s -f -N -p1 -i backports/debug.patch
patch -s -f -N -p1 -i backports/drx39xxj.patch
patch -s -f -N -p1 -i ../UDL_patch.diff > ../../UDL_patch.log
cat UDL_patch.log
echo ""
echo "Fix any errors shown in the reject files above and run 'cd $WORKDIR/media_build; ./build'"
echo ""
echo "If that runs successfully, run:"
echo " 'make install' as root."
echo " 'cp -R linux/include/uapi/linux/dvb/* /usr/include/linux/dvb/'"
echo " 'cp -R ../v4l-updatelee/firmware/* /lib/firmware/'"
echo ""
echo ""
}
show_help(){
cat << EOF
Running this script without options will create a work directory in the
/tmp directory, download the v4l and v4l-updatelee trees, and patch
the v4l tree with Updatelee's improvements. After the patching process
is complete; you'll need to finish the compilation manually.
Pay attention to the message you'll receive after the patching so you can
finish the compilation.
If you wish to specify a work directory, the format is:
media_build_script.sh your_desired_location
The only other valid options are -h or --help which both display this message.
EOF
}
case "$1" in
'')
prep
download
build1
make_UDL_patch
add_patches
;;
'-h'|'--help')
show_help
;;
*)
WORKDIR=$1
prep
download
build1
make_UDL_patch
add_patches
;;
esac
Jim
-------------------manual_media_build.sh starts below----------------------------------
#!/bin/bash
prep(){
WORKDIR=${WORKDIR:-"/tmp/v4l-`date +%b%d%I%M%P`"}
# test WORKDIR for existance and exit if it does with error message
if ; then
echo "$WORKDIR exists!!! Choose another working place or fix this manually"
echo "and rerun this script."
exit
else
echo ""
echo "First we'll create the work directory and change into it."
echo ""
mkdir $WORKDIR
cd $WORKDIR
fi
}
download(){
echo ""
echo "Now we'll get the source code trees."
echo ""
git clone --depth 1 https://bitbucket.org/updatelee/v4l-updatelee
git clone git://linuxtv.org/media_build.git
}
build1(){
echo ""
echo "Next we build the unpatched v4l modules."
echo ""
cd media_build
./build
}
make_UDL_patch(){
echo ""
echo "Here we build the patch where Updatelee's work is added to the v4l tree."
echo ""
cd linux
tar xf linux-media.tar.bz2
cd ../../
diff -ruP media_build/linux/include/uapi/linux/dvb/ v4l-updatelee/include/uapi/linux/dvb/ > UDL_patch.diff
diff -ruP media_build/linux/drivers/media/ v4l-updatelee/drivers/media/ >> UDL_patch.diff
}
add_patches(){
echo ""
echo "Time to apply the patches."
echo ""
cd media_build
patch -s -f -N -p1 -i backports/api_version.patch
patch -s -f -N -p1 -i backports/pr_fmt.patch
patch -s -f -N -p1 -i backports/debug.patch
patch -s -f -N -p1 -i backports/drx39xxj.patch
patch -s -f -N -p1 -i ../UDL_patch.diff > ../../UDL_patch.log
cat UDL_patch.log
echo ""
echo "Fix any errors shown in the reject files above and run 'cd $WORKDIR/media_build; ./build'"
echo ""
echo "If that runs successfully, run:"
echo " 'make install' as root."
echo " 'cp -R linux/include/uapi/linux/dvb/* /usr/include/linux/dvb/'"
echo " 'cp -R ../v4l-updatelee/firmware/* /lib/firmware/'"
echo ""
echo ""
}
show_help(){
cat << EOF
Running this script without options will create a work directory in the
/tmp directory, download the v4l and v4l-updatelee trees, and patch
the v4l tree with Updatelee's improvements. After the patching process
is complete; you'll need to finish the compilation manually.
Pay attention to the message you'll receive after the patching so you can
finish the compilation.
If you wish to specify a work directory, the format is:
media_build_script.sh your_desired_location
The only other valid options are -h or --help which both display this message.
EOF
}
case "$1" in
'')
prep
download
build1
make_UDL_patch
add_patches
;;
'-h'|'--help')
show_help
;;
*)
WORKDIR=$1
prep
download
build1
make_UDL_patch
add_patches
;;
esac
Category: Computer and USB Satellite Receivers and Recording