From 0811b5f680d60f72012b58ed19e4c79f205c2e43 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 27 Jun 2011 14:52:46 +0200 Subject: [PATCH] Provide update-usbids as separate script to avoid errors on missing update-usbids. --- .../fai/config/scripts/GRMLBASE/91-update-pciids | 17 ++++++------ .../fai/config/scripts/GRMLBASE/93-update-usbids | 32 ++++++++++++++++++++++ 2 files changed, 40 insertions(+), 9 deletions(-) create mode 100755 etc/grml/fai/config/scripts/GRMLBASE/93-update-usbids diff --git a/etc/grml/fai/config/scripts/GRMLBASE/91-update-pciids b/etc/grml/fai/config/scripts/GRMLBASE/91-update-pciids index 03c674c..ecb5180 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/91-update-pciids +++ b/etc/grml/fai/config/scripts/GRMLBASE/91-update-pciids @@ -17,16 +17,15 @@ set -e [ -x $target/usr/bin/timeout ] && TIMEOUT="10" || TIMEOUT="" if ! [ -x $target/usr/bin/update-pciids ] ; then - echo "Warning: update-pciids/update-usbids not installed" + echo "Warning: update-pciids not installed" + exit 0 +fi + +echo "Updating PCI-IDs" +if [ -n "$TIMEOUT" ] ; then + $ROOTCMD timeout $TIMEOUT update-pciids 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 fi ## END OF FILE ################################################################# diff --git a/etc/grml/fai/config/scripts/GRMLBASE/93-update-usbids b/etc/grml/fai/config/scripts/GRMLBASE/93-update-usbids new file mode 100755 index 0000000..6fc4a73 --- /dev/null +++ b/etc/grml/fai/config/scripts/GRMLBASE/93-update-usbids @@ -0,0 +1,32 @@ +#!/bin/bash +# Filename: ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/93-update-usbids +# Purpose: update pciids +# Authors: (c) Michael Prokop +# Bug-Reports: see http://grml.org/bugs/ +# License: This file is licensed under the GPL v2. +################################################################################ + +if ifclass NO_ONLINE ; then + echo "Ignoring script 93-update-usbids as NO_ONLINE is set." + exit 0 +fi + +set -u +set -e + +[ -x $target/usr/bin/timeout ] && TIMEOUT="10" || TIMEOUT="" + +if ! [ -x $target/usr/bin/update-usbids ] ; then + echo "Warning: update-usbids not installed" + exit 0 +fi + +echo "Updating USB-IDs" +if [ -n "$TIMEOUT" ] ; then + $ROOTCMD timeout $TIMEOUT update-usbids +else + $ROOTCMD update-usbids +fi + +## END OF FILE ################################################################# +# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2 -- 2.1.4