IMX6-使用mfgtool只燒寫內核

目的:其餘文件不動,只燒寫內核--根據內容可以進行修改,燒寫設備樹,或是文件系統等,舉一反三

在mfgtools根目錄下,打開cfg.ini文件,看到name後的名字,當前爲“eMMC-linux”;

打開“Profiles\Linux\OS Firmware\ucl2.xml文件,找到“eMMC-linux”,如下

<LIST name="eMMC-linux" desc="Choose eMMC as media">
	<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot.imx" ifdev="MX6Q">Loading U-boot</CMD>
		
	<CMD state="BootStrap" type="load" file="firmware/zImage_mfgtool" address="0x12000000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q MX6D">Loading Kernel.</CMD>
	<CMD state="BootStrap" type="load" file="firmware/zImage" address="0x80800000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL">Loading Kernel.</CMD>

	<CMD state="BootStrap" type="load" file="firmware/fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot" address="0x12C00000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q MX6D">Loading Initramfs.</CMD>

	<CMD state="BootStrap" type="load" file="firmware/imx6q-sabresd.dtb" address="0x18000000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q">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/mmcblk3"> Partitioning...</CMD>

	<!-- burn uboot -->
	<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk3 bs=1k seek=384 conv=fsync count=16">clear u-boot arg</CMD>
	<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk3 bs=1k seek=768 conv=fsync count=16">clear u-boot arg</CMD>
	<!-- access boot partition -->
	<CMD state="Updater" type="push" body="$ echo 0 > /sys/block/mmcblk3boot0/force_ro">access boot partition 1</CMD>
	<CMD state="Updater" type="push" body="$ echo 0 > /sys/block/mmcblk3/force_ro">access linux4.1 boot partition 1</CMD>
	
	<CMD state="Updater" type="push" body="send" file="files/linux/u-boot.imx" ifdev="MX6Q">Sending u-boot.bin</CMD>
	<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk3boot0 bs=512 seek=2">write U-Boot to sd card</CMD>
	<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk3 bs=512 seek=2;sync">write U-Boot to sd card</CMD>
	
	<CMD state="Updater" type="push" body="$ echo 1 > /sys/block/mmcblk3boot0/force_ro"> re-enable read-only access </CMD>
	<CMD state="Updater" type="push" body="$ mmc bootpart enable 1 1 /dev/mmcblk3">enable boot partion 1 to boot</CMD>

	<!-- create fat partition -->
	<CMD state="Updater" type="push" body="$ while [ ! -e /dev/mmcblk3p1 ]; do sleep 1; echo \"waiting...\"; done ">Waiting for the partition ready</CMD>
	<CMD state="Updater" type="push" body="$ mkfs.vfat /dev/mmcblk3p1">Formatting rootfs partition</CMD>
	<CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk3p1"/>
	<CMD state="Updater" type="push" body="$ mount -t vfat /dev/mmcblk3p1 /mnt/mmcblk3p1"/>

	<!-- burn zImage -->
	<CMD state="Updater" type="push" body="send" file="files/linux/zImage">Sending kernel zImage</CMD>
	<CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblk3p1/zImage">write kernel image to sd card</CMD>

	<!-- burn dtb -->
	<CMD state="Updater" type="push" body="send" file="files/linux/imx6q-sabresd.dtb" ifdev="MX6Q">Sending Device Tree file</CMD>
	<CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblk3p1/imx6q-sabresd.dtb" ifdef="MX6Q">write device tree to sd card</CMD>
	<CMD state="Updater" type="push" body="send" file="ramdisk.gz">Sending ramdisk</CMD>
	<CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblk3p1/ramdisk.gz">write ramdisk image to sd card</CMD>
	
	<CMD state="Updater" type="push" body="$ umount /mnt/mmcblk3p1">Unmounting vfat partition</CMD>

	<!-- burn rootfs -->
	<CMD state="Updater" type="push" body="$ mkfs.ext3 -E nodiscard /dev/mmcblk3p2">Formatting rootfs partition</CMD>
	<CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk3p2"/>
	<CMD state="Updater" type="push" body="$ mount -t ext3 /dev/mmcblk3p2 /mnt/mmcblk3p2"/>
	<CMD state="Updater" type="push" body="pipe tar -zxv -C /mnt/mmcblk3p2" file="files/linux/rootfs.tgz" ifdev="MX6SL MX6D MX6Q MX6SX">Sending and writting rootfs</CMD>
	<CMD state="Updater" type="push" body="frf">Finishing rootfs write</CMD>
	<CMD state="Updater" type="push" body="$ umount /mnt/mmcblk3p2">Unmounting rootfs partition</CMD>
	
	<CMD state="Updater" type="push" body="$ mkfs.ext3 -E nodiscard /dev/mmcblk3p3">Formatting recovery partition</CMD>
	<CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>
  </LIST>

 

 

修改燒寫文件,但是下面這個部分不要進行修改

 

 

修改內容如下:(註釋的方法是<!--   -->)

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章