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!


Possibly Related Threads…
Thread Author Replies Views Last Post
  Manjaro Sway Theme Broken Eighty8 1 166 03-08-2024, 08:41 AM
Last Post: tophneal
Question Manjaro with Full Disk Encryption and GRUB dumetrulo 1 1,605 02-02-2024, 02:45 AM
Last Post: frankkinney
  Manjaro network problem late 2023 acruhl 1 213 01-19-2024, 11:32 PM
Last Post: Kevin Kofler
  Help installing Manjaro on eMMC of Pinebook Pro pine4546464 4 1,912 12-13-2023, 07:22 PM
Last Post: trillobite
  Need Help Recovering Manjaro /boot Contents on Pinebook Pro calinb 6 1,979 12-11-2023, 03:47 AM
Last Post: calinb
  Manjaro 20.04 not loading from SD (with Manjaro on eMMC) zaius 1 291 12-07-2023, 03:11 PM
Last Post: wdt
  Manjaro ARM: enabling external monitors & fixing Broadcom WiFi after updating trifleneurotic 2 746 11-14-2023, 10:57 AM
Last Post: trifleneurotic
  How to mainline kernel on daniel thompson's debian installer? hellojack 14 7,027 09-07-2023, 09:38 PM
Last Post: Der Geist der Maschine
  Manjaro [ARM Stable Update] 2021-07-23 issues Bocanila 1 1,913 08-21-2023, 09:10 PM
Last Post: vanessadonald
  [Manjaro] u-boot won't boot from eMMC with (unbootable) SD card present zackw 1 1,852 08-21-2023, 09:08 PM
Last Post: vanessadonald

Forum Jump:


Users browsing this thread: 1 Guest(s)