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 ## based on FAI's lib/updatebase:
28 # some packages must access /proc even in chroot environment
29 if ! [ -d $FAI_ROOT/proc/1 ] ; then
30 mount -t proc proc $FAI_ROOT/proc || true
32 # some packages must access /sys even in chroot environment
33 if ! [ -d $FAI_ROOT/sys/kernel ] ; then
34 mount -t sysfs sysfs $FAI_ROOT/sys
36 # if we are using udev, also mount it into $FAI_ROOT
37 if [ -f /etc/init.d/udev ] ; then
38 mount --bind /dev $FAI_ROOT/dev || true
41 mount -t devpts devpts $FAI_ROOT/dev/pts || true
43 # skip the task if we want to build a new ISO only,
44 # this means we do NOT update any packages
45 if [ -n "$BUILD_ONLY" ] ; then
46 skiptask instsoft || true
49 exit # make sure we don't continue behind the following "fi"
52 # no softupdate but updating chroot e.g. based on /etc/grml/fai/config/basefiles/*
53 echo "Action $FAI_ACTION of FAI (hooks/updatebase.GRMLBASE) via grml-live running"
55 # install all apt related files
58 # remove grml-live's notice file from chroot:
59 if [ -r $target/etc/apt/important_note.txt ] ; then
60 grep -q GRML_LIVE_SOURCES $target/etc/apt/important_note.txt && rm $target/etc/apt/important_note.txt
63 # install grml gpg key:
64 fcopy /etc/apt/grml.key
65 $ROOTCMD apt-key add /etc/apt/grml.key
67 ## END OF FILE #################################################################
68 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3