Skip to contentSkip to conversation

Alternative and extended improvements to sdclass_image

PATCH In review Peter A. Bigot 3 participants 15 messages Nov 13, 2011 – Nov 14, 2011

lore
Share & tools
lore
#0 lore raw

cover Alternative and extended improvements to sdclass_image

From: "Peter A. Bigot" <[email protected]>

I understand the objections to my previous patch were that it would break when SPL was used and there is no MLO, and that the approach isn't the one that will eventually be implemented. Since the current head version also aborts if no MLO is present by that name (hence, doesn't work for beagleboard), until the "right" solution can be obtained perhaps the version herein can be installed. It uses a more general method that should work now and whenever x-load does (or doesn't) get fixed.

I also got tired of having to go down in to the basement to edit /etc/fstab on the console every time I rebooted the development server and it hung because it couldn't mount an unconfigured loop device. Two enhancements for
that: allow an override to the mount point so I don't have to clutter up /etc/fstab with hard-coded paths to workspace directories for every image I might want to build, and add the noauto option.

Finally, I moved the IMAGE_FSTYPES append out of the class into the recipe that actually depends on it, and got rid of the tar.bz2 which has nothing to do with sdcard_image and is already present in all the machine confs anyway.

Peter A. Bigot (2):
sdcard_image bbclass: fix MLO copy, loop device mounts, fstypes
ti-hw-bringup-image: add sdimg to fstypes

 classes/sdcard_image.bbclass               |   47 ++++++++++++++++------------
 recipes-misc/images/ti-hw-bringup-image.bb |    2 +
 2 files changed, 29 insertions(+), 20 deletions(-)
Signature · 1 line
1.7.6.4
#1 lore raw

PATCH 1/2 sdcard_image bbclass: fix MLO copy, loop device mounts, fstypes

From: "Peter A. Bigot" <[email protected]>

Generalize the search for MLO to install to have correct path for copies placed in ${DEPLOY_DIR_IMAGE} by x-load.inc, and to continue for SPL builds where there is no MLO.

Allow user to override the loop mount point as well as the loop device, for folks who don't want long paths to temporary directories in their fstabs.

Add noauto to example fstab entries so systems will boot without attempting to mount an unconfigured loopback device.

Remove IMAGE_FSTYPE_append which does not belong in this class.

---
 classes/sdcard_image.bbclass |   47 ++++++++++++++++++++++++-----------------
 1 files changed, 27 insertions(+), 20 deletions(-)
classes/sdcard_image.bbclass +27 -20
index 531b419..96b709d 100644
@@ -1,8 +1,5 @@
 inherit image
 
-# Add the fstypes we need
-IMAGE_FSTYPES_append = " tar.bz2 sdimg"
-
 # Ensure required utilities are present
 IMAGE_DEPENDS_sdimg = "genext2fs-native e2fsprogs-native"
 
@@ -13,6 +10,7 @@ LOSETUP ?= "/sbin/losetup"
 # Since the vars are weakly assigned, you can override them from your local.conf
 LOOPDEV ?= "/dev/loop1"
 LOOPDEV_BOOT ?= "/dev/loop2"
+MOUNTPOINT_BOOT ?= "${WORKDIR}/tmp-mnt-boot"
 LOOPDEV_FS ?= "/dev/loop3"
 
 # Default to 4GiB images
@@ -29,14 +27,18 @@ IMAGEDATESTAMP = "${@time.strftime('%Y.%m.%d',time.gmtime())}"
 # Files and/or directories to be copied into the vfat partition
 FATPAYLOAD ?= ""
 
+# Match meta-ti x-load.inc link names
+MLO_SYMLINK ?= "MLO-${MACHINE}"
+MLO_SYMLINK_NOMACHINE ?= "MLO"
+
 IMAGE_CMD_sdimg () {
 	SDIMG=${WORKDIR}/sd.img
 
 	# sanity check fstab entry for boot partition mounting
-	if [ "x$(cat /etc/fstab | grep ${LOOPDEV_BOOT} | grep ${WORKDIR}/tmp-mnt-boot | grep user || true)" = "x" ]; then
+	if [ "x$(cat /etc/fstab | grep ${LOOPDEV_BOOT} | grep ${MOUNTPOINT_BOOT} | grep user || true)" = "x" ]; then
 		echo "/etc/fstab entries need to be created with the user flag for the loop devices like:"
-		echo "${LOOPDEV_BOOT} ${WORKDIR}/tmp-mnt-boot vfat user 0 0"
-        false
+		echo "${LOOPDEV_BOOT} ${MOUNTPOINT_BOOT} vfat noauto,user 0 0"
+		false
 	fi
 
 	# cleanup loops
@@ -86,15 +88,20 @@ IMAGE_CMD_sdimg () {
 	# Prepare boot partion. First mount the boot partition, and copy the boot loader and supporting files
 	# from the root filesystem
 
-	mkdir -p ${WORKDIR}/tmp-mnt-boot
-	mount $LOOPDEV_BOOT ${WORKDIR}/tmp-mnt-boot
+	mkdir -p ${MOUNTPOINT_BOOT}
+	mount $LOOPDEV_BOOT ${MOUNTPOINT_BOOT}
 
 	echo "Copying bootloaders into the boot partition"
-	if [ -e ${IMAGE_ROOTFS}/boot/MLO ] ; then
-		cp -v ${IMAGE_ROOTFS}/boot/MLO ${WORKDIR}/tmp-mnt-boot 
-	else
-		cp -v ${DEPLOY_DIR_IMAGE}/MLO ${WORKDIR}/tmp-mnt-boot
-	fi
+	for mlo in \
+	    ${IMAGE_ROOTFS}/boot/${MLO_SYMLINK_NOMACHINE} \
+	    ${DEPLOY_DIR_IMAGE}/${MLO_SYMLINK} \
+	    ${DEPLOY_DIR_IMAGE}/MLO \
+	    ; do
+		if [ -e ${mlo} ] ; then
+			cp -v ${mlo} ${MOUNTPOINT_BOOT}/MLO
+			break
+		fi
+	done
 
 	# Check for u-boot SPL
 	if [ -e ${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.img ] ; then
@@ -103,27 +110,27 @@ IMAGE_CMD_sdimg () {
 		suffix=bin
 	fi
 
-	cp -v ${IMAGE_ROOTFS}/boot/uEnv.txt ${WORKDIR}/tmp-mnt-boot || true
-	cp -v ${IMAGE_ROOTFS}/boot/user.txt ${WORKDIR}/tmp-mnt-boot || true
-	cp -v ${IMAGE_ROOTFS}/boot/uImage ${WORKDIR}/tmp-mnt-boot || true
+	cp -v ${IMAGE_ROOTFS}/boot/uEnv.txt ${MOUNTPOINT_BOOT} || true
+	cp -v ${IMAGE_ROOTFS}/boot/user.txt ${MOUNTPOINT_BOOT} || true
+	cp -v ${IMAGE_ROOTFS}/boot/uImage ${MOUNTPOINT_BOOT} || true
 
 	if [ -e ${IMAGE_ROOTFS}/boot/u-boot.$suffix ] ; then
-		cp -v ${IMAGE_ROOTFS}/boot/{u-boot.$suffix} ${WORKDIR}/tmp-mnt-boot || true
+		cp -v ${IMAGE_ROOTFS}/boot/{u-boot.$suffix} ${MOUNTPOINT_BOOT} || true
 	else
-		cp -v ${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.$suffix ${WORKDIR}/tmp-mnt-boot/u-boot.$suffix 
+		cp -v ${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.$suffix ${MOUNTPOINT_BOOT}/u-boot.$suffix 
 	fi
 
 	if [ -n ${FATPAYLOAD} ] ; then
 		echo "Copying payload into VFAT"
 		for entry in ${FATPAYLOAD} ; do
 				# add the || true to stop aborting on vfat issues like not supporting .~lock files
-				cp -av ${IMAGE_ROOTFS}$entry ${WORKDIR}/tmp-mnt-boot || true
+				cp -av ${IMAGE_ROOTFS}$entry ${MOUNTPOINT_BOOT} || true
 		done
 	fi
 
 	# Cleanup VFAT mount
 	echo "Cleaning up VFAT mount"
-	umount ${WORKDIR}/tmp-mnt-boot
+	umount ${MOUNTPOINT_BOOT}
 	${LOSETUP} -d ${LOOPDEV_BOOT} || true
 
 	# Prepare rootfs parition
Signature · 1 line
1.7.6.4
#2 lore raw

PATCH 2/2 ti-hw-bringup-image: add sdimg to fstypes

From: "Peter A. Bigot" <[email protected]>

---
 recipes-misc/images/ti-hw-bringup-image.bb |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
recipes-misc/images/ti-hw-bringup-image.bb +2 -0
index 4e708bb..6c7c415 100644
@@ -38,4 +38,6 @@ IMAGE_LOGIN_MANAGER = "tinylogin shadow"
 
 export IMAGE_BASENAME = "TI-hw-bringup"
 
+IMAGE_FSTYPES += "sdimg"
+
 inherit sdcard_image
Signature · 1 line
1.7.6.4
#3 lore raw

Re: [PATCH 1/2] sdcard_image bbclass: fix MLO copy, loop device mounts, fstypes

In reply to Peter A. Bigot

Op 13 nov. 2011, om 19:25 heeft Peter A. Bigot het volgende geschreven:

Quoted 6 lines

From: "Peter A. Bigot" <[email protected]>

Generalize the search for MLO to install to have correct path for copies placed in ${DEPLOY_DIR_IMAGE} by x-load.inc, and to continue for SPL builds where there is no MLO.

Quoted 7 lines

Allow user to override the loop mount point as well as the loop device, for folks who don't want long paths to temporary directories in their fstabs.

Add noauto to example fstab entries so systems will boot without attempting to mount an unconfigured loopback device.

Remove IMAGE_FSTYPE_append which does not belong in this class.

I like the fstab changes, but not the others, could you please split this patch?

regards,

Koen

#4 lore raw

Re: [PATCH 1/2] sdcard_image bbclass: fix MLO copy, loop device mounts, fstypes

Quoted 12 lines · Koen Kooi

Op 13 nov. 2011, om 19:25 heeft Peter A. Bigot het volgende geschreven:

Quoted 9 lines

From: "Peter A. Bigot" <[email protected]>

Generalize the search for MLO to install to have correct path for copies placed in ${DEPLOY_DIR_IMAGE} by x-load.inc, and to continue for SPL builds where there is no MLO.

Allow user to override the loop mount point as well as the loop device, for folks who don't want long paths to temporary directories in their fstabs.

Quoted 6 lines
Quoted 4 lines

Add noauto to example fstab entries so systems will boot without attempting to mount an unconfigured loopback device.

Remove IMAGE_FSTYPE_append which does not belong in this class.

I like the fstab changes, but not the others, could you please split this patch?

Sure, next time I have to sync with meta-ti. Without the MLO fixes I'd end up with something that doesn't work, and I don't want to blow another half hour testing a script I can't use.

Peter

Quoted 12 lines

regards,

Koen
-----BEGIN PGP SIGNATURE-----

iEYEARECAAYFAk7AD4IACgkQMkyGM64RGpGW8gCgrK/QEYtpHxYDuOHPuONYeJlv TZgAmQGlt/0ZCZoRvbNbqUpCr6QpT0P3
=Az4V
-----END PGP SIGNATURE-----

#5 lore raw

Re: [PATCH 1/2] sdcard_image bbclass: fix MLO copy, loop device mounts, fstypes

Quoted 16 lines · Peter Bigot
Quoted 15 lines · Koen Kooi

Op 13 nov. 2011, om 19:25 heeft Peter A. Bigot het volgende geschreven:

Quoted 12 lines

From: "Peter A. Bigot" <[email protected]>

Generalize the search for MLO to install to have correct path for copies placed in ${DEPLOY_DIR_IMAGE} by x-load.inc, and to continue for SPL builds where there is no MLO.

Allow user to override the loop mount point as well as the loop device, for folks who don't want long paths to temporary directories in their fstabs.

Add noauto to example fstab entries so systems will boot without attempting to mount an unconfigured loopback device.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Remove IMAGE_FSTYPE_append which does not belong in this class.

I like the fstab changes, but not the others, could you please split this patch?

Sure, next time I have to sync with meta-ti.  Without the MLO fixes I'd end up with something that doesn't work, and I don't want to blow another half hour testing a script I can't use.

I guess I need to hurry up and bug Koen about switching beagleboard to the SPL tree then :)

Signature · 1 line
Tom
#6 lore raw

Re: [PATCH 1/2] sdcard_image bbclass: fix MLO copy, loop device mounts, fstypes

Op 13 nov. 2011, om 22:06 heeft Tom Rini het volgende geschreven:

Quoted 19 lines · Peter Bigot
Quoted 18 lines · Koen Kooi
Quoted 17 lines

Op 13 nov. 2011, om 19:25 heeft Peter A. Bigot het volgende geschreven:

Quoted 13 lines

From: "Peter A. Bigot" <[email protected]>

Generalize the search for MLO to install to have correct path for copies placed in ${DEPLOY_DIR_IMAGE} by x-load.inc, and to continue for SPL builds where there is no MLO.

Allow user to override the loop mount point as well as the loop device, for folks who don't want long paths to temporary directories in their fstabs.

Add noauto to example fstab entries so systems will boot without attempting to mount an unconfigured loopback device.

Remove IMAGE_FSTYPE_append which does not belong in this class.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

I like the fstab changes, but not the others, could you please split this patch?

Sure, next time I have to sync with meta-ti. Without the MLO fixes I'd end up with something that doesn't work, and I don't want to blow another half hour testing a script I can't use.

I guess I need to hurry up and bug Koen about switching beagleboard to the SPL tree then :)

Does your v3 work when applied on top of 2011.09?

regards,

Koen

#7 lore raw

Re: [PATCH 1/2] sdcard_image bbclass: fix MLO copy, loop device mounts, fstypes

Quoted 24 lines · Koen Kooi

Op 13 nov. 2011, om 22:06 heeft Tom Rini het volgende geschreven:

Quoted 21 lines · Peter Bigot
Quoted 20 lines · Koen Kooi
Quoted 18 lines

Op 13 nov. 2011, om 19:25 heeft Peter A. Bigot het volgende geschreven:

Quoted 6 lines

From: "Peter A. Bigot" <[email protected]>

Generalize the search for MLO to install to have correct path for copies placed in ${DEPLOY_DIR_IMAGE} by x-load.inc, and to continue for SPL builds where there is no MLO.

Quoted 7 lines

Allow user to override the loop mount point as well as the loop device, for folks who don't want long paths to temporary directories in their fstabs.

Add noauto to example fstab entries so systems will boot without attempting to mount an unconfigured loopback device.

Remove IMAGE_FSTYPE_append which does not belong in this class.

I like the fstab changes, but not the others, could you please split this patch?

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Sure, next time I have to sync with meta-ti.  Without the MLO fixes I'd end up with something that doesn't work, and I don't want to blow another half hour testing a script I can't use.

I guess I need to hurry up and bug Koen about switching beagleboard to the SPL tree then :)

Does your v3 work when applied on top of 2011.09?

Won't apply, no. But my 05.03.01.00 branch is good for beagleboard, am3517* and omap3evm.

Signature · 1 line
Tom
#8 lore raw

Re: [PATCH 1/2] sdcard_image bbclass: fix MLO copy, loop device mounts, fstypes

Op 14 nov. 2011, om 15:19 heeft Tom Rini het volgende geschreven:

Quoted 29 lines · Koen Kooi
Quoted 28 lines

Op 13 nov. 2011, om 22:06 heeft Tom Rini het volgende geschreven:

Quoted 25 lines · Peter Bigot
Quoted 23 lines · Koen Kooi
Quoted 12 lines

Op 13 nov. 2011, om 19:25 heeft Peter A. Bigot het volgende geschreven:

Quoted 9 lines

From: "Peter A. Bigot" <[email protected]>

Generalize the search for MLO to install to have correct path for copies placed in ${DEPLOY_DIR_IMAGE} by x-load.inc, and to continue for SPL builds where there is no MLO.

Allow user to override the loop mount point as well as the loop device, for folks who don't want long paths to temporary directories in their fstabs.

Quoted 6 lines
Quoted 4 lines

Add noauto to example fstab entries so systems will boot without attempting to mount an unconfigured loopback device.

Remove IMAGE_FSTYPE_append which does not belong in this class.

I like the fstab changes, but not the others, could you please split this patch?

Sure, next time I have to sync with meta-ti. Without the MLO fixes I'd end up with something that doesn't work, and I don't want to blow another half hour testing a script I can't use.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

I guess I need to hurry up and bug Koen about switching beagleboard to the SPL tree then :)

Does your v3 work when applied on top of 2011.09?

Won't apply, no. But my 05.03.01.00 branch is good for beagleboard, am3517* and omap3evm.

How much non-beagle and non-SPL patches does that have in there? For beagle we *really* want as little patches on top of upstream as possible. If that means moving to latest denx git, so be it.

regards,

Koen

#9 lore raw

Re: [PATCH 1/2] sdcard_image bbclass: fix MLO copy, loop device mounts, fstypes

Quoted 35 lines · Koen Kooi

Op 14 nov. 2011, om 15:19 heeft Tom Rini het volgende geschreven:

Quoted 32 lines · Koen Kooi
Quoted 31 lines

Op 13 nov. 2011, om 22:06 heeft Tom Rini het volgende geschreven:

Quoted 27 lines · Peter Bigot
Quoted 16 lines · Koen Kooi
Quoted 15 lines

Op 13 nov. 2011, om 19:25 heeft Peter A. Bigot het volgende geschreven:

Quoted 12 lines

From: "Peter A. Bigot" <[email protected]>

Generalize the search for MLO to install to have correct path for copies placed in ${DEPLOY_DIR_IMAGE} by x-load.inc, and to continue for SPL builds where there is no MLO.

Allow user to override the loop mount point as well as the loop device, for folks who don't want long paths to temporary directories in their fstabs.

Add noauto to example fstab entries so systems will boot without attempting to mount an unconfigured loopback device.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Remove IMAGE_FSTYPE_append which does not belong in this class.

I like the fstab changes, but not the others, could you please split this patch?

Sure, next time I have to sync with meta-ti.  Without the MLO fixes I'd end up with something that doesn't work, and I don't want to blow another half hour testing a script I can't use.

I guess I need to hurry up and bug Koen about switching beagleboard to the SPL tree then :)

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Does your v3 work when applied on top of 2011.09?

Won't apply, no.  But my 05.03.01.00 branch is good for beagleboard, am3517* and omap3evm.

How much non-beagle and non-SPL patches does that have in there? For beagle we *really* want as little patches on top of upstream as possible. If that means moving to latest denx git, so be it.

Well, it's a joint tree for those boards + ti814x/ti816x (but those aren't the latest/greatest, just an older iteration) and of course am335x. In terms of non-SPL changes, it's changing the OTG port to default to a usb host in U-Boot (from a USB gadget), and non 1-bit NAND ECC stuff. am3517 evm also gets ethernet support (crane could, trivially, just need a tester). omap3evm also gets an ethernet releated bugfix.

Signature · 1 line
Tom
#10 lore raw

Re: [PATCH 1/2] sdcard_image bbclass: fix MLO copy, loop device mounts, fstypes

In reply to Peter Bigot

Op 13 nov. 2011, om 19:57 heeft Peter Bigot het volgende geschreven:

Quoted 16 lines · Koen Kooi
Quoted 15 lines

Op 13 nov. 2011, om 19:25 heeft Peter A. Bigot het volgende geschreven:

Quoted 12 lines

From: "Peter A. Bigot" <[email protected]>

Generalize the search for MLO to install to have correct path for copies placed in ${DEPLOY_DIR_IMAGE} by x-load.inc, and to continue for SPL builds where there is no MLO.

Allow user to override the loop mount point as well as the loop device, for folks who don't want long paths to temporary directories in their fstabs.

Add noauto to example fstab entries so systems will boot without attempting to mount an unconfigured loopback device.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Remove IMAGE_FSTYPE_append which does not belong in this class.

I like the fstab changes, but not the others, could you please split this patch?

Sure, next time I have to sync with meta-ti. Without the MLO fixes I'd end up with something that doesn't work, and I don't want to blow another half hour testing a script I can't use.

The MLO issue has been fixed in the proper places now:

http://git.angstrom-distribution.org/cgi-bin/cgit.cgi/meta-texasinstruments/commit/?id=2de08fa6d4208a016b447832601f83fd51cb8f93
http://git.angstrom-distribution.org/cgi-bin/cgit.cgi/meta-texasinstruments/commit/?id=955b40d36a5d2b6eb9ca50bed7103d7b6daa7feb

regards,

Koen

#11 lore raw

Re: [PATCH 1/2] sdcard_image bbclass: fix MLO copy, loop device mounts, fstypes

In reply to Koen Kooi
Quoted 12 lines · Koen Kooi

Op 13 nov. 2011, om 19:25 heeft Peter A. Bigot het volgende geschreven:

Quoted 9 lines

From: "Peter A. Bigot" <[email protected]>

Generalize the search for MLO to install to have correct path for copies placed in ${DEPLOY_DIR_IMAGE} by x-load.inc, and to continue for SPL builds where there is no MLO.

Allow user to override the loop mount point as well as the loop device, for folks who don't want long paths to temporary directories in their fstabs.

Quoted 6 lines
Quoted 4 lines

Add noauto to example fstab entries so systems will boot without attempting to mount an unconfigured loopback device.

Remove IMAGE_FSTYPE_append which does not belong in this class.

I like the fstab changes, but not the others, could you please split this patch?

So I can prepare more appropriate patches now and in the future, please explain:

* Why do you want to hard-code the MLO symlink paths in the install and deploy directories instead of using the bitbake variables that x-load.inc uses for those paths?

* Why do you want IMAGE_FSTYPE to be extended with .tar.bz2 when this class has nothing to do with tar.bz2 images?

* Why do you want IMAGE_FSTYPE to be set in the class when every other image recipe in openembedded puts IMAGE_FSTYPE modifications in the recipe that incorporates the image?

Thanks.

Peter

Quoted 12 lines

regards,

Koen
-----BEGIN PGP SIGNATURE-----

iEYEARECAAYFAk7AD4IACgkQMkyGM64RGpGW8gCgrK/QEYtpHxYDuOHPuONYeJlv TZgAmQGlt/0ZCZoRvbNbqUpCr6QpT0P3
=Az4V
-----END PGP SIGNATURE-----

#12 lore raw

Re: [PATCH 1/2] sdcard_image bbclass: fix MLO copy, loop device mounts, fstypes

Op 14 nov. 2011, om 15:57 heeft Peter Bigot het volgende geschreven:

Quoted 18 lines · Koen Kooi
Quoted 17 lines

Op 13 nov. 2011, om 19:25 heeft Peter A. Bigot het volgende geschreven:

Quoted 13 lines

From: "Peter A. Bigot" <[email protected]>

Generalize the search for MLO to install to have correct path for copies placed in ${DEPLOY_DIR_IMAGE} by x-load.inc, and to continue for SPL builds where there is no MLO.

Allow user to override the loop mount point as well as the loop device, for folks who don't want long paths to temporary directories in their fstabs.

Add noauto to example fstab entries so systems will boot without attempting to mount an unconfigured loopback device.

Remove IMAGE_FSTYPE_append which does not belong in this class.

Quoted 7 lines
Quoted 1 line

I like the fstab changes, but not the others, could you please split this patch?

So I can prepare more appropriate patches now and in the future, please explain:

* Why do you want to hard-code the MLO symlink paths in the install and deploy directories instead of using the bitbake variables that x-load.inc uses for those paths?

Due to variable scoping those are only available inside those recipes, not the image class.

Quoted 2 lines

* Why do you want IMAGE_FSTYPE to be extended with .tar.bz2 when this class has nothing to do with tar.bz2 images?

It used the tar.bz2 rootfs to populate the extX partition in the past, but it looks like it can go away now.

Quoted 3 lines

* Why do you want IMAGE_FSTYPE to be set in the class when every other image recipe in openembedded puts IMAGE_FSTYPE modifications in the recipe that incorporates the image?

That was a hack to make inheriting the class "just work". I'm not sure how to proceed on this one, do we merge this into image_types.bbclass in OE-core or not? If there's enough support for requiring to both inherit the class and to set IMAGE_FSTYPES to sdcard we can move it.

regards,

Koen

#13 lore raw

Re: [PATCH 1/2] sdcard_image bbclass: fix MLO copy, loop device mounts, fstypes

Quoted 23 lines · Koen Kooi

Op 14 nov. 2011, om 15:57 heeft Peter Bigot het volgende geschreven:

Quoted 20 lines · Koen Kooi
Quoted 18 lines

Op 13 nov. 2011, om 19:25 heeft Peter A. Bigot het volgende geschreven:

Quoted 6 lines

From: "Peter A. Bigot" <[email protected]>

Generalize the search for MLO to install to have correct path for copies placed in ${DEPLOY_DIR_IMAGE} by x-load.inc, and to continue for SPL builds where there is no MLO.

Quoted 7 lines

Allow user to override the loop mount point as well as the loop device, for folks who don't want long paths to temporary directories in their fstabs.

Add noauto to example fstab entries so systems will boot without attempting to mount an unconfigured loopback device.

Remove IMAGE_FSTYPE_append which does not belong in this class.

I like the fstab changes, but not the others, could you please split this patch?

Quoted 7 lines
Quoted 5 lines

So I can prepare more appropriate patches now and in the future, please explain:

* Why do you want to hard-code the MLO symlink paths in the install and deploy directories instead of using the bitbake variables that x-load.inc uses for those paths?

Due to variable scoping those are only available inside those recipes, not the image class.

Yes, but they're default-assigned, so an override in local.conf would apply to both, no? Why does x-load allow them to be overridden? Maybe that'd be a clue as to the right way to change the point-of-use.

What's the point of adding a nomachine symlink anyway? A desire to avoid specifying the target filename in the cp command? Consistently using MLO-${MACHINE} for the source and MLO for the target would be a lot more clear, since the target absolutely must be named "MLO".

meta-ti now has two things that can create an MLO file (x-load and u-boot) and a third thing that uses it (sdcard_image), and they're inconsistent in how they name it. Ick.

Quoted 10 lines
Quoted 2 lines

* Why do you want IMAGE_FSTYPE to be extended with .tar.bz2 when this class has nothing to do with tar.bz2 images?

It used the tar.bz2 rootfs to populate the extX partition in the past, but it looks like it can go away now.

Quoted 3 lines

* Why do you want IMAGE_FSTYPE to be set in the class when every other image recipe in openembedded puts IMAGE_FSTYPE modifications in the recipe that incorporates the image?

That was a hack to make inheriting the class "just work". I'm not sure how to proceed on this one, do we merge this into image_types.bbclass in OE-core or not? If there's enough support for requiring to both inherit the class and to set IMAGE_FSTYPES to sdcard we can move it.

As far as I can tell, that (both inherit and set) is exactly how it's done normally.

Personally I'd like to see a lot of cleanup in sdcard_class before it got merged to oe-core image_types. Among other things, the ability to create the images for the partitions independently, and only optionally combine multiple partitions into a whole-disk image. Most of the time I'll have a pre-formatted sd card and only want to update the rootfs partition.

Besides, a generic name like "sdimg" almost certainly shouldn't be a class that only knows how to build boot partitions for OMAP boards that require MLO.

Peter

Quoted 12 lines

regards,

Koen
-----BEGIN PGP SIGNATURE-----

iEYEARECAAYFAk7BLsYACgkQMkyGM64RGpHYhQCfbQcmAJJCZvCyLeoHU4JlTl6e YOEAn298tyHdEDA+IAk/Zi979pn1nv/g
=CvBb
-----END PGP SIGNATURE-----

#14 lore raw

Re: [PATCH 1/2] sdcard_image bbclass: fix MLO copy, loop device mounts, fstypes

Op 14 nov. 2011, om 16:32 heeft Peter Bigot het volgende geschreven:

Quoted 36 lines · Koen Kooi
Quoted 23 lines

Op 14 nov. 2011, om 15:57 heeft Peter Bigot het volgende geschreven:

Quoted 20 lines · Koen Kooi
Quoted 18 lines

Op 13 nov. 2011, om 19:25 heeft Peter A. Bigot het volgende geschreven:

Quoted 6 lines

From: "Peter A. Bigot" <[email protected]>

Generalize the search for MLO to install to have correct path for copies placed in ${DEPLOY_DIR_IMAGE} by x-load.inc, and to continue for SPL builds where there is no MLO.

Quoted 7 lines

Allow user to override the loop mount point as well as the loop device, for folks who don't want long paths to temporary directories in their fstabs.

Add noauto to example fstab entries so systems will boot without attempting to mount an unconfigured loopback device.

Remove IMAGE_FSTYPE_append which does not belong in this class.

I like the fstab changes, but not the others, could you please split this patch?

Quoted 7 lines
Quoted 5 lines

So I can prepare more appropriate patches now and in the future, please explain:

* Why do you want to hard-code the MLO symlink paths in the install and deploy directories instead of using the bitbake variables that x-load.inc uses for those paths?

Due to variable scoping those are only available inside those recipes, not the image class.

Yes, but they're default-assigned, so an override in local.conf would apply to both, no? Why does x-load allow them to be overridden? Maybe that'd be a clue as to the right way to change the point-of-use.

Quoted 8 lines

What's the point of adding a nomachine symlink anyway? A desire to avoid specifying the target filename in the cp command? Consistently using MLO-${MACHINE} for the source and MLO for the target would be a lot more clear, since the target absolutely must be named "MLO".

meta-ti now has two things that can create an MLO file (x-load and u-boot) and a third thing that uses it (sdcard_image), and they're inconsistent in how they name it. Ick.

u-boot and x-load are now internally consistent with naming nowadays.