kernel build script for latest mainline manjaro kernel
#1
greetings,

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.

enjoy!


SCRIPT
script now part of pbp-tools. see other forum thread for details.
https://github.com/xmixahlx/pbp-tools
https://forum.pine64.org/showthread.php?tid=10190
#2
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
#3
crosscompile pbp kernel script: (configure VARS for your own usage)
Quote:#!/bin/sh
### LINUX-PINEBOOK-PRO-GIT-CROSSCOMPILE v0.20200607.1701
# execute in clean kernel source directory after placing your .config and applying any patches
## VARS
BUILDCONFIG="ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu-"
KERNELCONFIG="INITRD=yes KBUILD_IMAGE=arch/arm64/boot/Image"
GCCARMDIR=/usr/local/linaro-arm-gcc9
NPROC=10
TCPU=cortex-a72.cortex-a53
TOPTS=+crypto+crc
TARCH=armv8-a
## USE LINARO ARM GCC
# https://developer.arm.com/tools-and-soft.../downloads
# https://developer.arm.com/-/media/Files/...gnu.tar.xz
# untar to GCCARMDIR
export PATH=$GCCARMDIR/bin:$PATH
## CONFIGURE
make -j $NPROC $BUILDCONFIG oldconfig
make -j $NPROC $BUILDCONFIG menuconfig
## BUILD
KCFLAGS="-O2 -pipe -march=$TARCH$TOPTS -mcpu=$TCPU -mtune=$TCPU" \
KCPPFLAGS="-O2 -pipe -march=$TARCH$TOPTS -mcpu=$TCPU -mtune=$TCPU" \
make -j $NPROC $BUILDCONFIG $KERNELCONFIG bindeb-pkg
## EXIT
exit
## INSTALL
# move to pinebook pro and install manually via dpkg
## ENJOY
#4
a note about big cores: you can either disable the noted erratum, or remove maxcpus=4 from your u-boot defaults.
#5
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.
https://gitlab.manjaro.org/tsys/linux-pi...17e0.patch

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 https://www.kernel.org:
https://git.kernel.org/pub/scm/linux/ker...2=v5.6-rc5
#6
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.
https://backports.debian.org/Instructions/

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.
#7
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.
#8
I need to build some kernel so I can get the matching linux-headers package so I can build WireGuard.
#9
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.
#10
Yup, according to this,
https://www.kernel.org/doc/html/latest/k...dules.html

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

Multiarch,
https://wiki.debian.org/Multiarch/HOWTO

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:
https://www.tal.org/tutorials/raspberry-...bit-kernel
(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
  Building PPSSPP with Manjaro AUR LivingLinux 0 1,439 06-11-2022, 05:07 PM
Last Post: LivingLinux
  How to update Manjaro to 20.10 pineitup 8 15,027 07-31-2021, 04:44 AM
Last Post: jiyong
  Make your own Manjaro image flatulent_piney 0 3,549 11-07-2020, 03:30 AM
Last Post: flatulent_piney
  Manjaro ARM, Cryptomator, and MEGA Sync dp1kinobe 3 7,821 10-24-2020, 06:38 AM
Last Post: pineitup
  Downgrading packages on Manjaro ARM (on the example of boinc) wrzomar 0 3,697 10-02-2020, 12:20 PM
Last Post: wrzomar
  Freepascal FPC3.20 and Lazarus IDE on Manjaro KDE dieselnutjob 0 3,124 08-02-2020, 06:57 AM
Last Post: dieselnutjob
  Installing WPS Office on Manjaro brent.thierens 5 10,630 07-13-2020, 03:13 AM
Last Post: brent.thierens
  full disk encryption with luks on manjaro xfce limxr 48 74,605 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 8,786 06-23-2020, 12:41 AM
Last Post: pljanson
  mesa-git build script for latest panfrost xmixahlx 28 51,643 06-11-2020, 11:16 PM
Last Post: xmixahlx

Forum Jump:


Users browsing this thread: 1 Guest(s)