webbbn Posted December 31, 2019 Posted December 31, 2019 As far as I can tell, there is currently no hook to allow patching the out of tree wifi drivers, since they're merged into the kernel source after patching. I was able to add the ability to patch these drivers with just a one line change: Spoiler diff --git a/lib/compilation.sh b/lib/compilation.sh index 7bb90902..ddaf24a8 100644 --- a/lib/compilation.sh +++ b/lib/compilation.sh @@ -293,6 +293,8 @@ compile_kernel() # build 3rd party drivers compilation_prepare + advanced_patch "wifi" "$KERNELPATCHDIR" "$BOARD" "" "$BRANCH" "$LINUXFAMILY-$BRANCH" + # create linux-source package - with already patched sources local sources_pkg_dir=$SRC Would it be possible to add that (or something similar) to the build scripts, or let me know how I can currently add the patches if it's already possible? Thanks!
Igor Posted December 31, 2019 Posted December 31, 2019 Solution is simple and it works. But fragmenting patches further is not what we want to achieve. I would propose to keep this wifi / optional patches as a part of the kernel source and patch it the same way as everything else. Perhaps this way - moving wifi up before major patching? Some wireless patches that are added as patches might need some adjustments. Major one (sunxi-current) is passing. Spoiler diff --git a/lib/compilation.sh b/lib/compilation.sh index 7bb90902..1737d991 100644 --- a/lib/compilation.sh +++ b/lib/compilation.sh @@ -273,25 +273,18 @@ compile_kernel() fi cd "$kerneldir" - # this is a patch that Ubuntu Trusty compiler works - # TODO: Check if still required - if [[ $(patch --dry-run -t -p1 < $SRC/patch/misc/compiler.patch | grep Reversed) != "" ]]; then - display_alert "Patching kernel for compiler support" - patch --batch --silent -t -p1 < $SRC/patch/misc/compiler.patch >> $DEST/debug/output.log 2>&1 - fi - - advanced_patch "kernel" "$KERNELPATCHDIR" "$BOARD" "" "$BRANCH" "$LINUXFAMILY-$BRANCH" + if ! grep -qoE '^-rc[[:digit:]]+' <(grep "^EXTRAVERSION" Makefile | head -1 | awk '{print $(NF)}'); then + sed -i 's/EXTRAVERSION = .*/EXTRAVERSION = /' Makefile + fi + rm -f localversion - if ! grep -qoE '^-rc[[:digit:]]+' <(grep "^EXTRAVERSION" Makefile | head -1 | awk '{print $(NF)}'); then - sed -i 's/EXTRAVERSION = .*/EXTRAVERSION = /' Makefile - fi - rm -f localversion - - # read kernel version - local version=$(grab_version "$kerneldir") + # read kernel version + local version=$(grab_version "$kerneldir") # build 3rd party drivers - compilation_prepare + compilation_prepare + + advanced_patch "kernel" "$KERNELPATCHDIR" "$BOARD" "" "$BRANCH" "$LINUXFAMILY-$BRANCH" # create linux-source package - with already patched sources local sources_pkg_dir=$SRC/.tmp/${CHOSEN_KSRC}_${REVISION}_all Patch includes some cleaning of unneeded code.
Recommended Posts