Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/sysinst If we have no explicitly marke target root ...



details:   https://anonhg.NetBSD.org/src/rev/8aba168c1e7a
branches:  trunk
changeset: 944597:8aba168c1e7a
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Oct 04 16:09:12 2020 +0000

description:
If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.

diffstat:

 usr.sbin/sysinst/bsddisklabel.c |  31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)

diffs (45 lines):

diff -r a9d9492d0dfd -r 8aba168c1e7a usr.sbin/sysinst/bsddisklabel.c
--- a/usr.sbin/sysinst/bsddisklabel.c   Sun Oct 04 14:44:47 2020 +0000
+++ b/usr.sbin/sysinst/bsddisklabel.c   Sun Oct 04 16:09:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bsddisklabel.c,v 1.46 2020/10/03 18:54:18 martin Exp $ */
+/*     $NetBSD: bsddisklabel.c,v 1.47 2020/10/04 16:09:12 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1774,6 +1774,35 @@
        }
 
        /*
+        * Make sure the target root partition is properly marked
+        */
+       bool have_inst_target = false;
+       for (size_t i = 0; i < wanted.num; i++) {
+               if (wanted.infos[i].cur_flags & PTI_INSTALL_TARGET) {
+                       have_inst_target = true;
+                       break;
+                }
+       }
+       if (!have_inst_target) {
+               for (size_t i = 0; i < wanted.num; i++) {
+                       struct disk_part_info info;
+
+                       if (wanted.infos[i].type != PT_root ||
+                           strcmp(wanted.infos[i].mount, "/") != 0) 
+                               continue;
+                       wanted.infos[i].cur_flags |= PTI_INSTALL_TARGET;
+
+                       if (!wanted.parts->pscheme->get_part_info(wanted.parts,
+                           wanted.infos[i].cur_part_id, &info))
+                               break;
+                       info.flags |= PTI_INSTALL_TARGET;
+                       wanted.parts->pscheme->set_part_info(wanted.parts,
+                           wanted.infos[i].cur_part_id, &info, NULL);
+                       break;
+               }
+       }
+
+       /*
         * OK, we have a partition table. Give the user the chance to
         * edit it and verify it's OK, or abort altogether.
         */



Home | Main Index | Thread Index | Old Index