# Handles partitioning disks sub partition_disks { local ( $ret ); if (! &rhs_yesno ( "Disk Partitions", < If you will be using OS/2 on your system in addition to Linux, you must use the OS/2 partitioning software. OS/2 will not recognize partitions created by the Linux partitioning software. > If you have not done this, choose the Reboot option, partition your drives with the OS/2 software, and restart the Red Hat installation. > Continue? > EOM , 70)) { return 1; } if (! &rhs_yesno ( "Disk Partitions", < You\'ll need at least 16MB for the base system, 12MB for C development tools, 8MB for net stuff, 16MB for X stuff, 16MB for GNU Emacs and 13MB for TeX. THESE ARE MINIMUMS! Be sure to allow for your home directory, additional packages, etc. > Do you need to partition your disks? > EOM , 70)) { return 1; } &rhs_msgbox ( "Disk Partitions", < Each partition used for the Linux filesystem must be set as type 83. Each partition used for a Linux swap partition must be set as type 82. > EOM , 70); &_partition_disks; } sub _partition_disks { local ( $ret, $snarf, $disklist, $diskinfolist, $msg, $ent ); $ret = &rhs_infobox ( "Disk Partitioning", < Discovering what hard drives are attached to the system... > EOM , 70); @disklist = (); @diskinfolist = (); open(SAVEERR, ">&STDERR"); open(STDERR, ">/dev/null"); open(PROC, "fdisk -l |") || &newdie("Can't call fdisk!"); while () { if (/^Disk (.*):(.*)$/) { $disklist[@disklist] = $1; $diskinfolist[@diskinfolist] = "$1:$2"; } } close PROC; open(STDERR, ">&SAVEERR"); $msg = < EOM ; foreach $ent (@diskinfolist) { $msg .= ">" . $ent . "\n"; } while (1) { if (! &rhs_menu("Disk Partitioning", $msg, 70, 3, "fdisk", "Partition a disk with fdisk (command line)", "cfdisk", "Partition a disk with cfdisk (full screen)", "done", "Done with partitioning")) { last; } last if ($dialog_result eq "done"); &partition_disk ("fdisk", @disklist) if ($dialog_result eq "fdisk"); &partition_disk ("cfdisk", @disklist) if ($dialog_result eq "cfdisk"); } &rhs_menu("Disk Partitioning", < If fdisk (or cfdisk) complained about not being able to reload the partition tables, you should reboot now. > After rebooting skip the partitioning step and continue with the rest of the installation. > EOM , 70, 2, "Reboot", "Reboot now", "Continue", "Continue the install process"); exit(0) if ($dialog_result eq "Reboot"); return 1; } sub partition_disk { local ( $fdisk, @disklist ) = @_; local ( $ret ); if (! &rhs_menul ( "Disk Partitioning", < Which disk do you want to partition? > EOM , 50, scalar(@disklist), @disklist)) { return 1; } if ($fdisk eq "fdisk") { system("fdisk $dialog_result"); } else { system("cfdisk $dialog_result"); } print "\nHit enter to continue"; ; } ############ 1;