Adding lines to inittab
- This topic has 2 replies, 1 voice, and was last updated 13 years, 3 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Home › Forums › MultiConnect OCG › Adding lines to inittab
Tagged: bitbake, inittab, modify etc
Perhaps this question is better suited to OpenEmbedded than here, but I’m trying to make it so my rootfs has the following line in /etc/inittab, but can’t figure out how to do it short of manually editing the file before packaging it into a .jffs2 file.
S1:2345:respawn:/usr/sbin/pppd call gsm
Any suggestions?
Here’s what I ended up doing inside the .bb file:
pkg_postinst_${PN}() {<br />
#!/bin/sh -e<br />
# Make it run on the machine once installed, not on image packaging<br />
if [ x"$D" = "x" ]<br />
then<br />
# Check to see if pppd is already registered in /etc/inittab<br />
if ! grep /usr/sbin/pppd /etc/inittab<br />
then<br />
echo "Registering pppd for startup."<br />
# operator '>>' appends to an existing file<br />
echo "S1:2345:respawn:/usr/sbin/pppd call gsm" >> /etc/inittab<br />
else<br />
echo "pppd already registered.<br />
fi<br />
else<br />
exit 1<br />
fi<br />
}
Granted, that doesn’t get it into the image, and also didn’t run on its own, but opkg update && opkg upgrade
causes it to fire on the next upgrade.