Skip to contentSkip to conversation

wic:mx8: Fix the image creation

PATCH In review Daiane Angolini 3 participants 3 messages Jan 10, 2019 – Jan 11, 2019 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wic:mx8: Fix the image creation

imx8 family boards use u-boot as boot loader in addition to some other binaries. The final bootloader binary is gathered by mkimage into a file called imx-boot.

Add the wks file to create the wic image tailored for imx8 family. Fix the symbolic link file create to point to imx-boot (so it works for all the imx8 flavors).
Set the wks file as default for all imx8.

---
 conf/machine/include/imx-base.inc        |  3 +++
 recipes-bsp/imx-mkimage/imx-boot_0.2.bb  |  2 +-
 recipes-bsp/u-boot/u-boot-imx_2017.03.bb |  2 +-
 wic/imx-imx-boot-bootpart.wks            | 19 +++++++++++++++++++
 4 files changed, 24 insertions(+), 2 deletions(-)
 create mode 100644 wic/imx-imx-boot-bootpart.wks
conf/machine/include/imx-base.inc +3 -0
index 572e8e5e..005b71e1 100644
@@ -301,7 +301,10 @@ WKS_FILE_DEPENDS ?= " \
     bmap-tools-native \
 "
 
+WKS_FILE_DEPENDS_mx8 += "imx-boot"
+
 SOC_DEFAULT_WKS_FILE ?= "imx-uboot-bootpart.wks"
+SOC_DEFAULT_WKS_FILE_mx8 ?= "imx-imx-boot-bootpart.wks"
 SOC_DEFAULT_WKS_FILE_mxs ?= "imx-uboot-mxs-bootpart.wks.in"
 
 WKS_FILE ?= "${SOC_DEFAULT_WKS_FILE}"
recipes-bsp/imx-mkimage/imx-boot_0.2.bb +1 -1
index 5ffddd0e..b232ed52 100644
@@ -180,7 +180,7 @@ do_deploy() {
         install -m 0644 ${S}/${BOOT_CONFIG_MACHINE}-${target} ${DEPLOYDIR}
     done
     cd ${DEPLOYDIR}
-    ln -sf ${BOOT_CONFIG_MACHINE}-${IMAGE_IMXBOOT_TARGET} ${BOOT_CONFIG_MACHINE}
+    ln -sf ${BOOT_CONFIG_MACHINE}-${IMAGE_IMXBOOT_TARGET} ${BOOT_NAME}
     cd -
 }
 addtask deploy before do_build after do_compile
