From 11ac4be9eb01477570caae37e5f089a2bb736a39 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 8 Jul 2011 17:14:52 +0200 Subject: [PATCH] GRMLBASE/91-update-pciids: do not exit with error if network does not work If networking doesn't work inside the chroot just warn but do not error out, since this might break autobuilds. --- .../fai/config/scripts/GRMLBASE/91-update-pciids | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/etc/grml/fai/config/scripts/GRMLBASE/91-update-pciids b/etc/grml/fai/config/scripts/GRMLBASE/91-update-pciids index ecb5180..373e00f 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/91-update-pciids +++ b/etc/grml/fai/config/scripts/GRMLBASE/91-update-pciids @@ -12,7 +12,24 @@ if ifclass NO_ONLINE ; then fi set -u -set -e + +bailout() { + if [ "${1:-}" = "4" ] ; then + echo "Warning: freshclam returned with exit code 4." >&2 + + # be verbose in logs + echo "Warning: freshclam returned with exit code 4." + echo "-> This indicates that networking inside the chroot did not work" + echo " while GRMLBASE/91-update-pciids was running." + echo " To address this issue you can either configure /etc/resolv.conf" + echo " accordingly or just run dnsmasq on your host." + + exit 0 + fi + + exit "${1:-0}" +} + [ -x $target/usr/bin/timeout ] && TIMEOUT="10" || TIMEOUT="" @@ -24,8 +41,10 @@ fi echo "Updating PCI-IDs" if [ -n "$TIMEOUT" ] ; then $ROOTCMD timeout $TIMEOUT update-pciids + bailout $? else $ROOTCMD update-pciids + bailout $? fi ## END OF FILE ################################################################# -- 2.1.4