diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-05-02 14:09:22 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-05-02 14:13:15 +0000 |
commit | c84a6e263d1c0a980bc006e67fef8de47e86871f (patch) | |
tree | 3efca9b6a0159442579025df712fb3810ccd09c6 /main | |
parent | 5f2f70b8b9f345e3bd96da11b8d5c8bf3e7f1d91 (diff) | |
download | aports-c84a6e263d1c0a980bc006e67fef8de47e86871f.tar.bz2 aports-c84a6e263d1c0a980bc006e67fef8de47e86871f.tar.xz |
main/util-vserver: upgrade to 0.30.216_pre3034
Diffstat (limited to 'main')
-rw-r--r-- | main/util-vserver/APKBUILD | 10 | ||||
-rw-r--r-- | main/util-vserver/alpine.patch | 120 | ||||
-rw-r--r-- | main/util-vserver/setup-vs-guest | 1 |
3 files changed, 127 insertions, 4 deletions
diff --git a/main/util-vserver/APKBUILD b/main/util-vserver/APKBUILD index b3c43c13db..cd2a32a30f 100644 --- a/main/util-vserver/APKBUILD +++ b/main/util-vserver/APKBUILD @@ -1,8 +1,8 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=util-vserver -pkgver=0.30.216_pre3029 +pkgver=0.30.216_pre3034 _realver=${pkgver/_/-} -pkgrel=2 +pkgrel=0 pkgdesc="Linux-VServer admin utilities" url="http://www.nongnu.org/util-vserver/" arch="all" @@ -13,6 +13,7 @@ makedepends="iptables-dev e2fsprogs-dev beecrypt-dev autoconf automake depends="bash make" source="http://people.linux-vserver.org/~dhozac/t/uv-testing/util-vserver-$_realver.tar.bz2 + alpine.patch setup-vs-template setup-vs-guest " @@ -56,6 +57,7 @@ package() { install -Dm755 ../setup-vs-guest "$pkgdir"/usr/sbin/setup-vs-guest } -md5sums="e0775fe6ee9ce390be2be84c94eca4ab util-vserver-0.30.216-pre3029.tar.bz2 +md5sums="c0f708814ff48532802a5fb04514a86c util-vserver-0.30.216-pre3034.tar.bz2 +dd0a433de812dd167e7dbb36c215491e alpine.patch fae6626b724dec90a19924d68d355cd2 setup-vs-template -5036ff620b5d3a9b7824b4719e76bcd9 setup-vs-guest" +b164b1570badb45ecb6fa52772a10d2c setup-vs-guest" diff --git a/main/util-vserver/alpine.patch b/main/util-vserver/alpine.patch new file mode 100644 index 0000000000..d3727db8ae --- /dev/null +++ b/main/util-vserver/alpine.patch @@ -0,0 +1,120 @@ +diff --git a/distrib/alpine/initpost b/distrib/alpine/initpost +index 4bb639d..969e20c 100644 +--- a/distrib/alpine/initpost ++++ b/distrib/alpine/initpost +@@ -23,8 +23,8 @@ vdir="$cfgdir"/vdir + + cd "$vdir" + +-echo ">>> Creating missing dirs..." +-$_CHROOT_SH mkdir proc sys dev home etc etc/rcL.d etc/rcK.d 2>/dev/null ++echo ">>> Creating missing dirs ..." ++$_CHROOT_SH mkdir proc sys dev home etc run 2>/dev/null + + # remove mtab which is a link + if test -e "$vdir/etc/mtab"; then +@@ -32,40 +32,54 @@ if test -e "$vdir/etc/mtab"; then + fi + + # trick to install busybox links and boot services +-echo ">>> Installing boot services..." ++echo ">>> Installing boot services ..." + vserver="$1" +-$_VSERVER "$vserver" stop &>/dev/null || true +-$_VSERVER "$vserver" start --rescue --rescue-init /bin/busybox sh -c ' +- /bin/busybox --install -s +- if [ -x /sbin/rc-update ]; then +- /sbin/rc-update add syslog boot +- /bin/rmdir /etc/rcL.d /etc/rcK.d +- else +- /sbin/rc_add -s 20 -k syslog +- fi +-' ++$_CHROOT_SH mkdir /etc/runlevels 2>/dev/null ++$_CHROOT_SH mkdir /etc/runlevels/boot 2>/dev/null ++$_CHROOT_SH link /etc/init.d/syslog /etc/runlevels/boot/syslog + + # set up hostname + if test -r "$cfgdir"/uts/nodename; then +- echo ">>> Setting hostname..." ++ echo ">>> Setting hostname ..." + $_CHROOT_SH truncate /etc/hostname < "$cfgdir/uts/nodename" + fi + + # create fstab + echo -e "none\t/\tnone\tdefaults" | $_CHROOT_SH truncate /etc/fstab + +-# create busybox style inittab +-cat <<EOF | $_CHROOT_SH truncate /etc/inittab +-::wait:/etc/init.d/rcL +-::ctrlaltdel:/etc/init.d/rcK ++# set up cmd.start and cmd stop if needed ++test -e "$1"/apps/init/style && initstyle=$(cat "$1"/apps/init/style) ++if test "$initstyle" == "openrc" -o "$initstyle" == "gentoo"; then ++ echo ">>> Installing openrc init-style magic ..." ++ $_CHROOT_SH mkdir /lib 2>/dev/null ++ $_CHROOT_SH mkdir /lib/rc 2>/dev/null ++ $_CHROOT_SH mkdir /lib/rc/sh 2>/dev/null ++ ++ cat <<EOF | $_CHROOT_SH truncate /lib/rc/sh/init-vserver.sh ++#!/bin/sh ++ ++RUNLEVEL=1 /sbin/rc sysinit && /sbin/rc boot || exit 1 ++/sbin/rc \${1:-default} ++exit 0 ++EOF ++ $_CHROOT_SH chmod 0755 /lib/rc/sh/init-vserver.sh ++ ++ $_CHROOT_SH mkdir /etc/init.d 2>/dev/null ++ echo "exit 0" | $_CHROOT_SH truncate /etc/init.d/shutdown.sh ++ $_CHROOT_SH chmod 0755 /etc/init.d/shutdown.sh ++ echo "exit 0" | $_CHROOT_SH truncate /etc/init.d/reboot.sh ++ $_CHROOT_SH chmod 0755 /etc/init.d/reboot.sh ++ ++else ++ echo ">>> Creating busybox style inittab ..." ++ # create busybox style inittab ++ cat <<EOF | $_CHROOT_SH truncate /etc/inittab ++::sysinit:/sbin/rc sysinit ++::wait:/sbin/rc default ++::ctrlaltdel:/sbin/rc shutdown + ::ctrlaltdel:/usr/bin/killall5 -15 + EOF + +-# set up cmd.start and cmd stop if needed +-test -e "$1"/apps/init/style && initstlye=$(cat "$1"/apps/init/style) +-if test "$initstlye" != "plain"; then +- echo "/etc/init.d/rcL" > "$cfgdir/apps/init/cmd.start" +- echo "/etc/init.d/rcK" > "$cfgdir/apps/init/cmd.stop" + fi + + # vserver should not be running at this point but lets be sure +diff --git a/distrib/alpine/initpre b/distrib/alpine/initpre +index 58ea449..0257e20 100644 +--- a/distrib/alpine/initpre ++++ b/distrib/alpine/initpre +@@ -20,14 +20,19 @@ + vdir="$1"/vdir + . "$2" + ++echo ">>> Adding /run to fstab ..." ++echo "none /run tmpfs size=1m,mode=0755 0 0" >> "$1"/fstab ++ + # initstyle sanity + initstyle=sysv + test -e "$1"/apps/init/style && initstyle=$(cat "$1"/apps/init/style) + + echo ">>> Checking init-style ... $initstyle" + +-if test "$initstyle" != "sysv" && test "$initstyle" != "plain" ; then +- echo "!!! The init-style is not supported for Alpine Linux" +- echo "!!! Please use sysv or plain" +-fi ++case "$initstyle" in ++ plain|openrc|gentoo) ;; ++ *) echo "!!! The init-style $initstyle is not supported for Alpine Linux" ++ echo "!!! Please use plain or openrc" ++ ;; ++esac + + diff --git a/main/util-vserver/setup-vs-guest b/main/util-vserver/setup-vs-guest index 802f68fe54..04326dbc56 100644 --- a/main/util-vserver/setup-vs-guest +++ b/main/util-vserver/setup-vs-guest @@ -341,6 +341,7 @@ while true; do --hostname $_hostname \ $_ifaceopts \ --context $_context \ + --inistyle openrc \ $arch_opt \ -m template -- -t "$_template" -d alpine \ && cp /etc/resolv.conf /vservers/$_hostname/etc/ \ |