[Kernel] torvic9's 5.4 kernel for Manjaro (looking for testers)

Hello,

as you may have noticed I'm not as active on the forum anymore.
Yet, I still work on some stuff like kernels, and here's the annual custom LTS kernel:

This one has a lot of changes compared to Manjaro, please see the README for more details.
It would be great if experienced users could give it a brief test and report back as I'm trying to iron out the last remaining bugs.

Default Manjaro config is included, with a few necessary adaptations due to some patches, as well as a custom vd config. Disregard the "x" configs as they are for specific hardware only.
You will be asked which config to use.
No bootsplash or AppArmor patches!

As always, this can be installed alongside existing kernels, but in any case you should have a backup.

Thank you!

3 Likes

Should I remove /etc/makepkg.conf customisations (-march=native -O3) and select vd default config?

You can leave makepkg.conf as it is, it will (or should?) be overridden by the kernel config, where you simply choose "native" and "O3" (default is "native"+"O2").
The vd default config is heavily stripped, many modules have been disabled to speed up build process, but I might have disabled too many of them. If a needed driver is missing, please tell me so I can add it back.

1 Like

I'm having a look at nconfig to see what I did differently.
Compression algorithm (XZ) --->
Why not GZIP which should be faster? (not tested if it is)
<M> NFC subsystem support --->
Could be disabled, do any laptops use NFC?

Just curious: On what criteria did you decide to disable devices in Multifunction device drivers for example. Did you search each device name?

Some how compiled in fonts landed in Library routines. I have them IIRC in
Device Drivers ---> Graphics support --->

This is a little weird - I can't find the keys used to sign the kernel source.


Found it

gpg --locate-external-keys torvalds@kernel.org gregkh@kernel.org

2 Likes

I added a patch that uses -T2 (two threads) and dict=2M to xz module compression, which should be a little faster on compression.

No it would be too much to look up each and every device. Basically I disabled things which I think are not very common or only available on servers/high-performance/clusters. For example we don't need support for POWER related hardware since Manjaro won't run on it anyway.

You have to create the key manually and use a wrapper if you want to sign extramodules as well.
Or simply enter "n" to use autogeneration.

EDIT:

Ah, the keys used to sign the kernel source :slight_smile:
Thanks for that command by the way, I didn't know that.

How do I avoid building the drivers for amd only for intel?

CPU:
  Topology: Quad Core model: Intel Core i5-4570 bits: 64 type: MCP 
  L2 cache: 6144 KiB 
  Speed: 1896 MHz min/max: 800/3600 MHz Core speeds (MHz): 1: 1675 2: 1477 
  3: 1466 4: 1418 
Graphics:
  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics 
  driver: i915 v: kernel 
  Display: x11 server: X.Org 1.20.6 driver: modesetting 
  resolution: 1920x1080~60Hz, 1920x1080~60Hz 
  OpenGL: renderer: Mesa DRI Intel Haswell Desktop v: 4.5 Mesa 19.3.1 
Network:
  Device-1: Intel Ethernet I217-LM driver: e1000e 

Supported vendors

1 Like

If you have an all-Intel platform (CPU, graphics, ethernet, WiFi), you could try to use the "x270" config, which I created for the Thinkpad with the same name. Some audio codecs are disabled though.

It took 2:45 h to build. Here is the terminal output FWIIW https://pastebin.in/nqBYqyUy2f
Default config.

~ >>> inxi -Fxxxza
System:    Host: mj Kernel: 5.4.4-1-MANJARO x86_64 bits: 64 compiler: gcc v: 9.2.0
           parameters: BOOT_IMAGE=/vmlinuz-5.4-x86_64
           root=UUID=704dc990-70b6-4be2-9483-03528f497c51 rw quiet udev.log_priority=3
           zswap.enabled=1 zswap.compressor=lz4 zswap.max_pool_percent=20 zswap.zpool=z3fold
           nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier
           mds=off 3
           Desktop: KDE Plasma 5.17.4 tk: Qt 5.13.2 info: lemonbar wm: bspwm 0.9.7-2-g342c2e3
           dm: startx Distro: Manjaro Linux
Machine:   Type: Desktop System: ASUS product: All Series v: N/A serial: <filter>
           Mobo: ASUSTeK model: AM1I-A v: Rev X.0x serial: <filter> UEFI: American Megatrends
           v: 0801 date: 03/10/2016
