iglunix/linux/raspberrypi-linux/build.sh

51 lines
1.5 KiB
Bash
Raw Normal View History

2021-12-26 12:40:14 +00:00
pkgver=1.20211007
2021-06-19 14:02:01 +00:00
pkgname=raspberrypi-linux
fetch() {
2021-12-26 12:40:14 +00:00
curl -L "https://github.com/raspberrypi/linux/archive/refs/tags/$pkgver.tar.gz" -o $pkgname-$pkgver.tar.gz
2021-06-19 14:02:01 +00:00
tar -xf $pkgname-$pkgver.tar.gz
2021-09-11 08:24:20 +00:00
mv linux-raspberrypi-kernel_$pkgver $pkgname-$pkgver
2021-06-19 14:02:01 +00:00
cd $pkgname-$pkgver
patch -p1 < ../../kernel-byacc.patch
2021-09-11 08:24:20 +00:00
# patch -p1 < ../../reflex.patch
2021-06-19 14:02:01 +00:00
}
build() {
cd $pkgname-$pkgver
2021-09-11 08:24:20 +00:00
gmake ARCH=arm64 CC=cc HOSTCC=cc LEX=flex YACC=yacc LLVM=1 LLVM_IAS=1 bcm2711_defconfig
gmake ARCH=arm64 CC=cc HOSTCC=cc LEX=flex YACC=yacc LLVM=1 LLVM_IAS=1
2021-06-19 14:02:01 +00:00
}
package() {
cd $pkgname-$pkgver
install -d $pkgdir/boot
2021-06-24 21:10:19 +00:00
cp arch/arm64/boot/Image $pkgdir/boot/kernel8.img
2021-09-11 08:24:20 +00:00
gmake ARCH=arm64 CC=cc HOSTCC=cc LEX=flex YACC=yacc LLVM=1 LLVM_IAS=1 INSTALL_PATH=$pkgdir/boot install
gmake ARCH=arm64 CC=cc HOSTCC=cc LEX=flex YACC=yacc LLVM=1 LLVM_IAS=1 INSTALL_DTBS_PATH=$pkgdir/boot dtbs_install
gmake ARCH=arm64 CC=cc HOSTCC=cc LEX=flex YACC=yacc LLVM=1 LLVM_IAS=1 INSTALL_MOD_PATH=$pkgdir/ modules_install
mv $pkgdir/boot/broadcom/* $pkgdir/boot/
rmdir $pkgdir/boot/broadcom
2021-06-19 14:02:01 +00:00
if stat /usr/bin/rsync 2>/dev/null /dev/null; then
2021-12-26 12:40:14 +00:00
echo "using rsync"
2021-09-11 08:24:20 +00:00
gmake ARCH=arm64 CC=cc HOSTCC=cc LEX=flex YACC=yacc LLVM=1 LLVM_IAS=1 INSTALL_HDR_PATH=$pkgdir/usr headers_install
2021-06-19 14:02:01 +00:00
else
2021-09-11 08:24:20 +00:00
gmake ARCH=arm64 CC=cc HOSTCC=cc LEX=flex YACC=yacc LLVM=1 LLVM_IAS=1 headers
2021-06-19 14:02:01 +00:00
find -name '.*' -exec rm {} \;
rm usr/include/Makefile
2021-12-26 12:40:14 +00:00
install -d $pkgdir/usr/
cp -r usr/include $pkgdir/usr/
2021-06-19 14:02:01 +00:00
fi
}
2021-12-26 12:40:14 +00:00
backup() {
return
}
2021-06-19 14:02:01 +00:00
license() {
cd $pkgname-$pkgver
cat COPYING
}