aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-10-21 09:46:40 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-10-21 09:46:40 +0000
commit1269ce209902722dc212d0129a5751a915f5d038 (patch)
tree0356644b19b88bb9bdc9ee397db4086ba1e408be /testing
parentd0c4ad933961b1ec6f235f1a8b38b3c130a62e17 (diff)
downloadaports-1269ce209902722dc212d0129a5751a915f5d038.tar.bz2
aports-1269ce209902722dc212d0129a5751a915f5d038.tar.xz
testing/util-vserver: upgrade to 0.30.216-pre2849
added setup-vs-template script updated alpine patch to support 1.8 guests
Diffstat (limited to 'testing')
-rw-r--r--testing/util-vserver/APKBUILD13
-rw-r--r--testing/util-vserver/alpine.patch31
-rw-r--r--testing/util-vserver/setup-vs-template44
3 files changed, 70 insertions, 18 deletions
diff --git a/testing/util-vserver/APKBUILD b/testing/util-vserver/APKBUILD
index 31b076f4ea..bdf49caf41 100644
--- a/testing/util-vserver/APKBUILD
+++ b/testing/util-vserver/APKBUILD
@@ -1,8 +1,8 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=util-vserver
-pkgver=0.30.216_pre2841
-_realver=0.30.216-pre2841
-pkgrel=3
+pkgver=0.30.216_pre2849
+_realver=0.30.216-pre2849
+pkgrel=0
pkgdesc="Linux-VServer admin utilities"
url="http://www.nongnu.org/util-vserver/"
license="GPL"
@@ -16,6 +16,7 @@ source="http://people.linux-vserver.org/~dhozac/t/uv-testing/util-vserver-$_real
ensc_pathprog.patch
validate.patch
alpine.patch
+ setup-vs-template
"
subpackages="$pkgname-doc $pkgname-dev"
@@ -39,10 +40,12 @@ build() {
make || return 1
make DESTDIR="$pkgdir/" install install-distribution
+ install -Dm755 ../setup-vs-template "$pkgdir"/usr/sbin/setup-vs-template
}
-md5sums="71c3f2012d0159aac22fee098be063e9 util-vserver-0.30.216-pre2841.tar.bz2
+md5sums="af4c22b420320bdd94a1756f3c90de20 util-vserver-0.30.216-pre2849.tar.bz2
73c7437dea6937a57cf38d166ef83c09 chmod.patch
ff8f561f672524eb46fe633f584ef60e ensc_pathprog.patch
da8b70c4fd40e68894b3903ffd121397 validate.patch
-65fee3e086d2dd413526609c9ee782e5 alpine.patch"
+04000261fd990a3963b0e98260b481bd alpine.patch
+4504f4a97eba4a4ab21feff1b121c7bd setup-vs-template"
diff --git a/testing/util-vserver/alpine.patch b/testing/util-vserver/alpine.patch
index a9914a4b84..eacc2cb624 100644
--- a/testing/util-vserver/alpine.patch
+++ b/testing/util-vserver/alpine.patch
@@ -1,21 +1,26 @@
-diff -ru a/distrib/alpine/initpost b/distrib/alpine/initpost
---- a/distrib/alpine/initpost 2009-10-02 18:36:00.000000000 +0000
-+++ b/distrib/alpine/initpost 2009-10-02 18:42:35.000000000 +0000
-@@ -24,7 +24,7 @@
- cd "$vdir"
+Index: distrib/alpine/initpost
+===================================================================
+--- a/distrib/alpine/initpost (revision 2855)
++++ b/distrib/alpine/initpost (working copy)
+@@ -1,6 +1,6 @@
+ #!/bin/bash
- echo ">>> Creating missing dirs..."
--$_CHROOT_SH mkdir proc sys dev home etc etc/rcL.d etc/rcK.d 2>/dev/null
-+$_CHROOT_SH mkdir -p proc sys dev home etc 2>/dev/null
-
- # remove mtab which is a link
- if test -e "$vdir/etc/mtab"; then
-@@ -37,7 +37,7 @@
+-# Copyright (C) 2007 Natanael Copa <ncopa@alpinelinux.org>
++# Copyright (C) 2007, 2009 Natanael Copa <ncopa@alpinelinux.org>
+ #
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+@@ -37,7 +37,12 @@
$_VSERVER "$vserver" stop &>/dev/null || true
$_VSERVER "$vserver" start --rescue --rescue-init /bin/busybox sh -c '
/bin/busybox --install -s
- /sbin/rc_add -s 20 -k syslog
-+ /sbin/rc-update add syslog boot
++ 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
'
# set up hostname
diff --git a/testing/util-vserver/setup-vs-template b/testing/util-vserver/setup-vs-template
new file mode 100644
index 0000000000..79172b4c41
--- /dev/null
+++ b/testing/util-vserver/setup-vs-template
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# create a vserver template
+PROG=$0
+
+usage() {
+ echo "usage: $PROG [-fhq] [-o OUTFILE] [-X repository] [packages...]"
+ exit $1
+}
+
+clean_exit() {
+ rm -rf "$tmpdir"
+ exit $1
+}
+
+outfile=template.tar.gz
+fakeroot=
+repos=
+while getopts "ho:qX:" opt; do
+ case "$opt" in
+ h) usage 0;;
+ o) outfile="$OPTARG";;
+ q) quiet=-q;;
+ X) repos="$repos --repository $OPTARG";;
+ esac
+done
+shift $(( $OPTIND - 1 ))
+
+if [ "$(whoami)" != "root" ]; then
+ echo "Warning: you need root permissions" >&2
+fi
+
+tmpdir=$(mktemp -d ${TMPDIR:-/tmp}/setup-vs-template-XXXXXX)
+
+apk add --root "$tmpdir" --initdb --keys-dir /etc/apk/keys \
+ $quiet ${repos:---repositories-file /etc/apk/repositories} \
+ alpine-base $@ \
+ || clean_exit 1
+
+tar -czf "$outfile" -C "$tmpdir" $(ls "$tmpdir") || clean_exit 1
+
+[ -z "$quiet" ] && echo "Created $outfile"
+clean_exit 0
+