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 / dispatch < prev    next >
Text File  |  1995-12-04  |  8KB  |  366 lines

  1. # -*-perl-*-
  2.  
  3. require "arch";
  4.  
  5. if ($instarch eq "i386") {
  6.     @text_step = (
  7.           "Partition",
  8.           "Select Swap",
  9.           "Init Swap",
  10.           "Configure Net",
  11.           "Select Media",
  12.  
  13.           "Select FS",
  14.           "Fstab",
  15.           "Select Series",
  16.  
  17.           "Make FS",
  18.  
  19.           "Mount FS",
  20.           "Bootstrap",
  21.           "Install Series",
  22.  
  23.           "Install Kernel",
  24.           
  25.           "Configure Mouse",
  26.           "Configure X",
  27.           "Configure Net",
  28.           "Configure Modem",
  29.           "Configure Clock",
  30.           "Configure Keyboard",
  31.           "Configure LILO",
  32.           "Add Users",
  33.           "Root Password",
  34.           "Finish",
  35.           "All Done",
  36.           "No-op"
  37.           );
  38.  
  39.     @x_step = (
  40.            "Partition",
  41.            "Select Swap",
  42.            "Init Swap",
  43.            "Configure Net",
  44.            "Select Media",
  45.  
  46.            "X Install",
  47.            "All Done",
  48.            "No-op"
  49.            );
  50. } else {
  51.     @text_step = (
  52.           "Partition",
  53.           "Select Swap",
  54.           "Init Swap",
  55.           "Configure Net",
  56.           "Select Media",
  57.  
  58.           "Select FS",
  59.           "Fstab",
  60.           "Select Series",
  61.  
  62.           "Make FS",
  63.  
  64.           "Mount FS",
  65.           "Bootstrap",
  66.           "Install Series",
  67.  
  68.           "Install Kernel",
  69.           
  70.           "Configure Mouse",
  71.           # "Configure X",
  72.           "Configure Net",
  73.           "Configure Modem",
  74.           "Configure Clock",
  75.           "Configure Keyboard",
  76.           # "Configure LILO",
  77.           "Add Users",
  78.           "Root Password",
  79.           "Finish",
  80.           "All Done",
  81.           "No-op"
  82.           );
  83. }
  84.  
  85. sub install_dispatcher {
  86.  
  87.     local ( $step_index, @install_step, $step, $ret );
  88.  
  89.     if ($installtype eq "text") {
  90.     require "textinst";
  91.     require "makefs";
  92.     require "fstab";
  93.     require "bootstrap";
  94.     require "keyboard";
  95.     require "clock";
  96.     require "kernel";
  97.     require "lilo";
  98.     require "modem";
  99.     require "series";
  100.     require "users";
  101.     } else {
  102.     require "xinstall";
  103.     }
  104.  
  105.     if ($installtype eq "text") {
  106.     @install_step = @text_step;
  107.     } else {
  108.     @install_step = @x_step;
  109.     }
  110.  
  111.     $step_index = 0;
  112.  
  113.     while (1) {
  114.     if ($express_install) {
  115.         $r = "Next";
  116.     } else {
  117.         if (! &rhs_menu("Red Hat Install Menu",
  118. <<EOM
  119. >
  120. Please pick an installation step.
  121. >
  122. Choosing Next each time will walk you through the installation.
  123. This is highly recommended unless you know what you are doing.
  124. >
  125. EOM
  126.                 , 75, 37,
  127.                 "Next", "Next step ($install_step[$step_index])",
  128.                 "Express", "Continue with Express Install",
  129.                 "Skip+Express", "Skip this step and continue Express Install",
  130.                 "Skip", "Skip this step and continue in order",
  131.                 "Shell", "Start a shell",
  132.                 "Reboot", "Reboot the machine",
  133.                 "-----------", "--------------------------------------",
  134.                 "Select Media", "Find the Red Hat Packages",
  135.                 "Unmount RHS", "Unmount the Red Hat CD (or NFS)",
  136.                 "Partition", "Partition your hard drives",
  137.                 "Select Swap", "Select swap partitions",
  138.                 "Init Swap", "Format and activate swap partitions",
  139.                 "Swap Off", "Deactivate your swap partitions",
  140.                 "Select FS", "Select your Linux partitions",
  141.                 "Make FS", "Format your Linux partitions",
  142.                 "X Install", "Start X Based Installation",
  143.                 "Fstab", "Set up your Linux filesystem",
  144.                 "Mount FS", "Mount your Linux filesystem",
  145.                 "Unmount FS", "Unmount your Linux filesystem",
  146.                 "Conf Net", "Configure networking",
  147.                 "Net Up", "Turn networking on",
  148.                 "Net Down", "Turn networking off",
  149.                 "Bootstrap", "Install the bootstrap system",
  150.                 "Select Series", "Select series to install",
  151.                 "Install Series", "Install selected series",
  152.                 "Configure Modem", "Set up your modem device",
  153.                 "Configure Mouse", "Set up your mouse device",
  154.                 "Configure Keyboard", "Choose your keyboard map",
  155.                 "Configure Clock", "Set up clock and timezone",
  156.                 "Configure LILO", "Configure and install LILO",
  157.                 "Select X Server", "Select an X server",
  158.                 "Configure X", "Configure your X server",
  159.                 "Add Users", "Add users (other than root)",
  160.                 "Root Password", "Set the root password",
  161.                 "Install Kernel", "Install Kernel from Boot Floppy",
  162.                 "Finish", "Write config data, etc",
  163.                 "All Done", "You are finished")) {
  164.         next;
  165.         }
  166.         $r = $dialog_result;
  167.     }
  168.  
  169.     if ($r eq "Express") {
  170.         $express_install = 1;
  171.         $r = "Next";
  172.     }
  173.  
  174.     if ($r eq "Skip") {
  175.         $step_index++;
  176.     }
  177.  
  178.     if ($r eq "Skip+Express") {
  179.         $step_index++;
  180.         $express_install = 1;
  181.         $r = "Next";
  182.     }
  183.  
  184.     if ($r eq "Next") {
  185.         $step = 1;
  186.         $r = $install_step[$step_index];
  187.         $step_index++;
  188.     } else {
  189.         $step = 0;
  190.     }
  191.  
  192.     if ($r eq "No-op") {
  193.         $express_install = 0;
  194.         $step = 0;
  195.         $step_index--;
  196.     }
  197.  
  198.     if ($r eq "Reboot") {
  199.         return 1;
  200.     } elsif ($r eq "Shell") {
  201.         &do_shell;
  202.     } elsif ($r eq "Select Media") {
  203.         $ret = &select_media;
  204.     } elsif ($r eq "Unmount RHS") {
  205.         $ret = &unmount_rhs;
  206.     } elsif ($r eq "Partition") {
  207.         $ret = &partition_disks
  208.     } elsif ($r eq "Init Swap") {
  209.         $ret = &init_swap;
  210.     } elsif ($r eq "Select Swap") {
  211.         $ret = &select_swap;
  212.     } elsif ($r eq "Swap Off") {
  213.         $ret = &swap_off;
  214.     } elsif ($r eq "Configure LILO") {
  215.         $ret = &install_lilo;
  216.     } elsif ($r eq "Make FS") {
  217.         $ret = &format_disks;
  218.     } elsif ($r eq "Select FS") {
  219.         $ret = &select_format_disks;
  220.     } elsif ($r eq "Erase FS") {
  221.         $ret = &erase_filesystems
  222.     } elsif ($r eq "Mount FS") {
  223.         $ret = &mount_filesystems
  224.     } elsif ($r eq "Unmount FS") {
  225.         $ret = &unmount_filesystems;
  226.     } elsif ($r eq "Fstab") {
  227.         $ret = &init_filesystems;
  228.     } elsif ($r eq "X Install") {
  229.         # The X install can drop out to a text based install
  230.         $ret = &xinstall;
  231.         if (! $ret) {
  232.         $ret = 1;
  233.         # This should be the Select FS step
  234.         $step_index = 5;
  235.         @install_step = @text_step;
  236.         $installtype = "text";
  237.  
  238.         # Make sure we have everything
  239.         require "textinst";
  240.         require "makefs";
  241.         require "fstab";
  242.         require "bootstrap";
  243.         require "keyboard";
  244.         require "clock";
  245.         require "kernel";
  246.         require "lilo";
  247.         require "modem";
  248.         require "series";
  249.         require "users";
  250.         }
  251.     } elsif ($r eq "Bootstrap") {
  252.         $ret = &install_bootstrap;
  253.     } elsif ($r eq "Select Series") {
  254.         $ret = &series_select;
  255.     } elsif ($r eq "Install Series") {
  256.         $ret = &series_install;
  257.     } elsif ($r eq "Install Kernel") {
  258.         $ret = &install_kernel;
  259.     } elsif ($r eq "Conf Net") {
  260.         $ret = &config_net;
  261.     } elsif ($r eq "Configure Net") {
  262.         $ret = &configure_network;
  263.     } elsif ($r eq "Configure Modem") {
  264.         $ret = &configure_modem;
  265.     } elsif ($r eq "Configure Mouse") {
  266.         $ret = &configure_mouse;
  267.     } elsif ($r eq "Configure Keyboard") {
  268.         $ret = &configure_keyboard;
  269.     } elsif ($r eq "Configure Clock") {
  270.         $ret = &configure_clock;
  271.     } elsif ($r eq "Add Users") {
  272.         $ret = &add_users;
  273.     } elsif ($r eq "Root Password") {
  274.         $ret = &root_password;
  275.     } elsif ($r eq "Select X Server") {
  276.         $ret = &select_x_server;
  277.     } elsif ($r eq "Install X Server") {
  278.         $ret = &install_x;
  279.     } elsif ($r eq "Configure X") {
  280.         $ret = &config_x;
  281.     } elsif ($r eq "Net Up") {
  282.         $ret = &bring_net_up;
  283.     } elsif ($r eq "Net Down") {
  284.         $ret = &bring_net_down;
  285.     } elsif ($r eq "Erase") {
  286.         $ret = &erase_filesystems;
  287.     } elsif ($r eq "Hack") {
  288.         $ret = &hack_state;
  289.     } elsif ($r eq "Finish") {
  290.         $ret = &finish;
  291.     } elsif ($r eq "All Done") {
  292.         $ret = &all_done;
  293.         if ($ret) {
  294.         return 1;
  295.         }
  296.         $express_install = 0;
  297.     } elsif ($r eq "No-op") {
  298.         $ret = 1;
  299.     }
  300.  
  301.     if ($step) {
  302.         if (! $ret) {
  303.         # stop express install
  304.         if ($express_install) {
  305.             $express_install = 0;
  306.             &rhs_msgbox("Error",
  307. <<EOM
  308. >
  309. Some sort of error occured, so we have dropped you
  310. out of the Express Install.  You can rejoin the
  311. Express Install by selecting Express from the menu.
  312. >
  313. EOM
  314.                 , 65);
  315.         }
  316.         $step_index--;
  317.         }
  318.     }
  319.     }
  320. }
  321.  
  322. sub do_shell {
  323.     &rhs_msgbox("Shell",
  324. <<EOM
  325. >
  326. There is a shell running on VC2.  Press Alt-F2 to
  327. switch to VC2.  You can press Alt-F1 to get back to
  328. the install program.
  329. >
  330. EOM
  331.         , 65);
  332. }
  333.  
  334. sub all_done {
  335.     if ($instarch eq "i386") {
  336.         return &rhs_yesno("Installation Completed",
  337. <<EOM
  338. >
  339. Your installation is finished.
  340. >
  341. You may reboot now, or select reboot from the main menu.
  342. >
  343. Reboot now?
  344. >
  345. EOM
  346.               , 65);
  347.     } else {
  348.         return &rhs_yesno("Installation Completed",
  349. <<EOM
  350. >
  351. Your installation is finished.
  352. >
  353. You may shutdown your system now, or select "reboot" from the
  354. main menu. Note that you will have to manuall reboot your
  355. machine using the reset button.
  356. >
  357. Shutdown now?
  358. >
  359. EOM
  360.               , 65);
  361.     }
  362. }
  363.  
  364. ##
  365. 1;
  366.