From 16de7fb39f0e327b98454b0655e10166b524eff6 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 13 Apr 2012 21:59:33 +0200 Subject: 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. --- main/alpine-baselayout/APKBUILD | 4 +-- .../alpine-baselayout.post-upgrade | 34 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 main/alpine-baselayout/alpine-baselayout.post-upgrade diff --git a/main/alpine-baselayout/APKBUILD b/main/alpine-baselayout/APKBUILD index 15f61d55d..66edd075d 100644 --- a/main/alpine-baselayout/APKBUILD +++ b/main/alpine-baselayout/APKBUILD @@ -1,12 +1,12 @@ # Maintainer: Natanael Copa 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 000000000..0010c9bbc --- /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 -- cgit v1.2.3