X-Git-Url: http://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fconfig%2Fscripts%2FGRMLBASE%2F91-update-pciids;h=039c4232c5dfbf10dbe4a3401004c0fc6f6e1a6d;hp=03c674cf2dd613c6230253681ede7f16d4b149de;hb=3ddb9371241898bd0c1f203a8bec078e07d5ebd6;hpb=f3b335ea5c94d5cf24ec6b9184106b298849f311 diff --git a/etc/grml/fai/config/scripts/GRMLBASE/91-update-pciids b/etc/grml/fai/config/scripts/GRMLBASE/91-update-pciids index 03c674c..039c423 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/91-update-pciids +++ b/etc/grml/fai/config/scripts/GRMLBASE/91-update-pciids @@ -12,21 +12,39 @@ if ifclass NO_ONLINE ; then fi set -u -set -e + +bailout() { + if [ "${1:-}" = "4" ] ; then + echo "Warning: update-pciids returned with exit code 4." >&2 + + # be verbose in logs + echo "Warning: update-pciids 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="" -if ! [ -x $target/usr/bin/update-pciids ] ; then - echo "Warning: update-pciids/update-usbids not installed" +if ! [ -x "${target}/usr/sbin/update-pciids" ] && ! [ -x "${target}/usr/bin/update-pciids" ] ; then + echo "Warning: update-pciids not installed (neither /usr/sbin/update-pciids nor /usr/bin/update-pciids exists" + exit 0 +fi + +echo "Updating PCI-IDs" +if [ -n "$TIMEOUT" ] ; then + $ROOTCMD timeout $TIMEOUT update-pciids + bailout $? else - echo "Updating PCI- and USB-ids" - if [ -n "$TIMEOUT" ] ; then - $ROOTCMD timeout $TIMEOUT update-pciids - $ROOTCMD timeout $TIMEOUT update-usbids - else - $ROOTCMD update-pciids - $ROOTCMD update-usbids - fi + $ROOTCMD update-pciids + bailout $? fi ## END OF FILE #################################################################