2 # Filename: /etc/grml/fai/config/hooks/updatebase.GRMLBASE
3 # Purpose: Updates the base packages of the system, prepare chroot for instsoft
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2 or any later version.
7 ################################################################################
12 # visualize chroot inside zsh:
13 echo grml_chroot > $target/etc/debian_chroot
16 [ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
17 [ -r /etc/grml/grml-live.local ] && . /etc/grml/grml-live.local
18 [ -n "$HOSTNAME" ] || HOSTNAME=grml
19 echo "$HOSTNAME" > $target/etc/hostname
21 if [ "$FAI_ACTION" = "softupdate" ] ; then
22 echo "Action $FAI_ACTION of FAI (hooks/updatebase.GRMLBASE) via grml-live running"
24 ## we want to use our own sources.list:
27 ## taken from FAI's lib/updatebase:
28 # some packages must access /proc even in chroot environment
29 mount -t proc proc $FAI_ROOT/proc
30 # some packages must access /sys even in chroot environment
31 mount -t sysfs sysfs $FAI_ROOT/sys
32 # if we are using udev, also mount it into $FAI_ROOT
33 [ -f /etc/init.d/udev ] && mount --bind /dev $FAI_ROOT/dev
34 mount -t devpts devpts $FAI_ROOT/dev/pts
36 ## make sure we don't start any daemons - removed
37 ## later on via /etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot
38 if ! [ -r $target/usr/sbin/policy-rc.d ] ; then
39 cat > $target/usr/sbin/policy-rc.d << EOF
41 # FAI_ACTION=updatebase
44 chmod 755 $target/usr/sbin/policy-rc.d
47 # skip the task if we want to build a new ISO only:
48 [ -n "$BUILD_ONLY" ] && skiptask instsoft || /bin/true
50 exit # make sure we don't continue behind the following "fi"
53 # no softupdate but updating chroot e.g. based on /etc/grml/fai/config/basefiles/*
54 echo "Action $FAI_ACTION of FAI (hooks/updatebase.GRMLBASE) via grml-live running"
56 # install all apt related files
59 # remove grml-live's notice file from chroot:
60 if [ -r $target/etc/apt/important_note.txt ] ; then
61 grep -q GRML_LIVE_SOURCES $target/etc/apt/important_note.txt && rm $target/etc/apt/important_note.txt
64 # install grml gpg key:
65 fcopy /etc/apt/grml.key
66 $ROOTCMD apt-key add /etc/apt/grml.key
68 ## END OF FILE #################################################################
69 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3