<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.yoctoproject.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Venkata+Ramana+Gollamudi</id>
	<title>Yocto Project - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.yoctoproject.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Venkata+Ramana+Gollamudi"/>
	<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/Special:Contributions/Venkata_Ramana_Gollamudi"/>
	<updated>2026-05-03T12:50:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10705</id>
		<title>Binary configuration support</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10705"/>
		<updated>2013-07-17T15:47:05Z</updated>

		<summary type="html">&lt;p&gt;Venkata Ramana Gollamudi: /* What is Binary configuration? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Binary configuration? ==&lt;br /&gt;
Binary configuration allows configuration of post built binaries to generate custom image, without a need to rebuild from source &lt;br /&gt;
&lt;br /&gt;
Features that can be supported includes, however the list is tentative.&lt;br /&gt;
# Selects/deselects and integrates binary packages, i,e., OS packages &amp;amp; Various Applications packages from package pool, to generate the final image ready to deploy.&lt;br /&gt;
# Binary level offline configuration includes &lt;br /&gt;
#:Configure the users/passwords&lt;br /&gt;
#:Configure the network type etc&lt;br /&gt;
#:Configure the host name&lt;br /&gt;
#:Configure the serial console&lt;br /&gt;
#:Select the services to be started by default&lt;br /&gt;
#:Select the modules to be loaded by default&lt;br /&gt;
#:Security related configuration&lt;br /&gt;
#:configure exportfs format in ramfs/ext3/... partitioning etc&lt;br /&gt;
#:More...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It has following benefits&lt;br /&gt;
* User need not modify the poky layers content or build configuration for few configuration requirements.&lt;br /&gt;
* Makes packages and Linux image more configurable, gives platform for managing and extending binary configuration. &lt;br /&gt;
* Provides clean configuration interface to user.&lt;br /&gt;
* Allows selection of binary packages to be installed and supports package specific configuration.&lt;br /&gt;
* Facilitate sharing the package feed containing built packages, so that they can be used to generate a custom Linux image.&lt;br /&gt;
* Can be further extended to make configuration graphical user interface.&lt;br /&gt;
&lt;br /&gt;
Refer bug [3252]&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
Binary configuration can be used in two ways&lt;br /&gt;
# &#039;&#039;&#039;Binary configuration integrated to current poky&#039;&#039;&#039;: Useful for current users where target image is generated from poky while building from sources.&lt;br /&gt;
# &#039;&#039;&#039;Post build binary configuration&#039;&#039;&#039;: Useful for users who want to generate custom configured images from already built package binaries.&lt;br /&gt;
&lt;br /&gt;
== Binary configuration integrated to current poky ==&lt;br /&gt;
This allows Binary configuration to work along with poky. So Binary level user configuration changes will reflect into generated image.&lt;br /&gt;
[[File:Binary_config_integrated_with_poky.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Config Commands: ===&lt;br /&gt;
These are the configuration commands which allow each package to define how it can be configured. These are stored along with each package metadata. &lt;br /&gt;
:Ex: shadow package provides &#039;&#039;adduser&#039;&#039; config command. &lt;br /&gt;
Config commands can be overridden by different packages which support the same configuration but varying/extending implementation.&lt;br /&gt;
&lt;br /&gt;
Please refer section [[#Defining a new config command]].&lt;br /&gt;
&lt;br /&gt;
=== Config-Library: ===&lt;br /&gt;
All the configuration commands are copied to a single library during build. This library is called config-library. This library contains all the configurations that are supported on a particular build.&lt;br /&gt;
=== Binary level user configuration (file)===&lt;br /&gt;
Binary level user configuration file contains configuration values/parameters given by user to configure the image. It calls the configuration commands and passes them with appropriate parameters to configure.&lt;br /&gt;
&lt;br /&gt;
The configurations can be broadly divided into 3 major sections&lt;br /&gt;
# Selecting/omitting required packages to be installed into target image. &lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: addpkg(shadow)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Configuring the content&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: adduser(test, test123, life=999)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Exporting the rootfs&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: diskimage( ext3(size=10240)  )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Refer [[#Binary configuration file format]].&lt;br /&gt;
&lt;br /&gt;
== Post build binary configuration ==&lt;br /&gt;
[[File:Post_build_binary_configuration.jpg]]&lt;br /&gt;
&lt;br /&gt;
Post build binary configuration aims at configuring and generating the image from the built package binaries/repository. This process involves reading the configuration values from binary level configuration file and applying those configurations to generate rootfs. &#039;&#039;config-library&#039;&#039; which contains configuration commands is packed along with SDK and is used in applying the configuration.&lt;br /&gt;
So users now can configure the image by passing various configuration values as part of Binary level user Configuration file. Please refer to section [[#Binary level user configuration (file)]] for more details regarding Binary level user configuration.&lt;br /&gt;
&lt;br /&gt;
== Design details ==&lt;br /&gt;
Supporting Binary level configuration requires:&lt;br /&gt;
*Supporting a new configuration format.&lt;br /&gt;
*Parser to parse that format.&lt;br /&gt;
*Interfaces to read, modify and apply the configuration on the rootfs; such that image generation procedure can use these interfaces to generate the custom image.&lt;br /&gt;
&lt;br /&gt;
[[File:Binary_configuration_design_flow.jpg]]&lt;br /&gt;
=== Config parser ===&lt;br /&gt;
Parses the Binary level user Configuration file and generates the parsed content into a Config data tree. Also reports syntax and semantic errors if any.&lt;br /&gt;
=== Configuration Interface ===&lt;br /&gt;
==== cquery ====&lt;br /&gt;
Provides a query interface to read the Binary Configuration values given by user.&lt;br /&gt;
:Ex: to get install packages list.&lt;br /&gt;
==== cwrite ====&lt;br /&gt;
Provides a write interface to write or modify the configuration data. Provided for future use.&lt;br /&gt;
:Ex: Useful for GUI based configuration editor implementation&lt;br /&gt;
==== capply ====&lt;br /&gt;
Provides an interface to apply the Binary level user configuration values on to the rootfs to generate custom configured image. Configuration commands from config-library are called to apply the configuration.&lt;br /&gt;
&lt;br /&gt;
=== Defining a new config command ===&lt;br /&gt;
Config commands are implemented in python in &#039;&#039;&amp;lt;package_name&amp;gt;_cfg.py&#039;&#039; file which is kept under &#039;&#039;&amp;lt;package&amp;gt;/files/configlib/pkgconf&#039;&#039; folder. Adding a new config command requires&lt;br /&gt;
# Deriving new config command class from &#039;&#039;ConfigCmd&#039;&#039; class.&lt;br /&gt;
# Add &#039;&#039;__init__( )&#039;&#039; method with method parameters as per the arguments to be passed to config command, including default arguments. Any validation on command input can also be added here. Store the parameters as class members.&lt;br /&gt;
# Add/override &#039;&#039;execute()&#039;&#039; method and add logic to apply the configuration. Shell functions can also be called from here by using &#039;&#039;shellexec&#039;&#039; python library.&lt;br /&gt;
# Add  &amp;lt;code&amp;gt;inherit binary-config-package&amp;lt;/code&amp;gt; to shadow bb file&lt;br /&gt;
&lt;br /&gt;
[[File:configcmd_class_diagram.jpg]]&lt;br /&gt;
&lt;br /&gt;
Sample code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Ex: shadow/files/configlib/lib/pkgconf/shadow_cfg.py&lt;br /&gt;
&lt;br /&gt;
from configcmd import *&lt;br /&gt;
class users_adduser (ConfigCmd):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;config command to add user&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    uname=&amp;quot;&amp;quot;&lt;br /&gt;
    passwd=&amp;quot;&amp;quot;&lt;br /&gt;
    life=&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def __init__(self,uname, passwd=&amp;quot;&amp;quot;, life=99999):&lt;br /&gt;
        #any input validation can be done here&lt;br /&gt;
        self.uname = uname&lt;br /&gt;
        self.passwd = passwd&lt;br /&gt;
        self.life = life&lt;br /&gt;
&lt;br /&gt;
    def execute(self):&lt;br /&gt;
        #write logic to create user&lt;br /&gt;
        print &amp;quot;User :&amp;quot;+self.uname+&amp;quot; added&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Appendix ==&lt;br /&gt;
=== Binary configuration file format ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#   Author        : venkatarg@huawei.com&lt;br /&gt;
#   Description   : This is a sample format, only for reference however actual functions configuration funtions will differ&lt;br /&gt;
#   version       : 0.1&lt;br /&gt;
#&lt;br /&gt;
#   BNF for conf file:&lt;br /&gt;
#&lt;br /&gt;
# sectiondef	: &#039;[&#039; sectioninfo &#039;]&#039; [statements]         &lt;br /&gt;
# statements	: [ statement ]*                           &lt;br /&gt;
# statement 	: operation &#039;(&#039; [paramlist] &#039;)&#039;              &lt;br /&gt;
# operation 	: identifier&lt;br /&gt;
# paramlist 	: param [, param ]*                         &lt;br /&gt;
# param     	: directparam | fullparam | embstatement   &lt;br /&gt;
# directparam 	: nondelimiters | &#039;&amp;quot;&#039; anycharcters &#039;&amp;quot;&#039;    &lt;br /&gt;
# fullparam   	: identifier &#039;=&#039; (directparam | embstatement) &lt;br /&gt;
# embstatement 	: statement                             &lt;br /&gt;
# identifier  	: [ alphanums_-. ]&lt;br /&gt;
# nondelimiters : &amp;lt;anycharcters except [ or ( or &amp;quot; or , or ) or ] &amp;gt;&lt;br /&gt;
&lt;br /&gt;
[general]&lt;br /&gt;
version( &amp;quot;1.2&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[pkgs]&lt;br /&gt;
addlib( 32,64 )&lt;br /&gt;
&lt;br /&gt;
#minimal/mandatory pkgs are default added&lt;br /&gt;
addpkg( libacl )&lt;br /&gt;
&lt;br /&gt;
#add all kernal module except kernel-module-pchspi&lt;br /&gt;
addpkg( kernel-module*, !kernel-module-pchspi )&lt;br /&gt;
&lt;br /&gt;
addpkgs( packagegroup-core-boot,&lt;br /&gt;
	openssh,&lt;br /&gt;
	busybox,&lt;br /&gt;
	update-modules,&lt;br /&gt;
	# Additional Package Configuration&lt;br /&gt;
	binutils,&lt;br /&gt;
	coreutils,&lt;br /&gt;
	cracklib,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	e2fsprogs-e2fsck,&lt;br /&gt;
	e2fsprogs-mke2fs,&lt;br /&gt;
	e2fsprogs-ext4,&lt;br /&gt;
	elfutils,&lt;br /&gt;
	elfutils-libebl,&lt;br /&gt;
	iproute2,&lt;br /&gt;
	iputils,&lt;br /&gt;
	logrotate,&lt;br /&gt;
	nfs-utils,&lt;br /&gt;
	numactl-2.0.3-r0.x86_64,&lt;br /&gt;
	numactl-2.0.3-r0.x86,&lt;br /&gt;
	libstdcxx,&lt;br /&gt;
	libpam,&lt;br /&gt;
	pam-plugin-*,&lt;br /&gt;
	!pam-plugin-motd,&lt;br /&gt;
	!pam-plugin-permit,&lt;br /&gt;
	pciutils,&lt;br /&gt;
	portmap,&lt;br /&gt;
	procps,&lt;br /&gt;
	sed,&lt;br /&gt;
	shadow,&lt;br /&gt;
	sysconfig,&lt;br /&gt;
	syslog-ng,&lt;br /&gt;
	sysvinit,&lt;br /&gt;
	sysvinit-pidof,&lt;br /&gt;
	hw-breakpoint,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	util-linux,&lt;br /&gt;
	vlan,&lt;br /&gt;
	perf,&lt;br /&gt;
	lock-task )&lt;br /&gt;
&lt;br /&gt;
adddebugpkg( strace,&lt;br /&gt;
	     ethtool,&lt;br /&gt;
	     file,&lt;br /&gt;
	     binutils-debug,&lt;br /&gt;
	     oprofile,&lt;br /&gt;
	     iproute2-debug&lt;br /&gt;
	    )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[module-init]&lt;br /&gt;
configmod( module_squashfs_modules, package=kernel-module-sqashfs, status=e)&lt;br /&gt;
configmod( module_ramfs_modules,&lt;br /&gt;
	   package=kernel-module-ramfs,&lt;br /&gt;
	   status=e,&lt;br /&gt;
	   param=&amp;quot;rsize=100,caddress=0x444&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[users]&lt;br /&gt;
addgroup( rtos )&lt;br /&gt;
adduser( ramana, pwdhhxx, life=9999 ) &lt;br /&gt;
adduser( user1, pwdhhyy, life=9999 , shell=/usr/bin) &lt;br /&gt;
adduser( uname=user2, pwd=pwdhhyy, life=9999 ,&lt;br /&gt;
	 shell=/usr/bin,&lt;br /&gt;
	 group=&amp;quot;mail,ssh,rtos&amp;quot; ) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[kernel]&lt;br /&gt;
kernelparam( &amp;quot;nmi_watchdog=1 rdinit=/sc_init&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[network]&lt;br /&gt;
ifconfig( eth0, 10.18.89.222, 255.255.255.0) &lt;br /&gt;
ifconfig( eth1, ffe::200 , mode=6) &lt;br /&gt;
addroute( eth0, 10.18.89.*, 192.168.1.1 )&lt;br /&gt;
addroute( eth1, ffe::*, FF2::1 , mode=6 )&lt;br /&gt;
&lt;br /&gt;
[security]&lt;br /&gt;
include ( security.conf )&lt;br /&gt;
&lt;br /&gt;
[export]&lt;br /&gt;
# should be more detailed and relooked&lt;br /&gt;
diskimage( &lt;br /&gt;
	partitions (&lt;br /&gt;
		partition( hd0, /home , ext4, size=3G, flags=&amp;quot;r acp&amp;quot;, fstab=y ),&lt;br /&gt;
		partition( hd1, / , ext4, size=max, flags=&amp;quot;rw acp&amp;quot; , fstab=y )&lt;br /&gt;
		)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
diskimage(&lt;br /&gt;
	ext2(size=10240)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512 )&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512, fs=/home),&lt;br /&gt;
	cramfs( entrypoint=0x888888880000,size=10240,blocksize=512, fs=&amp;quot;/ !/home&amp;quot;)&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
archiveimage( type=cpio.tar.gz )&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
isoimage(dvd) &lt;br /&gt;
&lt;br /&gt;
[others]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Venkata Ramana Gollamudi</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10704</id>
		<title>Binary configuration support</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10704"/>
		<updated>2013-07-17T15:15:26Z</updated>

		<summary type="html">&lt;p&gt;Venkata Ramana Gollamudi: /* Binary level user configuration (file) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Binary configuration? ==&lt;br /&gt;
Binary configuration allows configuration of post built binaries. It gets the following features and benefits&lt;br /&gt;
* Makes packages and linux image more configurable, gives platform for extending and managing binary configuration. &lt;br /&gt;
* Provides clean configuration interface to user.&lt;br /&gt;
* Allows post build package selection and package specific configuration.&lt;br /&gt;
* Facilitate sharing the package feed containing built packages, so that they can be used to generate a custom linux image.&lt;br /&gt;
&lt;br /&gt;
Refer bug [3252]&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
Binary configuration can be used in two ways&lt;br /&gt;
# &#039;&#039;&#039;Binary configuration integrated to current poky&#039;&#039;&#039;: Useful for current users where target image is generated from poky while building from sources.&lt;br /&gt;
# &#039;&#039;&#039;Post build binary configuration&#039;&#039;&#039;: Useful for users who want to generate custom configured images from already built package binaries.&lt;br /&gt;
&lt;br /&gt;
== Binary configuration integrated to current poky ==&lt;br /&gt;
This allows Binary configuration to work along with poky. So Binary level user configuration changes will reflect into generated image.&lt;br /&gt;
[[File:Binary_config_integrated_with_poky.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Config Commands: ===&lt;br /&gt;
These are the configuration commands which allow each package to define how it can be configured. These are stored along with each package metadata. &lt;br /&gt;
:Ex: shadow package provides &#039;&#039;adduser&#039;&#039; config command. &lt;br /&gt;
Config commands can be overridden by different packages which support the same configuration but varying/extending implementation.&lt;br /&gt;
&lt;br /&gt;
Please refer section [[#Defining a new config command]].&lt;br /&gt;
&lt;br /&gt;
=== Config-Library: ===&lt;br /&gt;
All the configuration commands are copied to a single library during build. This library is called config-library. This library contains all the configurations that are supported on a particular build.&lt;br /&gt;
=== Binary level user configuration (file)===&lt;br /&gt;
Binary level user configuration file contains configuration values/parameters given by user to configure the image. It calls the configuration commands and passes them with appropriate parameters to configure.&lt;br /&gt;
&lt;br /&gt;
The configurations can be broadly divided into 3 major sections&lt;br /&gt;
# Selecting/omitting required packages to be installed into target image. &lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: addpkg(shadow)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Configuring the content&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: adduser(test, test123, life=999)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Exporting the rootfs&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: diskimage( ext3(size=10240)  )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Refer [[#Binary configuration file format]].&lt;br /&gt;
&lt;br /&gt;
== Post build binary configuration ==&lt;br /&gt;
[[File:Post_build_binary_configuration.jpg]]&lt;br /&gt;
&lt;br /&gt;
Post build binary configuration aims at configuring and generating the image from the built package binaries/repository. This process involves reading the configuration values from binary level configuration file and applying those configurations to generate rootfs. &#039;&#039;config-library&#039;&#039; which contains configuration commands is packed along with SDK and is used in applying the configuration.&lt;br /&gt;
So users now can configure the image by passing various configuration values as part of Binary level user Configuration file. Please refer to section [[#Binary level user configuration (file)]] for more details regarding Binary level user configuration.&lt;br /&gt;
&lt;br /&gt;
== Design details ==&lt;br /&gt;
Supporting Binary level configuration requires:&lt;br /&gt;
*Supporting a new configuration format.&lt;br /&gt;
*Parser to parse that format.&lt;br /&gt;
*Interfaces to read, modify and apply the configuration on the rootfs; such that image generation procedure can use these interfaces to generate the custom image.&lt;br /&gt;
&lt;br /&gt;
[[File:Binary_configuration_design_flow.jpg]]&lt;br /&gt;
=== Config parser ===&lt;br /&gt;
Parses the Binary level user Configuration file and generates the parsed content into a Config data tree. Also reports syntax and semantic errors if any.&lt;br /&gt;
=== Configuration Interface ===&lt;br /&gt;
==== cquery ====&lt;br /&gt;
Provides a query interface to read the Binary Configuration values given by user.&lt;br /&gt;
:Ex: to get install packages list.&lt;br /&gt;
==== cwrite ====&lt;br /&gt;
Provides a write interface to write or modify the configuration data. Provided for future use.&lt;br /&gt;
:Ex: Useful for GUI based configuration editor implementation&lt;br /&gt;
==== capply ====&lt;br /&gt;
Provides an interface to apply the Binary level user configuration values on to the rootfs to generate custom configured image. Configuration commands from config-library are called to apply the configuration.&lt;br /&gt;
&lt;br /&gt;
=== Defining a new config command ===&lt;br /&gt;
Config commands are implemented in python in &#039;&#039;&amp;lt;package_name&amp;gt;_cfg.py&#039;&#039; file which is kept under &#039;&#039;&amp;lt;package&amp;gt;/files/configlib/pkgconf&#039;&#039; folder. Adding a new config command requires&lt;br /&gt;
# Deriving new config command class from &#039;&#039;ConfigCmd&#039;&#039; class.&lt;br /&gt;
# Add &#039;&#039;__init__( )&#039;&#039; method with method parameters as per the arguments to be passed to config command, including default arguments. Any validation on command input can also be added here. Store the parameters as class members.&lt;br /&gt;
# Add/override &#039;&#039;execute()&#039;&#039; method and add logic to apply the configuration. Shell functions can also be called from here by using &#039;&#039;shellexec&#039;&#039; python library.&lt;br /&gt;
# Add  &amp;lt;code&amp;gt;inherit binary-config-package&amp;lt;/code&amp;gt; to shadow bb file&lt;br /&gt;
&lt;br /&gt;
[[File:configcmd_class_diagram.jpg]]&lt;br /&gt;
&lt;br /&gt;
Sample code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Ex: shadow/files/configlib/lib/pkgconf/shadow_cfg.py&lt;br /&gt;
&lt;br /&gt;
from configcmd import *&lt;br /&gt;
class users_adduser (ConfigCmd):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;config command to add user&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    uname=&amp;quot;&amp;quot;&lt;br /&gt;
    passwd=&amp;quot;&amp;quot;&lt;br /&gt;
    life=&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def __init__(self,uname, passwd=&amp;quot;&amp;quot;, life=99999):&lt;br /&gt;
        #any input validation can be done here&lt;br /&gt;
        self.uname = uname&lt;br /&gt;
        self.passwd = passwd&lt;br /&gt;
        self.life = life&lt;br /&gt;
&lt;br /&gt;
    def execute(self):&lt;br /&gt;
        #write logic to create user&lt;br /&gt;
        print &amp;quot;User :&amp;quot;+self.uname+&amp;quot; added&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Appendix ==&lt;br /&gt;
=== Binary configuration file format ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#   Author        : venkatarg@huawei.com&lt;br /&gt;
#   Description   : This is a sample format, only for reference however actual functions configuration funtions will differ&lt;br /&gt;
#   version       : 0.1&lt;br /&gt;
#&lt;br /&gt;
#   BNF for conf file:&lt;br /&gt;
#&lt;br /&gt;
# sectiondef	: &#039;[&#039; sectioninfo &#039;]&#039; [statements]         &lt;br /&gt;
# statements	: [ statement ]*                           &lt;br /&gt;
# statement 	: operation &#039;(&#039; [paramlist] &#039;)&#039;              &lt;br /&gt;
# operation 	: identifier&lt;br /&gt;
# paramlist 	: param [, param ]*                         &lt;br /&gt;
# param     	: directparam | fullparam | embstatement   &lt;br /&gt;
# directparam 	: nondelimiters | &#039;&amp;quot;&#039; anycharcters &#039;&amp;quot;&#039;    &lt;br /&gt;
# fullparam   	: identifier &#039;=&#039; (directparam | embstatement) &lt;br /&gt;
# embstatement 	: statement                             &lt;br /&gt;
# identifier  	: [ alphanums_-. ]&lt;br /&gt;
# nondelimiters : &amp;lt;anycharcters except [ or ( or &amp;quot; or , or ) or ] &amp;gt;&lt;br /&gt;
&lt;br /&gt;
[general]&lt;br /&gt;
version( &amp;quot;1.2&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[pkgs]&lt;br /&gt;
addlib( 32,64 )&lt;br /&gt;
&lt;br /&gt;
#minimal/mandatory pkgs are default added&lt;br /&gt;
addpkg( libacl )&lt;br /&gt;
&lt;br /&gt;
#add all kernal module except kernel-module-pchspi&lt;br /&gt;
addpkg( kernel-module*, !kernel-module-pchspi )&lt;br /&gt;
&lt;br /&gt;
addpkgs( packagegroup-core-boot,&lt;br /&gt;
	openssh,&lt;br /&gt;
	busybox,&lt;br /&gt;
	update-modules,&lt;br /&gt;
	# Additional Package Configuration&lt;br /&gt;
	binutils,&lt;br /&gt;
	coreutils,&lt;br /&gt;
	cracklib,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	e2fsprogs-e2fsck,&lt;br /&gt;
	e2fsprogs-mke2fs,&lt;br /&gt;
	e2fsprogs-ext4,&lt;br /&gt;
	elfutils,&lt;br /&gt;
	elfutils-libebl,&lt;br /&gt;
	iproute2,&lt;br /&gt;
	iputils,&lt;br /&gt;
	logrotate,&lt;br /&gt;
	nfs-utils,&lt;br /&gt;
	numactl-2.0.3-r0.x86_64,&lt;br /&gt;
	numactl-2.0.3-r0.x86,&lt;br /&gt;
	libstdcxx,&lt;br /&gt;
	libpam,&lt;br /&gt;
	pam-plugin-*,&lt;br /&gt;
	!pam-plugin-motd,&lt;br /&gt;
	!pam-plugin-permit,&lt;br /&gt;
	pciutils,&lt;br /&gt;
	portmap,&lt;br /&gt;
	procps,&lt;br /&gt;
	sed,&lt;br /&gt;
	shadow,&lt;br /&gt;
	sysconfig,&lt;br /&gt;
	syslog-ng,&lt;br /&gt;
	sysvinit,&lt;br /&gt;
	sysvinit-pidof,&lt;br /&gt;
	hw-breakpoint,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	util-linux,&lt;br /&gt;
	vlan,&lt;br /&gt;
	perf,&lt;br /&gt;
	lock-task )&lt;br /&gt;
&lt;br /&gt;
adddebugpkg( strace,&lt;br /&gt;
	     ethtool,&lt;br /&gt;
	     file,&lt;br /&gt;
	     binutils-debug,&lt;br /&gt;
	     oprofile,&lt;br /&gt;
	     iproute2-debug&lt;br /&gt;
	    )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[module-init]&lt;br /&gt;
configmod( module_squashfs_modules, package=kernel-module-sqashfs, status=e)&lt;br /&gt;
configmod( module_ramfs_modules,&lt;br /&gt;
	   package=kernel-module-ramfs,&lt;br /&gt;
	   status=e,&lt;br /&gt;
	   param=&amp;quot;rsize=100,caddress=0x444&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[users]&lt;br /&gt;
addgroup( rtos )&lt;br /&gt;
adduser( ramana, pwdhhxx, life=9999 ) &lt;br /&gt;
adduser( user1, pwdhhyy, life=9999 , shell=/usr/bin) &lt;br /&gt;
adduser( uname=user2, pwd=pwdhhyy, life=9999 ,&lt;br /&gt;
	 shell=/usr/bin,&lt;br /&gt;
	 group=&amp;quot;mail,ssh,rtos&amp;quot; ) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[kernel]&lt;br /&gt;
kernelparam( &amp;quot;nmi_watchdog=1 rdinit=/sc_init&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[network]&lt;br /&gt;
ifconfig( eth0, 10.18.89.222, 255.255.255.0) &lt;br /&gt;
ifconfig( eth1, ffe::200 , mode=6) &lt;br /&gt;
addroute( eth0, 10.18.89.*, 192.168.1.1 )&lt;br /&gt;
addroute( eth1, ffe::*, FF2::1 , mode=6 )&lt;br /&gt;
&lt;br /&gt;
[security]&lt;br /&gt;
include ( security.conf )&lt;br /&gt;
&lt;br /&gt;
[export]&lt;br /&gt;
# should be more detailed and relooked&lt;br /&gt;
diskimage( &lt;br /&gt;
	partitions (&lt;br /&gt;
		partition( hd0, /home , ext4, size=3G, flags=&amp;quot;r acp&amp;quot;, fstab=y ),&lt;br /&gt;
		partition( hd1, / , ext4, size=max, flags=&amp;quot;rw acp&amp;quot; , fstab=y )&lt;br /&gt;
		)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
diskimage(&lt;br /&gt;
	ext2(size=10240)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512 )&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512, fs=/home),&lt;br /&gt;
	cramfs( entrypoint=0x888888880000,size=10240,blocksize=512, fs=&amp;quot;/ !/home&amp;quot;)&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
archiveimage( type=cpio.tar.gz )&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
isoimage(dvd) &lt;br /&gt;
&lt;br /&gt;
[others]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Venkata Ramana Gollamudi</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10703</id>
		<title>Binary configuration support</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10703"/>
		<updated>2013-07-17T15:13:45Z</updated>

		<summary type="html">&lt;p&gt;Venkata Ramana Gollamudi: /* Post build binary configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Binary configuration? ==&lt;br /&gt;
Binary configuration allows configuration of post built binaries. It gets the following features and benefits&lt;br /&gt;
* Makes packages and linux image more configurable, gives platform for extending and managing binary configuration. &lt;br /&gt;
* Provides clean configuration interface to user.&lt;br /&gt;
* Allows post build package selection and package specific configuration.&lt;br /&gt;
* Facilitate sharing the package feed containing built packages, so that they can be used to generate a custom linux image.&lt;br /&gt;
&lt;br /&gt;
Refer bug [3252]&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
Binary configuration can be used in two ways&lt;br /&gt;
# &#039;&#039;&#039;Binary configuration integrated to current poky&#039;&#039;&#039;: Useful for current users where target image is generated from poky while building from sources.&lt;br /&gt;
# &#039;&#039;&#039;Post build binary configuration&#039;&#039;&#039;: Useful for users who want to generate custom configured images from already built package binaries.&lt;br /&gt;
&lt;br /&gt;
== Binary configuration integrated to current poky ==&lt;br /&gt;
This allows Binary configuration to work along with poky. So Binary level user configuration changes will reflect into generated image.&lt;br /&gt;
[[File:Binary_config_integrated_with_poky.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Config Commands: ===&lt;br /&gt;
These are the configuration commands which allow each package to define how it can be configured. These are stored along with each package metadata. &lt;br /&gt;
:Ex: shadow package provides &#039;&#039;adduser&#039;&#039; config command. &lt;br /&gt;
Config commands can be overridden by different packages which support the same configuration but varying/extending implementation.&lt;br /&gt;
&lt;br /&gt;
Please refer section [[#Defining a new config command]].&lt;br /&gt;
&lt;br /&gt;
=== Config-Library: ===&lt;br /&gt;
All the configuration commands are copied to a single library during build. This library is called config-library. This library contains all the configurations that are supported on a particular build.&lt;br /&gt;
=== Binary level user configuration (file)===&lt;br /&gt;
Binary level user configuration file contains configuration values/parameters given by user to configure the image. It calls the configuration commands and passes them with appropriate parameters to configure.&lt;br /&gt;
&lt;br /&gt;
The configurations can be broadly divided into 3 major sections&lt;br /&gt;
# Selecting/omitting required packages to be installed into target image. &lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: addpkg(shadow)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Configuring the content&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: adduser(test, test123, life=999)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Exporting the rootfs&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: diskimage( ext3(size=10240)  )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For sample user configuration file refer to appendix A.&lt;br /&gt;
&lt;br /&gt;
== Post build binary configuration ==&lt;br /&gt;
[[File:Post_build_binary_configuration.jpg]]&lt;br /&gt;
&lt;br /&gt;
Post build binary configuration aims at configuring and generating the image from the built package binaries/repository. This process involves reading the configuration values from binary level configuration file and applying those configurations to generate rootfs. &#039;&#039;config-library&#039;&#039; which contains configuration commands is packed along with SDK and is used in applying the configuration.&lt;br /&gt;
So users now can configure the image by passing various configuration values as part of Binary level user Configuration file. Please refer to section [[#Binary level user configuration (file)]] for more details regarding Binary level user configuration.&lt;br /&gt;
&lt;br /&gt;
== Design details ==&lt;br /&gt;
Supporting Binary level configuration requires:&lt;br /&gt;
*Supporting a new configuration format.&lt;br /&gt;
*Parser to parse that format.&lt;br /&gt;
*Interfaces to read, modify and apply the configuration on the rootfs; such that image generation procedure can use these interfaces to generate the custom image.&lt;br /&gt;
&lt;br /&gt;
[[File:Binary_configuration_design_flow.jpg]]&lt;br /&gt;
=== Config parser ===&lt;br /&gt;
Parses the Binary level user Configuration file and generates the parsed content into a Config data tree. Also reports syntax and semantic errors if any.&lt;br /&gt;
=== Configuration Interface ===&lt;br /&gt;
==== cquery ====&lt;br /&gt;
Provides a query interface to read the Binary Configuration values given by user.&lt;br /&gt;
:Ex: to get install packages list.&lt;br /&gt;
==== cwrite ====&lt;br /&gt;
Provides a write interface to write or modify the configuration data. Provided for future use.&lt;br /&gt;
:Ex: Useful for GUI based configuration editor implementation&lt;br /&gt;
==== capply ====&lt;br /&gt;
Provides an interface to apply the Binary level user configuration values on to the rootfs to generate custom configured image. Configuration commands from config-library are called to apply the configuration.&lt;br /&gt;
&lt;br /&gt;
=== Defining a new config command ===&lt;br /&gt;
Config commands are implemented in python in &#039;&#039;&amp;lt;package_name&amp;gt;_cfg.py&#039;&#039; file which is kept under &#039;&#039;&amp;lt;package&amp;gt;/files/configlib/pkgconf&#039;&#039; folder. Adding a new config command requires&lt;br /&gt;
# Deriving new config command class from &#039;&#039;ConfigCmd&#039;&#039; class.&lt;br /&gt;
# Add &#039;&#039;__init__( )&#039;&#039; method with method parameters as per the arguments to be passed to config command, including default arguments. Any validation on command input can also be added here. Store the parameters as class members.&lt;br /&gt;
# Add/override &#039;&#039;execute()&#039;&#039; method and add logic to apply the configuration. Shell functions can also be called from here by using &#039;&#039;shellexec&#039;&#039; python library.&lt;br /&gt;
# Add  &amp;lt;code&amp;gt;inherit binary-config-package&amp;lt;/code&amp;gt; to shadow bb file&lt;br /&gt;
&lt;br /&gt;
[[File:configcmd_class_diagram.jpg]]&lt;br /&gt;
&lt;br /&gt;
Sample code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Ex: shadow/files/configlib/lib/pkgconf/shadow_cfg.py&lt;br /&gt;
&lt;br /&gt;
from configcmd import *&lt;br /&gt;
class users_adduser (ConfigCmd):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;config command to add user&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    uname=&amp;quot;&amp;quot;&lt;br /&gt;
    passwd=&amp;quot;&amp;quot;&lt;br /&gt;
    life=&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def __init__(self,uname, passwd=&amp;quot;&amp;quot;, life=99999):&lt;br /&gt;
        #any input validation can be done here&lt;br /&gt;
        self.uname = uname&lt;br /&gt;
        self.passwd = passwd&lt;br /&gt;
        self.life = life&lt;br /&gt;
&lt;br /&gt;
    def execute(self):&lt;br /&gt;
        #write logic to create user&lt;br /&gt;
        print &amp;quot;User :&amp;quot;+self.uname+&amp;quot; added&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Appendix ==&lt;br /&gt;
=== Binary configuration file format ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#   Author        : venkatarg@huawei.com&lt;br /&gt;
#   Description   : This is a sample format, only for reference however actual functions configuration funtions will differ&lt;br /&gt;
#   version       : 0.1&lt;br /&gt;
#&lt;br /&gt;
#   BNF for conf file:&lt;br /&gt;
#&lt;br /&gt;
# sectiondef	: &#039;[&#039; sectioninfo &#039;]&#039; [statements]         &lt;br /&gt;
# statements	: [ statement ]*                           &lt;br /&gt;
# statement 	: operation &#039;(&#039; [paramlist] &#039;)&#039;              &lt;br /&gt;
# operation 	: identifier&lt;br /&gt;
# paramlist 	: param [, param ]*                         &lt;br /&gt;
# param     	: directparam | fullparam | embstatement   &lt;br /&gt;
# directparam 	: nondelimiters | &#039;&amp;quot;&#039; anycharcters &#039;&amp;quot;&#039;    &lt;br /&gt;
# fullparam   	: identifier &#039;=&#039; (directparam | embstatement) &lt;br /&gt;
# embstatement 	: statement                             &lt;br /&gt;
# identifier  	: [ alphanums_-. ]&lt;br /&gt;
# nondelimiters : &amp;lt;anycharcters except [ or ( or &amp;quot; or , or ) or ] &amp;gt;&lt;br /&gt;
&lt;br /&gt;
[general]&lt;br /&gt;
version( &amp;quot;1.2&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[pkgs]&lt;br /&gt;
addlib( 32,64 )&lt;br /&gt;
&lt;br /&gt;
#minimal/mandatory pkgs are default added&lt;br /&gt;
addpkg( libacl )&lt;br /&gt;
&lt;br /&gt;
#add all kernal module except kernel-module-pchspi&lt;br /&gt;
addpkg( kernel-module*, !kernel-module-pchspi )&lt;br /&gt;
&lt;br /&gt;
addpkgs( packagegroup-core-boot,&lt;br /&gt;
	openssh,&lt;br /&gt;
	busybox,&lt;br /&gt;
	update-modules,&lt;br /&gt;
	# Additional Package Configuration&lt;br /&gt;
	binutils,&lt;br /&gt;
	coreutils,&lt;br /&gt;
	cracklib,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	e2fsprogs-e2fsck,&lt;br /&gt;
	e2fsprogs-mke2fs,&lt;br /&gt;
	e2fsprogs-ext4,&lt;br /&gt;
	elfutils,&lt;br /&gt;
	elfutils-libebl,&lt;br /&gt;
	iproute2,&lt;br /&gt;
	iputils,&lt;br /&gt;
	logrotate,&lt;br /&gt;
	nfs-utils,&lt;br /&gt;
	numactl-2.0.3-r0.x86_64,&lt;br /&gt;
	numactl-2.0.3-r0.x86,&lt;br /&gt;
	libstdcxx,&lt;br /&gt;
	libpam,&lt;br /&gt;
	pam-plugin-*,&lt;br /&gt;
	!pam-plugin-motd,&lt;br /&gt;
	!pam-plugin-permit,&lt;br /&gt;
	pciutils,&lt;br /&gt;
	portmap,&lt;br /&gt;
	procps,&lt;br /&gt;
	sed,&lt;br /&gt;
	shadow,&lt;br /&gt;
	sysconfig,&lt;br /&gt;
	syslog-ng,&lt;br /&gt;
	sysvinit,&lt;br /&gt;
	sysvinit-pidof,&lt;br /&gt;
	hw-breakpoint,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	util-linux,&lt;br /&gt;
	vlan,&lt;br /&gt;
	perf,&lt;br /&gt;
	lock-task )&lt;br /&gt;
&lt;br /&gt;
adddebugpkg( strace,&lt;br /&gt;
	     ethtool,&lt;br /&gt;
	     file,&lt;br /&gt;
	     binutils-debug,&lt;br /&gt;
	     oprofile,&lt;br /&gt;
	     iproute2-debug&lt;br /&gt;
	    )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[module-init]&lt;br /&gt;
configmod( module_squashfs_modules, package=kernel-module-sqashfs, status=e)&lt;br /&gt;
configmod( module_ramfs_modules,&lt;br /&gt;
	   package=kernel-module-ramfs,&lt;br /&gt;
	   status=e,&lt;br /&gt;
	   param=&amp;quot;rsize=100,caddress=0x444&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[users]&lt;br /&gt;
addgroup( rtos )&lt;br /&gt;
adduser( ramana, pwdhhxx, life=9999 ) &lt;br /&gt;
adduser( user1, pwdhhyy, life=9999 , shell=/usr/bin) &lt;br /&gt;
adduser( uname=user2, pwd=pwdhhyy, life=9999 ,&lt;br /&gt;
	 shell=/usr/bin,&lt;br /&gt;
	 group=&amp;quot;mail,ssh,rtos&amp;quot; ) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[kernel]&lt;br /&gt;
kernelparam( &amp;quot;nmi_watchdog=1 rdinit=/sc_init&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[network]&lt;br /&gt;
ifconfig( eth0, 10.18.89.222, 255.255.255.0) &lt;br /&gt;
ifconfig( eth1, ffe::200 , mode=6) &lt;br /&gt;
addroute( eth0, 10.18.89.*, 192.168.1.1 )&lt;br /&gt;
addroute( eth1, ffe::*, FF2::1 , mode=6 )&lt;br /&gt;
&lt;br /&gt;
[security]&lt;br /&gt;
include ( security.conf )&lt;br /&gt;
&lt;br /&gt;
[export]&lt;br /&gt;
# should be more detailed and relooked&lt;br /&gt;
diskimage( &lt;br /&gt;
	partitions (&lt;br /&gt;
		partition( hd0, /home , ext4, size=3G, flags=&amp;quot;r acp&amp;quot;, fstab=y ),&lt;br /&gt;
		partition( hd1, / , ext4, size=max, flags=&amp;quot;rw acp&amp;quot; , fstab=y )&lt;br /&gt;
		)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
diskimage(&lt;br /&gt;
	ext2(size=10240)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512 )&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512, fs=/home),&lt;br /&gt;
	cramfs( entrypoint=0x888888880000,size=10240,blocksize=512, fs=&amp;quot;/ !/home&amp;quot;)&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
archiveimage( type=cpio.tar.gz )&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
isoimage(dvd) &lt;br /&gt;
&lt;br /&gt;
[others]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Venkata Ramana Gollamudi</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10702</id>
		<title>Binary configuration support</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10702"/>
		<updated>2013-07-17T15:10:25Z</updated>

		<summary type="html">&lt;p&gt;Venkata Ramana Gollamudi: /* Binary level user configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Binary configuration? ==&lt;br /&gt;
Binary configuration allows configuration of post built binaries. It gets the following features and benefits&lt;br /&gt;
* Makes packages and linux image more configurable, gives platform for extending and managing binary configuration. &lt;br /&gt;
* Provides clean configuration interface to user.&lt;br /&gt;
* Allows post build package selection and package specific configuration.&lt;br /&gt;
* Facilitate sharing the package feed containing built packages, so that they can be used to generate a custom linux image.&lt;br /&gt;
&lt;br /&gt;
Refer bug [3252]&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
Binary configuration can be used in two ways&lt;br /&gt;
# &#039;&#039;&#039;Binary configuration integrated to current poky&#039;&#039;&#039;: Useful for current users where target image is generated from poky while building from sources.&lt;br /&gt;
# &#039;&#039;&#039;Post build binary configuration&#039;&#039;&#039;: Useful for users who want to generate custom configured images from already built package binaries.&lt;br /&gt;
&lt;br /&gt;
== Binary configuration integrated to current poky ==&lt;br /&gt;
This allows Binary configuration to work along with poky. So Binary level user configuration changes will reflect into generated image.&lt;br /&gt;
[[File:Binary_config_integrated_with_poky.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Config Commands: ===&lt;br /&gt;
These are the configuration commands which allow each package to define how it can be configured. These are stored along with each package metadata. &lt;br /&gt;
:Ex: shadow package provides &#039;&#039;adduser&#039;&#039; config command. &lt;br /&gt;
Config commands can be overridden by different packages which support the same configuration but varying/extending implementation.&lt;br /&gt;
&lt;br /&gt;
Please refer section [[#Defining a new config command]].&lt;br /&gt;
&lt;br /&gt;
=== Config-Library: ===&lt;br /&gt;
All the configuration commands are copied to a single library during build. This library is called config-library. This library contains all the configurations that are supported on a particular build.&lt;br /&gt;
=== Binary level user configuration (file)===&lt;br /&gt;
Binary level user configuration file contains configuration values/parameters given by user to configure the image. It calls the configuration commands and passes them with appropriate parameters to configure.&lt;br /&gt;
&lt;br /&gt;
The configurations can be broadly divided into 3 major sections&lt;br /&gt;
# Selecting/omitting required packages to be installed into target image. &lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: addpkg(shadow)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Configuring the content&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: adduser(test, test123, life=999)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Exporting the rootfs&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: diskimage( ext3(size=10240)  )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For sample user configuration file refer to appendix A.&lt;br /&gt;
&lt;br /&gt;
== Post build binary configuration ==&lt;br /&gt;
[[File:Post_build_binary_configuration.jpg]]&lt;br /&gt;
&lt;br /&gt;
Post build binary configuration aims at configuring and generating the image from the built package binaries/repository. This process involves reading the configuration values from binary level configuration file and applying those configurations to generate rootfs. &#039;&#039;config-library&#039;&#039; which contains configuration commands is packed along with SDK and is used in applying the configuration.&lt;br /&gt;
So users now can configure the image by passing various configuration values as part of Binary level user Configuration file. Please refer to sections [[3.1]], [[3.2]], [[3.3]] for more details regarding Binary level user configuration.&lt;br /&gt;
&lt;br /&gt;
== Design details ==&lt;br /&gt;
Supporting Binary level configuration requires:&lt;br /&gt;
*Supporting a new configuration format.&lt;br /&gt;
*Parser to parse that format.&lt;br /&gt;
*Interfaces to read, modify and apply the configuration on the rootfs; such that image generation procedure can use these interfaces to generate the custom image.&lt;br /&gt;
&lt;br /&gt;
[[File:Binary_configuration_design_flow.jpg]]&lt;br /&gt;
=== Config parser ===&lt;br /&gt;
Parses the Binary level user Configuration file and generates the parsed content into a Config data tree. Also reports syntax and semantic errors if any.&lt;br /&gt;
=== Configuration Interface ===&lt;br /&gt;
==== cquery ====&lt;br /&gt;
Provides a query interface to read the Binary Configuration values given by user.&lt;br /&gt;
:Ex: to get install packages list.&lt;br /&gt;
==== cwrite ====&lt;br /&gt;
Provides a write interface to write or modify the configuration data. Provided for future use.&lt;br /&gt;
:Ex: Useful for GUI based configuration editor implementation&lt;br /&gt;
==== capply ====&lt;br /&gt;
Provides an interface to apply the Binary level user configuration values on to the rootfs to generate custom configured image. Configuration commands from config-library are called to apply the configuration.&lt;br /&gt;
&lt;br /&gt;
=== Defining a new config command ===&lt;br /&gt;
Config commands are implemented in python in &#039;&#039;&amp;lt;package_name&amp;gt;_cfg.py&#039;&#039; file which is kept under &#039;&#039;&amp;lt;package&amp;gt;/files/configlib/pkgconf&#039;&#039; folder. Adding a new config command requires&lt;br /&gt;
# Deriving new config command class from &#039;&#039;ConfigCmd&#039;&#039; class.&lt;br /&gt;
# Add &#039;&#039;__init__( )&#039;&#039; method with method parameters as per the arguments to be passed to config command, including default arguments. Any validation on command input can also be added here. Store the parameters as class members.&lt;br /&gt;
# Add/override &#039;&#039;execute()&#039;&#039; method and add logic to apply the configuration. Shell functions can also be called from here by using &#039;&#039;shellexec&#039;&#039; python library.&lt;br /&gt;
# Add  &amp;lt;code&amp;gt;inherit binary-config-package&amp;lt;/code&amp;gt; to shadow bb file&lt;br /&gt;
&lt;br /&gt;
[[File:configcmd_class_diagram.jpg]]&lt;br /&gt;
&lt;br /&gt;
Sample code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Ex: shadow/files/configlib/lib/pkgconf/shadow_cfg.py&lt;br /&gt;
&lt;br /&gt;
from configcmd import *&lt;br /&gt;
class users_adduser (ConfigCmd):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;config command to add user&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    uname=&amp;quot;&amp;quot;&lt;br /&gt;
    passwd=&amp;quot;&amp;quot;&lt;br /&gt;
    life=&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def __init__(self,uname, passwd=&amp;quot;&amp;quot;, life=99999):&lt;br /&gt;
        #any input validation can be done here&lt;br /&gt;
        self.uname = uname&lt;br /&gt;
        self.passwd = passwd&lt;br /&gt;
        self.life = life&lt;br /&gt;
&lt;br /&gt;
    def execute(self):&lt;br /&gt;
        #write logic to create user&lt;br /&gt;
        print &amp;quot;User :&amp;quot;+self.uname+&amp;quot; added&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Appendix ==&lt;br /&gt;
=== Binary configuration file format ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#   Author        : venkatarg@huawei.com&lt;br /&gt;
#   Description   : This is a sample format, only for reference however actual functions configuration funtions will differ&lt;br /&gt;
#   version       : 0.1&lt;br /&gt;
#&lt;br /&gt;
#   BNF for conf file:&lt;br /&gt;
#&lt;br /&gt;
# sectiondef	: &#039;[&#039; sectioninfo &#039;]&#039; [statements]         &lt;br /&gt;
# statements	: [ statement ]*                           &lt;br /&gt;
# statement 	: operation &#039;(&#039; [paramlist] &#039;)&#039;              &lt;br /&gt;
# operation 	: identifier&lt;br /&gt;
# paramlist 	: param [, param ]*                         &lt;br /&gt;
# param     	: directparam | fullparam | embstatement   &lt;br /&gt;
# directparam 	: nondelimiters | &#039;&amp;quot;&#039; anycharcters &#039;&amp;quot;&#039;    &lt;br /&gt;
# fullparam   	: identifier &#039;=&#039; (directparam | embstatement) &lt;br /&gt;
# embstatement 	: statement                             &lt;br /&gt;
# identifier  	: [ alphanums_-. ]&lt;br /&gt;
# nondelimiters : &amp;lt;anycharcters except [ or ( or &amp;quot; or , or ) or ] &amp;gt;&lt;br /&gt;
&lt;br /&gt;
[general]&lt;br /&gt;
version( &amp;quot;1.2&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[pkgs]&lt;br /&gt;
addlib( 32,64 )&lt;br /&gt;
&lt;br /&gt;
#minimal/mandatory pkgs are default added&lt;br /&gt;
addpkg( libacl )&lt;br /&gt;
&lt;br /&gt;
#add all kernal module except kernel-module-pchspi&lt;br /&gt;
addpkg( kernel-module*, !kernel-module-pchspi )&lt;br /&gt;
&lt;br /&gt;
addpkgs( packagegroup-core-boot,&lt;br /&gt;
	openssh,&lt;br /&gt;
	busybox,&lt;br /&gt;
	update-modules,&lt;br /&gt;
	# Additional Package Configuration&lt;br /&gt;
	binutils,&lt;br /&gt;
	coreutils,&lt;br /&gt;
	cracklib,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	e2fsprogs-e2fsck,&lt;br /&gt;
	e2fsprogs-mke2fs,&lt;br /&gt;
	e2fsprogs-ext4,&lt;br /&gt;
	elfutils,&lt;br /&gt;
	elfutils-libebl,&lt;br /&gt;
	iproute2,&lt;br /&gt;
	iputils,&lt;br /&gt;
	logrotate,&lt;br /&gt;
	nfs-utils,&lt;br /&gt;
	numactl-2.0.3-r0.x86_64,&lt;br /&gt;
	numactl-2.0.3-r0.x86,&lt;br /&gt;
	libstdcxx,&lt;br /&gt;
	libpam,&lt;br /&gt;
	pam-plugin-*,&lt;br /&gt;
	!pam-plugin-motd,&lt;br /&gt;
	!pam-plugin-permit,&lt;br /&gt;
	pciutils,&lt;br /&gt;
	portmap,&lt;br /&gt;
	procps,&lt;br /&gt;
	sed,&lt;br /&gt;
	shadow,&lt;br /&gt;
	sysconfig,&lt;br /&gt;
	syslog-ng,&lt;br /&gt;
	sysvinit,&lt;br /&gt;
	sysvinit-pidof,&lt;br /&gt;
	hw-breakpoint,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	util-linux,&lt;br /&gt;
	vlan,&lt;br /&gt;
	perf,&lt;br /&gt;
	lock-task )&lt;br /&gt;
&lt;br /&gt;
adddebugpkg( strace,&lt;br /&gt;
	     ethtool,&lt;br /&gt;
	     file,&lt;br /&gt;
	     binutils-debug,&lt;br /&gt;
	     oprofile,&lt;br /&gt;
	     iproute2-debug&lt;br /&gt;
	    )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[module-init]&lt;br /&gt;
configmod( module_squashfs_modules, package=kernel-module-sqashfs, status=e)&lt;br /&gt;
configmod( module_ramfs_modules,&lt;br /&gt;
	   package=kernel-module-ramfs,&lt;br /&gt;
	   status=e,&lt;br /&gt;
	   param=&amp;quot;rsize=100,caddress=0x444&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[users]&lt;br /&gt;
addgroup( rtos )&lt;br /&gt;
adduser( ramana, pwdhhxx, life=9999 ) &lt;br /&gt;
adduser( user1, pwdhhyy, life=9999 , shell=/usr/bin) &lt;br /&gt;
adduser( uname=user2, pwd=pwdhhyy, life=9999 ,&lt;br /&gt;
	 shell=/usr/bin,&lt;br /&gt;
	 group=&amp;quot;mail,ssh,rtos&amp;quot; ) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[kernel]&lt;br /&gt;
kernelparam( &amp;quot;nmi_watchdog=1 rdinit=/sc_init&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[network]&lt;br /&gt;
ifconfig( eth0, 10.18.89.222, 255.255.255.0) &lt;br /&gt;
ifconfig( eth1, ffe::200 , mode=6) &lt;br /&gt;
addroute( eth0, 10.18.89.*, 192.168.1.1 )&lt;br /&gt;
addroute( eth1, ffe::*, FF2::1 , mode=6 )&lt;br /&gt;
&lt;br /&gt;
[security]&lt;br /&gt;
include ( security.conf )&lt;br /&gt;
&lt;br /&gt;
[export]&lt;br /&gt;
# should be more detailed and relooked&lt;br /&gt;
diskimage( &lt;br /&gt;
	partitions (&lt;br /&gt;
		partition( hd0, /home , ext4, size=3G, flags=&amp;quot;r acp&amp;quot;, fstab=y ),&lt;br /&gt;
		partition( hd1, / , ext4, size=max, flags=&amp;quot;rw acp&amp;quot; , fstab=y )&lt;br /&gt;
		)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
diskimage(&lt;br /&gt;
	ext2(size=10240)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512 )&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512, fs=/home),&lt;br /&gt;
	cramfs( entrypoint=0x888888880000,size=10240,blocksize=512, fs=&amp;quot;/ !/home&amp;quot;)&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
archiveimage( type=cpio.tar.gz )&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
isoimage(dvd) &lt;br /&gt;
&lt;br /&gt;
[others]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Venkata Ramana Gollamudi</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10701</id>
		<title>Binary configuration support</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10701"/>
		<updated>2013-07-17T15:06:30Z</updated>

		<summary type="html">&lt;p&gt;Venkata Ramana Gollamudi: /* Config Commands: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Binary configuration? ==&lt;br /&gt;
Binary configuration allows configuration of post built binaries. It gets the following features and benefits&lt;br /&gt;
* Makes packages and linux image more configurable, gives platform for extending and managing binary configuration. &lt;br /&gt;
* Provides clean configuration interface to user.&lt;br /&gt;
* Allows post build package selection and package specific configuration.&lt;br /&gt;
* Facilitate sharing the package feed containing built packages, so that they can be used to generate a custom linux image.&lt;br /&gt;
&lt;br /&gt;
Refer bug [3252]&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
Binary configuration can be used in two ways&lt;br /&gt;
# &#039;&#039;&#039;Binary configuration integrated to current poky&#039;&#039;&#039;: Useful for current users where target image is generated from poky while building from sources.&lt;br /&gt;
# &#039;&#039;&#039;Post build binary configuration&#039;&#039;&#039;: Useful for users who want to generate custom configured images from already built package binaries.&lt;br /&gt;
&lt;br /&gt;
== Binary configuration integrated to current poky ==&lt;br /&gt;
This allows Binary configuration to work along with poky. So Binary level user configuration changes will reflect into generated image.&lt;br /&gt;
[[File:Binary_config_integrated_with_poky.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Config Commands: ===&lt;br /&gt;
These are the configuration commands which allow each package to define how it can be configured. These are stored along with each package metadata. &lt;br /&gt;
:Ex: shadow package provides &#039;&#039;adduser&#039;&#039; config command. &lt;br /&gt;
Config commands can be overridden by different packages which support the same configuration but varying/extending implementation.&lt;br /&gt;
&lt;br /&gt;
Please refer section [[#Defining a new config command]].&lt;br /&gt;
&lt;br /&gt;
=== Config-Library: ===&lt;br /&gt;
All the configuration commands are copied to a single library during build. This library is called config-library. This library contains all the configurations that are supported on a particular build.&lt;br /&gt;
=== Binary level user configuration ===&lt;br /&gt;
Binary level user configuration file contains configuration values/parameters given by user to configure the image. It calls the configuration commands and passes them with appropriate parameters to configure.&lt;br /&gt;
&lt;br /&gt;
The configurations can be broadly divided into 3 major sections&lt;br /&gt;
# Selecting/omitting required packages to be installed into target image. &lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: addpkg(shadow)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Configuring the content&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: adduser(test, test123, life=999)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Exporting the rootfs&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: diskimage( ext3(size=10240)  )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For sample user configuration file refer to appendix A.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Post build binary configuration ==&lt;br /&gt;
[[File:Post_build_binary_configuration.jpg]]&lt;br /&gt;
&lt;br /&gt;
Post build binary configuration aims at configuring and generating the image from the built package binaries/repository. This process involves reading the configuration values from binary level configuration file and applying those configurations to generate rootfs. &#039;&#039;config-library&#039;&#039; which contains configuration commands is packed along with SDK and is used in applying the configuration.&lt;br /&gt;
So users now can configure the image by passing various configuration values as part of Binary level user Configuration file. Please refer to sections [[3.1]], [[3.2]], [[3.3]] for more details regarding Binary level user configuration.&lt;br /&gt;
&lt;br /&gt;
== Design details ==&lt;br /&gt;
Supporting Binary level configuration requires:&lt;br /&gt;
*Supporting a new configuration format.&lt;br /&gt;
*Parser to parse that format.&lt;br /&gt;
*Interfaces to read, modify and apply the configuration on the rootfs; such that image generation procedure can use these interfaces to generate the custom image.&lt;br /&gt;
&lt;br /&gt;
[[File:Binary_configuration_design_flow.jpg]]&lt;br /&gt;
=== Config parser ===&lt;br /&gt;
Parses the Binary level user Configuration file and generates the parsed content into a Config data tree. Also reports syntax and semantic errors if any.&lt;br /&gt;
=== Configuration Interface ===&lt;br /&gt;
==== cquery ====&lt;br /&gt;
Provides a query interface to read the Binary Configuration values given by user.&lt;br /&gt;
:Ex: to get install packages list.&lt;br /&gt;
==== cwrite ====&lt;br /&gt;
Provides a write interface to write or modify the configuration data. Provided for future use.&lt;br /&gt;
:Ex: Useful for GUI based configuration editor implementation&lt;br /&gt;
==== capply ====&lt;br /&gt;
Provides an interface to apply the Binary level user configuration values on to the rootfs to generate custom configured image. Configuration commands from config-library are called to apply the configuration.&lt;br /&gt;
&lt;br /&gt;
=== Defining a new config command ===&lt;br /&gt;
Config commands are implemented in python in &#039;&#039;&amp;lt;package_name&amp;gt;_cfg.py&#039;&#039; file which is kept under &#039;&#039;&amp;lt;package&amp;gt;/files/configlib/pkgconf&#039;&#039; folder. Adding a new config command requires&lt;br /&gt;
# Deriving new config command class from &#039;&#039;ConfigCmd&#039;&#039; class.&lt;br /&gt;
# Add &#039;&#039;__init__( )&#039;&#039; method with method parameters as per the arguments to be passed to config command, including default arguments. Any validation on command input can also be added here. Store the parameters as class members.&lt;br /&gt;
# Add/override &#039;&#039;execute()&#039;&#039; method and add logic to apply the configuration. Shell functions can also be called from here by using &#039;&#039;shellexec&#039;&#039; python library.&lt;br /&gt;
# Add  &amp;lt;code&amp;gt;inherit binary-config-package&amp;lt;/code&amp;gt; to shadow bb file&lt;br /&gt;
&lt;br /&gt;
[[File:configcmd_class_diagram.jpg]]&lt;br /&gt;
&lt;br /&gt;
Sample code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Ex: shadow/files/configlib/lib/pkgconf/shadow_cfg.py&lt;br /&gt;
&lt;br /&gt;
from configcmd import *&lt;br /&gt;
class users_adduser (ConfigCmd):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;config command to add user&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    uname=&amp;quot;&amp;quot;&lt;br /&gt;
    passwd=&amp;quot;&amp;quot;&lt;br /&gt;
    life=&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def __init__(self,uname, passwd=&amp;quot;&amp;quot;, life=99999):&lt;br /&gt;
        #any input validation can be done here&lt;br /&gt;
        self.uname = uname&lt;br /&gt;
        self.passwd = passwd&lt;br /&gt;
        self.life = life&lt;br /&gt;
&lt;br /&gt;
    def execute(self):&lt;br /&gt;
        #write logic to create user&lt;br /&gt;
        print &amp;quot;User :&amp;quot;+self.uname+&amp;quot; added&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Appendix ==&lt;br /&gt;
=== Binary configuration file format ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#   Author        : venkatarg@huawei.com&lt;br /&gt;
#   Description   : This is a sample format, only for reference however actual functions configuration funtions will differ&lt;br /&gt;
#   version       : 0.1&lt;br /&gt;
#&lt;br /&gt;
#   BNF for conf file:&lt;br /&gt;
#&lt;br /&gt;
# sectiondef	: &#039;[&#039; sectioninfo &#039;]&#039; [statements]         &lt;br /&gt;
# statements	: [ statement ]*                           &lt;br /&gt;
# statement 	: operation &#039;(&#039; [paramlist] &#039;)&#039;              &lt;br /&gt;
# operation 	: identifier&lt;br /&gt;
# paramlist 	: param [, param ]*                         &lt;br /&gt;
# param     	: directparam | fullparam | embstatement   &lt;br /&gt;
# directparam 	: nondelimiters | &#039;&amp;quot;&#039; anycharcters &#039;&amp;quot;&#039;    &lt;br /&gt;
# fullparam   	: identifier &#039;=&#039; (directparam | embstatement) &lt;br /&gt;
# embstatement 	: statement                             &lt;br /&gt;
# identifier  	: [ alphanums_-. ]&lt;br /&gt;
# nondelimiters : &amp;lt;anycharcters except [ or ( or &amp;quot; or , or ) or ] &amp;gt;&lt;br /&gt;
&lt;br /&gt;
[general]&lt;br /&gt;
version( &amp;quot;1.2&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[pkgs]&lt;br /&gt;
addlib( 32,64 )&lt;br /&gt;
&lt;br /&gt;
#minimal/mandatory pkgs are default added&lt;br /&gt;
addpkg( libacl )&lt;br /&gt;
&lt;br /&gt;
#add all kernal module except kernel-module-pchspi&lt;br /&gt;
addpkg( kernel-module*, !kernel-module-pchspi )&lt;br /&gt;
&lt;br /&gt;
addpkgs( packagegroup-core-boot,&lt;br /&gt;
	openssh,&lt;br /&gt;
	busybox,&lt;br /&gt;
	update-modules,&lt;br /&gt;
	# Additional Package Configuration&lt;br /&gt;
	binutils,&lt;br /&gt;
	coreutils,&lt;br /&gt;
	cracklib,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	e2fsprogs-e2fsck,&lt;br /&gt;
	e2fsprogs-mke2fs,&lt;br /&gt;
	e2fsprogs-ext4,&lt;br /&gt;
	elfutils,&lt;br /&gt;
	elfutils-libebl,&lt;br /&gt;
	iproute2,&lt;br /&gt;
	iputils,&lt;br /&gt;
	logrotate,&lt;br /&gt;
	nfs-utils,&lt;br /&gt;
	numactl-2.0.3-r0.x86_64,&lt;br /&gt;
	numactl-2.0.3-r0.x86,&lt;br /&gt;
	libstdcxx,&lt;br /&gt;
	libpam,&lt;br /&gt;
	pam-plugin-*,&lt;br /&gt;
	!pam-plugin-motd,&lt;br /&gt;
	!pam-plugin-permit,&lt;br /&gt;
	pciutils,&lt;br /&gt;
	portmap,&lt;br /&gt;
	procps,&lt;br /&gt;
	sed,&lt;br /&gt;
	shadow,&lt;br /&gt;
	sysconfig,&lt;br /&gt;
	syslog-ng,&lt;br /&gt;
	sysvinit,&lt;br /&gt;
	sysvinit-pidof,&lt;br /&gt;
	hw-breakpoint,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	util-linux,&lt;br /&gt;
	vlan,&lt;br /&gt;
	perf,&lt;br /&gt;
	lock-task )&lt;br /&gt;
&lt;br /&gt;
adddebugpkg( strace,&lt;br /&gt;
	     ethtool,&lt;br /&gt;
	     file,&lt;br /&gt;
	     binutils-debug,&lt;br /&gt;
	     oprofile,&lt;br /&gt;
	     iproute2-debug&lt;br /&gt;
	    )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[module-init]&lt;br /&gt;
configmod( module_squashfs_modules, package=kernel-module-sqashfs, status=e)&lt;br /&gt;
configmod( module_ramfs_modules,&lt;br /&gt;
	   package=kernel-module-ramfs,&lt;br /&gt;
	   status=e,&lt;br /&gt;
	   param=&amp;quot;rsize=100,caddress=0x444&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[users]&lt;br /&gt;
addgroup( rtos )&lt;br /&gt;
adduser( ramana, pwdhhxx, life=9999 ) &lt;br /&gt;
adduser( user1, pwdhhyy, life=9999 , shell=/usr/bin) &lt;br /&gt;
adduser( uname=user2, pwd=pwdhhyy, life=9999 ,&lt;br /&gt;
	 shell=/usr/bin,&lt;br /&gt;
	 group=&amp;quot;mail,ssh,rtos&amp;quot; ) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[kernel]&lt;br /&gt;
kernelparam( &amp;quot;nmi_watchdog=1 rdinit=/sc_init&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[network]&lt;br /&gt;
ifconfig( eth0, 10.18.89.222, 255.255.255.0) &lt;br /&gt;
ifconfig( eth1, ffe::200 , mode=6) &lt;br /&gt;
addroute( eth0, 10.18.89.*, 192.168.1.1 )&lt;br /&gt;
addroute( eth1, ffe::*, FF2::1 , mode=6 )&lt;br /&gt;
&lt;br /&gt;
[security]&lt;br /&gt;
include ( security.conf )&lt;br /&gt;
&lt;br /&gt;
[export]&lt;br /&gt;
# should be more detailed and relooked&lt;br /&gt;
diskimage( &lt;br /&gt;
	partitions (&lt;br /&gt;
		partition( hd0, /home , ext4, size=3G, flags=&amp;quot;r acp&amp;quot;, fstab=y ),&lt;br /&gt;
		partition( hd1, / , ext4, size=max, flags=&amp;quot;rw acp&amp;quot; , fstab=y )&lt;br /&gt;
		)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
diskimage(&lt;br /&gt;
	ext2(size=10240)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512 )&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512, fs=/home),&lt;br /&gt;
	cramfs( entrypoint=0x888888880000,size=10240,blocksize=512, fs=&amp;quot;/ !/home&amp;quot;)&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
archiveimage( type=cpio.tar.gz )&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
isoimage(dvd) &lt;br /&gt;
&lt;br /&gt;
[others]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Venkata Ramana Gollamudi</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10700</id>
		<title>Binary configuration support</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10700"/>
		<updated>2013-07-17T14:59:12Z</updated>

		<summary type="html">&lt;p&gt;Venkata Ramana Gollamudi: /* Config Commands: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Binary configuration? ==&lt;br /&gt;
Binary configuration allows configuration of post built binaries. It gets the following features and benefits&lt;br /&gt;
* Makes packages and linux image more configurable, gives platform for extending and managing binary configuration. &lt;br /&gt;
* Provides clean configuration interface to user.&lt;br /&gt;
* Allows post build package selection and package specific configuration.&lt;br /&gt;
* Facilitate sharing the package feed containing built packages, so that they can be used to generate a custom linux image.&lt;br /&gt;
&lt;br /&gt;
Refer bug [3252]&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
Binary configuration can be used in two ways&lt;br /&gt;
# &#039;&#039;&#039;Binary configuration integrated to current poky&#039;&#039;&#039;: Useful for current users where target image is generated from poky while building from sources.&lt;br /&gt;
# &#039;&#039;&#039;Post build binary configuration&#039;&#039;&#039;: Useful for users who want to generate custom configured images from already built package binaries.&lt;br /&gt;
&lt;br /&gt;
== Binary configuration integrated to current poky ==&lt;br /&gt;
This allows Binary configuration to work along with poky. So Binary level user configuration changes will reflect into generated image.&lt;br /&gt;
[[File:Binary_config_integrated_with_poky.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Config Commands: ===&lt;br /&gt;
These are the configuration commands which allow each package to define how it can be configured. These are stored along with each package metadata. &lt;br /&gt;
:Ex: shadow package provides &#039;&#039;adduser&#039;&#039; config command. &lt;br /&gt;
Config commands can be overridden by different packages which support the same configuration but varying/extending implementation.&lt;br /&gt;
&lt;br /&gt;
Please refer section [[Defining a new config command]].&lt;br /&gt;
&lt;br /&gt;
=== Config-Library: ===&lt;br /&gt;
All the configuration commands are copied to a single library during build. This library is called config-library. This library contains all the configurations that are supported on a particular build.&lt;br /&gt;
=== Binary level user configuration ===&lt;br /&gt;
Binary level user configuration file contains configuration values/parameters given by user to configure the image. It calls the configuration commands and passes them with appropriate parameters to configure.&lt;br /&gt;
&lt;br /&gt;
The configurations can be broadly divided into 3 major sections&lt;br /&gt;
# Selecting/omitting required packages to be installed into target image. &lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: addpkg(shadow)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Configuring the content&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: adduser(test, test123, life=999)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Exporting the rootfs&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: diskimage( ext3(size=10240)  )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For sample user configuration file refer to appendix A.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Post build binary configuration ==&lt;br /&gt;
[[File:Post_build_binary_configuration.jpg]]&lt;br /&gt;
&lt;br /&gt;
Post build binary configuration aims at configuring and generating the image from the built package binaries/repository. This process involves reading the configuration values from binary level configuration file and applying those configurations to generate rootfs. &#039;&#039;config-library&#039;&#039; which contains configuration commands is packed along with SDK and is used in applying the configuration.&lt;br /&gt;
So users now can configure the image by passing various configuration values as part of Binary level user Configuration file. Please refer to sections [[3.1]], [[3.2]], [[3.3]] for more details regarding Binary level user configuration.&lt;br /&gt;
&lt;br /&gt;
== Design details ==&lt;br /&gt;
Supporting Binary level configuration requires:&lt;br /&gt;
*Supporting a new configuration format.&lt;br /&gt;
*Parser to parse that format.&lt;br /&gt;
*Interfaces to read, modify and apply the configuration on the rootfs; such that image generation procedure can use these interfaces to generate the custom image.&lt;br /&gt;
&lt;br /&gt;
[[File:Binary_configuration_design_flow.jpg]]&lt;br /&gt;
=== Config parser ===&lt;br /&gt;
Parses the Binary level user Configuration file and generates the parsed content into a Config data tree. Also reports syntax and semantic errors if any.&lt;br /&gt;
=== Configuration Interface ===&lt;br /&gt;
==== cquery ====&lt;br /&gt;
Provides a query interface to read the Binary Configuration values given by user.&lt;br /&gt;
:Ex: to get install packages list.&lt;br /&gt;
==== cwrite ====&lt;br /&gt;
Provides a write interface to write or modify the configuration data. Provided for future use.&lt;br /&gt;
:Ex: Useful for GUI based configuration editor implementation&lt;br /&gt;
==== capply ====&lt;br /&gt;
Provides an interface to apply the Binary level user configuration values on to the rootfs to generate custom configured image. Configuration commands from config-library are called to apply the configuration.&lt;br /&gt;
&lt;br /&gt;
=== Defining a new config command ===&lt;br /&gt;
Config commands are implemented in python in &#039;&#039;&amp;lt;package_name&amp;gt;_cfg.py&#039;&#039; file which is kept under &#039;&#039;&amp;lt;package&amp;gt;/files/configlib/pkgconf&#039;&#039; folder. Adding a new config command requires&lt;br /&gt;
# Deriving new config command class from &#039;&#039;ConfigCmd&#039;&#039; class.&lt;br /&gt;
# Add &#039;&#039;__init__( )&#039;&#039; method with method parameters as per the arguments to be passed to config command, including default arguments. Any validation on command input can also be added here. Store the parameters as class members.&lt;br /&gt;
# Add/override &#039;&#039;execute()&#039;&#039; method and add logic to apply the configuration. Shell functions can also be called from here by using &#039;&#039;shellexec&#039;&#039; python library.&lt;br /&gt;
# Add  &amp;lt;code&amp;gt;inherit binary-config-package&amp;lt;/code&amp;gt; to shadow bb file&lt;br /&gt;
&lt;br /&gt;
[[File:configcmd_class_diagram.jpg]]&lt;br /&gt;
&lt;br /&gt;
Sample code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Ex: shadow/files/configlib/lib/pkgconf/shadow_cfg.py&lt;br /&gt;
&lt;br /&gt;
from configcmd import *&lt;br /&gt;
class users_adduser (ConfigCmd):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;config command to add user&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    uname=&amp;quot;&amp;quot;&lt;br /&gt;
    passwd=&amp;quot;&amp;quot;&lt;br /&gt;
    life=&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def __init__(self,uname, passwd=&amp;quot;&amp;quot;, life=99999):&lt;br /&gt;
        #any input validation can be done here&lt;br /&gt;
        self.uname = uname&lt;br /&gt;
        self.passwd = passwd&lt;br /&gt;
        self.life = life&lt;br /&gt;
&lt;br /&gt;
    def execute(self):&lt;br /&gt;
        #write logic to create user&lt;br /&gt;
        print &amp;quot;User :&amp;quot;+self.uname+&amp;quot; added&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Appendix ==&lt;br /&gt;
=== Binary configuration file format ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#   Author        : venkatarg@huawei.com&lt;br /&gt;
#   Description   : This is a sample format, only for reference however actual functions configuration funtions will differ&lt;br /&gt;
#   version       : 0.1&lt;br /&gt;
#&lt;br /&gt;
#   BNF for conf file:&lt;br /&gt;
#&lt;br /&gt;
# sectiondef	: &#039;[&#039; sectioninfo &#039;]&#039; [statements]         &lt;br /&gt;
# statements	: [ statement ]*                           &lt;br /&gt;
# statement 	: operation &#039;(&#039; [paramlist] &#039;)&#039;              &lt;br /&gt;
# operation 	: identifier&lt;br /&gt;
# paramlist 	: param [, param ]*                         &lt;br /&gt;
# param     	: directparam | fullparam | embstatement   &lt;br /&gt;
# directparam 	: nondelimiters | &#039;&amp;quot;&#039; anycharcters &#039;&amp;quot;&#039;    &lt;br /&gt;
# fullparam   	: identifier &#039;=&#039; (directparam | embstatement) &lt;br /&gt;
# embstatement 	: statement                             &lt;br /&gt;
# identifier  	: [ alphanums_-. ]&lt;br /&gt;
# nondelimiters : &amp;lt;anycharcters except [ or ( or &amp;quot; or , or ) or ] &amp;gt;&lt;br /&gt;
&lt;br /&gt;
[general]&lt;br /&gt;
version( &amp;quot;1.2&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[pkgs]&lt;br /&gt;
addlib( 32,64 )&lt;br /&gt;
&lt;br /&gt;
#minimal/mandatory pkgs are default added&lt;br /&gt;
addpkg( libacl )&lt;br /&gt;
&lt;br /&gt;
#add all kernal module except kernel-module-pchspi&lt;br /&gt;
addpkg( kernel-module*, !kernel-module-pchspi )&lt;br /&gt;
&lt;br /&gt;
addpkgs( packagegroup-core-boot,&lt;br /&gt;
	openssh,&lt;br /&gt;
	busybox,&lt;br /&gt;
	update-modules,&lt;br /&gt;
	# Additional Package Configuration&lt;br /&gt;
	binutils,&lt;br /&gt;
	coreutils,&lt;br /&gt;
	cracklib,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	e2fsprogs-e2fsck,&lt;br /&gt;
	e2fsprogs-mke2fs,&lt;br /&gt;
	e2fsprogs-ext4,&lt;br /&gt;
	elfutils,&lt;br /&gt;
	elfutils-libebl,&lt;br /&gt;
	iproute2,&lt;br /&gt;
	iputils,&lt;br /&gt;
	logrotate,&lt;br /&gt;
	nfs-utils,&lt;br /&gt;
	numactl-2.0.3-r0.x86_64,&lt;br /&gt;
	numactl-2.0.3-r0.x86,&lt;br /&gt;
	libstdcxx,&lt;br /&gt;
	libpam,&lt;br /&gt;
	pam-plugin-*,&lt;br /&gt;
	!pam-plugin-motd,&lt;br /&gt;
	!pam-plugin-permit,&lt;br /&gt;
	pciutils,&lt;br /&gt;
	portmap,&lt;br /&gt;
	procps,&lt;br /&gt;
	sed,&lt;br /&gt;
	shadow,&lt;br /&gt;
	sysconfig,&lt;br /&gt;
	syslog-ng,&lt;br /&gt;
	sysvinit,&lt;br /&gt;
	sysvinit-pidof,&lt;br /&gt;
	hw-breakpoint,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	util-linux,&lt;br /&gt;
	vlan,&lt;br /&gt;
	perf,&lt;br /&gt;
	lock-task )&lt;br /&gt;
&lt;br /&gt;
adddebugpkg( strace,&lt;br /&gt;
	     ethtool,&lt;br /&gt;
	     file,&lt;br /&gt;
	     binutils-debug,&lt;br /&gt;
	     oprofile,&lt;br /&gt;
	     iproute2-debug&lt;br /&gt;
	    )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[module-init]&lt;br /&gt;
configmod( module_squashfs_modules, package=kernel-module-sqashfs, status=e)&lt;br /&gt;
configmod( module_ramfs_modules,&lt;br /&gt;
	   package=kernel-module-ramfs,&lt;br /&gt;
	   status=e,&lt;br /&gt;
	   param=&amp;quot;rsize=100,caddress=0x444&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[users]&lt;br /&gt;
addgroup( rtos )&lt;br /&gt;
adduser( ramana, pwdhhxx, life=9999 ) &lt;br /&gt;
adduser( user1, pwdhhyy, life=9999 , shell=/usr/bin) &lt;br /&gt;
adduser( uname=user2, pwd=pwdhhyy, life=9999 ,&lt;br /&gt;
	 shell=/usr/bin,&lt;br /&gt;
	 group=&amp;quot;mail,ssh,rtos&amp;quot; ) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[kernel]&lt;br /&gt;
kernelparam( &amp;quot;nmi_watchdog=1 rdinit=/sc_init&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[network]&lt;br /&gt;
ifconfig( eth0, 10.18.89.222, 255.255.255.0) &lt;br /&gt;
ifconfig( eth1, ffe::200 , mode=6) &lt;br /&gt;
addroute( eth0, 10.18.89.*, 192.168.1.1 )&lt;br /&gt;
addroute( eth1, ffe::*, FF2::1 , mode=6 )&lt;br /&gt;
&lt;br /&gt;
[security]&lt;br /&gt;
include ( security.conf )&lt;br /&gt;
&lt;br /&gt;
[export]&lt;br /&gt;
# should be more detailed and relooked&lt;br /&gt;
diskimage( &lt;br /&gt;
	partitions (&lt;br /&gt;
		partition( hd0, /home , ext4, size=3G, flags=&amp;quot;r acp&amp;quot;, fstab=y ),&lt;br /&gt;
		partition( hd1, / , ext4, size=max, flags=&amp;quot;rw acp&amp;quot; , fstab=y )&lt;br /&gt;
		)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
diskimage(&lt;br /&gt;
	ext2(size=10240)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512 )&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512, fs=/home),&lt;br /&gt;
	cramfs( entrypoint=0x888888880000,size=10240,blocksize=512, fs=&amp;quot;/ !/home&amp;quot;)&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
archiveimage( type=cpio.tar.gz )&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
isoimage(dvd) &lt;br /&gt;
&lt;br /&gt;
[others]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Venkata Ramana Gollamudi</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=File:Configcmd_class_diagram.jpg&amp;diff=10699</id>
		<title>File:Configcmd class diagram.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=File:Configcmd_class_diagram.jpg&amp;diff=10699"/>
		<updated>2013-07-17T14:49:53Z</updated>

		<summary type="html">&lt;p&gt;Venkata Ramana Gollamudi: Class design explaining how to add a new config command. It allows to define how each package it can be configured. These are stored along with each package metadata. 
Ex: shadow package provides “adduser” config command&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Class design explaining how to add a new config command. It allows to define how each package it can be configured. These are stored along with each package metadata. &lt;br /&gt;
Ex: shadow package provides “adduser” config command&lt;/div&gt;</summary>
		<author><name>Venkata Ramana Gollamudi</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10698</id>
		<title>Binary configuration support</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10698"/>
		<updated>2013-07-17T14:46:53Z</updated>

		<summary type="html">&lt;p&gt;Venkata Ramana Gollamudi: /* Design details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Binary configuration? ==&lt;br /&gt;
Binary configuration allows configuration of post built binaries. It gets the following features and benefits&lt;br /&gt;
* Makes packages and linux image more configurable, gives platform for extending and managing binary configuration. &lt;br /&gt;
* Provides clean configuration interface to user.&lt;br /&gt;
* Allows post build package selection and package specific configuration.&lt;br /&gt;
* Facilitate sharing the package feed containing built packages, so that they can be used to generate a custom linux image.&lt;br /&gt;
&lt;br /&gt;
Refer bug [3252]&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
Binary configuration can be used in two ways&lt;br /&gt;
# &#039;&#039;&#039;Binary configuration integrated to current poky&#039;&#039;&#039;: Useful for current users where target image is generated from poky while building from sources.&lt;br /&gt;
# &#039;&#039;&#039;Post build binary configuration&#039;&#039;&#039;: Useful for users who want to generate custom configured images from already built package binaries.&lt;br /&gt;
&lt;br /&gt;
== Binary configuration integrated to current poky ==&lt;br /&gt;
This allows Binary configuration to work along with poky. So Binary level user configuration changes will reflect into generated image.&lt;br /&gt;
[[File:Binary_config_integrated_with_poky.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Config Commands: ===&lt;br /&gt;
These are the configuration commands which allow each package define how it can be configured. These are stored along with each package metadata. &lt;br /&gt;
:Ex: shadow package provides &#039;&#039;adduser&#039;&#039; config command. &lt;br /&gt;
Config commands can be overridden by different packages which support the same configuration but varying/extending implementation.&lt;br /&gt;
=== Config-Library: ===&lt;br /&gt;
All the configuration commands are copied to a single library during build. This library is called config-library. This library contains all the configurations that are supported on a particular build.&lt;br /&gt;
=== Binary level user configuration ===&lt;br /&gt;
Binary level user configuration file contains configuration values/parameters given by user to configure the image. It calls the configuration commands and passes them with appropriate parameters to configure.&lt;br /&gt;
&lt;br /&gt;
The configurations can be broadly divided into 3 major sections&lt;br /&gt;
# Selecting/omitting required packages to be installed into target image. &lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: addpkg(shadow)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Configuring the content&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: adduser(test, test123, life=999)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Exporting the rootfs&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: diskimage( ext3(size=10240)  )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For sample user configuration file refer to appendix A.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Post build binary configuration ==&lt;br /&gt;
[[File:Post_build_binary_configuration.jpg]]&lt;br /&gt;
&lt;br /&gt;
Post build binary configuration aims at configuring and generating the image from the built package binaries/repository. This process involves reading the configuration values from binary level configuration file and applying those configurations to generate rootfs. &#039;&#039;config-library&#039;&#039; which contains configuration commands is packed along with SDK and is used in applying the configuration.&lt;br /&gt;
So users now can configure the image by passing various configuration values as part of Binary level user Configuration file. Please refer to sections [[3.1]], [[3.2]], [[3.3]] for more details regarding Binary level user configuration.&lt;br /&gt;
&lt;br /&gt;
== Design details ==&lt;br /&gt;
Supporting Binary level configuration requires:&lt;br /&gt;
*Supporting a new configuration format.&lt;br /&gt;
*Parser to parse that format.&lt;br /&gt;
*Interfaces to read, modify and apply the configuration on the rootfs; such that image generation procedure can use these interfaces to generate the custom image.&lt;br /&gt;
&lt;br /&gt;
[[File:Binary_configuration_design_flow.jpg]]&lt;br /&gt;
=== Config parser ===&lt;br /&gt;
Parses the Binary level user Configuration file and generates the parsed content into a Config data tree. Also reports syntax and semantic errors if any.&lt;br /&gt;
=== Configuration Interface ===&lt;br /&gt;
==== cquery ====&lt;br /&gt;
Provides a query interface to read the Binary Configuration values given by user.&lt;br /&gt;
:Ex: to get install packages list.&lt;br /&gt;
==== cwrite ====&lt;br /&gt;
Provides a write interface to write or modify the configuration data. Provided for future use.&lt;br /&gt;
:Ex: Useful for GUI based configuration editor implementation&lt;br /&gt;
==== capply ====&lt;br /&gt;
Provides an interface to apply the Binary level user configuration values on to the rootfs to generate custom configured image. Configuration commands from config-library are called to apply the configuration.&lt;br /&gt;
&lt;br /&gt;
=== Defining a new config command ===&lt;br /&gt;
Config commands are implemented in python in &#039;&#039;&amp;lt;package_name&amp;gt;_cfg.py&#039;&#039; file which is kept under &#039;&#039;&amp;lt;package&amp;gt;/files/configlib/pkgconf&#039;&#039; folder. Adding a new config command requires&lt;br /&gt;
# Deriving new config command class from &#039;&#039;ConfigCmd&#039;&#039; class.&lt;br /&gt;
# Add &#039;&#039;__init__( )&#039;&#039; method with method parameters as per the arguments to be passed to config command, including default arguments. Any validation on command input can also be added here. Store the parameters as class members.&lt;br /&gt;
# Add/override &#039;&#039;execute()&#039;&#039; method and add logic to apply the configuration. Shell functions can also be called from here by using &#039;&#039;shellexec&#039;&#039; python library.&lt;br /&gt;
# Add  &amp;lt;code&amp;gt;inherit binary-config-package&amp;lt;/code&amp;gt; to shadow bb file&lt;br /&gt;
&lt;br /&gt;
[[File:configcmd_class_diagram.jpg]]&lt;br /&gt;
&lt;br /&gt;
Sample code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Ex: shadow/files/configlib/lib/pkgconf/shadow_cfg.py&lt;br /&gt;
&lt;br /&gt;
from configcmd import *&lt;br /&gt;
class users_adduser (ConfigCmd):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;config command to add user&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    uname=&amp;quot;&amp;quot;&lt;br /&gt;
    passwd=&amp;quot;&amp;quot;&lt;br /&gt;
    life=&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def __init__(self,uname, passwd=&amp;quot;&amp;quot;, life=99999):&lt;br /&gt;
        #any input validation can be done here&lt;br /&gt;
        self.uname = uname&lt;br /&gt;
        self.passwd = passwd&lt;br /&gt;
        self.life = life&lt;br /&gt;
&lt;br /&gt;
    def execute(self):&lt;br /&gt;
        #write logic to create user&lt;br /&gt;
        print &amp;quot;User :&amp;quot;+self.uname+&amp;quot; added&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Appendix ==&lt;br /&gt;
=== Binary configuration file format ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#   Author        : venkatarg@huawei.com&lt;br /&gt;
#   Description   : This is a sample format, only for reference however actual functions configuration funtions will differ&lt;br /&gt;
#   version       : 0.1&lt;br /&gt;
#&lt;br /&gt;
#   BNF for conf file:&lt;br /&gt;
#&lt;br /&gt;
# sectiondef	: &#039;[&#039; sectioninfo &#039;]&#039; [statements]         &lt;br /&gt;
# statements	: [ statement ]*                           &lt;br /&gt;
# statement 	: operation &#039;(&#039; [paramlist] &#039;)&#039;              &lt;br /&gt;
# operation 	: identifier&lt;br /&gt;
# paramlist 	: param [, param ]*                         &lt;br /&gt;
# param     	: directparam | fullparam | embstatement   &lt;br /&gt;
# directparam 	: nondelimiters | &#039;&amp;quot;&#039; anycharcters &#039;&amp;quot;&#039;    &lt;br /&gt;
# fullparam   	: identifier &#039;=&#039; (directparam | embstatement) &lt;br /&gt;
# embstatement 	: statement                             &lt;br /&gt;
# identifier  	: [ alphanums_-. ]&lt;br /&gt;
# nondelimiters : &amp;lt;anycharcters except [ or ( or &amp;quot; or , or ) or ] &amp;gt;&lt;br /&gt;
&lt;br /&gt;
[general]&lt;br /&gt;
version( &amp;quot;1.2&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[pkgs]&lt;br /&gt;
addlib( 32,64 )&lt;br /&gt;
&lt;br /&gt;
#minimal/mandatory pkgs are default added&lt;br /&gt;
addpkg( libacl )&lt;br /&gt;
&lt;br /&gt;
#add all kernal module except kernel-module-pchspi&lt;br /&gt;
addpkg( kernel-module*, !kernel-module-pchspi )&lt;br /&gt;
&lt;br /&gt;
addpkgs( packagegroup-core-boot,&lt;br /&gt;
	openssh,&lt;br /&gt;
	busybox,&lt;br /&gt;
	update-modules,&lt;br /&gt;
	# Additional Package Configuration&lt;br /&gt;
	binutils,&lt;br /&gt;
	coreutils,&lt;br /&gt;
	cracklib,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	e2fsprogs-e2fsck,&lt;br /&gt;
	e2fsprogs-mke2fs,&lt;br /&gt;
	e2fsprogs-ext4,&lt;br /&gt;
	elfutils,&lt;br /&gt;
	elfutils-libebl,&lt;br /&gt;
	iproute2,&lt;br /&gt;
	iputils,&lt;br /&gt;
	logrotate,&lt;br /&gt;
	nfs-utils,&lt;br /&gt;
	numactl-2.0.3-r0.x86_64,&lt;br /&gt;
	numactl-2.0.3-r0.x86,&lt;br /&gt;
	libstdcxx,&lt;br /&gt;
	libpam,&lt;br /&gt;
	pam-plugin-*,&lt;br /&gt;
	!pam-plugin-motd,&lt;br /&gt;
	!pam-plugin-permit,&lt;br /&gt;
	pciutils,&lt;br /&gt;
	portmap,&lt;br /&gt;
	procps,&lt;br /&gt;
	sed,&lt;br /&gt;
	shadow,&lt;br /&gt;
	sysconfig,&lt;br /&gt;
	syslog-ng,&lt;br /&gt;
	sysvinit,&lt;br /&gt;
	sysvinit-pidof,&lt;br /&gt;
	hw-breakpoint,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	util-linux,&lt;br /&gt;
	vlan,&lt;br /&gt;
	perf,&lt;br /&gt;
	lock-task )&lt;br /&gt;
&lt;br /&gt;
adddebugpkg( strace,&lt;br /&gt;
	     ethtool,&lt;br /&gt;
	     file,&lt;br /&gt;
	     binutils-debug,&lt;br /&gt;
	     oprofile,&lt;br /&gt;
	     iproute2-debug&lt;br /&gt;
	    )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[module-init]&lt;br /&gt;
configmod( module_squashfs_modules, package=kernel-module-sqashfs, status=e)&lt;br /&gt;
configmod( module_ramfs_modules,&lt;br /&gt;
	   package=kernel-module-ramfs,&lt;br /&gt;
	   status=e,&lt;br /&gt;
	   param=&amp;quot;rsize=100,caddress=0x444&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[users]&lt;br /&gt;
addgroup( rtos )&lt;br /&gt;
adduser( ramana, pwdhhxx, life=9999 ) &lt;br /&gt;
adduser( user1, pwdhhyy, life=9999 , shell=/usr/bin) &lt;br /&gt;
adduser( uname=user2, pwd=pwdhhyy, life=9999 ,&lt;br /&gt;
	 shell=/usr/bin,&lt;br /&gt;
	 group=&amp;quot;mail,ssh,rtos&amp;quot; ) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[kernel]&lt;br /&gt;
kernelparam( &amp;quot;nmi_watchdog=1 rdinit=/sc_init&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[network]&lt;br /&gt;
ifconfig( eth0, 10.18.89.222, 255.255.255.0) &lt;br /&gt;
ifconfig( eth1, ffe::200 , mode=6) &lt;br /&gt;
addroute( eth0, 10.18.89.*, 192.168.1.1 )&lt;br /&gt;
addroute( eth1, ffe::*, FF2::1 , mode=6 )&lt;br /&gt;
&lt;br /&gt;
[security]&lt;br /&gt;
include ( security.conf )&lt;br /&gt;
&lt;br /&gt;
[export]&lt;br /&gt;
# should be more detailed and relooked&lt;br /&gt;
diskimage( &lt;br /&gt;
	partitions (&lt;br /&gt;
		partition( hd0, /home , ext4, size=3G, flags=&amp;quot;r acp&amp;quot;, fstab=y ),&lt;br /&gt;
		partition( hd1, / , ext4, size=max, flags=&amp;quot;rw acp&amp;quot; , fstab=y )&lt;br /&gt;
		)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
diskimage(&lt;br /&gt;
	ext2(size=10240)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512 )&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512, fs=/home),&lt;br /&gt;
	cramfs( entrypoint=0x888888880000,size=10240,blocksize=512, fs=&amp;quot;/ !/home&amp;quot;)&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
archiveimage( type=cpio.tar.gz )&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
isoimage(dvd) &lt;br /&gt;
&lt;br /&gt;
[others]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Venkata Ramana Gollamudi</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10697</id>
		<title>Binary configuration support</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10697"/>
		<updated>2013-07-16T16:48:44Z</updated>

		<summary type="html">&lt;p&gt;Venkata Ramana Gollamudi: /* Binary configuration file format */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Binary configuration? ==&lt;br /&gt;
