diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2023-11-26 21:24:28 +0100 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2023-12-27 16:01:30 +0100 |
commit | b799dd3c705dfd95745cdd94b13d1cd2ad2367a6 (patch) | |
tree | c322fcf5214f72eaa449ca9221a8809a7e8ae3c8 /package/base-files/files | |
parent | 485adc9d3c436d31f9713a7d8d84adf266754e26 (diff) | |
download | openwrt-b799dd3c705dfd95745cdd94b13d1cd2ad2367a6.tar.gz openwrt-b799dd3c705dfd95745cdd94b13d1cd2ad2367a6.tar.bz2 openwrt-b799dd3c705dfd95745cdd94b13d1cd2ad2367a6.zip |
base-files: execute package's "postinst" after executing uci-defaults
Allow "postinst" scripts to perform extra actions after applying all
kind of fixups implemented using uci-defaults.
This is needed e.g. by uhttpd-mod-ubus which after installation in a
running systems needs to:
1. Update uhttpd config using its uci-defaults script
2. Reload uhttpd
While this approach makes sense there is a risk it'll blow up some
corner case postinst usages. There is only 1 way to find out.
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'package/base-files/files')
-rw-r--r-- | package/base-files/files/lib/functions.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index d9628dbb7a..851d2f1791 100644 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -270,11 +270,6 @@ default_postinst() { add_group_and_user "${pkgname}" - if [ -f "$root/usr/lib/opkg/info/${pkgname}.postinst-pkg" ]; then - ( . "$root/usr/lib/opkg/info/${pkgname}.postinst-pkg" ) - ret=$? - fi - if [ -d "$root/rootfs-overlay" ]; then cp -R $root/rootfs-overlay/. $root/ rm -fR $root/rootfs-overlay/ @@ -300,6 +295,11 @@ default_postinst() { rm -f /tmp/luci-indexcache fi + if [ -f "$root/usr/lib/opkg/info/${pkgname}.postinst-pkg" ]; then + ( . "$root/usr/lib/opkg/info/${pkgname}.postinst-pkg" ) + ret=$? + fi + local shell="$(command -v bash)" for i in $(grep -s "^/etc/init.d/" "$root$filelist"); do if [ -n "$root" ]; then |