pmaports/linux-nokia-rx51/APKBUILD

122 lines
3.1 KiB
Text
Raw Normal View History

2017-06-08 17:27:02 +00:00
# APKBUILD based on linux-vanilla aport. Changes:
# - disabled module installation
# - add !check !tracedeps
# - package: just install zimage and kernel.release, because the kernel config
# does not generate modules or dtb files
# - do not create -dev subpackage (makes no sense without module support)
#
# Kernel config based on: arch/arm/configs/lineageos_mako_defconfig
# Changes:
# - enable devtmpfs (needed for udev -> touch support in weston)
_vendor=nokia
_flavor=nokia-rx51
_hash="7b6fbfd899b4133e4f789843e5967beb139ec4d2"
_config="config-${_flavor}.armhf"
pkgname=linux-${_flavor}
pkgver=4.12.2
2017-06-08 17:27:02 +00:00
case $pkgver in
*.*.*) _kernver=${pkgver%.*};;
*.*) _kernver=$pkgver;;
esac
pkgrel=3
2017-06-08 17:27:02 +00:00
arch="armhf"
pkgdesc="Mainline Linux for the Nokia N900"
url="https://github.com/pali/linux-n900"
depends="postmarketos-mkinitfs"
2017-06-09 21:11:29 +00:00
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev uboot-tools"
2017-06-08 17:27:02 +00:00
options="!strip !check !tracedeps"
install=
source="
https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-"$pkgver".tar.xz
2017-06-08 17:27:02 +00:00
$_config
"
subpackages=""
license="GPL2"
_abi_release=${pkgver}
_carch="arm"
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
ksrcdir="$srcdir/linux-$pkgver"
2017-06-08 17:27:02 +00:00
prepare() {
local _patch_failed=
cd "$ksrcdir"
# first apply patches in specified order
for i in $source; do
case $i in
*.patch)
msg "Applying $i..."
if ! patch -s -p1 -N -i "$srcdir"/$i; then
echo $i >>failed
_patch_failed=1
fi
;;
esac
done
if ! [ -z "$_patch_failed" ]; then
error "The following patches failed:"
cat failed
return 1
fi
mkdir -p "$srcdir"/build
cp "$srcdir"/$_config "$srcdir"/build/.config || return 1
make -C "$ksrcdir" O="$srcdir"/build ARCH="$_carch" HOSTCC="$HOSTCC" \
silentoldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build || return 1
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine" \
2017-06-18 22:05:37 +00:00
CFLAGS_MODULE=-fno-pic \
2017-06-08 17:27:02 +00:00
zImage modules omap3-n900.dtb \
|| return 1
}
package() {
2017-06-09 21:11:29 +00:00
cd "$srcdir/build/arch/arm/boot"
cat zImage dts/omap3-n900.dtb > zImage-dtb
mkimage -A arm -O linux -T kernel -C none -a 80008000 -e 80008000 -n postmarketos -d zImage-dtb uImage
install -Dm644 "$srcdir/build/arch/arm/boot/uImage" \
"$pkgdir/boot/uImage-$_flavor"
2017-06-09 21:11:29 +00:00
install -Dm644 "$srcdir/build/arch/arm/boot/zImage-dtb" \
"$pkgdir/boot/vmlinuz-$_flavor"
2017-06-09 21:11:29 +00:00
install -Dm644 "$srcdir/build/arch/arm/boot/dts/omap3-n900.dtb" \
"$pkgdir/boot/omap3-n900.dtb"
2017-06-08 17:27:02 +00:00
install -D "$srcdir/build/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
cd "$srcdir"/build
make -j1 modules_install \
ARCH="$_carch" \
INSTALL_MOD_PATH="$pkgdir" \
|| return 1
2017-06-08 17:27:02 +00:00
}
sha512sums="683ff447607e1f10af81a539aae8620964173f61fc9fc69b8e108bfdfd49358cc1f5b04a5bd31efcb299f66fac9df2750f92a18ea1b9264a9f0e76d2759b66e9 linux-4.12.2.tar.xz
1a9fc469806b44c9ca4355a9f1ff9cc07c282793bf9bd022acfda26361a51233d9f1ddd14c7f439a13dab28a17b039fa229135aa2c5319e4cc0df1d2d0a14dca config-nokia-rx51.armhf"