CPU:       Topology: Quad Core model: AMD Athlon 5370 APU with Radeon R3 bits: 64 type: MCP
           arch: Jaguar family: 16 (22) model-id: N/A stepping: 1 microcode: 700010F
           L2 cache: 2048 KiB
           flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 17599
           Speed: 800 MHz min/max: 800/2200 MHz Core speeds (MHz): 1: 824 2: 800 3: 800 4: 955
           Vulnerabilities: Type: itlb_multihit status: Not affected
           Type: l1tf status: Not affected
           Type: mds status: Not affected
           Type: meltdown status: Not affected
           Type: spec_store_bypass status: Vulnerable
           Type: spectre_v1 status: Vulnerable: __user pointer sanitization and usercopy
           barriers only; no swapgs barriers
           Type: spectre_v2 status: Vulnerable, STIBP: disabled
           Type: tsx_async_abort status: Not affected
Graphics:  Device-1: AMD Kabini [Radeon HD 8400 / R3 Series] vendor: ASUSTeK driver: amdgpu
           v: kernel bus ID: 00:01.0 chip ID: 1002:9830
           Display: server: X.Org 1.20.6 driver: amdgpu FAILED: ati unloaded: modesetting
           alternate: fbdev,vesa resolution: 1920x1080~60Hz
           OpenGL: renderer: AMD KABINI (DRM 3.35.0 5.4.4-1-MANJARO LLVM 9.0.0)
           v: 4.5 Mesa 19.3.1 direct render: Yes
Audio:     Device-1: AMD Kabini HDMI/DP Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel
           bus ID: 00:01.1 chip ID: 1002:9840
           Device-2: AMD FCH Azalia vendor: ASUSTeK driver: snd_hda_intel v: kernel
           bus ID: 00:14.2 chip ID: 1022:780d
           Sound Server: ALSA v: k5.4.4-1-MANJARO
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: ASUSTeK
           driver: r8169 v: kernel port: e000 bus ID: 02:00.0 chip ID: 10ec:8168
           IF: enp2s0 state: up speed: 100 Mbps duplex: full mac: <filter>
Drives:    Local Storage: total: 704.25 GiB used: 93.63 GiB (13.3%)
           ID-1: /dev/sda vendor: Seagate model: ST500LM012 HN-M500MBB size: 465.76 GiB
           block size: physical: 4096 B logical: 512 B speed: 3.0 Gb/s rotation: 5400 rpm
           serial: <filter> rev: 0002 scheme: GPT
           ID-2: /dev/sdb vendor: Kingston model: RBU-SNS8100S3128GD size: 119.24 GiB
           block size: physical: 512 B logical: 512 B speed: 6.0 Gb/s serial: <filter>
           rev: 06.9 scheme: GPT
           ID-3: /dev/sdc vendor: Samsung model: MZHPU128HCGM-00004 size: 119.24 GiB
           block size: physical: 512 B logical: 512 B speed: 6.0 Gb/s serial: <filter>
           rev: 501Q scheme: GPT
Partition: ID-1: / raw size: 118.85 GiB size: 118.85 GiB (100.00%) used: 16.47 GiB (13.9%)
           fs: f2fs dev: /dev/sdb1
           ID-2: /boot raw size: 290.0 MiB size: 272.8 MiB (94.08%) used: 74.0 MiB (27.1%)
           fs: ext4 dev: /dev/sdb2
           ID-3: /home raw size: 119.24 GiB size: 119.24 GiB (100.00%) used: 77.08 GiB (64.6%)
           fs: f2fs dev: /dev/sdc1
           ID-4: swap-1 size: 8.48 GiB used: 1.0 MiB (0.0%) fs: swap
           swappiness: 80 (default 60) cache pressure: 100 (default) dev: /dev/sda2
Sensors:   System Temperatures: cpu: 22.8 C mobo: N/A gpu: amdgpu temp: 22 C
           Fan Speeds (RPM): N/A
Info:      Processes: 185 Uptime: 3h 53m Memory: 7.22 GiB used: 1.85 GiB (25.6%) Init: systemd
           v: 244 Compilers: gcc: 9.2.0 clang: 9.0.0 Shell: zsh v: 5.7.1 running in: server
           inxi: 3.0.37
