1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 19:19:46 +01:00
build/pkg/linux-rpi3/build
David Oberhollenzer b7fdbc5599 Bump Raspberry Pi 3 kernel version
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-07-15 20:46:32 +02:00

53 lines
2 KiB
Text
Executable file

VERSION="1.20180619-1"
SRCDIR="linux-raspberrypi-kernel_${VERSION}"
TARBALL="raspberrypi-kernel_${VERSION}.tar.gz"
URL="https://github.com/raspberrypi/linux/archive"
SHA256SUM="39b516162f043435cd0373845d7d5d967a2234323f353b3ee0ffe57ed9b9f57e"
DEPENDS="initrd"
prepare() {
return
}
build() {
local INITRDLIST="$PKGDEPLOYDIR/initrd/initrd.list"
export KBUILD_OUTPUT="$PKGBUILDDIR"
make -C "$1" O="$PKGBUILDDIR" ARCH="arm" CROSS_COMPILE="${TARGET}-" mrproper
cat_file_override "linux.config" > "$PKGBUILDDIR/.config"
sed -i "$PKGBUILDDIR/.config" -e 's,^CONFIG_CROSS_COMPILE=.*,CONFIG_CROSS_COMPILE="'$TARGET'-",'
sed -i "$PKGBUILDDIR/.config" -e 's,^CONFIG_INITRAMFS_SOURCE=.*,CONFIG_INITRAMFS_SOURCE="'$INITRDLIST'",'
make -C "$1" O="$PKGBUILDDIR" ARCH="arm" CROSS_COMPILE="${TARGET}-" oldconfig
sed -i "$PKGBUILDDIR/.config" -e 's,^CONFIG_CROSS_COMPILE=.*,CONFIG_CROSS_COMPILE="'$TARGET'-",'
sed -i "$PKGBUILDDIR/.config" -e 's,^CONFIG_INITRAMFS_SOURCE=.*,CONFIG_INITRAMFS_SOURCE="'$INITRDLIST'",'
sed -i "$PKGBUILDDIR/.config" -e 's,^CONFIG_LOCALVERSION=.*,CONFIG_LOCALVERSION="-'${OS_NAME}-${OS_RELEASE}'",'
make -C "$1" O="$PKGBUILDDIR" ARCH="arm" CROSS_COMPILE="${TARGET}-" -j $NUMJOBS zImage dtbs modules
}
deploy() {
local SOURCE="$1"
local DEPLOY="$2"
mkdir -p "$DEPLOY/boot" "$DEPLOY/lib/modules"
cp "arch/arm/boot/zImage" "$DEPLOY/boot/vmlinuz"
export KBUILD_OUTPUT="$PKGBUILDDIR"
make -C "$SOURCE" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" INSTALL_MOD_PATH="$DEPLOY" modules_install
echo "boot/vmlinuz m 555 0 0" > "$DEPLOY/rootfs_files.txt"
find "$DEPLOY/lib" -exec stat {} --printf="%n m %a 0 0\\n" \; | \
sed "s#^$DEPLOY/##g" | sed "s/644/444/g" | \
sed "s/755/555/g" >> "$DEPLOY/rootfs_files.txt"
}
check_update() {
local version=$(echo $VERSION | sed 's/-/./g')
curl --silent -L "https://github.com/raspberrypi/linux/releases" | \
grep -o "raspberrypi-kernel_[0-9.]*-[0-9]" | \
sed 's/raspberrypi-kernel_//g' | sed 's/-/./g' | \
verson_find_greatest "$version"
}