Commit Graph

15 Commits

Author SHA1 Message Date
Haris Okanovic e3537163a6 run-postinsts: Print message before running deferred postinst scripts
Opkg can defer running postinst scripts to first boot, which can take
a while on some systems. The output of `opkg configure` (or whatever pm
is used) is redirected to a file when logging is enabled
(I.e. $POSTINST_LOGGING == 1), making the machine appear hung during
this process. This change simply prints a wait message on the console
to inform the user of this potentially long and silent operation so
that they do not mistakenly reboot their machine.

Why not simply `tee` the output instead?
Tee might be provided by BusyBox in some distros, which may need to run
update-alternatives in the very postinst scripts being executed by this
process. It's therefore not safe to assume Tee (or any other packaged
util) is available until the configure process finishes.

(From OE-Core rev: 3f8f1d8e4b129e5dfdd63d450887320aa0e33228)

Signed-off-by: Haris Okanovic <haris.okanovic@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-08 10:31:30 +00:00
Jussi Kukkonen 17ad91acd5 run-postinsts: Use opkg/dpkg to configure when possible
Currently run-postinsts script has code to run postinst scripts
via opkg/dpkg configure but that code is never used. The advantage
of using package managers instead of just executing the scripts is
to keep the package manager DB updated.

Fix the script so that the package managers are used when appropriate.
Also use $localstatedir for the opkg runtime file location.

Fixes [YOCTO #10478].

(From OE-Core rev: b645919f173512f9e75aeb26348d60b63dcdc53c)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-07 10:38:00 +00:00
Robert P. J. Day e6ad36cb54 run-postinsts: Correct comment misspelling, "rpm-posinsts".
(From OE-Core rev: 45048442913687f2817ef9a52352fe3214f5f023)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:24 +01:00
Alejandro del Castillo d6b1171131 opkg: upgrade to v0.3.0
Changes required:
- Rename opkg-cl to opkg
- Add libarchive dependency
- Drop backport patches
- Drop obsolete directory options
- Add patch to handle empty index files

Based on initial work by Paul Barker.

(From OE-Core rev: 1dd2a9ea54f5a5497e23814f144f35ff15430d71)

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
CC: Paul Barker <paul@paulbarker.me.uk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:14 +01:00
André Draszik 0e9a9842a8 run-postinsts: use ${localstatedir} instead of hardcoding /var/lib
(From OE-Core rev: 48d735a8938ec7c49754a57019182ebcd9a2d8b6)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31 10:32:38 +01:00
Aníbal Limón 64229cb5d4 run-postinsts: Fix ipk package management detection
run-postinsts always mark ipk package management as true, causing
problems when try to execute opkg-cl and isn't present.

(From OE-Core rev: 84dcc8dded5761e24e09dbcc822445ce3dd69497)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:52 +01:00
Chen Qi 1ea5aad63a run-postinsts.service: remove redundant line
The basic.target itself requires sysinit.target, so there's no
need to write this redundant line in the run-postinsts unit file.

(From OE-Core rev: 28835fcd78fd35db6d3bd7ee2be16904ddf11991)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-03 11:09:07 +01:00
Laurentiu Palcu cbefaa3e31 run-postinsts: fix issue with checking IMAGE_FEATURES
The old implementation was wrong. It was not very generic and it checked
IMAGE_FEATURES while building the recipe, which led to various issues
with the generation of the final script. That is, the run-postinsts
script was generated once, while building the package for the first
time. Hence, any other changes to IMAGE_FEATURES, like removing/adding
'package-management' did not reflect in the final script.

This commit makes run-postinsts script autodetect the backend used for
creating the image, making it generic.

[YOCTO #5666]
[YOCTO #5972]

(From OE-Core rev: 44902f7550e490a9d4d2e2bcdf8c577329b4af75)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-27 15:44:43 +00:00
Laurentiu Palcu 5159ddcb62 run-postinsts: use it for opkg/dpkg too
Currently, opkg/dpkg have their own postinstalls that create a
run-postinsts script which is run at first boot.

This commit prepares the run-postinsts recipe/script to be used by
opkg/dpkg when DISTRO_FEATURES includes package-management.

[YOCTO #5666]

(From OE-Core rev: f33555f52a4ee83f0bd205cdf483045fcd0578b2)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-07 15:05:08 +00:00
Ross Burton 79f2bb4742 run-postinsts: Add systemd service file
This patch mainly adds a systmd service file for run-postinsts,
which is started at first boot to run the post-install scripts.

Apart from this, this patch also modifies the installation location
of run-postinsts to ${sbindir}. This is because this script would be
used by both sysvinit and systemd based images. So it's more reasonable
to make it locate under ${sbindir}.

[YOCTO #5719]

(From OE-Core rev: 5933fbef26ffbc8140248ffb28957f36a813054b)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-28 00:52:34 +00:00
Chen Qi 78484bf45e run-postinsts: remove the init script after a clean start-up
If we enable ipk/deb package back-end, and we have 'package-management'
in our IMAGE_FEATURES, then the /etc/rcS.d/S99run-postinsts would
still exist in our system after a clean start-up.

The initial design for run-postinsts requires the related init script
to be removed if there's no more post-install script left in the system.

This patch fixes this problem.

[YOCTO #5718]

(From OE-Core rev: 08a2f48cb95256c6d44c8574949fabafe1466969)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-28 00:52:34 +00:00
Chen Qi aa7bc3caca run-postinsts: add more logging to the log file to make things clearer
When all postinsts scripts succeed at system startup, it's very possible
that the log file /var/log/postinstall.log is empty. This is kind of
confusing, as that file is supposed to hold information about the postinsts.

Add more logging to the log file to make things clearer.

(From OE-Core rev: d60926b3fc4ba5780aef5b5226d05170892a7133)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-29 13:09:00 +01:00
Chen Qi 49cd268c22 run-postinsts: fix comment
The run-postinsts script also handles the #SYSCONFDIR#/rpm-postinsts
directory. Add it to the comment for clarity.

(From OE-Core rev: ca32f9c3f7749aa31d1ea83eda1ca39a2678215b)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-29 13:09:00 +01:00
Yi Zhao 8b57730610 run-postinsts: Fix typo
Fix a typo for stderr redirection.

(From OE-Core rev: b03c670d44b28c673393468bbe62919f3f8186de)

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-18 21:24:29 +01:00
Laurentiu Palcu 76cd8a776b run-postinsts: make it generic
This recipe is used only when the package manager is not deployed on
target and there still are delayed postinstalls that need to be run on
target. At the moment, run-postinsts is targeted to dpkg/opkg. RPM uses another
recipe, called rpm-postinsts which, in turn, is used even when the rpm
package is deployed.

This patch intends to make run-postinsts generic and deprecate
rpm-postinsts. Here's why:
 * when opkg/dpkg are not deplyed, the meta-data files are useless.
   Hence, the awk script is not needed. The postinstall files are already
   saved in /etc/(deb|ipk)-postinsts directory and we can use the same
   procedure as in rpm's case;

Also, the recipe is moved out from meta/recipes-devel/dpkg to
meta/recipes-devel/run-postinsts.

(From OE-Core rev: 0222e6740ee4670bbf42d246ab3ecad415ffcdee)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-11 15:38:04 +01:00