1 Like

Thanks! 2h45 is a lot though, what computer are you compiling on?
My Core2Duo 1.6 GHz takes a little over 3 hours (for -O2 build).

EDIT: little tip for you: use mitigations=off to disable all the mitigations at once :wink:

The grub entry is older than the kernel parameter, I didn't care to update the parameter.
Your kernel package #
49M Dec 19 14:31 linux54-vd-5.4.5-1-x86_64.pkg.tar.zst
is smaller than mine
69M Dec 18 21:46 linux54-5.4.4-1-x86_64.pkg.tar.zst
because I compile too much into the kernel with <*> instead of <M>.

Update: Everithing seems to work after the reboot with your kernel. USB, KDE Connect...

Can you compare the size of modules dir with e.g.
du -h --max-depth=1 /usr/lib/modules
as well, please?

My kernel image in /boot/vmlinuz is 11M (LZ4 compression), and the module dir is 121M.

That's the most important thing, good!

linux54-vd

~ >>> du -h --max-depth=1 /usr/lib/modules                                                  

145M    /usr/lib/modules/5.3.17-1-MANJARO
129M    /usr/lib/modules/5.4.5-1-vd
172K    /usr/lib/modules/extramodules-5.3-MANJARO
172K    /usr/lib/modules/extramodules-5.4-MANJARO
184M    /usr/lib/modules/5.4.4-1-MANJARO
4.0K    /usr/lib/modules/extramodules-5.4-vd
458M    /usr/lib/modules
~ >>>

my custom linux54 MANJARO

eugen@mj Linux 5.4.4-1-MANJARO x86_64 18.1.4 Juhraya
~ >>> du -h --max-depth=1 /usr/lib/modules                                                  
145M    /usr/lib/modules/5.3.17-1-MANJARO
129M    /usr/lib/modules/5.4.5-1-vd
172K    /usr/lib/modules/extramodules-5.3-MANJARO
172K    /usr/lib/modules/extramodules-5.4-MANJARO
184M    /usr/lib/modules/5.4.4-1-MANJARO
4.0K    /usr/lib/modules/extramodules-5.4-vd
458M    /usr/lib/modules
~ >>>   

The same :facepalm: I didn't think what the command does.

34m 13s build - default vd config

.makepkg.conf
❯ cat .makepkg.conf
#
# /etc/makepkg.conf
#

#########################################################################
# SOURCE ACQUISITION
#########################################################################
#
#-- The download utilities that makepkg should use to acquire sources
#  Format: 'protocol::agent'
DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u'
          'ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
          'http::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'https::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'rsync::/usr/bin/rsync --no-motd -z %u %o'
          'scp::/usr/bin/scp -C %u %o')

# Other common tools:
# /usr/bin/snarf
# /usr/bin/lftpget -c
# /usr/bin/wget

#-- The package required by makepkg to download VCS sources
#  Format: 'protocol::package'
VCSCLIENTS=('bzr::bzr'
            'git::git'
            'hg::mercurial'
            'svn::subversion')

#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
CARCH="x86_64"
CHOST="x86_64-pc-linux-gnu"

#-- Compiler and Linker Flags
# -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family
CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
#-- Make Flags: change this for DistCC/SMP systems
MAKEFLAGS="-j$(nproc)"
#-- Debugging flags
DEBUG_CFLAGS="-g -fvar-tracking-assignments"
DEBUG_CXXFLAGS="-g -fvar-tracking-assignments"

#########################################################################
# BUILD ENVIRONMENT
#########################################################################
#
# Defaults: BUILDENV=(!distcc color !ccache check !sign)
#  A negated environment option will do the opposite of the comments below.
#
#-- distcc:   Use the Distributed C/C++/ObjC compiler
#-- color:    Colorize output messages
#-- ccache:   Use ccache to cache compilation
#-- check:    Run the check() function if present in the PKGBUILD
#-- sign:     Generate PGP signature file
#
BUILDENV=(!distcc color !ccache check !sign)
#
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
#-- specify a space-delimited list of hosts running in the DistCC cluster.
#DISTCC_HOSTS=""
#
#-- Specify a directory for package building.
#BUILDDIR=/tmp/makepkg

