mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] How to add opkg/ipkg post install scripts to package?
@ 2013-09-11  6:55 Markus Wolters
  2013-09-11  8:33 ` Michael Olbrich
  0 siblings, 1 reply; 16+ messages in thread
From: Markus Wolters @ 2013-09-11  6:55 UTC (permalink / raw)
  To: ptxdist

[-- Attachment #1: Type: text/html, Size: 363 bytes --]

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

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
  2013-09-11  6:55 [ptxdist] How to add opkg/ipkg post install scripts to package? Markus Wolters
@ 2013-09-11  8:33 ` Michael Olbrich
  2013-09-11  9:16   ` Markus Wolters
  0 siblings, 1 reply; 16+ messages in thread
From: Michael Olbrich @ 2013-09-11  8:33 UTC (permalink / raw)
  To: ptxdist

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
  2013-09-11  8:33 ` Michael Olbrich
@ 2013-09-11  9:16   ` Markus Wolters
  2013-09-11 10:34     ` Schenk, Gavin
  2013-09-11 13:11     ` Marc Kleine-Budde
  0 siblings, 2 replies; 16+ messages in thread
From: Markus Wolters @ 2013-09-11  9:16 UTC (permalink / raw)
  To: ptxdist

[-- Attachment #1: Type: text/html, Size: 1906 bytes --]

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

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
  2013-09-11  9:16   ` Markus Wolters
@ 2013-09-11 10:34     ` Schenk, Gavin
  2013-09-16  6:57       ` Markus Wolters
  2013-09-11 13:11     ` Marc Kleine-Budde
  1 sibling, 1 reply; 16+ messages in thread
From: Schenk, Gavin @ 2013-09-11 10:34 UTC (permalink / raw)
  To: ptxdist


[-- 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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
  2013-09-11  9:16   ` Markus Wolters
  2013-09-11 10:34     ` Schenk, Gavin
@ 2013-09-11 13:11     ` Marc Kleine-Budde
  1 sibling, 0 replies; 16+ messages in thread
From: Marc Kleine-Budde @ 2013-09-11 13:11 UTC (permalink / raw)
  To: ptxdist; +Cc: Markus Wolters


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

On 09/11/2013 11:16 AM, Markus Wolters wrote:
> 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?

Instead of creating a user during the first boot, you can just copy
modified passwd + shadow to projectroot/etc of you BSP.

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

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

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
  2013-09-11 10:34     ` Schenk, Gavin
@ 2013-09-16  6:57       ` Markus Wolters
  2013-09-16  8:23         ` Michael Olbrich
  0 siblings, 1 reply; 16+ messages in thread
From: Markus Wolters @ 2013-09-16  6:57 UTC (permalink / raw)
  To: ptxdist

[-- Attachment #1: Type: text/html, Size: 9244 bytes --]

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

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
  2013-09-16  6:57       ` Markus Wolters
@ 2013-09-16  8:23         ` Michael Olbrich
  2013-09-16  8:36           ` Markus Wolters
  2013-09-20  8:54           ` Markus Wolters
  0 siblings, 2 replies; 16+ messages in thread
From: Michael Olbrich @ 2013-09-16  8:23 UTC (permalink / raw)
  To: ptxdist

Hi,

On Mon, Sep 16, 2013 at 08:57:36AM +0200, Markus Wolters wrote:
> unfortunately I'm not able to get it work. My foo.postinst only contains an
> echo "something" and exit 0. Rights are rx for everyone. If I extract the files
> from ipk, there is no postinst file included and no script gets executed on
> install/upgrade. Any ideas what's going wrong?

Take a closer look at the ipkg. It is a zip file that contains 2 tar-balls.
The postinst script should be in the control tar-ball.

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
  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-20  8:54           ` Markus Wolters
  1 sibling, 2 replies; 16+ messages in thread
From: Markus Wolters @ 2013-09-16  8:36 UTC (permalink / raw)
  To: ptxdist

