From d97ddf08e9d879d15196a5c433da731c424a37ce Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Tue, 12 Sep 2006 16:33:59 +0000 Subject: [PATCH] Add support for vserver-build -m template, which extracts tarballs. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2304 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- configure.ac | 5 ++ contrib/manifest.dat.pathsubst | 1 + scripts/Makefile-files | 2 + scripts/magic.mime | 19 ++++++++ scripts/util-vserver-vars.pathsubst | 6 +++ scripts/vserver-build | 4 +- scripts/vserver-build.template | 92 +++++++++++++++++++++++++++++++++++++ 7 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 scripts/magic.mime create mode 100644 scripts/vserver-build.template diff --git a/configure.ac b/configure.ac index 0e85a57..5642959 100644 --- a/configure.ac +++ b/configure.ac @@ -56,6 +56,11 @@ ENSC_PATHPROG(NOHUP, nohup) ENSC_PATHPROG(RMMOD, rmmod) ENSC_PATHPROG(VCONFIG, vconfig,, [See http://www.candelatech.com/~greear/vlan.html; usually this tool is shipped in the 'vconfig' or 'vlan' package of your distribution]) ENSC_PATHPROG(WGET, wget) +ENSC_PATHPROG(FILE, file, [file]) +ENSC_PATHPROG(GZIP, gzip, [gzip]) +ENSC_PATHPROG(BZIP2, bzip2, [bzip2]) +ENSC_PATHPROG(CPIO, cpio, [cpio]) +ENSC_PATHPROG(RESTORE, restore, [restore]) ENSC_PATHPROG(DOXYGEN, doxygen, [:]) ENSC_PATHPROG(XSLTP, xsltp, [:]) diff --git a/contrib/manifest.dat.pathsubst b/contrib/manifest.dat.pathsubst index d700696..8ae2eff 100644 --- a/contrib/manifest.dat.pathsubst +++ b/contrib/manifest.dat.pathsubst @@ -7,6 +7,7 @@ build @PKGLIBDIR@/vserver-build.skeleton build @PKGLIBDIR@/vserver-build.debootstrap build @PKGLIBDIR@/vserver-build.yum build @PKGLIBDIR@/vserver-build.rpm +build @PKGLIBDIR@/vserver-build.template build @PKGLIBDIR@/vserver-build.functions build @PKGLIBDIR@/vserver-build.functions.apt build @PKGLIBDIR@/vserver-build.functions.rpm diff --git a/scripts/Makefile-files b/scripts/Makefile-files index 27aac8e..7c2e989 100644 --- a/scripts/Makefile-files +++ b/scripts/Makefile-files @@ -38,11 +38,13 @@ AM_INSTALLCHECK_STD_OPTIONS_EXEMPT += \ scripts_pkglib_src_DTA = scripts/functions \ + scripts/magic.mime \ scripts/vserver-build.apt-rpm \ scripts/vserver-build.skeleton \ scripts/vserver-build.debootstrap \ scripts/vserver-build.rpm \ scripts/vserver-build.yum \ + scripts/vserver-build.template \ scripts/vserver-build.functions \ scripts/vserver-build.functions.apt \ scripts/vserver-build.functions.rpm \ diff --git a/scripts/magic.mime b/scripts/magic.mime new file mode 100644 index 0000000..0e10d84 --- /dev/null +++ b/scripts/magic.mime @@ -0,0 +1,19 @@ +# Borrowed from file(1) +# gzip (GNU zip, not to be confused with [Info-ZIP/PKWARE] zip archiver) +0 string \037\213 application/x-gzip +# tar posix +257 string ustar\0 application/x-tar +# tar gnu +257 string ustar\040\040\0 application/x-tar +# cpio +0 short 070707 application/x-cpio +# cpio swapped +0 short 0143561 application/x-cpio +# bzip2 +0 string BZh application/x-bzip2 +# dump/restore new-fs big and little endian +24 belong 60012 application/x-dump +24 lelong 60012 application/x-dump +# dump/restore old-fs big and little endian +24 belong 60011 application/x-dump +24 lelong 60011 application/x-dump diff --git a/scripts/util-vserver-vars.pathsubst b/scripts/util-vserver-vars.pathsubst index 4ea7698..ee7662f 100644 --- a/scripts/util-vserver-vars.pathsubst +++ b/scripts/util-vserver-vars.pathsubst @@ -43,6 +43,7 @@ _IFSPEC="$__LEGACYDIR/ifspec" _INITSYNC_MINIT_START=: _KEEP_CTX_ALIVE="$__PKGLIBDIR/keep-ctx-alive" _LIB_FUNCTIONS="$__PKGLIBDIR/functions" +_LIB_MAGIC="$__PKGLIBDIR/magic" _LIB_VSERVER_SETUP_FUNCTIONS="$__PKGLIBDIR/vserver-setup.functions" _LIB_VSERVER_BUILD_FUNCTIONS="$__PKGLIBDIR/vserver-build.functions" _LIB_VSERVER_BUILD_FUNCTIONS_APT="$__PKGLIBDIR/vserver-build.functions.apt" @@ -96,14 +97,18 @@ _VYUM="$__SBINDIR/vyum" _VYUM_WORKER="$__PKGLIBDIR/vyum-worker" _AWK="@AWK@" +_BZIP2="@BZIP2@" _CAT="@CAT@" _CHOWN="@CHOWN@" _CMP="@CMP@" _CP="@CP@" +_CPIO="@CPIO@" _DIRNAME="@DIRNAME@" _EGREP="@EGREP@" _ENV="@ENV@" +_FILE="@FILE@" _GREP="@GREP@" +_GZIP="@GZIP@" _IP="@IP@" _IPTABLES="@IPTABLES@" _LN="@LN@" @@ -118,6 +123,7 @@ _MV="@MV@" _NAMEIF="@NAMEIF@" _NICE="@NICE@" _NOHUP="@NOHUP@" +_RESTORE="@RESTORE@" _RM="@RM@" _RMDIR="@RMDIR@" _RMMOD="@RMMOD@" diff --git a/scripts/vserver-build b/scripts/vserver-build index 41fe0b7..e184deb 100755 --- a/scripts/vserver-build +++ b/scripts/vserver-build @@ -66,6 +66,8 @@ Possible methods are: configuration file and calls an optional command then debootstrap ... -- -d [-m ] [-s