Hi community,
Mfgtool get stuck with the error "write error: No space left on device" when I download a big image(about 200MB) to my customer board.I checked with command "df -h" and here is the result:
UTP: received command '$ df -h'
UTP: executing "df -h"
Filesystem Size Used Avail Use% Mounted on
rootfs 86M 60M 27M 70% /
none 86M 0 86M 0% /dev
/dev/mmcblk2p2 3.0G 128M 2.7G 5% /mnt/mmcblk2p2
UTP: sending Success to kernel for command $ df -h.
utp_poll: pass returned.
I used 512M DDR3 and 4GB EMMC but only 86M space was available when I downloaded the image.
Why there is only 86M available and how can I fix this issue?
Regards,
Azmat
Finally,I found out the solution but don't the reason...
Hi Azmat
for repartitioning one can try to use *.sh scripts in MFG Tool
..Profiles/Linux/OS Firmware folder.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Any ideas?
MFG Tool is small linux image, so answers can be found analysing
its scripts and linux documentation.
Best regards
igor
Hi igor,
I don't think I've got the ability to find the answer.T_T~
I have read and modified the scripts but still got no idea about the size of the rootfs.
I think the rootfs should be mounted from the g_mass_storage device which is a ram based file system.
Continue from the last reply...
Did the size of the rootfs depend on the size of the ram file system named as initramfs..cpio.gz.u-boot?
If so,how can I expand the capacity?How can I create my own initramfs?
Any suggestion would be greatly appreciated.
Regards,
Azmat
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