[-- Attachment #1: Type: text/html, Size: 1980 bytes --]

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

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
  2013-09-16  8:36           ` Markus Wolters
@ 2013-09-16  8:48             ` Jürgen Beisert
  2013-09-16 12:03             ` Markus Wolters
  1 sibling, 0 replies; 16+ messages in thread
From: Jürgen Beisert @ 2013-09-16  8:48 UTC (permalink / raw)
  To: ptxdist; +Cc: Markus Wolters

Hi Markus,

On Monday 16 September 2013 10:36:13 Markus Wolters wrote:
> <html><head></head><body><div style="font-family: Verdana;font-size:
> 12.0px;"><div> <div>Hi Michael,</div>
> <div>&nbsp;</div>
> <div>that&#39;s what I meant when I wrote:</div>
> <div>&gt; If I extract the files<br/>
> &gt; from ipk, there is no postinst file included</div>
> [...]

Please use plain text instead of HTML.

Regards,
Juergen

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
  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
  1 sibling, 1 reply; 16+ messages in thread
From: Markus Wolters @ 2013-09-16 12:03 UTC (permalink / raw)
  To: ptxdist

[-- Attachment #1: Type: text/html, Size: 2724 bytes --]

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

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
  2013-09-16  8:23         ` Michael Olbrich
  2013-09-16  8:36           ` Markus Wolters
@ 2013-09-20  8:54           ` Markus Wolters
  1 sibling, 0 replies; 16+ messages in thread
From: Markus Wolters @ 2013-09-20  8:54 UTC (permalink / raw)
  To: ptxdist

Hello Michael,

the control tar ball only consists of a single control text file. Do you know any tools or ways to find out, why the rules/mypackage.postinst file is not build in?

Regards 
Markus



> Gesendet: Montag, 16. September 2013 um 10:23 Uhr
> Von: "Michael Olbrich" <m.olbrich@pengutronix.de>
> An: ptxdist@pengutronix.de
> Betreff: Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
>
> Hi,
> 
> On Mon, Sep 16, 2013 at 08:57:36AM +0200, Markus Wolters wrote:
> > unfortunately I'm not able to get it work. My foo.postinst only contains an
> > echo "something" and exit 0. Rights are rx for everyone. If I extract the files
> > from ipk, there is no postinst file included and no script gets executed on
> > install/upgrade. Any ideas what's going wrong?
> 
> Take a closer look at the ipkg. It is a zip file that contains 2 tar-balls.
> The postinst script should be in the control tar-ball.
> 
> 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
> 

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
  2013-09-16 12:03             ` Markus Wolters
@ 2013-09-24  8:01               ` Markus Wolters
  2013-09-24  8:08                 ` Jürgen Beisert
  2013-09-24  8:16                 ` Markus Wolters
  0 siblings, 2 replies; 16+ messages in thread
From: Markus Wolters @ 2013-09-24  8:01 UTC (permalink / raw)
  To: ptxdist

[-- Attachment #1: Type: text/html, Size: 3612 bytes --]

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

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
  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
  1 sibling, 1 reply; 16+ messages in thread
From: Jürgen Beisert @ 2013-09-24  8:08 UTC (permalink / raw)
  To: ptxdist; +Cc: Markus Wolters

Hi Markus,

On Tuesday 24 September 2013 10:01:57 Markus Wolters wrote:
> <html><head></head><body><div style="font-family: Verdana;font-size:
> 12.0px;"><div>
> [...]

Please use plain text instead of HTML.

Regards,
Juergen

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
  2013-09-24  8:01               ` Markus Wolters
  2013-09-24  8:08                 ` Jürgen Beisert
@ 2013-09-24  8:16                 ` Markus Wolters
  2013-09-24  8:28                   ` Thomas Heller
  1 sibling, 1 reply; 16+ messages in thread
From: Markus Wolters @ 2013-09-24  8:16 UTC (permalink / raw)
  To: ptxdist

Excuse me, I already switched my gmx settings the last time, but I figured out, that you have to do it per mail?! Sorry again...
 
 

Gesendet: Dienstag, 24. September 2013 um 10:01 Uhr
Von: "Markus Wolters" <MarkusWolters@gmx.de>
An: ptxdist@pengutronix.de
Betreff: Re: [ptxdist] How to add opkg/ipkg post install scripts to package?

My postinst script is working now, but I have to ask another question. As the most commands executed in the script require a running target (e.g. access to sdcard), how can I prevent the script from beeing executed at ptxdists targetinstall time on build host?

 
Regards,
Markus
 

Gesendet: Montag, 16. September 2013 um 14:03 Uhr
Von: "Markus Wolters" <MarkusWolters@gmx.de>
An: ptxdist@pengutronix.de
Betreff: Re: [ptxdist] How to add opkg/ipkg post install scripts to package?

I have forgotten to mention that I'm using ptxdist Version "ptxdist-2012.03.0". Maybe something changed since this release?
 
Markus
 

Gesendet: Montag, 16. September 2013 um 10:36 Uhr
Von: "Markus Wolters" <MarkusWolters@gmx.de>
An: ptxdist@pengutronix.de
Betreff: Re: [ptxdist] How to add opkg/ipkg post install scripts to package?

Hi Michael,
 
that's what I meant when I wrote:
> If I extract the files
> from ipk, there is no postinst file included

;-)
 
There is no postinst script in the tar-ball.
 

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

On Mon, Sep 16, 2013 at 08:57:36AM +0200, Markus Wolters wrote:
> unfortunately I'm not able to get it work. My foo.postinst only contains an
> echo "something" and exit 0. Rights are rx for everyone. If I extract the files
> from ipk, there is no postinst file included and no script gets executed on
> install/upgrade. Any ideas what's going wrong?

Take a closer look at the ipkg. It is a zip file that contains 2 tar-balls.
The postinst script should be in the control tar-ball.

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

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
  2013-09-24  8:16                 ` Markus Wolters
@ 2013-09-24  8:28                   ` Thomas Heller
  0 siblings, 0 replies; 16+ messages in thread
From: Thomas Heller @ 2013-09-24  8:28 UTC (permalink / raw)
  To: ptxdist

Am 24.09.2013 10:16, schrieb Markus Wolters:
> My postinst script is working now, but I have to ask another
> question. As the most commands executed in the script require a
> running target (e.g. access to sdcard), how can I prevent the script
> from beeing executed at ptxdists targetinstall time on build host?

I include the script code inside a block like this:

if [ -z "$DESTDIR" ]; then
    # do something
fi

Thomas

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [ptxdist] How to add opkg/ipkg post install scripts to package?
  2013-09-24  8:08                 ` Jürgen Beisert
@ 2013-09-25  6:09                   ` Prajwal Chandrappa
  0 siblings, 0 replies; 16+ messages in thread
From: Prajwal Chandrappa @ 2013-09-25  6:09 UTC (permalink / raw)
  To: ptxdist; +Cc: Markus Wolters

Hi All ,
I am setting up the BSP and creating an image for this device called podbox. I need help regarding the image creation.
After the BSP is setup , when I do the "ptxdist images" I get the following error 
Cannot satisfy dependencies
gettext**install opkg  : parted file error

-----Original Message-----
From: ptxdist-bounces@pengutronix.de [mailto:ptxdist-bounces@pengutronix.de] On Behalf Of Jürgen Beisert
Sent: Dienstag, 24. September 2013 10:09
To: ptxdist@pengutronix.de
Cc: Markus Wolters
Subject: Re: [ptxdist] How to add opkg/ipkg post install scripts to package?

Hi Markus,

On Tuesday 24 September 2013 10:01:57 Markus Wolters wrote:
> <html><head></head><body><div style="font-family: Verdana;font-size:
> 12.0px;"><div>
> [...]

Please use plain text instead of HTML.

Regards,
Juergen

--
Pengutronix e.K.                              | Juergen Beisert             | Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |

--
ptxdist mailing list
ptxdist@pengutronix.de

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2013-09-25  6:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-11  6:55 [ptxdist] How to add opkg/ipkg post install scripts to package? Markus Wolters
2013-09-11  8:33 ` Michael Olbrich
2013-09-11  9:16   ` Markus Wolters
2013-09-11 10:34     ` Schenk, Gavin
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox