Thanks, but this isn't exactly what I want to do. The problem isn't with the install step, but when the image is created. My /etc/environment file conflicts with the existing one from libpam. So, either I need a way to override the libpam version, or I need to be able to edit the libpam version after it's done but before the image is created. In my recipe, I have a hand edited copy with some substitution strings in there for sed to work on. Then, when I'm done editing my file, I move it to /etc, and that's where things break down.

|  * check_data_file_clashes: Package environment wants to install file /home/pete/Projects/overo/build/target/rootfs/csp-console-image/etc/environment
|       But that file is already provided by package  * libpam
|  * opkg_install_cmd: Cannot install package environment.

Sorry, should have been more clear in my original post.

On Tue, Nov 30, 2010 at 3:21 PM, Markus Svilans <msvilans@aeonyx.ca> wrote:
Hi Peter,

Here is how I have been doing it.

Just add a task in your .bb file, as follows:


pkg_postinst_${PN} () {

# add commands to run on target machine, after package has been installed

sed -i 's#@@CONSOLE_PORT@@#ttymxc0#' etc/environment
sed -i 's#@@KERNEL_VERSION@@#2.6.34#' etc/environment
sed -i 's#@@NVM_DIR@@#/tmp#' etc/environment
sed -i 's#@@NVM_PRI_DIR@@#/tmp#' etc/environment

# and so on...
}


I successfully use this to create some small config files, make .tar.gz backups of previous settings, and start daemons after the ipk installation is completed.

Regards,
Markus.





On 2010.11.30 15:57, Peter Buelow wrote:
I have an overo build, and now I want to tweak /etc/environment, and the /etc/init.d/dbus-1 startup script. I've been googling all over, but haven't found anything that actually tells me how to do it (it's a TODO in the OE documentation). I've got complicated version, where I create my own new recipe file in user.local, and then create a version of the file, build the .ipk, and install it manually with a --force option, but this isn't going to work very well long term. Next step is to just hardcode the path to the files in rootfs/sysroot and sed edit them there so they get bundled up as I want them. This is highly not portable.

BTW, trying to just overwrite the existing versions doesn't seem to work, although my recipe might be broken. It's included below.

What have other people done? Thanks for any help.


DESCRIPTION = "Modify /etc/environment with some project specific details"
DEPENDS = "libpam"
PR = "1"

S = "${WORKDIR}"

SRC_URI = " \
"

# Don't do anything for the next two functions. We don't need to
do_configure() {
:
}

do_compile() {
:
}

do_install() {
sed -i 's#@@CONSOLE_PORT@@#ttymxc0#' etc/environment
sed -i 's#@@KERNEL_VERSION@@#2.6.34#' etc/environment
sed -i 's#@@NVM_DIR@@#/tmp#' etc/environment
sed -i 's#@@NVM_PRI_DIR@@#/tmp#' etc/environment
install -d ${sysconfdir}
install -m 0644 etc/environment ${sysconfdir}
install -d ${S}/image/etc
install -m 0644 etc/environment ${S}/image/etc

}

FILES_${PN} = " \
/etc/environment \
"

--
Pete
------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________ gumstix-users mailing list gumstix-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gumstix-users

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
gumstix-users mailing list
gumstix-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gumstix-users




--
Pete