#!/bin/sh

function has_keyboard {
  if [ ! "$kbd_ok" ] ; then
    hwinfo --keyboard | grep -q keyboard
    kbd_ok=$?
  fi
  return $kbd_ok
}

kbd_ok=

rm -f /var/lib/hardware/LOCK

arch=`uname -m`

if [ "$arch" = s390 -o "$arch" = s390x ] ; then

  /usr/sbin/hwscan --silent --boot --fast --block

else

  neededchanged=`/usr/sbin/hwscan --boot --gfxcard`
  if [ -n "$neededchanged" ] ; then
    has_keyboard && /sbin/yast2 x11 reprobe
  fi

  /usr/sbin/hwscan --silent --boot --fast --isapnp --pci --block --floppy --mouse

fi

#
# create icons for static drives
#
if [ -e /etc/hotplug/hotplug.subfs.functions ]; then
  . /etc/hotplug/hotplug.subfs.functions
  coldplug_create_subfs
fi

exit 0
