[Openembedded-users] Allowing recipe to overwrite /etc config files

Nichol Draper ndraper at litetouch.com
Tue Feb 15 14:38:10 UTC 2011


Rob,

I did this same type of thing, but instead of a separate recipe I patched the Linux recipe.  I based it on the overlay idea that Atmel uses to patch the files for their processors.  They have a good example here: http://www.at91.com/linux4sam/bin/view/Linux4SAM/OpenEmbeddedAngstromBuild#How_to_build_Angstrom_for_AT91

I then added my own overlay on top of theirs, so in the linux_2.6.33.bb file my first three lines are:
require linux.inc
require linux-at91.inc
require linux-lt.inc

Where linux-li.inc includes my files.  I took it one step further and created my own step after the patch step to copy my files prior to the compile step.  Here is my linux-lt.inc file.


===============
# machine boots with it, works but was not tested too much

ltat91sam_patch = " \
	file://${HOME}/oe/ltoe/kernel/driver/serial/atmel_serial.c \
#	file://${HOME}/oe/ltoe/kernel/patches/atmel_serial_rs485_17.patch \
	"

#do_ltunpack() {
#	cp -f ${HOME}/oe/ltoe/kernel/patches/atmel_serial_rs485_17.patch ${WORKDIR}/2.6.30-at91-exp.3/atmel_serial_rs485_17.patch
#}


do_copyltcode() {
# arch/arm/include/asm/ioctls.h
	cp -f ${HOME}/oe/ltoe/kernel/arch/arm/include/asm/ioctls.h ${S}/arch/arm/include/asm/ioctls.h
# arch/arm/mach-at91/include/mach/board.h	
	cp -f ${HOME}/oe/ltoe/kernel/arch/arm/mach-at91/include/mach/board.h ${S}/arch/arm/mach-at91/include/mach/board.h
	cp -f ${HOME}/oe/ltoe/kernel/drivers/serial/atmel_serial.c ${S}/drivers/serial/atmel_serial.c
	cp -f ${HOME}/oe/ltoe/kernel/arch/arm/mach-at91/rb_at91sam9263_devices.c ${S}/arch/arm/mach-at91/at91sam9263_devices.c
	cp -f ${HOME}/oe/ltoe/kernel/arch/arm/mach-at91/rb_board-sam9263ek.c ${S}/arch/arm/mach-at91/board-sam9263ek.c
	cp -f ${HOME}/oe/ltoe/kernel/arch/arm/boot/compressed/misc.c ${S}/arch/arm/boot/compressed/misc.c

	cp -f ${HOME}/oe/ltoe/kernel/drivers/char/Makefile ${S}/drivers/char/Makefile
	cp -f ${HOME}/oe/ltoe/kernel/drivers/char/ltstationbus.c ${S}/drivers/char/ltstationbus.c
}

addtask ltunpack after do_unpack before do_patch
addtask copyltcode after do_patch before do_configure

===============

Notice the extra tasks.

I'm sure there are other ways to do this, but this is working for me.  Also, since I have the entire Linux tree, I can patch any file from drivers to configuration files.  

Nichol


-----Original Message-----
From: openembedded-users-bounces at linuxtogo.org [mailto:openembedded-users-bounces at linuxtogo.org] On Behalf Of Rob Smith
Sent: Tuesday, February 15, 2011 7:03 AM
To: openembedded-users at linuxtogo.org
Subject: [Openembedded-users] Allowing recipe to overwrite /etc config files

Hello,

We are putting together an OpenEmbedded based system that requires
changes to many of the standard /etc config files. Some are the standard
files like /etc/network/interfaces, others of installed packages
like /etc/lighttpd.conf. Therefore, changing these config files in each
recipe for each package would take some work. 

What I've done instead, is write a recipe that is included as the very
last package in my image recipe, that just installs all the modified
files to the /etc directory. That way, all the modified files for all
the packages are held in one place for easy maintenance.

However, opkg complains about two packages wanting to write the same
file. 

Can anyone tell me the solution to this? Is there a bitbake parameter to
include in my recipe that will allow overwriting of files already
installed by other packages? Or is there another standard method that
will achieve the same thing?

Thanks very much for any help,
Regards
Rob Smith


_______________________________________________
Openembedded-users mailing list
Openembedded-users at linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-users




More information about the Openembedded-users mailing list