Skip to content

Instantly share code, notes, and snippets.

@RobertCNelson
Created January 22, 2020 15:01
Show Gist options
  • Select an option

  • Save RobertCNelson/aaa50eb0c4996a2c094a8c3a07b3adda to your computer and use it in GitHub Desktop.

Select an option

Save RobertCNelson/aaa50eb0c4996a2c094a8c3a07b3adda to your computer and use it in GitHub Desktop.
#!/bin/bash
VERSION_MESSAGE="Version: 1.1846.20200122: screwed up again..."
chroot_user="voodoo"
SYSTEM_BUILDER=$(uname -n)
#Download/Upload
wget_dl="wget --no-verbose --directory-prefix=/build/buildd/"
UPLOAD="curl --limit-rate 25000 --retry 5 --retry-delay 120 --ftp-create-dirs -T"
ABI_LTS414="ABI:1 LTS414"
ABI_LTS419="ABI:1 LTS419"
ABI_LTS54="ABI:1 LTS54"
ABI_STABLE="ABI:1 STABLE"
ABI_TEST="ABI:1 TESTING"
ABI_EXP="ABI:1 EXPERIMENTAL"
setup_enviroment () {
CHROOT_DIR="/var/chroot"
local_http="http://192.168.1.98/internal/dl/kernel.org"
unset release
unset dpkg_arch
unset SUBARCH
unset LATEST
unset use_fakeroot
release=$(ls -1 /tmp/deb.release* | grep "deb.release" | awk -F '.' '{print $3}')
dpkg_arch=$(ls -1 /tmp/deb.arch* | grep "deb.arch" | awk -F '.' '{print $3}')
SUBARCH=$(ls -1 /tmp/deb.subarch* | grep "deb.subarch" | awk -F '.' '{print $3}')
LATEST=$(ls -1 /tmp/deb.latest* | grep "deb.latest" | awk -F '.' '{print $3}')
use_fakeroot=$(ls -1 /tmp/deb.fakeroot* | grep "deb.fakeroot" | awk -F '.' '{print $3}')
echo "deb.release.${release}"
echo "deb.arch.${dpkg_arch}"
echo "deb.subarch.${SUBARCH}"
echo "deb.latest.${LATEST}"
echo "deb.fakeroot.${use_fakeroot}"
if [ "x${dpkg_arch}" = "xarmhf" ] ; then
KERNEL_ARCH="arm"
fi
if [ "x${dpkg_arch}" = "xarm64" ] ; then
KERNEL_ARCH="arm64"
fi
date
echo "${VERSION_MESSAGE}"
echo "Running on: ${SYSTEM_BUILDER}: `uname -r`"
}
setup_buildd () {
if [ ! -d /build/buildd/ ] ; then
sudo mkdir -p /build/buildd/
sudo chown -R ${chroot_user}:${chroot_user} /build/buildd/
fi
if [ ! -d "${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/" ] ; then
sudo mkdir -p ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/
sudo chown -R ${chroot_user}:${chroot_user} ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/
fi
cd /build/buildd/
}
cleanup_schroot () {
cd /build/buildd/
echo "***schroot***"
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ls -1
echo "*************"
echo "***beagle***"
ls -1
echo "*************"
echo "Cleaning up schroot"
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- rm defconfig >/dev/null 2>&1
rm -f ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/linux-*.buildinfo || true >/dev/null 2>&1
rm -f ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/linux-*.changes || true >/dev/null 2>&1
#old...
rm -f ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/linux-*.dsc || true >/dev/null 2>&1
rm -f ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/linux-*.debian.tar.gz || true >/dev/null 2>&1
rm -f ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/linux-*.orig.tar.gz || true >/dev/null 2>&1
rm -rf ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/linux-src/ || true >/dev/null 2>&1
rm -f ./*.deb >/dev/null 2>&1 || true
rm -f ./*.diff >/dev/null 2>&1 || true
rm -f ./*.diff.gz >/dev/null 2>&1 || true
rm -f ./*.tar.gz >/dev/null 2>&1 || true
rm -rf /build/buildd/linux-src/ >/dev/null 2>&1 || true
echo "***schroot***"
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ls -1
echo "*************"
echo "***beagle***"
ls -1
echo "*************"
}
update_schroot () {
echo "Updating schroot"
MIRROR="proxy.gfnd.rcn-ee.org:3142"
if [ -f /var/chroot/${release}-${dpkg_arch}/etc/apt/apt.conf ] ; then
sudo rm -rf /var/chroot/${release}-${dpkg_arch}/etc/apt/apt.conf
echo "Acquire::http::Proxy \"http://${MIRROR}/\";" | sudo tee -a /var/chroot/${release}-${dpkg_arch}/etc/apt/apt.conf
echo "Acquire::PDiffs \"false\";" | sudo tee -a /var/chroot/${release}-${dpkg_arch}/etc/apt/apt.conf
fi
echo "add bash to /bin/sh symlink..."
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- sudo ln -sf bash /bin/sh
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- sudo dpkg --configure -a >/dev/null 2>&1
#schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- sudo apt-get update -o Acquire::Pdiffs=false >/dev/null 2>&1
if [ "x${release}" = "xxenial" ] || [ "x${release}" = "xbionic" ] || [ "x${release}" = "xstretch" ] ; then
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- sudo apt-get -y install aptitude apt bash libssl-dev u-boot-tools cpio kmod rsync
else
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- sudo apt-get -y install aptitude apt bash libssl-dev u-boot-tools cpio kmod rsync lz4
fi
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- sudo aptitude update >/dev/null 2>&1
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- sudo aptitude -y --allow-untrusted safe-upgrade
if [ "x${release}" = "xfocal" ] || [ "x${release}" = "xbuster" ] ; then
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- sudo aptitude -y --full-resolver safe-upgrade
fi
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- sudo apt-get clean >/dev/null 2>&1
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- gcc -v
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- sudo ln -sf bash /bin/sh
echo "*************"
}
disable_module_lz4 () {
echo "BUG: LZ4: No binary: /usr/bin/lz4, switching back to lzo"
sed -i -e 's:CONFIG_KERNEL_LZ4=y:# CONFIG_KERNEL_LZ4 is not set:g' ${chroot_defconfig}
sed -i -e 's:# CONFIG_KERNEL_LZO is not set:CONFIG_KERNEL_LZO=y:g' ${chroot_defconfig}
}
config_test_builtin () {
chroot_defconfig="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/defconfig"
unset config_set
unset test_config
test_config=$(grep "${config}=y" ${chroot_defconfig} || true)
if [ "x${test_config}" = "x${config}=y" ] ; then
config_set="set"
fi
}
http_dl_patch () {
#Kernel Build Patch
${wget_dl} ${local_http}/${KERNEL_TAG}${BUILD}/patch-${KERNEL_TAG}${BUILD}.diff
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ${wget_dl} ${local_http}/${KERNEL_TAG}${BUILD}/defconfig
if [ ! -f /usr/bin/lz4 ] ; then
config="CONFIG_KERNEL_LZ4"
config_test_builtin
if [ "x${config_set}" = "xset" ] ; then
disable_module_lz4
fi
fi
}
git_pull () {
echo "fetching stable"
echo "git fetch git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git --tags"
git fetch git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git --tags || true
echo "pulling from kernel.org"
echo "git pull git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master --tags"
git pull git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master --tags || true
}
git_dl_kernel () {
echo "Fetching from git"
cd /build/buildd/
if [ ! -d /build/buildd/linux-src ] ; then
mkdir -p /build/buildd/linux-src
fi
if [ ! -d "${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/linux-src" ] ; then
mkdir -p ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/linux-src
fi
# if [ ! -f /home/${chroot_user}/git_repo/linux/.git/config ] ; then
# mkdir -p /home/${chroot_user}/git_repo/ || true
# cd /home/${chroot_user}/git_repo/
# echo "git clone ssh://[email protected]:2350/linux.git"
# git clone ssh://[email protected]:2350/linux.git || true
# fi
if [ ! -f /home/${chroot_user}/git_repo/linux/.git/config ] ; then
mkdir -p /home/${chroot_user}/git_repo/ || true
cd /home/${chroot_user}/git_repo/
echo "git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git || true
fi
echo "git: /home/${chroot_user}/git_repo/linux"
cd /home/${chroot_user}/git_repo/linux
git remote set-url origin git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote -v
git reset --hard HEAD
git checkout master -f || true
if [ -f .git/gc.log ] ; then
echo "*************"
echo `cat .git/gc.log`
echo "*************"
rm .git/gc.log || true
fi
git config gc.auto 0
git config --global gc.auto 0
git pull || true
git fetch --tags || true
git_pull
echo "git: ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/linux-src"
cd ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/linux-src
git clone --shared /home/${chroot_user}/git_repo/linux ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/linux-src
git reset --hard HEAD
git checkout master -f
git tag | grep v${KERNEL_TAG} | grep -v rc >/dev/null 2>&1 || git_pull
echo "git checkout v${KERNEL_TAG} -b v${KERNEL_TAG}${BUILD}"
git checkout v${KERNEL_TAG} -b v${KERNEL_TAG}${BUILD}
git describe
echo "git apply -v /build/buildd/patch-${KERNEL_TAG}${BUILD}.diff"
ls -lha /build/buildd/patch-${KERNEL_TAG}${BUILD}.diff
git apply -v /build/buildd/patch-${KERNEL_TAG}${BUILD}.diff
}
exit_fail () {
touch /tmp/FAILED
exit
}
build_kernel () {
unset buildopts
echo "make ARCH=${KERNEL_ARCH} CROSS_COMPILE= distclean"
cd /build/buildd/linux-src
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- make ARCH=${KERNEL_ARCH} CROSS_COMPILE= distclean
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- cp -v /build/buildd/defconfig .config
if [ "x${use_fakeroot}" = "xyes" ] ; then
MAKE_DEB_PKG="fakeroot make -j5 ARCH=${KERNEL_ARCH}"
else
MAKE_DEB_PKG="make -j5 ARCH=${KERNEL_ARCH}"
fi
MAKE_DEB_PKG="${MAKE_DEB_PKG} ${buildopts} LOCALVERSION=${BUILD} CROSS_COMPILE= "
MAKE_DEB_PKG="${MAKE_DEB_PKG} KDEB_PKGVERSION=1${release} KDEB_SOURCENAME=linux-upstream"
MAKE_DEB_PKG="${MAKE_DEB_PKG} KBUILD_DEBARCH=${dpkg_arch} [email protected]"
if [ -f "${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/linux-src/scripts/Makefile.package" ] ; then
MAKE_DEB_PKG="${MAKE_DEB_PKG} DEBFULLNAME=rcn-ee bindeb-pkg"
else
if grep -q bindeb-pkg "${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/linux-src/scripts/package/Makefile"; then
MAKE_DEB_PKG="${MAKE_DEB_PKG} DEBFULLNAME=rcn-ee bindeb-pkg"
else
MAKE_DEB_PKG="${MAKE_DEB_PKG} DEBFULLNAME=rcn-ee deb-pkg"
fi
fi
echo "_______________"
echo "${MAKE_DEB_PKG}"
time schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ${MAKE_DEB_PKG}
if [ -f ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/linux-src/include/generated/utsrelease.h ] ; then
uname_r=$(cat ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/linux-src/include/generated/utsrelease.h | awk '{print $3}' | sed 's/\"//g' )
else
#just reboot, something wrong...
sudo reboot
fi
echo "_______________"
MAKE_DTBS="fakeroot make -j1 ARCH=${KERNEL_ARCH} ${buildopts} LOCALVERSION=${BUILD} CROSS_COMPILE= dtbs"
echo "${MAKE_DTBS}"
time schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ${MAKE_DTBS}
if [ -d /tmp/dtbs ] ; then
sudo rm -rf /tmp/dtbs || true
fi
mkdir -p /tmp/dtbs
echo "_______________"
find ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/linux-src/arch/${KERNEL_ARCH}/boot/ -iname "*.dtb" -exec cp -v '{}' /tmp/dtbs/ \;
cd /tmp/dtbs
echo "Building ${uname_r}-dtbs.tar.gz"
tar czf /build/buildd/${uname_r}-dtbs.tar.gz *
cd -
cd ..
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ls -1
cd /build/buildd/
mv ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/*.deb /build/buildd/ || exit_fail
echo "***builder***"
ls -1
}
generic_upload () {
if [ -f ${file_upload} ] ; then
echo ""
echo "uploading: ${file_upload}"
if [ -d /mnt/mirror/deb/ ] ; then
if [ ! -d /mnt/mirror/deb/${release}-${dpkg_arch}/ ] ; then
mkdir -p /mnt/mirror/deb/${release}-${dpkg_arch}/ || true
fi
if [ ! -d /mnt/mirror/deb/${release}-${dpkg_arch}/${FTPDIR}/ ] ; then
mkdir -p /mnt/mirror/deb/${release}-${dpkg_arch}/${FTPDIR}/ || true
fi
cp -v ${file_upload} /mnt/mirror/deb/${release}-${dpkg_arch}/${FTPDIR}/
sync
rm ${file_upload} >/dev/null 2>&1 || true
sleep 10
fi
else
echo ""
echo "Warn: [${file_upload}] was not built"
fi
}
cleanup_third_party () {
if [ -d /build/buildd/${package} ] ; then
rm -rf /build/buildd/${package} || true
fi
if [ -d ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package} ] ; then
rm -rf ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package} || true
fi
}
build_third_party () {
cleanup_third_party
cd ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/
git clone https://github.com/rcn-ee/${package}.git
cd ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}
git checkout origin/${git_branch} -b tmp
cd /build/buildd/
git clone https://github.com/rcn-ee/${package}.git
cd /build/buildd/${package}
git checkout origin/${git_branch} -b tmp
cd /build/buildd/${package}/src/
}
third_party_old_sgx () {
#make sure the module was built
file_upload="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/src/gfx_rel_${es}.x/pvrsrvkm.ko"
if [ -f ${file_upload} ] ; then
d_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/"
base_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/"
#modules
cp -v ${base_dir}src/gfx_rel_${es}.x/pvrsrvkm.ko ${base_dir}
cp -v ${base_dir}src/gfx_rel_${es}.x/omaplfb.ko ${base_dir}
cp -v ${base_dir}src/gfx_rel_${es}.x/bufferclass_ti.ko ${base_dir}
#readme
cp -v ${base_dir}src/GFX_Linux_KM/README ${base_dir}
echo "Section: misc" > ${base_dir}control
echo "Priority: optional" >> ${base_dir}control
echo "Homepage: https://github.com/rcn-ee/${package}" >> ${base_dir}control
echo "Standards-Version: 3.9.7" >> ${base_dir}control
echo "" >> ${base_dir}control
echo "Package: ${package}-${es}-modules-${uname_r}" >> ${base_dir}control
echo "Version: 1${release}" >> ${base_dir}control
echo "Pre-Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Maintainer: Robert Nelson <[email protected]>" >> ${base_dir}control
echo "Architecture: ${dpkg_arch}" >> ${base_dir}control
echo "Readme: README" >> ${base_dir}control
echo "Files: pvrsrvkm.ko /lib/modules/${uname_r}/extra/${es}.x/" >> ${base_dir}control
echo " omaplfb.ko /lib/modules/${uname_r}/extra/${es}.x/" >> ${base_dir}control
echo " bufferclass_ti.ko /lib/modules/${uname_r}/extra/${es}.x/" >> ${base_dir}control
echo "Description: ${package} ${es} modules" >> ${base_dir}control
echo " Kernel modules for ${package} ${es} devices" >> ${base_dir}control
echo "" >> ${base_dir}control
cd /build/buildd/${package}/
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- equivs-build control
file_upload="${d_dir}/${package}/${package}-${es}-modules-${uname_r}_1${release}_${dpkg_arch}.deb"
generic_upload
fi
}
third_party_sgx () {
#1.14.3699939
#make sure the module was built
file_upload="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/src/src/eurasia_km/eurasiacon/binary2_omap_linux_release/target/kbuild/pvrsrvkm.ko"
if [ -f ${file_upload} ] ; then
d_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/"
base_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/"
#modules
cp -v ${base_dir}/src/src/eurasia_km/eurasiacon/binary2_omap_linux_release/target/kbuild/pvrsrvkm.ko ${base_dir}
cp -v ${base_dir}/src/src/eurasia_km/eurasiacon/binary2_omap_linux_release/target/kbuild/bc_example.ko ${base_dir}
#readme
cp -v ${base_dir}/src/src/eurasia_km/README ${base_dir}
cp -v ${base_dir}/src/src/eurasia_km/MIT-COPYING ${base_dir}
echo "Section: misc" > ${base_dir}control
echo "Priority: optional" >> ${base_dir}control
echo "Homepage: https://github.com/rcn-ee/${package}" >> ${base_dir}control
echo "Standards-Version: 3.9.7" >> ${base_dir}control
echo "" >> ${base_dir}control
echo "Package: ${real_package}-${device}-modules-${uname_r}" >> ${base_dir}control
echo "Version: 1${release}" >> ${base_dir}control
echo "Pre-Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Maintainer: Robert Nelson <[email protected]>" >> ${base_dir}control
echo "Architecture: ${dpkg_arch}" >> ${base_dir}control
echo "Copyright: MIT-COPYING" >> ${base_dir}control
echo "Readme: README" >> ${base_dir}control
echo "Files: pvrsrvkm.ko /lib/modules/${uname_r}/extra/${device}/" >> ${base_dir}control
echo " bc_example.ko /lib/modules/${uname_r}/extra/${device}/" >> ${base_dir}control
echo "Description: ${real_package} modules" >> ${base_dir}control
echo " Kernel modules for ${real_package} devices" >> ${base_dir}control
echo "" >> ${base_dir}control
cd /build/buildd/${package}/
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- equivs-build control
file_upload="${d_dir}/${package}/${real_package}-${device}-modules-${uname_r}_1${release}_${dpkg_arch}.deb"
generic_upload
fi
#1.17.4948957
#make sure the module was built
file_upload="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/src/src/eurasia_km/eurasiacon/binary_omap_linux_xorg_release/target_armhf/kbuild/pvrsrvkm.ko"
if [ -f ${file_upload} ] ; then
d_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/"
base_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/"
#modules
cp -v ${base_dir}/src/src/eurasia_km/eurasiacon/binary_omap_linux_xorg_release/target_armhf/kbuild/pvrsrvkm.ko ${base_dir}
#readme
cp -v ${base_dir}/src/src/eurasia_km/README ${base_dir}
cp -v ${base_dir}/src/src/eurasia_km/MIT-COPYING ${base_dir}
echo "Section: misc" > ${base_dir}control
echo "Priority: optional" >> ${base_dir}control
echo "Homepage: https://github.com/rcn-ee/${package}" >> ${base_dir}control
echo "Standards-Version: 3.9.7" >> ${base_dir}control
echo "" >> ${base_dir}control
echo "Package: ${real_package}-${device}-modules-${uname_r}" >> ${base_dir}control
echo "Version: 1${release}" >> ${base_dir}control
echo "Pre-Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Maintainer: Robert Nelson <[email protected]>" >> ${base_dir}control
echo "Architecture: ${dpkg_arch}" >> ${base_dir}control
echo "Copyright: MIT-COPYING" >> ${base_dir}control
echo "Readme: README" >> ${base_dir}control
echo "Files: pvrsrvkm.ko /lib/modules/${uname_r}/extra/${device}/" >> ${base_dir}control
echo "Description: ${real_package} modules" >> ${base_dir}control
echo " Kernel modules for ${real_package} devices" >> ${base_dir}control
echo "" >> ${base_dir}control
cd /build/buildd/${package}/
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- equivs-build control
file_upload="${d_dir}/${package}/${real_package}-${device}-modules-${uname_r}_1${release}_${dpkg_arch}.deb"
generic_upload
fi
}
third_party () {
file_dir="https://rcn-ee.com/deb/${release}-${dpkg_arch}/${FTPDIR}/"
if [ "x${SUBARCH}" = "xomap-psp" ] || [ "x${SUBARCH}" = "xbone-rt" ] || [ "x${SUBARCH}" = "xti" ] || [ "x${SUBARCH}" = "xti-rt" ] || [ "x${SUBARCH}" = "xti-xenomai" ] ; then
mainline=$(cat /mnt/mirror/deb/${release}-${dpkg_arch}/${FTPDIR}/defconfig | grep 'CONFIG_MT7601U=m')
if [ "x${mainline}" = "x" ] ; then
package="mt7601u"
git_branch="master"
build_third_party
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build.sh
#make sure the module was built
file_upload="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/src/os/linux/mt7601Usta.ko"
if [ -f ${file_upload} ] ; then
d_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd"
base_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/"
cp -v ${base_dir}src/os/linux/mt7601Usta.ko ${base_dir}
# cp -v ${base_dir}src/RT2870STA.dat ${base_dir}
cp -v ${base_dir}src/README_STA_usb ${base_dir}
# echo "mt7601Usta" > ${base_dir}mt7601.conf
echo "Section: misc" > ${base_dir}control
echo "Priority: optional" >> ${base_dir}control
echo "Homepage: https://github.com/rcn-ee/${package}" >> ${base_dir}control
echo "Standards-Version: 3.9.7" >> ${base_dir}control
echo "" >> ${base_dir}control
echo "Package: ${package}-modules-${uname_r}" >> ${base_dir}control
echo "Version: 1${release}" >> ${base_dir}control
echo "Pre-Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Maintainer: Robert Nelson <[email protected]>" >> ${base_dir}control
echo "Architecture: ${dpkg_arch}" >> ${base_dir}control
echo "Readme: README_STA_usb" >> ${base_dir}control
echo "Files: mt7601Usta.ko /lib/modules/${uname_r}/kernel/drivers/net/wireless/" >> ${base_dir}control
# echo " RT2870STA.dat /etc/Wireless/RT2870STA/" >> ${base_dir}control
# echo " mt7601.conf /etc/modules-load.d/" >> ${base_dir}control
echo "Description: ${package} modules" >> ${base_dir}control
echo " Kernel modules for ${package} devices" >> ${base_dir}control
echo "" >> ${base_dir}control
cd /build/buildd/${package}/
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- equivs-build control
file_upload="${d_dir}/${package}/${package}-modules-${uname_r}_1${release}_${dpkg_arch}.deb"
generic_upload
fi
cleanup_third_party
fi
fi
if [ "x${SUBARCH}" = "xomap-psp" ] || [ "x${SUBARCH}" = "xbone-rt" ] || [ "x${SUBARCH}" = "xti" ] || [ "x${SUBARCH}" = "xti-rt" ] || [ "x${SUBARCH}" = "xti-xenomai" ] ; then
#Not till Mainline Supports AP mode...
#mainline=$(cat /mnt/mirror/deb/${release}-${dpkg_arch}/${FTPDIR}/defconfig | grep 'CONFIG_TCP_CONG_BBR=m')
unset mainline
if [ "x${mainline}" = "x" ] ; then
package="rtl8723bu"
git_branch="master"
build_third_party
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build.sh
#make sure the module was built
file_upload="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/src/8723bu.ko"
if [ -f ${file_upload} ] ; then
d_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd"
base_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/"
cp -v ${base_dir}src/8723bu.ko ${base_dir}
cp -v ${base_dir}src/README.md ${base_dir}
echo "Section: misc" > ${base_dir}control
echo "Priority: optional" >> ${base_dir}control
echo "Homepage: https://github.com/rcn-ee/${package}" >> ${base_dir}control
echo "Standards-Version: 3.9.7" >> ${base_dir}control
echo "" >> ${base_dir}control
echo "Package: ${package}-modules-${uname_r}" >> ${base_dir}control
echo "Version: 1${release}" >> ${base_dir}control
echo "Pre-Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Maintainer: Robert Nelson <[email protected]>" >> ${base_dir}control
echo "Architecture: ${dpkg_arch}" >> ${base_dir}control
echo "Readme: README.md" >> ${base_dir}control
echo "Files: 8723bu.ko /lib/modules/${uname_r}/kernel/drivers/net/wireless/" >> ${base_dir}control
echo "Description: ${package} modules" >> ${base_dir}control
echo " Kernel modules for ${package} devices" >> ${base_dir}control
echo "" >> ${base_dir}control
cd /build/buildd/${package}/
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- equivs-build control
file_upload="${d_dir}/${package}/${package}-modules-${uname_r}_1${release}_${dpkg_arch}.deb"
generic_upload
fi
cleanup_third_party
fi
unset mainline
if [ "x${mainline}" = "x" ] ; then
package="rtl8821cu"
git_branch="master"
build_third_party
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build.sh
#make sure the module was built
file_upload="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/src/8821cu.ko"
if [ -f ${file_upload} ] ; then
d_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd"
base_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/"
cp -v ${base_dir}src/8821cu.ko ${base_dir}
cp -v ${base_dir}src/README.md ${base_dir}
echo "Section: misc" > ${base_dir}control
echo "Priority: optional" >> ${base_dir}control
echo "Homepage: https://github.com/rcn-ee/${package}" >> ${base_dir}control
echo "Standards-Version: 3.9.7" >> ${base_dir}control
echo "" >> ${base_dir}control
echo "Package: ${package}-modules-${uname_r}" >> ${base_dir}control
echo "Version: 1${release}" >> ${base_dir}control
echo "Pre-Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Maintainer: Robert Nelson <[email protected]>" >> ${base_dir}control
echo "Architecture: ${dpkg_arch}" >> ${base_dir}control
echo "Readme: README.md" >> ${base_dir}control
echo "Files: 8821cu.ko /lib/modules/${uname_r}/kernel/drivers/net/wireless/" >> ${base_dir}control
echo "Description: ${package} modules" >> ${base_dir}control
echo " Kernel modules for ${package} devices" >> ${base_dir}control
echo "" >> ${base_dir}control
cd /build/buildd/${package}/
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- equivs-build control
file_upload="${d_dir}/${package}/${package}-modules-${uname_r}_1${release}_${dpkg_arch}.deb"
generic_upload
fi
cleanup_third_party
fi
unset mainline
if [ "x${mainline}" = "x" ] ; then
package="libpruio"
git_branch="master"
build_third_party
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build.sh
#make sure the module was built
file_upload="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/src/libpruio.ko"
if [ -f ${file_upload} ] ; then
d_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd"
base_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/"
cp -v ${base_dir}src/libpruio.ko ${base_dir}
cp -v ${base_dir}src/ReadMe.md ${base_dir}
echo "Section: misc" > ${base_dir}control
echo "Priority: optional" >> ${base_dir}control
echo "Homepage: https://github.com/rcn-ee/${package}" >> ${base_dir}control
echo "Standards-Version: 3.9.7" >> ${base_dir}control
echo "" >> ${base_dir}control
echo "Package: ${package}-modules-${uname_r}" >> ${base_dir}control
echo "Version: 1${release}" >> ${base_dir}control
echo "Pre-Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Maintainer: Robert Nelson <[email protected]>" >> ${base_dir}control
echo "Architecture: ${dpkg_arch}" >> ${base_dir}control
echo "Readme: ReadMe.md" >> ${base_dir}control
echo "Files: libpruio.ko /lib/modules/${uname_r}/extra/" >> ${base_dir}control
echo "Description: ${package} modules" >> ${base_dir}control
echo " Kernel modules for ${package} devices" >> ${base_dir}control
echo "" >> ${base_dir}control
cd /build/buildd/${package}/
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- equivs-build control
file_upload="${d_dir}/${package}/${package}-modules-${uname_r}_1${release}_${dpkg_arch}.deb"
generic_upload
fi
cleanup_third_party
fi
fi
if [ "x${SUBARCH}" = "xomap-psp" ] || [ "x${SUBARCH}" = "xbone-rt" ] ; then
package="ti-sgx"
git_branch="ti-5.01.01.02"
build_third_party
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build-es8.sh
es="es8"
third_party_old_sgx
cleanup_third_party
fi
if [ "x${SUBARCH}" = "xomap-psp" ] || [ "x${SUBARCH}" = "xbone-rt" ] ; then
package="ti-sgx"
git_branch="ti-5.01.01.02"
build_third_party
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build-es9.sh
es="es9"
third_party_old_sgx
cleanup_third_party
fi
if [ "x${SUBARCH}" = "xti" ] || [ "x${SUBARCH}" = "xti-rt" ] || [ "x${SUBARCH}" = "xti-xenomai" ] ; then
package="ti-sgx-omap5"
real_package="ti-sgx"
git_branch="master"
build_third_party
if [ "x${LATEST}" = "xlts414" ] ; then
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build-ti335x-4.14.x.sh
elif [ "x${LATEST}" = "xlts419" ] ; then
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build-ti335x-4.19.x.sh
elif [ "x${LATEST}" = "xlts54" ] ; then
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build-ti335x-4.19.x.sh
else
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build-ti335x-4.19.x.sh
fi
device="ti335x"
third_party_sgx
cleanup_third_party
fi
if [ "x${SUBARCH}" = "xti" ] || [ "x${SUBARCH}" = "xti-rt" ] || [ "x${SUBARCH}" = "xti-xenomai" ] ; then
package="ti-sgx-omap5"
real_package="ti-sgx"
git_branch="master"
build_third_party
if [ "x${LATEST}" = "xlts414" ] ; then
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build-ti437x-4.14.x.sh
elif [ "x${LATEST}" = "xlts419" ] ; then
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build-ti437x-4.19.x.sh
elif [ "x${LATEST}" = "xlts54" ] ; then
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build-ti437x-4.19.x.sh
else
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build-ti437x-4.19.x.sh
fi
device="ti437x"
third_party_sgx
cleanup_third_party
fi
if [ "x${SUBARCH}" = "xti" ] || [ "x${SUBARCH}" = "xti-rt" ] || [ "x${SUBARCH}" = "xti-xenomai" ] ; then
package="ti-sgx-omap5"
real_package="ti-sgx"
git_branch="master"
build_third_party
if [ "x${LATEST}" = "xlts414" ] ; then
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build-jacinto6evm-4.14.x.sh
elif [ "x${LATEST}" = "xlts419" ] ; then
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build-jacinto6evm-4.19.x.sh
elif [ "x${LATEST}" = "xlts54" ] ; then
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build-jacinto6evm-4.19.x.sh
else
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build-jacinto6evm-4.19.x.sh
fi
device="jacinto6evm"
third_party_sgx
cleanup_third_party
fi
if [ "x${SUBARCH}" = "xti" ] || [ "x${SUBARCH}" = "xti-rt" ] || [ "x${SUBARCH}" = "xti-xenomai" ] ; then
#Classic 4.15.00.02
package="ti-cmem"
git_branch="master"
build_third_party
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build.sh
#make sure the module was built
file_upload="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/src/src/src/cmem/module/cmemk.ko"
if [ -f ${file_upload} ] ; then
d_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd"
base_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/"
cp -v ${base_dir}src/src/src/cmem/module/cmemk.ko ${base_dir}
cp -v ${base_dir}src/src/src/cmem/README ${base_dir}
echo "Section: misc" > ${base_dir}control
echo "Priority: optional" >> ${base_dir}control
echo "Homepage: https://github.com/rcn-ee/${package}" >> ${base_dir}control
echo "Standards-Version: 3.9.7" >> ${base_dir}control
echo "" >> ${base_dir}control
echo "Package: ${package}-modules-${uname_r}" >> ${base_dir}control
echo "Version: 1${release}" >> ${base_dir}control
echo "Pre-Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Maintainer: Robert Nelson <[email protected]>" >> ${base_dir}control
echo "Architecture: ${dpkg_arch}" >> ${base_dir}control
echo "Readme: README" >> ${base_dir}control
echo "Files: cmemk.ko /lib/modules/${uname_r}/extra/" >> ${base_dir}control
echo "Description: ${package} modules" >> ${base_dir}control
echo " Kernel modules for ${package} devices" >> ${base_dir}control
echo "" >> ${base_dir}control
cd /build/buildd/${package}/
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- equivs-build control
file_upload="${d_dir}/${package}/${package}-modules-${uname_r}_1${release}_${dpkg_arch}.deb"
generic_upload
fi
cleanup_third_party
package="ti-cmem"
cmem_api="4.15.00.02"
git_branch="master"
build_third_party
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build-${cmem_api}.sh
#make sure the module was built
file_upload="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/src/src/src/cmem/module/cmemk.ko"
if [ -f ${file_upload} ] ; then
d_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd"
base_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/"
cp -v ${base_dir}src/src/src/cmem/module/cmemk.ko ${base_dir}
cp -v ${base_dir}src/src/src/cmem/README ${base_dir}
echo "Section: misc" > ${base_dir}control
echo "Priority: optional" >> ${base_dir}control
echo "Homepage: https://github.com/rcn-ee/${package}" >> ${base_dir}control
echo "Standards-Version: 3.9.7" >> ${base_dir}control
echo "" >> ${base_dir}control
echo "Package: ${package}-${cmem_api}-modules-${uname_r}" >> ${base_dir}control
echo "Version: 1${release}" >> ${base_dir}control
echo "Pre-Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Maintainer: Robert Nelson <[email protected]>" >> ${base_dir}control
echo "Architecture: ${dpkg_arch}" >> ${base_dir}control
echo "Readme: README" >> ${base_dir}control
echo "Files: cmemk.ko /lib/modules/${uname_r}/extra/" >> ${base_dir}control
echo "Description: ${package} modules" >> ${base_dir}control
echo " Kernel modules for ${package} devices" >> ${base_dir}control
echo "" >> ${base_dir}control
cd /build/buildd/${package}/
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- equivs-build control
file_upload="${d_dir}/${package}/${package}-${cmem_api}-modules-${uname_r}_1${release}_${dpkg_arch}.deb"
generic_upload
fi
cleanup_third_party
package="ti-cmem"
cmem_api="4.16.00.00"
git_branch="master"
build_third_party
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build-${cmem_api}.sh
#make sure the module was built
file_upload="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/src/src/src/cmem/module/cmemk.ko"
if [ -f ${file_upload} ] ; then
d_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd"
base_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/"
cp -v ${base_dir}src/src/src/cmem/module/cmemk.ko ${base_dir}
cp -v ${base_dir}src/src/src/cmem/README ${base_dir}
echo "Section: misc" > ${base_dir}control
echo "Priority: optional" >> ${base_dir}control
echo "Homepage: https://github.com/rcn-ee/${package}" >> ${base_dir}control
echo "Standards-Version: 3.9.7" >> ${base_dir}control
echo "" >> ${base_dir}control
echo "Package: ${package}-${cmem_api}-modules-${uname_r}" >> ${base_dir}control
echo "Version: 1${release}" >> ${base_dir}control
echo "Pre-Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Maintainer: Robert Nelson <[email protected]>" >> ${base_dir}control
echo "Architecture: ${dpkg_arch}" >> ${base_dir}control
echo "Readme: README" >> ${base_dir}control
echo "Files: cmemk.ko /lib/modules/${uname_r}/extra/" >> ${base_dir}control
echo "Description: ${package} modules" >> ${base_dir}control
echo " Kernel modules for ${package} devices" >> ${base_dir}control
echo "" >> ${base_dir}control
cd /build/buildd/${package}/
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- equivs-build control
file_upload="${d_dir}/${package}/${package}-${cmem_api}-modules-${uname_r}_1${release}_${dpkg_arch}.deb"
generic_upload
fi
cleanup_third_party
fi
#Seeed Modules
if [ "x${SUBARCH}" = "xti" ] || [ "x${SUBARCH}" = "xti-rt" ] || [ "x${SUBARCH}" = "xti-xenomai" ] ; then
package="seeed-linux-dtverlays"
git_branch="master"
build_third_party
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- ../build.sh
#make sure the module was built
file_upload="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/src/src/modules/p9813/p9813.ko"
if [ -f ${file_upload} ] ; then
d_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd"
base_dir="${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/${package}/"
cp -v ${base_dir}src/src/modules/p9813/p9813.ko ${base_dir}
cp -v ${base_dir}src/src/modules/vl53l0x/vl53l0x.ko ${base_dir}
cp -v ${base_dir}src/src/modules/sht3x/sht3x.ko ${base_dir}
cp -v ${base_dir}src/src/modules/mpr121/mpr121_touchkey.ko ${base_dir}
cp -v ${base_dir}src/src/modules/mpr121/mpr121.ko ${base_dir}
cp -v ${base_dir}src/src/modules/lis3lv02d/lis331dlh-i2c.ko ${base_dir}
cp -v ${base_dir}src/src/modules/hcsr04/hcsr04.ko ${base_dir}
cp -v ${base_dir}src/src/modules/mcp25xxfd/mcp25xxfd-can.ko ${base_dir}
cp -v ${base_dir}src/src/modules/hd44780/hd44780.ko ${base_dir}
cp -v ${base_dir}src/src/modules/bme280/bme280.ko ${base_dir}
cp -v ${base_dir}src/src/modules/e-ink/eink-tty.ko ${base_dir}
cp -v ${base_dir}src/src/modules/adxl34x/adxl34x.ko ${base_dir}
cp -v ${base_dir}src/src/modules/adxl34x/adxl34x-i2c.ko ${base_dir}
cp -v ${base_dir}src/src/modules/gt9xx/touch-gt9xx.ko ${base_dir}
cp -v ${base_dir}src/src/modules/seeed-voicecard/snd-soc-ac108.ko ${base_dir}
cp -v ${base_dir}src/src/modules/seeed-voicecard/snd-soc-seeed-voicecard.ko ${base_dir}
cp -v ${base_dir}src/src/modules/seeed-voicecard/snd-soc-wm8960.ko ${base_dir}
cp -v ${base_dir}src/src/readme.md ${base_dir}
echo "Section: misc" > ${base_dir}control
echo "Priority: optional" >> ${base_dir}control
echo "Homepage: https://github.com/Seeed-Studio/seeed-linux-dtverlays" >> ${base_dir}control
echo "Standards-Version: 3.9.7" >> ${base_dir}control
echo "" >> ${base_dir}control
echo "Package: seeed-modules-${uname_r}" >> ${base_dir}control
echo "Version: 1${release}" >> ${base_dir}control
echo "Pre-Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Depends: linux-image-${uname_r}" >> ${base_dir}control
echo "Maintainer: Robert Nelson <[email protected]>" >> ${base_dir}control
echo "Architecture: ${dpkg_arch}" >> ${base_dir}control
echo "Readme: readme.md" >> ${base_dir}control
echo "Files: p9813.ko /lib/modules/${uname_r}/extra/seeed/" >> ${base_dir}control
echo " vl53l0x.ko /lib/modules/${uname_r}/extra/seeed/" >> ${base_dir}control
echo " sht3x.ko /lib/modules/${uname_r}/extra/seeed/" >> ${base_dir}control
echo " mpr121_touchkey.ko /lib/modules/${uname_r}/extra/seeed/" >> ${base_dir}control
echo " mpr121.ko /lib/modules/${uname_r}/extra/seeed/" >> ${base_dir}control
echo " lis331dlh-i2c.ko /lib/modules/${uname_r}/extra/seeed/" >> ${base_dir}control
echo " hcsr04.ko /lib/modules/${uname_r}/extra/seeed/" >> ${base_dir}control
echo " mcp25xxfd-can.ko /lib/modules/${uname_r}/extra/seeed/" >> ${base_dir}control
echo " hd44780.ko /lib/modules/${uname_r}/extra/seeed/" >> ${base_dir}control
echo " bme280.ko /lib/modules/${uname_r}/extra/seeed/" >> ${base_dir}control
echo " eink-tty.ko /lib/modules/${uname_r}/extra/seeed/" >> ${base_dir}control
echo " adxl34x.ko /lib/modules/${uname_r}/extra/seeed/" >> ${base_dir}control
echo " adxl34x-i2c.ko /lib/modules/${uname_r}/extra/seeed/" >> ${base_dir}control
echo " touch-gt9xx.ko /lib/modules/${uname_r}/extra/seeed/" >> ${base_dir}control
echo " snd-soc-ac108.ko /lib/modules/${uname_r}/extra/seeed/" >> ${base_dir}control
echo " snd-soc-seeed-voicecard.ko /lib/modules/${uname_r}/extra/seeed/" >> ${base_dir}control
echo " snd-soc-wm8960.ko /lib/modules/${uname_r}/extra/seeed/" >> ${base_dir}control
echo "Description: seeed modules" >> ${base_dir}control
echo " Kernel modules for seeed devices" >> ${base_dir}control
echo "" >> ${base_dir}control
cd /build/buildd/${package}/
schroot -c ${release}-${dpkg_arch} -u ${chroot_user} -- equivs-build control
file_upload="${d_dir}/${package}/seeed-modules-${uname_r}_1${release}_${dpkg_arch}.deb"
generic_upload
fi
cleanup_third_party
fi
touch /tmp/complete
file_upload="/tmp/complete"
generic_upload
}
kernel_upload () {
#linux-headers-4.6.0-rc2-armv7-devel-r35_1cross_armhf.deb -> upload
#linux-image-4.6.0-rc2-armv7-devel-r35_1cross_armhf.deb -> upload
#linux-image-4.6.0-rc2-armv7-devel-r35-dbg_1cross_armhf.deb -> upload
#linux-libc-dev_1cross_armhf.deb
#linux-upstream_1cross_armhf.changes
#linux-upstream_1cross.debian.tar.gz
#linux-upstream_1cross.dsc
#linux-upstream_4.6.0-rc2-armv7-devel-r35.orig.tar.gz
rm linux-libc-dev*.deb >/dev/null 2>&1 || true
rm linux-*.changes >/dev/null 2>&1 || true
rm linux-*.debian.tar.gz >/dev/null 2>&1 || true
rm linux-*.dsc >/dev/null 2>&1 || true
rm linux-*.orig.tar.gz >/dev/null 2>&1 || true
KERNEL_UPLOAD=$(ls -1 | grep -v dbg | grep linux-image)
FTP_KERNEL_IMG_REL=${KERNEL_UPLOAD/linux-image-}
FTP_KERNEL_IMG_REL=${FTP_KERNEL_IMG_REL/_*_arm*.deb}
FTPDIR=v${FTP_KERNEL_IMG_REL}
file_upload="${KERNEL_UPLOAD}"
generic_upload
if ls -1 /build/buildd/linux-headers*.deb >/dev/null 2>&1;then
file_upload=$(ls -1 | grep linux-headers*.deb)
generic_upload
fi
if ls -1 /build/buildd/linux-image-*-dbg*.deb >/dev/null 2>&1;then
file_upload=$(ls -1 | grep linux-image-*-dbg*.deb)
generic_upload
fi
if [ "x${release}" = "xsid" ] ; then
gzip_patch=$(ls -1 | grep patch-*.diff)
gzip ${gzip_patch}
file_upload=$(ls -1 | grep patch-*.diff.gz)
generic_upload
else
gzip_patch=$(ls -1 | grep patch-*.diff)
xz ${gzip_patch}
file_upload=$(ls -1 | grep patch-*.diff.xz)
generic_upload
fi
mv ${CHROOT_DIR}/${release}-${dpkg_arch}/build/buildd/defconfig /build/buildd/
file_upload="defconfig"
generic_upload
KERNEL_IMG_REL=${KERNEL_UPLOAD/linux-image-}
KERNEL_IMG_REL=${KERNEL_IMG_REL/_*_arm*.deb}
if ls -1 /build/buildd/${uname_r}-dtbs.tar.gz >/dev/null 2>&1;then
file_upload="${uname_r}-dtbs.tar.gz"
generic_upload
fi
if [ "x${LATEST}" = "xunrelease" ] ; then
echo "unrelease"
else
UPDATEFILE="/build/buildd/LATEST-${SUBARCH}"
echo "Updating $LATEST repo..."
if [ -f ${UPDATEFILE} ] ; then
rm -f ${UPDATEFILE} || true
fi
${wget_dl} http://192.168.1.98/rcn-ee.net/deb/${release}-${dpkg_arch}/LATEST-${SUBARCH}
if [ "x${LATEST}" = "xexperimental" ] ; then
ABI="${ABI_EXP}"
elif [ "x${LATEST}" = "xtesting" ] ; then
ABI="${ABI_TEST}"
elif [ "x${LATEST}" = "xstable" ] ; then
ABI="${ABI_STABLE}"
elif [ "x${LATEST}" = "xlts414" ] ; then
ABI="${ABI_LTS414}"
elif [ "x${LATEST}" = "xlts419" ] ; then
ABI="${ABI_LTS419}"
elif [ "x${LATEST}" = "xlts54" ] ; then
ABI="${ABI_LTS54}"
fi
KERNEL_DL=$(cat ${UPDATEFILE} | grep "${ABI}" | awk '{print $3}')
KERNEL_DL_VER=$(echo ${KERNEL_DL} | awk -F'/' '{print $6}')
cat ${UPDATEFILE} | grep -v "${ABI}" > ${UPDATEFILE}-new
rm -f ${UPDATEFILE} || true
mv ${UPDATEFILE}-new ${UPDATEFILE}
echo "${ABI} https://rcn-ee.com/deb/${release}-${dpkg_arch}/${FTPDIR}/install-me.sh" >> ${UPDATEFILE}
echo ""
echo "uploading: LATEST"
cat ${UPDATEFILE}
if [ -d /mnt/mirror/deb ] ; then
if [ ! -d /mnt/mirror/deb/${release}-${dpkg_arch}/ ] ; then
mkdir -p /mnt/mirror/deb/${release}-${dpkg_arch}/ || true
fi
cp -v ${UPDATEFILE} /mnt/mirror/deb/${release}-${dpkg_arch}/
fi
rm ${UPDATEFILE} >/dev/null 2>&1 || true
sleep 10
fi
}
setup_enviroment
setup_buildd
if [ -f /mnt/mirror/.mirror ] ; then
cleanup_schroot
update_schroot
http_dl_patch
git_dl_kernel
build_kernel
if ls -1 /build/buildd/linux-image*.deb | grep -v dbg >/dev/null 2>&1;then
kernel_upload
third_party
else
echo "deb generation failed, review log"
fi
else
echo "nfs failure"
fi
cleanup_schroot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment