OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.3 KiB

  1. #!/bin/sh
  2. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # Filename: package/.../udev/scripts/load_floppy_module.sh
  6. # Copyright (C) 2006 The OpenSDE Project
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; version 2 of the License. A copy of the
  13. # GNU General Public License can be found in the file COPYING.
  14. # --- SDE-COPYRIGHT-NOTE-END ---
  15. ########################################################################
  16. #
  17. # Description : load_floppy_module
  18. #
  19. # Authors : Based on Open Suse Udev Rules
  20. # kay.sievers@suse.de
  21. #
  22. # Adapted to : Jim Gifford
  23. # LFS
  24. #
  25. # Version : 00.00
  26. #
  27. # Notes : Loads the floppy module based upon contents of the NVRAM
  28. #
  29. ########################################################################
  30. PROC=/proc/driver/nvram
  31. # wait for /proc file to appear
  32. loop=10
  33. while ! test -e $PROC; do
  34. sleep 0.1;
  35. test "$loop" -gt 0 || break
  36. loop=$(($loop - 1))
  37. done
  38. if [ ! -r /proc/driver/nvram ]; then
  39. exit 0;
  40. fi
  41. floppy_devices=$(cat $PROC | sed -n '/Floppy.*\..*/p')
  42. if [ -n "$floppy_devices" ]; then
  43. /sbin/modprobe block-major-2
  44. else
  45. /bin/true
  46. fi
  47. exit $?