home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 15 / boot-disc-1997-11.iso / Debian / Tools / resc1440.bin / INSTALL.SH < prev    next >
Linux/UNIX/POSIX Shell Script  |  1997-08-01  |  1KB  |  57 lines

  1. #!    /bin/sh
  2.  
  3. # Install the kernel from this boot floppy onto the root filesystem.
  4. # Don't run LILO, so the hard disk won't be bootable until more is done.
  5. # The commands used by this script are limited to the ones available on
  6. # the root floppy.
  7.  
  8. #set -x
  9. set -e
  10. umask 022
  11.  
  12. VERSION=2.0.29
  13.  
  14. extract="cpio --format=ustar --extract --unconditional"
  15. if [ -x /bin/star -o -x /usr/bin/star ]; then
  16.     extract="star"
  17. fi
  18.  
  19. if [ ! install.sh ]; then
  20.     echo     "Error: Change directory to the boot floppy before running this script."
  21.     1>&2
  22.     exit -1
  23. fi
  24.  
  25. FLOPPY=`pwd`
  26.  
  27. if [ $# -gt 0 ]; then
  28.     DESTDIR=$1
  29. fi
  30.  
  31. if [ ! -d ${DESTDIR}/boot ]; then
  32.     mkdir -m 2775 ${DESTDIR}/boot
  33. fi
  34.  
  35. cp linux ${DESTDIR}/boot/vmlinuz-${VERSION}
  36. rdev ${DESTDIR}/boot/vmlinuz-${VERSION} ${DESTDIR}
  37. rdev -r ${DESTDIR}/boot/vmlinuz-${VERSION} 0
  38. rdev -R ${DESTDIR}/boot/vmlinuz-${VERSION} 1
  39. rdev -v ${DESTDIR}/boot/vmlinuz-${VERSION} -1
  40. if [ -f sys_map.gz ]; then
  41.     zcat < sys_map.gz > ${DESTDIR}/boot/System.map-${VERSION}
  42. fi
  43. if [ -f ${DESTDIR}/vmlinuz ]; then 
  44.     rm -f ${DESTDIR}/vmlinuz.old
  45.     mv -f ${DESTDIR}/vmlinuz ${DESTDIR}/vmlinuz.old
  46.     rm -f ${DESTDIR}/vmlinuz
  47. fi
  48. (cd ${DESTDIR}/; ln -s boot/vmlinuz-${VERSION} vmlinuz)
  49. if [ -f ${DESTDIR}/System.map ]; then 
  50.     rm -f ${DESTDIR}/System.old
  51.     mv -f ${DESTDIR}/System.map ${DESTDIR}/System.old
  52.     rm -f ${DESTDIR}/System.map
  53. fi
  54. (cd ${DESTDIR}/; ln -s -f boot/System.map-${VERSION} System.map)
  55. sync
  56. exit 0
  57.