home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / src / linux-headers-2.6.17-6 / debian / examples / sample.force-build-link.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2006-03-22  |  1.1 KB  |  39 lines

  1. #!/bin/sh
  2. #                               -*- Mode: Sh -*- 
  3. # sample.force-build-link.sh --- 
  4. # Author           : Manoj Srivastava ( srivasta@glaurung.internal.golden-gryphon.com ) 
  5. # Created On       : Wed Mar 22 08:07:21 2006
  6. # Created On Node  : glaurung.internal.golden-gryphon.com
  7. # Last Modified By : Manoj Srivastava
  8. # Last Modified On : Wed Mar 22 08:14:10 2006
  9. # Last Machine Used: glaurung.internal.golden-gryphon.com
  10. # Update Count     : 4
  11. # Status           : Unknown, Use with caution!
  12. # HISTORY          : 
  13. # Description      : 
  14. #
  15. # This is an example of a script that can be run as a postinst hook,
  16. # and forces the build link to point to a headers directory, even if
  17. # the source dir is present.
  18. # arch-tag: ca36fde4-759d-4f96-8d03-aeea4fd24f99
  19.  
  20. set -e
  21.  
  22.  
  23. VERSION=$1
  24. KERNELDIR=$2
  25.  
  26. MODULEDIR=/lib/modules/$VERSION
  27. HEADERDIR=/usr/src/linux-headers-$VERSION
  28.  
  29. # exit silently if there is no module dir
  30. test -d $MODULEDIR || exit 0
  31. test -d $HEADERDIR || exit 0
  32.  
  33. # update build link -- by first deleting whatever is there
  34. test ! -e $MODULEDIR/build || rm -f $MODULEDIR/build
  35. # and then creating a new one
  36. ln -sf $HEADERDIR $MODULEDIR/build
  37.