Initial configuration for FAI (work in progress)
[grml-live.git] / etc / grml / fai / config / hooks / instsoft.GRML
1 #!/bin/sh
2 # make sure we have file-rc available before
3 # package_config/GRML is being executed:
4 if [ -z "$target" ] ; then
5         echo "Fatal: $target unset for $0 - can not continue therefore."
6         exit 1
7 fi
8
9 # work around http://trac.lighttpd.net/trac/ticket/657:
10 echo "Acquire::http::Pipeline-Depth "0";" >> $target/etc/apt/apt.conf
11
12 # install grml keys:
13 gpg --keyserver subkeys.pgp.net --recv-keys F61E2E7CECDEA787
14 gpg --export F61E2E7CECDEA787 > $target/etc/apt/grml.key
15 chroot $target apt-key add /etc/apt/grml.key
16
17 # finally install file-rc:
18 chroot $target apt-get update
19 chroot $target apt-get --download-only --assume-yes install file-rc
20 chroot $target /bin/sh -c "dpkg -i --force-all /var/cache/apt/archives/file-rc*.deb"
21 chroot $target apt-get -f install file-rc
22
23 # we don't need the invoke-rc.d and update-rc.d diversion
24 # because otherwise use of file-rc with aptitude fails:
25 if [ -L "$target"/usr/sbin/invoke-rc.d ] ; then
26    rm -f "$target"/usr/sbin/invoke-rc.d
27    chroot $target dpkg-divert --package fai --rename --remove /usr/sbin/invoke-rc.d
28 fi
29 if [ -L "$target"/usr/sbin/update-rc.d ] ; then
30    dpkg --purge sysv-rc
31    chroot $target apt-get --assume-yes --reinstall install file-rc
32 fi
33
34 # debug:
35 # chroot $target /bin/bash
36
37 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3