From: Benedikt Boehm Date: Fri, 13 Apr 2007 09:02:29 +0000 (+0000) Subject: add build scripts for debian etch X-Git-Tag: release-0.30.214~77 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb89e96d574857bfdd1bb79c22889ef706d0be81;p=util-vserver.git add build scripts for debian etch git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2528 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/distrib/Makefile.am b/distrib/Makefile.am index abef012..ba62496 100644 --- a/distrib/Makefile.am +++ b/distrib/Makefile.am @@ -21,7 +21,8 @@ distribdir = $(pkglibdir)/distributions confdistribdir = $(confdir)/.distributions confdefaultsdir = $(confdir)/.defaults -defaults_DATA = misc/debootstrap.uri \ +defaults_DATA = misc/debootstrap.mirror \ + misc/debootstrap.uri \ misc/fstab \ misc/mtab \ misc/vprocunhide-files \ @@ -33,7 +34,8 @@ nobase_distrib_SCRIPTS = redhat/initpost \ redhat/initpre \ redhat/rc.sysinit \ gentoo/initpost \ - gentoo/initpre + gentoo/initpre \ + etch/initpost nobase_distrib_DATA = defaults/devs \ defaults/apt.conf \ @@ -60,7 +62,8 @@ nobase_distrib_DATA = defaults/devs \ suse91/apt/rpmpriorities suse91/pkgs/01 suse91/pkgs/02 \ suse91/rpm/macros \ gentoo/init-vserver.sh gentoo/net.vserver \ - gentoo/reboot.sh gentoo/shutdown.sh + gentoo/reboot.sh gentoo/shutdown.sh \ + etch/vserver-config.sh nobase_confdistrib_DATA = rh9/apt/sources.list \ fc1/apt/sources.list \ diff --git a/distrib/etch/initpost b/distrib/etch/initpost new file mode 100755 index 0000000..bd6e698 --- /dev/null +++ b/distrib/etch/initpost @@ -0,0 +1,130 @@ +#!/bin/bash + +# Copyright (C) 2006 Benedikt Boehm +# +# 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 +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +## Called as: initpost + +# setup environment +cfgdir="$1" +vdir="$cfgdir"/vdir +. "$2" + + +# vserver name +NAME=$(< "$cfgdir"/name) + +# debian mirror +MIRROR=$3 + +# debian distribution +DIST="etch" + + +# go to vdir for chroot-sh +pushd "$vdir" &>/dev/null + + +# helper for sed in chroot +chrootsed() { + local file="$1" + shift + + sedtmp=$($_MKTEMP chrootsed.XXXXXX) + + $_CHROOT_SH cat "$file" | $_SED "$@" > $sedtmp + $_CHROOT_SH truncate "$file" < $sedtmp + + $_RM -f $sedtmp +} + + +# create a locale.gen if needed. +if test -n "$LANG" && test "$LANG" != "C"; then + echo $LANG $(locale charmap) | $_CHROOT_SH append /etc/locale.gen +fi + + +# make apt and friends work +$_CHROOT_SH truncate /etc/apt/sources.list <>> Executing post install script ... " +echo + +# start vserver before we can exec anything inside it +vserver $NAME start + +# run the configure commands from within the server +vserver $NAME exec /vserver-config.sh +$_CHROOT_SH rm /vserver-config.sh + +# stop the vserver +vserver $NAME stop + +popd &>/dev/null diff --git a/distrib/etch/vserver-config.sh b/distrib/etch/vserver-config.sh new file mode 100755 index 0000000..970d3f1 --- /dev/null +++ b/distrib/etch/vserver-config.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +REMOVE_LINKS=" +bootlogd +checkfs +checkroot +halt +hwclock.sh +ifupdown +klogd +libdevmapper1.02 +makedev +module-init-tools +mountall.sh +mountdevsubfs.sh +mountnfs.sh +mountkernfs.sh +mountvirtfs +networking +reboot +setserial +single +stop-bootlogd +stop-bootlogd-single +umountfs +umountnfs.sh +umountroot +urandom +" + +test -x /usr/sbin/tzconfig && /usr/sbin/tzconfig + +aptitude update +LANG=C aptitude install locales + +test -x /usr/sbin/locale-gen && /usr/sbin/locale-gen + +dpkg-reconfigure passwd +tasksel + +for link in $REMOVE_LINKS; do + update-rc.d -f $link remove +done + diff --git a/distrib/misc/debootstrap.mirror b/distrib/misc/debootstrap.mirror new file mode 100644 index 0000000..04ed33b --- /dev/null +++ b/distrib/misc/debootstrap.mirror @@ -0,0 +1 @@ +http://ftp.debian.org/debian diff --git a/scripts/vserver-build.debootstrap b/scripts/vserver-build.debootstrap index 694fa11..eedc520 100644 --- a/scripts/vserver-build.debootstrap +++ b/scripts/vserver-build.debootstrap @@ -25,9 +25,9 @@ function initVariables { base.init - test -n "${mirror-unset}" || { + test -n "${mirror}" || { local aux - findFile aux "$__CONFDIR"/.defaults/apps/debootstrap/mirror '' + findFile aux "$__CONFDIR"/.defaults/apps/debootstrap/mirror "$__PKGLIBDEFAULTDIR"/debootstrap.mirror test -z "$aux" || read mirror <"$aux" } } @@ -146,11 +146,11 @@ setup_writeInitialFstab findDebootstrap -test -z "$BUILD_INITPRE" || "$BUILD_INITPRE" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS" +test -z "$BUILD_INITPRE" || "$BUILD_INITPRE" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS" "$mirror" mv "$VDIR"/dev "$VDIR"/dev.X "$_VNAMESPACE" --new -- "$DEBOOTSTRAP" "$@" "$DISTRIBUTION" "$VDIR" "$mirror" "$script" || : ## HACK: ignore all errors... fixupDebian "$VDIR" -test -z "$BUILD_INITPOST" || "$BUILD_INITPOST" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS" +test -z "$BUILD_INITPOST" || "$BUILD_INITPOST" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS" "$mirror" $_RM -fr "$workdir" base.setSuccess