Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/usr.sbin/sysinst Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/1b39a37b7002
branches:  netbsd-9
changeset: 372638:1b39a37b7002
user:      snj <snj%NetBSD.org@localhost>
date:      Wed Dec 14 15:36:52 2022 +0000

description:
Pull up following revision(s) (requested by martin in ticket #1553):

        usr.sbin/sysinst/bsddisklabel.c: revision 1.67

A little less (confusing) magic: adjust the size of / when adding /usr
only if / has not beenn manually resized.

diffstat:

 usr.sbin/sysinst/bsddisklabel.c |  29 +++++++++++++++++------------
 1 files changed, 17 insertions(+), 12 deletions(-)

diffs (59 lines):

diff -r 93e44d332026 -r 1b39a37b7002 usr.sbin/sysinst/bsddisklabel.c
--- a/usr.sbin/sysinst/bsddisklabel.c   Tue Dec 06 19:27:34 2022 +0000
+++ b/usr.sbin/sysinst/bsddisklabel.c   Wed Dec 14 15:36:52 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bsddisklabel.c,v 1.23.2.11 2020/10/15 19:36:50 bouyer Exp $    */
+/*     $NetBSD: bsddisklabel.c,v 1.23.2.12 2022/12/14 15:36:52 snj Exp $       */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -653,18 +653,23 @@
                                }
                        }
                        /* 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 @@
        }
        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;
@@ -1205,6 +1209,7 @@
                            wanted->infos[root].limit;
                }
        }
+       wanted->infos[root].def_size = wanted->infos[root].size;
 }
 
 /*



Home | Main Index | Thread Index | Old Index