X-Git-Url: http://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=scripts%2F02_chroot.sh;fp=scripts%2F02_chroot.sh;h=fe2f84a60f1094fbc294b95f4d613ca4a554ba69;hp=0000000000000000000000000000000000000000;hb=46e3a2d278bc75b91f6a5eae3fbdedae02441d64;hpb=9dc51d74f26d10d61130c86a0f3369c3f65970b7 diff --git a/scripts/02_chroot.sh b/scripts/02_chroot.sh new file mode 100644 index 0000000..fe2f84a --- /dev/null +++ b/scripts/02_chroot.sh @@ -0,0 +1,62 @@ +# Filename: 02_chroot.sh +# Purpose: build script for creating grml live-cd +# Authors: grml-team (grml.org), (c) Michael Prokop +# Bug-Reports: see http://grml.org/bugs/ +# License: This file is licensed under the GPL v2. +# Latest change: Tue Feb 13 00:16:27 CET 2007 +################################################################################ + +chroot_shell() { + chroot "$TARGET" /bin/bash +} + +chroot_exec() { + chroot "$TARGET" /usr/bin/env -i HOME="/root" PATH="/usr/sbin:/usr/bin:/sbin:/bin" TERM="${TERM}" \ + DEBIAN_FRONTEND="${DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${DEBCONF_PRIORITY}" ${1} + return $? +} + +patch_chroot() { + case "${1}" in + + apply) + debug "executing patch_chroot in apply mode" + echo "grml-live" > "${TARGET}"/etc/debian_chroot + [ -f "${TARGET}"/etc/hosts ] && cp "${TARGET}"/etc/hosts "$TARGET"/etc/hosts.orig + [ -f /etc/hosts ] && cp /etc/hosts "$TARGET"/etc/hosts + [ -f "${TARGET}"/etc/resolv.conf ] && cp "${TARGET}"/etc/resolv.conf "$TARGET"/etc/resolv.conf.orig + [ -f /etc/resolv.conf ] && cp /etc/resolv.conf "$TARGET"/etc/resolv.conf + # TODO: make sure to fix setup of grml-policy.rc.d + cat > "${TARGET}"/usr/sbin/policy-rc.d <