Manjaro with BSP kernel
#1
I've been exploring the possibility of running Manjaro on the eMMC but with a BSP kernel on the SD card. Not totally stable yet but wanted to see if anyone has thoughts on this.

Why

I love the overall experience in Manjaro ARM a lot (up-to-date packages, AUR etc). I've installed it to the eMMC and use it on a daily basis. The included mainline kernel has come a long way and mostly works well, but I'm still running into a few issues compared to the BSP kernel in mrfixit2001's Debian and ayufan's Ubuntu images:
  • Redshift doesn't work. This is a big problem for me as I use the laptop mostly in the evenings at home.
  • Sound from the speakers is fairly quiet even at max volume.
  • S3 sleep: wakes up a few seconds after closing the lid.
  • (minor) Power LED indicator doesn't change color during sleep.
So I wondered if it'd be possible to use the BSP kernel from ayufan with Manjaro, but without borking the default mainline kernel. The basic idea:
  • Write ayufan's Bionic image containing BSP kernel to SD card
  • Change the kernel boot flags on SD card to use the Manjaro partition on the eMMC as rootfs
  • Copy over BSP kernel modules and firmware from Bionic image to Manjaro partition on the eMMC
Now, without the SD card, the laptop would still boot normally from the eMMC into "regular" Manjaro with mainline kernel. With the SD card inserted, it would boot from the kernel and initramfs on the SD card, but then still use the Manjaro userspace on the eMMC.

How

This is what I did:

1. Write ayufan's Bionic image to SD card:
Code:
xzcat bionic-mate-pinebookpro-0.9.14-1159-armhf.img.xz  | sudo dd of=/dev/mmcblk1 bs=1M status=progress conv=fsync

2. Reboot into Bionic on the SD card, verify everything is working.

3. Mount the Manjaro partition on the eMMC.
  • Note that with the mainline kernel in Manjaro, mmcblk1 is the SD card and mmcblk0 is the eMMC storage, but with the BSP kernel in Bionic it's the other way around where mmcblk0 is the SD card and mmcblk1 is the eMMC storage.
  • Say the Manjaro root partition is /dev/mmcblk1p1 in Bionic and is mounted at /mnt. The default Manjaro eMMC installer sets a label of "ROOT" on the partition, which you can confirm with "ls -l /dev/disk/by-label/".

4. Edit /boot/extlinux/extlinux.conf on the SD card.Change the kernel boot argument "root=LABEL=linux-root" to "root=LABEL=ROOT" (or to "root=/dev/mmcblk1p1"). Again, make sure to confirm the label maps to the correct partition with "ls -l /dev/disk/by-label/".
  • The line to be edited is the first line that starts with "append". After editing, the first few lines of my /boot/extlinux/extlinux.conf looked like this:
    Code:
    timeout 10
    menu title select kernel

    label kernel-4.4.190-1233-rockchip-ayufan-gd3f1be0ed310
        kernel /boot/vmlinuz-4.4.190-1233-rockchip-ayufan-gd3f1be0ed310
        initrd /boot/initrd.img-4.4.190-1233-rockchip-ayufan-gd3f1be0ed310
        devicetreedir /boot/dtbs/4.4.190-1233-rockchip-ayufan-gd3f1be0ed310
        append rw panic=10 init=/sbin/init coherent_pool=1M ethaddr=${ethaddr} eth1addr=${eth1addr} serial=${serial#} cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1 root=LABEL=ROOT rootwait rootfstype=ext4

5. Copy over kernel modules and firmware from Bionic on the SD card to the Manjaro partition on the eMMC.
  • I located the necessary modules by looking through the "linux-image-4.4.190-1233-rockchip-ayufan-gd3f1be0ed310" and "board-package-pinebookpro-0.9-182" packages:
    Code:
    dpkg -L board-package-pinebookpro-0.9-182 linux-image-4.4.190-1233-rockchip-ayufan-gd3f1be0ed310
  • Ultimately, here are the files I copied over:
    Code:
    sudo cp -a /lib/modules/4.4.190-1233-rockchip-ayufan-gd3f1be0ed310 /mnt/lib/modules/sudo cp -a /usr/lib/linux-image-4.4.190-1233-rockchip-ayufan-gd3f1be0ed310 /mnt/usr/lib/sudo cp -a /vendor /mnt/sudo cp -a /lib/firmware/rtlbt /mnt/lib/firmware/[/list]

6. Fix wi-fi by editing /mnt/etc/NetworkManager/NetworkManager.conf (on the Manjaro partition) to add:
Code:
[device]
wifi.scan-rand-mac-address=no

7. Reboot with SD card inserted. If all went well, you should be able to log in to the eMMC Manjaro install as normal.

Hope this helps!
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Manjaro ARM 20.04 spikerguy 52 11,558 09-17-2020, 08:37 AM
Last Post: nightranger73
  Manjaro - No battery info after plugged in AlecM 4 415 09-16-2020, 08:34 PM
Last Post: zer0sig
  Manjaro and Arch repository with privacy oriented software as400 49 8,729 09-15-2020, 02:42 AM
Last Post: llsf
  Manjaro 20.09: USB ethernet dongle keeps hanging Dendrocalamus64 1 125 09-13-2020, 07:31 AM
Last Post: acceptabledecision
Question Help: Pinebook Pro will not enter sleep [Manjaro 20.04] EverythingIsInput 27 4,291 09-04-2020, 11:04 AM
Last Post: feoh
  Manjaro XFCE MPV Hardware Acceleration p3pp3r 1 476 09-03-2020, 06:02 PM
Last Post: etothepii
  Manjaro XFCE vs. Manjaro KDE pawlinski 0 181 09-02-2020, 06:49 AM
Last Post: pawlinski
  Virtual Desktop Issues (Manjaro KDE) davemaps 1 276 08-31-2020, 07:28 PM
Last Post: brad2723
  Boot Manjaro lock screen language and key issues Iiari 0 118 08-28-2020, 02:21 AM
Last Post: Iiari
  Manjaro 20.06 Step-By-Step Installation Guide nathanielwheeler 15 2,419 08-27-2020, 05:15 PM
Last Post: brianpbp

Forum Jump:


Users browsing this thread: 1 Guest(s)