栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

嵌入式Linux开发--Ubuntu系统下容易忘记的操作

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

嵌入式Linux开发--Ubuntu系统下容易忘记的操作

文章目录
  • SD卡部分操作
    • 烧录Uboot的bin文件
    • 已经做好的文件系统打个包
  • 查看编译出来的文件

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

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/830780.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号