aboutsummaryrefslogtreecommitdiffstats
path: root/main/alpine-baselayout
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-04-13 21:59:33 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2012-04-19 13:00:01 +0200
commit16de7fb39f0e327b98454b0655e10166b524eff6 (patch)
tree6d6b246aa0e5c6894d3a3e4379cd5a5bf9beebeb /main/alpine-baselayout
parentf76368c508ff676a1f534df1ac139759dda338a3 (diff)
downloadaports-16de7fb39f0e327b98454b0655e10166b524eff6.tar.bz2
aports-16de7fb39f0e327b98454b0655e10166b524eff6.tar.xz
main/alpine-baselayout: add compat scripts for vserver guests
The alpine-baselayout package no longer provide the pre-openrc rcL and rcK scripts. The already configured vserver guests might depend on those so we create them in post-upgrade for vserver guests.
Diffstat (limited to 'main/alpine-baselayout')
-rw-r--r--main/alpine-baselayout/APKBUILD4
-rw-r--r--main/alpine-baselayout/alpine-baselayout.post-upgrade34
2 files changed, 36 insertions, 2 deletions
diff --git a/main/alpine-baselayout/APKBUILD b/main/alpine-baselayout/APKBUILD
index 15f61d55d6..66edd075d7 100644
--- a/main/alpine-baselayout/APKBUILD
+++ b/main/alpine-baselayout/APKBUILD
@@ -1,12 +1,12 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=alpine-baselayout
pkgver=2.2.0
-pkgrel=0
+pkgrel=1
pkgdesc="Alpine base dir structure and init scripts"
url=http://git.alpinelinux.org/cgit/alpine-baselayout
depends=
options="!fhs"
-install="$pkgname.pre-upgrade"
+install="$pkgname.pre-upgrade $pkgname.post-upgrade"
source="http://git.alpinelinux.org/cgit/$pkgname.git/snapshot/$pkgname-$pkgver.tar.bz2
0001-blacklist-viafb-and-e_powersaver.patch
"
diff --git a/main/alpine-baselayout/alpine-baselayout.post-upgrade b/main/alpine-baselayout/alpine-baselayout.post-upgrade
new file mode 100644
index 0000000000..0010c9bbc7
--- /dev/null
+++ b/main/alpine-baselayout/alpine-baselayout.post-upgrade
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+create_vserver_startstop() {
+ cat <<__EOF__
+#!/bin/sh
+
+# This file is for compatibility
+case \${0##*/} in
+rcL)
+ RUNLEVEL=1 /sbin/rc sysinit || exit 1
+ /sbin/rc boot || exit 1
+ /sbin/rc \${1:-default}
+ exit 0
+ ;;
+rcK)
+ /sbin/rc shutdown
+ ;;
+esac
+
+__EOF__
+}
+
+# create compat start/stop scripts for vserver guests
+if [ "$(/sbin/rc --sys)" != "VSERVER" ]; then
+ # create rcL and rcK|
+ if ! [ -e /etc/init.d/rcL ]; then
+ create_vserver_startstop > /etc/init.d/rcL
+ fi
+ if ! [ -e /etc/init.d/rcK ]; then
+ ln -s rcL /etc/init.d/rcK
+ fi
+fi
+
+exit 0