home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / linux / puppy-barebones-2.01r2.iso / pup_201.sfs / usr / sbin / delayedrun < prev    next >
Encoding:
Text File  |  2006-06-10  |  1.3 KB  |  37 lines

  1. #!/bin/sh
  2.  
  3. PUPMODE=2
  4. [ -f /etc/rc.d/PUPMODE ] && PUPMODE=`cat /etc/rc.d/PUPMODE`
  5.  
  6. #v2.0.0
  7. #have avoided loading usb-storage module unless really needed. partly because it
  8. #slows down bootup. well, load it now... not in rc.local0, too soon...
  9. #not sure, but may be conflict if X accesses
  10. #   usb keyboard/mouse while usb-storage is loading. so, doing this in ~/.xinitrc,
  11. #   which calls /usr/sbin/delayedrun
  12.  
  13. sleep 3 #let the dust settle first.
  14.  
  15. #k2.6 module is usb-storage.ko but lsmod shows it as usb_storage!!!...
  16. if [ "`lsmod | grep --extended-regexp '^usb\-storage|^usb_storage'`" = "" ];then
  17.  modprobe usb-storage &
  18.  #...can take 5 seconds for usb2, 25 secs for usb1, but assume nothing accesses within this.
  19. fi
  20.  
  21.  
  22. #on very 1st boot, PUPMODE=5, put up a welcome box... (handle Xvesa in video-wizard)
  23. if [ "`readlink /usr/X11R6/bin/X`" = "Xorg" ];then
  24.  if [ $PUPMODE -eq 5 ];then
  25.   #rc.modules should have detected sound, loaded module, written to /etc/modprobe.conf.
  26.   #rc.local0 executes rc.alsa to start sound. now bark...
  27.   if [ ! "`grep 'alias snd\-card\-0' /etc/modprobe.conf`" = "" ];then
  28.    aplay /usr/share/audio/2barks.au &
  29.    #PIDAPLAY=$!
  30.   fi
  31.   dillo --rcfile /etc/welcomedillorc file:///usr/share/doc/welcome1stboot.htm
  32.   #kill $PIDAPLAY 2> /dev/null
  33.   killall aplay 2> /dev/null
  34.   #...one laptop has bug, aplay barks forever, so kill it.
  35.  fi
  36. fi
  37.