X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fconfig%2Fhooks%2Finstsoft.GRML;fp=etc%2Fgrml%2Ffai%2Fconfig%2Fhooks%2Finstsoft.GRML;h=6f7cf08e2d8334548b5b8570c75b012da02641e1;hb=cdd808cce09a6503af46053ff59e2e54dfaaf036;hp=0132f265708de9a7405e8bcf4fe78b0f2e603c9f;hpb=8dfcd204e18d0a36b0f75cf622c24ad447e9ca1f;p=grml-live.git diff --git a/etc/grml/fai/config/hooks/instsoft.GRML b/etc/grml/fai/config/hooks/instsoft.GRML index 0132f26..6f7cf08 100755 --- a/etc/grml/fai/config/hooks/instsoft.GRML +++ b/etc/grml/fai/config/hooks/instsoft.GRML @@ -1,10 +1,11 @@ #!/bin/sh +set -u +set -e + # make sure we have file-rc available before # package_config/GRML is being executed: -if [ -z "$target" ] ; then - echo "Fatal: $target unset for $0 - can not continue therefore." - exit 1 -fi + +# TODO: test whether adding file-rc to FAI_DEBOOTSTRAP_OPTS= would do the trick too # work around http://trac.lighttpd.net/trac/ticket/657: echo "Acquire::http::Pipeline-Depth "0";" >> $target/etc/apt/apt.conf @@ -12,26 +13,26 @@ echo "Acquire::http::Pipeline-Depth "0";" >> $target/etc/apt/apt.conf # install grml keys: gpg --keyserver subkeys.pgp.net --recv-keys F61E2E7CECDEA787 gpg --export F61E2E7CECDEA787 > $target/etc/apt/grml.key -chroot $target apt-key add /etc/apt/grml.key +$ROOTCMD apt-key add /etc/apt/grml.key # finally install file-rc: -chroot $target apt-get update -chroot $target apt-get --download-only --assume-yes install file-rc -chroot $target /bin/sh -c "dpkg -i --force-all /var/cache/apt/archives/file-rc*.deb" -chroot $target apt-get -f install file-rc +$ROOTCMD apt-get update +$ROOTCMD apt-get --download-only --assume-yes install file-rc +$ROOTCMD /bin/sh -c "dpkg -i --force-all /var/cache/apt/archives/file-rc*.deb" +$ROOTCMD apt-get -f install file-rc # we don't need the invoke-rc.d and update-rc.d diversion # because otherwise use of file-rc with aptitude fails: if [ -L "$target"/usr/sbin/invoke-rc.d ] ; then rm -f "$target"/usr/sbin/invoke-rc.d - chroot $target dpkg-divert --package fai --rename --remove /usr/sbin/invoke-rc.d + $ROOTCMD dpkg-divert --package fai --rename --remove /usr/sbin/invoke-rc.d fi if [ -L "$target"/usr/sbin/update-rc.d ] ; then dpkg --purge sysv-rc - chroot $target apt-get --assume-yes --reinstall install file-rc + $ROOTCMD apt-get --assume-yes --reinstall install file-rc fi # debug: -# chroot $target /bin/bash +# $ROOTCMD /bin/bash # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3