Implement the geometry command. Clean up the help a little.

This commit is contained in:
jkh 1995-05-08 01:27:07 +00:00
parent dd5b13ab4b
commit f8629aa1a3
6 changed files with 72 additions and 24 deletions

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: devices.c,v 1.8 1995/05/07 05:58:55 jkh Exp $
* $Id: devices.c,v 1.9 1995/05/07 22:07:50 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -239,8 +239,19 @@ device_slice_disk(struct disk *d)
}
break;
case 'G':
/* Set geometry */
case 'G': {
char *val, geometry[80];
snprintf(geometry, 80, "%lu/%lu/%lu",
d->bios_cyl, d->bios_hd, d->bios_sect);
val = msgGetInput(geometry,
"Please specify the new geometry in cyl/hd/sect format.\nDon't forget to use the two slash (/) separator characters!\nIt's not possible to parse the field without them.");
if (val) {
d->bios_cyl = strtol(val, &val, 0);
d->bios_hd = strtol(val + 1, &val, 0);
d->bios_sect = strtol(val + 1, 0, 0);
}
}
break;
case 'S':

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.9 1995/05/08 00:38:02 jkh Exp $
* $Id: disks.c,v 1.10 1995/05/08 00:56:28 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -551,7 +551,7 @@ partition_disks(struct disk **disks)
break;
case 'W':
if (!msgYesNo("Are you sure you want to go into Wizard mode?\nThis is an entirely documented feature which you are not\nexpected to understand!")) {
if (!msgYesNo("Are you sure you want to go into Wizard mode?\n\nThis is an entirely undocumented feature which you are not\nexpected to understand!")) {
int i;
clear();
@ -592,14 +592,19 @@ write_disks(struct disk **disks)
for (i = 0; disks[i]; i++) {
if (contains_root_partition(disks[i]))
Set_Boot_Blocks(disks[i], boot1, boot2);
dialog_clear();
if (i == 0 && !msgYesNo("Would you like to install a boot manager?\n\nThis will allow you to easily select between other operating systems\non the first disk, or boot from a disk other than the first."))
Set_Boot_Mgr(disks[i], bteasy17);
else if (i == 0 && !msgYesNo("Would you like to remove an existing boot manager?"))
Set_Boot_Mgr(disks[i], mbr);
else {
dialog_clear();
if (i == 0 && !msgYesNo("Would you like to remove an existing boot manager?"))
Set_Boot_Mgr(disks[i], mbr);
}
dialog_clear();
if (!msgYesNo("Last Chance! Are you sure you want to write out\nall these changes to disk?")) {
Write_Disk(disks[i]);
return 0;
}
return 0;
}
return 1;
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: devices.c,v 1.8 1995/05/07 05:58:55 jkh Exp $
* $Id: devices.c,v 1.9 1995/05/07 22:07:50 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -239,8 +239,19 @@ device_slice_disk(struct disk *d)
}
break;
case 'G':
/* Set geometry */
case 'G': {
char *val, geometry[80];
snprintf(geometry, 80, "%lu/%lu/%lu",
d->bios_cyl, d->bios_hd, d->bios_sect);
val = msgGetInput(geometry,
"Please specify the new geometry in cyl/hd/sect format.\nDon't forget to use the two slash (/) separator characters!\nIt's not possible to parse the field without them.");
if (val) {
d->bios_cyl = strtol(val, &val, 0);
d->bios_hd = strtol(val + 1, &val, 0);
d->bios_sect = strtol(val + 1, 0, 0);
}
}
break;
case 'S':

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.9 1995/05/08 00:38:02 jkh Exp $
* $Id: disks.c,v 1.10 1995/05/08 00:56:28 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -551,7 +551,7 @@ partition_disks(struct disk **disks)
break;
case 'W':
if (!msgYesNo("Are you sure you want to go into Wizard mode?\nThis is an entirely documented feature which you are not\nexpected to understand!")) {
if (!msgYesNo("Are you sure you want to go into Wizard mode?\n\nThis is an entirely undocumented feature which you are not\nexpected to understand!")) {
int i;
clear();
@ -592,14 +592,19 @@ write_disks(struct disk **disks)
for (i = 0; disks[i]; i++) {
if (contains_root_partition(disks[i]))
Set_Boot_Blocks(disks[i], boot1, boot2);
dialog_clear();
if (i == 0 && !msgYesNo("Would you like to install a boot manager?\n\nThis will allow you to easily select between other operating systems\non the first disk, or boot from a disk other than the first."))
Set_Boot_Mgr(disks[i], bteasy17);
else if (i == 0 && !msgYesNo("Would you like to remove an existing boot manager?"))
Set_Boot_Mgr(disks[i], mbr);
else {
dialog_clear();
if (i == 0 && !msgYesNo("Would you like to remove an existing boot manager?"))
Set_Boot_Mgr(disks[i], mbr);
}
dialog_clear();
if (!msgYesNo("Last Chance! Are you sure you want to write out\nall these changes to disk?")) {
Write_Disk(disks[i]);
return 0;
}
return 0;
}
return 1;
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: devices.c,v 1.8 1995/05/07 05:58:55 jkh Exp $
* $Id: devices.c,v 1.9 1995/05/07 22:07:50 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -239,8 +239,19 @@ device_slice_disk(struct disk *d)
}
break;
case 'G':
/* Set geometry */
case 'G': {
char *val, geometry[80];
snprintf(geometry, 80, "%lu/%lu/%lu",
d->bios_cyl, d->bios_hd, d->bios_sect);
val = msgGetInput(geometry,
"Please specify the new geometry in cyl/hd/sect format.\nDon't forget to use the two slash (/) separator characters!\nIt's not possible to parse the field without them.");
if (val) {
d->bios_cyl = strtol(val, &val, 0);
d->bios_hd = strtol(val + 1, &val, 0);
d->bios_sect = strtol(val + 1, 0, 0);
}
}
break;
case 'S':

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.9 1995/05/08 00:38:02 jkh Exp $
* $Id: disks.c,v 1.10 1995/05/08 00:56:28 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -551,7 +551,7 @@ partition_disks(struct disk **disks)
break;
case 'W':
if (!msgYesNo("Are you sure you want to go into Wizard mode?\nThis is an entirely documented feature which you are not\nexpected to understand!")) {
if (!msgYesNo("Are you sure you want to go into Wizard mode?\n\nThis is an entirely undocumented feature which you are not\nexpected to understand!")) {
int i;
clear();
@ -592,14 +592,19 @@ write_disks(struct disk **disks)
for (i = 0; disks[i]; i++) {
if (contains_root_partition(disks[i]))
Set_Boot_Blocks(disks[i], boot1, boot2);
dialog_clear();
if (i == 0 && !msgYesNo("Would you like to install a boot manager?\n\nThis will allow you to easily select between other operating systems\non the first disk, or boot from a disk other than the first."))
Set_Boot_Mgr(disks[i], bteasy17);
else if (i == 0 && !msgYesNo("Would you like to remove an existing boot manager?"))
Set_Boot_Mgr(disks[i], mbr);
else {
dialog_clear();
if (i == 0 && !msgYesNo("Would you like to remove an existing boot manager?"))
Set_Boot_Mgr(disks[i], mbr);
}
dialog_clear();
if (!msgYesNo("Last Chance! Are you sure you want to write out\nall these changes to disk?")) {
Write_Disk(disks[i]);
return 0;
}
return 0;
}
return 1;
}