home *** CD-ROM | disk | FTP | other *** search
/ Caldera Network Desktop 1.0 / caldera-network-desktop-1.0.bin / images / ramdisk2-beta.img / usr / lib / perl / install < prev    next >
Text File  |  1995-12-04  |  4KB  |  177 lines

  1. #!/usr/bin/perl
  2.  
  3. # dialog requires a shell, unfortunately.  But I guess we
  4. # wanted to have a shell anyway.
  5.  
  6. # Copyright (C) 1995 Red Hat Software, Inc.
  7.  
  8. require "dialog";
  9. require "mount_rh";
  10. require "probe_cd";
  11. require "misc";
  12. require "net";
  13. require "nfs_mount";
  14. require "xinst";
  15. require "pcmcia";
  16. require "fdisk";
  17. require "swap";
  18. require "mouse";
  19. require "dispatch";
  20. require "xinstall";
  21. require "media";
  22. require "bootdisk";
  23. require "arch";
  24. require "getopts";
  25.  
  26. # ***
  27. $rh_testing = 0;
  28. # ***
  29.  
  30. $express_install = 1;
  31.  
  32. $fsmount = "/mnt";
  33.  
  34. #$rh_mounted = 1;
  35. #$rh_available = 1;
  36. #$rh_mountpath = "/mnt/rhscd";
  37.  
  38. $* = 1;
  39.  
  40. # The boot disk is on    /bootdisk
  41. # The 2nd rootdisk is on /ramdisk
  42. # The CD instimage (if there is one) goes on /image
  43.  
  44. $ENV{'PATH'} = "/bin:/usr/bin:/usr/bin/X11:/usr/X11/bin:/sbin:/usr/sbin";
  45. $ENV{'PATH'} .= ":/mnt/bin:/mnt/usr/bin:/mnt/sbin:/mnt/usr/sbin";
  46.  
  47. # Set $scr_lines here if we need to
  48. # This is used by the perl interface to dialog
  49. $scr_lines = 24;
  50.  
  51. @rest = &Getopts("pck:");
  52. $opt_p && ($mediamounted = 1);
  53. $opt_k && ($kernelfile = $opt_k);
  54. $opt_c && ($cdboot = 1);
  55.  
  56. open(CPUINFO, "/proc/cpuinfo");
  57.  
  58. &rhs_msgbox ( "Red Hat Linux",
  59. <<EOM
  60. Welcome to Red Hat Linux for $instarch processors!
  61. >
  62. Red Hat Software has worked very hard to bring you the highest
  63. quality Linux system and the easiest and most
  64. flexible installation procedure.
  65. >
  66. If you managed to get this far with all your hardware
  67. detected, the hard part is done!
  68. >
  69. This script will walk you through each step
  70. of the installation.
  71. >
  72. PLEASE BE SURE YOU HAVE READ AND UNDERSTOOD THE INSTALLATION
  73. GUIDE IN THE MANUAL BEFORE YOU PROCEED.  It is probably a good
  74. idea to have the manual available for reference too.
  75. >
  76. Copyright (C) 1995 Red Hat Software, Inc.
  77. EOM
  78.          , 74);
  79.  
  80. &mount_bootdisk();
  81.  
  82. if ($instarch eq "i386" && (! $rh_testing)) {
  83.     $ret = &pcmcia_init;
  84. }
  85.  
  86. #$express_install = &rhs_yesno("Red Hat Linux",
  87. #<<EOM
  88. #>
  89. #The Express Install provides the simplest installation by
  90. #taking you through each installation step in order.
  91. #>
  92. #Do you want to do an Express Install?
  93. #>
  94. #EOM
  95.                   #, 70);
  96. $express_install = 1;
  97.  
  98. $installsource = "";
  99. $installtype = "";
  100.  
  101. if ($instarch eq "i386") {
  102.     @installtypes = ("cdrom", "Red Hat CDROM", "nfs", "NFS server",
  103.     "hard drive", "local hard drive", "ftp", "FTP server",
  104.     "floppy", "floppy disks");
  105.     $enablegraphical = 1;
  106. } else {
  107.     @installtypes = ("cdrom", "Red Hat CDROM", "nfs", "NFS server",
  108.     "hard drive", "local hard drive" );
  109.     $enablegraphical = 0;
  110. }
  111.  
  112. if ($mediamounted) {
  113.     $installsource = "hard drive";    # close enough
  114.     $installtype = "text";
  115. } else {
  116.     while ($installtype eq "") {
  117.     if (&rhs_menu("Installation Type",
  118. <<EOM
  119. >
  120. Red Hat supports a number of different sources for installation. You
  121. may use NFS, a cdrom, ftp, floppy disks, a hard drive partition. 
  122. >
  123. Which do you prefer?
  124. EOM
  125.               , 70, (($#installtypes + 1) / 2), @installtypes,
  126.               )) {
  127.         $installsource = $dialog_result;
  128.  
  129.         if (($installsource eq "cdrom" || $installsource eq "nfs") 
  130.             && $enable_graphical) {
  131.         # Find out if they want to do a X based install or a text mode one
  132.         if (&rhs_menu("Installation Type",
  133.     <<EOM
  134. >
  135. Red Hat supports two types of CD (or NFS) based installation interfaces. One 
  136. is a X based graphical interface which is more powerful
  137. and much easier to use. However, some people have difficulty
  138. getting X set up, so we provide a simpler text only installation
  139. procedure as an alternative.
  140. >
  141. Which would you prefer?
  142. EOM
  143.               , 70, 2, 
  144.               "X", "Graphical Installation",
  145.               "text", "Text based install"
  146.               )) {
  147.             $installtype = $dialog_result;
  148.         } else {
  149.             $installsource = "";
  150.         }
  151.         } else {
  152.         $installtype = "text";
  153.         }
  154.     }
  155.     }
  156. }
  157.  
  158. &install_dispatcher;
  159.  
  160. if (! $rh_testing) {
  161.     &umount_bootdisk();
  162.  
  163.     &rhs_msgbox ( "Installation Complete",
  164. <<EOM
  165. >
  166. When you hit enter your computer will be rebooted.
  167. >
  168. Be sure to remove the boot floppy from your floppy drive!
  169. >
  170. EOM
  171.          , 70);
  172. }
  173.  
  174. exit 0;
  175.