From c1d7156a4938b475c90f053a223a298aed702485 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 12 Jan 2006 22:51:31 +0000 Subject: [PATCH] - do few nice things like poldek.conf symlink and kill agetty respawns in inittab Changed files: util-vserver-initpost.sh -> 1.1 --- util-vserver-initpost.sh | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 util-vserver-initpost.sh diff --git a/util-vserver-initpost.sh b/util-vserver-initpost.sh new file mode 100644 index 0000000..ad53e2c --- /dev/null +++ b/util-vserver-initpost.sh @@ -0,0 +1,49 @@ +#! /bin/bash + +# Copyright (C) 2005 Enrico Scholz +# +# 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 + +vdir=$1/vdir +cfgdir=$1 +. "$2" + +## Usage: subst +function subst +{ + tmp=$(mktemp /tmp/initpost-subst.XXXXXX) + + case "$1" in + (/*|./*) cat "$1";; + (*) $_CHROOT_SH cat "$1";; + esac | sed -e "$2" >$tmp + cmp -s $tmp "$1" || $_CHROOT_SH truncate "$1" <$tmp + + rm -f $tmp +} + +pushd "$cfgdir" &>/dev/null + # make convinient poldek.conf symlink + ln -s apps/pkgmgmt/base/poldek/etc/poldek.conf poldek.conf +popd >/dev/null + +pushd "$vdir" &>/dev/null + # for future. right now SysVinit is not created at build stage + if [ -f etc/inittab ]; then + # disable mingetty respawn + subst etc/inittab 's!^\([^#].*:respawn:.* tty\)!#\1!' + fi +popd >/dev/null -- 2.44.0