Drop unnecessary policy-rc.d handler from hooks/updatebase.GRMLBASE and scripts/GRMLB...
[grml-live.git] / etc / grml / fai / config / hooks / updatebase.GRMLBASE
1 #!/bin/bash
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 ################################################################################
8
9 set -u
10 set -e
11
12 # visualize chroot inside zsh:
13 echo grml_chroot > $target/etc/debian_chroot
14
15 HOSTNAME=''
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
20
21 if [ "$FAI_ACTION" = "softupdate" ] ; then
22    echo "Action $FAI_ACTION of FAI (hooks/updatebase.GRMLBASE) via grml-live running"
23
24    ## we want to use our own sources.list:
25    skiptask updatebase
26
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
35
36    # skip the task if we want to build a new ISO only:
37    [ -n "$BUILD_ONLY" ] && skiptask instsoft || /bin/true
38
39    exit # make sure we don't continue behind the following "fi"
40 fi
41
42 # no softupdate but updating chroot e.g. based on /etc/grml/fai/config/basefiles/*
43 echo "Action $FAI_ACTION of FAI (hooks/updatebase.GRMLBASE) via grml-live running"
44
45 # install all apt related files
46 fcopy -r /etc/apt
47
48 # remove grml-live's notice file from chroot:
49 if [ -r $target/etc/apt/important_note.txt ] ; then
50    grep -q GRML_LIVE_SOURCES $target/etc/apt/important_note.txt && rm $target/etc/apt/important_note.txt
51 fi
52
53 # install grml gpg key:
54 fcopy /etc/apt/grml.key
55 $ROOTCMD apt-key add /etc/apt/grml.key
56
57 ## END OF FILE #################################################################
58 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3