If no partition configuration is specified in {}, use the automatic setup
the interactive installer uses. Example: bsdinstall scriptedpart ada0 Result: Use entire disk for a FreeBSD system with default partition layout
This commit is contained in:
parent
5eca7e06a1
commit
a6b612e920
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245701
@ -42,7 +42,6 @@
|
||||
|
||||
static char *boot_disk(struct gmesh *mesh);
|
||||
static char *wizard_partition(struct gmesh *mesh, const char *disk);
|
||||
static int wizard_makeparts(struct gmesh *mesh, const char *disk);
|
||||
|
||||
int
|
||||
part_wizard(void) {
|
||||
@ -71,7 +70,7 @@ part_wizard(void) {
|
||||
dlg_put_backtitle();
|
||||
error = geom_gettree(&mesh);
|
||||
|
||||
error = wizard_makeparts(&mesh, schemeroot);
|
||||
error = wizard_makeparts(&mesh, schemeroot, 1);
|
||||
if (error)
|
||||
goto startwizard;
|
||||
free(schemeroot);
|
||||
@ -288,8 +287,8 @@ wizard_partition(struct gmesh *mesh, const char *disk)
|
||||
return (retval);
|
||||
}
|
||||
|
||||
static int
|
||||
wizard_makeparts(struct gmesh *mesh, const char *disk)
|
||||
int
|
||||
wizard_makeparts(struct gmesh *mesh, const char *disk, int interactive)
|
||||
{
|
||||
struct gmesh submesh;
|
||||
struct gclass *classp;
|
||||
@ -310,7 +309,7 @@ wizard_makeparts(struct gmesh *mesh, const char *disk)
|
||||
pp = provider_for_name(mesh, disk);
|
||||
|
||||
available = gpart_max_free(gp, NULL)*pp->lg_sectorsize;
|
||||
if (available < MIN_FREE_SPACE) {
|
||||
if (interactive && available < MIN_FREE_SPACE) {
|
||||
char availablestr[10], neededstr[10], message[512];
|
||||
humanize_number(availablestr, 7, available, "B", HN_AUTOSCALE,
|
||||
HN_DECIMAL);
|
||||
|
@ -56,6 +56,7 @@ void delete_part_metadata(const char *name);
|
||||
|
||||
int part_wizard(void);
|
||||
int scripted_editor(int argc, const char **argv);
|
||||
int wizard_makeparts(struct gmesh *mesh, const char *disk, int interactive);
|
||||
|
||||
/* gpart operations */
|
||||
void gpart_delete(struct gprovider *pp);
|
||||
|
@ -109,6 +109,11 @@ part_config(char *disk, const char *scheme, char *config)
|
||||
error = geom_gettree(&mesh);
|
||||
|
||||
/* Create partitions */
|
||||
if (config == NULL) {
|
||||
wizard_makeparts(&mesh, disk, 0);
|
||||
goto finished;
|
||||
}
|
||||
|
||||
while ((partition = strsep(&config, ",")) != NULL) {
|
||||
while ((ap = strsep(&partition, " \t\n")) != NULL) {
|
||||
if (*ap == '\0')
|
||||
@ -131,6 +136,7 @@ part_config(char *disk, const char *scheme, char *config)
|
||||
size = type = mount = NULL;
|
||||
}
|
||||
|
||||
finished:
|
||||
geom_deletetree(&mesh);
|
||||
free(disk);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user