交叉编译飞思卡尔imx6烧写工具MFGtools脚本中的sfdisk小软件

MFGtools中的脚本中有如此一段

sfdisk --force -uM ${node} << EOF
${BOOT_ROM_SIZE},500,0c
600,,83
EOF

里面用到了sfdisk工具来进行文件系统的分区工作。在实际的开发中,主板上没有预留USB OTG,所以MFGtools工具无法使用。出现问题后重新烧写uboot和image以及文件系统时只能用串口。

实际搭建环境为:

  1. VMware虚拟机
  2. Ubuntu12.04
  3. 已搭建TFTP和NFS

将uboot.bin 和 uImage 及文件系统解压至Ubuntu系统的NFS文件夹中。将自己做好的烧写sh脚本放在NFS文件系统。首先要保证板子至少uboot好用,可以正常从NFS启动。

然后编译的是https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.23/util-linux-2.23.1.tar.bz2

交叉编译链为arm-linux-gcc-4.6.3版本

配置命令为./configure --host=arm-linux CC=arm-linux-gcc --prefix=/home/xxx/util-linux-2.23.1/_install --without-ncurses

然后make 最后make install。

可能最后make install的时候会有错误,但sfdisk工具已经生成,复制到NFS中文件系统的sbin目录中,arm使用没有任何问题。

~ # sfdisk

Usage:
 sfdisk [options]  [...]

Options:
 -s, --show-size           list size of a partition
 -c, --id                  change or print partition Id
     --change-id           change Id
     --print-id            print Id
 -l, --list                list partitions of each device
 -d, --dump                idem, but in a format suitable for later input
 -i, --increment           number cylinders etc. from 1 instead of from 0
 -u, --unit        units to be used;  can be one of
                             S (sectors), C (cylinders), B (blocks), or M (MB)
 -1, --one-only            reserved option that does nothing currently
 -T, --list-types          list the known partition types
 -D, --DOS                 for DOS-compatibility: waste a little space
 -E, --DOS-extended        DOS extended partition compatibility
 -R, --re-read             make the kernel reread the partition table
 -N                change only the partition with this 
 -n                        do not actually write to disk
 -O                  save the sectors that will be overwritten to 
 -I                  restore sectors from 
 -V, --verify              check that the listed partitions are reasonable
 -v, --version             display version information and exit
 -h, --help                display this help text and exit

Dangerous options:
 -f, --force               disable all consistency checking
     --no-reread           do not check whether the partition is in use
 -q, --quiet               suppress warning messages
 -L, --Linux               do not complain about things irrelevant for Linux
 -g, --show-geometry       print the kernel's idea of the geometry
 -G, --show-pt-geometry    print geometry guessed from the partition table
 -A, --activate[=] activate bootable flag
 -U, --unhide[=]      set partition unhidden
 -x, --show-extended       also list extended partitions in the output,
                             or expect descriptors for them in the input
     --leave-last          do not allocate the last cylinder
     --IBM                 same as --leave-last
     --in-order            partitions are in order
     --not-in-order        partitions are not in order
     --inside-outer        all logicals inside outermost extended
     --not-inside-outer    not all logicals inside outermost extended
     --nested              every partition is disjoint from all others
     --chained             like nested, but extended partitions may lie outside
     --onesector           partitions are mutually disjoint

Override the detected geometry using:
 -C, --cylinders   set the number of cylinders to use
 -H, --heads       set the number of heads to use
 -S, --sectors     set the number of sectors to use

 

你可能感兴趣的:(LINUX)