Skip to contentSkip to conversation

postinst jobs and "exit 1"

DISCUSSION Martin Dietze 3 participants 4 messages Sep 14, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

lots of packages start their postinst jobs like this:

| test -z "$D" || exit 1

When creating firmware images using recent OE recipes (nylon distro and mtx-2 hardware), this seems to cause problems, either bitbake complains about "exit 1" in the log file when doing the rootfs or lots of postinst jobs are not run after installing the image.

Is the above test deprecated and should be replaced by something not exit'ing at all? If yes, who is going to adapt all the existing packages still doing this?

Cheers,

Martin

Signature · 5 lines
-------------- Martin Dietze --------------- / -- 4G Systeme GmbH Hamburg ---
-- [email protected] -- / ---- [email protected] ----
------------- / http://herbert.the-little-red-haired-girl.org / -------------
=+= 
Ed, the greatest WYGIWYG editor of all.
#1 lore raw
Quoted 10 lines · Martin Dietze

lots of packages start their postinst jobs like this:

| test -z "$D" || exit 1

When creating firmware images using recent OE recipes (nylon distro and mtx-2 hardware), this seems to cause problems, either bitbake complains about "exit 1" in the log file when doing the rootfs or lots of postinst jobs are not run after installing the image.

Quoted 3 lines

Is the above test deprecated and should be replaced by something not exit'ing at all? If yes, who is going to adapt all the existing packages still doing this?

Packages do this if the postinst should run on the device and should not be during do_rootfs. If the postinst can be safely run during postinst, you wouldn't have a line like this.

Based on that are there any specific examples giving cause for concern?

Regards,

Richard

#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Richard Purdie schreef:

Quoted 11 lines · Martin Dietze
Quoted 10 lines

lots of packages start their postinst jobs like this:

| test -z "$D" || exit 1

When creating firmware images using recent OE recipes (nylon distro and mtx-2 hardware), this seems to cause problems, either bitbake complains about "exit 1" in the log file when doing the rootfs or lots of postinst jobs are not run after installing the image.

Quoted 7 lines
Quoted 3 lines

Is the above test deprecated and should be replaced by something not exit'ing at all? If yes, who is going to adapt all the existing packages still doing this?

Packages do this if the postinst should run on the device and should not be during do_rootfs. If the postinst can be safely run during postinst, you wouldn't have a line like this.

isn't the 'if x$D == x' test preferred over the above test?[1]

regards,

Koen

[1] I really don't know

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFCWIiMkyGM64RGpERAq1mAJ0TI7T1qOlBi9tb7A8oPc6dmLwGdACffKeU cPxJYtR3N37AylFrzjSniUA=
=N/7O
-----END PGP SIGNATURE-----

#3 lore raw
In reply to Richard Purdie
Quoted 1 line · Richard Purdie

Based on that are there any specific examples giving cause for concern?

The problem was somewhere else. Since there is some checking for errors after having performed the offline installation into the image's root file system I got an error after an "exit 1" in a postinst job. As it turned out the problem was not the action performed but the fact that there had been a `set -x' before it in the recipe. Took me half a day to find out :) Sorry for having bothered you with this.

Cheers,

Martin

Signature · 5 lines
-------------- Martin Dietze --------------- / -- 4G Systeme GmbH Hamburg ---
-- [email protected] -- / ---- [email protected] ----
------------- / http://herbert.the-little-red-haired-girl.org / -------------
=+= 
Yoda of Borg I am. Assimilated you will be.