diff options
Diffstat (limited to 'meta')
| -rwxr-xr-x | meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts | 21 | ||||
| -rw-r--r-- | meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service | 1 |
2 files changed, 12 insertions, 10 deletions
diff --git a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts index 307feb7187..95eff04e17 100755 --- a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts +++ b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts | |||
| @@ -6,7 +6,8 @@ | |||
| 6 | # | 6 | # |
| 7 | 7 | ||
| 8 | # The following script will run all the scriptlets found in #SYSCONFDIR#/deb-postinsts, | 8 | # The following script will run all the scriptlets found in #SYSCONFDIR#/deb-postinsts, |
| 9 | # #SYSCONFDIR#/ipk-postinsts or #SYSCONFDIR#/rpm-postinsts. | 9 | # #SYSCONFDIR#/ipk-postinsts or #SYSCONFDIR#/rpm-postinsts or the package manager in |
| 10 | # case available. | ||
| 10 | 11 | ||
| 11 | # the order of this list is important, do not change! | 12 | # the order of this list is important, do not change! |
| 12 | backend_list="rpm deb ipk" | 13 | backend_list="rpm deb ipk" |
| @@ -14,27 +15,29 @@ backend_list="rpm deb ipk" | |||
| 14 | pm_installed=false | 15 | pm_installed=false |
| 15 | 16 | ||
| 16 | for pm in $backend_list; do | 17 | for pm in $backend_list; do |
| 17 | pi_dir="#SYSCONFDIR#/$pm-postinsts" | ||
| 18 | |||
| 19 | if [ ! -d $pi_dir ]; then | ||
| 20 | continue | ||
| 21 | fi | ||
| 22 | |||
| 23 | # found the package manager, it has postinsts | 18 | # found the package manager, it has postinsts |
| 24 | case $pm in | 19 | case $pm in |
| 25 | "deb") | 20 | "deb") |
| 26 | if [ -s "#LOCALSTATEDIR#/lib/dpkg/status" ]; then | 21 | if [ -s "#LOCALSTATEDIR#/lib/dpkg/status" ]; then |
| 27 | pm_installed=true | 22 | pm_installed=true |
| 23 | break | ||
| 28 | fi | 24 | fi |
| 29 | ;; | 25 | ;; |
| 30 | 26 | ||
| 31 | "ipk") | 27 | "ipk") |
| 32 | if [ -s "#LOCALSTATEDIR#/lib/opkg/status" ]; then | 28 | if [ -s "#LOCALSTATEDIR#/lib/opkg/status" ]; then |
| 33 | pm_installed=true | 29 | pm_installed=true |
| 30 | break | ||
| 34 | fi | 31 | fi |
| 35 | ;; | 32 | ;; |
| 36 | esac | 33 | esac |
| 37 | break | 34 | |
| 35 | pi_dir="#SYSCONFDIR#/$pm-postinsts" | ||
| 36 | |||
| 37 | # found postinsts directory | ||
| 38 | if [ -d $pi_dir ]; then | ||
| 39 | break | ||
| 40 | fi | ||
| 38 | done | 41 | done |
| 39 | 42 | ||
| 40 | remove_rcsd_link () { | 43 | remove_rcsd_link () { |
| @@ -43,7 +46,7 @@ remove_rcsd_link () { | |||
| 43 | fi | 46 | fi |
| 44 | } | 47 | } |
| 45 | 48 | ||
| 46 | if ! [ -d $pi_dir ]; then | 49 | if ! [ -d $pi_dir ] && ! $pm_installed; then |
| 47 | remove_rcsd_link | 50 | remove_rcsd_link |
| 48 | exit 0 | 51 | exit 0 |
| 49 | fi | 52 | fi |
diff --git a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service index 1b71a1f8be..d42addf510 100644 --- a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service +++ b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service | |||
| @@ -3,7 +3,6 @@ Description=Run pending postinsts | |||
| 3 | DefaultDependencies=no | 3 | DefaultDependencies=no |
| 4 | After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount | 4 | After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount |
| 5 | Before=sysinit.target | 5 | Before=sysinit.target |
| 6 | ConditionPathExistsGlob=#SYSCONFDIR#/*-postinsts | ||
| 7 | 6 | ||
| 8 | [Service] | 7 | [Service] |
| 9 | Type=oneshot | 8 | Type=oneshot |
