SOURCES: util-vserver-initpost.sh (NEW) - do few nice things like ...
glen
glen at pld-linux.org
Thu Jan 12 23:51:36 CET 2006
Author: glen Date: Thu Jan 12 22:51:36 2006 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- do few nice things like poldek.conf symlink and kill agetty respawns in inittab
---- Files affected:
SOURCES:
util-vserver-initpost.sh (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/util-vserver-initpost.sh
diff -u /dev/null SOURCES/util-vserver-initpost.sh:1.1
--- /dev/null Thu Jan 12 23:51:36 2006
+++ SOURCES/util-vserver-initpost.sh Thu Jan 12 23:51:31 2006
@@ -0,0 +1,49 @@
+#! /bin/bash
+
+# Copyright (C) 2005 Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de>
+#
+# 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 <cfgdir> <path of util-vserver-vars>
+
+vdir=$1/vdir
+cfgdir=$1
+. "$2"
+
+## Usage: subst <file> <regexp>
+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
================================================================
More information about the pld-cvs-commit
mailing list