#!/bin/bash set -e if [[ "$KERNEL_TAG" == "" ]]; then echo "ERROR: Please set the KERNEL_TAG (the mainline KERNEL version is also the git tag) you're building" echo " e.g., KERNEL_TAG=4.9.10 make release" exit 1 fi : ${ARTIFACTS:=$(pwd)/assets} : ${BUILD:=/usr/src} : ${CONFIG:=$(pwd)/config} : ${DIST:=$(pwd)/dist} : ${PATCHES:=$(pwd)/patches} mkdir -p ${DIST}/kernel list_build_files() { find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl find $(find ./arch/${SRCARCH} -name include -o -name scripts -type d) ./include ./scripts -type f find ./arch/${SRCARCH} -name module.lds -o -name Kbuild.platforms -o -name Platform find . -name Module.symvers -type f } create_firmware_tar() { local list=$1 local temp=firmware-temp rm -rf $temp mkdir -p $temp tar xf linux*.tar -C $temp if [ ! -e linux-firmware ]; then git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git fi ( cd linux-firmware git rev-parse HEAD > .git-commit ) echo .git-commit > files for i in $(<$list); do if [ ! -e $temp/lib/firmware/$i ]; then if [ -e linux-firmware/$i ]; then echo Found $i echo $i >> files else echo WARNING: Firmware listed in $list Not found $i fi fi done tar cf firmware.tar --transform 's,^,lib/firmware/,' -C linux-firmware $(