mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-22 09:43:47 +00:00
* Negative #if's are harder to read as they don't tell exactly what arch
something applies to. So change #ifndef to an explicit list of defines. * Treate sparc64 and ia64 as 64-bit platforms, which means larger roots. * sparc64 should halt back to the firmware, not reset. * sparc64 doesn't need to play MS-DOS/BIOS partition crap games. Reviewed by: jake
This commit is contained in:
parent
4d5266715e
commit
eec2e4bdde
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=104940
|
@ -368,7 +368,7 @@ diskPartition(Device *dev)
|
|||
|
||||
case 'A':
|
||||
case 'F': /* Undocumented magic Dangerously Dedicated mode */
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
rv = 1;
|
||||
#else /* The rest is only relevant on x86 */
|
||||
cp = variable_get(VAR_DEDICATE_DISK);
|
||||
|
@ -442,7 +442,7 @@ diskPartition(Device *dev)
|
|||
partitiontype = fat;
|
||||
else
|
||||
partitiontype = unknown;
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
if (partitiontype == freebsd && size == chunk_info[current_chunk]->size)
|
||||
All_FreeBSD(d, 1);
|
||||
else
|
||||
|
@ -816,20 +816,20 @@ diskPartitionWrite(dialogMenuItem *self)
|
|||
for (i = 0; devs[i]; i++) {
|
||||
Disk *d = (Disk *)devs[i]->private;
|
||||
static u_char *boot1;
|
||||
#ifndef __alpha__
|
||||
#if defined(__i386__) || defined(__ia64__)
|
||||
static u_char *boot2;
|
||||
#endif
|
||||
|
||||
if (!devs[i]->enabled)
|
||||
continue;
|
||||
|
||||
#ifdef __alpha__
|
||||
if (!boot1) boot1 = bootalloc("boot1", NULL);
|
||||
Set_Boot_Blocks(d, boot1, NULL);
|
||||
#else
|
||||
#if defined(__i386__) || defined(__ia64__)
|
||||
if (!boot1) boot1 = bootalloc("boot1", NULL);
|
||||
if (!boot2) boot2 = bootalloc("boot2", NULL);
|
||||
Set_Boot_Blocks(d, boot1, boot2);
|
||||
#else
|
||||
if (!boot1) boot1 = bootalloc("boot1", NULL);
|
||||
Set_Boot_Blocks(d, boot1, NULL);
|
||||
#endif
|
||||
|
||||
msgNotify("Writing partition information to drive %s", d->name);
|
||||
|
|
|
@ -518,7 +518,7 @@ installExpress(dialogMenuItem *self)
|
|||
|
||||
dialog_clear_norefresh();
|
||||
variable_set2(SYSTEM_STATE, "express", 0);
|
||||
#ifndef __alpha__
|
||||
#if defined(__i386__) || defined(__ia64__)
|
||||
if (DITEM_STATUS((i = diskPartitionEditor(self))) == DITEM_FAILURE)
|
||||
return i;
|
||||
#endif
|
||||
|
@ -546,7 +546,7 @@ installStandard(dialogMenuItem *self)
|
|||
|
||||
variable_set2(SYSTEM_STATE, "standard", 0);
|
||||
dialog_clear_norefresh();
|
||||
#ifndef __alpha__
|
||||
#if defined(__i386__) || defined(__ia64__)
|
||||
msgConfirm("In the next menu, you will need to set up a DOS-style (\"fdisk\") partitioning\n"
|
||||
"scheme for your hard disk. If you simply wish to devote all disk space\n"
|
||||
"to FreeBSD (overwriting anything else that might be on the disk(s) selected)\n"
|
||||
|
@ -566,16 +566,16 @@ installStandard(dialogMenuItem *self)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef __alpha__
|
||||
msgConfirm("Now you need to create BSD partitions on the disk which you are\n"
|
||||
"installing to. If you have a reasonable amount of disk space (200MB or more)\n"
|
||||
#if defined(__i386__) || defined(__ia64__)
|
||||
msgConfirm("Now you need to create BSD partitions inside of the fdisk partition(s)\n"
|
||||
"just created. If you have a reasonable amount of disk space (200MB or more)\n"
|
||||
"and don't have any special requirements, simply use the (A)uto command to\n"
|
||||
"allocate space automatically. If you have more specific needs or just don't\n"
|
||||
"care for the layout chosen by (A)uto, press F1 for more information on\n"
|
||||
"manual layout.");
|
||||
#else
|
||||
msgConfirm("Now you need to create BSD partitions inside of the fdisk partition(s)\n"
|
||||
"just created. If you have a reasonable amount of disk space (200MB or more)\n"
|
||||
msgConfirm("Now you need to create BSD partitions on the disk which you are\n"
|
||||
"installing to. If you have a reasonable amount of disk space (200MB or more)\n"
|
||||
"and don't have any special requirements, simply use the (A)uto command to\n"
|
||||
"allocate space automatically. If you have more specific needs or just don't\n"
|
||||
"care for the layout chosen by (A)uto, press F1 for more information on\n"
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
/*
|
||||
* Minimum partition sizes
|
||||
*/
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__ia64__) || defined(__sparc64__)
|
||||
#define ROOT_MIN_SIZE 40
|
||||
#else
|
||||
#define ROOT_MIN_SIZE 30
|
||||
|
@ -679,7 +679,7 @@ clear_wins(void)
|
|||
print_label_chunks();
|
||||
}
|
||||
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
|
||||
/*
|
||||
* If there isn't a freebsd chunk already (i.e. there is no label),
|
||||
|
@ -712,7 +712,7 @@ diskLabel(Device *dev)
|
|||
PartInfo *p, *oldp;
|
||||
PartType type;
|
||||
Device **devs;
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
int i;
|
||||
#endif
|
||||
WINDOW *w = savescr();
|
||||
|
@ -729,7 +729,7 @@ diskLabel(Device *dev)
|
|||
}
|
||||
labeling = TRUE;
|
||||
keypad(stdscr, TRUE);
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
for (i = 0; devs[i]; i++) {
|
||||
maybe_dedicate((Disk*) devs[i]->private);
|
||||
}
|
||||
|
@ -1381,7 +1381,7 @@ diskLabelNonInteractive(Device *dev)
|
|||
d = dev->private;
|
||||
else
|
||||
d = devs[0]->private;
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
maybe_dedicate(d);
|
||||
#endif
|
||||
record_label_chunks(devs, dev);
|
||||
|
|
|
@ -162,7 +162,7 @@ main(int argc, char **argv)
|
|||
choice = scroll = curr = max = 0;
|
||||
dmenuOpen(&MenuInitial, &choice, &scroll, &curr, &max, TRUE);
|
||||
if (getpid() != 1
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
|| !msgNoYes("Are you sure you wish to exit? The system will halt.")
|
||||
#else
|
||||
|| !msgNoYes("Are you sure you wish to exit? The system will reboot\n"
|
||||
|
|
|
@ -1182,7 +1182,7 @@ DMenu MenuInstallCustom = {
|
|||
"INSTALL",
|
||||
{ { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit },
|
||||
{ "2 Options", "View/Set various installation options", NULL, optionsEditor },
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
{ "3 Label", "Label disk partitions", NULL, diskLabelEditor },
|
||||
{ "4 Distributions", "Select distribution(s) to extract", NULL, dmenuSubmenu, NULL, &MenuDistributions },
|
||||
{ "5 Media", "Choose the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia },
|
||||
|
@ -1320,14 +1320,17 @@ DMenu MenuStartup = {
|
|||
dmenuVarCheck, dmenuToggleVariable, NULL, "accounting_enable=YES" },
|
||||
{ " lpd", "This host has a printer and wants to run lpd.",
|
||||
dmenuVarCheck, dmenuToggleVariable, NULL, "lpd_enable=YES" },
|
||||
#ifdef __i386__
|
||||
{ " linux", "This host wants to be able to run linux binaries.",
|
||||
dmenuVarCheck, configLinux, NULL, VAR_LINUX_ENABLE "=YES" },
|
||||
{ " SVR4", "This host wants to be able to run SVR4 binaries.",
|
||||
dmenuVarCheck, dmenuToggleVariable, NULL, "svr4_enable=YES" },
|
||||
#ifdef __i386__
|
||||
{ " SCO", "This host wants to be able to run IBCS2 binaries.",
|
||||
dmenuVarCheck, dmenuToggleVariable, NULL, "ibcs2_enable=YES" },
|
||||
#elif __alpha__
|
||||
#endif
|
||||
#if defined(__i386__) || defined(__sparc64__)
|
||||
{ " SVR4", "This host wants to be able to run SVR4 binaries.",
|
||||
dmenuVarCheck, dmenuToggleVariable, NULL, "svr4_enable=YES" },
|
||||
#endif
|
||||
#ifdef __alpha__
|
||||
{ " OSF/1", "This host wants to be able to run DEC OSF/1 binaries.",
|
||||
dmenuVarCheck, dmenuToggleVariable, NULL, "osf1_enable=YES" },
|
||||
#endif
|
||||
|
|
|
@ -253,7 +253,7 @@ systemShutdown(int status)
|
|||
if (RunningAsInit) {
|
||||
/* Put the console back */
|
||||
ioctl(0, VT_ACTIVATE, 2);
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
reboot(RB_HALT);
|
||||
#else
|
||||
reboot(0);
|
||||
|
|
|
@ -155,6 +155,8 @@ mediaInitCDROM(Device *dev)
|
|||
if (strcmp(cp, "any") &&
|
||||
#ifdef __alpha__
|
||||
strcmp(cp, "alpha")) {
|
||||
#elif defined(__sparc64__)
|
||||
strcmp(cp, "sparc64")) {
|
||||
#else
|
||||
strcmp(cp, "x86")) {
|
||||
#endif
|
||||
|
|
|
@ -368,7 +368,7 @@ diskPartition(Device *dev)
|
|||
|
||||
case 'A':
|
||||
case 'F': /* Undocumented magic Dangerously Dedicated mode */
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
rv = 1;
|
||||
#else /* The rest is only relevant on x86 */
|
||||
cp = variable_get(VAR_DEDICATE_DISK);
|
||||
|
@ -442,7 +442,7 @@ diskPartition(Device *dev)
|
|||
partitiontype = fat;
|
||||
else
|
||||
partitiontype = unknown;
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
if (partitiontype == freebsd && size == chunk_info[current_chunk]->size)
|
||||
All_FreeBSD(d, 1);
|
||||
else
|
||||
|
@ -816,20 +816,20 @@ diskPartitionWrite(dialogMenuItem *self)
|
|||
for (i = 0; devs[i]; i++) {
|
||||
Disk *d = (Disk *)devs[i]->private;
|
||||
static u_char *boot1;
|
||||
#ifndef __alpha__
|
||||
#if defined(__i386__) || defined(__ia64__)
|
||||
static u_char *boot2;
|
||||
#endif
|
||||
|
||||
if (!devs[i]->enabled)
|
||||
continue;
|
||||
|
||||
#ifdef __alpha__
|
||||
if (!boot1) boot1 = bootalloc("boot1", NULL);
|
||||
Set_Boot_Blocks(d, boot1, NULL);
|
||||
#else
|
||||
#if defined(__i386__) || defined(__ia64__)
|
||||
if (!boot1) boot1 = bootalloc("boot1", NULL);
|
||||
if (!boot2) boot2 = bootalloc("boot2", NULL);
|
||||
Set_Boot_Blocks(d, boot1, boot2);
|
||||
#else
|
||||
if (!boot1) boot1 = bootalloc("boot1", NULL);
|
||||
Set_Boot_Blocks(d, boot1, NULL);
|
||||
#endif
|
||||
|
||||
msgNotify("Writing partition information to drive %s", d->name);
|
||||
|
|
|
@ -518,7 +518,7 @@ installExpress(dialogMenuItem *self)
|
|||
|
||||
dialog_clear_norefresh();
|
||||
variable_set2(SYSTEM_STATE, "express", 0);
|
||||
#ifndef __alpha__
|
||||
#if defined(__i386__) || defined(__ia64__)
|
||||
if (DITEM_STATUS((i = diskPartitionEditor(self))) == DITEM_FAILURE)
|
||||
return i;
|
||||
#endif
|
||||
|
@ -546,7 +546,7 @@ installStandard(dialogMenuItem *self)
|
|||
|
||||
variable_set2(SYSTEM_STATE, "standard", 0);
|
||||
dialog_clear_norefresh();
|
||||
#ifndef __alpha__
|
||||
#if defined(__i386__) || defined(__ia64__)
|
||||
msgConfirm("In the next menu, you will need to set up a DOS-style (\"fdisk\") partitioning\n"
|
||||
"scheme for your hard disk. If you simply wish to devote all disk space\n"
|
||||
"to FreeBSD (overwriting anything else that might be on the disk(s) selected)\n"
|
||||
|
@ -566,16 +566,16 @@ installStandard(dialogMenuItem *self)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef __alpha__
|
||||
msgConfirm("Now you need to create BSD partitions on the disk which you are\n"
|
||||
"installing to. If you have a reasonable amount of disk space (200MB or more)\n"
|
||||
#if defined(__i386__) || defined(__ia64__)
|
||||
msgConfirm("Now you need to create BSD partitions inside of the fdisk partition(s)\n"
|
||||
"just created. If you have a reasonable amount of disk space (200MB or more)\n"
|
||||
"and don't have any special requirements, simply use the (A)uto command to\n"
|
||||
"allocate space automatically. If you have more specific needs or just don't\n"
|
||||
"care for the layout chosen by (A)uto, press F1 for more information on\n"
|
||||
"manual layout.");
|
||||
#else
|
||||
msgConfirm("Now you need to create BSD partitions inside of the fdisk partition(s)\n"
|
||||
"just created. If you have a reasonable amount of disk space (200MB or more)\n"
|
||||
msgConfirm("Now you need to create BSD partitions on the disk which you are\n"
|
||||
"installing to. If you have a reasonable amount of disk space (200MB or more)\n"
|
||||
"and don't have any special requirements, simply use the (A)uto command to\n"
|
||||
"allocate space automatically. If you have more specific needs or just don't\n"
|
||||
"care for the layout chosen by (A)uto, press F1 for more information on\n"
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
/*
|
||||
* Minimum partition sizes
|
||||
*/
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__ia64__) || defined(__sparc64__)
|
||||
#define ROOT_MIN_SIZE 40
|
||||
#else
|
||||
#define ROOT_MIN_SIZE 30
|
||||
|
@ -679,7 +679,7 @@ clear_wins(void)
|
|||
print_label_chunks();
|
||||
}
|
||||
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
|
||||
/*
|
||||
* If there isn't a freebsd chunk already (i.e. there is no label),
|
||||
|
@ -712,7 +712,7 @@ diskLabel(Device *dev)
|
|||
PartInfo *p, *oldp;
|
||||
PartType type;
|
||||
Device **devs;
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
int i;
|
||||
#endif
|
||||
WINDOW *w = savescr();
|
||||
|
@ -729,7 +729,7 @@ diskLabel(Device *dev)
|
|||
}
|
||||
labeling = TRUE;
|
||||
keypad(stdscr, TRUE);
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
for (i = 0; devs[i]; i++) {
|
||||
maybe_dedicate((Disk*) devs[i]->private);
|
||||
}
|
||||
|
@ -1381,7 +1381,7 @@ diskLabelNonInteractive(Device *dev)
|
|||
d = dev->private;
|
||||
else
|
||||
d = devs[0]->private;
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
maybe_dedicate(d);
|
||||
#endif
|
||||
record_label_chunks(devs, dev);
|
||||
|
|
|
@ -162,7 +162,7 @@ main(int argc, char **argv)
|
|||
choice = scroll = curr = max = 0;
|
||||
dmenuOpen(&MenuInitial, &choice, &scroll, &curr, &max, TRUE);
|
||||
if (getpid() != 1
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
|| !msgNoYes("Are you sure you wish to exit? The system will halt.")
|
||||
#else
|
||||
|| !msgNoYes("Are you sure you wish to exit? The system will reboot\n"
|
||||
|
|
|
@ -1182,7 +1182,7 @@ DMenu MenuInstallCustom = {
|
|||
"INSTALL",
|
||||
{ { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit },
|
||||
{ "2 Options", "View/Set various installation options", NULL, optionsEditor },
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
{ "3 Label", "Label disk partitions", NULL, diskLabelEditor },
|
||||
{ "4 Distributions", "Select distribution(s) to extract", NULL, dmenuSubmenu, NULL, &MenuDistributions },
|
||||
{ "5 Media", "Choose the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia },
|
||||
|
@ -1320,14 +1320,17 @@ DMenu MenuStartup = {
|
|||
dmenuVarCheck, dmenuToggleVariable, NULL, "accounting_enable=YES" },
|
||||
{ " lpd", "This host has a printer and wants to run lpd.",
|
||||
dmenuVarCheck, dmenuToggleVariable, NULL, "lpd_enable=YES" },
|
||||
#ifdef __i386__
|
||||
{ " linux", "This host wants to be able to run linux binaries.",
|
||||
dmenuVarCheck, configLinux, NULL, VAR_LINUX_ENABLE "=YES" },
|
||||
{ " SVR4", "This host wants to be able to run SVR4 binaries.",
|
||||
dmenuVarCheck, dmenuToggleVariable, NULL, "svr4_enable=YES" },
|
||||
#ifdef __i386__
|
||||
{ " SCO", "This host wants to be able to run IBCS2 binaries.",
|
||||
dmenuVarCheck, dmenuToggleVariable, NULL, "ibcs2_enable=YES" },
|
||||
#elif __alpha__
|
||||
#endif
|
||||
#if defined(__i386__) || defined(__sparc64__)
|
||||
{ " SVR4", "This host wants to be able to run SVR4 binaries.",
|
||||
dmenuVarCheck, dmenuToggleVariable, NULL, "svr4_enable=YES" },
|
||||
#endif
|
||||
#ifdef __alpha__
|
||||
{ " OSF/1", "This host wants to be able to run DEC OSF/1 binaries.",
|
||||
dmenuVarCheck, dmenuToggleVariable, NULL, "osf1_enable=YES" },
|
||||
#endif
|
||||
|
|
|
@ -253,7 +253,7 @@ systemShutdown(int status)
|
|||
if (RunningAsInit) {
|
||||
/* Put the console back */
|
||||
ioctl(0, VT_ACTIVATE, 2);
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc64__)
|
||||
reboot(RB_HALT);
|
||||
#else
|
||||
reboot(0);
|
||||
|
|
Loading…
Reference in a new issue