Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/sysinst/arch/evbarm Move MBR writing (if any) post ...



details:   https://anonhg.NetBSD.org/src/rev/d615bd8c364d
branches:  trunk
changeset: 977077:d615bd8c364d
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Oct 14 14:37:59 2020 +0000

description:
Move MBR writing (if any) post disklabel writing, otherwise strange
interactions happen.

diffstat:

 usr.sbin/sysinst/arch/evbarm/md.c |  34 +++++++++++++++++++++++-----------
 1 files changed, 23 insertions(+), 11 deletions(-)

diffs (62 lines):

diff -r dec3c486ca79 -r d615bd8c364d usr.sbin/sysinst/arch/evbarm/md.c
--- a/usr.sbin/sysinst/arch/evbarm/md.c Wed Oct 14 14:02:43 2020 +0000
+++ b/usr.sbin/sysinst/arch/evbarm/md.c Wed Oct 14 14:37:59 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.17 2020/10/12 16:14:33 martin Exp $ */
+/*     $NetBSD: md.c,v 1.18 2020/10/14 14:37:59 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -117,6 +117,13 @@
                        pm->dlsize = ps->size_limit;
        }
 
+       /*
+        * If the selected scheme does not need two-stage partitioning
+        * (like GPT), do not bother to edit the outer partitions.
+        */
+       if (pm->parts->pscheme->secondary_partitions == NULL ||
+           pm->parts->pscheme->secondary_scheme == NULL)
+               return true;
 
        res = edit_outer_parts(pm->parts);
        if (res == 0)
@@ -164,6 +171,21 @@
     struct disk_partitions *parts)
 {
 
+       /*
+        * RAW_PART is 2 on evbarm and bad things happen if we
+        * write the MBR first and then the disklabel - so postpone
+        * the MBR to md_post_disklabel(), unlike other architecturs.
+        */
+       return true;
+}
+
+/*
+ * hook called after writing disklabel to new target disk.
+ */
+bool
+md_post_disklabel(struct install_partition_desc *install,
+    struct disk_partitions *parts)
+{
        if (parts->parent == NULL)
                return true;    /* no outer partitions */
 
@@ -183,16 +205,6 @@
 }
 
 /*
- * hook called after writing disklabel to new target disk.
- */
-bool
-md_post_disklabel(struct install_partition_desc *install,
-    struct disk_partitions *parts)
-{
-       return true;
-}
-
-/*
  * hook called after upgrade() or install() has finished setting
  * up the target disk but immediately before the user is given the
  * ``disks are now set up'' message.



Home | Main Index | Thread Index | Old Index