1
0
mirror of https://github.com/rancher/os-kernel.git synced 2025-06-24 04:37:04 +00:00
os-kernel/scripts/build-common

49 lines
1.3 KiB
Bash

#!/bin/bash
set -e
: ${KERNEL_URL:="https://github.com/rancher/linux/archive/Ubuntu-4.2.0-30.36-rancher.tar.gz"}
: ${KERNEL_SHA1:="5a803c07a2c880161dcd37f9cccbfe7e0cf71784"}
: ${ARTIFACTS:=$(pwd)/assets}
: ${BUILD:=/usr/src}
: ${CONFIG:=$(pwd)/config}
: ${DIST:=$(pwd)/dist}
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 Not found $i
fi
fi
done
tar cf firmware.tar --transform 's,^,lib/firmware/,' -C linux-firmware $(<files)
}