高级会员
- 积分
- 813
- 金钱
- 813
- 注册时间
- 2021-2-26
- 在线时间
- 117 小时
|
上一个帖子我们讲到了分区表的修改,并且成功的分出了我们想要的分区表,现在我们烧录对应的文件到分区中。
由之前的帖子我们知道,烧录时候使用的烧录脚本是<mfgtool/Profiles/Linux/OS Firmware/ucl2.xml>,那我们直接对他进行修改。
修改前,我们要做一些记录:
uboot_a ====> /dev/mmcblk1boot0
uboot_b ====> /dev/mmcblk1boot1
boot_a ====> /dev/mmcblk1p1
boot_b ====> /dev/mmcblk1p2
rootfs_a ====> /dev/mmcblk1p5
rootfs_b ====> /dev/mmcblk1p6
userdata ====> /dev/mmcblk1p7
ucl2.xml修改如下:
- <LIST name="eMMC" desc="Choose eMMC as media">
- <CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot-imx6ull-14x14-emmc.imx" ifdev="MX6ULL">Loading U-boot</CMD>
-
- <CMD state="BootStrap" type="load" file="firmware/zImage" address="0x80800000"
- loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6ULL">Loading Kernel.</CMD>
- <CMD state="BootStrap" type="load" file="firmware/fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot" address="0x83800000"
- loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6ULL">Loading Initramfs.</CMD>
- <CMD state="BootStrap" type="load" file="firmware/imx6ull-14x14-emmc.dtb" address="0x83000000"
- loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6ULL">Loading device tree.</CMD>
- <CMD state="BootStrap" type="jump" > Jumping to OS image. </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/mmcblk1"> Partitioning...</CMD>
- <!-- burn uboot -->
- <CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk1 bs=1k seek=768 conv=fsync count=8">clear u-boot env</CMD>
- <CMD state="Updater" type="push" body="$ echo 0 > /sys/block/mmcblk1boot0/force_ro">access boot partition 1</CMD>
- <CMD state="Updater" type="push" body="$ echo 0 > /sys/block/mmcblk1boot1/force_ro">access boot partition 2</CMD> <!-- 打开emmc boot1的写入权限 -->
- <CMD state="Updater" type="push" body="send" file="files/boot/u-boot-imx6ull-14x14-ddr%ddr%-emmc1.imx" ifdev="MX6ULL">Sending u-boot1.bin</CMD>
- <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk1boot0 bs=512 seek=2">write U-Boot to boot1</CMD>
- <CMD state="Updater" type="push" body="$ sleep 1">delay</CMD>
- <CMD state="Updater" type="push" body="send" file="files/boot/u-boot-imx6ull-14x14-ddr%ddr%-emmc2.imx" ifdev="MX6ULL">Sending u-boot2.bin</CMD>
- <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk1boot1 bs=512 seek=2">write U-Boot to boot2</CMD> <!-- 写入uboot到emmc boot1分区 -->
- <CMD state="Updater" type="push" body="$ echo 1 > /sys/block/mmcblk1boot0/force_ro"> re-enable read-only access </CMD>
- <CMD state="Updater" type="push" body="$ echo 1 > /sys/block/mmcblk1boot1/force_ro"> re-enable read-only access </CMD> <!-- 关闭emmc boot1的写入权限 -->
- <CMD state="Updater" type="push" body="$ mmc bootpart enable 1 1 /dev/mmcblk1">enable boot partion 1 to boot</CMD>
- <!-- <CMD state="Updater" type="push" body="$ mmc bootpart enable 2 1 /dev/mmcblk1">enable boot partion 2 to boot</CMD> -->
- <!-- format and mount boot partition -->
- <CMD state="Updater" type="push" body="$ while [ ! -e /dev/mmcblk1p1 ]; do sleep 1; echo "waiting..."; done ">Waiting for the partition ready</CMD>
- <CMD state="Updater" type="push" body="$ mkfs.vfat -F 32 /dev/mmcblk1p1">Formatting boot partition1</CMD>
- <CMD state="Updater" type="push" body="$ mkfs.vfat -F 32 /dev/mmcblk1p2">Formatting boot partition2</CMD> <!-- 格式化/dev/mmcblk1p2为FAT32格式 -->
- <CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk1p1"/>
- <CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk1p2"/>
- <CMD state="Updater" type="push" body="$ mount -t vfat /dev/mmcblk1p1 /mnt/mmcblk1p1"/>
- <CMD state="Updater" type="push" body="$ mount -t vfat /dev/mmcblk1p2 /mnt/mmcblk1p2"/> <!-- 挂载/dev/mmcblk1p2到/mnt/mmcblk1p2 -->
- <CMD state="Updater" type="push" body="send" file="files/boot/zImage">Sending kernel zImage</CMD>
- <CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblk1p1/zImage">write kernel image to boot1</CMD>
- <CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblk1p2/zImage">write kernel image to boot2</CMD> <!-- 复制zImage到/mnt/mmcblk1p2 -->
- <CMD state="Updater" type="push" body="send" file="files/boot/imx6ull-alientek-emmc.dtb" ifdev="MX6ULL">Sending Device Tree file</CMD>
- <CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblk1p1/imx6ull-alientek-emmc.dtb" ifdev="MX6ULL">write device tree to boot1</CMD>
- <CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblk1p2/imx6ull-alientek-emmc.dtb" ifdev="MX6ULL">write device tree to boot2</CMD> <!-- 复制dtb到/mnt/mmcblk1p2 -->
-
- <CMD state="Updater" type="push" body="$ sleep 1">delay</CMD>
- <CMD state="Updater" type="push" body="$ sync">Sync...</CMD>
- <CMD state="Updater" type="push" body="$ umount /mnt/mmcblk1p1">Unmounting vfat partition</CMD>
- <CMD state="Updater" type="push" body="$ umount /mnt/mmcblk1p2">Unmounting vfat partition</CMD> <!-- 卸载/mnt/mmcblk1p2 -->
- <CMD state="Updater" type="push" body="$ mkfs.ext3 -F -E nodiscard /dev/mmcblk1p5">Formatting rootfs partition1</CMD>
- <CMD state="Updater" type="push" body="$ mkfs.ext3 -F -E nodiscard /dev/mmcblk1p6">Formatting rootfs partition2</CMD> <!-- 格式化/dev/mmcblk1p6为EXT3格式 -->
- <CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk1p5"/>
- <CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk1p6"/>
- <CMD state="Updater" type="push" body="$ mount -t ext3 /dev/mmcblk1p5 /mnt/mmcblk1p5"/>
- <CMD state="Updater" type="push" body="$ mount -t ext3 /dev/mmcblk1p6 /mnt/mmcblk1p6"/> <!-- 挂载/dev/mmcblk1p6到/mnt/mmcblk1p6 -->
- <CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblk1p5" file="files/filesystem/rootfs1.tar.bz2" ifdev="MX6ULL">Sending and writting rootfs1</CMD>
- <CMD state="Updater" type="push" body="frf">Finishing rootfs write</CMD>
- <CMD state="Updater" type="push" body="$ sleep 1">delay</CMD>
-
- <CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblk1p6" file="files/filesystem/rootfs2.tar.bz2" ifdev="MX6ULL">Sending and writting rootfs2</CMD> <!-- 拷贝rootfs文件到/mnt/mmcblk1p6 -->
- <CMD state="Updater" type="push" body="frf">Finishing rootfs write</CMD>
- <CMD state="Updater" type="push" body="$ sync">Sync...</CMD>
- <CMD state="Updater" type="push" body="$ umount /mnt/mmcblk1p5">Unmounting rootfs partition</CMD>
- <CMD state="Updater" type="push" body="$ umount /mnt/mmcblk1p6">Unmounting rootfs partition</CMD> <!-- 卸载/mnt/mmcblk1p6 -->
-
- <CMD state="Updater" type="push" body="$ mkfs.ext3 -F -E nodiscard /dev/mmcblk1p7">Formatting userdata partition1</CMD> <!-- 格式化/dev/mmcblk1p7为EXT3格式 -->
-
- <CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>
- </LIST>
复制代码
准备好对应的文件,使用mfgtool进行烧录,正常情况下,烧录会直接成功。那么接下来就是第一次开机启动了。
|
|