我正在尝试从 RAM 启动由 yocto 构建的基于 busybox 的 ext4 Liunx 映像,使用 PHRAM 设备(dev/mtdblock0)作为 rootfs。该机器是Intel FPGA板(Stratix 10)。我已经PHRAM
在linux内核配置中启用了。
我将内核、设备树、rootfs加载到RAM中,然后手动启动。(没有uboot,只需设置reg x0-x3并跳转到EL1处的内核。)
内核mtdblock0
成功挂载为 rootfs,但在 systemd 期间失败。
编辑:我尝试使用 sysvinit 作为 /sbin/init 而不是 systemd,效果很好。所以问题肯定出在systemd上。但我需要 systemd。
该映像最初设计为从 MMC 卡启动(并且运行良好),所以我想知道是否需要修改任何内容。
这是日志。 (我只是在 rootfs 安装后才复制它。如果有必要,我会从内核启动中发布它)
[ 11.639366] EXT4-fs (mtdblock0): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[ 11.649197] VFS: Mounted root (ext4 filesystem) on device 31:0.
[ 11.656090] devtmpfs: mounted
[ 11.662064] Freeing unused kernel memory: 5184K
[ 11.666746] Run /sbin/init as init process
[ 11.670845] with arguments:
[ 11.673805] /sbin/init
[ 11.676516] with environment:
[ 11.679657] HOME=/
[ 11.682013] TERM=linux
[ 11.684722] kgdboc=ttyS0,115200
[ 11.777899] systemd[1]: System time before build time, advancing clock.
[ 11.788722] systemd[1]: Failed to lookup module alias 'unix': Function not implemented
[ 11.804645] systemd[1]: systemd 241 running in system mode. (-PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 -IDN -PCRE2 default-hierarchy=hybrid)
[ 11.826116] systemd[1]: No virtualization found in DMI
[ 11.831289] systemd[1]: No virtualization found in CPUID
[ 11.836647] systemd[1]: Virtualization XEN not found, /proc/xen does not exist
[ 11.844073] systemd[1]: No virtualization found in /proc/device-tree/*
[ 11.850762] systemd[1]: UML virtualization not found in /proc/cpuinfo.
[ 11.857324] systemd[1]: This platform does not support /proc/sysinfo
[ 11.863765] systemd[1]: Found VM virtualization none
[ 11.868765] systemd[1]: Detected architecture arm64.
[ 11.874085] systemd[1]: Mounting cgroup to /sys/fs/cgroup/cpuset of type cgroup with options cpuset.
[ 11.894948] systemd[1]: Mounting cgroup to /sys/fs/cgroup/devices of type cgroup with options devices.
[ 11.904532] systemd[1]: Mounting cgroup to /sys/fs/cgroup/blkio of type cgroup with options blkio.
[ 11.913773] systemd[1]: Mounting cgroup to /sys/fs/cgroup/cpu,cpuacct of type cgroup with options cpu,cpuacct.
[ 11.924124] systemd[1]: Mounting cgroup to /sys/fs/cgroup/memory of type cgroup with options memory.
[ 11.933736] systemd[1]: Mounting cgroup to /sys/fs/cgroup/perf_event of type cgroup with options perf_event.
[ 11.943823] systemd[1]: Mounting cgroup to /sys/fs/cgroup/hugetlb of type cgroup with options hugetlb.
[ 11.953540] systemd[1]: Mounting cgroup to /sys/fs/cgroup/pids of type cgroup with options pids.
Welcome to EMLinux 2.4 (buster)!
[ 11.970925] systemd[1]: Set hostname to <qemuarm64>.
[ 11.978373] random: systemd: uninitialized urandom read (16 bytes read)
[ 11.985036] systemd[1]: Initializing machine ID from random generator.
[ 11.992641] systemd[1]: Failed to open netlink: Function not implemented
[ 11.999413] systemd[1]: Failed to read AF_UNIX datagram queue length, ignoring: No such file or directory
[ 12.009010] systemd[1]: Setting 'fs/file-max' to '9223372036854775807'.
[ 12.015771] systemd[1]: Setting 'fs/nr_open' to '2147483640'.
[ 12.021577] systemd[1]: Couldn't write fs.nr_open as 2147483640, halving it.
[ 12.028697] systemd[1]: Setting 'fs/nr_open' to '1073741816'.
[ 12.034502] systemd[1]: Successfully bumped fs.nr_open to 1073741816
[ 12.044488] systemd[1]: Found cgroup2 on /sys/fs/cgroup/unified, unified hierarchy for systemd controller
[ 12.054084] systemd[1]: Unified cgroup hierarchy is located at /sys/fs/cgroup/unified. Controllers are on legacy hierarchies.
[ 12.070744] systemd[1]: Can't allocate BPF LPM TRIE map, BPF firewalling is not supported: Function not implemented
[ 12.081219] systemd[1]: Can't load kernel CGROUP DEVICE BPF program, BPF device control is not supported: Function not implemented
[ 12.093014] systemd[1]: Controller 'cpu' supported: yes
[ 12.098268] systemd[1]: Controller 'cpuacct' supported: yes
[ 12.103867] systemd[1]: Controller 'io' supported: no
[ 12.108929] systemd[1]: Controller 'blkio' supported: yes
[ 12.114336] systemd[1]: Controller 'memory' supported: yes
[ 12.119828] systemd[1]: Controller 'devices' supported: yes
[ 12.125406] systemd[1]: Controller 'pids' supported: yes
[ 12.130726] systemd[1]: Controller 'bpf-firewall' supported: no
[ 12.136649] systemd[1]: Controller 'bpf-devices' supported: no
[ 12.142524] systemd[1]: Set up TFD_TIMER_CANCEL_ON_SET timerfd.
[ 12.148482] systemd[1]: Failed to stat /etc/localtime, ignoring: No such file or directory
[ 12.156762] systemd[1]: /etc/localtime doesn't exist yet, watching /etc instead.
[ 12.164790] systemd[1]: Enabling showing of status.
[ 12.170660] systemd[1]: Successfully forked off '(sd-executor)' as PID 63.
[ 12.179714] systemd[63]: Successfully forked off '(direxec)' as PID 64.
[ 12.195509] systemd[63]: Successfully forked off '(direxec)' as PID 65.
[ 12.215538] systemd[63]: Successfully forked off '(direxec)' as PID 66.
[ 12.226667] systemd-fstab-generator[65]: Parsing /etc/fstab
[ 12.239560] systemd[63]: Successfully forked off '(direxec)' as PID 67.
[ 12.255251] systemd-fstab-generator[65]: Found entry what=/dev/root where=/ type=auto makefs=no nofail=no noauto=no
[ 12.265799] systemd-getty-generator[66]: Automatically adding serial getty for /dev/ttyS0.
[ 12.275474] systemd[63]: Successfully forked off '(direxec)' as PID 68.
[ 12.286144] systemd-gpt-auto-generator[67]: Failed to chase block device '/', ignoring: No such file or directory
[ 12.305730] systemd-fstab-generator[65]: Found entry what=proc where=/proc type=proc makefs=no nofail=no noauto=no
[ 12.316858] systemd[63]: Successfully forked off '(direxec)' as PID 69.
[ 12.326671] systemd-hibernate-resume-generator[68]: Not running in an initrd, quitting.
[ 12.344951] systemd[63]: Successfully forked off '(direxec)' as PID 70.
[ 12.354201] systemd-gpt-auto-generator[67]: mtd0: Parent isn't a raw disk, ignoring.
[ 12.363862] systemd-rc-local-generator[69]: /etc/rc.local does not exist, skipping.
[ 12.374949] systemd-fstab-generator[65]: Found entry what=devpts where=/dev/pts type=devpts makefs=no nofail=no noauto=no
[ 12.391515] systemd[63]: Successfully forked off '(direxec)' as PID 71.
[ 12.407198] systemd-rc-local-generator[69]: /usr/sbin/halt.local does not exist, skipping.
[ 12.418934] systemd-fstab-generator[65]: Found entry what=tmpfs where=/run type=tmpfs makefs=no nofail=no noauto=no
[ 12.430101] systemd[63]: Successfully forked off '(direxec)' as PID 72.
[ 12.451088] systemd-fstab-generator[65]: Found entry what=tmpfs where=/var/volatile type=tmpfs makefs=no nofail=no noauto=no
[ 12.465060] systemd[63]: /lib/systemd/system-generators/systemd-sysv-generator succeeded.
[ 12.473353] systemd[63]: /lib/systemd/system-generators/systemd-gpt-auto-generator succeeded.
[ 12.481943] systemd[63]: /lib/systemd/system-generators/systemd-getty-generator succeeded.
[ 12.490351] systemd[63]: /lib/systemd/system-generators/systemd-run-generator succeeded.
[ 12.498513] systemd[63]: /lib/systemd/system-generators/systemd-system-update-generator succeeded.
[ 12.507537] systemd[63]: /lib/systemd/system-generators/systemd-debug-generator succeeded.
[ 12.515864] systemd[63]: /lib/systemd/system-generators/systemd-fstab-generator succeeded.
[ 12.524195] systemd[63]: /lib/systemd/system-generators/systemd-hibernate-resume-generator succeeded.
[ 12.533480] systemd[63]: /lib/systemd/system-generators/systemd-rc-local-generator succeeded.
[ 12.542744] systemd[1]: (sd-executor) succeeded.
[ 12.547757] systemd[1]: Looking for unit files in (higher priority first):
[ 12.554674] systemd[1]: /etc/systemd/system.control
[ 12.559669] systemd[1]: /run/systemd/system.control
[ 12.564650] systemd[1]: /run/systemd/transient
[ 12.569190] systemd[1]: /etc/systemd/system
[ 12.573469] systemd[1]: /run/systemd/system
[ 12.577747] systemd[1]: /run/systemd/generator
[ 12.582285] systemd[1]: /lib/systemd/system
[ 12.593188] systemd[1]: sd-device-monitor: Failed to create socket: Function not implemented
[ 12.601667] systemd[1]: Failed to allocate device monitor: Function not implemented
[ 12.614284] systemd[1]: run-systemd-journal-stdout.mount: Failed to load configuration: No such file or directory
[ 12.624610] systemd[1]: run.mount: Failed to load configuration: No such file or directory
[ 12.632930] systemd[1]: run-systemd.mount: Failed to load configuration: No such file or directory
[ 12.641934] systemd[1]: run-systemd-journal.mount: Failed to load configuration: No such file or directory
[ 12.651616] systemd[1]: run-systemd-journal-socket.mount: Failed to load configuration: No such file or directory
[ 12.662655] systemd[1]: File /lib/systemd/system/systemd-journald.service:12 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
[ 12.679663] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[ 12.692458] systemd[1]: /lib/systemd/system/systemd-journald.service:13: Support for option LockPersonality= has been disabled at compile time and it is ignored
[ 12.706801] systemd[1]: /lib/systemd/system/systemd-journald.service:14: Support for option MemoryDenyWriteExecute= has been disabled at compile time and it is ignored
[ 12.722013] systemd[1]: /lib/systemd/system/systemd-journald.service:18: Support for option RestrictAddressFamilies= has been disabled at compile time and it is ignored
[ 12.737051] systemd[1]: /lib/systemd/system/systemd-journald.service:19: Support for option RestrictNamespaces= has been disabled at compile time and it is ignored
[ 12.751652] systemd[1]: /lib/systemd/system/systemd-journald.service:20: Support for option RestrictRealtime= has been disabled at compile time and it is ignored
[ 12.766254] systemd[1]: /lib/systemd/system/systemd-journald.service:23: Support for option SystemCallArchitectures= has been disabled at compile time and it is ignored
[ 12.781294] systemd[1]: /lib/systemd/system/systemd-journald.service:24: Support for option SystemCallErrorNumber= has been disabled at compile time and it is ignored
[ 12.796158] systemd[1]: /lib/systemd/system/systemd-journald.service:25: Support for option SystemCallFilter= has been disabled at compile time and it is ignored
[ 12.818042] systemd[1]: var.mount: Failed to load configuration: No such file or directory
[ 12.826375] systemd[1]: var-log.mount: Failed to load configuration: No such file or directory
[ 12.835071] systemd[1]: var-log-wtmp.mount: Failed to load configuration: No such file or directory
[ 12.844145] systemd[1]: auditd.service: Failed to load configuration: No such file or directory
[ 12.857237] systemd[1]: run-systemd-fsck.progress.mount: Failed to load configuration: No such file or directory
[ 12.870092] systemd[1]: /lib/systemd/system/systemd-udevd.service:19: Support for option MemoryDenyWriteExecute= has been disabled at compile time and it is ignored
[ 12.884838] systemd[1]: /lib/systemd/system/systemd-udevd.service:20: Support for option RestrictRealtime= has been disabled at compile time and it is ignored
[ 12.899041] systemd[1]: /lib/systemd/system/systemd-udevd.service:21: Support for option RestrictAddressFamilies= has been disabled at compile time and it is ignored
[ 12.913822] systemd[1]: /lib/systemd/system/systemd-udevd.service:22: Support for option SystemCallArchitectures= has been disabled at compile time and it is ignored
[ 12.928596] systemd[1]: /lib/systemd/system/systemd-udevd.service:23: Support for option LockPersonality= has been disabled at compile time and it is ignored
[ 12.942684] systemd[1]: File /lib/systemd/system/systemd-udevd.service:24 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
[ 12.959437] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[ 12.974996] systemd[1]: run-udev.mount: Failed to load configuration: No such file or directory
[ 12.983750] systemd[1]: run-udev-control.mount: Failed to load configuration: No such file or directory
[ 12.997890] systemd[1]: /lib/systemd/system/systemd-timesyncd.service:15: Support for option LockPersonality= has been disabled at compile time and it is ignored
[ 13.012348] systemd[1]: /lib/systemd/system/systemd-timesyncd.service:16: Support for option MemoryDenyWriteExecute= has been disabled at compile time and it is ignored
[ 13.027519] systemd[1]: /lib/systemd/system/systemd-timesyncd.service:27: Support for option RestrictAddressFamilies= has been disabled at compile time and it is ignored
[ 13.042645] systemd[1]: /lib/systemd/system/systemd-timesyncd.service:28: Support for option RestrictNamespaces= has been disabled at compile time and it is ignored
[ 13.057333] systemd[1]: /lib/systemd/system/systemd-timesyncd.service:29: Support for option RestrictRealtime= has been disabled at compile time and it is ignored
[ 13.071899] systemd[1]: /lib/systemd/system/systemd-timesyncd.service:32: Support for option SystemCallArchitectures= has been disabled at compile time and it is ignored
[ 13.087021] systemd[1]: /lib/systemd/system/systemd-timesyncd.service:33: Support for option SystemCallErrorNumber= has been disabled at compile time and it is ignored
[ 13.101973] systemd[1]: /lib/systemd/system/systemd-timesyncd.service:34: Support for option SystemCallFilter= has been disabled at compile time and it is ignored
[ 13.117397] systemd[1]: run-systemd-timesync.mount: Failed to load configuration: No such file or directory
[ 13.127186] systemd[1]: var-tmp.mount: Failed to load configuration: No such file or directory
[ 13.135847] systemd[1]: var-lib.mount: Failed to load configuration: No such file or directory
[ 13.144494] systemd[1]: var-lib-systemd.mount: Failed to load configuration: No such file or directory
[ 13.153827] systemd[1]: var-lib-systemd-timesync.mount: Failed to load configuration: No such file or directory
[ 13.169479] systemd[1]: var-lib-systemd-random\x2dseed.mount: Failed to load configuration: No such file or directory
[ 13.186126] systemd[1]: var-log-journal.mount: Failed to load configuration: No such file or directory
[ 13.201157] systemd[1]: run-systemd-ask\x2dpassword.mount: Failed to load configuration: No such file or directory
[ 13.212117] systemd[1]: /lib/systemd/system/systemd-ask-password-console.service:11: Support for option SystemCallArchitectures= has been disabled at compile time and it is ignored
[ 13.238236] systemd[1]: display-manager.service: Failed to load configuration: No such file or directory
[ 13.251377] systemd[1]: /lib/systemd/system/systemd-resolved.service:16: Support for option LockPersonality= has been disabled at compile time and it is ignored
[ 13.265785] systemd[1]: /lib/systemd/system/systemd-resolved.service:17: Support for option MemoryDenyWriteExecute= has been disabled at compile time and it is ignored
[ 13.280849] systemd[1]: /lib/systemd/system/systemd-resolved.service:28: Support for option RestrictAddressFamilies= has been disabled at compile time and it is ignored
[ 13.295883] systemd[1]: /lib/systemd/system/systemd-resolved.service:29: Support for option RestrictNamespaces= has been disabled at compile time and it is ignored
[ 13.310483] systemd[1]: /lib/systemd/system/systemd-resolved.service:30: Support for option RestrictRealtime= has been disabled at compile time and it is ignored
[ 13.324953] systemd[1]: /lib/systemd/system/systemd-resolved.service:33: Support for option SystemCallArchitectures= has been disabled at compile time and it is ignored
[ 13.339989] systemd[1]: /lib/systemd/system/systemd-resolved.service:34: Support for option SystemCallErrorNumber= has been disabled at compile time and it is ignored
[ 13.354851] systemd[1]: /lib/systemd/system/systemd-resolved.service:35: Support for option SystemCallFilter= has been disabled at compile time and it is ignored
[ 13.369961] systemd[1]: run-systemd-resolve.mount: Failed to load configuration: No such file or directory
[ 13.382207] systemd[1]: /lib/systemd/system/systemd-networkd.service:14: Support for option LockPersonality= has been disabled at compile time and it is ignored
[ 13.396602] systemd[1]: /lib/systemd/system/systemd-networkd.service:15: Support for option MemoryDenyWriteExecute= has been disabled at compile time and it is ignored
[ 13.411662] systemd[1]: /lib/systemd/system/systemd-networkd.service:23: Support for option RestrictAddressFamilies= has been disabled at compile time and it is ignored
[ 13.426714] systemd[1]: /lib/systemd/system/systemd-networkd.service:24: Support for option RestrictNamespaces= has been disabled at compile time and it is ignored
[ 13.441315] systemd[1]: /lib/systemd/system/systemd-networkd.service:25: Support for option RestrictRealtime= has been disabled at compile time and it is ignored
[ 13.455782] systemd[1]: /lib/systemd/system/systemd-networkd.service:28: Support for option SystemCallArchitectures= has been disabled at compile time and it is ignored
[ 13.470818] systemd[1]: /lib/systemd/system/systemd-networkd.service:29: Support for option SystemCallErrorNumber= has been disabled at compile time and it is ignored
[ 13.485681] systemd[1]: /lib/systemd/system/systemd-networkd.service:30: Support for option SystemCallFilter= has been disabled at compile time and it is ignored
[ 13.500755] systemd[1]: run-systemd-netif.mount: Failed to load configuration: No such file or directory
[ 13.511027] systemd[1]: File /lib/systemd/system/systemd-logind.service:16 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
[ 13.527864] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[ 13.540648] systemd[1]: /lib/systemd/system/systemd-logind.service:17: Support for option LockPersonality= has been disabled at compile time and it is ignored
[ 13.554818] systemd[1]: /lib/systemd/system/systemd-logind.service:18: Support for option MemoryDenyWriteExecute= has been disabled at compile time and it is ignored
[ 13.569626] systemd[1]: /lib/systemd/system/systemd-logind.service:22: Support for option RestrictAddressFamilies= has been disabled at compile time and it is ignored
[ 13.584486] systemd[1]: /lib/systemd/system/systemd-logind.service:23: Support for option RestrictNamespaces= has been disabled at compile time and it is ignored
[ 13.598912] systemd[1]: /lib/systemd/system/systemd-logind.service:24: Support for option RestrictRealtime= has been disabled at compile time and it is ignored
[ 13.613167] systemd[1]: /lib/systemd/system/systemd-logind.service:25: Support for option SystemCallArchitectures= has been disabled at compile time and it is ignored
[ 13.628028] systemd[1]: /lib/systemd/system/systemd-logind.service:26: Support for option SystemCallErrorNumber= has been disabled at compile time and it is ignored
[ 13.642726] systemd[1]: /lib/systemd/system/systemd-logind.service:27: Support for option SystemCallFilter= has been disabled at compile time and it is ignored
[ 13.658226] systemd[1]: var-run.mount: Failed to load configuration: No such file or directory
[ 13.666894] systemd[1]: var-run-dbus.mount: Failed to load configuration: No such file or directory
[ 13.675988] systemd[1]: var-run-dbus-system_bus_socket.mount: Failed to load configuration: No such file or directory
[ 13.690645] systemd[1]: /lib/systemd/system/systemd-ask-password-wall.service:8: Support for option SystemCallArchitectures= has been disabled at compile time and it is ignored
[ 13.707430] systemd[1]: systemd-user-sessions.service: Failed to load configuration: No such file or directory
[ 13.719881] systemd[1]: var-lib-machines.raw.mount: Failed to load configuration: No such file or directory
[ 13.736282] systemd[1]: plymouth-quit-wait.service: Failed to load configuration: No such file or directory
[ 13.774959] systemd[1]: cryptsetup.target: Failed to load configuration: No such file or directory
[ 13.784386] systemd[1]: plymouth-start.service: Failed to load configuration: No such file or directory
[ 13.795138] systemd[1]: sys.mount: Failed to load configuration: No such file or directory
[ 13.803459] systemd[1]: sys-kernel.mount: Failed to load configuration: No such file or directory
[ 13.815153] systemd[1]: sys-fs.mount: Failed to load configuration: No such file or directory
[ 13.823730] systemd[1]: sys-fs-fuse.mount: Failed to load configuration: No such file or directory
[ 13.836347] systemd[1]: dev.mount: Failed to load configuration: No such file or directory
[ 13.854246] systemd[1]: run-systemd-journal-syslog.mount: Failed to load configuration: No such file or directory
[ 13.867748] systemd[1]: run-systemd-journal-dev\x2dlog.mount: Failed to load configuration: No such file or directory
[ 13.881945] systemd[1]: run-initctl.mount: Failed to load configuration: No such file or directory
[ 13.891307] systemd[1]: /lib/systemd/system/systemd-initctl.service:9: Support for option SystemCallArchitectures= has been disabled at compile time and it is ignored
[ 13.908639] systemd[1]: dev-root.mount: Failed to load configuration: No such file or directory
[ 13.918095] systemd[1]: Failed to allocate notification socket: Function not implemented
[!!!!!!] Failed to start up manager.
[ 13.950790] systemd[1]: Freezing execution.
以及设备树中的 bootarg:
bootargs = "earlycon panic=-1 printk.devkmsg=on root=/dev/mtdblock0 kgdboc=ttyS0,115200
rw rootwait mem=480M debug ignore_loglevel phram.phram=root,0x20000000,0x37C1C00,0x100 ";
fstab: # stock fstab - 您可能想用特定于机器的 fstab 覆盖它
/dev/mtdblock0 / ext4 defaults 1 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0
tmpfs /var/volatile tmpfs defaults 0 0
# uncomment this if your device has a SD/MMC/Transflash slot
#/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0