[英]Rootfs on SD card
I've a device on which I've a 3.10 linux kernel booting up to a busybox shell (initramfs) 我有一个在3.10 Linux内核上启动到busybox shell(initramfs)的设备
When I extracted the busybox filesystem image on the SD card and when modified the root from root=/dev/ram to /dev/mmcblck0p1, it still boots up to the shell So the busybox works fine but if I try to use any other FS the kernel would crash... 当我在SD卡上提取busybox文件系统映像并将根从root = / dev / ram修改为/ dev / mmcblck0p1时,它仍会引导至外壳,因此busybox可以正常工作,但是如果我尝试使用任何其他FS内核会崩溃...
While I try to generate a rootfs using debootstrap ( https://help.ubuntu.com/community/DebootstrapChroot ) and have the new rootfs extracted on the SD card. 当我尝试使用debootstrap( https://help.ubuntu.com/community/DebootstrapChroot )生成rootfs并将新的rootfs提取到SD卡上时。 I get an error saying "Failed to execute /sbin/init" I did check if the file is present and also checked the permissions and it looks good to me. 我收到一条错误消息“无法执行/ sbin / init”,我确实检查了文件是否存在,并检查了权限,它对我来说看起来不错。
What could be the problem? 可能是什么问题呢?
WRT rootfs I'm particularly new. WRT rootfs我特别新。 I was assuming that any FS on the SD card could be mounted but looks like its not the case. 我以为可以安装SD卡上的所有FS,但看起来并非如此。 I'm guessing that whatever the /sbin/init will be doing is device dependent? 我猜想/ sbin / init要做的是设备相关的?
What I am trying to do? 我要做什么? ---> I need to make a rootfs with a few packages and libraries (gcc python etc..) What would a normal approach? --->我需要用一些软件包和库(例如gcc python等)制作一个rootfs。正常的方法是什么? I've even tried buildroot but I couldn't get gcc on target. 我什至尝试过buildroot,但无法在目标上获得gcc。 Is it not possible to have gcc in /bin/ within buildroot? 在buildroot的/ bin /中是否没有gcc?
-- UPDATE -- -更新-
I'm formatting the SD card to ext4 format and following is the output of fdisk 我正在将SD卡格式化为ext4格式,以下是fdisk的输出
Disk /dev/sdb1: 7945 MB, 7945588224 bytes
255 heads, 63 sectors/track, 965 cylinders, total 15518727 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc2aa4908
Device Boot Start End Blocks Id System
And following are the kernel logs while I have a filesystem on the SD card. 以下是我在SD卡上有文件系统时的内核日志。 The memory card driver works fine I've verified that. 我已经验证了存储卡驱动程序的正常运行。 If I have a busybox filesystem on the SD card, everything works fine. 如果我在SD卡上有一个busybox文件系统,则一切正常。 When I'm using any other file systems I get the following... 当我使用任何其他文件系统时,我得到以下信息...
6EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
6VFS: Mounted root (ext4 filesystem) on device 179:1.
6Freeing unused kernel memory: 84K (c0f00000 - c0f15000)
3request_module: runaway loop modprobe binfmt-464c
4kworker/u2:4 (145) used greatest stack depth: 6132 bytes left
3Failed to execute /sbin/init. Attempting defaults...
3request_module: runaway loop modprobe binfmt-464c
3request_module: runaway loop modprobe binfmt-464c
0Kernel panic - not syncing: No init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
When checked, there is /sbin/init with the appropriate permissions that too! 选中后,还会有/ sbin / init也具有相应的权限!
Consider this error: "request_module: runaway loop modprobe binfmt-464c" 考虑以下错误:“ request_module:失控循环modprobe binfmt-464c”
In all probability you're trying to use 64b binaries ( /sbin/init
and the rest) with 32b only kernel. 您极有可能尝试将64b二进制文件( /sbin/init
和其余部分)与仅32b内核一起使用。 Either recompile your kernel to support 64b or install a 32b user space onto your sd card. 重新编译内核以支持64b或在SD卡上安装32b用户空间。
Other things to check: 其他要检查的内容:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.