【发布时间】:2016-05-10 22:00:26
【问题描述】:
我正在尝试使用 initramfs 作为我的文件系统来启动 linux 内核。 我希望我的文件系统最小,所以我只使用没有 rootfs 的 initramfs。现在一旦内核启动它从 initramfs 执行 /init,我尝试在 init 中挂载 proc 和 sysfs,如下所示。
#!/bin/busybox sh
echo "Mounting Proc and Sysfs"
# Mount the /proc and /sys filesystems.
mount -t proc none /proc
mount -t sysfs none /sys
我还需要添加什么才能使用 initramfs 获取命令提示符。当我执行上面的 init 命令时出现以下错误。
New FileSystem
Mounting Proc and Sysfs
This script just
[ 4.524724] sh (116) used greatest stack depth: 13832 bytes left mounts and boots the rootfs, nothing else!
[ 4.537448] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
[ 4.537448]
[ 4.537453] CPU: 0 PID: 1 Comm: init Not tainted 4.1.17-ltsi-rt18 #4
【问题讨论】:
-
请修正您的格式
标签: linux