iT邦幫忙

2021 iThome 鐵人賽

DAY 25
0
Software Development

Port Alpine Linux to open source RISC-V platform系列 第 25

Alpine Linux Porting (1.999) The light at the end of tunnel

  • 分享至 

  • xImage
  •  

一樣先上進度log:

+ exec /bin/busybox switch_root /sysroot /sbin/init

   OpenRC 0.44.5.af85a2aa85 is starting up Linux 5.10.0 (riscv32)

 * /proc is already mounted
 * Mounting /run ...[  997.108243] tmpfs: Unknown parameter 'mode'
mount: mounting tmpfs on /run failed: Invalid argument
 * Unable to mount tmpfs on /run.
 * Can't continue.
 * Caching service dependencies ... [ ok ]
 * Clock skew detected with `(null)'
 * Adjusting mtime of `/run/openrc/deptree' to Tue Sep 21 16:34:03 2021
 * WARNING: clock skew detected!
 * Remounting devtmpfs on /dev ... [ ok ]
 * Mounting /dev/shm ...[ 1196.469000] tmpfs: Unknown parameter 'mode'
mount: mounting shm on /dev/shm failed: Invalid argument
 [ !! ]
 * Mounting modloop  ... [ !! ]
 * ERROR: modloop failed to start
 * Starting busybox mdev .../lib/rc/sh/openrc-run.sh: line 21: can't create /proc/sys/kernel/hotplug: nonexistent directory
 [ ok ]
 * Loading hardware drivers ... [ ok ]
 * WARNING: clock skew detected!
 * Mounting modloop  ... [ !! ]
 * ERROR: modloop failed to start
 * Setting the local clock based on last shutdown time ... * swclock: settimeofday: Function not implemented
 [ !! ]
 * ERROR: swclock failed to start
 * Loading modules ...modprobe: can't change directory to '/lib/modules': No such file or directory
modprobe: can't change directory to '/lib/modules': No such file or directory
 [ ok ]
 * Checking local filesystems  ... [ ok ]
 * Remounting filesystems ... [ ok ]
 * Mounting local filesystems ... [ ok ]
 * Configuring kernel parameters ...sysctl: error: 'net.ipv4.tcp_syncookies' is an unknown key
sysctl: error: 'kernel.unprivileged_bpf_disabled' is an unknown key
 [ ok ]
 * Migrating /var/lock to /run/lock ... [ ok ]
 * Creating user login records ... [ ok ]
 * Clock skew detected with `(null)'
 * Cleaning /var/run ... [ ok ]
 * Wiping /tmp directory ... [ ok ]
 * Caching service dependencies ... [ ok ]
 * Clock skew detected with `(null)'
 * Adjusting mtime of `/run/openrc/deptree' to Tue Sep 21 16:34:03 2021
 * WARNING: clock skew detected!
 * Remounting devtmpfs on /dev ... [ ok ]
 * Mounting /dev/shm ...mount: mounting shm on /dev/shm failed: Invalid argument
 [ !! ]
 * Mounting modloop  ... [ !! ]
 * ERROR: modloop failed to start
 * Starting busybox mdev .../lib/rc/sh/openrc-run.sh: line 21: can't create /proc/sys/kernel/hotplug: nonexistent directory
 [ ok ]
 * Loading hardware drivers ... [ ok ]
 * Setting the local clock based on last shutdown time ... * swclock: settimeofday: Function not implemented
 [ !! ]
 * ERROR: swclock failed to start
 * Loading modules ...modprobe: can't change directory to '/lib/modules': No such file or directory
modprobe: can't change directory to '/lib/modules': No such file or directory
 [ ok ]
 * Checking local filesystems  ... [ ok ]
 * Remounting filesystems ... [ ok ]
 * Mounting local filesystems ... [ ok ]
 * Configuring kernel parameters ...sysctl: error: 'net.ipv4.tcp_syncookies' is an unknown key
sysctl: error: 'kernel.unprivileged_bpf_disabled' is an unknown key
 [ ok ]
 * /var/lock does not point to /run/lock.
 * Setting /var/lock to point to /run/lock.
 * Creating user login records ... [ ok ]
 * Cleaning /var/run ... [ ok ]
 * Wiping /tmp directory ... [ ok ]
can't open /dev/liteuart: No such file or directory
Welcome to Alpine Linux 3.15.0_alpha20210804 (edge)
Kernel 5.10.0 on an riscv32 (/dev/ttyLXU0)
can't open /dev/liteuart: No such file or directory
can't open /dev/liteuart: No such file or directory
can't open /dev/liteuart: No such file or directory
(none) login: 
Kernel 5.10.0 on an riscv32 (/dev/ttyLXU0)

在QEMU上驗證完後,擺放到實體板子上就是另一個重要的課題了。
目前是能夠進到kernel的login shell,但是會遇到 OpenRC 設定的問題,這會在下一篇時,開始跳進去看OpenRC有什麼sysinit相關的target需要作調整。

細項來說,今天遇到的實體問題是:因為在真實硬體上,我的RAM空間是有限的,不能像我在QEMU上可以直接把Alpine的apk們強塞進initramfs。所以實際上我是透過OrangeCrab上的spi_mmc、去mount SD卡上來給Alpine Init去安裝,這邊還算順利,就單純的試誤。中間遇到的小插曲是Linux-on-LitexVexriscv的buildroot config中,沒有打開CONFIG_TMPFS、只有傳統的ramfs,這點對Alpine來說太harsh了很難tweak,最後我還是妥協重編了一次buildroot kernel,最後卡在的點就是如面log所示,他進userspace時,會瘋狂抱怨Litex/VexRiscv的UART - - LiteUART 消失了,這點我必須要深入Alpine的OpenRC裡面,去看看到底是哪個環節炸裂掉。

下集待續~


上一篇
Alpine Linux Porting (1.99) ES LEBT !!!
下一篇
Alpine Linux Porting (1.9999)
系列文
Port Alpine Linux to open source RISC-V platform30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言