devicepkg-dev kernel prepare function

This commit is contained in:
Daniele Debernardi 2018-07-02 00:12:49 +00:00 committed by Oliver Smith
parent bb9ab3a9b3
commit 758c056002
2 changed files with 35 additions and 2 deletions

View file

@ -1,5 +1,5 @@
pkgname="devicepkg-dev"
pkgver=0.2
pkgver=0.3
pkgrel=0
pkgdesc="Provides default device package functions"
url="https://postmarketos.org"
@ -8,6 +8,7 @@ license="MIT"
source="
devicepkg_build.sh
devicepkg_package.sh
downstreamkernel_prepare.sh
"
package() {
@ -15,6 +16,9 @@ package() {
"$pkgdir/usr/bin/devicepkg_build"
install -Dm755 "$srcdir/devicepkg_package.sh" \
"$pkgdir/usr/bin/devicepkg_package"
install -Dm755 "$srcdir/downstreamkernel_prepare.sh" \
"$pkgdir/usr/bin/downstreamkernel_prepare"
}
sha512sums="638d50e6388eabf0da6bf0cff2fe9719ad8a808946f0077228db57fa13a26d9eeb39c1f2689c9a6f93ff9b3bcfdcfb7c358b180bba90e5bba8b9a9e78d25ed18 devicepkg_build.sh
c732792596f56860f6ab9ddd53b9a7a80224400dd20097b20cebe17a6e7330e9178783f09db16132a28a555f83e29ef3643bfe069638b62998912a9a7ffefdc0 devicepkg_package.sh"
c732792596f56860f6ab9ddd53b9a7a80224400dd20097b20cebe17a6e7330e9178783f09db16132a28a555f83e29ef3643bfe069638b62998912a9a7ffefdc0 devicepkg_package.sh
9f240217084215e6a085616ae7dbe4ed7446f9cd4a1ca32631c083a1c74ea380bb8585a32a506491e54db091683bbe7300e94dba3a0d994a580017686386abc8 downstreamkernel_prepare.sh"

View file

@ -0,0 +1,29 @@
#!/bin/sh
srcdir=$1
builddir=$2
_config=$3
_carch=$4
HOSTCC=$5
if [ -z "$srcdir" ] || [ -z "$builddir" ] || [ -z "$_config" ] ||
[ -z "$_carch" ] || [ -z "$HOSTCC" ]; then
echo "ERROR: missing argument!"
echo "Please call downstreamkernel_prepare() with \$srcdir, \$builddir,"
echo "\$_config, \$_carch and \$HOSTCC as arguments."
exit 1
fi
# gcc6 support
cp -v "$srcdir/compiler-gcc6.h" "$builddir/include/linux/"
# Remove -Werror from all makefiles
makefiles="$(find . -type f -name Makefile)
$(find . -type f -name Kbuild)"
for i in $makefiles; do
sed -i 's/-Werror-/-W/g' "$i"
sed -i 's/-Werror//g' "$i"
done
# Prepare kernel config ('yes ""' for kernels lacking olddefconfig)
cp "$srcdir/$_config" "$builddir"/.config
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig