#!/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

最新文章

  1. 【C#】项目优化实战
  2. RHEL6p5下ntfs分区的挂载及自动挂载
  3. Autolayout学习(1)-了解Autoreszing
  4. java获取时间戳的方法
  5. Google Protocol Buffer 的使用和原理
  6. ASPxTreeList控件去根节点的新增修改操作(写在onCommandColumnButtonInitialize()事件中)
  7. 数组Magic Index
  8. Linux开发环境的搭建和使用——Linux本必备软件SSH
  9. Java迭代器Iterator
  10. NetFPGA Demo ——reference_router_nf1_cml
  11. 如何在现有的 Web 应用中使用 ReactJS
  12. HTML DOM 改变 HTML 内容
  13. margin塌陷与margin合并(margin),清除浮动
  14. 洛谷.1919.[模板]A*B Problem升级版(FFT)
  15. 经验:使用 Cache 时注意 DateTime.Now
  16. Node.js是用来干嘛的
  17. spring/spirng boot添加fluent日志-aop
  18. &hellip;gen already exists but is not a source folder. Convert to a source folder or rename it [closed]
  19. Java Toolkit类用法
  20. centos7 关闭默认firewalld,开启iptables

热门文章

  1. Deep Learning(5)
  2. JQuery表格操作的常用技巧总结
  3. 索引查找Java实现
  4. VS2010/MFC编程入门之十(对话框:设置对话框控件的Tab顺序)
  5. python webdriver 测试框架-数据驱动xml驱动方式
  6. Centos75 安装 postgresql11
  7. 从知乎了解到,为什么Mysql禁用存储过程、外键和级联?
  8. bzoj1602 / P2912 [USACO08OCT]牧场散步Pasture Walking(倍增lca)
  9. 关于Drupal中使用hook_schema建立数据库报错PDOException: SQLSTATE[42000]的解决办法
  10. linux下如何安装解压工具rar