1 # Filename: 02_chroot.sh
2 # Purpose: build script for creating grml live-cd
3 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
4 # Bug-Reports: see http://grml.org/bugs/
5 # License: This file is licensed under the GPL v2.
6 # Latest change: Tue Feb 13 00:16:27 CET 2007
7 ################################################################################
10 chroot "$TARGET" /bin/bash
14 chroot "$TARGET" /usr/bin/env -i HOME="/root" PATH="/usr/sbin:/usr/bin:/sbin:/bin" TERM="${TERM}" \
15 DEBIAN_FRONTEND="${DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${DEBCONF_PRIORITY}" ${1}
23 debug "executing patch_chroot in apply mode"
24 echo "grml-live" > "${TARGET}"/etc/debian_chroot
25 [ -f "${TARGET}"/etc/hosts ] && cp "${TARGET}"/etc/hosts "$TARGET"/etc/hosts.orig
26 [ -f /etc/hosts ] && cp /etc/hosts "$TARGET"/etc/hosts
27 [ -f "${TARGET}"/etc/resolv.conf ] && cp "${TARGET}"/etc/resolv.conf "$TARGET"/etc/resolv.conf.orig
28 [ -f /etc/resolv.conf ] && cp /etc/resolv.conf "$TARGET"/etc/resolv.conf
29 # TODO: make sure to fix setup of grml-policy.rc.d
30 cat > "${TARGET}"/usr/sbin/policy-rc.d <<EOF
33 echo "Information: policy-rc.d in action."
36 chmod 755 "${TARGET}"/usr/sbin/policy-rc.d
40 debug "executing patch_chroot in deapply mode"
41 rm -f "${TARGET}"/etc/debian_chroot
43 if [ -f "${TARGET}"/etc/hosts.orig ] ; then
44 mv "${TARGET}"/etc/hosts.orig "$TARGET"/etc/hosts
46 rm -f "$TARGET"/etc/hosts
49 # TODO: adjust for grml-policy.rc.d
50 if [ -f "${TARGET}"/etc/resolv.conf.orig ] ; then
51 mv "${TARGET}"/etc/resolv.conf.orig "$TARGET"/etc/resolv.conf
53 rm -f "$TARGET"/etc/resolv.conf
56 rm -f "${TARGET}"/usr/sbin/policy-rc.d
61 ## END OF FILE #################################################################
62 # vim: ai tw=80 ft=sh expandtab