From c84a6e263d1c0a980bc006e67fef8de47e86871f Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 2 May 2012 14:09:22 +0000 Subject: main/util-vserver: upgrade to 0.30.216_pre3034 --- main/util-vserver/APKBUILD | 10 ++-- main/util-vserver/alpine.patch | 120 +++++++++++++++++++++++++++++++++++++++ main/util-vserver/setup-vs-guest | 1 + 3 files changed, 127 insertions(+), 4 deletions(-) create mode 100644 main/util-vserver/alpine.patch diff --git a/main/util-vserver/APKBUILD b/main/util-vserver/APKBUILD index b3c43c13d..cd2a32a30 100644 --- a/main/util-vserver/APKBUILD +++ b/main/util-vserver/APKBUILD @@ -1,8 +1,8 @@ # Maintainer: Natanael Copa 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 000000000..d3727db8a --- /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 <>> 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 </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 < "$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 802f68fe5..04326dbc5 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/ \ -- cgit v1.2.3