Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Roland <rolandu@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] adding a new machine configuration
Date: Fri, 02 Mar 2012 18:46:54 +0200	[thread overview]
Message-ID: <4F50F97E.3070203@gmail.com> (raw)
In-Reply-To: <20120301143934.073f50a0@skate>

On 03/01/2012 03:39 PM, Thomas Petazzoni wrote:
> Le Thu, 01 Mar 2012 15:07:48 +0200,
> Roland<rolandu@gmail.com>  a ?crit :
>
>> 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?
>
>> 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

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)" \
 >> $(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)" \
 >> $(BUILD_DIR)/_ubinize.cfg ;\
         $(UBI_UBINIZE_ECHO_ALIGNMENT) \
     echo "image=$$@fs" \
 >> $(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)" \
 >> $(BUILD_DIR)/_ubinize.cfg ;\
         [ "_y" = "_$(BR2_TARGET_ROOTFS_UBI_ALIGNMENT_DEFINED)" ] && \
                 echo 
"vol_alignment=$(BR2_TARGET_ROOTFS_UBI_VOL_ALIGNMENT)" \
 >> $(BUILD_DIR)/_ubinize.cfg ;\
     echo "image=$$@fs" \
 >> $(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))

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

  reply	other threads:[~2012-03-02 16:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-01 13:07 [Buildroot] adding a new machine configuration Roland
2012-03-01 13:39 ` Thomas Petazzoni
2012-03-02 16:46   ` Roland [this message]
2012-03-02 22:41     ` Arnout Vandecappelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F50F97E.3070203@gmail.com \
    --to=rolandu@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox