Lex*_*uxx 6 embedded devices block-device linux-kernel
嵌入式 Linux 2.6.26.5。我需要从 busybox shell (initramfs) 手动挂载根文件系统。因为这个 Linux 内核不使用 devtmpfs,所以我必须手动创建基本设备节点,使用 mknod ( /dev/null
, /dev/zero
, dev/mtdblock
{0-10}, ttys
)。我不确定/dev/mtdblock
和的正确格式ttys
。我应该为 /dev/mtdblock 和 /dev/mtd 创建节点吗?设备在 nand0 上创建 11 个 MTD 分区。在哪里可以找到分配给设备的主设备号和次设备号?对于 ttys 来说同样的问题:正确的 mknod 命令是什么 5 /dev/tty
- 4 tty
它们在不同的地方吗?
mknod -m 666 tty c 4 0
mknod -m 666 /dev/tty c 5 0
Run Code Online (Sandbox Code Playgroud)
编辑:分区、设备和文件系统
# cat /proc/partitions
major minor #blocks name
31 0 384 mtdblock0
31 1 128 mtdblock1
31 2 20352 mtdblock2
31 3 7168 mtdblock3
31 4 18816 mtdblock4
31 5 2048 mtdblock5
31 6 1024 mtdblock6
31 7 512 mtdblock7
31 8 128 mtdblock8
31 9 512 mtdblock9
31 10 512 mtdblock10
# cat /proc/devices
Character devices:
1 mem
2 pty
3 ttyp
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
7 vcs
10 misc
13 input
89 i2c
90 mtd
108 ppp
128 ptm
136 pts
153 spi
204 ttyJ
254 cordless
Block devices:
1 ramdisk
31 mtdblock
93 nftl
Run Code Online (Sandbox Code Playgroud)