home *** CD-ROM | disk | FTP | other *** search
/ Enter 2006 October / Enter 10 2006.iso / boot / isolinux / initrd / in / usr / lib / setup / migrate.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2005-01-28  |  923 b   |  30 lines

  1. #!/bin/sh
  2. #
  3. # Like, the space is *really* getting tight on these install disks!
  4. # Can you believe it?  Anyway, we can avoid many problems by migrating
  5. # the $TMP directory onto the install partition ASAP.  So, this script
  6. # is run right after the TARGET partition is configured and mounted
  7. # under /mnt.
  8. #
  9.  
  10. TMPLINK="`LC_ALL=C /bin/ls -l /var/log/setup/tmp | tr -s ' ' | cut -f 11 -d ' '`"
  11. if [ -L /var/log/setup/tmp -a "$TMPLINK" = "/tmp" ]; then
  12.   if mount | grep " on /mnt " 1> /dev/null 2> /dev/null ; then # /mnt mounted
  13.     TYPE="`mount | grep " on /mnt " | cut -f 5 -d ' '`"
  14.     if [ "$TYPE" = "umsdos" ]; then
  15.       LINKDIR=/mnt/linux/var/log/setup/tmp
  16.     else
  17.       LINKDIR=/mnt/var/log/setup/tmp
  18.     fi
  19.     if [ ! -d $LINKDIR ]; then
  20.       mkdir -p $LINKDIR
  21.       chmod 700 $LINKDIR
  22.     fi
  23.     ( cd /var/log/setup
  24.       rm tmp
  25.       ln -sf $LINKDIR tmp )
  26.     rm -f $LINKDIR/SeT*
  27.     mv /tmp/SeT* $LINKDIR
  28.   fi
  29. fi
  30.