2 # Filename: /etc/grml/fai/config/hooks/instsoft.GRML
3 # Purpose: grml specific Debian installation in the chroot
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 # Latest change: Mon Nov 05 22:48:02 CET 2007 [mika]
8 ################################################################################
13 # visualize chroot inside zsh:
14 echo grml_chroot > $target/etc/debian_chroot
16 if [ "$FAI_ACTION" = "softupdate" ] ; then
17 echo "Softupdate of FAI via grml-live running"
19 if [ -r /etc/resolv.conf ] ; then
20 if [ -r $target/etc/resolvconf/run/resolv.conf ] ; then
21 cat /etc/resolv.conf >> $target/etc/resolvconf/run/resolv.conf
23 cat /etc/resolv.conf >> $target/etc/resolv.conf
27 if [ -r $target/etc/policy-rc.d.conf ] ; then
28 sed -i "s/EXITSTATUS=.*/EXITSTATUS='101'/" $target/etc/policy-rc.d.conf
31 # make sure we prefer grml repository:
32 if [ -r /etc/grml/fai/apt/preferences ] ; then
33 cp /etc/grml/fai/apt/preferences $target/etc/apt/preferences
36 # we definitely don't want to fail running fai sofupdate just
37 # because of some well known bugs:
38 [ -d $target/etc/apt/apt.conf.d ] || mkdir $target/etc/apt/apt.conf.d
39 cat > $target/etc/apt/apt.conf.d/10apt-listbugs << EOF
40 // Check all packages whether they has critical bugs before they are installed.
41 // If you don't like it, comment it out.
42 //DPkg::Pre-Install-Pkgs {"/usr/sbin/apt-listbugs apt || exit 10"};
43 //DPkg::Tools::Options::/usr/sbin/apt-listbugs "";
44 //DPkg::Tools::Options::/usr/sbin/apt-listbugs::Version "2";
47 if [ -r /etc/grml/fai/apt/sources.list ] ; then
48 if [ -L $target/etc/apt/sources.list ] ; then
49 rm $target/etc/apt/sources.list
51 cp /etc/grml/fai/apt/sources.list $target/etc/apt/sources.list
54 # FAI softupdate does not execute upgrade, so let's do it on our own:
55 $ROOTCMD apt-get update
56 if [ -x $target/usr/bin/aptitude ] ; then
57 if strings $target/usr/bin/aptitude | grep safe-upgrade 1>/dev/null ; then
58 $ROOTCMD aptitude -y safe-upgrade
60 $ROOTCMD aptitude -y upgrade
63 $ROOTCMD apt-get -y upgrade
66 else # no softupdate but fresh installation
68 # work around http://trac.lighttpd.net/trac/ticket/657
69 # should be removed later on:
70 echo "Acquire::http::Pipeline-Depth "0"; // added by grml-live" >> $target/etc/apt/apt.conf
72 # Recommends just pull in way tooooo much packages, so disable it:
73 echo "APT::Install-Recommends "false"; // added by grml-live" >> $target/etc/apt/apt.conf
76 gpg --keyserver subkeys.pgp.net --recv-keys F61E2E7CECDEA787 || \
77 gpg --keyserver blackhole.pca.dfn.de --recv-keys F61E2E7CECDEA787
78 gpg --export F61E2E7CECDEA787 > $target/etc/apt/grml.key
79 $ROOTCMD apt-key add /etc/apt/grml.key
81 # make sure we prefer grml repository:
82 if [ -r /etc/grml/fai/files/etc/apt/preferences ] ; then
83 cp /etc/grml/fai/apt/preferences $target/etc/apt/preferences
86 # make sure we have file-rc available before
87 # package_config/GRML is being executed:
88 $ROOTCMD apt-get update
89 $ROOTCMD aptitude -f -y install file-rc
91 # Workaround #443481 of snort for Debian/etch:
92 mkdir -p $target/etc/snort
93 echo 'LOGDIR=/var/log/snort' >> $target/etc/snort/snort.common.parameters
95 # we definitely don't want to fail running fai dirinstall just
96 # because of some well known bugs:
97 [ -d $target/etc/apt/apt.conf.d ] || mkdir $target/etc/apt/apt.conf.d
98 cat > $target/etc/apt/apt.conf.d/10apt-listbugs << EOF
99 // Check all packages whether they has critical bugs before they are installed.
100 // If you don't like it, comment it out.
101 //DPkg::Pre-Install-Pkgs {"/usr/sbin/apt-listbugs apt || exit 10"};
102 //DPkg::Tools::Options::/usr/sbin/apt-listbugs "";
103 //DPkg::Tools::Options::/usr/sbin/apt-listbugs::Version "2";
106 # make sure /dev/MAKEDEV is available:
107 if [ -x "$target"/sbin/MAKEDEV ] && ! [ -r "$target"/dev/MAKEDEV ] ; then
108 ln -s /sbin/MAKEDEV "$target"/dev/MAKEDEV
111 # we don't need the invoke-rc.d.d diversion (we have grml-policyrcd :)):
112 if [ -L "$target"/usr/sbin/invoke-rc.d ] ; then
113 rm -f "$target"/usr/sbin/invoke-rc.d
114 $ROOTCMD dpkg-divert --package fai --rename --remove /usr/sbin/invoke-rc.d
117 fi # end of FAI_ACTION = softupdate
119 ## END OF FILE #################################################################
120 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3