2 # Filename: ${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 [ -n "${APT_PROXY:-}" ] ; then
22 cat > $target/etc/apt/apt.conf.d/90grml-apt-proxy.conf <<EOF
23 Acquire::http { Proxy "$APT_PROXY"; };
27 if [ "$FAI_ACTION" = "softupdate" ] ; then
28 echo "Action $FAI_ACTION of FAI (hooks/updatebase.GRMLBASE) via grml-live running"
30 ## we want to use our own sources.list:
33 ## based on FAI's lib/updatebase:
34 # some packages must access /proc even in chroot environment
35 if ! [ -d $FAI_ROOT/proc/1 ] ; then
36 mount -t proc proc $FAI_ROOT/proc || true
38 # some packages must access /sys even in chroot environment
39 if ! [ -d $FAI_ROOT/sys/kernel ] ; then
40 mount -t sysfs sysfs $FAI_ROOT/sys
42 # if we are using udev, also mount it into $FAI_ROOT
43 if [ -f /etc/init.d/udev ] ; then
44 mount --bind /dev $FAI_ROOT/dev || true
47 mount -t devpts devpts $FAI_ROOT/dev/pts || true
49 # skip the task if we want to build a new ISO only,
50 # this means we do NOT update any packages
51 if [ -n "$BUILD_ONLY" ] ; then
52 skiptask instsoft || true
55 exit # make sure we don't continue behind the following "fi"
58 if [ -n "$BOOTSTRAP_ONLY" ] ; then
59 echo "Skipping task configure in hooks/updatebase.GRMLBASE as BOOTSTRAP_ONLY environment is set."
63 # no softupdate but updating chroot e.g. based on ${GRML_FAI_CONFIG}/basefiles/*
64 echo "Action $FAI_ACTION of FAI (hooks/updatebase.GRMLBASE) via grml-live running"
66 # work around #632624: udev fails to install on systems with old kernel versions
67 if ! [ -e ${target}/etc/udev/kernel-upgrade ] ; then
68 echo "Working around udev package bug, creating /etc/udev/kernel-upgrade"
69 echo "# installed via updatebase.GRMLBASE" > ${target}/etc/udev/kernel-upgrade
72 # install all apt related files
75 # install Grml gpg key:
76 $ROOTCMD apt-key add /etc/apt/grml.key
78 ## END OF FILE #################################################################
79 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2