[Openembedded-users] Modifying preinstalled files in /etc

Nichol Draper ndraper at litetouch.com
Wed Dec 1 16:26:22 UTC 2010


Pete,

I had a difficult time figuring out how to work with these as well.  I'm using the Atmel AT91SAM9263EK.  Fortunately, Atmel has created some overlays that I looked at very closely to figure out how to do this.  My setup uses the openembedded project files with the Atmel overlay followed by my overlay.  I also wanted to be  able to patch individual files for a specific project.  My Linux Bitbake file looks like the following:

Linux_2.6.30.bb
-----------------------
require linux.inc
require linux-at91.inc
require linux-lt.inc


PR = "r1"

S = "${WORKDIR}/linux-${PV}"

SRC_URI = " \
                ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2 \
                http://maxim.org.za/AT91RM9200/2.6/2.6.30-at91.patch.gz;patch=1 \
                file://defconfig \
                "
-------------------

You can download the atmel overlay here http://www.at91.com/linux4sam/bin/view/Linux4SAM/OpenEmbeddedAngstromBuild#How_to_build_Angstrom_for_AT91


I then created my own include with new tasks which I add after the do_patch task to replace files I want replaced:
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

-------------------

I retrieve the normal files from openembedded using git.  I then have the Atmel overlay which I retrieved with wget.  Lastly my own overlay is committed into my corporate svn repository.

My structure looks like this:
oe/openembedded - came from git
oe/oe_at91sam - came from Atmel
oe/ltoe - my overlay

in my ltoe directory I have a file called lt-env.source that I source when I start a terminal window to setup my environment:

--------------------
export OE_DIR=${HOME}/oe
export PATH=${OE_DIR}/bitbake/bin:$PATH
export BBPATH=${OE_DIR}/ltoe:${OE_DIR}/oe_at91sam:${OE_DIR}/openembedded

if [ -z ${ORG_PATH} ] ; then
                ORG_PATH=${PATH}
                export ORG_PATH
fi

if [ -z ${ORG_LD_LIBRARY_PATH} ] ; then
                ORG_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
                export ORG_LD_LIBRARY_PATH
fi

LD_LIBRARY_PATH=
export PATH LD_LIBRARY_PATH BBPATH
export LANG=C
export BB_ENV_EXTRAWHITE="MACHINE DISTRO ANGSTROM_MODE"

--------------------

The Atmel site has a good explanation on how to setup everything except for your own overlay on top of everything.

I hope this helps.  I've seen some other approaches, but this works for me.

Nichol



From: openembedded-users-bounces at linuxtogo.org [mailto:openembedded-users-bounces at linuxtogo.org] On Behalf Of Peter Buelow
Sent: Wednesday, December 01, 2010 8:30 AM
To: openembedded-users at lists.openembedded.org
Subject: [Openembedded-users] Modifying preinstalled files in /etc

I want to update the /etc/environment and /etc/init.d/dbus-1 files with some changes specific to my gumstix overo build. I would do this in a recipe, because I also want to generate a package with these files. However, this doesn't work. as OE complains that I'm trying to overwrite an existing file with mine. How can I use a recipe to edit existing files in /etc to include information in my build?

--
Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-users/attachments/20101201/ccb29b46/attachment-0002.html>


More information about the Openembedded-users mailing list