recipes-bsp/u-boot/u-boot-imx_2017.03.bb +1 -1
index 705ff164..86eca196 100644
@@ -35,7 +35,7 @@ do_deploy_append_mx8m() {
                     install -d ${DEPLOYDIR}/${BOOT_TOOLS}
                     install -m 0777 ${B}/${config}/arch/arm/dts/${UBOOT_DTB_NAME}  ${DEPLOYDIR}/${BOOT_TOOLS}
                     install -m 0777 ${B}/${config}/tools/mkimage  ${DEPLOYDIR}/${BOOT_TOOLS}/mkimage_uboot
-                    install -m 0777 ${B}/${config}/u-boot-nodtb.bin  ${DEPLOYDIR}/${BOOT_TOOLS}/u-boot-nodtb.bin-${MACHINE}-${UBOOT_CONFIG}
+                    install -m 0777 ${B}/${config}/u-boot-nodtb.bin  ${DEPLOYDIR}/${BOOT_TOOLS}/u-boot-nodtb.bin
                 fi
             done
             unset  j
wic/imx-imx-boot-bootpart.wks new file +19 -0
new file mode 100644
index 00000000..8bbcd6c0
@@ -0,0 +1,19 @@
+# short-description: Create SD card image with a boot partition
+# long-description:
+# Create an image that can be written onto a SD card using dd for use
+# with i.MX SoC family
+# It uses u-boot
+#
+# The disk layout used is:
+#  - ---------- -------------- --------------
+# | | imx-boot |     boot     |    rootfs   |
+#  - ---------- -------------- --------------
+# ^ ^          ^              ^
+# | |          |              |
+# 0 33kiB    4MiB          16MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
+#
+part u-boot --source rawcopy --sourceparams="file=imx-boot" --ondisk mmcblk --no-table --align 33
+part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 16
+part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096
+
+bootloader --ptable msdos
\ No newline at end of file
Signature · 1 line
2.17.1
#1 lore raw

Hi Daiane!

Quoted 24 lines · Daiane Angolini

imx8 family boards use u-boot as boot loader in addition to some other binaries. The final bootloader binary is gathered by mkimage into a file called imx-boot.

Add the wks file to create the wic image tailored for imx8 family. Fix the symbolic link file create to point to imx-boot (so it works for all the imx8 flavors).
Set the wks file as default for all imx8.

---
 conf/machine/include/imx-base.inc        |  3 +++
 recipes-bsp/imx-mkimage/imx-boot_0.2.bb  |  2 +-
 recipes-bsp/u-boot/u-boot-imx_2017.03.bb |  2 +-
 wic/imx-imx-boot-bootpart.wks            | 19 +++++++++++++++++++
 4 files changed, 24 insertions(+), 2 deletions(-)
 create mode 100644 wic/imx-imx-boot-bootpart.wks
conf/machine/include/imx-base.inc +0 -0
index 572e8e5e..005b71e1 100644

conf/machine/include/imx-base.inc WKS_FILE_DEPENDS ?= " \ · line 307

Quoted 7 lines
conf/machine/include/imx-base.inc +3 -0
@@ -301,7 +301,10 @@ WKS_FILE_DEPENDS ?= " \
     bmap-tools-native \
 "
 
+WKS_FILE_DEPENDS_mx8 += "imx-boot"
+
 SOC_DEFAULT_WKS_FILE ?= "imx-uboot-bootpart.wks"
+SOC_DEFAULT_WKS_FILE_mx8 ?= "imx-imx-boot-bootpart.wks"

Why duplicate imx- prefix?

Quoted 63 lines
conf/machine/include/imx-base.inc +0 -0
 SOC_DEFAULT_WKS_FILE_mxs ?= "imx-uboot-mxs-bootpart.wks.in"
 
 WKS_FILE ?= "${SOC_DEFAULT_WKS_FILE}"
recipes-bsp/imx-mkimage/imx-boot_0.2.bb +1 -1
index 5ffddd0e..b232ed52 100644
@@ -180,7 +180,7 @@ do_deploy() {
         install -m 0644 ${S}/${BOOT_CONFIG_MACHINE}-${target} ${DEPLOYDIR}
     done
     cd ${DEPLOYDIR}
-    ln -sf ${BOOT_CONFIG_MACHINE}-${IMAGE_IMXBOOT_TARGET} ${BOOT_CONFIG_MACHINE}
+    ln -sf ${BOOT_CONFIG_MACHINE}-${IMAGE_IMXBOOT_TARGET} ${BOOT_NAME}
     cd -
 }
 addtask deploy before do_build after do_compile
recipes-bsp/u-boot/u-boot-imx_2017.03.bb +1 -1
index 705ff164..86eca196 100644
@@ -35,7 +35,7 @@ do_deploy_append_mx8m() {
                     install -d ${DEPLOYDIR}/${BOOT_TOOLS}
                     install -m 0777 ${B}/${config}/arch/arm/dts/${UBOOT_DTB_NAME}  ${DEPLOYDIR}/${BOOT_TOOLS}
                     install -m 0777 ${B}/${config}/tools/mkimage  ${DEPLOYDIR}/${BOOT_TOOLS}/mkimage_uboot
-                    install -m 0777 ${B}/${config}/u-boot-nodtb.bin  ${DEPLOYDIR}/${BOOT_TOOLS}/u-boot-nodtb.bin-${MACHINE}-${UBOOT_CONFIG}
+                    install -m 0777 ${B}/${config}/u-boot-nodtb.bin  ${DEPLOYDIR}/${BOOT_TOOLS}/u-boot-nodtb.bin
                 fi
             done
             unset  j
wic/imx-imx-boot-bootpart.wks new file +19 -1
new file mode 100644
index 00000000..8bbcd6c0
@@ -0,0 +1,19 @@
+# short-description: Create SD card image with a boot partition
+# long-description:
+# Create an image that can be written onto a SD card using dd for use
+# with i.MX SoC family
+# It uses u-boot
+#
+# The disk layout used is:
+#  - ---------- -------------- --------------
+# | | imx-boot |     boot     |    rootfs   |
+#  - ---------- -------------- --------------
+# ^ ^          ^              ^
+# | |          |              |
+# 0 33kiB    4MiB          16MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
+#
+part u-boot --source rawcopy --sourceparams="file=imx-boot" --ondisk mmcblk --no-table --align 33
+part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 16
+part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096
+
+bootloader --ptable msdos
\ No newline at end of file
--

2.17.1

--
_______________________________________________
meta-freescale mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-freescale

#2 lore raw
Quoted 32 lines · Fabio Berton

Hi Daiane!

Quoted 27 lines · Daiane Angolini

imx8 family boards use u-boot as boot loader in addition to some other binaries. The final bootloader binary is gathered by mkimage into a file called imx-boot.

Add the wks file to create the wic image tailored for imx8 family. Fix the symbolic link file create to point to imx-boot (so it works for all the imx8 flavors).
Set the wks file as default for all imx8.

---
 conf/machine/include/imx-base.inc        |  3 +++
 recipes-bsp/imx-mkimage/imx-boot_0.2.bb  |  2 +-
 recipes-bsp/u-boot/u-boot-imx_2017.03.bb |  2 +-
 wic/imx-imx-boot-bootpart.wks            | 19 +++++++++++++++++++
 4 files changed, 24 insertions(+), 2 deletions(-)
 create mode 100644 wic/imx-imx-boot-bootpart.wks
conf/machine/include/imx-base.inc +0 -0
index 572e8e5e..005b71e1 100644
@@ -301,7 +301,10 @@ WKS_FILE_DEPENDS ?= " \
     bmap-tools-native \
 "
 
Quoted 6 lines

conf/machine/include/imx-base.inc WKS_FILE_DEPENDS ?= " \ · line 307

Quoted 4 lines
conf/machine/include/imx-base.inc +3 -0
+WKS_FILE_DEPENDS_mx8 += "imx-boot"
+
 SOC_DEFAULT_WKS_FILE ?= "imx-uboot-bootpart.wks"
+SOC_DEFAULT_WKS_FILE_mx8 ?= "imx-imx-boot-bootpart.wks"

Why duplicate imx- prefix?

Because I replaced "uboot" by "imx-boot", which is the file name, and didn't realized there were 2 imx.

What filename would you suggest?

Daiane

Quoted 69 lines
Quoted 59 lines
conf/machine/include/imx-base.inc +0 -0
 SOC_DEFAULT_WKS_FILE_mxs ?= "imx-uboot-mxs-bootpart.wks.in"
 
 WKS_FILE ?= "${SOC_DEFAULT_WKS_FILE}"
recipes-bsp/imx-mkimage/imx-boot_0.2.bb +1 -1
index 5ffddd0e..b232ed52 100644
@@ -180,7 +180,7 @@ do_deploy() {
         install -m 0644 ${S}/${BOOT_CONFIG_MACHINE}-${target} ${DEPLOYDIR}
     done
     cd ${DEPLOYDIR}
-    ln -sf ${BOOT_CONFIG_MACHINE}-${IMAGE_IMXBOOT_TARGET} ${BOOT_CONFIG_MACHINE}
+    ln -sf ${BOOT_CONFIG_MACHINE}-${IMAGE_IMXBOOT_TARGET} ${BOOT_NAME}
     cd -
 }
 addtask deploy before do_build after do_compile
recipes-bsp/u-boot/u-boot-imx_2017.03.bb +1 -1
index 705ff164..86eca196 100644
@@ -35,7 +35,7 @@ do_deploy_append_mx8m() {
                     install -d ${DEPLOYDIR}/${BOOT_TOOLS}
                     install -m 0777 ${B}/${config}/arch/arm/dts/${UBOOT_DTB_NAME}  ${DEPLOYDIR}/${BOOT_TOOLS}
                     install -m 0777 ${B}/${config}/tools/mkimage  ${DEPLOYDIR}/${BOOT_TOOLS}/mkimage_uboot
-                    install -m 0777 ${B}/${config}/u-boot-nodtb.bin  ${DEPLOYDIR}/${BOOT_TOOLS}/u-boot-nodtb.bin-${MACHINE}-${UBOOT_CONFIG}
+                    install -m 0777 ${B}/${config}/u-boot-nodtb.bin  ${DEPLOYDIR}/${BOOT_TOOLS}/u-boot-nodtb.bin
                 fi
             done
             unset  j
wic/imx-imx-boot-bootpart.wks new file +19 -1
new file mode 100644
index 00000000..8bbcd6c0
@@ -0,0 +1,19 @@
+# short-description: Create SD card image with a boot partition
+# long-description:
+# Create an image that can be written onto a SD card using dd for use
+# with i.MX SoC family
+# It uses u-boot
+#
+# The disk layout used is:
+#  - ---------- -------------- --------------
+# | | imx-boot |     boot     |    rootfs   |
+#  - ---------- -------------- --------------
+# ^ ^          ^              ^
+# | |          |              |
+# 0 33kiB    4MiB          16MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
+#
+part u-boot --source rawcopy --sourceparams="file=imx-boot" --ondisk mmcblk --no-table --align 33
+part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 16
+part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096
+
+bootloader --ptable msdos
\ No newline at end of file
--

2.17.1

Quoted 5 lines

--
_______________________________________________
meta-freescale mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-freescale

--
_______________________________________________
meta-freescale mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-freescale