1995-05-16 02:53:31 +00:00
|
|
|
/*
|
1999-08-28 01:35:59 +00:00
|
|
|
* $FreeBSD$
|
1995-05-16 02:53:31 +00:00
|
|
|
*
|
|
|
|
* Copyright (c) 1995
|
|
|
|
* Jordan Hubbard. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
1995-05-30 08:29:07 +00:00
|
|
|
* notice, this list of conditions and the following disclaimer,
|
|
|
|
* verbatim and that no modifications are made prior to this
|
1995-05-16 02:53:31 +00:00
|
|
|
* point in the file.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2011-11-24 18:37:16 +00:00
|
|
|
#include <sys/types.h>
|
1995-05-16 02:53:31 +00:00
|
|
|
#include <ctype.h>
|
2004-03-16 17:07:06 +00:00
|
|
|
#include <inttypes.h>
|
2004-08-02 23:18:48 +00:00
|
|
|
#include <libdisk.h>
|
1995-05-16 02:53:31 +00:00
|
|
|
#include <sys/disklabel.h>
|
1995-09-18 16:53:06 +00:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/sysctl.h>
|
1995-05-16 02:53:31 +00:00
|
|
|
|
2011-11-24 18:37:16 +00:00
|
|
|
#include "sade.h"
|
|
|
|
|
2002-01-07 07:51:24 +00:00
|
|
|
#define AUTO_HOME 0 /* do not create /home automatically */
|
|
|
|
|
1995-05-16 02:53:31 +00:00
|
|
|
/*
|
|
|
|
* Everything to do with editing the contents of disk labels.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* A nice message we use a lot in the disklabel editor */
|
|
|
|
#define MSG_NOT_APPLICABLE "That option is not applicable here"
|
|
|
|
|
|
|
|
/* Where to start printing the freebsd slices */
|
|
|
|
#define CHUNK_SLICE_START_ROW 2
|
1995-05-19 02:19:15 +00:00
|
|
|
#define CHUNK_PART_START_ROW 11
|
1995-05-16 02:53:31 +00:00
|
|
|
|
|
|
|
/* The smallest filesystem we're willing to create */
|
1995-05-22 14:10:25 +00:00
|
|
|
#define FS_MIN_SIZE ONE_MEG
|
1995-05-16 02:53:31 +00:00
|
|
|
|
2001-12-09 09:47:09 +00:00
|
|
|
/*
|
|
|
|
* Minimum partition sizes
|
|
|
|
*/
|
2003-05-24 21:12:14 +00:00
|
|
|
#if defined(__alpha__) || defined(__ia64__) || defined(__sparc64__) || defined(__amd64__)
|
2002-12-15 12:05:00 +00:00
|
|
|
#define ROOT_MIN_SIZE 128
|
1999-03-09 12:36:28 +00:00
|
|
|
#else
|
2002-12-15 12:05:00 +00:00
|
|
|
#define ROOT_MIN_SIZE 118
|
1999-03-09 12:36:28 +00:00
|
|
|
#endif
|
1999-12-17 02:02:51 +00:00
|
|
|
#define SWAP_MIN_SIZE 32
|
2005-12-30 21:45:10 +00:00
|
|
|
#define USR_MIN_SIZE 128
|
1999-03-30 04:09:21 +00:00
|
|
|
#define VAR_MIN_SIZE 20
|
2001-12-10 02:18:05 +00:00
|
|
|
#define TMP_MIN_SIZE 20
|
2001-12-09 09:47:09 +00:00
|
|
|
#define HOME_MIN_SIZE 20
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Swap size limit for auto-partitioning (4G).
|
|
|
|
*/
|
|
|
|
#define SWAP_AUTO_LIMIT_SIZE 4096
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Default partition sizes. If we do not have sufficient disk space
|
|
|
|
* for this configuration we scale things relative to the NOM vs DEFAULT
|
|
|
|
* sizes. If the disk is larger then /home will get any remaining space.
|
|
|
|
*/
|
2005-08-16 13:19:17 +00:00
|
|
|
#define ROOT_DEFAULT_SIZE 512
|
|
|
|
#define USR_DEFAULT_SIZE 8192
|
|
|
|
#define VAR_DEFAULT_SIZE 1024
|
|
|
|
#define TMP_DEFAULT_SIZE 512
|
2001-12-09 09:47:09 +00:00
|
|
|
#define HOME_DEFAULT_SIZE USR_DEFAULT_SIZE
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Nominal partition sizes. These are used to scale the default sizes down
|
|
|
|
* when we have insufficient disk space. If this isn't sufficient we scale
|
|
|
|
* down using the MIN sizes instead.
|
|
|
|
*/
|
2005-08-16 13:19:17 +00:00
|
|
|
#define ROOT_NOMINAL_SIZE 256
|
|
|
|
#define USR_NOMINAL_SIZE 1536
|
|
|
|
#define VAR_NOMINAL_SIZE 128
|
|
|
|
#define TMP_NOMINAL_SIZE 128
|
2001-12-09 09:47:09 +00:00
|
|
|
#define HOME_NOMINAL_SIZE USR_NOMINAL_SIZE
|
1995-05-16 02:53:31 +00:00
|
|
|
|
1996-04-28 22:54:21 +00:00
|
|
|
/* The bottom-most row we're allowed to scribble on */
|
1997-09-09 16:32:01 +00:00
|
|
|
#define CHUNK_ROW_MAX 16
|
1996-04-28 22:54:21 +00:00
|
|
|
|
|
|
|
|
1995-05-16 02:53:31 +00:00
|
|
|
/* All the chunks currently displayed on the screen */
|
|
|
|
static struct {
|
|
|
|
struct chunk *c;
|
|
|
|
PartType type;
|
|
|
|
} label_chunk_info[MAX_CHUNKS + 1];
|
|
|
|
static int here;
|
|
|
|
|
1997-09-09 16:32:01 +00:00
|
|
|
/*** with this value we try to track the most recently added label ***/
|
|
|
|
static int label_focus = 0, pslice_focus = 0;
|
|
|
|
|
1997-10-12 16:21:21 +00:00
|
|
|
static int diskLabel(Device *dev);
|
|
|
|
static int diskLabelNonInteractive(Device *dev);
|
2011-11-24 15:47:01 +00:00
|
|
|
static char *try_auto_label(Device *dev, int perc, int *req);
|
1997-10-12 16:21:21 +00:00
|
|
|
|
|
|
|
static int
|
|
|
|
labelHook(dialogMenuItem *selected)
|
|
|
|
{
|
|
|
|
Device **devs = NULL;
|
|
|
|
|
|
|
|
devs = deviceFind(selected->prompt, DEVICE_TYPE_DISK);
|
|
|
|
if (!devs) {
|
|
|
|
msgConfirm("Unable to find disk %s!", selected->prompt);
|
|
|
|
return DITEM_FAILURE;
|
|
|
|
}
|
2011-11-24 15:47:01 +00:00
|
|
|
diskLabel(devs[0]);
|
1999-12-14 04:25:29 +00:00
|
|
|
return DITEM_SUCCESS;
|
1997-10-12 16:21:21 +00:00
|
|
|
}
|
|
|
|
|
1995-12-07 10:34:59 +00:00
|
|
|
int
|
1996-04-07 03:52:36 +00:00
|
|
|
diskLabelEditor(dialogMenuItem *self)
|
1995-12-07 10:34:59 +00:00
|
|
|
{
|
1997-10-12 16:21:21 +00:00
|
|
|
DMenu *menu;
|
1995-12-07 10:34:59 +00:00
|
|
|
Device **devs;
|
2011-11-24 15:47:01 +00:00
|
|
|
int result;
|
1995-12-07 10:34:59 +00:00
|
|
|
|
2011-11-24 15:47:01 +00:00
|
|
|
devs = deviceFind(variable_get(VAR_DISK), DEVICE_TYPE_DISK);
|
|
|
|
if (devs == NULL) {
|
1995-12-07 10:34:59 +00:00
|
|
|
msgConfirm("No disks found! Please verify that your disk controller is being\n"
|
|
|
|
"properly probed at boot time. See the Hardware Guide on the\n"
|
|
|
|
"Documentation menu for clues on diagnosing this type of problem.");
|
1996-04-13 13:32:15 +00:00
|
|
|
return DITEM_FAILURE;
|
1995-12-07 10:34:59 +00:00
|
|
|
}
|
1997-10-12 16:21:21 +00:00
|
|
|
else {
|
|
|
|
/* No disks are selected, fall-back case now */
|
2011-11-24 15:47:01 +00:00
|
|
|
int cnt = deviceCount(devs);
|
1997-10-12 16:21:21 +00:00
|
|
|
if (cnt == 1) {
|
2002-05-31 13:38:17 +00:00
|
|
|
if (variable_get(VAR_NONINTERACTIVE) &&
|
|
|
|
!variable_get(VAR_DISKINTERACTIVE))
|
2011-11-24 15:47:01 +00:00
|
|
|
result = diskLabelNonInteractive(devs[0]);
|
1997-10-12 16:21:21 +00:00
|
|
|
else
|
2011-11-24 15:47:01 +00:00
|
|
|
result = diskLabel(devs[0]);
|
1997-10-12 16:21:21 +00:00
|
|
|
}
|
|
|
|
else {
|
2011-11-24 15:47:01 +00:00
|
|
|
menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, labelHook);
|
1997-10-12 16:21:21 +00:00
|
|
|
if (!menu) {
|
|
|
|
msgConfirm("No devices suitable for installation found!\n\n"
|
|
|
|
"Please verify that your disk controller (and attached drives)\n"
|
|
|
|
"were detected properly. This can be done by pressing the\n"
|
|
|
|
"[Scroll Lock] key and using the Arrow keys to move back to\n"
|
|
|
|
"the boot messages. Press [Scroll Lock] again to return.");
|
2011-11-24 15:47:01 +00:00
|
|
|
result = DITEM_FAILURE;
|
1997-10-12 16:21:21 +00:00
|
|
|
}
|
|
|
|
else {
|
2011-11-24 18:37:16 +00:00
|
|
|
result = dmenuOpen(menu) ? DITEM_SUCCESS : DITEM_FAILURE;
|
1997-10-12 16:21:21 +00:00
|
|
|
free(menu);
|
|
|
|
}
|
|
|
|
}
|
1995-12-07 10:34:59 +00:00
|
|
|
}
|
2011-11-24 15:47:01 +00:00
|
|
|
if (DITEM_STATUS(result) != DITEM_FAILURE) {
|
2001-03-12 10:18:54 +00:00
|
|
|
if (variable_cmp(DISK_LABELLED, "written"))
|
1999-02-05 22:15:52 +00:00
|
|
|
variable_set2(DISK_LABELLED, "yes", 0);
|
1996-10-06 11:40:31 +00:00
|
|
|
}
|
2011-11-24 15:47:01 +00:00
|
|
|
return result;
|
1995-12-07 10:34:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2011-11-24 15:47:01 +00:00
|
|
|
diskLabelCommit(Device *dev)
|
1995-12-07 10:34:59 +00:00
|
|
|
{
|
|
|
|
char *cp;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* Already done? */
|
1996-07-09 03:07:51 +00:00
|
|
|
if ((cp = variable_get(DISK_LABELLED)) && strcmp(cp, "yes"))
|
1996-04-13 13:32:15 +00:00
|
|
|
i = DITEM_SUCCESS;
|
1995-12-07 10:34:59 +00:00
|
|
|
else if (!cp) {
|
|
|
|
msgConfirm("You must assign disk labels before this option can be used.");
|
1996-04-13 13:32:15 +00:00
|
|
|
i = DITEM_FAILURE;
|
1995-12-07 10:34:59 +00:00
|
|
|
}
|
|
|
|
/* The routine will guard against redundant writes, just as this one does */
|
2011-11-24 15:47:01 +00:00
|
|
|
else if (DITEM_STATUS(diskPartitionWrite(dev)) != DITEM_SUCCESS)
|
1996-04-13 13:32:15 +00:00
|
|
|
i = DITEM_FAILURE;
|
2011-11-24 15:47:01 +00:00
|
|
|
else if (DITEM_STATUS(installFilesystems(dev)) != DITEM_SUCCESS)
|
1996-04-13 13:32:15 +00:00
|
|
|
i = DITEM_FAILURE;
|
1995-12-07 10:34:59 +00:00
|
|
|
else {
|
|
|
|
msgInfo("All filesystem information written successfully.");
|
1999-02-05 22:15:52 +00:00
|
|
|
variable_set2(DISK_LABELLED, "written", 0);
|
1996-04-13 13:32:15 +00:00
|
|
|
i = DITEM_SUCCESS;
|
1995-12-07 10:34:59 +00:00
|
|
|
}
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
1995-05-16 02:53:31 +00:00
|
|
|
/* See if we're already using a desired partition name */
|
|
|
|
static Boolean
|
|
|
|
check_conflict(char *name)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
1995-05-25 18:48:33 +00:00
|
|
|
for (i = 0; label_chunk_info[i].c; i++)
|
2003-11-02 08:58:57 +00:00
|
|
|
if ((label_chunk_info[i].type == PART_FILESYSTEM || label_chunk_info[i].type == PART_FAT
|
|
|
|
|| label_chunk_info[i].type == PART_EFI) && label_chunk_info[i].c->private_data
|
1996-03-24 18:57:37 +00:00
|
|
|
&& !strcmp(((PartInfo *)label_chunk_info[i].c->private_data)->mountpoint, name))
|
1995-05-16 02:53:31 +00:00
|
|
|
return TRUE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* How much space is in this FreeBSD slice? */
|
2004-03-16 17:07:06 +00:00
|
|
|
static daddr_t
|
1995-05-16 02:53:31 +00:00
|
|
|
space_free(struct chunk *c)
|
|
|
|
{
|
1995-12-07 10:34:59 +00:00
|
|
|
struct chunk *c1;
|
2004-03-16 17:07:06 +00:00
|
|
|
daddr_t sz = c->size;
|
1995-05-16 02:53:31 +00:00
|
|
|
|
1995-12-07 10:34:59 +00:00
|
|
|
for (c1 = c->part; c1; c1 = c1->next) {
|
1995-05-16 02:53:31 +00:00
|
|
|
if (c1->type != unused)
|
|
|
|
sz -= c1->size;
|
|
|
|
}
|
|
|
|
if (sz < 0)
|
|
|
|
msgFatal("Partitions are larger than actual chunk??");
|
|
|
|
return sz;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Snapshot the current situation into the displayed chunks structure */
|
|
|
|
static void
|
2011-11-24 15:47:01 +00:00
|
|
|
record_label_chunks(Device *dev)
|
1995-05-16 02:53:31 +00:00
|
|
|
{
|
2011-11-24 15:47:01 +00:00
|
|
|
int j, p;
|
1995-05-16 02:53:31 +00:00
|
|
|
struct chunk *c1, *c2;
|
2011-11-24 15:47:01 +00:00
|
|
|
Disk *d = (Disk *)dev->private;
|
1995-05-16 02:53:31 +00:00
|
|
|
|
|
|
|
j = p = 0;
|
1995-05-16 11:37:27 +00:00
|
|
|
/* First buzz through and pick up the FreeBSD slices */
|
2011-11-24 15:47:01 +00:00
|
|
|
if (!d->chunks)
|
|
|
|
msgFatal("No chunk list found for %s!", d->name);
|
1995-05-16 11:37:27 +00:00
|
|
|
|
2003-11-02 08:58:57 +00:00
|
|
|
#ifdef __ia64__
|
2011-11-24 15:47:01 +00:00
|
|
|
label_chunk_info[j].type = PART_SLICE;
|
|
|
|
label_chunk_info[j].c = d->chunks;
|
|
|
|
j++;
|
2003-11-02 08:58:57 +00:00
|
|
|
#endif
|
|
|
|
|
2011-11-24 15:47:01 +00:00
|
|
|
/* Put the slice entries first */
|
|
|
|
for (c1 = d->chunks->part; c1; c1 = c1->next) {
|
|
|
|
if (c1->type == freebsd) {
|
|
|
|
label_chunk_info[j].type = PART_SLICE;
|
|
|
|
label_chunk_info[j].c = c1;
|
|
|
|
++j;
|
|
|
|
}
|
2004-05-15 05:06:19 +00:00
|
|
|
#ifdef __powerpc__
|
2011-11-24 15:47:01 +00:00
|
|
|
if (c1->type == apple) {
|
|
|
|
label_chunk_info[j].type = PART_SLICE;
|
|
|
|
label_chunk_info[j].c = c1;
|
|
|
|
++j;
|
|
|
|
}
|
2004-05-15 05:06:19 +00:00
|
|
|
#endif
|
1995-05-16 02:53:31 +00:00
|
|
|
}
|
1995-12-07 10:34:59 +00:00
|
|
|
|
2011-11-24 15:47:01 +00:00
|
|
|
/* Then buzz through and pick up the partitions */
|
|
|
|
for (c1 = d->chunks->part; c1; c1 = c1->next) {
|
|
|
|
if (c1->type == freebsd) {
|
|
|
|
for (c2 = c1->part; c2; c2 = c2->next) {
|
|
|
|
if (c2->type == part) {
|
|
|
|
if (c2->subtype == FS_SWAP)
|
|
|
|
label_chunk_info[j].type = PART_SWAP;
|
|
|
|
else
|
|
|
|
label_chunk_info[j].type = PART_FILESYSTEM;
|
|
|
|
label_chunk_info[j].c = c2;
|
|
|
|
++j;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (c1->type == fat) {
|
|
|
|
label_chunk_info[j].type = PART_FAT;
|
|
|
|
label_chunk_info[j].c = c1;
|
|
|
|
++j;
|
|
|
|
}
|
2003-11-01 20:14:06 +00:00
|
|
|
#ifdef __ia64__
|
2011-11-24 15:47:01 +00:00
|
|
|
else if (c1->type == efi) {
|
|
|
|
label_chunk_info[j].type = PART_EFI;
|
|
|
|
label_chunk_info[j].c = c1;
|
|
|
|
++j;
|
|
|
|
}
|
|
|
|
else if (c1->type == part) {
|
|
|
|
if (c1->subtype == FS_SWAP)
|
|
|
|
label_chunk_info[j].type = PART_SWAP;
|
|
|
|
else
|
|
|
|
label_chunk_info[j].type = PART_FILESYSTEM;
|
|
|
|
label_chunk_info[j].c = c1;
|
|
|
|
++j;
|
|
|
|
}
|
2004-05-15 05:06:19 +00:00
|
|
|
#endif
|
|
|
|
#ifdef __powerpc__
|
2011-11-24 15:47:01 +00:00
|
|
|
else if (c1->type == apple) {
|
|
|
|
for (c2 = c1->part; c2; c2 = c2->next) {
|
|
|
|
if (c2->type == part) {
|
|
|
|
if (c2->subtype == FS_SWAP)
|
|
|
|
label_chunk_info[j].type = PART_SWAP;
|
|
|
|
else
|
|
|
|
label_chunk_info[j].type = PART_FILESYSTEM;
|
|
|
|
label_chunk_info[j].c = c2;
|
|
|
|
++j;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-11-01 20:14:06 +00:00
|
|
|
#endif
|
1995-05-16 02:53:31 +00:00
|
|
|
}
|
|
|
|
label_chunk_info[j].c = NULL;
|
1997-09-09 16:32:01 +00:00
|
|
|
if (here >= j) {
|
1995-05-16 02:53:31 +00:00
|
|
|
here = j ? j - 1 : 0;
|
1997-09-09 16:32:01 +00:00
|
|
|
}
|
1995-05-16 02:53:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* A new partition entry */
|
|
|
|
static PartInfo *
|
2004-08-04 05:40:15 +00:00
|
|
|
new_part(PartType type, char *mpoint, Boolean newfs)
|
1995-05-16 02:53:31 +00:00
|
|
|
{
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
PartInfo *pi;
|
1995-06-11 19:33:05 +00:00
|
|
|
|
|
|
|
if (!mpoint)
|
2004-08-04 05:40:15 +00:00
|
|
|
mpoint = (type == PART_EFI) ? "/efi" : "/change_me";
|
1995-05-16 02:53:31 +00:00
|
|
|
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
pi = (PartInfo *)safe_malloc(sizeof(PartInfo));
|
|
|
|
sstrncpy(pi->mountpoint, mpoint, FILENAME_MAX);
|
|
|
|
|
|
|
|
pi->do_newfs = newfs;
|
|
|
|
|
2004-08-04 05:40:15 +00:00
|
|
|
if (type == PART_EFI) {
|
|
|
|
pi->newfs_type = NEWFS_MSDOS;
|
|
|
|
} else {
|
|
|
|
pi->newfs_type = NEWFS_UFS;
|
|
|
|
strcpy(pi->newfs_data.newfs_ufs.user_options, "");
|
|
|
|
pi->newfs_data.newfs_ufs.acls = FALSE;
|
|
|
|
pi->newfs_data.newfs_ufs.multilabel = FALSE;
|
|
|
|
pi->newfs_data.newfs_ufs.softupdates = strcmp(mpoint, "/");
|
2003-04-21 20:57:20 +00:00
|
|
|
#ifdef PC98
|
2004-08-04 05:40:15 +00:00
|
|
|
pi->newfs_data.newfs_ufs.ufs1 = TRUE;
|
2003-04-21 20:57:20 +00:00
|
|
|
#else
|
2004-08-04 05:40:15 +00:00
|
|
|
pi->newfs_data.newfs_ufs.ufs1 = FALSE;
|
2003-04-21 20:57:20 +00:00
|
|
|
#endif
|
2004-08-04 05:40:15 +00:00
|
|
|
}
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
|
|
|
|
return pi;
|
1995-05-16 02:53:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Get the mountpoint for a partition and save it away */
|
1995-12-07 10:34:59 +00:00
|
|
|
static PartInfo *
|
2004-08-04 05:40:15 +00:00
|
|
|
get_mountpoint(PartType type, struct chunk *old)
|
1995-05-16 02:53:31 +00:00
|
|
|
{
|
|
|
|
char *val;
|
|
|
|
PartInfo *tmp;
|
2002-11-12 20:26:52 +00:00
|
|
|
Boolean newfs;
|
1995-05-16 02:53:31 +00:00
|
|
|
|
1996-03-24 18:57:37 +00:00
|
|
|
if (old && old->private_data)
|
|
|
|
tmp = old->private_data;
|
1995-05-28 09:31:44 +00:00
|
|
|
else
|
|
|
|
tmp = NULL;
|
2004-08-04 05:40:15 +00:00
|
|
|
val = (tmp != NULL) ? tmp->mountpoint : (type == PART_EFI) ? "/efi" : NULL;
|
|
|
|
val = msgGetInput(val, "Please specify a mount point for the partition");
|
1995-05-26 11:21:53 +00:00
|
|
|
if (!val || !*val) {
|
1995-05-25 18:48:33 +00:00
|
|
|
if (!old)
|
|
|
|
return NULL;
|
|
|
|
else {
|
1996-03-24 18:57:37 +00:00
|
|
|
free(old->private_data);
|
|
|
|
old->private_data = NULL;
|
1995-05-25 18:48:33 +00:00
|
|
|
}
|
1995-05-21 06:12:44 +00:00
|
|
|
return NULL;
|
1995-05-25 18:48:33 +00:00
|
|
|
}
|
1995-05-21 06:12:44 +00:00
|
|
|
|
|
|
|
/* Is it just the same value? */
|
1995-05-28 09:31:44 +00:00
|
|
|
if (tmp && !strcmp(tmp->mountpoint, val))
|
1995-05-21 06:12:44 +00:00
|
|
|
return NULL;
|
1995-05-28 09:31:44 +00:00
|
|
|
|
|
|
|
/* Did we use it already? */
|
1995-05-21 06:12:44 +00:00
|
|
|
if (check_conflict(val)) {
|
|
|
|
msgConfirm("You already have a mount point for %s assigned!", val);
|
|
|
|
return NULL;
|
1995-05-16 02:53:31 +00:00
|
|
|
}
|
1995-05-28 09:31:44 +00:00
|
|
|
|
|
|
|
/* Is it bogus? */
|
1995-05-21 06:12:44 +00:00
|
|
|
if (*val != '/') {
|
|
|
|
msgConfirm("Mount point must start with a / character");
|
|
|
|
return NULL;
|
|
|
|
}
|
1995-05-28 09:31:44 +00:00
|
|
|
|
|
|
|
/* Is it going to be mounted on root? */
|
1995-05-21 06:12:44 +00:00
|
|
|
if (!strcmp(val, "/")) {
|
|
|
|
if (old)
|
|
|
|
old->flags |= CHUNK_IS_ROOT;
|
1995-05-28 09:31:44 +00:00
|
|
|
}
|
|
|
|
else if (old)
|
1995-05-21 06:12:44 +00:00
|
|
|
old->flags &= ~CHUNK_IS_ROOT;
|
1995-05-28 09:31:44 +00:00
|
|
|
|
2002-11-12 20:40:15 +00:00
|
|
|
newfs = TRUE;
|
2002-11-12 20:26:52 +00:00
|
|
|
if (tmp) {
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
newfs = tmp->do_newfs;
|
2002-11-12 20:26:52 +00:00
|
|
|
safe_free(tmp);
|
|
|
|
}
|
1999-05-07 04:36:21 +00:00
|
|
|
val = string_skipwhite(string_prune(val));
|
2004-08-04 05:40:15 +00:00
|
|
|
tmp = new_part(type, val, newfs);
|
1995-05-21 06:12:44 +00:00
|
|
|
if (old) {
|
1996-03-24 18:57:37 +00:00
|
|
|
old->private_data = tmp;
|
1995-05-21 06:12:44 +00:00
|
|
|
old->private_free = safe_free;
|
|
|
|
}
|
|
|
|
return tmp;
|
1995-05-16 02:53:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Get the type of the new partiton */
|
|
|
|
static PartType
|
|
|
|
get_partition_type(void)
|
|
|
|
{
|
1995-05-21 06:12:44 +00:00
|
|
|
int i;
|
2011-11-24 18:37:16 +00:00
|
|
|
static char *fs_types[] = {
|
2003-11-02 08:58:57 +00:00
|
|
|
#ifdef __ia64__
|
|
|
|
"EFI", "An EFI system partition",
|
|
|
|
#endif
|
|
|
|
"FS", "A file system",
|
|
|
|
"Swap", "A swap partition.",
|
1995-05-16 02:53:31 +00:00
|
|
|
};
|
1999-12-14 04:25:29 +00:00
|
|
|
WINDOW *w = savescr();
|
|
|
|
|
2011-11-24 18:37:16 +00:00
|
|
|
dlg_clr_result();
|
1995-05-21 06:12:44 +00:00
|
|
|
i = dialog_menu("Please choose a partition type",
|
2003-11-02 08:58:57 +00:00
|
|
|
"If you want to use this partition for swap space, select Swap.\n"
|
|
|
|
"If you want to put a filesystem on it, choose FS.",
|
|
|
|
-1, -1,
|
|
|
|
#ifdef __ia64__
|
|
|
|
3, 3,
|
|
|
|
#else
|
|
|
|
2, 2,
|
|
|
|
#endif
|
2011-11-24 18:37:16 +00:00
|
|
|
fs_types);
|
1999-12-14 04:25:29 +00:00
|
|
|
restorescr(w);
|
1995-05-21 06:12:44 +00:00
|
|
|
if (!i) {
|
2003-11-02 08:58:57 +00:00
|
|
|
#ifdef __ia64__
|
2011-11-24 18:37:16 +00:00
|
|
|
if (!strcmp(dialog_vars.input_result, "EFI"))
|
2003-11-02 08:58:57 +00:00
|
|
|
return PART_EFI;
|
|
|
|
#endif
|
2011-11-24 18:37:16 +00:00
|
|
|
if (!strcmp(dialog_vars.input_result, "FS"))
|
1995-05-16 02:53:31 +00:00
|
|
|
return PART_FILESYSTEM;
|
2011-11-24 18:37:16 +00:00
|
|
|
else if (!strcmp(dialog_vars.input_result, "Swap"))
|
1995-05-16 02:53:31 +00:00
|
|
|
return PART_SWAP;
|
|
|
|
}
|
|
|
|
return PART_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If the user wants a special newfs command for this, set it */
|
|
|
|
static void
|
|
|
|
getNewfsCmd(PartInfo *p)
|
|
|
|
{
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
char buffer[NEWFS_CMD_ARGS_MAX];
|
1995-05-16 02:53:31 +00:00
|
|
|
char *val;
|
|
|
|
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
switch (p->newfs_type) {
|
|
|
|
case NEWFS_UFS:
|
|
|
|
snprintf(buffer, NEWFS_CMD_ARGS_MAX, "%s %s %s %s",
|
|
|
|
NEWFS_UFS_CMD, p->newfs_data.newfs_ufs.softupdates ? "-U" : "",
|
2003-04-20 14:08:05 +00:00
|
|
|
p->newfs_data.newfs_ufs.ufs1 ? "-O1" : "-O2",
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
p->newfs_data.newfs_ufs.user_options);
|
|
|
|
break;
|
|
|
|
case NEWFS_MSDOS:
|
|
|
|
snprintf(buffer, NEWFS_CMD_ARGS_MAX, "%s", NEWFS_MSDOS_CMD);
|
|
|
|
break;
|
|
|
|
case NEWFS_CUSTOM:
|
|
|
|
strcpy(buffer, p->newfs_data.newfs_custom.command);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
val = msgGetInput(buffer,
|
|
|
|
"Please enter the newfs command and options you'd like to use in\n"
|
|
|
|
"creating this file system.");
|
|
|
|
if (val != NULL) {
|
|
|
|
p->newfs_type = NEWFS_CUSTOM;
|
|
|
|
strlcpy(p->newfs_data.newfs_custom.command, val, NEWFS_CMD_ARGS_MAX);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
getNewfsOptionalArguments(PartInfo *p)
|
|
|
|
{
|
|
|
|
char buffer[NEWFS_CMD_ARGS_MAX];
|
|
|
|
char *val;
|
|
|
|
|
|
|
|
/* Must be UFS, per argument checking in I/O routines. */
|
|
|
|
|
|
|
|
strlcpy(buffer, p->newfs_data.newfs_ufs.user_options,
|
|
|
|
NEWFS_CMD_ARGS_MAX);
|
|
|
|
val = msgGetInput(buffer,
|
|
|
|
"Please enter any additional UFS newfs options you'd like to\n"
|
|
|
|
"use in creating this file system.");
|
|
|
|
if (val != NULL)
|
|
|
|
strlcpy(p->newfs_data.newfs_ufs.user_options, val,
|
|
|
|
NEWFS_CMD_ARGS_MAX);
|
1995-05-16 02:53:31 +00:00
|
|
|
}
|
|
|
|
|
2001-05-06 02:52:45 +00:00
|
|
|
#define MAX_MOUNT_NAME 9
|
1995-05-16 02:53:31 +00:00
|
|
|
|
|
|
|
#define PART_PART_COL 0
|
1999-12-02 02:55:57 +00:00
|
|
|
#define PART_MOUNT_COL 10
|
1995-05-16 02:53:31 +00:00
|
|
|
#define PART_SIZE_COL (PART_MOUNT_COL + MAX_MOUNT_NAME + 3)
|
1999-07-29 06:28:52 +00:00
|
|
|
#define PART_NEWFS_COL (PART_SIZE_COL + 8)
|
2001-05-06 02:52:45 +00:00
|
|
|
#define PART_OFF 38
|
1995-05-16 02:53:31 +00:00
|
|
|
|
1997-09-09 16:32:01 +00:00
|
|
|
#define TOTAL_AVAIL_LINES (10)
|
|
|
|
#define PSLICE_SHOWABLE (4)
|
|
|
|
|
|
|
|
|
1995-05-16 02:53:31 +00:00
|
|
|
/* stick this all up on the screen */
|
|
|
|
static void
|
|
|
|
print_label_chunks(void)
|
|
|
|
{
|
2004-03-16 17:07:06 +00:00
|
|
|
int i, j, srow, prow, pcol;
|
|
|
|
daddr_t sz;
|
1997-09-09 16:32:01 +00:00
|
|
|
char clrmsg[80];
|
1997-09-20 06:24:17 +00:00
|
|
|
int ChunkPartStartRow;
|
|
|
|
WINDOW *ChunkWin;
|
1997-09-09 16:32:01 +00:00
|
|
|
|
|
|
|
/********************************************************/
|
|
|
|
/*** These values are for controling screen resources ***/
|
|
|
|
/*** Each label line holds up to 2 labels, so beware! ***/
|
|
|
|
/*** strategy will be to try to always make sure the ***/
|
|
|
|
/*** highlighted label is in the active display area. ***/
|
|
|
|
/********************************************************/
|
|
|
|
int pslice_max, label_max;
|
|
|
|
int pslice_count, label_count, label_focus_found, pslice_focus_found;
|
1995-05-16 02:53:31 +00:00
|
|
|
|
|
|
|
attrset(A_REVERSE);
|
|
|
|
mvaddstr(0, 25, "FreeBSD Disklabel Editor");
|
|
|
|
attrset(A_NORMAL);
|
|
|
|
|
1997-09-20 06:24:17 +00:00
|
|
|
/*** Count the number of parition slices ***/
|
|
|
|
pslice_count = 0;
|
|
|
|
for (i = 0; label_chunk_info[i].c ; i++) {
|
|
|
|
if (label_chunk_info[i].type == PART_SLICE)
|
|
|
|
++pslice_count;
|
|
|
|
}
|
|
|
|
pslice_max = pslice_count;
|
2003-11-01 20:14:06 +00:00
|
|
|
|
1997-09-20 06:24:17 +00:00
|
|
|
/*** 4 line max for partition slices ***/
|
|
|
|
if (pslice_max > PSLICE_SHOWABLE) {
|
|
|
|
pslice_max = PSLICE_SHOWABLE;
|
|
|
|
}
|
|
|
|
ChunkPartStartRow = CHUNK_SLICE_START_ROW + 3 + pslice_max;
|
|
|
|
|
|
|
|
/*** View partition slices modulo pslice_max ***/
|
|
|
|
label_max = TOTAL_AVAIL_LINES - pslice_max;
|
|
|
|
|
1995-05-16 02:53:31 +00:00
|
|
|
for (i = 0; i < 2; i++) {
|
1996-04-28 22:54:21 +00:00
|
|
|
mvaddstr(ChunkPartStartRow - 2, PART_PART_COL + (i * PART_OFF), "Part");
|
|
|
|
mvaddstr(ChunkPartStartRow - 1, PART_PART_COL + (i * PART_OFF), "----");
|
1995-05-19 02:19:15 +00:00
|
|
|
|
1996-04-28 22:54:21 +00:00
|
|
|
mvaddstr(ChunkPartStartRow - 2, PART_MOUNT_COL + (i * PART_OFF), "Mount");
|
|
|
|
mvaddstr(ChunkPartStartRow - 1, PART_MOUNT_COL + (i * PART_OFF), "-----");
|
1995-05-16 02:53:31 +00:00
|
|
|
|
1999-07-29 06:28:52 +00:00
|
|
|
mvaddstr(ChunkPartStartRow - 2, PART_SIZE_COL + (i * PART_OFF) + 3, "Size");
|
|
|
|
mvaddstr(ChunkPartStartRow - 1, PART_SIZE_COL + (i * PART_OFF) + 3, "----");
|
1995-05-19 02:19:15 +00:00
|
|
|
|
1996-04-28 22:54:21 +00:00
|
|
|
mvaddstr(ChunkPartStartRow - 2, PART_NEWFS_COL + (i * PART_OFF), "Newfs");
|
|
|
|
mvaddstr(ChunkPartStartRow - 1, PART_NEWFS_COL + (i * PART_OFF), "-----");
|
1995-05-19 02:19:15 +00:00
|
|
|
}
|
1995-05-16 02:53:31 +00:00
|
|
|
srow = CHUNK_SLICE_START_ROW;
|
1996-04-28 22:54:21 +00:00
|
|
|
prow = 0;
|
1995-05-16 02:53:31 +00:00
|
|
|
pcol = 0;
|
|
|
|
|
1997-09-09 16:32:01 +00:00
|
|
|
/*** these variables indicate that the focused item is shown currently ***/
|
|
|
|
label_focus_found = 0;
|
|
|
|
pslice_focus_found = 0;
|
|
|
|
|
|
|
|
label_count = 0;
|
|
|
|
pslice_count = 0;
|
|
|
|
mvprintw(CHUNK_SLICE_START_ROW - 1, 0, " ");
|
|
|
|
mvprintw(CHUNK_SLICE_START_ROW + pslice_max, 0, " ");
|
|
|
|
|
1997-09-20 06:24:17 +00:00
|
|
|
ChunkWin = newwin(CHUNK_ROW_MAX - ChunkPartStartRow, 76, ChunkPartStartRow, 0);
|
|
|
|
|
|
|
|
wclear(ChunkWin);
|
|
|
|
/*** wrefresh(ChunkWin); ***/
|
|
|
|
|
1995-05-25 18:48:33 +00:00
|
|
|
for (i = 0; label_chunk_info[i].c; i++) {
|
1995-05-16 02:53:31 +00:00
|
|
|
/* Is it a slice entry displayed at the top? */
|
|
|
|
if (label_chunk_info[i].type == PART_SLICE) {
|
1997-09-09 16:32:01 +00:00
|
|
|
/*** This causes the new pslice to replace the previous display ***/
|
|
|
|
/*** focus must remain on the most recently active pslice ***/
|
|
|
|
if (pslice_count == pslice_max) {
|
|
|
|
if (pslice_focus_found) {
|
|
|
|
/*** This is where we can mark the more following ***/
|
|
|
|
attrset(A_BOLD);
|
|
|
|
mvprintw(CHUNK_SLICE_START_ROW + pslice_max, 0, "***MORE***");
|
|
|
|
attrset(A_NORMAL);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/*** this is where we set the more previous ***/
|
|
|
|
attrset(A_BOLD);
|
|
|
|
mvprintw(CHUNK_SLICE_START_ROW - 1, 0, "***MORE***");
|
|
|
|
attrset(A_NORMAL);
|
|
|
|
pslice_count = 0;
|
|
|
|
srow = CHUNK_SLICE_START_ROW;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1995-05-16 02:53:31 +00:00
|
|
|
sz = space_free(label_chunk_info[i].c);
|
1996-04-28 22:54:21 +00:00
|
|
|
if (i == here)
|
1996-06-08 09:08:51 +00:00
|
|
|
attrset(ATTR_SELECTED);
|
1997-09-09 16:32:01 +00:00
|
|
|
if (i == pslice_focus)
|
|
|
|
pslice_focus_found = -1;
|
|
|
|
|
2003-11-01 20:14:06 +00:00
|
|
|
if (label_chunk_info[i].c->type == whole) {
|
|
|
|
if (sz >= 100 * ONE_GIG)
|
|
|
|
mvprintw(srow++, 0,
|
2004-03-16 17:07:06 +00:00
|
|
|
"Disk: %s\t\tFree: %jd blocks (%jdGB)",
|
|
|
|
label_chunk_info[i].c->disk->name, (intmax_t)sz,
|
|
|
|
(intmax_t)(sz / ONE_GIG));
|
2003-11-01 20:14:06 +00:00
|
|
|
else
|
|
|
|
mvprintw(srow++, 0,
|
2004-03-16 17:07:06 +00:00
|
|
|
"Disk: %s\t\tFree: %jd blocks (%jdMB)",
|
|
|
|
label_chunk_info[i].c->disk->name, (intmax_t)sz,
|
|
|
|
(intmax_t)(sz / ONE_MEG));
|
2003-11-01 20:14:06 +00:00
|
|
|
} else {
|
|
|
|
if (sz >= 100 * ONE_GIG)
|
2002-12-11 17:36:34 +00:00
|
|
|
mvprintw(srow++, 0,
|
2004-03-16 17:07:06 +00:00
|
|
|
"Disk: %s\tPartition name: %s\tFree: %jd blocks (%jdGB)",
|
2002-12-11 17:36:34 +00:00
|
|
|
label_chunk_info[i].c->disk->name,
|
|
|
|
label_chunk_info[i].c->name,
|
2004-03-16 17:07:06 +00:00
|
|
|
(intmax_t)sz, (intmax_t)(sz / ONE_GIG));
|
2003-11-01 20:14:06 +00:00
|
|
|
else
|
2002-12-11 17:36:34 +00:00
|
|
|
mvprintw(srow++, 0,
|
2004-03-16 17:07:06 +00:00
|
|
|
"Disk: %s\tPartition name: %s\tFree: %jd blocks (%jdMB)",
|
2002-12-11 17:36:34 +00:00
|
|
|
label_chunk_info[i].c->disk->name,
|
|
|
|
label_chunk_info[i].c->name,
|
2004-03-16 17:07:06 +00:00
|
|
|
(intmax_t)sz, (intmax_t)(sz / ONE_MEG));
|
2003-11-01 20:14:06 +00:00
|
|
|
}
|
1996-04-28 22:54:21 +00:00
|
|
|
attrset(A_NORMAL);
|
|
|
|
clrtoeol();
|
|
|
|
move(0, 0);
|
1997-09-20 06:24:17 +00:00
|
|
|
/*** refresh(); ***/
|
1997-09-09 16:32:01 +00:00
|
|
|
++pslice_count;
|
1995-05-16 02:53:31 +00:00
|
|
|
}
|
1996-04-28 22:54:21 +00:00
|
|
|
/* Otherwise it's a DOS, swap or filesystem entry in the Chunk window */
|
1995-05-16 02:53:31 +00:00
|
|
|
else {
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
char onestr[PART_OFF], num[10], *mountpoint, newfs[12];
|
1995-05-16 02:53:31 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* We copy this into a blank-padded string so that it looks like
|
|
|
|
* a solid bar in reverse-video
|
|
|
|
*/
|
|
|
|
memset(onestr, ' ', PART_OFF - 1);
|
|
|
|
onestr[PART_OFF - 1] = '\0';
|
1997-09-09 16:32:01 +00:00
|
|
|
|
|
|
|
/*** Track how many labels have been displayed ***/
|
|
|
|
if (label_count == ((label_max - 1 ) * 2)) {
|
|
|
|
if (label_focus_found) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
label_count = 0;
|
|
|
|
prow = 0;
|
|
|
|
pcol = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1996-04-28 22:54:21 +00:00
|
|
|
/* Go for two columns if we've written one full columns worth */
|
1997-09-09 16:32:01 +00:00
|
|
|
/*** if (prow == (CHUNK_ROW_MAX - ChunkPartStartRow)) ***/
|
|
|
|
if (label_count == label_max - 1) {
|
1995-05-16 02:53:31 +00:00
|
|
|
pcol = PART_OFF;
|
1996-04-28 22:54:21 +00:00
|
|
|
prow = 0;
|
1995-05-16 02:53:31 +00:00
|
|
|
}
|
1995-05-23 02:41:18 +00:00
|
|
|
memcpy(onestr + PART_PART_COL, label_chunk_info[i].c->name, strlen(label_chunk_info[i].c->name));
|
1995-05-16 02:53:31 +00:00
|
|
|
/* If it's a filesystem, display the mountpoint */
|
2003-11-02 08:58:57 +00:00
|
|
|
if (label_chunk_info[i].c->private_data && (label_chunk_info[i].type == PART_FILESYSTEM
|
|
|
|
|| label_chunk_info[i].type == PART_FAT || label_chunk_info[i].type == PART_EFI))
|
|
|
|
mountpoint = ((PartInfo *)label_chunk_info[i].c->private_data)->mountpoint;
|
1997-03-08 16:17:49 +00:00
|
|
|
else if (label_chunk_info[i].type == PART_SWAP)
|
|
|
|
mountpoint = "swap";
|
1995-09-18 16:53:06 +00:00
|
|
|
else
|
|
|
|
mountpoint = "<none>";
|
|
|
|
|
|
|
|
/* Now display the newfs field */
|
2003-11-02 08:58:57 +00:00
|
|
|
if (label_chunk_info[i].type == PART_FAT)
|
2002-11-14 01:46:20 +00:00
|
|
|
strcpy(newfs, "DOS");
|
|
|
|
#if defined(__ia64__)
|
2003-11-02 08:58:57 +00:00
|
|
|
else if (label_chunk_info[i].type == PART_EFI) {
|
|
|
|
strcpy(newfs, "EFI");
|
|
|
|
if (label_chunk_info[i].c->private_data) {
|
|
|
|
strcat(newfs, " ");
|
|
|
|
PartInfo *pi = (PartInfo *)label_chunk_info[i].c->private_data;
|
|
|
|
strcat(newfs, pi->do_newfs ? " Y" : " N");
|
2002-11-14 01:46:20 +00:00
|
|
|
}
|
|
|
|
}
|
2003-11-02 08:58:57 +00:00
|
|
|
#endif
|
2001-03-10 19:51:04 +00:00
|
|
|
else if (label_chunk_info[i].c->private_data && label_chunk_info[i].type == PART_FILESYSTEM) {
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
PartInfo *pi = (PartInfo *)label_chunk_info[i].c->private_data;
|
|
|
|
|
|
|
|
switch (pi->newfs_type) {
|
|
|
|
case NEWFS_UFS:
|
|
|
|
strcpy(newfs, NEWFS_UFS_STRING);
|
2003-04-20 14:08:05 +00:00
|
|
|
if (pi->newfs_data.newfs_ufs.ufs1)
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
strcat(newfs, "1");
|
2003-04-20 14:08:05 +00:00
|
|
|
else
|
|
|
|
strcat(newfs, "2");
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
if (pi->newfs_data.newfs_ufs.softupdates)
|
|
|
|
strcat(newfs, "+S");
|
|
|
|
else
|
|
|
|
strcat(newfs, " ");
|
|
|
|
|
|
|
|
break;
|
|
|
|
case NEWFS_MSDOS:
|
|
|
|
strcpy(newfs, "FAT");
|
|
|
|
break;
|
|
|
|
case NEWFS_CUSTOM:
|
|
|
|
strcpy(newfs, "CUST");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
strcat(newfs, pi->do_newfs ? " Y" : " N ");
|
2001-03-10 19:51:04 +00:00
|
|
|
}
|
1995-09-18 16:53:06 +00:00
|
|
|
else if (label_chunk_info[i].type == PART_SWAP)
|
2001-03-10 19:51:04 +00:00
|
|
|
strcpy(newfs, "SWAP");
|
1995-09-18 16:53:06 +00:00
|
|
|
else
|
2001-03-10 19:51:04 +00:00
|
|
|
strcpy(newfs, "*");
|
1995-05-16 02:53:31 +00:00
|
|
|
for (j = 0; j < MAX_MOUNT_NAME && mountpoint[j]; j++)
|
|
|
|
onestr[PART_MOUNT_COL + j] = mountpoint[j];
|
2002-12-11 17:36:34 +00:00
|
|
|
if (label_chunk_info[i].c->size == 0)
|
2004-03-16 17:07:06 +00:00
|
|
|
snprintf(num, 10, "%5dMB", 0);
|
2002-12-11 17:36:34 +00:00
|
|
|
else if (label_chunk_info[i].c->size < (100 * ONE_GIG))
|
2004-03-16 17:07:06 +00:00
|
|
|
snprintf(num, 10, "%5jdMB",
|
|
|
|
(intmax_t)label_chunk_info[i].c->size / ONE_MEG);
|
2002-12-11 17:36:34 +00:00
|
|
|
else
|
2004-03-16 17:07:06 +00:00
|
|
|
snprintf(num, 10, "%5jdGB",
|
|
|
|
(intmax_t)label_chunk_info[i].c->size / ONE_GIG);
|
1995-05-16 02:53:31 +00:00
|
|
|
memcpy(onestr + PART_SIZE_COL, num, strlen(num));
|
|
|
|
memcpy(onestr + PART_NEWFS_COL, newfs, strlen(newfs));
|
|
|
|
onestr[PART_NEWFS_COL + strlen(newfs)] = '\0';
|
1997-09-20 06:24:17 +00:00
|
|
|
if (i == label_focus) {
|
|
|
|
label_focus_found = -1;
|
|
|
|
wattrset(ChunkWin, A_BOLD);
|
|
|
|
}
|
1996-04-28 22:54:21 +00:00
|
|
|
if (i == here)
|
1996-06-08 09:08:51 +00:00
|
|
|
wattrset(ChunkWin, ATTR_SELECTED);
|
1997-09-09 16:32:01 +00:00
|
|
|
|
2001-03-10 19:51:04 +00:00
|
|
|
/*** lazy man's way of expensively padding this string ***/
|
|
|
|
while (strlen(onestr) < 37)
|
1997-09-09 16:32:01 +00:00
|
|
|
strcat(onestr, " ");
|
|
|
|
|
1996-04-28 22:54:21 +00:00
|
|
|
mvwaddstr(ChunkWin, prow, pcol, onestr);
|
|
|
|
wattrset(ChunkWin, A_NORMAL);
|
|
|
|
move(0, 0);
|
1995-05-16 02:53:31 +00:00
|
|
|
++prow;
|
1997-09-09 16:32:01 +00:00
|
|
|
++label_count;
|
1995-05-16 02:53:31 +00:00
|
|
|
}
|
|
|
|
}
|
1997-09-09 16:32:01 +00:00
|
|
|
|
|
|
|
/*** this will erase all the extra stuff ***/
|
|
|
|
memset(clrmsg, ' ', 37);
|
|
|
|
clrmsg[37] = '\0';
|
|
|
|
|
|
|
|
while (pslice_count < pslice_max) {
|
|
|
|
mvprintw(srow++, 0, clrmsg);
|
|
|
|
clrtoeol();
|
|
|
|
++pslice_count;
|
|
|
|
}
|
1997-09-20 06:24:17 +00:00
|
|
|
while (label_count < (2 * (label_max - 1))) {
|
|
|
|
mvwaddstr(ChunkWin, prow++, pcol, clrmsg);
|
|
|
|
++label_count;
|
|
|
|
if (prow == (label_max - 1)) {
|
|
|
|
prow = 0;
|
|
|
|
pcol = PART_OFF;
|
|
|
|
}
|
1997-09-09 16:32:01 +00:00
|
|
|
}
|
1997-09-20 06:24:17 +00:00
|
|
|
refresh();
|
|
|
|
wrefresh(ChunkWin);
|
1995-05-16 02:53:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1996-10-01 12:13:29 +00:00
|
|
|
print_command_summary(void)
|
1995-05-16 02:53:31 +00:00
|
|
|
{
|
1995-05-28 20:28:15 +00:00
|
|
|
mvprintw(17, 0, "The following commands are valid here (upper or lower case):");
|
2001-03-10 19:51:04 +00:00
|
|
|
mvprintw(18, 0, "C = Create D = Delete M = Mount pt.");
|
2006-08-07 23:35:49 +00:00
|
|
|
mvprintw(18, 56, "W = Write");
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
mvprintw(19, 0, "N = Newfs Opts Q = Finish S = Toggle SoftUpdates Z = Custom Newfs");
|
|
|
|
mvprintw(20, 0, "T = Toggle Newfs U = Undo A = Auto Defaults R = Delete+Merge");
|
1996-05-09 09:42:17 +00:00
|
|
|
mvprintw(22, 0, "Use F1 or ? to get more help, arrow keys to select.");
|
1995-05-16 02:53:31 +00:00
|
|
|
move(0, 0);
|
|
|
|
}
|
|
|
|
|
1996-10-01 12:13:29 +00:00
|
|
|
static void
|
|
|
|
clear_wins(void)
|
|
|
|
{
|
2006-08-08 13:45:46 +00:00
|
|
|
|
1996-10-01 12:13:29 +00:00
|
|
|
clear();
|
1997-09-20 06:24:17 +00:00
|
|
|
print_label_chunks();
|
1996-10-01 12:13:29 +00:00
|
|
|
}
|
|
|
|
|
1995-12-07 10:34:59 +00:00
|
|
|
static int
|
1997-10-12 16:21:21 +00:00
|
|
|
diskLabel(Device *dev)
|
1995-05-16 02:53:31 +00:00
|
|
|
{
|
2004-03-16 17:07:06 +00:00
|
|
|
daddr_t sz;
|
|
|
|
int key = 0;
|
1995-05-16 02:53:31 +00:00
|
|
|
Boolean labeling;
|
|
|
|
char *msg = NULL;
|
1995-06-11 19:33:05 +00:00
|
|
|
PartInfo *p, *oldp;
|
1995-05-16 02:53:31 +00:00
|
|
|
PartType type;
|
1999-12-14 04:25:29 +00:00
|
|
|
WINDOW *w = savescr();
|
1995-05-16 02:53:31 +00:00
|
|
|
|
1997-09-20 02:48:48 +00:00
|
|
|
label_focus = 0;
|
|
|
|
pslice_focus = 0;
|
1997-09-20 06:24:17 +00:00
|
|
|
here = 0;
|
1997-10-12 16:21:21 +00:00
|
|
|
|
1995-05-16 02:53:31 +00:00
|
|
|
labeling = TRUE;
|
|
|
|
keypad(stdscr, TRUE);
|
2011-11-24 15:47:01 +00:00
|
|
|
record_label_chunks(dev);
|
1995-05-16 02:53:31 +00:00
|
|
|
|
1996-10-01 12:13:29 +00:00
|
|
|
clear();
|
1995-05-16 02:53:31 +00:00
|
|
|
while (labeling) {
|
1996-10-06 11:40:31 +00:00
|
|
|
char *cp;
|
2002-01-07 07:51:24 +00:00
|
|
|
int rflags = DELCHUNK_NORMAL;
|
1996-10-06 11:40:31 +00:00
|
|
|
|
1995-05-16 02:53:31 +00:00
|
|
|
print_label_chunks();
|
1996-10-01 12:13:29 +00:00
|
|
|
print_command_summary();
|
1995-05-16 02:53:31 +00:00
|
|
|
if (msg) {
|
1996-05-09 09:42:17 +00:00
|
|
|
attrset(title_attr); mvprintw(23, 0, msg); attrset(A_NORMAL);
|
1995-12-07 10:34:59 +00:00
|
|
|
clrtoeol();
|
1995-05-16 02:53:31 +00:00
|
|
|
beep();
|
|
|
|
msg = NULL;
|
|
|
|
}
|
1996-04-29 05:09:23 +00:00
|
|
|
else {
|
|
|
|
move(23, 0);
|
|
|
|
clrtoeol();
|
|
|
|
}
|
1996-10-06 11:40:31 +00:00
|
|
|
|
1996-10-01 12:13:29 +00:00
|
|
|
refresh();
|
1996-08-03 05:25:56 +00:00
|
|
|
key = getch();
|
|
|
|
switch (toupper(key)) {
|
1996-07-31 06:20:59 +00:00
|
|
|
static char _msg[40];
|
1995-05-16 02:53:31 +00:00
|
|
|
|
1995-05-25 18:48:33 +00:00
|
|
|
case '\014': /* ^L */
|
1996-10-01 12:13:29 +00:00
|
|
|
clear_wins();
|
|
|
|
break;
|
1995-05-25 18:48:33 +00:00
|
|
|
|
1997-01-15 02:52:00 +00:00
|
|
|
case '\020': /* ^P */
|
1995-05-16 02:53:31 +00:00
|
|
|
case KEY_UP:
|
|
|
|
case '-':
|
|
|
|
if (here != 0)
|
|
|
|
--here;
|
1995-05-25 18:48:33 +00:00
|
|
|
else
|
|
|
|
while (label_chunk_info[here + 1].c)
|
|
|
|
++here;
|
1995-05-16 02:53:31 +00:00
|
|
|
break;
|
|
|
|
|
1997-01-15 02:52:00 +00:00
|
|
|
case '\016': /* ^N */
|
1995-05-16 02:53:31 +00:00
|
|
|
case KEY_DOWN:
|
|
|
|
case '+':
|
|
|
|
case '\r':
|
|
|
|
case '\n':
|
1995-05-25 18:48:33 +00:00
|
|
|
if (label_chunk_info[here + 1].c)
|
1995-05-16 02:53:31 +00:00
|
|
|
++here;
|
1995-05-25 18:48:33 +00:00
|
|
|
else
|
|
|
|
here = 0;
|
1995-05-16 02:53:31 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case KEY_HOME:
|
|
|
|
here = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case KEY_END:
|
1995-05-25 18:48:33 +00:00
|
|
|
while (label_chunk_info[here + 1].c)
|
1995-05-16 02:53:31 +00:00
|
|
|
++here;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case KEY_F(1):
|
|
|
|
case '?':
|
1995-12-07 10:34:59 +00:00
|
|
|
systemDisplayHelp("partition");
|
1996-10-01 12:13:29 +00:00
|
|
|
clear_wins();
|
1995-05-16 02:53:31 +00:00
|
|
|
break;
|
|
|
|
|
2003-04-20 14:08:05 +00:00
|
|
|
case '1':
|
|
|
|
if (label_chunk_info[here].type == PART_FILESYSTEM) {
|
|
|
|
PartInfo *pi =
|
|
|
|
((PartInfo *)label_chunk_info[here].c->private_data);
|
|
|
|
|
|
|
|
if ((pi != NULL) &&
|
|
|
|
(pi->newfs_type == NEWFS_UFS)) {
|
|
|
|
pi->newfs_data.newfs_ufs.ufs1 = true;
|
|
|
|
} else
|
|
|
|
msg = MSG_NOT_APPLICABLE;
|
|
|
|
} else
|
|
|
|
msg = MSG_NOT_APPLICABLE;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
case '2':
|
|
|
|
if (label_chunk_info[here].type == PART_FILESYSTEM) {
|
|
|
|
PartInfo *pi =
|
|
|
|
((PartInfo *)label_chunk_info[here].c->private_data);
|
|
|
|
|
|
|
|
if ((pi != NULL) &&
|
|
|
|
(pi->newfs_type == NEWFS_UFS)) {
|
2003-04-20 14:08:05 +00:00
|
|
|
pi->newfs_data.newfs_ufs.ufs1 = false;
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
} else
|
|
|
|
msg = MSG_NOT_APPLICABLE;
|
|
|
|
} else
|
|
|
|
msg = MSG_NOT_APPLICABLE;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
1995-09-18 16:53:06 +00:00
|
|
|
case 'A':
|
|
|
|
if (label_chunk_info[here].type != PART_SLICE) {
|
1996-04-28 22:54:21 +00:00
|
|
|
msg = "You can only do this in a disk slice (at top of screen)";
|
1995-09-18 16:53:06 +00:00
|
|
|
break;
|
|
|
|
}
|
2001-12-09 09:47:09 +00:00
|
|
|
/*
|
|
|
|
* Generate standard partitions automatically. If we do not
|
|
|
|
* have sufficient space we attempt to scale-down the size
|
|
|
|
* of the partitions within certain bounds.
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
int perc;
|
|
|
|
int req = 0;
|
1996-07-31 06:20:59 +00:00
|
|
|
|
2001-12-09 09:47:09 +00:00
|
|
|
for (perc = 100; perc > 0; perc -= 5) {
|
|
|
|
req = 0; /* reset for each loop */
|
2011-11-24 15:47:01 +00:00
|
|
|
if ((msg = try_auto_label(dev, perc, &req)) == NULL)
|
1996-07-31 06:20:59 +00:00
|
|
|
break;
|
1996-04-28 22:54:21 +00:00
|
|
|
}
|
2001-12-09 09:47:09 +00:00
|
|
|
if (msg) {
|
|
|
|
if (req) {
|
|
|
|
msgConfirm(msg);
|
1996-10-01 12:13:29 +00:00
|
|
|
clear_wins();
|
2001-12-09 09:47:09 +00:00
|
|
|
msg = NULL;
|
1996-07-31 06:20:59 +00:00
|
|
|
}
|
1996-04-28 22:54:21 +00:00
|
|
|
}
|
1995-09-18 16:53:06 +00:00
|
|
|
}
|
1996-04-28 22:54:21 +00:00
|
|
|
break;
|
1995-09-18 16:53:06 +00:00
|
|
|
|
1995-05-16 02:53:31 +00:00
|
|
|
case 'C':
|
|
|
|
if (label_chunk_info[here].type != PART_SLICE) {
|
|
|
|
msg = "You can only do this in a master partition (see top of screen)";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
sz = space_free(label_chunk_info[here].c);
|
1995-05-21 06:12:44 +00:00
|
|
|
if (sz <= FS_MIN_SIZE) {
|
1995-12-07 10:34:59 +00:00
|
|
|
msg = "Not enough space to create an additional FreeBSD partition";
|
1995-05-21 06:12:44 +00:00
|
|
|
break;
|
|
|
|
}
|
1996-04-28 22:54:21 +00:00
|
|
|
else {
|
1996-10-06 11:40:31 +00:00
|
|
|
char *val;
|
2004-03-16 17:07:06 +00:00
|
|
|
daddr_t size;
|
1995-05-22 14:10:25 +00:00
|
|
|
struct chunk *tmp;
|
1995-05-28 20:28:15 +00:00
|
|
|
char osize[80];
|
1995-05-22 14:10:25 +00:00
|
|
|
u_long flags = 0;
|
|
|
|
|
2004-05-15 05:06:19 +00:00
|
|
|
#ifdef __powerpc__
|
|
|
|
/* Always use the maximum size for apple partitions */
|
|
|
|
if (label_chunk_info[here].c->type == apple)
|
|
|
|
size = sz;
|
|
|
|
else {
|
|
|
|
#endif
|
2004-03-16 17:07:06 +00:00
|
|
|
sprintf(osize, "%jd", (intmax_t)sz);
|
1996-10-01 12:13:29 +00:00
|
|
|
val = msgGetInput(osize,
|
2000-02-29 10:40:59 +00:00
|
|
|
"Please specify the partition size in blocks or append a trailing G for\n"
|
2003-11-04 02:04:36 +00:00
|
|
|
#ifdef __ia64__
|
|
|
|
"gigabytes, M for megabytes.\n"
|
|
|
|
#else
|
2000-02-29 10:40:59 +00:00
|
|
|
"gigabytes, M for megabytes, or C for cylinders.\n"
|
2003-11-04 02:04:36 +00:00
|
|
|
#endif
|
2004-03-16 17:07:06 +00:00
|
|
|
"%jd blocks (%jdMB) are free.",
|
|
|
|
(intmax_t)sz, (intmax_t)sz / ONE_MEG);
|
|
|
|
if (!val || (size = strtoimax(val, &cp, 0)) <= 0) {
|
1996-10-01 12:13:29 +00:00
|
|
|
clear_wins();
|
1995-05-22 14:10:25 +00:00
|
|
|
break;
|
1996-10-01 12:13:29 +00:00
|
|
|
}
|
1995-05-21 06:12:44 +00:00
|
|
|
|
1995-05-25 18:48:33 +00:00
|
|
|
if (*cp) {
|
|
|
|
if (toupper(*cp) == 'M')
|
|
|
|
size *= ONE_MEG;
|
2000-02-29 10:40:59 +00:00
|
|
|
else if (toupper(*cp) == 'G')
|
|
|
|
size *= ONE_GIG;
|
2003-11-02 08:58:57 +00:00
|
|
|
#ifndef __ia64__
|
1995-05-25 18:48:33 +00:00
|
|
|
else if (toupper(*cp) == 'C')
|
|
|
|
size *= (label_chunk_info[here].c->disk->bios_hd * label_chunk_info[here].c->disk->bios_sect);
|
2003-11-02 08:58:57 +00:00
|
|
|
#endif
|
1995-05-28 20:28:15 +00:00
|
|
|
}
|
|
|
|
if (size <= FS_MIN_SIZE) {
|
|
|
|
msgConfirm("The minimum filesystem size is %dMB", FS_MIN_SIZE / ONE_MEG);
|
1996-10-01 12:13:29 +00:00
|
|
|
clear_wins();
|
1995-05-28 20:28:15 +00:00
|
|
|
break;
|
1995-05-25 18:48:33 +00:00
|
|
|
}
|
2004-05-15 05:06:19 +00:00
|
|
|
#ifdef __powerpc__
|
|
|
|
}
|
|
|
|
#endif
|
1995-05-22 14:10:25 +00:00
|
|
|
type = get_partition_type();
|
1996-10-01 12:13:29 +00:00
|
|
|
if (type == PART_NONE) {
|
|
|
|
clear_wins();
|
|
|
|
beep();
|
1995-05-21 10:16:10 +00:00
|
|
|
break;
|
1996-10-01 12:13:29 +00:00
|
|
|
}
|
1995-05-22 14:10:25 +00:00
|
|
|
|
2003-11-04 02:04:36 +00:00
|
|
|
if (type == PART_FILESYSTEM || type == PART_EFI) {
|
2004-08-04 05:40:15 +00:00
|
|
|
if ((p = get_mountpoint(type, NULL)) == NULL) {
|
1996-10-01 12:13:29 +00:00
|
|
|
clear_wins();
|
|
|
|
beep();
|
1995-05-22 14:10:25 +00:00
|
|
|
break;
|
1996-10-01 12:13:29 +00:00
|
|
|
}
|
2003-11-04 02:04:36 +00:00
|
|
|
else if (!strcmp(p->mountpoint, "/")) {
|
|
|
|
if (type != PART_FILESYSTEM) {
|
|
|
|
clear_wins();
|
|
|
|
beep();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
flags |= CHUNK_IS_ROOT;
|
|
|
|
}
|
1995-05-22 14:10:25 +00:00
|
|
|
else
|
|
|
|
flags &= ~CHUNK_IS_ROOT;
|
1996-10-01 12:13:29 +00:00
|
|
|
}
|
|
|
|
else
|
1995-05-22 14:10:25 +00:00
|
|
|
p = NULL;
|
|
|
|
|
2001-05-03 09:23:48 +00:00
|
|
|
if ((flags & CHUNK_IS_ROOT) && (size < (ROOT_MIN_SIZE * ONE_MEG))) {
|
|
|
|
msgConfirm("Warning: This is smaller than the recommended size for a\n"
|
|
|
|
"root partition. For a variety of reasons, root\n"
|
|
|
|
"partitions should usually be at least %dMB in size", ROOT_MIN_SIZE);
|
1995-05-21 10:16:10 +00:00
|
|
|
}
|
1995-05-25 18:48:33 +00:00
|
|
|
tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
|
2003-11-04 02:04:36 +00:00
|
|
|
label_chunk_info[here].c, size,
|
|
|
|
#ifdef __ia64__
|
|
|
|
(type == PART_EFI) ? efi : part,
|
|
|
|
(type == PART_EFI) ? 0 : (type == PART_SWAP) ? FS_SWAP : FS_BSDFFS,
|
|
|
|
#else
|
|
|
|
part, (type == PART_SWAP) ? FS_SWAP : FS_BSDFFS,
|
|
|
|
#endif
|
|
|
|
flags);
|
1995-05-22 14:10:25 +00:00
|
|
|
if (!tmp) {
|
|
|
|
msgConfirm("Unable to create the partition. Too big?");
|
1996-10-01 12:13:29 +00:00
|
|
|
clear_wins();
|
1995-05-21 10:16:10 +00:00
|
|
|
break;
|
|
|
|
}
|
2001-07-13 16:37:03 +00:00
|
|
|
|
|
|
|
#ifdef __alpha__
|
|
|
|
/*
|
2001-07-13 16:45:00 +00:00
|
|
|
* SRM requires that the root partition is at the
|
2001-07-13 16:37:03 +00:00
|
|
|
* begining of the disk and cannot boot otherwise.
|
|
|
|
* Warn Alpha users if they are about to shoot themselves in
|
|
|
|
* the foot in this way.
|
|
|
|
*
|
|
|
|
* Since partitions may not start precisely at offset 0 we
|
|
|
|
* check for a "close to 0" instead. :-(
|
|
|
|
*/
|
|
|
|
if ((flags & CHUNK_IS_ROOT) && (tmp->offset > 1024)) {
|
2001-07-13 16:45:00 +00:00
|
|
|
msgConfirm("Your root partition `a' does not seem to be the first\n"
|
|
|
|
"partition. The Alpha's firmware can only boot from the\n"
|
|
|
|
"first partition. So it is unlikely that your current\n"
|
|
|
|
"disk layout will be bootable boot after installation.\n"
|
2001-07-13 16:37:03 +00:00
|
|
|
"\n"
|
|
|
|
"Please allocate the root partition before allocating\n"
|
|
|
|
"any others.\n");
|
|
|
|
}
|
|
|
|
#endif /* alpha */
|
|
|
|
|
2002-11-12 20:48:49 +00:00
|
|
|
tmp->private_data = p;
|
1995-05-22 14:10:25 +00:00
|
|
|
tmp->private_free = safe_free;
|
2001-03-12 10:18:54 +00:00
|
|
|
if (variable_cmp(DISK_LABELLED, "written"))
|
1999-02-05 22:15:52 +00:00
|
|
|
variable_set2(DISK_LABELLED, "yes", 0);
|
2011-11-24 15:47:01 +00:00
|
|
|
record_label_chunks(dev);
|
1996-10-01 12:13:29 +00:00
|
|
|
clear_wins();
|
2001-07-13 16:37:03 +00:00
|
|
|
/* This is where we assign focus to new label so it shows. */
|
1997-09-09 16:32:01 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
label_focus = -1;
|
|
|
|
for (i = 0; label_chunk_info[i].c; ++i) {
|
|
|
|
if (label_chunk_info[i].c == tmp) {
|
|
|
|
label_focus = i;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (label_focus == -1)
|
|
|
|
label_focus = i - 1;
|
|
|
|
}
|
1995-05-16 02:53:31 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1996-08-03 05:25:56 +00:00
|
|
|
case KEY_DC:
|
2002-01-07 07:51:24 +00:00
|
|
|
case 'R': /* recover space (delete w/ recover) */
|
|
|
|
/*
|
|
|
|
* Delete the partition w/ space recovery.
|
|
|
|
*/
|
|
|
|
rflags = DELCHUNK_RECOVER;
|
|
|
|
/* fall through */
|
1995-05-16 02:53:31 +00:00
|
|
|
case 'D': /* delete */
|
|
|
|
if (label_chunk_info[here].type == PART_SLICE) {
|
|
|
|
msg = MSG_NOT_APPLICABLE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else if (label_chunk_info[here].type == PART_FAT) {
|
1995-05-23 02:41:18 +00:00
|
|
|
msg = "Use the Disk Partition Editor to delete DOS partitions";
|
1995-05-16 02:53:31 +00:00
|
|
|
break;
|
|
|
|
}
|
2002-01-07 07:51:24 +00:00
|
|
|
Delete_Chunk2(label_chunk_info[here].c->disk, label_chunk_info[here].c, rflags);
|
2001-03-12 10:18:54 +00:00
|
|
|
if (variable_cmp(DISK_LABELLED, "written"))
|
1999-02-05 22:15:52 +00:00
|
|
|
variable_set2(DISK_LABELLED, "yes", 0);
|
2011-11-24 15:47:01 +00:00
|
|
|
record_label_chunks(dev);
|
1995-05-16 02:53:31 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'M': /* mount */
|
|
|
|
switch(label_chunk_info[here].type) {
|
|
|
|
case PART_SLICE:
|
|
|
|
msg = MSG_NOT_APPLICABLE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PART_SWAP:
|
|
|
|
msg = "You don't need to specify a mountpoint for a swap partition.";
|
|
|
|
break;
|
|
|
|
|
1995-05-16 11:37:27 +00:00
|
|
|
case PART_FAT:
|
2003-11-02 08:58:57 +00:00
|
|
|
case PART_EFI:
|
1995-05-16 02:53:31 +00:00
|
|
|
case PART_FILESYSTEM:
|
1996-03-24 18:57:37 +00:00
|
|
|
oldp = label_chunk_info[here].c->private_data;
|
2004-08-04 05:40:15 +00:00
|
|
|
p = get_mountpoint(label_chunk_info[here].type, label_chunk_info[here].c);
|
1995-05-16 02:53:31 +00:00
|
|
|
if (p) {
|
1995-06-11 19:33:05 +00:00
|
|
|
if (!oldp)
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
p->do_newfs = FALSE;
|
2003-11-02 08:58:57 +00:00
|
|
|
if ((label_chunk_info[here].type == PART_FAT ||
|
|
|
|
label_chunk_info[here].type == PART_EFI) &&
|
|
|
|
(!strcmp(p->mountpoint, "/") ||
|
|
|
|
!strcmp(p->mountpoint, "/usr") ||
|
|
|
|
!strcmp(p->mountpoint, "/var"))) {
|
1995-05-24 09:00:58 +00:00
|
|
|
msgConfirm("%s is an invalid mount point for a DOS partition!", p->mountpoint);
|
|
|
|
strcpy(p->mountpoint, "/bogus");
|
|
|
|
}
|
1995-05-16 02:53:31 +00:00
|
|
|
}
|
2001-03-12 10:18:54 +00:00
|
|
|
if (variable_cmp(DISK_LABELLED, "written"))
|
1999-02-05 22:15:52 +00:00
|
|
|
variable_set2(DISK_LABELLED, "yes", 0);
|
2011-11-24 15:47:01 +00:00
|
|
|
record_label_chunks(dev);
|
1996-10-02 02:19:35 +00:00
|
|
|
clear_wins();
|
1995-05-16 02:53:31 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
msgFatal("Bogus partition under cursor???");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'N': /* Set newfs options */
|
1996-03-24 18:57:37 +00:00
|
|
|
if (label_chunk_info[here].c->private_data &&
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
((PartInfo *)label_chunk_info[here].c->private_data)->do_newfs)
|
|
|
|
getNewfsOptionalArguments(
|
|
|
|
label_chunk_info[here].c->private_data);
|
1995-05-16 02:53:31 +00:00
|
|
|
else
|
|
|
|
msg = MSG_NOT_APPLICABLE;
|
1996-10-02 02:19:35 +00:00
|
|
|
clear_wins();
|
1995-05-16 02:53:31 +00:00
|
|
|
break;
|
|
|
|
|
2001-03-10 19:51:04 +00:00
|
|
|
case 'S': /* Toggle soft updates flag */
|
|
|
|
if (label_chunk_info[here].type == PART_FILESYSTEM) {
|
|
|
|
PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private_data);
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
if (pi != NULL &&
|
|
|
|
pi->newfs_type == NEWFS_UFS)
|
|
|
|
pi->newfs_data.newfs_ufs.softupdates =
|
|
|
|
!pi->newfs_data.newfs_ufs.softupdates;
|
2001-03-10 19:51:04 +00:00
|
|
|
else
|
|
|
|
msg = MSG_NOT_APPLICABLE;
|
|
|
|
}
|
2001-03-12 10:18:54 +00:00
|
|
|
else
|
|
|
|
msg = MSG_NOT_APPLICABLE;
|
2001-03-10 19:51:04 +00:00
|
|
|
break;
|
|
|
|
|
1995-05-16 02:53:31 +00:00
|
|
|
case 'T': /* Toggle newfs state */
|
2004-08-04 05:40:15 +00:00
|
|
|
if ((label_chunk_info[here].type == PART_FILESYSTEM ||
|
|
|
|
label_chunk_info[here].type == PART_EFI) &&
|
2002-01-29 22:35:40 +00:00
|
|
|
(label_chunk_info[here].c->private_data)) {
|
1997-03-11 17:51:01 +00:00
|
|
|
PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private_data);
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
if (!pi->do_newfs)
|
2001-12-09 23:40:02 +00:00
|
|
|
label_chunk_info[here].c->flags |= CHUNK_NEWFS;
|
|
|
|
else
|
|
|
|
label_chunk_info[here].c->flags &= ~CHUNK_NEWFS;
|
|
|
|
|
1997-03-11 17:51:01 +00:00
|
|
|
label_chunk_info[here].c->private_data =
|
2004-08-04 05:40:15 +00:00
|
|
|
new_part(label_chunk_info[here].type, pi ? pi->mountpoint : NULL, pi ? !pi->do_newfs
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
: TRUE);
|
|
|
|
if (pi != NULL &&
|
|
|
|
pi->newfs_type == NEWFS_UFS) {
|
|
|
|
PartInfo *pi_new = label_chunk_info[here].c->private_data;
|
|
|
|
|
|
|
|
pi_new->newfs_data.newfs_ufs = pi->newfs_data.newfs_ufs;
|
|
|
|
}
|
1997-03-11 17:51:01 +00:00
|
|
|
safe_free(pi);
|
|
|
|
label_chunk_info[here].c->private_free = safe_free;
|
2001-03-12 10:18:54 +00:00
|
|
|
if (variable_cmp(DISK_LABELLED, "written"))
|
1999-02-05 22:15:52 +00:00
|
|
|
variable_set2(DISK_LABELLED, "yes", 0);
|
1996-10-01 12:13:29 +00:00
|
|
|
}
|
1995-05-16 02:53:31 +00:00
|
|
|
else
|
|
|
|
msg = MSG_NOT_APPLICABLE;
|
|
|
|
break;
|
|
|
|
|
1995-05-28 20:28:15 +00:00
|
|
|
case 'U':
|
1995-12-07 10:34:59 +00:00
|
|
|
clear();
|
2001-03-12 10:18:54 +00:00
|
|
|
if (!variable_cmp(DISK_LABELLED, "written")) {
|
1996-10-06 11:40:31 +00:00
|
|
|
msgConfirm("You've already written out your changes -\n"
|
|
|
|
"it's too late to undo!");
|
|
|
|
}
|
2000-12-14 02:49:02 +00:00
|
|
|
else if (!msgNoYes("Are you SURE you want to Undo everything?")) {
|
2011-11-24 15:47:01 +00:00
|
|
|
Disk *d;
|
|
|
|
|
1996-10-06 11:40:31 +00:00
|
|
|
variable_unset(DISK_PARTITIONED);
|
|
|
|
variable_unset(DISK_LABELLED);
|
2011-11-24 15:47:01 +00:00
|
|
|
if ((d = Open_Disk(dev->name)) != NULL) {
|
|
|
|
Free_Disk(dev->private);
|
|
|
|
dev->private = d;
|
2002-11-27 19:46:18 +00:00
|
|
|
#ifdef WITH_SLICES
|
2011-11-24 15:47:01 +00:00
|
|
|
diskPartition(dev);
|
2002-11-27 19:46:18 +00:00
|
|
|
#endif
|
1995-05-28 23:12:09 +00:00
|
|
|
}
|
2011-11-24 15:47:01 +00:00
|
|
|
record_label_chunks(dev);
|
1995-05-28 23:12:09 +00:00
|
|
|
}
|
1996-10-02 02:19:35 +00:00
|
|
|
clear_wins();
|
1995-05-28 23:12:09 +00:00
|
|
|
break;
|
1995-05-28 20:28:15 +00:00
|
|
|
|
1995-05-16 02:53:31 +00:00
|
|
|
case 'W':
|
2001-03-12 10:18:54 +00:00
|
|
|
if (!variable_cmp(DISK_LABELLED, "written")) {
|
1996-10-06 11:40:31 +00:00
|
|
|
msgConfirm("You've already written out your changes - if you\n"
|
2001-03-12 10:18:54 +00:00
|
|
|
"wish to overwrite them, you'll have to restart\n"
|
2008-05-11 17:23:57 +00:00
|
|
|
"%s first.", ProgName);
|
1996-10-06 11:40:31 +00:00
|
|
|
}
|
2008-05-05 06:31:41 +00:00
|
|
|
else if (!msgNoYes("WARNING: You are about to modify an EXISTING\n"
|
|
|
|
"installation.\n\n"
|
|
|
|
"Are you absolutely sure you want to continue?")) {
|
1999-02-05 22:15:52 +00:00
|
|
|
variable_set2(DISK_LABELLED, "yes", 0);
|
2011-11-24 15:47:01 +00:00
|
|
|
diskLabelCommit(dev);
|
1995-12-07 10:34:59 +00:00
|
|
|
}
|
1996-10-02 02:19:35 +00:00
|
|
|
clear_wins();
|
1995-09-18 16:53:06 +00:00
|
|
|
break;
|
|
|
|
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
case 'Z': /* Set newfs command line */
|
|
|
|
if (label_chunk_info[here].c->private_data &&
|
|
|
|
((PartInfo *)label_chunk_info[here].c->private_data)->do_newfs)
|
|
|
|
getNewfsCmd(label_chunk_info[here].c->private_data);
|
|
|
|
else
|
|
|
|
msg = MSG_NOT_APPLICABLE;
|
|
|
|
clear_wins();
|
|
|
|
break;
|
|
|
|
|
2003-11-01 20:14:06 +00:00
|
|
|
#ifndef __ia64__
|
1995-09-18 16:53:06 +00:00
|
|
|
case '|':
|
2000-12-14 02:49:02 +00:00
|
|
|
if (!msgNoYes("Are you sure you want to go into Wizard mode?\n\n"
|
1995-12-07 10:34:59 +00:00
|
|
|
"This is an entirely undocumented feature which you are not\n"
|
|
|
|
"expected to understand!")) {
|
2011-11-24 18:37:16 +00:00
|
|
|
dlg_clear();
|
1995-05-16 02:53:31 +00:00
|
|
|
end_dialog();
|
|
|
|
DialogActive = FALSE;
|
2011-11-24 15:47:01 +00:00
|
|
|
if (dev->private) {
|
|
|
|
slice_wizard(((Disk *)dev->private));
|
1995-05-18 18:02:31 +00:00
|
|
|
}
|
2001-03-12 10:18:54 +00:00
|
|
|
if (variable_cmp(DISK_LABELLED, "written"))
|
1999-02-05 22:15:52 +00:00
|
|
|
variable_set2(DISK_LABELLED, "yes", 0);
|
1995-05-16 02:53:31 +00:00
|
|
|
DialogActive = TRUE;
|
2011-11-24 15:47:01 +00:00
|
|
|
record_label_chunks(dev);
|
1996-10-02 02:19:35 +00:00
|
|
|
clear_wins();
|
1995-05-16 02:53:31 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
msg = "A most prudent choice!";
|
|
|
|
break;
|
2003-11-01 20:14:06 +00:00
|
|
|
#endif
|
1995-05-16 02:53:31 +00:00
|
|
|
|
1997-01-15 02:52:00 +00:00
|
|
|
case '\033': /* ESC */
|
1995-06-11 19:33:05 +00:00
|
|
|
case 'Q':
|
1995-05-16 02:53:31 +00:00
|
|
|
labeling = FALSE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
beep();
|
1996-07-31 06:20:59 +00:00
|
|
|
sprintf(_msg, "Invalid key %d - Type F1 or ? for help", key);
|
|
|
|
msg = _msg;
|
1995-05-16 02:53:31 +00:00
|
|
|
break;
|
|
|
|
}
|
1997-09-20 06:24:17 +00:00
|
|
|
if (label_chunk_info[here].type == PART_SLICE)
|
|
|
|
pslice_focus = here;
|
|
|
|
else
|
|
|
|
label_focus = here;
|
1995-05-16 02:53:31 +00:00
|
|
|
}
|
1999-12-14 04:25:29 +00:00
|
|
|
restorescr(w);
|
|
|
|
return DITEM_SUCCESS;
|
1995-09-18 16:53:06 +00:00
|
|
|
}
|
1997-06-05 09:48:03 +00:00
|
|
|
|
2004-03-16 17:07:06 +00:00
|
|
|
static __inline daddr_t
|
|
|
|
requested_part_size(char *varName, daddr_t nom, int def, int perc)
|
2001-12-09 09:47:09 +00:00
|
|
|
{
|
|
|
|
char *cp;
|
2004-03-16 17:07:06 +00:00
|
|
|
daddr_t sz;
|
2001-12-09 09:47:09 +00:00
|
|
|
|
2002-06-07 15:32:05 +00:00
|
|
|
if ((cp = variable_get(varName)) != NULL)
|
2004-03-16 17:07:06 +00:00
|
|
|
sz = strtoimax(cp, NULL, 0);
|
2001-12-09 09:47:09 +00:00
|
|
|
else
|
|
|
|
sz = nom + (def - nom) * perc / 100;
|
|
|
|
return(sz * ONE_MEG);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Attempt to auto-label the disk. 'perc' (0-100) scales
|
|
|
|
* the size of the various partitions within appropriate
|
|
|
|
* bounds (NOMINAL through DEFAULT sizes). The procedure
|
|
|
|
* succeeds of NULL is returned. A non-null return message
|
|
|
|
* is either a failure-status message (*req == 0), or
|
|
|
|
* a confirmation requestor (*req == 1). *req is 0 on
|
|
|
|
* entry to this call.
|
|
|
|
*
|
2005-08-16 13:19:17 +00:00
|
|
|
* As a special exception to the usual sizing rules, /var is given
|
|
|
|
* additional space equal to the amount of physical memory present
|
|
|
|
* if perc == 100 in order to ensure that users with large hard drives
|
|
|
|
* will have enough space to store a crashdump in /var/crash.
|
|
|
|
*
|
2001-12-10 02:18:05 +00:00
|
|
|
* We autolabel the following partitions: /, swap, /var, /tmp, /usr,
|
2001-12-09 09:47:09 +00:00
|
|
|
* and /home. /home receives any extra left over disk space.
|
|
|
|
*/
|
|
|
|
static char *
|
2011-11-24 15:47:01 +00:00
|
|
|
try_auto_label(Device *dev, int perc, int *req)
|
2001-12-09 09:47:09 +00:00
|
|
|
{
|
2004-03-16 17:07:06 +00:00
|
|
|
daddr_t sz;
|
2004-08-07 01:19:54 +00:00
|
|
|
Chunk *AutoHome, *AutoRoot, *AutoSwap;
|
|
|
|
Chunk *AutoTmp, *AutoUsr, *AutoVar;
|
2004-08-07 04:03:18 +00:00
|
|
|
#ifdef __ia64__
|
|
|
|
Chunk *AutoEfi;
|
|
|
|
#endif
|
2001-12-09 09:47:09 +00:00
|
|
|
int mib[2];
|
2002-11-02 17:19:18 +00:00
|
|
|
unsigned long physmem;
|
2001-12-09 09:47:09 +00:00
|
|
|
size_t size;
|
|
|
|
char *msg = NULL;
|
|
|
|
|
|
|
|
sz = space_free(label_chunk_info[here].c);
|
|
|
|
if (sz <= FS_MIN_SIZE)
|
|
|
|
return("Not enough free space to create a new partition in the slice");
|
|
|
|
|
2004-08-07 01:19:54 +00:00
|
|
|
(void)checkLabels(FALSE);
|
|
|
|
AutoHome = AutoRoot = AutoSwap = NULL;
|
|
|
|
AutoTmp = AutoUsr = AutoVar = NULL;
|
2004-08-07 04:03:18 +00:00
|
|
|
|
|
|
|
#ifdef __ia64__
|
|
|
|
AutoEfi = NULL;
|
|
|
|
if (EfiChunk == NULL) {
|
|
|
|
sz = 100 * ONE_MEG;
|
|
|
|
AutoEfi = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
|
|
|
|
label_chunk_info[here].c, sz, efi, 0, 0);
|
|
|
|
if (AutoEfi == NULL) {
|
|
|
|
*req = 1;
|
|
|
|
msg = "Unable to create the EFI system partition. Too big?";
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
AutoEfi->private_data = new_part(PART_EFI, "/efi", TRUE);
|
|
|
|
AutoEfi->private_free = safe_free;
|
|
|
|
AutoEfi->flags |= CHUNK_NEWFS;
|
2011-11-24 15:47:01 +00:00
|
|
|
record_label_chunks(dev);
|
2004-08-07 04:03:18 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-08-07 01:19:54 +00:00
|
|
|
if (RootChunk == NULL) {
|
2001-12-09 09:47:09 +00:00
|
|
|
sz = requested_part_size(VAR_ROOT_SIZE, ROOT_NOMINAL_SIZE, ROOT_DEFAULT_SIZE, perc);
|
|
|
|
|
2004-08-07 01:19:54 +00:00
|
|
|
AutoRoot = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
|
2001-12-09 23:40:02 +00:00
|
|
|
label_chunk_info[here].c, sz, part,
|
|
|
|
FS_BSDFFS, CHUNK_IS_ROOT | CHUNK_AUTO_SIZE);
|
2004-08-07 01:19:54 +00:00
|
|
|
if (!AutoRoot) {
|
2001-12-09 09:47:09 +00:00
|
|
|
*req = 1;
|
|
|
|
msg = "Unable to create the root partition. Too big?";
|
|
|
|
goto done;
|
|
|
|
}
|
2004-08-07 01:19:54 +00:00
|
|
|
AutoRoot->private_data = new_part(PART_FILESYSTEM, "/", TRUE);
|
|
|
|
AutoRoot->private_free = safe_free;
|
|
|
|
AutoRoot->flags |= CHUNK_NEWFS;
|
2011-11-24 15:47:01 +00:00
|
|
|
record_label_chunks(dev);
|
2001-12-09 09:47:09 +00:00
|
|
|
}
|
2004-08-07 01:19:54 +00:00
|
|
|
if (SwapChunk == NULL) {
|
2001-12-09 09:47:09 +00:00
|
|
|
sz = requested_part_size(VAR_SWAP_SIZE, 0, 0, perc);
|
|
|
|
if (sz == 0) {
|
2004-03-16 17:07:06 +00:00
|
|
|
daddr_t nom;
|
|
|
|
daddr_t def;
|
2001-12-09 09:47:09 +00:00
|
|
|
|
|
|
|
mib[0] = CTL_HW;
|
|
|
|
mib[1] = HW_PHYSMEM;
|
|
|
|
size = sizeof physmem;
|
|
|
|
sysctl(mib, 2, &physmem, &size, (void *)0, (size_t)0);
|
|
|
|
def = 2 * (int)(physmem / 512);
|
|
|
|
if (def < SWAP_MIN_SIZE * ONE_MEG)
|
|
|
|
def = SWAP_MIN_SIZE * ONE_MEG;
|
|
|
|
if (def > SWAP_AUTO_LIMIT_SIZE * ONE_MEG)
|
|
|
|
def = SWAP_AUTO_LIMIT_SIZE * ONE_MEG;
|
2003-01-25 19:32:35 +00:00
|
|
|
nom = (int)(physmem / 512) / 8;
|
2001-12-09 09:47:09 +00:00
|
|
|
sz = nom + (def - nom) * perc / 100;
|
|
|
|
}
|
2004-08-07 01:19:54 +00:00
|
|
|
AutoSwap = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
|
2001-12-09 23:40:02 +00:00
|
|
|
label_chunk_info[here].c, sz, part,
|
|
|
|
FS_SWAP, CHUNK_AUTO_SIZE);
|
2004-08-07 01:19:54 +00:00
|
|
|
if (!AutoSwap) {
|
2001-12-09 09:47:09 +00:00
|
|
|
*req = 1;
|
|
|
|
msg = "Unable to create the swap partition. Too big?";
|
|
|
|
goto done;
|
|
|
|
}
|
2004-08-07 01:19:54 +00:00
|
|
|
AutoSwap->private_data = 0;
|
|
|
|
AutoSwap->private_free = safe_free;
|
2011-11-24 15:47:01 +00:00
|
|
|
record_label_chunks(dev);
|
2001-12-09 09:47:09 +00:00
|
|
|
}
|
2004-08-07 01:19:54 +00:00
|
|
|
if (VarChunk == NULL) {
|
2005-08-16 13:19:17 +00:00
|
|
|
/* Work out how much extra space we want for a crash dump */
|
|
|
|
unsigned long crashdumpsz;
|
|
|
|
|
|
|
|
mib[0] = CTL_HW;
|
|
|
|
mib[1] = HW_PHYSMEM;
|
|
|
|
size = sizeof(physmem);
|
|
|
|
sysctl(mib, 2, &physmem, &size, (void *)0, (size_t)0);
|
|
|
|
|
|
|
|
if (perc == 100)
|
|
|
|
crashdumpsz = physmem / 1048576;
|
|
|
|
else
|
|
|
|
crashdumpsz = 0;
|
|
|
|
|
|
|
|
sz = requested_part_size(VAR_VAR_SIZE, VAR_NOMINAL_SIZE, \
|
|
|
|
VAR_DEFAULT_SIZE + crashdumpsz, perc);
|
2001-12-09 09:47:09 +00:00
|
|
|
|
2004-08-07 01:19:54 +00:00
|
|
|
AutoVar = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
|
2001-12-09 23:40:02 +00:00
|
|
|
label_chunk_info[here].c, sz, part,
|
|
|
|
FS_BSDFFS, CHUNK_AUTO_SIZE);
|
2004-08-07 01:19:54 +00:00
|
|
|
if (!AutoVar) {
|
2001-12-09 09:47:09 +00:00
|
|
|
*req = 1;
|
|
|
|
msg = "Not enough free space for /var - you will need to\n"
|
|
|
|
"partition your disk manually with a custom install!";
|
|
|
|
goto done;
|
|
|
|
}
|
2004-08-07 01:19:54 +00:00
|
|
|
AutoVar->private_data = new_part(PART_FILESYSTEM, "/var", TRUE);
|
|
|
|
AutoVar->private_free = safe_free;
|
|
|
|
AutoVar->flags |= CHUNK_NEWFS;
|
2011-11-24 15:47:01 +00:00
|
|
|
record_label_chunks(dev);
|
2001-12-09 09:47:09 +00:00
|
|
|
}
|
2004-08-07 01:19:54 +00:00
|
|
|
if (TmpChunk == NULL && !variable_get(VAR_NO_TMP)) {
|
2001-12-10 02:18:05 +00:00
|
|
|
sz = requested_part_size(VAR_TMP_SIZE, TMP_NOMINAL_SIZE, TMP_DEFAULT_SIZE, perc);
|
2001-12-09 09:47:09 +00:00
|
|
|
|
2004-08-07 01:19:54 +00:00
|
|
|
AutoTmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
|
2001-12-09 23:40:02 +00:00
|
|
|
label_chunk_info[here].c, sz, part,
|
|
|
|
FS_BSDFFS, CHUNK_AUTO_SIZE);
|
2004-08-07 01:19:54 +00:00
|
|
|
if (!AutoTmp) {
|
2001-12-09 09:47:09 +00:00
|
|
|
*req = 1;
|
2001-12-10 02:18:05 +00:00
|
|
|
msg = "Not enough free space for /tmp - you will need to\n"
|
2001-12-09 09:47:09 +00:00
|
|
|
"partition your disk manually with a custom install!";
|
|
|
|
goto done;
|
|
|
|
}
|
2004-08-07 01:19:54 +00:00
|
|
|
AutoTmp->private_data = new_part(PART_FILESYSTEM, "/tmp", TRUE);
|
|
|
|
AutoTmp->private_free = safe_free;
|
|
|
|
AutoTmp->flags |= CHUNK_NEWFS;
|
2011-11-24 15:47:01 +00:00
|
|
|
record_label_chunks(dev);
|
2001-12-09 09:47:09 +00:00
|
|
|
}
|
2004-08-07 01:19:54 +00:00
|
|
|
if (UsrChunk == NULL && !variable_get(VAR_NO_USR)) {
|
2001-12-09 09:47:09 +00:00
|
|
|
sz = requested_part_size(VAR_USR_SIZE, USR_NOMINAL_SIZE, USR_DEFAULT_SIZE, perc);
|
2002-01-07 07:51:24 +00:00
|
|
|
#if AUTO_HOME == 0
|
2006-03-24 22:45:24 +00:00
|
|
|
if (sz < space_free(label_chunk_info[here].c))
|
2001-12-09 09:47:09 +00:00
|
|
|
sz = space_free(label_chunk_info[here].c);
|
|
|
|
#endif
|
|
|
|
if (sz) {
|
|
|
|
if (sz < (USR_MIN_SIZE * ONE_MEG)) {
|
|
|
|
*req = 1;
|
|
|
|
msg = "Not enough free space for /usr - you will need to\n"
|
|
|
|
"partition your disk manually with a custom install!";
|
|
|
|
}
|
|
|
|
|
2004-08-07 01:19:54 +00:00
|
|
|
AutoUsr = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
|
2001-12-09 23:40:02 +00:00
|
|
|
label_chunk_info[here].c, sz, part,
|
|
|
|
FS_BSDFFS, CHUNK_AUTO_SIZE);
|
2004-08-07 01:19:54 +00:00
|
|
|
if (!AutoUsr) {
|
2001-12-09 09:47:09 +00:00
|
|
|
msg = "Unable to create the /usr partition. Not enough space?\n"
|
|
|
|
"You will need to partition your disk manually with a custom install!";
|
|
|
|
goto done;
|
|
|
|
}
|
2004-08-07 01:19:54 +00:00
|
|
|
AutoUsr->private_data = new_part(PART_FILESYSTEM, "/usr", TRUE);
|
|
|
|
AutoUsr->private_free = safe_free;
|
|
|
|
AutoUsr->flags |= CHUNK_NEWFS;
|
2011-11-24 15:47:01 +00:00
|
|
|
record_label_chunks(dev);
|
2001-12-09 09:47:09 +00:00
|
|
|
}
|
|
|
|
}
|
2002-01-07 07:51:24 +00:00
|
|
|
#if AUTO_HOME == 1
|
2004-08-07 01:19:54 +00:00
|
|
|
if (HomeChunk == NULL && !variable_get(VAR_NO_HOME)) {
|
2001-12-09 09:47:09 +00:00
|
|
|
sz = requested_part_size(VAR_HOME_SIZE, HOME_NOMINAL_SIZE, HOME_DEFAULT_SIZE, perc);
|
|
|
|
if (sz < space_free(label_chunk_info[here].c))
|
|
|
|
sz = space_free(label_chunk_info[here].c);
|
|
|
|
if (sz) {
|
|
|
|
if (sz < (HOME_MIN_SIZE * ONE_MEG)) {
|
|
|
|
*req = 1;
|
|
|
|
msg = "Not enough free space for /home - you will need to\n"
|
|
|
|
"partition your disk manually with a custom install!";
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
2004-08-07 01:19:54 +00:00
|
|
|
AutoHome = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
|
2001-12-09 23:40:02 +00:00
|
|
|
label_chunk_info[here].c, sz, part,
|
|
|
|
FS_BSDFFS, CHUNK_AUTO_SIZE);
|
2004-08-07 01:19:54 +00:00
|
|
|
if (!AutoHome) {
|
2001-12-09 09:47:09 +00:00
|
|
|
msg = "Unable to create the /home partition. Not enough space?\n"
|
|
|
|
"You will need to partition your disk manually with a custom install!";
|
|
|
|
goto done;
|
|
|
|
}
|
2004-08-07 01:19:54 +00:00
|
|
|
AutoHome->private_data = new_part(PART_FILESYSTEM, "/home", TRUE);
|
|
|
|
AutoHome->private_free = safe_free;
|
|
|
|
AutoHome->flags |= CHUNK_NEWFS;
|
2011-11-24 15:47:01 +00:00
|
|
|
record_label_chunks(dev);
|
2001-12-09 09:47:09 +00:00
|
|
|
}
|
|
|
|
}
|
2002-01-07 07:51:24 +00:00
|
|
|
#endif
|
2001-12-09 09:47:09 +00:00
|
|
|
|
|
|
|
/* At this point, we're reasonably "labelled" */
|
|
|
|
if (variable_cmp(DISK_LABELLED, "written"))
|
|
|
|
variable_set2(DISK_LABELLED, "yes", 0);
|
|
|
|
|
|
|
|
done:
|
|
|
|
if (msg) {
|
2004-08-07 01:19:54 +00:00
|
|
|
if (AutoRoot != NULL)
|
|
|
|
Delete_Chunk(AutoRoot->disk, AutoRoot);
|
|
|
|
if (AutoSwap != NULL)
|
|
|
|
Delete_Chunk(AutoSwap->disk, AutoSwap);
|
|
|
|
if (AutoVar != NULL)
|
|
|
|
Delete_Chunk(AutoVar->disk, AutoVar);
|
|
|
|
if (AutoTmp != NULL)
|
|
|
|
Delete_Chunk(AutoTmp->disk, AutoTmp);
|
|
|
|
if (AutoUsr != NULL)
|
|
|
|
Delete_Chunk(AutoUsr->disk, AutoUsr);
|
|
|
|
if (AutoHome != NULL)
|
|
|
|
Delete_Chunk(AutoHome->disk, AutoHome);
|
2011-11-24 15:47:01 +00:00
|
|
|
record_label_chunks(dev);
|
2001-12-09 09:47:09 +00:00
|
|
|
}
|
|
|
|
return(msg);
|
|
|
|
}
|
|
|
|
|
1997-06-05 09:48:03 +00:00
|
|
|
static int
|
1997-10-12 16:21:21 +00:00
|
|
|
diskLabelNonInteractive(Device *dev)
|
1997-06-05 09:48:03 +00:00
|
|
|
{
|
|
|
|
char *cp;
|
|
|
|
PartType type;
|
|
|
|
PartInfo *p;
|
2002-11-12 21:18:54 +00:00
|
|
|
u_long flags;
|
1997-06-05 09:48:03 +00:00
|
|
|
int i, status;
|
|
|
|
Device **devs;
|
|
|
|
Disk *d;
|
1999-12-14 04:25:29 +00:00
|
|
|
|
1997-06-05 09:48:03 +00:00
|
|
|
status = DITEM_SUCCESS;
|
|
|
|
cp = variable_get(VAR_DISK);
|
|
|
|
if (!cp) {
|
|
|
|
msgConfirm("diskLabel: No disk selected - can't label automatically.");
|
|
|
|
return DITEM_FAILURE;
|
|
|
|
}
|
|
|
|
devs = deviceFind(cp, DEVICE_TYPE_DISK);
|
|
|
|
if (!devs) {
|
|
|
|
msgConfirm("diskLabel: No disk device %s found!", cp);
|
|
|
|
return DITEM_FAILURE;
|
|
|
|
}
|
1997-10-12 16:21:21 +00:00
|
|
|
if (dev)
|
|
|
|
d = dev->private;
|
|
|
|
else
|
|
|
|
d = devs[0]->private;
|
2011-11-24 15:47:01 +00:00
|
|
|
record_label_chunks(dev);
|
1997-06-05 09:48:03 +00:00
|
|
|
for (i = 0; label_chunk_info[i].c; i++) {
|
|
|
|
Chunk *c1 = label_chunk_info[i].c;
|
|
|
|
|
|
|
|
if (label_chunk_info[i].type == PART_SLICE) {
|
1997-08-11 13:08:29 +00:00
|
|
|
char name[512];
|
2002-11-12 21:09:58 +00:00
|
|
|
char typ[10], mpoint[50];
|
|
|
|
int entries;
|
1997-06-05 09:48:03 +00:00
|
|
|
|
2002-11-12 21:09:58 +00:00
|
|
|
for (entries = 1;; entries++) {
|
2004-03-16 17:07:06 +00:00
|
|
|
intmax_t sz;
|
|
|
|
int soft = 0;
|
1997-08-11 13:08:29 +00:00
|
|
|
snprintf(name, sizeof name, "%s-%d", c1->name, entries);
|
2002-11-12 21:09:58 +00:00
|
|
|
if ((cp = variable_get(name)) == NULL)
|
|
|
|
break;
|
2004-03-16 17:07:06 +00:00
|
|
|
if (sscanf(cp, "%s %jd %s %d", typ, &sz, mpoint, &soft) < 3) {
|
2002-11-12 21:09:58 +00:00
|
|
|
msgConfirm("For slice entry %s, got an invalid detail entry of: %s", c1->name, cp);
|
|
|
|
status = DITEM_FAILURE;
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
Chunk *tmp;
|
|
|
|
|
2002-11-12 21:18:54 +00:00
|
|
|
flags = 0;
|
2002-11-12 21:09:58 +00:00
|
|
|
if (!strcmp(typ, "swap")) {
|
|
|
|
type = PART_SWAP;
|
|
|
|
strcpy(mpoint, "SWAP");
|
|
|
|
} else {
|
|
|
|
type = PART_FILESYSTEM;
|
|
|
|
if (!strcmp(mpoint, "/"))
|
|
|
|
flags |= CHUNK_IS_ROOT;
|
|
|
|
}
|
|
|
|
if (!sz)
|
|
|
|
sz = space_free(c1);
|
|
|
|
if (sz > space_free(c1)) {
|
|
|
|
msgConfirm("Not enough free space to create partition: %s", mpoint);
|
1997-06-05 09:48:03 +00:00
|
|
|
status = DITEM_FAILURE;
|
2002-11-12 21:09:58 +00:00
|
|
|
break;
|
1997-06-05 09:48:03 +00:00
|
|
|
}
|
2002-11-12 21:09:58 +00:00
|
|
|
if (!(tmp = Create_Chunk_DWIM(d, c1, sz, part,
|
|
|
|
(type == PART_SWAP) ? FS_SWAP : FS_BSDFFS, flags))) {
|
|
|
|
msgConfirm("Unable to create from partition spec: %s. Too big?", cp);
|
|
|
|
status = DITEM_FAILURE;
|
|
|
|
break;
|
|
|
|
} else {
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
PartInfo *pi;
|
2004-08-04 05:40:15 +00:00
|
|
|
pi = tmp->private_data = new_part(PART_FILESYSTEM, mpoint, TRUE);
|
2002-11-12 21:09:58 +00:00
|
|
|
tmp->private_free = safe_free;
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
pi->newfs_data.newfs_ufs.softupdates = soft;
|
1997-06-05 09:48:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2002-11-12 21:09:58 +00:00
|
|
|
} else {
|
1997-08-11 13:08:29 +00:00
|
|
|
/* Must be something we can set a mountpoint for */
|
1997-06-05 09:48:03 +00:00
|
|
|
cp = variable_get(c1->name);
|
|
|
|
if (cp) {
|
1997-08-11 13:08:29 +00:00
|
|
|
char mpoint[50], do_newfs[8];
|
1997-06-05 09:48:03 +00:00
|
|
|
Boolean newfs = FALSE;
|
|
|
|
|
1997-08-11 13:08:29 +00:00
|
|
|
do_newfs[0] = '\0';
|
|
|
|
if (sscanf(cp, "%s %s", mpoint, do_newfs) != 2) {
|
1997-06-05 09:48:03 +00:00
|
|
|
msgConfirm("For slice entry %s, got an invalid detail entry of: %s", c1->name, cp);
|
|
|
|
status = DITEM_FAILURE;
|
2002-11-12 21:12:42 +00:00
|
|
|
break;
|
1997-06-05 09:48:03 +00:00
|
|
|
}
|
1997-08-11 13:08:29 +00:00
|
|
|
newfs = toupper(do_newfs[0]) == 'Y' ? TRUE : FALSE;
|
1997-06-05 09:48:03 +00:00
|
|
|
if (c1->private_data) {
|
|
|
|
p = c1->private_data;
|
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.
(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use
soft updates on an msdos file system.
(2) Distinguish adding new arguments to the newfs command line from
replacing it. Permit the addition of new arguments by the user for
NEWFS_UFS. If we entirely replace the command line provided by
sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional
arguments; 'Z' will opt to replace the newfs command line entirely,
but will prompt the user with their current command line as a
starting point.
(3) Construct the newfs command line dynamically based on the options
provided by the user at label-time. Right now, this means selecting
UFS1 vs. UFS2, and the soft updates flag. Drop in some variables
to support ACLs and MAC Multilabel in the future also, but don't
expose them now.
This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor. It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.
While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.
Reviewed by: jhb, marcel
Approved by: re
ia64 bits from: marcel
2002-12-03 22:25:47 +00:00
|
|
|
p->do_newfs = newfs;
|
1997-06-05 09:48:03 +00:00
|
|
|
strcpy(p->mountpoint, mpoint);
|
|
|
|
}
|
|
|
|
else {
|
2004-08-04 05:40:15 +00:00
|
|
|
c1->private_data = new_part(PART_FILESYSTEM, mpoint, newfs);
|
1997-06-05 09:48:03 +00:00
|
|
|
c1->private_free = safe_free;
|
|
|
|
}
|
|
|
|
if (!strcmp(mpoint, "/"))
|
|
|
|
c1->flags |= CHUNK_IS_ROOT;
|
|
|
|
else
|
|
|
|
c1->flags &= ~CHUNK_IS_ROOT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (status == DITEM_SUCCESS)
|
1999-02-05 22:15:52 +00:00
|
|
|
variable_set2(DISK_LABELLED, "yes", 0);
|
1997-06-05 09:48:03 +00:00
|
|
|
return status;
|
|
|
|
}
|