From 348d706236d2bf7e09bc8214b657faef0b0a30c5 Mon Sep 17 00:00:00 2001 From: Stew Benedict Date: Sat, 3 Mar 2001 00:16:02 +0000 Subject: *** empty log message *** --- perl-install/ChangeLog | 20 +++++++ perl-install/c/smp.c | 31 +++++++++++ perl-install/fs.pm | 2 + perl-install/help.pm | 104 +++++++++++++++++++++++++++++++++++- perl-install/install2.pm | 2 +- perl-install/modules.pm | 4 +- perl-install/partition_table.pm | 15 ++++-- perl-install/partition_table_mac.pm | 29 +++++++++- 8 files changed, 199 insertions(+), 8 deletions(-) (limited to 'perl-install') diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog index f62a4fa34..4f28d157e 100644 --- a/perl-install/ChangeLog +++ b/perl-install/ChangeLog @@ -1,3 +1,23 @@ +2001/03/02 stew + + * c/smp.c -stanza for PPC + + * detect_devices.pm - added code for MO devices + + * help.pm - help information for yaboot - PPC + + * partition_table.pm - PPC mods + + * partition_table_mac.pm - PPC mods + + * modules.pm - PPC mods - parallel port not used + + * diskdrake.pm - PPC mods - display like pdisk + + * install2.pm - PPC mod - no bootdisk + + * fs.pm - bootstrap partition - PPC + 2001/02/27 dam's * standalone/draknet: pop up a dialog to quit X when accepting diff --git a/perl-install/c/smp.c b/perl-install/c/smp.c index 08b2b0a7c..e54cac62f 100644 --- a/perl-install/c/smp.c +++ b/perl-install/c/smp.c @@ -64,6 +64,35 @@ int sparcDetectSMP(void) } #endif /* __sparc__ */ +/* I'm sure this is not right - but don't know what to look for at +this point - before adding this a machine that was definitely NOT +SMP was identified as such Feb 12, 2001 sbenedict */ + +#ifdef __powerpc__ +int ppcDetectSMP(void) +{ + int issmp = 0; + FILE *f; + + f = fopen("/proc/cpuinfo", "r"); + if (f) { + char buff[1024]; + + while (fgets (buff, 1024, f) != NULL) { + if (!strncmp (buff, "ncpus active\t: ", 15)) { + if (strtoul (buff + 15, NULL, 0) > 1) + issmp = 1; + break; + } + } + fclose(f); + } else + return -1; + + return issmp; +} +#endif /* __powerpc__ */ + #ifdef __i386__ #define SMP_MAGIC_IDENT (('_'<<24)|('P'<<16)|('M'<<8)|'_') @@ -337,6 +366,8 @@ int detectSMP(void) return isSMP = sparcDetectSMP(); #elif __alpha__ return isSMP = alphaDetectSMP(); +#elif __powerpc__ + return isSMP = ppcDetectSMP(); #endif } diff --git a/perl-install/fs.pm b/perl-install/fs.pm index 460631607..d3773a430 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -126,6 +126,8 @@ sub real_format_part { format_dos($part->{device}, @options, '-F', 32); } elsif (isHFS($part)) { format_hfs($part->{device}, @options, '-l', "Untitled"); + } elsif (isBootstrap($part)) { + format_hfs($part->{device}, @options, '-l', "bootstrap"); } elsif (isSwap($part)) { my $check_blocks = grep { /^-c$/ } @options; swap::make($part->{device}, $check_blocks); diff --git a/perl-install/help.pm b/perl-install/help.pm index 3bedeae13..6014bb280 100644 --- a/perl-install/help.pm +++ b/perl-install/help.pm @@ -212,7 +212,13 @@ When a partition is selected, you can use: * Ctrl-d to delete a partition - * Ctrl-m to set the mount point"), + * Ctrl-m to set the mount point + + + +If you are installing on a PPC Machine, you will want to create a small HFS 'bootstrap' partition of at least 1MB for use +by the yaboot bootloader. If you opt to make the partition a bit larger, say 50MB, you may find it a useful place to store +a spare kernel and ramdisk image for emgergency boot situations."), ask_mntpoint_s => __("Above are listed the existing Linux partitions detected on @@ -676,6 +682,102 @@ when booting. The following values are available: * : use the corresponding text mode."), +setupYabootGeneral => + __("Yaboot is a bootloader for NewWorld MacIntosh hardware. It is able +to boot either GNU/Linux, MacOS, or MacOSX, if present on your computer. +Normally, these other operating systems are correctly detected and +installed. If this is not the case, you can add an entry by hand in this +screen. Be careful as to choose the correct parameters. + + +Yaboot main options are: + + + - Init Message: A simple text message that is displayed before the boot +prompt. + + + - Boot Device: Indicate where you want to place the information required to +boot to GNU/Linux. Generally, you will have setup a bootstrap partition earlier +to hold this information. + + + - Open Firmware Delay: Unlike LILO, there are two delays available with +yaboot. The first delay is measured in seconds and at this point you can +choose between CD, OF boot, MacOS, or Linux. + + + - Kernel Boot Timeout: This timeout is similar to the LILO boot delay. After +selecting Linux, you will have this delay in 0.1 seconds before your default +kernel description is selected. + + + - Enable CD Boot?: Checking this option will allow you to choose 'C' for CD at +the first boot prompt. + + + - Enable OF Boot?: Checking this option will allow you to choose 'N' for Open +Firmware at the first boot prompt. + + + - Default OS: You can select which OS will boot by default when the Open Firmware +Delay expires."), + +setupYabootAddEntry => +__("You can add additional entries for yaboot, either for other operating systems, +alternate kernels, or for an emergency boot image. + + +For other OS's - the entry consists only of a label and the root partition. + + +For Linux, they are a few possible options: + + + - Label: This is simply the name will type at the yaboot prompt to select this +boot option. + + + - Image: This would be the name of the kernel to boot. Typically vmlinux or +a variation of vmlinux with an extension. + + + - Root: The root device or '/' for your Linux installation. + + + + - Append: On Apple hardware, the kernel append option is used quite often to +assist in initializing video hardware, or to enable keyboard mouse button emulation +for the often lacking 2nd and 3rd mouse buttons on a stock Apple mouse. The following +are some examples: + + + video=aty128fb:vmode:17,cmode:32,mclk:71 adb_buttons=103,111 hda=autotune + + video=atyfb:vmode:12,cmode:24 adb_buttons=103,111 + + + + - Initrd: This option can be used either to load initial modules, before the boot +device is available, or to load a ramdisk image for an emergency boot situation. + + + - Initrd-size: The default ramdisk size is generally 4096 bytes. If you should need +to allocate a large ramdisk, this option can be used. + + + - Read-write: Normally the 'root' partition is initially brought up read-only, to allow +a filesystem check before the system becomes 'live'. You can override this option here. + + + - NoVideo: Should the Apple video hardware prove to be exceptionally problematic, you can +select this option to boot in 'novideo' mode, with native framebuffer support. + + + - Default: Selects this entry as being the default Linux selection, selectable by just +pressing ENTER at the yaboot prompt. This entry will also be highlighted with a '*', if you +press TAB to see the boot selections."), + setupSILOAddEntry => __("SILO is a bootloader for SPARC: it is able to boot either GNU/Linux or any other operating system present on your computer. diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 5fabe8070..0379648ae 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -52,7 +52,7 @@ my (%installSteps, @orderedInstallSteps); configureServices => [ __("Configure services"), 1, 1, '!$::expert', "installPackages" ], setRootPassword => [ __("Set root password"), 1, 1, '', "installPackages" ], addUser => [ __("Add a user"), 1, 1, '', "installPackages" ], -arch() !~ /alpha/ ? ( +((arch() !~ /alpha/) && (arch() !~ /ppc/)) ? ( createBootdisk => [ __("Create a bootdisk"), 1, 0, '', "installPackages" ], ) : (), setupBootloader => [ __("Install bootloader"), 1, 1, '', "installPackages" ], diff --git a/perl-install/modules.pm b/perl-install/modules.pm index 0a726e3cc..2ee0eb632 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -340,7 +340,7 @@ sk98lin my @skip_modules_on_stage1 = ( - arch() =~ /alpha/ ? qw(sb1000) : (), + arch() =~ /alpha|ppc/ ? qw(sb1000) : (), "apa1480_cb", "imm", "ppa", @@ -608,6 +608,8 @@ sub read_stage1_conf { if (arch() =~ /sparc/) { $conf{parport_lowlevel}{alias} ||= "parport_ax"; $conf{plip}{"pre-install"} ||= "modprobe parport_ax ; echo 7 > /proc/parport/0/irq"; #- TOCHECK + } elsif (arch() =~ /ppc/) { + $conf{pcmcia_core}{"pre-install"} ||= "CARDMGR_OPTS=-f /etc/rc.d/init.d/pcmcia start"; } else { $conf{parport_lowlevel}{alias} ||= "parport_pc"; $conf{pcmcia_core}{"pre-install"} ||= "CARDMGR_OPTS=-f /etc/rc.d/init.d/pcmcia start"; diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index cda10c6db..aa57f0e30 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -6,7 +6,7 @@ package partition_table; # $Id$ @ISA = qw(Exporter); %EXPORT_TAGS = ( - types => [ qw(type2name type2fs name2type fs2type isExtended isExt2 isReiserfs isTrueFS isSwap isDos isWin isFat isSunOS isOtherAvailableFS isPrimary isNfs isSupermount isRAID isMDRAID isHFS isNT isMountableRW isNonMountable isApplePartMap isLoopback) ], + types => [ qw(type2name type2fs name2type fs2type isExtended isExt2 isReiserfs isTrueFS isSwap isDos isWin isFat isSunOS isOtherAvailableFS isPrimary isNfs isSupermount isRAID isMDRAID isHFS isNT isMountableRW isNonMountable isApplePartMap isLoopback isApple isBootstrap) ], ); @EXPORT_OK = map { @$_ } values %EXPORT_TAGS; @@ -15,8 +15,11 @@ use common qw(:common :system :functional); use partition_table_raw; use log; - -@important_types = ('Linux native', 'Linux swap', if_(arch() =~ /i.86/, 'ReiserFS', 'DOS FAT16', 'Win98 FAT32')); +if (arch() =~ /ppc/) { + @important_types = ('Linux native', 'Linux swap', 'Apple HFS Partition', 'Apple Bootstrap'); +} else { + @important_types = ('Linux native', 'Linux swap', if_(arch() =~ /i.86/, 'ReiserFS', 'DOS FAT16', 'Win98 FAT32')); +} @important_types2 = ('Linux RAID', 'Linux Logical Volume Manager partition'); @fields2save = qw(primary extended totalsectors isDirty needKernelReread); @@ -27,6 +30,7 @@ my %types = ( 0x0 => 'Empty', arch() =~ /^ppc/ ? ( 0x401 => 'Apple Partition', + 0x401 => 'Apple Bootstrap', 0x402 => 'Apple HFS Partition', ) : arch() =~ /^i.86/ ? ( 0x183 => 'ReiserFS', @@ -183,6 +187,7 @@ arch() !~ /sparc/ ? ( 0x82 => 'swap', 0x83 => 'ext2', 0x183=> 'reiserfs', + 0x401 => 'apple', 0x402 => 'hfs', nfs => 'nfs', #- hack ); @@ -224,6 +229,8 @@ sub isNfs($) { $_[0]{type} eq 'nfs' } #- small hack sub isNT($) { arch() !~ /^sparc/ && $_[0]{type} == 0x7 } sub isSupermount($) { $_[0]{type} eq 'supermount' } sub isHFS($) { $type2fs{$_[0]{type}} eq 'hfs' } +sub isApple($) { $type2fs{$_[0]{type}} eq 'apple' && defined $_[0]{isDriver} } +sub isBootstrap($) { $type2fs{$_[0]{type}} eq 'apple' && defined $_[0]{isBoot} } sub isHiddenMacPart { defined $_[0]{isMap} } sub isLoopback { defined $_[0]{loopback_file} } sub isTrueFS { isExt2($_[0]) || isReiserfs($_[0]) } @@ -611,7 +618,7 @@ sub add($$;$$) { my $e = $hd->{primary}{extended}; - if (arch() =~ /^sparc/ || + if (arch() =~ /^sparc|ppc/ || $primaryOrExtended eq 'Primary' || $primaryOrExtended !~ /Extended/ && is_empty_array_ref($hd->{primary}{normal})) { eval { add_primary($hd, $part) }; diff --git a/perl-install/partition_table_mac.pm b/perl-install/partition_table_mac.pm index 91d7cea01..30c269398 100644 --- a/perl-install/partition_table_mac.pm +++ b/perl-install/partition_table_mac.pm @@ -1,7 +1,7 @@ package partition_table_mac; # $Id$ use diagnostics; -use strict; +#use strict; - fixed other PPC code to comply, but program bails on empty partition table - sbenedict use vars qw(@ISA); @ISA = qw(partition_table_raw); @@ -13,6 +13,7 @@ use c; my %typeToDos = ( "Apple_partition_map" => 0x401, + "Apple_Bootstrap" => 0x401, "Apple_Driver43" => 0x401, "Apple_Driver_IOKit" => 0x401, "Apple_Patches" => 0x401, @@ -136,15 +137,36 @@ sub read($$) { if ($h{pType} =~ /^Apple_UNIX_SVR2/i) { $h{pName} =~ /swap/i ? ($h{type} = 0x82) : ($h{type} = 0x83); } elsif ($h{pType} =~ /^Apple_Free/i) { + #- need to locate a 1MB partition to setup a bootstrap on + if (defined $partition_table_mac'freepart_start && $partition_table_mac'freepart_size >= 1) { + #- already found a suitable partition + } else { + $partition_table_mac'freepart_start = $h{start}; + $partition_table_mac'freepart_size = $h{size}/2048; + $partition_table_mac'freepart_device = $hd; + log::l("free apple partition found on drive /dev/$partition_table_mac'freepart_device->{device}, block $partition_table_mac'freepart_start, size $partition_table_mac'freepart_size"); + } next; #$h{type} = 0x0; } elsif ($h{pType} =~ /^Apple_HFS/i) { $h{type} = 0x402; + if (defined $partition_table_mac'macos_part) { + #- swag at identifying MacOS - 1st HFS partition + } else { + $partition_table_mac'macos_part = "/dev/" . $hd->{device} . ($i+1); + log::l("found MacOS at partition $partition_table_mac'macos_part"); + } } elsif ($h{pType} =~ /^Apple_Partition_Map/i) { $h{type} = 0x401; $h{isMap} = 1; + } elsif ($h{pType} =~ /^Apple_Bootstrap/i) { + $h{type} = 0x401; + $h{isBoot} = 1; + $partition_table_mac'bootstrap_part = "/dev/" . $hd->{device} . ($i+1); + log::l("found bootstrap at partition $partition_table_mac'bootstrap_part"); } else { $h{type} = 0x401; + $h{isDriver} = 1; }; # Let's see if this partition is a driver. @@ -261,6 +283,11 @@ sub write($$$;$) { $_->{pType} = "Apple_Partition_Map"; $_->{pName} = "Apple"; $_->{pFlags} = 0x33; + } elsif ($_->{type} == 0x401) { + $_->{pType} = "Apple_Bootstrap"; + $_->{pName} = "bootstrap"; + $_->{pFlags} = 0x33; + $_->{isBoot} = 1; } elsif ($_->{type} == 0x82) { $_->{pType} = "Apple_UNIX_SVR2"; $_->{pName} = "swap"; -- cgit v1.2.1