X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=old%2Fscripts%2F02_chroot.sh;fp=old%2Fscripts%2F02_chroot.sh;h=d22d675b8522b0a5ba0a05e8ebb34439bad89e5a;hb=1a06f3f65adef0fdd432aad11f479020630778a5;hp=0000000000000000000000000000000000000000;hpb=3ce5c1d60539aa8d2a01a810aa92325f8c513696;p=grml-live.git diff --git a/old/scripts/02_chroot.sh b/old/scripts/02_chroot.sh new file mode 100644 index 0000000..d22d675 --- /dev/null +++ b/old/scripts/02_chroot.sh @@ -0,0 +1,90 @@ +# 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:37:19 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 < "${TARGET}"/grml-live/files/sources.list + fi + + cat > "${TARGET}"/grml-live/scripts/install_packages.sh << EOF +#!/bin/sh + +if ! [ -f /etc/apt/grml.key ] ; then + gpg --keyserver subkeys.pgp.net --recv-keys F61E2E7CECDEA787 + gpg --export F61E2E7CECDEA787 > /etc/apt/grml.key + apt-key add /etc/apt/grml.key +fi + +apt-get update +apt-get upgrade + +EOF + + chmod 755 "${TARGET}"/grml-live/scripts/install_packages.sh +} + +chroot_live_execute() { + debug "executing grml-live script in chroot" + chroot_exec /grml-live/scripts/install_packages.sh +} + +## END OF FILE ################################################################# +# vim: ai tw=80 ft=sh expandtab