1.修改Ramdisk文件夹中的update.sh:
/sbin/fdisk /dev/mmcblk0 << EOF d 2 n p 2 172416
w EOF
为:
/sbin/fdisk /dev/mmcblk0 << EOF d 2 n p 2 172416 14897471 w EOF
注:其中172416为起始sector,14897471为结束sector,当输入回车时,是默认值(最大值)。
2.编译后把ramdisk.img.gz放到烧写sd卡中进行烧写。 3.烧录完成,启动系统,用fdisk重新分区 root@ok6254:~# fdisk /dev/mmcblk0 Command (m for help): n Partition type p primary (2 primary, 0 extended, 2 free) e extended (container for logical partitions) Select (default p): p Partition number (3,4, default 3): 3 First sector (14897472-15269887, default 14899200): (回车) Last sector, +/-sectors or +/-size{K,M,G,T,P} (14899200-15269887, default 15269887): (回车)
Created a new partition 3 of type 'Linux' and of size 181 MiB.
Command (m for help): w The partition table has been altered. Syncing disks. root@ok6254:~# mkfs.ext4 /dev/mmcblk0p3 mke2fs 1.45.7 (28-Jan-2021) Discarding device blocks: done Creating filesystem with 185344 1k blocks and 46368 inodes Filesystem UUID: 022088fc-b884-456b-af55-f601fbd15a7f Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729
Allocating group tables: done Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done
root@ok6254:~# mkdir /run/media/mmcblk0p3/ root@ok6254:~# mount /dev/mmcblk0p3 /run/media/mmcblk0p3 |
|小黑屋|
飞凌嵌入式
( 冀ICP备12004394号-1 )
GMT+8, 2026-4-4 04:10
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.