2018-07-02 00:12:49 +00:00
|
|
|
#!/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
|
|
|
|
|
2018-10-05 06:02:52 +00:00
|
|
|
# support newer GCC versions
|
|
|
|
cp -v "/usr/share/devicepkg-dev/compiler-gcc.h" "$builddir/include/linux/"
|
2018-07-02 00:12:49 +00:00
|
|
|
|
|
|
|
# Remove -Werror from all makefiles
|
2018-10-10 14:39:15 +00:00
|
|
|
makefiles="$(find "$builddir" -type f -name Makefile)
|
|
|
|
$(find "$builddir" -type f -name Kbuild)"
|
2018-07-02 00:12:49 +00:00
|
|
|
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
|
2018-10-10 14:39:15 +00:00
|
|
|
yes "" | make -C "$builddir" ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
|