Module Name: src
Committed By: martin
Date: Fri Dec 9 16:54:31 UTC 2022
Modified Files:
src/usr.sbin/sysinst: bsddisklabel.c
Log Message:
A little less (confusing) magic: adjust the size of / when adding /usr
only if / has not beenn manually resized.
To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/usr.sbin/sysinst/bsddisklabel.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/sysinst/bsddisklabel.c
diff -u src/usr.sbin/sysinst/bsddisklabel.c:1.66 src/usr.sbin/sysinst/bsddisklabel.c:1.67
--- src/usr.sbin/sysinst/bsddisklabel.c:1.66 Wed Nov 30 15:57:54 2022
+++ src/usr.sbin/sysinst/bsddisklabel.c Fri Dec 9 16:54:31 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: bsddisklabel.c,v 1.66 2022/11/30 15:57:54 martin Exp $ */
+/* $NetBSD: bsddisklabel.c,v 1.67 2022/12/09 16:54:31 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -653,18 +653,23 @@ set_ptn_size(menudesc *m, void *arg)
}
}
/* Remove space for /usr from / */
- if (root < pset->num && pset->infos[i].cur_part_id ==
- NO_PART) {
- pset->infos[root].size -= p->def_size;
+ if (root < pset->num &&
+ pset->infos[root].cur_part_id == NO_PART &&
+ pset->infos[root].size ==
+ pset->infos[root].def_size) {
+ /*
+ * root partition does not yet exist and
+ * has default size
+ */
+ pset->infos[root].size -= p->def_size;
pset->cur_free_space += p->def_size;
}
- /* hack to add free space to default sized /usr */
- if (strcmp(answer, dflt) == 0) {
- size = p->def_size;
- pset->infos[root].flags &= ~PUIFLAG_EXTEND;
- p->flags |= PUIFLAG_EXTEND;
- goto adjust_free;
- }
+ /*
+ * hack to add free space to /usr if
+ * previously / got it
+ */
+ if (pset->infos[root].flags & PUIFLAG_EXTEND)
+ extend = true;
}
if (new_size_val < 0)
continue;
@@ -687,7 +692,6 @@ set_ptn_size(menudesc *m, void *arg)
}
if (p->limit != 0 && size > p->limit)
size = p->limit;
- adjust_free:
if ((p->flags & (PUIFLG_IS_OUTER|PUIFLG_JUST_MOUNTPOINT)) == 0)
pset->cur_free_space += p->size - size;
p->size = is_percent ? -size : size;
@@ -1206,6 +1210,7 @@ fill_defaults(struct partition_usage_set
wanted->infos[root].limit;
}
}
+ wanted->infos[root].def_size = wanted->infos[root].size;
}
/*