Make all shell scripts using /bin/bash instead /bin/sh to be able to FAI's environment.
[grml-live.git] / etc / grml / fai / config / hooks / updatebase.GRMLBASE
1 #!/bin/bash
2 # Filename:      /etc/grml/fai/config/hooks/updatebase.GRMLBASE
3 # Purpose:       skip task updatebase of FAI when running softupdate
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 if [ "$FAI_ACTION" = "softupdate" ] ; then
10
11    ## we want to use our own sources.list:
12    skiptask updatebase
13
14    ## make sure we don't start any daemons - removed
15    ## later on via /etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot
16    if ! [ -r $target/usr/sbin/policy-rc.d ] ; then
17       cat > $target/usr/sbin/policy-rc.d << EOF
18 #!/bin/sh
19 # FAI_ACTION=updatebase
20 exit 101
21 EOF
22       chmod 755 $target/usr/sbin/policy-rc.d
23    fi
24
25    # skip the task if we want to build a new ISO only:
26    [ -n "$BUILD_ONLY" ] && skiptask instsoft || /bin/true
27
28 else # no softupdate but updating chroot based on /etc/grml/fai/config/basefiles/*
29
30 # install all apt related files
31 fcopy -r /etc/apt
32
33 # remove grml-live's notice file from chroot:
34 if [ -r $target/etc/apt/important_note.txt ] ; then
35    grep -q GRML_LIVE_SOURCES $target/etc/apt/important_note.txt && rm $target/etc/apt/important_note.txt
36 fi
37
38 # install grml gpg key:
39 fcopy /etc/apt/grml.key
40 $ROOTCMD apt-key add /etc/apt/grml.key
41
42 fi # softupdate check
43
44 ## END OF FILE #################################################################
45 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3