1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-06 13:09:50 +00:00

o Add support for loading the rsaref or rsaintl packages, depending

on locale.

o Allow use of "G" in label editor to stand for gigabytes. This
  is actually an unrelated patch which I meant to commit separately
  but what the heck, it's late.

Partially submitted by:	phk
This commit is contained in:
Jordan K. Hubbard 2000-02-29 10:40:59 +00:00
parent 2394baefd8
commit 7140b4def8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=57617
17 changed files with 133 additions and 11 deletions

View File

@ -309,6 +309,8 @@ diskPartition(Device *dev)
if (val && (size = strtol(val, &cp, 0)) > 0) {
if (*cp && toupper(*cp) == 'M')
size *= ONE_MEG;
else if (*cp && toupper(*cp) == 'G')
size *= ONE_GIG;
strcpy(tmp, "165");
val = msgGetInput(tmp, "Enter type of partition to create:\n\n"
"Pressing Enter will choose the default, a native FreeBSD\n"
@ -733,6 +735,8 @@ diskPartitionNonInteractive(Device *dev)
/* Look for sz bytes free */
if (*cp && toupper(*cp) == 'M')
sz *= ONE_MEG;
else if (*cp && toupper(*cp) == 'G')
sz *= ONE_GIG;
for (i = 0; chunk_info[i]; i++) {
/* If a chunk is at least sz MB, use it. */
if (chunk_info[i]->type == unused && chunk_info[i]->size >= sz) {

View File

@ -47,6 +47,7 @@ Boolean RunningAsInit; /* Are we running as init? */
Boolean DialogActive; /* Is libdialog initialized? */
Boolean ColorDisplay; /* Are we on a color display? */
Boolean OnVTY; /* Are we on a VTY? */
Boolean PkgInteractive; /* Is the package going to spew at us? */
Boolean USAResident; /* Are we cryptographically challenged? */
Variable *VarHead; /* The head of the variable chain */
Device *mediaDevice; /* Where we're installing from */
@ -63,6 +64,7 @@ globalsInit(void)
{
DebugFD = -1;
ColorDisplay = FALSE;
PkgInteractive = FALSE;
Fake = FALSE;
OnVTY = FALSE;
DialogActive = FALSE;

View File

@ -565,6 +565,35 @@ installStandard(dialogMenuItem *self)
(void)configLinux(self);
#endif
dialog_clear();
if (USAResident) {
if (!msgYesNo("I see that you are \"USA_RESIDENT\" according to your earlier\n"
"response to the CRYPTO distribution dialog. Do you want to try and\n"
"load the rsaref package from the current media? Some restrictions on\n"
"usage may apply, so be sure to read the package installation output!")) {
PkgInteractive = TRUE;
dialog_clear();
if (DITEM_STATUS(package_add("rsaref")) != DITEM_SUCCESS) {
msgConfirm("Unable to find an rsaref package on the current intallation media.\n"
"You may wish to switch media types and try again, perhaps\n"
"from an FTP server which carries this package.");
}
PkgInteractive = FALSE;
dialog_clear();
}
}
else {
if (!msgYesNo("I see that you are not \"USA_RESIDENT\" according to your earlier\n"
"response to the CRYPTO distribution dialog. Do you want to try and\n"
"load the rsaintl package from the current media?")) {
if (DITEM_STATUS(package_add("rsaintl")) != DITEM_SUCCESS) {
msgConfirm("Unable to find an rsaintl package on the current intallation media.\n"
"You may wish to switch media types and try again, perhaps\n"
"from an FTP server which carries this package.");
}
}
}
dialog_clear_norefresh();
if (!msgYesNo("Does this system have a mouse attached to it?"))
dmenuOpenSimple(&MenuMouse, FALSE);

View File

@ -901,8 +901,9 @@ diskLabel(Device *dev)
sprintf(osize, "%d", sz);
val = msgGetInput(osize,
"Please specify the partition size in blocks or append a trailing M for\n"
"megabytes or C for cylinders. %d blocks (%dMB) are free.",
"Please specify the partition size in blocks or append a trailing G for\n"
"gigabytes, M for megabytes, or C for cylinders.\n"
"%d blocks (%dMB) are free.",
sz, sz / ONE_MEG);
if (!val || (size = strtol(val, &cp, 0)) <= 0) {
clear_wins();
@ -912,6 +913,8 @@ diskLabel(Device *dev)
if (*cp) {
if (toupper(*cp) == 'M')
size *= ONE_MEG;
else if (toupper(*cp) == 'G')
size *= ONE_GIG;
else if (toupper(*cp) == 'C')
size *= (label_chunk_info[here].c->disk->bios_hd * label_chunk_info[here].c->disk->bios_sect);
}

View File

@ -167,7 +167,8 @@ package_extract(Device *dev, char *name, Boolean depended)
pid = fork();
if (!pid) {
dup2(pfd[0], 0); close(pfd[0]);
dup2(DebugFD, 1);
if (!PkgInteractive)
dup2(DebugFD, 1);
close(2);
close(pfd[1]);
if (isDebug())

View File

@ -174,6 +174,7 @@
/* One MB worth of blocks */
#define ONE_MEG 2048
#define ONE_GIG (ONE_MEG * 1024)
/* Which selection attributes to use */
#define ATTR_SELECTED (ColorDisplay ? item_selected_attr : item_attr)
@ -340,7 +341,8 @@ extern Boolean RunningAsInit; /* Are we running stand-alone? */
extern Boolean DialogActive; /* Is the dialog() stuff up? */
extern Boolean ColorDisplay; /* Are we on a color display? */
extern Boolean OnVTY; /* On a syscons VTY? */
Boolean USAResident; /* Are we cryptographically challenged? */
Boolean PkgInteractive; /* Is the package going to spew at us? */
Boolean USAResident; /* Are we cryptographically challenged? */
extern Variable *VarHead; /* The head of the variable chain */
extern Device *mediaDevice; /* Where we're getting our distribution from */
extern unsigned int Dists; /* Which distributions we want */

View File

@ -309,6 +309,8 @@ diskPartition(Device *dev)
if (val && (size = strtol(val, &cp, 0)) > 0) {
if (*cp && toupper(*cp) == 'M')
size *= ONE_MEG;
else if (*cp && toupper(*cp) == 'G')
size *= ONE_GIG;
strcpy(tmp, "165");
val = msgGetInput(tmp, "Enter type of partition to create:\n\n"
"Pressing Enter will choose the default, a native FreeBSD\n"
@ -733,6 +735,8 @@ diskPartitionNonInteractive(Device *dev)
/* Look for sz bytes free */
if (*cp && toupper(*cp) == 'M')
sz *= ONE_MEG;
else if (*cp && toupper(*cp) == 'G')
sz *= ONE_GIG;
for (i = 0; chunk_info[i]; i++) {
/* If a chunk is at least sz MB, use it. */
if (chunk_info[i]->type == unused && chunk_info[i]->size >= sz) {

View File

@ -47,6 +47,7 @@ Boolean RunningAsInit; /* Are we running as init? */
Boolean DialogActive; /* Is libdialog initialized? */
Boolean ColorDisplay; /* Are we on a color display? */
Boolean OnVTY; /* Are we on a VTY? */
Boolean PkgInteractive; /* Is the package going to spew at us? */
Boolean USAResident; /* Are we cryptographically challenged? */
Variable *VarHead; /* The head of the variable chain */
Device *mediaDevice; /* Where we're installing from */
@ -63,6 +64,7 @@ globalsInit(void)
{
DebugFD = -1;
ColorDisplay = FALSE;
PkgInteractive = FALSE;
Fake = FALSE;
OnVTY = FALSE;
DialogActive = FALSE;

View File

@ -565,6 +565,35 @@ installStandard(dialogMenuItem *self)
(void)configLinux(self);
#endif
dialog_clear();
if (USAResident) {
if (!msgYesNo("I see that you are \"USA_RESIDENT\" according to your earlier\n"
"response to the CRYPTO distribution dialog. Do you want to try and\n"
"load the rsaref package from the current media? Some restrictions on\n"
"usage may apply, so be sure to read the package installation output!")) {
PkgInteractive = TRUE;
dialog_clear();
if (DITEM_STATUS(package_add("rsaref")) != DITEM_SUCCESS) {
msgConfirm("Unable to find an rsaref package on the current intallation media.\n"
"You may wish to switch media types and try again, perhaps\n"
"from an FTP server which carries this package.");
}
PkgInteractive = FALSE;
dialog_clear();
}
}
else {
if (!msgYesNo("I see that you are not \"USA_RESIDENT\" according to your earlier\n"
"response to the CRYPTO distribution dialog. Do you want to try and\n"
"load the rsaintl package from the current media?")) {
if (DITEM_STATUS(package_add("rsaintl")) != DITEM_SUCCESS) {
msgConfirm("Unable to find an rsaintl package on the current intallation media.\n"
"You may wish to switch media types and try again, perhaps\n"
"from an FTP server which carries this package.");
}
}
}
dialog_clear_norefresh();
if (!msgYesNo("Does this system have a mouse attached to it?"))
dmenuOpenSimple(&MenuMouse, FALSE);

View File

@ -901,8 +901,9 @@ diskLabel(Device *dev)
sprintf(osize, "%d", sz);
val = msgGetInput(osize,
"Please specify the partition size in blocks or append a trailing M for\n"
"megabytes or C for cylinders. %d blocks (%dMB) are free.",
"Please specify the partition size in blocks or append a trailing G for\n"
"gigabytes, M for megabytes, or C for cylinders.\n"
"%d blocks (%dMB) are free.",
sz, sz / ONE_MEG);
if (!val || (size = strtol(val, &cp, 0)) <= 0) {
clear_wins();
@ -912,6 +913,8 @@ diskLabel(Device *dev)
if (*cp) {
if (toupper(*cp) == 'M')
size *= ONE_MEG;
else if (toupper(*cp) == 'G')
size *= ONE_GIG;
else if (toupper(*cp) == 'C')
size *= (label_chunk_info[here].c->disk->bios_hd * label_chunk_info[here].c->disk->bios_sect);
}

View File

@ -174,6 +174,7 @@
/* One MB worth of blocks */
#define ONE_MEG 2048
#define ONE_GIG (ONE_MEG * 1024)
/* Which selection attributes to use */
#define ATTR_SELECTED (ColorDisplay ? item_selected_attr : item_attr)
@ -340,7 +341,8 @@ extern Boolean RunningAsInit; /* Are we running stand-alone? */
extern Boolean DialogActive; /* Is the dialog() stuff up? */
extern Boolean ColorDisplay; /* Are we on a color display? */
extern Boolean OnVTY; /* On a syscons VTY? */
Boolean USAResident; /* Are we cryptographically challenged? */
Boolean PkgInteractive; /* Is the package going to spew at us? */
Boolean USAResident; /* Are we cryptographically challenged? */
extern Variable *VarHead; /* The head of the variable chain */
extern Device *mediaDevice; /* Where we're getting our distribution from */
extern unsigned int Dists; /* Which distributions we want */

View File

@ -309,6 +309,8 @@ diskPartition(Device *dev)
if (val && (size = strtol(val, &cp, 0)) > 0) {
if (*cp && toupper(*cp) == 'M')
size *= ONE_MEG;
else if (*cp && toupper(*cp) == 'G')
size *= ONE_GIG;
strcpy(tmp, "165");
val = msgGetInput(tmp, "Enter type of partition to create:\n\n"
"Pressing Enter will choose the default, a native FreeBSD\n"
@ -733,6 +735,8 @@ diskPartitionNonInteractive(Device *dev)
/* Look for sz bytes free */
if (*cp && toupper(*cp) == 'M')
sz *= ONE_MEG;
else if (*cp && toupper(*cp) == 'G')
sz *= ONE_GIG;
for (i = 0; chunk_info[i]; i++) {
/* If a chunk is at least sz MB, use it. */
if (chunk_info[i]->type == unused && chunk_info[i]->size >= sz) {

View File

@ -47,6 +47,7 @@ Boolean RunningAsInit; /* Are we running as init? */
Boolean DialogActive; /* Is libdialog initialized? */
Boolean ColorDisplay; /* Are we on a color display? */
Boolean OnVTY; /* Are we on a VTY? */
Boolean PkgInteractive; /* Is the package going to spew at us? */
Boolean USAResident; /* Are we cryptographically challenged? */
Variable *VarHead; /* The head of the variable chain */
Device *mediaDevice; /* Where we're installing from */
@ -63,6 +64,7 @@ globalsInit(void)
{
DebugFD = -1;
ColorDisplay = FALSE;
PkgInteractive = FALSE;
Fake = FALSE;
OnVTY = FALSE;
DialogActive = FALSE;

View File

@ -565,6 +565,35 @@ installStandard(dialogMenuItem *self)
(void)configLinux(self);
#endif
dialog_clear();
if (USAResident) {
if (!msgYesNo("I see that you are \"USA_RESIDENT\" according to your earlier\n"
"response to the CRYPTO distribution dialog. Do you want to try and\n"
"load the rsaref package from the current media? Some restrictions on\n"
"usage may apply, so be sure to read the package installation output!")) {
PkgInteractive = TRUE;
dialog_clear();
if (DITEM_STATUS(package_add("rsaref")) != DITEM_SUCCESS) {
msgConfirm("Unable to find an rsaref package on the current intallation media.\n"
"You may wish to switch media types and try again, perhaps\n"
"from an FTP server which carries this package.");
}
PkgInteractive = FALSE;
dialog_clear();
}
}
else {
if (!msgYesNo("I see that you are not \"USA_RESIDENT\" according to your earlier\n"
"response to the CRYPTO distribution dialog. Do you want to try and\n"
"load the rsaintl package from the current media?")) {
if (DITEM_STATUS(package_add("rsaintl")) != DITEM_SUCCESS) {
msgConfirm("Unable to find an rsaintl package on the current intallation media.\n"
"You may wish to switch media types and try again, perhaps\n"
"from an FTP server which carries this package.");
}
}
}
dialog_clear_norefresh();
if (!msgYesNo("Does this system have a mouse attached to it?"))
dmenuOpenSimple(&MenuMouse, FALSE);

View File

@ -901,8 +901,9 @@ diskLabel(Device *dev)
sprintf(osize, "%d", sz);
val = msgGetInput(osize,
"Please specify the partition size in blocks or append a trailing M for\n"
"megabytes or C for cylinders. %d blocks (%dMB) are free.",
"Please specify the partition size in blocks or append a trailing G for\n"
"gigabytes, M for megabytes, or C for cylinders.\n"
"%d blocks (%dMB) are free.",
sz, sz / ONE_MEG);
if (!val || (size = strtol(val, &cp, 0)) <= 0) {
clear_wins();
@ -912,6 +913,8 @@ diskLabel(Device *dev)
if (*cp) {
if (toupper(*cp) == 'M')
size *= ONE_MEG;
else if (toupper(*cp) == 'G')
size *= ONE_GIG;
else if (toupper(*cp) == 'C')
size *= (label_chunk_info[here].c->disk->bios_hd * label_chunk_info[here].c->disk->bios_sect);
}

View File

@ -167,7 +167,8 @@ package_extract(Device *dev, char *name, Boolean depended)
pid = fork();
if (!pid) {
dup2(pfd[0], 0); close(pfd[0]);
dup2(DebugFD, 1);
if (!PkgInteractive)
dup2(DebugFD, 1);
close(2);
close(pfd[1]);
if (isDebug())

View File

@ -174,6 +174,7 @@
/* One MB worth of blocks */
#define ONE_MEG 2048
#define ONE_GIG (ONE_MEG * 1024)
/* Which selection attributes to use */
#define ATTR_SELECTED (ColorDisplay ? item_selected_attr : item_attr)
@ -340,7 +341,8 @@ extern Boolean RunningAsInit; /* Are we running stand-alone? */
extern Boolean DialogActive; /* Is the dialog() stuff up? */
extern Boolean ColorDisplay; /* Are we on a color display? */
extern Boolean OnVTY; /* On a syscons VTY? */
Boolean USAResident; /* Are we cryptographically challenged? */
Boolean PkgInteractive; /* Is the package going to spew at us? */
Boolean USAResident; /* Are we cryptographically challenged? */
extern Variable *VarHead; /* The head of the variable chain */
extern Device *mediaDevice; /* Where we're getting our distribution from */
extern unsigned int Dists; /* Which distributions we want */