- SD卡部分操作
- 烧录Uboot的bin文件
- 已经做好的文件系统打个包
- 查看编译出来的文件
-
使用dd命令将bin文件烧录到SD卡的开始位置(多运行几次!):dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
-
sync && eject /dev/sdb
-
/dev/sdx请替换为实际的TF卡设备文件名。
-
sync命令可以确保数据成功写到TF卡中,eject命令用于弹出TF卡。
注意:因为这个u-boot-sunxi-with-spl.bin文件比较大,所以在设置SD文件分区时需要在boot分区前预留至少3MiB的空间用来存放U-Boot文件。
已经做好的文件系统打个包- 进入SD卡文件系统分区的目录下(/media/liefyuan/rootfs)在目录下进行打包操作
- 命令打包:sudo tar -zcvf rootfs.tar.gz *
- 将这个压缩包解压到指定的目录(解压到SD卡的文件系统分区):sudo tar -zxvf rootfs.tar.gz -C /media/liefyuan/rootfs/
- readelf工具是在GNU binutils工具集里面的
- sudo apt-get install readelf
- 查看文件头:readelf -h targetApp
- 查看依赖库:readelf -d targetApp
$ readelf -h targetApp ELF Header: Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 Class: ELF32 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC (Executable file) Machine: ARM Version: 0x1 Entry point address: 0x10381 Start of program headers: 52 (bytes into file) Start of section headers: 5732 (bytes into file) Flags: 0x5000402, Version5 EABI, hard-float ABI,Size of this header: 52 (bytes) Size of program headers: 32 (bytes) Number of program headers: 8 Size of section headers: 40 (bytes) Number of section headers: 38 Section header string table index: 35



