Hi igorpadykov
Thanks for your reply.
The *.sh scripts you mentioned for repartitioning shows below:
#!/bin/sh
# partition size in MB
BOOT_ROM_SIZE=10
# wait for the SD/MMC device node ready
while [ ! -e $1 ]
do
sleep 1
echo “wait for $1 appear”
done
# call sfdisk to create partition table
# destroy the partition table
node=$1
dd if=/dev/zero of=${node} bs=1024 count=1
sfdisk --force ${node} << EOF
${BOOT_ROM_SIZE}M,500M,0c
600M,,83
EOF
The ucl2.xml related shows below:
<LIST name="eMMC" desc="Choose eMMC as media">
<CMD state="BootStrap" type="boot" body="BootStrap" file ="%product%/%mfg_uboot%" ifdev="MX6Q MX6DL MX6D">Loading U-boot</CMD>
<CMD state="BootStrap" type="load" file="%product%/%mfg_kernel%" address="0x12000000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q MX6DL MX6D">Loading Kernel.</CMD>
<CMD state="BootStrap" type="load" file="%product%/%mfg_initramfs%" address="0x12C00000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q MX6DL MX6D">Loading Initramfs.</CMD>
<CMD state="BootStrap" type="load" file="%product%/%mfg_dtb%" address="0x18000000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q MX6DL MX6D">Loading device tree.</CMD>
<CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD>
<!-- create partition -->
<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/mmcblk%mmc%"> Partitioning...</CMD>
<!-- burn uboot -->
<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=384 conv=fsync count=129">clear u-boot arg</CMD>
<!-- access boot partition -->
<CMD state="Updater" type="push" body="$ echo 0 > /sys/block/mmcblk%mmc%boot0/force_ro">access boot partition 1</CMD>
<CMD state="Updater" type="push" body="send" file="%product%/%uboot%" ifdev="MX6Q MX6DL MX6D">Sending u-boot.bin</CMD>
<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc%boot0 bs=512 seek=2">write U-Boot to sd card</CMD>
<CMD state="Updater" type="push" body="$ echo 1 > /sys/block/mmcblk%mmc%boot0/force_ro"> re-enable read-only access </CMD>
<CMD state="Updater" type="push" body="$ mmc bootpart enable 1 1 /dev/mmcblk%mmc%">enable boot partion 1 to boot</CMD>
<!-- create fat partition -->
<CMD state="Updater" type="push" body="$ mkfs.vfat /dev/mmcblk%mmc%p1">Formatting rootfs partition</CMD>
<CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk%mmc%p1"/>
<CMD state="Updater" type="push" body="$ mount -t vfat /dev/mmcblk%mmc%p1 /mnt/mmcblk%mmc%p1"/>
<!-- burn zImage -->
<CMD state="Updater" type="push" body="send" file="%product%/%kernel%">Sending kernel zImage</CMD>
<CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblk%mmc%p1/zImage">write kernel image to sd card</CMD>
<!-- burn dtb -->
<CMD state="Updater" type="push" body="send" file="%product%/%dtb%" ifdev="MX6Q MX6DL MX6D">Sending Device Tree file</CMD>
<CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblk%mmc%p1/zImage.dtb" ifdef="MX6Q MX6DL MX6D">write device tree to sd card</CMD>
<CMD state="Updater" type="push" body="$ umount /mnt/mmcblk%mmc%p1">Unmounting vfat partition</CMD>
<!-- burn rootfs -->
<CMD state="Updater" type="push" body="$ mkfs.ext4 -E nodiscard -F /dev/mmcblk%mmc%p2">Formatting rootfs partition</CMD>
<CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk%mmc%p2"/>
<CMD state="Updater" type="push" body="$ mount -t ext4 /dev/mmcblk%mmc%p2 /mnt/mmcblk%mmc%p2"/>
<CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblk%mmc%p2" file="%product%/%rootfs%" ifdev="MX6Q MX6DL MX6D">Sending and writting rootfs</CMD>
<!-- deploy software -->
<CMD state="Updater" type="push" body="frf">Deploy software</CMD>
<CMD state="Updater" type="push" body="send" file="%product%/%deploy%">Sending deploy</CMD>
<CMD state="Updater" type="push" body="$ df -h"/>
<CMD state="Updater" type="push" body="$ cat /proc/cmdline"/>
<CMD state="Updater" type="push" body="$ tar jxvpf $FILE ">Extracting deploy</CMD>
<CMD state="Updater" type="push" body="$ sh deploy.sh /mnt/mmcblk%mmc%p2">Exec deploy</CMD>
<CMD state="Updater" type="push" body="frf">Finishing rootfs write</CMD>
<CMD state="Updater" type="push" body="$ umount /mnt/mmcblk%mmc%p2">Unmounting rootfs partition</CMD>
<CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>
</LIST>
I repartitioned EMMC for two partion(/dev/mmcblk2p1(490M) and /dev/mmcblk2p2(else)) and the script seems work fine because my customer board can boot up even though the download process was failed(only some of the rootfs file was not been fully written).I am confused now because I don't know what device or partition was mounted as rootfs when MFGtool was running.Please give me some direction to investigate the issue.
Best regards,
Azmat