I.MX6 Manufacturing Tool V2 (MFGTool2) Emmc mksdcard.sh hacking
2024-10-19 00:26:29
#!/bin/sh # 参考文章:
# . MFGTool Emmc mksdcard.sh MFGTool Emmc mksdcard.sh comment
# http://jordonwu.github.io/blog/2015/05/14/mfgtool-emmc-mksdcard-dot-sh/
# . linux sfdisk partition
# http://blog.csdn.net/shell_albert/article/details/8425530 #<!-- partitioning the eMMC: -->
#<CMD state="Updater" type="push" body="$ echo 8 > /sys/devices/platform/sdhci-esdhc-imx.3/mmc_host/mmc0/mmc0:0001/boot_config">access user partition and enable boot partion to boot</CMD>
#<CMD state="Updater" type="push" body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>
#<CMD state="Updater" type="push" body="$ tar xf $FILE "> Partitioning...</CMD>
#<CMD state="Updater" type="push" body="$ sh mksdcard.sh /dev/mmcblk0"> Partitioning SD card now...</CMD> # partition size in MB
# 这里定义的是启动ROM 10MB
BOOT_ROM_SIZE= # call sfdisk to create partition table
# destroy the partition table
# $: 为命令行第一个传递的参数
# node: /dev/mmcblk0
# 将前导一个1024字节(1KB)大小的分区零0,也就是分区表擦除
node=$
dd if=/dev/zero of=${node} bs= count= # sfdisk reads lines of the form
# <start> <size> <id>< bootable> <c,h,s> <c,h,s>
# where each line fills one partition descriptor.
#
# --force: disable all consistency checking
# -uS, -uB, -uC, -uM: 以扇面/块/柱面数/MB为单位 显示或形成报告
# SmartFdisk –uM表示以MB为单位生成报告 即: sfdisk --force -um /dev/mmcblk0 <<EOF
#
# BOOT_ROM_SIZE:
# 而分区则是使用sfdisk进行的,空出了uboot和kernel的位置,从起始地址10MB开始的:
# (,,) 将其10M以后所有空间分成一个区,,此处应该就是mmcblk0p1,其中83是Linux分区标识
#
# Uboot和kernel是直接使用dd写入mmcblk0中的:
# <!-- burn the uboot: -->
# <CMD state="Updater" type="push" body="send" file="files/u-boot.bin">Sending U-Boot</CMD>
# <CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk0 bs=512 seek=2 count=2000">Clean U-Bootenvironment</CMD>
# <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk0 bs=512 seek=2 skip=2">write U-Boot to sdcard</CMD>
#
# <!-- burn the kernel: -->
# <CMD state="Updater" type="push" body="send" file="files/uImage">Sending kernel uImage</CMD>
# <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk0 bs=1M seek=1 conv=fsync">write kernel image to emmc</CMD> sfdisk --force -uM ${node} << EOF
${BOOT_ROM_SIZE},,
EOF
最新文章
- 【C#】项目优化实战
- RHEL6p5下ntfs分区的挂载及自动挂载
- Autolayout学习(1)-了解Autoreszing
- java获取时间戳的方法
- Google Protocol Buffer 的使用和原理
- ASPxTreeList控件去根节点的新增修改操作(写在onCommandColumnButtonInitialize()事件中)
- 数组Magic Index
- Linux开发环境的搭建和使用——Linux本必备软件SSH
- Java迭代器Iterator
- NetFPGA Demo ——reference_router_nf1_cml
- 如何在现有的 Web 应用中使用 ReactJS
- HTML DOM 改变 HTML 内容
- margin塌陷与margin合并(margin),清除浮动
- 洛谷.1919.[模板]A*B Problem升级版(FFT)
- 经验:使用 Cache 时注意 DateTime.Now
- Node.js是用来干嘛的
- spring/spirng boot添加fluent日志-aop
- &hellip;gen already exists but is not a source folder. Convert to a source folder or rename it [closed]
- Java Toolkit类用法
- centos7 关闭默认firewalld,开启iptables
热门文章
- Deep Learning(5)
- JQuery表格操作的常用技巧总结
- 索引查找Java实现
- VS2010/MFC编程入门之十(对话框:设置对话框控件的Tab顺序)
- python webdriver 测试框架-数据驱动xml驱动方式
- Centos75 安装 postgresql11
- 从知乎了解到,为什么Mysql禁用存储过程、外键和级联?
- bzoj1602 / P2912 [USACO08OCT]牧场散步Pasture Walking(倍增lca)
- 关于Drupal中使用hook_schema建立数据库报错PDOException: SQLSTATE[42000]的解决办法
- linux下如何安装解压工具rar