mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: "Schenk, Gavin" <G.Schenk@eckelmann.de>
To: "ptxdist@pengutronix.de" <ptxdist@pengutronix.de>
Subject: Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
Date: Wed, 11 Sep 2013 10:34:23 +0000	[thread overview]
Message-ID: <D415CD2EC4182C4EAB90A76B7D9F16DCCF69949B@EX-DAG01.eckelmann.group> (raw)
In-Reply-To: <trinity-05aa3a84-8cf5-4971-b070-45d701b1fa41-1378890962470@3capp-gmx-bs31>


[-- Attachment #1.1: Type: text/plain, Size: 2889 bytes --]

Hi Markus,

I´m not sure about your requirement, maybe you are looking for the rc.once mechanism, too. rc.once is running once per target on the very first run.

The package mechanism works every time you upgrade/install a package with opkg/ipkg to the already running target. Let´s say you have a package called mypackage. This package is represented by two files in the rules directory of your project $PTXDIST_WORKSPACE/rules/mypackage.in and $PTXDIST_WORKSPACE/rulse/mypackage.make. You can create a postinst script by creating a "executable" file named $PTXDIST_WORKSPACE/rules/mypackage.postinst.

A short example content of this file could be:

#!/bin/sh
echo "running postinst script of mypackage"
/sbin/create_a_cool_user.sh
/sbin/call_some_fancy_binaries.sh
exit 0

It is important, that your script always succeed (return 0). As Michael mentioned this script is called when your rootfs is assembled. This script is called by opkg when upgrading or installing this package via opkg/ipkg to your already running target, too.

Hope this helps.

Regards
Gavin


From: ptxdist-bounces@pengutronix.de [mailto:ptxdist-bounces@pengutronix.de] On Behalf Of Markus Wolters
Sent: Wednesday, September 11, 2013 11:16 AM
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] How to add opkg/ipkg post install scripts to package?

Hello Michael,

I'm not quite sure if I got it right. I need to create an user and start some executables on the already running target for example. Is that possible with your solution?

Markus

Gesendet: Mittwoch, 11. September 2013 um 10:33 Uhr
Von: "Michael Olbrich" <m.olbrich@pengutronix.de<mailto:m.olbrich@pengutronix.de>>
An: ptxdist@pengutronix.de<mailto:ptxdist@pengutronix.de>
Betreff: Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
Hi,

On Wed, Sep 11, 2013 at 08:55:26AM +0200, Markus Wolters wrote:
> is it possible to add an opkg/ipkg postinstall script to a newly created
> ptxdist package? It should be run once when packages is installed on target.

Just create "rules/<package>.postinst". There are some examples in PTXdist.
Note: PTXdist will call the script when creating a rootfs. In this case
$DESTDIR is set to the path where the rootfs is assembled.

Michael

--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |

--
ptxdist mailing list
ptxdist@pengutronix.de<mailto:ptxdist@pengutronix.de>
Eckelmann Aktiengesellschaft
Vorstand: Dr.-Ing. Gerd Eckelmann (Vorsitzender)
Dr.-Ing. Peter Cordes, Dr.-Ing. Frank-Thomas Mellert
Vorsitzender des Aufsichtsrats: Hubertus G. Krossa
Sitz der Gesellschaft: Berliner Str. 161, 65205 Wiesbaden, Amtsgericht Wiesbaden HRB 12636
http://www.eckelmann.de

[-- Attachment #1.2: Type: text/html, Size: 9274 bytes --]

[-- Attachment #2: Type: text/plain, Size: 48 bytes --]

-- 
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2013-09-11 10:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-11  6:55 Markus Wolters
2013-09-11  8:33 ` Michael Olbrich
2013-09-11  9:16   ` Markus Wolters
2013-09-11 10:34     ` Schenk, Gavin [this message]
2013-09-16  6:57       ` Markus Wolters
2013-09-16  8:23         ` Michael Olbrich
2013-09-16  8:36           ` Markus Wolters
2013-09-16  8:48             ` Jürgen Beisert
2013-09-16 12:03             ` Markus Wolters
2013-09-24  8:01               ` Markus Wolters
2013-09-24  8:08                 ` Jürgen Beisert
2013-09-25  6:09                   ` Prajwal Chandrappa
2013-09-24  8:16                 ` Markus Wolters
2013-09-24  8:28                   ` Thomas Heller
2013-09-20  8:54           ` Markus Wolters
2013-09-11 13:11     ` Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D415CD2EC4182C4EAB90A76B7D9F16DCCF69949B@EX-DAG01.eckelmann.group \
    --to=g.schenk@eckelmann.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox