Skip to contentSkip to conversation

Flexibilize sdcard generation

PATCH Applied Otavio Salvador 1 participant 4 messages Dec 10, 2012 – Dec 12, 2012

lore
Share & tools
lore
#0 lore raw

cover Flexibilize sdcard generation

There're some use cases where we might need to have an sdcard with no bootloader (as it might be provided in the board in SPI NOR, for example) and use of boot scripts. This patchset adds this flexibility to iMX machines.

Otavio Salvador (2):
image_types_fsl.bbclass: Add support to not use bootloader for iMX image_types_fsl.bbclass: Add support to install boot scripts

 classes/image_types_fsl.bbclass |   12 ++++++++++++
 1 file changed, 12 insertions(+)
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/2 image_types_fsl.bbclass: Add support to not use bootloader for iMX

Some machines might come with a bootloader in an internal flash (a SPI NOR, for example) so not requiring a boot loader in the image.

Change-Id Id1a69c6c6b60639694a64b2b7badd16ee4b0d2f7
---
 classes/image_types_fsl.bbclass |    2 ++
 1 file changed, 2 insertions(+)
classes/image_types_fsl.bbclass +2 -0
index c369832..8414848 100644
@@ -106,6 +106,8 @@ generate_imx_sdcard () {
 		dd if=${DEPLOY_DIR_IMAGE}/barebox-${MACHINE}.bin of=${SDCARD} conv=notrunc seek=1 skip=1 bs=512
 		dd if=${DEPLOY_DIR_IMAGE}/bareboxenv-${MACHINE}.bin of=${SDCARD} conv=notrunc seek=1 bs=512k
 		;;
+		"")
+		;;
 		*)
 		bberror "Unkown IMAGE_BOOTLOADER value"
 		exit 1
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/2 image_types_fsl.bbclass: Add support to install boot scripts

In reply to Otavio Salvador

Some machines might want to provide boot scripts for use. This now can be accomplished using BOOT_SCRIPTS variable in following format:

<source>:<destination>

Thus any file in deploy directory can be installed in the boot partition of the sdcard, easily.

This can be placed in the machine definition or the image.

Change-Id Ic1eafd2be3559b5c9da43dcc6f54f1b480dbc647
---
 classes/image_types_fsl.bbclass |   10 ++++++++++
 1 file changed, 10 insertions(+)
classes/image_types_fsl.bbclass +10 -0
index 8414848..8a9fde4 100644
@@ -119,6 +119,16 @@ generate_imx_sdcard () {
 	                  | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 1024 }')
 	mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS
 	mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/uImage-${MACHINE}.bin ::/uImage
+
+	# Copy boot scripts
+	for item in ${BOOT_SCRIPTS}; do
+		src=`echo $item | awk -F':' '{ print $1 }'`
+		dst=`echo $item | awk -F':' '{ print $2 }'`
+
+		mcopy -i ${WORKDIR}/boot.img -s $src ::/$dst
+	done
+
+	# Copy device tree file
 	if [ -e "${KERNEL_IMAGETYPE}-${MACHINE}.dtb" ]; then
 		kernel_bin="`readlink ${KERNEL_IMAGETYPE}-${MACHINE}.bin`"
 		kernel_dtb="`readlink ${KERNEL_IMAGETYPE}-${MACHINE}.dtb`"
Signature · 1 line
1.7.10.4
author Applied
#3 lore raw
In reply to Otavio Salvador
Quoted 8 lines · Otavio Salvador

There're some use cases where we might need to have an sdcard with no bootloader (as it might be provided in the board in SPI NOR, for example) and use of boot scripts. This patchset adds this flexibility to iMX machines.

Otavio Salvador (2):
image_types_fsl.bbclass: Add support to not use bootloader for iMX image_types_fsl.bbclass: Add support to install boot scripts

Merged to master.

--
Otavio Salvador O.S. Systems
E-mail: [email protected] http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br