Skip to contentSkip to conversation

adding a new machine configuration

Buildroot Roland 3 participants 4 messages Mar 1, 2012 – Mar 2, 2012

lore
Share & tools
lore

Roland

author
#0 lore raw

Hi.

I have created a new machine configuration file.

Target is Voipac iMX25 module ( http://voipac.com/#X25-DMM-254 ).

I'm gonna also create one for iMX51.

The problem is, the generated filesystem image won't work if don't change the fs/ubinize.cfg file (problem with alignment). And currently it's not possible to edit ubinize.cfg file in the buildroot configuration file.

I'm interested in sharing the config and other files so, it can be merged to buildroot's git.
But it's probably not possible until ubinize.cfg is configurable.

Any comments by the people, who have commit access?

Thanks,
Roland

#1 lore raw

Le Thu, 01 Mar 2012 15:07:48 +0200,
Roland <[email protected]> a ?crit :

Quoted 10 lines

I have created a new machine configuration file.

Target is Voipac iMX25 module ( http://voipac.com/#X25-DMM-254 ).

I'm gonna also create one for iMX51.

The problem is, the generated filesystem image won't work if don't change the fs/ubinize.cfg file (problem with alignment). And currently it's not possible to edit ubinize.cfg file in the buildroot configuration file.

I guess you're talking about the vol_alignment parameter, is this correct?

Quoted 5 lines

I'm interested in sharing the config and other files so, it can be merged to buildroot's git.
But it's probably not possible until ubinize.cfg is configurable.

Any comments by the people, who have commit access?

You can simply add a new configuration option in the menuconfig to specify the alignment, with a default value equal to the one used in the current ubinize.cfg. Then, you change the ubinize.cfg to something like:

vol_alignment=__BR_VOL_ALIGNMENT__

And then when the filesystem image is built, you copy this ubinize.cfg somewhere, making the replacement of __BR_VOL_ALIGNMENT__ with the value from the configuration, and you run ubinize with it.

Is this what you're looking for?

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
author
#2 lore raw
Quoted 28 lines · Thomas Petazzoni

Le Thu, 01 Mar 2012 15:07:48 +0200,
Roland<[email protected]> a ?crit :

Quoted 10 lines

I have created a new machine configuration file.

Target is Voipac iMX25 module ( http://voipac.com/#X25-DMM-254 ).

I'm gonna also create one for iMX51.

The problem is, the generated filesystem image won't work if don't change the fs/ubinize.cfg file (problem with alignment). And currently it's not possible to edit ubinize.cfg file in the buildroot configuration file.

I guess you're talking about the vol_alignment parameter, is this correct?

Quoted 5 lines

I'm interested in sharing the config and other files so, it can be merged to buildroot's git.
But it's probably not possible until ubinize.cfg is configurable.

Any comments by the people, who have commit access?

You can simply add a new configuration option in the menuconfig to specify the alignment, with a default value equal to the one used in the current ubinize.cfg. Then, you change the ubinize.cfg to something like:

vol_alignment=__BR_VOL_ALIGNMENT__

Quoted 7 lines

And then when the filesystem image is built, you copy this ubinize.cfg somewhere, making the replacement of __BR_VOL_ALIGNMENT__ with the value from the configuration, and you run ubinize with it.

Is this what you're looking for?

Thomas

Thanks,
This was helpful

Managed to change the Config.in file, but I'm having some trouble with ubi.mk

Which is better version... I'm specifically interested in the IF
section where BR2_TARGET_ROOTFS_UBI_ALIGNMENT_DEFINED is used.

Or suggest the correct buildroot way of doing this.

Thanks.

Version 1

#############################################################
#
# Embed the ubifs image into an ubi one
#
#############################################################

UBI_UBINIZE_OPTS := -m $(BR2_TARGET_ROOTFS_UBIFS_MINIOSIZE) UBI_UBINIZE_OPTS += -p $(BR2_TARGET_ROOTFS_UBI_PEBSIZE) ifneq ($(BR2_TARGET_ROOTFS_UBI_SUBSIZE),0) UBI_UBINIZE_OPTS += -s $(BR2_TARGET_ROOTFS_UBI_SUBSIZE) endif

UBI_UBINIZE_ECHO_ALIGNMENT :=
ifeq ($(BR2_TARGET_ROOTFS_UBI_ALIGNMENT_DEFINED),y)
UBI_UBINIZE_ECHO_ALIGNMENT := echo
"vol_alignment=$(BR2_TARGET_ROOTFS_UBI_VOL_ALIGNMENT)" \

Quoted 1 line
Quoted 1 line

$(BUILD_DIR)/_ubinize.cfg ;

endif

ROOTFS_UBI_DEPENDENCIES = rootfs-ubifs

define ROOTFS_UBI_CMD

     cp fs/ubifs/ubinize.cfg $(BUILD_DIR)/_ubinize.cfg ;\
         echo "vol_name=$(BR2_TARGET_ROOTFS_UBI_VOL_NAME)" \
Quoted 1 line
Quoted 1 line

$(BUILD_DIR)/_ubinize.cfg ;\

         $(UBI_UBINIZE_ECHO_ALIGNMENT) \
     echo "image=$$@fs" \
Quoted 1 line
Quoted 1 line

$(BUILD_DIR)/_ubinize.cfg ;\

     $(HOST_DIR)/usr/sbin/ubinize -o $$@ $(UBI_UBINIZE_OPTS) 
$(BUILD_DIR)/_ubinize.cfg ;\
         rm $(BUILD_DIR)/_ubinize.cfg

endef

$(eval $(call ROOTFS_TARGET,ubi))

#############################################################

Version 2

#############################################################
#
# Embed the ubifs image into an ubi one
#
#############################################################

UBI_UBINIZE_OPTS := -m $(BR2_TARGET_ROOTFS_UBIFS_MINIOSIZE) UBI_UBINIZE_OPTS += -p $(BR2_TARGET_ROOTFS_UBI_PEBSIZE) ifneq ($(BR2_TARGET_ROOTFS_UBI_SUBSIZE),0) UBI_UBINIZE_OPTS += -s $(BR2_TARGET_ROOTFS_UBI_SUBSIZE) endif

ROOTFS_UBI_DEPENDENCIES = rootfs-ubifs

define ROOTFS_UBI_CMD

     cp fs/ubifs/ubinize.cfg $(BUILD_DIR)/_ubinize.cfg ;\
         echo "vol_name=$(BR2_TARGET_ROOTFS_UBI_VOL_NAME)" \
Quoted 1 line
Quoted 1 line

$(BUILD_DIR)/_ubinize.cfg ;\

         [ "_y" = "_$(BR2_TARGET_ROOTFS_UBI_ALIGNMENT_DEFINED)" ] && \
                 echo 

"vol_alignment=$(BR2_TARGET_ROOTFS_UBI_VOL_ALIGNMENT)" \

Quoted 1 line
Quoted 1 line

$(BUILD_DIR)/_ubinize.cfg ;\

     echo "image=$$@fs" \
Quoted 1 line
Quoted 1 line

$(BUILD_DIR)/_ubinize.cfg ;\

     $(HOST_DIR)/usr/sbin/ubinize -o $$@ $(UBI_UBINIZE_OPTS) 
$(BUILD_DIR)/_ubinize.cfg ;\
         rm $(BUILD_DIR)/_ubinize.cfg

endef

$(eval $(call ROOTFS_TARGET,ubi))

#############################################################

#3 lore raw
Quoted 2 lines · On Friday 02 March 2012 16:46:54 Roland wrote:

Which is better version... I'm specifically interested in the IF
section where BR2_TARGET_ROOTFS_UBI_ALIGNMENT_DEFINED is used.

Option 3 :-)

Remove the vol_alignment=1 from ubinize.cfg, and do the
'echo vol_alignment=...' unconditionally. Make sure that in Config.in, the BR2_TARGET_ROOTFS_UBI_ALIGNMENT defaults to 1 and you get exactly the same behaviour by default.

By the way, when you send your patches, please use git send-email
(see the man page for how to set it up with GMail). GMail destroys the formatting of the patch, so it won't apply. And we prefer not to get them as attachments because that makes them difficult to review.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F