home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 49 / PCPP49b.iso / freebies / BeOS5-PersonalEdition / data1.cab / Data_Files / image.be / beos / system / boot / InstallerInitScript < prev    next >
Encoding:
Text File  |  2000-03-24  |  6.7 KB  |  193 lines

  1. #!/bin/sh
  2. #
  3. # (c)1997, 98, 99, Be, Inc. All rights reserved.
  4.  
  5. CMD_ESC='-'
  6. NO_ERR='0'
  7. ERR_BAD_CMD='-1'
  8. ERR_NO_VOL='-2'
  9. NEW_SAMPLE_DIR=optional/sample-code
  10. OLD_SAMPLE_DIR=optional/old-sample-code
  11.  
  12. prog_name="${0}"
  13.  
  14. # Check the command-line arguments
  15. for arg ; do
  16.     if [ "${arg#$CMD_ESC}" = "${arg}" ] ; then
  17.         # The argument is not a tag
  18.         volume="${arg}"
  19.     fi
  20. done
  21.  
  22. # Check to see if we should do anything
  23. if [ -z "${volume}" ] ; then
  24.     echo "Usage: ${prog_name} VOLUME_NAME"
  25.     exit "${ERR_BAD_CMD}"
  26. fi
  27.  
  28. # Check to see if the disk exists and is mounted
  29. if ! cd /"${volume}" &>/dev/null ; then
  30.     echo "${prog_name}: \"${volume}\" not mounted"
  31.     exit "${ERR_NO_VOL}"
  32. fi
  33.  
  34. #
  35. # make some indices on the target volume
  36. #
  37. mkindex -t int "_trk/qrylastchange"
  38.  
  39. #
  40. # Move things their new location
  41. #
  42. mv apps/Metrowerks/stationary develop/BeIDE
  43.  
  44. # Delete obsolete files
  45. rm -f home/config/be/Applications/{Connect,IconWorld,PlaySound,simple-midi}
  46. rm -f {beos/,}apps/{Connect,IconWorld,PlaySound,simple-midi}
  47. rm -f home/config/be/Preferences/{Audio,Sound,Video,Serial,AddPrinter,SelectPrinter}
  48. rm -f {beos/,}preferences/{Audio,Sound,Video,Serial,AddPrinter,SelectPrinter}
  49. rm -f beos/bin/lilo*
  50. rm -rf home/config/be/Demos/{3dsound,Dominos,Life,SoftwareValet}
  51. rm -rf home/config/be/SoftwareValet
  52. rm -f home/config/settings/kernel_settings
  53. rm -rf home/config/settings/Media
  54. rm -f beos/system/add-ons/kernel/drivers/dev/{joystick,midi,audio/mix,audio/mux,audio/old,audio/raw}/emu10k
  55. rm -fr home/config/settings/Epson
  56. rm -f "home/config/add-ons/Print/Epson Stylus Driver"
  57.  
  58. # for Maui
  59. rm -f beos/system/add-ons/Tracker/Backgrounds    # replaced by Background-B
  60. rm -f beos/bin/cardmgr # made obsolete by the watcher
  61. rm -fr demos/{3dsound,Chart,FontDemo,GLTeapot,Minesweeper} # 3dsound is now 3dmiX, in apps...the others are now links
  62. rm -f home/config/add-ons/kernel/file_systems/{cdda,ext2,iso9660,ntfs} # now standard
  63. rm -fr beos/etc/ppd/*
  64. rm -fr "beos/system/add-ons/Print/Apple Laserwriter Compatible"
  65. catattr "Driver Name" /boot/home/config/settings/printers/* | grep "Apple Laserwriter Compatible" | awk -F ' : ' {'print $1'}  | while read line; do addattr "Driver Name" "PostScript" "$line"; done 
  66.  
  67. # superceded by Be-supplied translator
  68. rm -f home/config/add-ons/Translators/PNGTranslator
  69.  
  70. rm -f beos/system/add-ons/drive_setup/fs/{cdda-fs,ext2,ntfs}
  71. rm -f beos/system/add-ons/kernel/drivers/dev/memtypes # replaced by misc/mempool
  72. rm -f home/config/lib/{libGL.so,libglide*.so}
  73.  
  74.  
  75. if [ "$BE_HOST_CPU" = "ppc" ]; then
  76.     rm -f `query "name = mergeres || name = mwbres || name = mwdres"`
  77.     rm -f home/config/be/Preferences/Joysticks
  78.     rm -f {beos/,}preferences/Joysticks 
  79. else
  80.     rm -f `query "name = mwbres"`
  81. fi
  82. rm -rf beos/system/add-ons/media
  83. rm -rf apps/Metrowerks
  84. rm -rf develop/headers/{posix,cpp}
  85. rm -rf "beos/documentation/Shell Tools"
  86. if [ -f beos/system/kernel_intel ]; then
  87.     rm -f beos/bin/{ld,cc,ar,as}
  88.  
  89.     rm -f {beos/,}preferences/Boot
  90.     rm -f home/config/be/Preferences/Boot
  91.     rm -f home/config/settings/Is_Default_Volume
  92.  
  93.     # R4 and R4.5 installed the following link in the wrong place
  94.     rm -f beos/system/add-ons/kernel/drivers/dev/ports/config
  95.  
  96.     rm -f beos/system/add-ons/kernel/drivers/dev/misc/1394
  97.     rm -f beos/system/add-ons/kernel/drivers/dev/bus/1394
  98.     rm -f beos/system/add-ons/media/dvcapture.media_addon
  99.  
  100.     if [ -d home/config/settings/config_manager ]
  101.     then
  102.         mv home/config/settings/config_manager home/config/settings/kernel/config_manager
  103.     fi
  104. fi
  105.  
  106. rm -f home/config/settings/kernel/drivers/sample/*.sample
  107.  
  108.  
  109. #delete Tracker settings that were broken in R4
  110. rm -rf home/config/settings/Tracker/DefaultQueryTemplates/text_x-email
  111.  
  112. #
  113. #    Save the old sample code so the new code won't
  114. #    Clobber it.
  115. #
  116. #    check to see if the pre-Genki sample-code
  117. #    heirarchy is in place. In Genki + the
  118. #    HelloWorld directory is at
  119. #    NEW_SAMPLE_DIR/intro/HelloWorld
  120. if [ -d "$NEW_SAMPLE_DIR/HelloWorld" ]
  121. then
  122.     if ! [ -d $OLD_SAMPLE_DIR ]
  123.     then
  124.         mv $NEW_SAMPLE_DIR $OLD_SAMPLE_DIR
  125.     fi
  126. fi
  127.  
  128. # font names have become more descriptive
  129. rm -f beos/etc/fonts/ttfonts/tt*
  130. rm -f beos/etc/fonts/ttfonts/profont*
  131.  
  132. #rm -f home/config/settings/fonts_list   # Remove font list & cache since they
  133. #rm -f home/config/settings/fonts_cache  # have been known to cause problems...
  134. #rm -f home/config/settings/fonts_status
  135.  
  136. # Get rid of old app_server settings
  137. #rm -f home/config/settings/Desktop_settings
  138. #rm -f home/config/settings/Screen_data    # Solve off-screen Screen problem
  139. #rm -f home/config/settings/Screen_settings
  140. #rm -f home/config/settings/Workspace_data
  141.  
  142.  
  143. # Remove the obsolete links in the be menu
  144. # Basically, the "-L home/config/be/apps" tests to see if there is
  145. # indeed an item in home/config/be/apps and it is indeed a link.
  146. # Lest someone remove the default links and create their own which
  147. # point elsewhere, we must check to see that they point to the right
  148. # spot. That's what that "/bin/ls ... | /bin/awk ..." thing is all
  149. # about. We give the -Fl arguments to ls to print out a long format
  150. # with the item to which the link points. We have to also give it
  151. # --full-time to insure that it has a consistent number of fields
  152. # (which it normally would not). Now we pipe it to awk which checks
  153. # to make sure if the twelfth field is "->" (which it should be if
  154. # the line item is a symbolic link) and if the last field is the
  155. # the thirteenth field (which it would not be if there were spaces
  156. # in the path to which the link points) and if it resolves to the
  157. # original. This avoids the problem where we would remove the link
  158. # if a user had done something like:
  159. #     rm -fr ~/config/be/apps
  160. #     mkdir -p ~/foo\ /boot/apps
  161. #     ln -s ~/foo\ /boot/apps ~/config/be/apps
  162. # Without the field check in awk, we would remove the above link.
  163. if [ -L home/config/be/apps ] \
  164.     && [ `/bin/ls -Fl --full-time home/config/be/apps | /bin/awk '{ if ($12 == "->" && NF == 13) print $NF }'` = "/boot/apps/" ] ; then
  165.     rm -f home/config/be/apps;
  166. fi
  167.  
  168. if [ -L home/config/be/demos ] \
  169.     && [ `/bin/ls -Fl --full-time home/config/be/demos | /bin/awk '{ if ($12 == "->" && NF == 13) print $NF }'` = "/boot/demos/" ] ; then
  170.     rm -f home/config/be/demos;
  171. fi
  172.  
  173. if [ -L home/config/be/preferences ] \
  174.     && [ `/bin/ls -Fl --full-time home/config/be/preferences | /bin/awk '{ if ($12 == "->" && NF == 13) print $NF }'` = "/boot/preferences/" ] ; then
  175.     rm -f home/config/be/preferences;
  176. fi
  177.  
  178. # precompiled headers now have their own folder
  179. if mv "develop/headers/be/BeHeaders.pch++" "${TEMP_DIR}" &>/dev/null ; then
  180.     echo "Moved old precompiled headers to \"`pwd`/${TEMP_DIR}\"." >>"${TEMP_DIR}"/"${README}"
  181.     moved_something='1'
  182. fi
  183.  
  184. if mv "develop/headers/be/BeHeaders" "${TEMP_DIR}" &>/dev/null ; then
  185.     echo "Moved old precompiled headers to \"`pwd`/${TEMP_DIR}\"." >>"${TEMP_DIR}"/"${README}"
  186.     moved_something='1'
  187. fi
  188.  
  189. # mount BeOS_Tools ISO/HFS partition for shared files
  190. mountvolume -ro BeOS_Tools
  191.  
  192. exit "${NO_ERR}"
  193.