#########################################################################
# GLOBAL PACKAGE OPTIONS
#   These are default values for the options=() settings
#########################################################################
#
# Default: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug)
#  A negated option will do the opposite of the comments below.
#
#-- strip:      Strip symbols from binaries/libraries
#-- docs:       Save doc directories specified by DOC_DIRS
#-- libtool:    Leave libtool (.la) files in packages
#-- staticlibs: Leave static library (.a) files in packages
#-- emptydirs:  Leave empty directories in packages
#-- zipman:     Compress manual (man and info) pages in MAN_DIRS with gzip
#-- purge:      Remove files specified by PURGE_TARGETS
#-- debug:      Add debugging flags as specified in DEBUG_* variables
#
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug)

#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
INTEGRITY_CHECK=(md5)
#-- Options to be used when stripping binaries. See `man strip' for details.
STRIP_BINARIES="--strip-all"
#-- Options to be used when stripping shared libraries. See `man strip' for details.
STRIP_SHARED="--strip-unneeded"
#-- Options to be used when stripping static libraries. See `man strip' for details.
STRIP_STATIC="--strip-debug"
#-- Manual (man and info) directories to compress (if zipman is specified)
MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
#-- Doc directories to remove (if !docs is specified)
DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
#-- Files to be removed from all packages (if purge is specified)
PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
#-- Directory to store source code in for debug packages
DBGSRCDIR="/usr/src/debug"

#########################################################################
# PACKAGE OUTPUT
#########################################################################
#
# Default: put built package and cached source in build directory
#
#-- Destination: specify a fixed directory where all packages will be placed
#PKGDEST=/home/packages
#-- Source cache: specify a fixed directory where source files will be cached
#SRCDEST=/home/sources
#-- Source packages: specify a fixed directory where all src packages will be placed
#SRCPKGDEST=/home/srcpackages
#-- Log files: specify a fixed directory where all log files will be placed
#LOGDEST=/home/makepkglogs
#-- Packager: name/email of the person or organization building packages
PACKAGER="fhdk <fh@manjaro.org>"
#-- Specify a key to use for package signing
GPGKEY="17C752B61B2F2E90"

#########################################################################
# COMPRESSION DEFAULTS
#########################################################################
#
COMPRESSGZ=(gzip -c -f -n)
COMPRESSBZ2=(bzip2 -c -f)
COMPRESSXZ=(xz -c -z -)
COMPRESSZST=(zstd -c -z -q -)
COMPRESSLRZ=(lrzip -q)
COMPRESSLZO=(lzop -q)
COMPRESSZ=(compress -c -f)
COMPRESSLZ4=(lz4 -q)
COMPRESSLZ=(lzip -c -f)

#########################################################################
# EXTENSION DEFAULTS
#########################################################################
#
# WARNING: Do NOT modify these variables unless you know what you are
#          doing.
#
PKGEXT='.pkg.tar.xz'
SRCEXT='.src.tar.gz'
1 Like

Moved from #general-discussion to #manjaro-development:projects since it fits better there

Just ran into an error after compiling for 35 minutes (default Manjaro profile): :wink:

Kernel: arch/x86/boot/bzImage is ready  (#1)
ERROR: "raid6_intx32" [lib/raid6/raid6_pq.ko] undefined!
make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
make: *** [Makefile:1285: modules] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

edit

Just trying again now after removing the 0002-clearlinux-add-config-opt-for-raid6-bench.patch from PKGBUILD. (Maybe just commenting CONFIG_RAID6_FORCE_INT=y in config.x86_64 would have fixed also :man_shrugging:)

edit2

After removing that patch mentioned above it compiled successfully. Using it right now.
So far everything works fine. Thanks for your efforts @anon23612428

1 Like

Thank you for reporting, I can confirm the problem and will have a look at it.

EDIT: fixed, 5.4.6 is up.

1 Like

Thx. Compiling it now.

I also had to adapt PKGBUILD for building the virtualbox and acpi modules:

For virtualbox, I removed lines 57-59 (referencing some local file for signing)

  for i in vbox{drv,netflt,netadp}.ko; do
  	/home/archon/bin/sign-file54.sh "${pkgdir}/usr/lib/modules/${_extramodules}/$i"
  done

And for acpi_call, removed line 47:

sign-file54.sh "${pkgdir}/usr/lib/modules/${_extramodules}/acpi_call.ko"
1 Like

Forum kindly sponsored by