kernel build script for latest mainline manjaro kernel

included is a kernel build script, and dependencies debian-based systems (and you can modify for other systems easily... ).

this fetches the tsys/manjaro *v5.7* branch from the manjaro git, applies a config of your choice, preps, builds, and debianizes a custom kernel. build time is about 90min for the pbp, or ?min via crossbuilding. (for me is ~10min.)

you can also choose any branch in the manjaro git by changing the VAR.


script now part of pbp-tools. see other forum thread for details.
v5.5 branch working well. script updated. thank you @tsys !

Linux pbp-deb-arm64-emmc 5.5.0-1-pinebookpro-arm64-custom+ #1 SMP PREEMPT Thu Jan 30 13:38:40 PST 2020 aarch64 GNU/Linux
crosscompile pbp kernel script: (configure VARS for your own usage)
# execute in clean kernel source directory after placing your .config and applying any patches
BUILDCONFIG="ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu-"
KERNELCONFIG="INITRD=yes KBUILD_IMAGE=arch/arm64/boot/Image"
# untar to GCCARMDIR
make -j $NPROC $BUILDCONFIG oldconfig
make -j $NPROC $BUILDCONFIG menuconfig
KCFLAGS="-O2 -pipe -march=$TARCH$TOPTS -mcpu=$TCPU -mtune=$TCPU" \
KCPPFLAGS="-O2 -pipe -march=$TARCH$TOPTS -mcpu=$TCPU -mtune=$TCPU" \
# move to pinebook pro and install manually via dpkg
a note about big cores: you can either disable the noted erratum, or remove maxcpus=4 from your u-boot defaults.
tsys has focused development on the 5.6 branch of late, including the pinebook dts and cw2015 battery kernel module. recommend using either the 5.6 branch (dev) or master (stable) depending on your interests.

you may want to apply the hantro patches from the hantro-h264 branch for testing, which are rebased from libreelec and described in the mainline hwaccel thread.

you may want to apply the latest 5.6 rc patch if not yet applied to the v5.6 branch, i.e. 5.6-rc6 from
Trying to build on the stock Debian+Mate which is stretch rather than sid.

Needed additional packages: bison fakeroot flex libssl-dev

Also kernel-package has to be got from stretch-backports as it's not in stretch.

Now dying with "gcc: error: unrecognized command line option '-mgeneral-regs-only' "

That is an option understood only by the aarch64 compiler, and stock uses debian armhf rather than arm64.
So that would need an armhf->arm64 cross-compile, or building the kernel with a different selected arch, I suppose.
And I'll look at that more later, I'm out of time for now.
no reason to build your own mainline kernel with the mrfixit2001 debian os. it is hacked together for the 4.4.x rockchip kernel.

either crossbuild or install multiarch on an armhf system.

debian stable armhf with mainline kernel works great, tho. i have this as an sdcard install for testing. uses same kernel as arm64.
I need to build some kernel so I can get the matching linux-headers package so I can build WireGuard.
oh, you can probably fake this with a git clone of the repository. i have this enabled in my mainline kernel package, although it is untested.
Yup, according to this,

one can prepare the kernel source tree for building external modules without actually having to build the kernel, with the make target modules_prepare.


only supports parallel versions of libraries, not applications, so I'd have to remove some amount of the armhf build environment. Don't know yet if a mix of armhf & arm64 would work for general purposes.

For cross-compiling the kernel, one needs binutils-aarch64-linux-gnu and gcc-aarch64-linux-gnu, and those are only available for x86 in the Debian repositories.

So, I used this Raspberry Pi Howto to build minimal versions of both from source:
(It needed package 'texinfo' in addition to the dependencies in the howto)

Next is to clone MrFixit's kernel, identify the right commit to checkout that matches the running kernel (looks like 209da1a), and modules_prepare that. I'll continue the drama in my thread since it's starting to get off-topic for manjaro mainline.

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to update Manjaro to 20.10 pineitup 6 2,653 01-04-2021, 02:00 PM
Last Post: nightranger73
  Make your own Manjaro image flatulent_piney 0 924 11-07-2020, 03:30 AM
Last Post: flatulent_piney
  Manjaro ARM, Cryptomator, and MEGA Sync dp1kinobe 3 2,029 10-24-2020, 06:38 AM
Last Post: pineitup
  Downgrading packages on Manjaro ARM (on the example of boinc) wrzomar 0 972 10-02-2020, 12:20 PM
Last Post: wrzomar
  Freepascal FPC3.20 and Lazarus IDE on Manjaro KDE dieselnutjob 0 928 08-02-2020, 06:57 AM
Last Post: dieselnutjob
  Installing WPS Office on Manjaro brent.thierens 5 3,611 07-13-2020, 03:13 AM
Last Post: brent.thierens
  full disk encryption with luks on manjaro xfce limxr 48 25,546 07-09-2020, 07:27 AM
Last Post: JtR
  Is there a MMC upgrade instruction from debian-mate to manjaro factory (20.06)? pljanson 4 2,669 06-23-2020, 12:41 AM
Last Post: pljanson
  mesa-git build script for latest panfrost xmixahlx 28 19,734 06-11-2020, 11:16 PM
Last Post: xmixahlx
  How to boot Manjaro from NVME with uboot on eMMC as400 47 20,337 06-07-2020, 02:37 AM
Last Post: as400

Forum Jump:

Users browsing this thread: 1 Guest(s)