Binary configuration allows configuration of post built binaries. It gets the following features and benefits&lt;br /&gt;
* Makes packages and linux image more configurable, gives platform for extending and managing binary configuration. &lt;br /&gt;
* Provides clean configuration interface to user.&lt;br /&gt;
* Allows post build package selection and package specific configuration.&lt;br /&gt;
* Facilitate sharing the package feed containing built packages, so that they can be used to generate a custom linux image.&lt;br /&gt;
&lt;br /&gt;
Refer bug [3252]&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
Binary configuration can be used in two ways&lt;br /&gt;
# &#039;&#039;&#039;Binary configuration integrated to current poky&#039;&#039;&#039;: Useful for current users where target image is generated from poky while building from sources.&lt;br /&gt;
# &#039;&#039;&#039;Post build binary configuration&#039;&#039;&#039;: Useful for users who want to generate custom configured images from already built package binaries.&lt;br /&gt;
&lt;br /&gt;
== Binary configuration integrated to current poky ==&lt;br /&gt;
This allows Binary configuration to work along with poky. So Binary level user configuration changes will reflect into generated image.&lt;br /&gt;
[[File:Binary_config_integrated_with_poky.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Config Commands: ===&lt;br /&gt;
These are the configuration commands which allow each package define how it can be configured. These are stored along with each package metadata. &lt;br /&gt;
:Ex: shadow package provides &#039;&#039;adduser&#039;&#039; config command. &lt;br /&gt;
Config commands can be overridden by different packages which support the same configuration but varying/extending implementation.&lt;br /&gt;
=== Config-Library: ===&lt;br /&gt;
All the configuration commands are copied to a single library during build. This library is called config-library. This library contains all the configurations that are supported on a particular build.&lt;br /&gt;
=== Binary level user configuration ===&lt;br /&gt;
Binary level user configuration file contains configuration values/parameters given by user to configure the image. It calls the configuration commands and passes them with appropriate parameters to configure.&lt;br /&gt;
&lt;br /&gt;
The configurations can be broadly divided into 3 major sections&lt;br /&gt;
# Selecting/omitting required packages to be installed into target image. &lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: addpkg(shadow)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Configuring the content&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: adduser(test, test123, life=999)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Exporting the rootfs&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: diskimage( ext3(size=10240)  )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For sample user configuration file refer to appendix A.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Post build binary configuration ==&lt;br /&gt;
[[File:Post_build_binary_configuration.jpg]]&lt;br /&gt;
&lt;br /&gt;
Post build binary configuration aims at configuring and generating the image from the built package binaries/repository. This process involves reading the configuration values from binary level configuration file and applying those configurations to generate rootfs. &#039;&#039;config-library&#039;&#039; which contains configuration commands is packed along with SDK and is used in applying the configuration.&lt;br /&gt;
So users now can configure the image by passing various configuration values as part of Binary level user Configuration file. Please refer to sections [[3.1]], [[3.2]], [[3.3]] for more details regarding Binary level user configuration.&lt;br /&gt;
&lt;br /&gt;
== Design details ==&lt;br /&gt;
Supporting Binary level configuration requires:&lt;br /&gt;
*Supporting a new configuration format.&lt;br /&gt;
*Parser to parse that format.&lt;br /&gt;
*Interfaces to read, modify and apply the configuration on the rootfs; such that image generation procedure can use these interfaces to generate the custom image.&lt;br /&gt;
&lt;br /&gt;
[[File:Binary_configuration_design_flow.jpg]]&lt;br /&gt;
=== Config parser: ===&lt;br /&gt;
Parses the Binary level user Configuration file and generates the parsed content into a Config data tree. Also reports syntax and semantic errors if any.&lt;br /&gt;
=== Configuration Interface ===&lt;br /&gt;
==== cquery ====&lt;br /&gt;
Provides a query interface to read the Binary Configuration values given by user.&lt;br /&gt;
:Ex: to get install packages list.&lt;br /&gt;
==== cwrite ====&lt;br /&gt;
Provides a write interface to write or modify the configuration data. Provided for future use.&lt;br /&gt;
:Ex: Useful for GUI based configuration editor implementation&lt;br /&gt;
==== capply ====&lt;br /&gt;
Provides an interface to apply the Binary level user configuration values on to the rootfs to generate custom configured image. Configuration commands from config-library are called to apply the configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Appendix ==&lt;br /&gt;
=== Binary configuration file format ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#   Author        : venkatarg@huawei.com&lt;br /&gt;
#   Description   : This is a sample format, only for reference however actual functions configuration funtions will differ&lt;br /&gt;
#   version       : 0.1&lt;br /&gt;
#&lt;br /&gt;
#   BNF for conf file:&lt;br /&gt;
#&lt;br /&gt;
# sectiondef	: &#039;[&#039; sectioninfo &#039;]&#039; [statements]         &lt;br /&gt;
# statements	: [ statement ]*                           &lt;br /&gt;
# statement 	: operation &#039;(&#039; [paramlist] &#039;)&#039;              &lt;br /&gt;
# operation 	: identifier&lt;br /&gt;
# paramlist 	: param [, param ]*                         &lt;br /&gt;
# param     	: directparam | fullparam | embstatement   &lt;br /&gt;
# directparam 	: nondelimiters | &#039;&amp;quot;&#039; anycharcters &#039;&amp;quot;&#039;    &lt;br /&gt;
# fullparam   	: identifier &#039;=&#039; (directparam | embstatement) &lt;br /&gt;
# embstatement 	: statement                             &lt;br /&gt;
# identifier  	: [ alphanums_-. ]&lt;br /&gt;
# nondelimiters : &amp;lt;anycharcters except [ or ( or &amp;quot; or , or ) or ] &amp;gt;&lt;br /&gt;
&lt;br /&gt;
[general]&lt;br /&gt;
version( &amp;quot;1.2&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[pkgs]&lt;br /&gt;
addlib( 32,64 )&lt;br /&gt;
&lt;br /&gt;
#minimal/mandatory pkgs are default added&lt;br /&gt;
addpkg( libacl )&lt;br /&gt;
&lt;br /&gt;
#add all kernal module except kernel-module-pchspi&lt;br /&gt;
addpkg( kernel-module*, !kernel-module-pchspi )&lt;br /&gt;
&lt;br /&gt;
addpkgs( packagegroup-core-boot,&lt;br /&gt;
	openssh,&lt;br /&gt;
	busybox,&lt;br /&gt;
	update-modules,&lt;br /&gt;
	# Additional Package Configuration&lt;br /&gt;
	binutils,&lt;br /&gt;
	coreutils,&lt;br /&gt;
	cracklib,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	e2fsprogs-e2fsck,&lt;br /&gt;
	e2fsprogs-mke2fs,&lt;br /&gt;
	e2fsprogs-ext4,&lt;br /&gt;
	elfutils,&lt;br /&gt;
	elfutils-libebl,&lt;br /&gt;
	iproute2,&lt;br /&gt;
	iputils,&lt;br /&gt;
	logrotate,&lt;br /&gt;
	nfs-utils,&lt;br /&gt;
	numactl-2.0.3-r0.x86_64,&lt;br /&gt;
	numactl-2.0.3-r0.x86,&lt;br /&gt;
	libstdcxx,&lt;br /&gt;
	libpam,&lt;br /&gt;
	pam-plugin-*,&lt;br /&gt;
	!pam-plugin-motd,&lt;br /&gt;
	!pam-plugin-permit,&lt;br /&gt;
	pciutils,&lt;br /&gt;
	portmap,&lt;br /&gt;
	procps,&lt;br /&gt;
	sed,&lt;br /&gt;
	shadow,&lt;br /&gt;
	sysconfig,&lt;br /&gt;
	syslog-ng,&lt;br /&gt;
	sysvinit,&lt;br /&gt;
	sysvinit-pidof,&lt;br /&gt;
	hw-breakpoint,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	util-linux,&lt;br /&gt;
	vlan,&lt;br /&gt;
	perf,&lt;br /&gt;
	lock-task )&lt;br /&gt;
&lt;br /&gt;
adddebugpkg( strace,&lt;br /&gt;
	     ethtool,&lt;br /&gt;
	     file,&lt;br /&gt;
	     binutils-debug,&lt;br /&gt;
	     oprofile,&lt;br /&gt;
	     iproute2-debug&lt;br /&gt;
	    )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[module-init]&lt;br /&gt;
configmod( module_squashfs_modules, package=kernel-module-sqashfs, status=e)&lt;br /&gt;
configmod( module_ramfs_modules,&lt;br /&gt;
	   package=kernel-module-ramfs,&lt;br /&gt;
	   status=e,&lt;br /&gt;
	   param=&amp;quot;rsize=100,caddress=0x444&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[users]&lt;br /&gt;
addgroup( rtos )&lt;br /&gt;
adduser( ramana, pwdhhxx, life=9999 ) &lt;br /&gt;
adduser( user1, pwdhhyy, life=9999 , shell=/usr/bin) &lt;br /&gt;
adduser( uname=user2, pwd=pwdhhyy, life=9999 ,&lt;br /&gt;
	 shell=/usr/bin,&lt;br /&gt;
	 group=&amp;quot;mail,ssh,rtos&amp;quot; ) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[kernel]&lt;br /&gt;
kernelparam( &amp;quot;nmi_watchdog=1 rdinit=/sc_init&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[network]&lt;br /&gt;
ifconfig( eth0, 10.18.89.222, 255.255.255.0) &lt;br /&gt;
ifconfig( eth1, ffe::200 , mode=6) &lt;br /&gt;
addroute( eth0, 10.18.89.*, 192.168.1.1 )&lt;br /&gt;
addroute( eth1, ffe::*, FF2::1 , mode=6 )&lt;br /&gt;
&lt;br /&gt;
[security]&lt;br /&gt;
include ( security.conf )&lt;br /&gt;
&lt;br /&gt;
[export]&lt;br /&gt;
# should be more detailed and relooked&lt;br /&gt;
diskimage( &lt;br /&gt;
	partitions (&lt;br /&gt;
		partition( hd0, /home , ext4, size=3G, flags=&amp;quot;r acp&amp;quot;, fstab=y ),&lt;br /&gt;
		partition( hd1, / , ext4, size=max, flags=&amp;quot;rw acp&amp;quot; , fstab=y )&lt;br /&gt;
		)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
diskimage(&lt;br /&gt;
	ext2(size=10240)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512 )&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512, fs=/home),&lt;br /&gt;
	cramfs( entrypoint=0x888888880000,size=10240,blocksize=512, fs=&amp;quot;/ !/home&amp;quot;)&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
archiveimage( type=cpio.tar.gz )&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
isoimage(dvd) &lt;br /&gt;
&lt;br /&gt;
[others]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Venkata Ramana Gollamudi</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=File:Binary_configuration_design_flow.jpg&amp;diff=10696</id>
		<title>File:Binary configuration design flow.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=File:Binary_configuration_design_flow.jpg&amp;diff=10696"/>
		<updated>2013-07-16T16:45:55Z</updated>

		<summary type="html">&lt;p&gt;Venkata Ramana Gollamudi: Binary configuration design flow and interfaces to image generation.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Binary configuration design flow and interfaces to image generation.&lt;/div&gt;</summary>
		<author><name>Venkata Ramana Gollamudi</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=File:Post_build_binary_configuration.jpg&amp;diff=10695</id>
		<title>File:Post build binary configuration.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=File:Post_build_binary_configuration.jpg&amp;diff=10695"/>
		<updated>2013-07-16T16:43:43Z</updated>

		<summary type="html">&lt;p&gt;Venkata Ramana Gollamudi: Post build binary configuration aims at configuring and generating the image from the built package binaries/repository. This process involves reading the configuration values from binary level configuration file and applying those configurations to gener&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Post build binary configuration aims at configuring and generating the image from the built package binaries/repository. This process involves reading the configuration values from binary level configuration file and applying those configurations to generate rootfs.&lt;/div&gt;</summary>
		<author><name>Venkata Ramana Gollamudi</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=File:Binary_config_integrated_with_poky.jpg&amp;diff=10694</id>
		<title>File:Binary config integrated with poky.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=File:Binary_config_integrated_with_poky.jpg&amp;diff=10694"/>
		<updated>2013-07-16T16:41:29Z</updated>

		<summary type="html">&lt;p&gt;Venkata Ramana Gollamudi: This allows Binary configuration to work along with poky. So Binary level user configuration changes will reflect into generated image.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This allows Binary configuration to work along with poky. So Binary level user configuration changes will reflect into generated image.&lt;/div&gt;</summary>
		<author><name>Venkata Ramana Gollamudi</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10693</id>
		<title>Binary configuration support</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Binary_configuration_support&amp;diff=10693"/>
		<updated>2013-07-16T16:36:24Z</updated>

		<summary type="html">&lt;p&gt;Venkata Ramana Gollamudi: This page explains about binary configuration feature , how it works and design.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Binary configuration? ==&lt;br /&gt;
Binary configuration allows configuration of post built binaries. It gets the following features and benefits&lt;br /&gt;
* Makes packages and linux image more configurable, gives platform for extending and managing binary configuration. &lt;br /&gt;
* Provides clean configuration interface to user.&lt;br /&gt;
* Allows post build package selection and package specific configuration.&lt;br /&gt;
* Facilitate sharing the package feed containing built packages, so that they can be used to generate a custom linux image.&lt;br /&gt;
&lt;br /&gt;
Refer bug [3252]&lt;br /&gt;
&lt;br /&gt;
== How it works? ==&lt;br /&gt;
Binary configuration can be used in two ways&lt;br /&gt;
# &#039;&#039;&#039;Binary configuration integrated to current poky&#039;&#039;&#039;: Useful for current users where target image is generated from poky while building from sources.&lt;br /&gt;
# &#039;&#039;&#039;Post build binary configuration&#039;&#039;&#039;: Useful for users who want to generate custom configured images from already built package binaries.&lt;br /&gt;
&lt;br /&gt;
== Binary configuration integrated to current poky ==&lt;br /&gt;
This allows Binary configuration to work along with poky. So Binary level user configuration changes will reflect into generated image.&lt;br /&gt;
[[File:Binary_config_integrated_with_poky.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Config Commands: ===&lt;br /&gt;
These are the configuration commands which allow each package define how it can be configured. These are stored along with each package metadata. &lt;br /&gt;
:Ex: shadow package provides &#039;&#039;adduser&#039;&#039; config command. &lt;br /&gt;
Config commands can be overridden by different packages which support the same configuration but varying/extending implementation.&lt;br /&gt;
=== Config-Library: ===&lt;br /&gt;
All the configuration commands are copied to a single library during build. This library is called config-library. This library contains all the configurations that are supported on a particular build.&lt;br /&gt;
=== Binary level user configuration ===&lt;br /&gt;
Binary level user configuration file contains configuration values/parameters given by user to configure the image. It calls the configuration commands and passes them with appropriate parameters to configure.&lt;br /&gt;
&lt;br /&gt;
The configurations can be broadly divided into 3 major sections&lt;br /&gt;
# Selecting/omitting required packages to be installed into target image. &lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: addpkg(shadow)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Configuring the content&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: adduser(test, test123, life=999)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Exporting the rootfs&lt;br /&gt;
#:&amp;lt;code&amp;gt;Ex: diskimage( ext3(size=10240)  )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For sample user configuration file refer to appendix A.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Post build binary configuration ==&lt;br /&gt;
[[File:Post_build_binary_configuration.jpg]]&lt;br /&gt;
&lt;br /&gt;
Post build binary configuration aims at configuring and generating the image from the built package binaries/repository. This process involves reading the configuration values from binary level configuration file and applying those configurations to generate rootfs. &#039;&#039;config-library&#039;&#039; which contains configuration commands is packed along with SDK and is used in applying the configuration.&lt;br /&gt;
So users now can configure the image by passing various configuration values as part of Binary level user Configuration file. Please refer to sections [[3.1]], [[3.2]], [[3.3]] for more details regarding Binary level user configuration.&lt;br /&gt;
&lt;br /&gt;
== Design details ==&lt;br /&gt;
Supporting Binary level configuration requires:&lt;br /&gt;
*Supporting a new configuration format.&lt;br /&gt;
*Parser to parse that format.&lt;br /&gt;
*Interfaces to read, modify and apply the configuration on the rootfs; such that image generation procedure can use these interfaces to generate the custom image.&lt;br /&gt;
&lt;br /&gt;
[[File:Binary_configuration_design_flow.jpg]]&lt;br /&gt;
=== Config parser: ===&lt;br /&gt;
Parses the Binary level user Configuration file and generates the parsed content into a Config data tree. Also reports syntax and semantic errors if any.&lt;br /&gt;
=== Configuration Interface ===&lt;br /&gt;
==== cquery ====&lt;br /&gt;
Provides a query interface to read the Binary Configuration values given by user.&lt;br /&gt;
:Ex: to get install packages list.&lt;br /&gt;
==== cwrite ====&lt;br /&gt;
Provides a write interface to write or modify the configuration data. Provided for future use.&lt;br /&gt;
:Ex: Useful for GUI based configuration editor implementation&lt;br /&gt;
==== capply ====&lt;br /&gt;
Provides an interface to apply the Binary level user configuration values on to the rootfs to generate custom configured image. Configuration commands from config-library are called to apply the configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Appendix ==&lt;br /&gt;
=== Binary configuration file format ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#   Author        : venkatarg@huawei.com&lt;br /&gt;
#   Description   : This is a sample format, only for reference however actual functions configuration funtions will differ&lt;br /&gt;
#   version       : 0.1&lt;br /&gt;
#&lt;br /&gt;
#   BNF for conf file:&lt;br /&gt;
#&lt;br /&gt;
# sectiondef	: &#039;[&#039; sectioninfo &#039;]&#039; [statements]         &lt;br /&gt;
# statements	: [ statement ]*                           &lt;br /&gt;
# statement 	: operation &#039;(&#039; [paramlist] &#039;)&#039;              &lt;br /&gt;
# operation 	: identifier&lt;br /&gt;
# paramlist 	: param [, param ]*                         &lt;br /&gt;
# param     	: directparam | fullparam | embstatement   &lt;br /&gt;
# directparam 	: nondelimiters | &#039;&amp;quot;&#039; anycharcters &#039;&amp;quot;&#039;    &lt;br /&gt;
# fullparam   	: identifier &#039;=&#039; (directparam | embstatement) &lt;br /&gt;
# embstatement 	: statement                             &lt;br /&gt;
# identifier  	: [ alphanums_-. ]&lt;br /&gt;
# nondelimiters : &amp;lt;anycharcters except [ or ( or &amp;quot; or , or ) or ] &amp;gt;&lt;br /&gt;
&lt;br /&gt;
[general]&lt;br /&gt;
version( &amp;quot;1.2&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[pkgs]&lt;br /&gt;
addlib( 32,64 )&lt;br /&gt;
&lt;br /&gt;
#minimal/mandatory pkgs are default added&lt;br /&gt;
addpkg( libacl )&lt;br /&gt;
&lt;br /&gt;
#add all kernal module except kernel-module-pchspi&lt;br /&gt;
addpkg( kernel-module*, !kernel-module-pchspi )&lt;br /&gt;
&lt;br /&gt;
addpkgs( packagegroup-core-boot,&lt;br /&gt;
	openssh,&lt;br /&gt;
	busybox,&lt;br /&gt;
	update-modules,&lt;br /&gt;
	# Additional Package Configuration&lt;br /&gt;
	binutils,&lt;br /&gt;
	coreutils,&lt;br /&gt;
	cracklib,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	e2fsprogs-e2fsck,&lt;br /&gt;
	e2fsprogs-mke2fs,&lt;br /&gt;
	e2fsprogs-ext4,&lt;br /&gt;
	elfutils,&lt;br /&gt;
	elfutils-libebl,&lt;br /&gt;
	iproute2,&lt;br /&gt;
	iputils,&lt;br /&gt;
	logrotate,&lt;br /&gt;
	nfs-utils,&lt;br /&gt;
	numactl-2.0.3-r0.x86_64,&lt;br /&gt;
	numactl-2.0.3-r0.x86,&lt;br /&gt;
	libstdcxx,&lt;br /&gt;
	libpam,&lt;br /&gt;
	pam-plugin-*,&lt;br /&gt;
	!pam-plugin-motd,&lt;br /&gt;
	!pam-plugin-permit,&lt;br /&gt;
	pciutils,&lt;br /&gt;
	portmap,&lt;br /&gt;
	procps,&lt;br /&gt;
	sed,&lt;br /&gt;
	shadow,&lt;br /&gt;
	sysconfig,&lt;br /&gt;
	syslog-ng,&lt;br /&gt;
	sysvinit,&lt;br /&gt;
	sysvinit-pidof,&lt;br /&gt;
	hw-breakpoint,&lt;br /&gt;
	#Added for disk Management&lt;br /&gt;
	util-linux,&lt;br /&gt;
	vlan,&lt;br /&gt;
	perf,&lt;br /&gt;
	lock-task )&lt;br /&gt;
&lt;br /&gt;
adddebugpkg( strace,&lt;br /&gt;
	     ethtool,&lt;br /&gt;
	     file,&lt;br /&gt;
	     binutils-debug,&lt;br /&gt;
	     oprofile,&lt;br /&gt;
	     iproute2-debug&lt;br /&gt;
	    )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[module-init]&lt;br /&gt;
configmod( module_squashfs_modules, package=kernel-module-sqashfs, status=e)&lt;br /&gt;
configmod( module_ramfs_modules,&lt;br /&gt;
	   package=kernel-module-ramfs,&lt;br /&gt;
	   status=e,&lt;br /&gt;
	   param=&amp;quot;rsize=100,caddress=0x444&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[users]&lt;br /&gt;
addgroup( rtos )&lt;br /&gt;
adduser( ramana, pwdhhxx, life=9999 ) &lt;br /&gt;
adduser( user1, pwdhhyy, life=9999 , shell=/usr/bin) &lt;br /&gt;
adduser( uname=user2, pwd=pwdhhyy, life=9999 ,&lt;br /&gt;
	 shell=/usr/bin,&lt;br /&gt;
	 group=&amp;quot;mail,ssh,rtos&amp;quot; ) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[kernel]&lt;br /&gt;
kernelparam( &amp;quot;nmi_watchdog=1 rdinit=/sc_init&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
[network]&lt;br /&gt;
ifconfig( eth0, 10.18.89.222, 255.255.255.0) &lt;br /&gt;
ifconfig( eth1, ffe::200 , mode=6) &lt;br /&gt;
addroute( eth0, 10.18.89.*, 192.168.1.1 )&lt;br /&gt;
addroute( eth1, ffe::*, FF2::1 , mode=6 )&lt;br /&gt;
&lt;br /&gt;
[security]&lt;br /&gt;
include ( security.conf )&lt;br /&gt;
&lt;br /&gt;
[fs]&lt;br /&gt;
# should be more detailed and relooked&lt;br /&gt;
diskimage( &lt;br /&gt;
	partitions (&lt;br /&gt;
		partition( hd0, /home , ext4, size=3G, flags=&amp;quot;r acp&amp;quot;, fstab=y ),&lt;br /&gt;
		partition( hd1, / , ext4, size=max, flags=&amp;quot;rw acp&amp;quot; , fstab=y )&lt;br /&gt;
		)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
diskimage(&lt;br /&gt;
	ext2(size=10240)&lt;br /&gt;
	)&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512 )&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
flashimage(&lt;br /&gt;
	jffs2( entrypoint=0x80000,size=10240,blocksize=512, fs=/home),&lt;br /&gt;
	cramfs( entrypoint=0x888888880000,size=10240,blocksize=512, fs=&amp;quot;/ !/home&amp;quot;)&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
archiveimage( type=cpio.tar.gz )&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
isoimage(dvd) &lt;br /&gt;
&lt;br /&gt;
[others]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Venkata Ramana Gollamudi</name></author>
	</entry>
</feed>