Adding lines to inittab

Home Forums MultiConnect OCG Adding lines to inittab

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2610
    Neil McGuire
    Participant

    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?

    #3309
    Neil McGuire
    Participant

    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 />
    }

    #3310
    Neil McGuire
    Participant

    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.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.