Ports Openrc To Systemd On Armv7 Armv8

25 Feb 2023 - Linux Mobile

The reason I write this article because some people asked on matrix how can I use the mainline kernel built on postmarketOS running openrc, which could use on other distros like ArchLinux, Ubuntu, openSUSE, Gentoo running systemd.

Systemd Flowchart
Systemd Flowchart

I was lucky to be the first to reach the gitlab of postmarketOS branch pmaports. At that time, the lines of code in APKBUILD are very simple, you can understand where it is located in the rootfs, and the additional modules such as firmwares and drivers. With the guidance of WorldBlender dev on xda-developers. I just figured out hacking the kernel to ports through other distros running systemd.

Some mainline kernels are built specifically for chipsets with or without some modules built into the kernel, but some basic modules such as sound, display panel, sensors are integrated into the kernel as integral components.

To ports from openrc to systemd, one must understand how the kernel boots to add partition mounts to /etc/fstab as required by systemd. Also have to declare loading sound modules and sensors in /etc/modules to tell the kernel to load at booting, install alsa-utils and iio-sensors-proxy to use these modules. That’s basic configuration and more add-ons.

The GNU/Linux had 3 part:

  • device-(company name)-(model name)

  • firmware-(company name)-(model name)

  • linux-(company name)-(model name)

You should find it out which the right way to ports and patching those on systemd.

ALSA

...

# sudo lsmod | grep "^snd" | cut -d " " -f 1

snd_soc_tegra30_i2s
snd_soc_tegra30_ahub
snd_soc_tegra_pcm
snd_soc_tegra_machine
snd_soc_core
snd_pcm_dmaengine
snd_pcm
snd_timer
snd

# sudo nano /etc/modules

snd_soc_rl6231
snd_soc_rt5640
snd_soc_tegra30_i2s
snd_soc_tegra30_ahub
snd_soc_tegra_pcm
snd_soc_tegra_machine
snd_soc_tegra_wm8903
snd_soc_core
snd_soc_wm8903
snd_pcm_dmaengine
snd_pcm
snd_timer
snd

# sudo reboot

Checking soc soundcard loaded:

# sudo cat /proc/asound/card*/id

ALC5642

# sudo alsa force-reload

...

FSTAB

...

# sudo nano /etc/fstab

LABEL=pmOS_root / ext4 defaults,noatime 0 0
LABEL=pmOS_boot /boot ext2 defaults 0 1
#tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
#tmpfs /var/tmp tmpfs defaults,noatime,mode=1777 0 0
#tmpfs /var/spool tmpfs defaults,noatime,mode=1777 0 0
tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0

...

 

Recent Posts:

Initially, when I stepped foot in GNU/Linux, I realized that... more

If you have armhf or arm64 GNU/Linux available, it’s quite... more

First of all, GNU/Linux running mainline kernel has 2 main... more

Because Android is a fork of GNU/Linux, that means only... more

When I created my personal blog from basic jekyll barebone,... more

U Boot On Tegra Soc

12 Feb 2023 - tegra

As mentioned in the previous post, Nexus 7 2012 grouper/tilapia... more

Fosdem 2023

05 Feb 2023 - linuxmobile

This event could view online at this link. They... more

I finished barebone static blog from Jekyll documents and... more

This is hard part about Tegra 3 T30L, which I... more

This post, I share my experiences from I/O and CPU... more

I wrote some lk2nd experiences at previous post. Xiaomi Redmi... more

How the system booting!? Let’s start, since Google created compatible... more

This is the first SoC on ARM. Nvidia made ULP... more

When I wanna push source code to git, I saw... more

When I was online, I saw some github.io website. I’ve... more

 
More articles