[yocto] Adding to inittab based on image content
colin.helliwell at ln-systems.com
colin.helliwell at ln-systems.com
Wed Jan 11 01:16:12 PST 2017
Thanks Rudi, that's got it.
-----Original Message-----
From: Rudolf J Streif [mailto:rudolf.streif at gmail.com]
Sent: 06 January 2017 17:18
To: yocto at yoctoproject.org; colin.helliwell at ln-systems.com
Subject: Re: [yocto] Adding to inittab based on image content
Hi Colin,
The correct way of doing this is a package postinstallation script that is
run by the package manager after the package containing your application is
installed on the target system.
You add to your recipe:
pkg_postinst_${PN}() {
#!/bin/sh
echo "whateveryouneed" >> ${D}/etc/inittab }
The build system will include this as the post install script into the
package in the correct form for the package manager you are using e.g. RPM,
DEB, IPK.
This will work when the build system installs your package into the system
root or when executed on the target.
You can also distinguish the two cases:
pkg_postinst_${PN}() {
#!/bin/sh
if [ x"$D" = "x" ] ; then
# shell commands for target execution else
# shell commands for build system execution fi }
In the case of target execution $D is not set.
More information about the yocto
mailing list