Deleted Added
full compact
label.c (87581) label.c (87583)
1/*
2 * The new sysinstall program.
3 *
4 * This is probably the last program in the `sysinstall' line - the next
5 * generation being essentially a complete rewrite.
6 *
1/*
2 * The new sysinstall program.
3 *
4 * This is probably the last program in the `sysinstall' line - the next
5 * generation being essentially a complete rewrite.
6 *
7 * $FreeBSD: head/usr.sbin/sysinstall/label.c 87581 2001-12-09 23:40:02Z dillon $
7 * $FreeBSD: head/usr.sbin/sysinstall/label.c 87583 2001-12-10 02:18:05Z dillon $
8 *
9 * Copyright (c) 1995
10 * Jordan Hubbard. All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright

--- 44 unchanged lines hidden (view full) ---

60#ifdef __alpha__
61#define ROOT_MIN_SIZE 40
62#else
63#define ROOT_MIN_SIZE 30
64#endif
65#define SWAP_MIN_SIZE 32
66#define USR_MIN_SIZE 80
67#define VAR_MIN_SIZE 20
8 *
9 * Copyright (c) 1995
10 * Jordan Hubbard. All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright

--- 44 unchanged lines hidden (view full) ---

60#ifdef __alpha__
61#define ROOT_MIN_SIZE 40
62#else
63#define ROOT_MIN_SIZE 30
64#endif
65#define SWAP_MIN_SIZE 32
66#define USR_MIN_SIZE 80
67#define VAR_MIN_SIZE 20
68#define VARTMP_MIN_SIZE 20
68#define TMP_MIN_SIZE 20
69#define HOME_MIN_SIZE 20
70
71/*
72 * Swap size limit for auto-partitioning (4G).
73 */
74#define SWAP_AUTO_LIMIT_SIZE 4096
75
76/*
77 * Default partition sizes. If we do not have sufficient disk space
78 * for this configuration we scale things relative to the NOM vs DEFAULT
79 * sizes. If the disk is larger then /home will get any remaining space.
80 */
81#define ROOT_DEFAULT_SIZE 128
82#define USR_DEFAULT_SIZE 3072
83#define VAR_DEFAULT_SIZE 256
69#define HOME_MIN_SIZE 20
70
71/*
72 * Swap size limit for auto-partitioning (4G).
73 */
74#define SWAP_AUTO_LIMIT_SIZE 4096
75
76/*
77 * Default partition sizes. If we do not have sufficient disk space
78 * for this configuration we scale things relative to the NOM vs DEFAULT
79 * sizes. If the disk is larger then /home will get any remaining space.
80 */
81#define ROOT_DEFAULT_SIZE 128
82#define USR_DEFAULT_SIZE 3072
83#define VAR_DEFAULT_SIZE 256
84#define VARTMP_DEFAULT_SIZE 256
84#define TMP_DEFAULT_SIZE 256
85#define HOME_DEFAULT_SIZE USR_DEFAULT_SIZE
86
87/*
88 * Nominal partition sizes. These are used to scale the default sizes down
89 * when we have insufficient disk space. If this isn't sufficient we scale
90 * down using the MIN sizes instead.
91 */
92#define ROOT_NOMINAL_SIZE 128
93#define USR_NOMINAL_SIZE 512
94#define VAR_NOMINAL_SIZE 64
85#define HOME_DEFAULT_SIZE USR_DEFAULT_SIZE
86
87/*
88 * Nominal partition sizes. These are used to scale the default sizes down
89 * when we have insufficient disk space. If this isn't sufficient we scale
90 * down using the MIN sizes instead.
91 */
92#define ROOT_NOMINAL_SIZE 128
93#define USR_NOMINAL_SIZE 512
94#define VAR_NOMINAL_SIZE 64
95#define VARTMP_NOMINAL_SIZE 64
95#define TMP_NOMINAL_SIZE 64
96#define HOME_NOMINAL_SIZE USR_NOMINAL_SIZE
97
98/* The bottom-most row we're allowed to scribble on */
99#define CHUNK_ROW_MAX 16
100
101
102/* All the chunks currently displayed on the screen */
103static struct {

--- 1050 unchanged lines hidden (view full) ---

1154 * Attempt to auto-label the disk. 'perc' (0-100) scales
1155 * the size of the various partitions within appropriate
1156 * bounds (NOMINAL through DEFAULT sizes). The procedure
1157 * succeeds of NULL is returned. A non-null return message
1158 * is either a failure-status message (*req == 0), or
1159 * a confirmation requestor (*req == 1). *req is 0 on
1160 * entry to this call.
1161 *
96#define HOME_NOMINAL_SIZE USR_NOMINAL_SIZE
97
98/* The bottom-most row we're allowed to scribble on */
99#define CHUNK_ROW_MAX 16
100
101
102/* All the chunks currently displayed on the screen */
103static struct {

--- 1050 unchanged lines hidden (view full) ---

1154 * Attempt to auto-label the disk. 'perc' (0-100) scales
1155 * the size of the various partitions within appropriate
1156 * bounds (NOMINAL through DEFAULT sizes). The procedure
1157 * succeeds of NULL is returned. A non-null return message
1158 * is either a failure-status message (*req == 0), or
1159 * a confirmation requestor (*req == 1). *req is 0 on
1160 * entry to this call.
1161 *
1162 * We autolabel the following partitions: /, swap, /var, /var/tmp, /usr,
1162 * We autolabel the following partitions: /, swap, /var, /tmp, /usr,
1163 * and /home. /home receives any extra left over disk space.
1164 */
1165static char *
1166try_auto_label(Device **devs, Device *dev, int perc, int *req)
1167{
1168 int sz;
1169 struct chunk *root_chunk = NULL;
1170 struct chunk *swap_chunk = NULL;

--- 72 unchanged lines hidden (view full) ---

1243 "partition your disk manually with a custom install!";
1244 goto done;
1245 }
1246 var_chunk->private_data = new_part("/var", TRUE, var_chunk->size);
1247 var_chunk->private_free = safe_free;
1248 var_chunk->flags |= CHUNK_NEWFS;
1249 record_label_chunks(devs, dev);
1250 }
1163 * and /home. /home receives any extra left over disk space.
1164 */
1165static char *
1166try_auto_label(Device **devs, Device *dev, int perc, int *req)
1167{
1168 int sz;
1169 struct chunk *root_chunk = NULL;
1170 struct chunk *swap_chunk = NULL;

--- 72 unchanged lines hidden (view full) ---

1243 "partition your disk manually with a custom install!";
1244 goto done;
1245 }
1246 var_chunk->private_data = new_part("/var", TRUE, var_chunk->size);
1247 var_chunk->private_free = safe_free;
1248 var_chunk->flags |= CHUNK_NEWFS;
1249 record_label_chunks(devs, dev);
1250 }
1251 if (!tmpdev && !variable_get(VAR_NO_VARTMP)) {
1252 sz = requested_part_size(VAR_VARTMP_SIZE, VARTMP_NOMINAL_SIZE, VARTMP_DEFAULT_SIZE, perc);
1251 if (!tmpdev && !variable_get(VAR_NO_TMP)) {
1252 sz = requested_part_size(VAR_TMP_SIZE, TMP_NOMINAL_SIZE, TMP_DEFAULT_SIZE, perc);
1253
1254 tmp_chunk = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
1255 label_chunk_info[here].c, sz, part,
1256 FS_BSDFFS, CHUNK_AUTO_SIZE);
1257 if (!tmp_chunk) {
1258 *req = 1;
1253
1254 tmp_chunk = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
1255 label_chunk_info[here].c, sz, part,
1256 FS_BSDFFS, CHUNK_AUTO_SIZE);
1257 if (!tmp_chunk) {
1258 *req = 1;
1259 msg = "Not enough free space for /var/tmp - you will need to\n"
1259 msg = "Not enough free space for /tmp - you will need to\n"
1260 "partition your disk manually with a custom install!";
1261 goto done;
1262 }
1263 tmp_chunk->private_data = new_part("/tmp", TRUE, tmp_chunk->size);
1264 tmp_chunk->private_free = safe_free;
1265 tmp_chunk->flags |= CHUNK_NEWFS;
1266 record_label_chunks(devs, dev);
1267 }

--- 200 unchanged lines hidden ---
1260 "partition your disk manually with a custom install!";
1261 goto done;
1262 }
1263 tmp_chunk->private_data = new_part("/tmp", TRUE, tmp_chunk->size);
1264 tmp_chunk->private_free = safe_free;
1265 tmp_chunk->flags |= CHUNK_NEWFS;
1266 record_label_chunks(devs, dev);
1267 }

--- 200 unchanged lines hidden ---