--- label.c.orig Mon Oct 28 05:34:00 2002 +++ label.c Mon Oct 28 06:36:44 2002 @@ -80,11 +80,12 @@ * 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. */ -#define ROOT_DEFAULT_SIZE 128 -#define USR_DEFAULT_SIZE 3072 -#define VAR_DEFAULT_SIZE 256 -#define TMP_DEFAULT_SIZE 256 -#define HOME_DEFAULT_SIZE USR_DEFAULT_SIZE +#define ROOT_DEFAULT_SIZE (large ? ROOT_LARGE_SIZE : 128) +#define SWAP_DEFAULT_SIZE (large ? SWAP_LARGE_SIZE : 0) +#define USR_DEFAULT_SIZE (large ? USR_LARGE_SIZE : 3072) +#define VAR_DEFAULT_SIZE (large ? VAR_LARGE_SIZE : 256) +#define TMP_DEFAULT_SIZE (large ? TMP_LARGE_SIZE : 256) +#define HOME_DEFAULT_SIZE (large ? HOME_LARGE_SIZE : USR_DEFAULT_SIZE) /* * Nominal partition sizes. These are used to scale the default sizes down @@ -97,6 +98,23 @@ #define TMP_NOMINAL_SIZE 64 #define HOME_NOMINAL_SIZE USR_NOMINAL_SIZE +/* + * Large partition sizes. If we have a 'large' disk (60gig?) then we + * try to scale things up a bit.. In this case, we create the /home + * mount point. + */ +#define ROOT_LARGE_SIZE ( 1024) +#define SWAP_LARGE_SIZE ( 4*1024) +#define USR_LARGE_SIZE (15*1024) +#define VAR_LARGE_SIZE ( 4*1024) +#define TMP_LARGE_SIZE ( 8*1024) +#define HOME_LARGE_SIZE (17*1024) + +/* + * Let's define a what we think a large disk is.. + */ +#define LARGE_DISK_SIZE (58*1024*1024) + /* The bottom-most row we're allowed to scribble on */ #define CHUNK_ROW_MAX 16 @@ -1178,6 +1196,7 @@ try_auto_label(Device **devs, Device *dev, int perc, int *req) { int sz; + int large = 0; struct chunk *root_chunk = NULL; struct chunk *swap_chunk = NULL; struct chunk *usr_chunk = NULL; @@ -1192,6 +1211,11 @@ char *msg = NULL; sz = space_free(label_chunk_info[here].c); + if (sz > LARGE_DISK_SIZE) + large = 1; + else + large = 0; /* Just in case */ + if (sz <= FS_MIN_SIZE) return("Not enough free space to create a new partition in the slice"); @@ -1214,7 +1238,7 @@ record_label_chunks(devs, dev); } if (!swapdev) { - sz = requested_part_size(VAR_SWAP_SIZE, 0, 0, perc); + sz = requested_part_size(VAR_SWAP_SIZE, 0, SWAP_DEFAULT_SIZE, perc); if (sz == 0) { int nom; int def; @@ -1279,9 +1303,9 @@ } if (!usrdev && !variable_get(VAR_NO_USR)) { sz = requested_part_size(VAR_USR_SIZE, USR_NOMINAL_SIZE, USR_DEFAULT_SIZE, perc); -#if AUTO_HOME == 0 + if (!large) sz = space_free(label_chunk_info[here].c); -#endif + if (sz) { if (sz < (USR_MIN_SIZE * ONE_MEG)) { *req = 1; @@ -1303,7 +1327,7 @@ record_label_chunks(devs, dev); } } -#if AUTO_HOME == 1 +if (large) if (!homedev && !variable_get(VAR_NO_HOME)) { sz = requested_part_size(VAR_HOME_SIZE, HOME_NOMINAL_SIZE, HOME_DEFAULT_SIZE, perc); if (sz < space_free(label_chunk_info[here].c)) @@ -1330,7 +1354,7 @@ record_label_chunks(devs, dev); } } -#endif + /* At this point, we're reasonably "labelled" */ if (variable_cmp(DISK_LABELLED, "written"))