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/520dbfa5a28d
branches:  netbsd-9
changeset: 744701:520dbfa5a28d
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Mon Feb 10 21:39:37 2020 +0000

description:
Pull up following revision(s) (requested by martin in ticket #693):
        usr.sbin/sysinst/arch/x68k/msg.md.en: revision 1.2
        usr.sbin/sysinst/arch/x68k/md.c: revision 1.10
        usr.sbin/sysinst/arch/mvme68k/msg.md.fr: revision 1.2
        usr.sbin/sysinst/arch/x68k/msg.md.en: revision 1.3
        usr.sbin/sysinst/arch/mvme68k/msg.md.fr: revision 1.3
        usr.sbin/sysinst/msg.mi.en: revision 1.28
        usr.sbin/sysinst/arch/hp300/md.c: revision 1.10
        usr.sbin/sysinst/msg.mi.es: revision 1.22
        usr.sbin/sysinst/target.c: revision 1.12
        usr.sbin/sysinst/arch/mvme68k/md.c: revision 1.10
        usr.sbin/sysinst/arch/i386/md.c: revision 1.30
        usr.sbin/sysinst/arch/mvme68k/msg.md.pl: revision 1.2
        usr.sbin/sysinst/arch/mvme68k/msg.md.pl: revision 1.3
        usr.sbin/sysinst/bsddisklabel.c: revision 1.39
        usr.sbin/sysinst/arch/mvme68k/msg.md.de: revision 1.2
        usr.sbin/sysinst/arch/mac68k/md.c: revision 1.9
        usr.sbin/sysinst/disklabel.c: revision 1.35
        usr.sbin/sysinst/arch/mvme68k/msg.md.de: revision 1.3
        usr.sbin/sysinst/defs.h: revision 1.55
        usr.sbin/sysinst/disks.c: revision 1.63
        usr.sbin/sysinst/disks.c: revision 1.64
        usr.sbin/sysinst/mbr.c: revision 1.31
        usr.sbin/sysinst/disks.c: revision 1.65
        usr.sbin/sysinst/txtwalk.c: revision 1.3
        usr.sbin/sysinst/txtwalk.c: revision 1.4
        usr.sbin/sysinst/arch/mvme68k/msg.md.en: revision 1.2
        usr.sbin/sysinst/arch/mvme68k/msg.md.en: revision 1.3
        usr.sbin/sysinst/msg.mi.fr: revision 1.26
        usr.sbin/sysinst/msg.mi.pl: revision 1.29
        usr.sbin/sysinst/arch/mvme68k/msg.md.es: revision 1.2
        usr.sbin/sysinst/upgrade.c: revision 1.15
        usr.sbin/sysinst/arch/mvme68k/msg.md.es: revision 1.3
        usr.sbin/sysinst/upgrade.c: revision 1.16
        usr.sbin/sysinst/partman.c: revision 1.50
        usr.sbin/sysinst/msg.mi.de: revision 1.21
remove unused "emptypart" message (or moved to ifdef notyet area)
PR install/54921: message "ordering" takes a %s argument.
PR install/54921: skip non-user partitions when checking for overlaps
bootxx_name() - fix oversight in previous change (do not assume first
partition is the root partition)
PR install/54934: always use -f on the installboot invocation. We come
here post-newfs (and maybe should have dd'd zeros to the start of the
disk before newfs instead).
Remove a bogus assert: when reading disklabel partitions and the outer
(MBR) partitioning has changed, but the changes have not yet been written
back to disk, we need to ignore the kernels idea of the disklabel and
instead continue with an empty one.
Deal with partitioning schemes having no inner counterpart.
Avoid NULL derefs.
Do not assum a partitioning scheme that supports innner partitions always
needs to actually have such partitions defined.
PR bin/54944: deal with escaped spaces in NAME= syntax in /etc/fstab.
PR bin/54944: explicitly reject GPT protective MBRs.
PR bin/54944: make the "explicit single wedge" selection also work for
upgrades.
Reformat a query to add an automatically detected swap partition
so it fits on narrow screens.
Make re-install sets also work for an explicit selected root wedge
Fix copy&pasto in previous - from kre.
Only a single partition can ever have the "extend" flag (grow to available
size).
Do not use -P for tar extractions - the in tree tar has been fixed.
Finish conversion to generic partitioning backend

diffstat:

 usr.sbin/sysinst/arch/hp300/md.c        |    8 +-
 usr.sbin/sysinst/arch/i386/md.c         |    4 +-
 usr.sbin/sysinst/arch/mac68k/md.c       |  116 ++++++++++++-------------------
 usr.sbin/sysinst/arch/mvme68k/md.c      |    8 +-
 usr.sbin/sysinst/arch/mvme68k/msg.md.de |   13 +-
 usr.sbin/sysinst/arch/mvme68k/msg.md.en |   13 +-
 usr.sbin/sysinst/arch/mvme68k/msg.md.es |   12 +-
 usr.sbin/sysinst/arch/mvme68k/msg.md.fr |    8 +-
 usr.sbin/sysinst/arch/mvme68k/msg.md.pl |    8 +-
 usr.sbin/sysinst/arch/x68k/md.c         |    8 +-
 usr.sbin/sysinst/arch/x68k/msg.md.en    |   12 +-
 usr.sbin/sysinst/bsddisklabel.c         |    4 +-
 usr.sbin/sysinst/defs.h                 |    4 +-
 usr.sbin/sysinst/disklabel.c            |   10 +-
 usr.sbin/sysinst/disks.c                |   26 +++++-
 usr.sbin/sysinst/mbr.c                  |   18 ++++-
 usr.sbin/sysinst/msg.mi.de              |    4 +-
 usr.sbin/sysinst/msg.mi.en              |    5 +-
 usr.sbin/sysinst/msg.mi.es              |    5 +-
 usr.sbin/sysinst/msg.mi.fr              |    5 +-
 usr.sbin/sysinst/msg.mi.pl              |    5 +-
 usr.sbin/sysinst/partman.c              |   16 ++-
 usr.sbin/sysinst/target.c               |   13 ++-
 usr.sbin/sysinst/txtwalk.c              |   11 ++-
 usr.sbin/sysinst/upgrade.c              |   17 +---
 25 files changed, 195 insertions(+), 158 deletions(-)

diffs (truncated from 837 to 300 lines):

diff -r deec85e7502e -r 520dbfa5a28d usr.sbin/sysinst/arch/hp300/md.c
--- a/usr.sbin/sysinst/arch/hp300/md.c  Mon Feb 10 19:32:47 2020 +0000
+++ b/usr.sbin/sysinst/arch/hp300/md.c  Mon Feb 10 21:39:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.8.2.1 2019/12/17 09:44:51 msaitoh Exp $ */
+/*     $NetBSD: md.c,v 1.8.2.2 2020/02/10 21:39:38 bouyer Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -136,6 +136,12 @@
 
        for (i = 0; i < install->num; i++) {
                if (i > 0) {
+                       /* skip raw part and similar */
+                       if (install->infos[i].cur_flags &
+                           (PTI_SEC_CONTAINER|PTI_PSCHEME_INTERNAL|
+                           PTI_RAW_PART))
+                               continue;
+
                        if (install->infos[i].cur_start < last_end) {
                                snprintf(desc, sizeof desc,
                                    "%zu (%s)", i,
diff -r deec85e7502e -r 520dbfa5a28d usr.sbin/sysinst/arch/i386/md.c
--- a/usr.sbin/sysinst/arch/i386/md.c   Mon Feb 10 19:32:47 2020 +0000
+++ b/usr.sbin/sysinst/arch/i386/md.c   Mon Feb 10 21:39:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.20.2.5 2020/01/28 10:17:58 msaitoh Exp $ */
+/*     $NetBSD: md.c,v 1.20.2.6 2020/02/10 21:39:38 bouyer Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -291,7 +291,7 @@
                    "console=%s,speed=%u", consoles[boottype.bp_consdev],
                    boottype.bp_conspeed);
                        ret = run_program(RUN_DISPLAY,
-                           "/usr/sbin/installboot -o %s %s %s",
+                           "/usr/sbin/installboot -f -o %s %s %s",
                            boot_options, rdev, bootxx_filename);
                 free(bootxx_filename);
         } else {
diff -r deec85e7502e -r 520dbfa5a28d usr.sbin/sysinst/arch/mac68k/md.c
--- a/usr.sbin/sysinst/arch/mac68k/md.c Mon Feb 10 19:32:47 2020 +0000
+++ b/usr.sbin/sysinst/arch/mac68k/md.c Mon Feb 10 21:39:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.8 2019/07/13 17:13:38 martin Exp $ */
+/*     $NetBSD: md.c,v 1.8.2.1 2020/02/10 21:39:38 bouyer Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -247,12 +247,13 @@
 bool
 md_make_bsd_partitions(struct install_partition_desc *install)
 {
-       int rv;
-#if 0  // XXX
-       FILE *f;
-       int i, j, pl;
+       int i, j, rv;
        EBZB *bzb;
-#endif
+       struct disk_part_info info;
+       uint fs_type;
+       const char *mountpoint;
+       part_id pid;
+       size_t ndx;
 
        /*
         * Scan for any problems and report them before continuing.
@@ -272,16 +273,10 @@
                break;
        }
 
-#if 0  // XXX
-       /* Build standard partitions */
-       memset(&pm->bsdlabel, 0, sizeof pm->bsdlabel);
+       /* Start with empty fake disklabel partitions */
+       pm->parts->pscheme->delete_all_partitions(pm->parts);
 
        /*
-        * The mac68k port has a predefined partition for "c" which
-        *  is the size of the disk, everything else is unused.
-        */
-       pm->bsdlabel[RAW_PART].pi_size = pm->dlsize;
-       /*
         * Now, scan through the Disk Partition Map and transfer the
         *  information into the incore disklabel.
         */
@@ -289,80 +284,63 @@
            j = map.mblk[i];
            bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
            if (bzb->flags.part) {
-               pl = bzb->flags.part - 'a';
+               mountpoint = NULL;
+               fs_type = FS_UNUSED;
                switch (whichType(&map.blk[j])) {
                    case HFS_PART:
-                       pm->bsdlabel[pl].pi_fstype = FS_HFS;
-                       strcpy (pm->bsdlabel[pl].pi_mount, (char *)bzb->mount_point);
+                       fs_type = FS_HFS;
+                       mountpoint = (const char*)bzb->mount_point;
                        break;
                    case ROOT_PART:
                    case UFS_PART:
-                       pm->bsdlabel[pl].pi_fstype = FS_BSDFFS;
-                       strcpy (pm->bsdlabel[pl].pi_mount, (char *)bzb->mount_point);
-                       pm->bsdlabel[pl].pi_flags |= PIF_NEWFS | PIF_MOUNT;
+                       fs_type = FS_BSDFFS;
+                       mountpoint = (const char*)bzb->mount_point;
                        break;
                    case SWAP_PART:
-                       pm->bsdlabel[pl].pi_fstype = FS_SWAP;
+                       fs_type = FS_SWAP;
                        break;
                    case SCRATCH_PART:
-                       pm->bsdlabel[pl].pi_fstype = FS_OTHER;
-                       strcpy (pm->bsdlabel[pl].pi_mount, (char *)bzb->mount_point);
+                       fs_type = FS_OTHER;
+                       mountpoint = (const char*)bzb->mount_point;
+                       break;
                    default:
-                       break;
+                       continue;
                }
-               if (pm->bsdlabel[pl].pi_fstype != FS_UNUSED) {
-                   pm->bsdlabel[pl].pi_size = map.blk[j].pmPartBlkCnt;
-                   pm->bsdlabel[pl].pi_offset = map.blk[j].pmPyPartStart;
-                   if (pm->bsdlabel[pl].pi_fstype != FS_SWAP) {
-                       pm->bsdlabel[pl].pi_frag = 8;
-                       pm->bsdlabel[pl].pi_fsize = 1024;
-                   }
+               if (fs_type != FS_UNUSED) {
+                       memset(&info, 0, sizeof info);
+                       info.start = map.blk[j].pmPyPartStart;
+                       info.size = map.blk[j].pmPartBlkCnt;
+                       info.fs_type = fs_type;
+                       info.last_mounted = mountpoint;
+                       info.nat_type = pm->parts->pscheme->get_fs_part_type(
+                           PT_root, fs_type, 0);
+                       pid = pm->parts->pscheme->add_outer_partition(pm->parts,
+                           &info, NULL);
+                       if (pid == NO_PART)
+                               return false;
                }
            }
        }
 
        /* Disk name  - don't bother asking, just use the physical name*/
-       strcpy (pm->bsddiskname, pm->diskdev);
+       pm->parts->pscheme->set_disk_pack_name(pm->parts, pm->diskdev);
+
+       /* Write the converted partitions */
+       if (!pm->parts->pscheme->write_to_disk(pm->parts))
+               return false;
 
-#ifdef DEBUG
-       f = fopen ("/tmp/disktab", "w");
-#else
-       f = fopen ("/etc/disktab", "w");
-#endif
-       if (f == NULL) {
-               endwin();
-               (void) fprintf (stderr, "Could not open /etc/disktab");
-               exit (1);
+       /* now convert to install info */
+       if (!install_desc_from_parts(install, pm->parts))
+               return false;
+
+       /* set newfs flag for all FFS partitions */
+       for (ndx = 0; ndx < install->num; ndx++) {
+               if (install->infos[ndx].fs_type == FS_BSDFFS &&
+                   install->infos[ndx].size > 0 &&
+                   (install->infos[ndx].instflags & PUIINST_MOUNT))
+                       install->infos[ndx].instflags |= PUIINST_NEWFS;
        }
-       (void)fprintf (f, "%s|NetBSD installation generated:\\\n", pm->bsddiskname);
-       (void)fprintf (f, "\t:dt=%s:ty=winchester:\\\n", pm->disktype);
-       (void)fprintf (f, "\t:nc#%d:nt#%d:ns#%d:\\\n", pm->dlcyl, pm->dlhead, pm->dlsec);
-       (void)fprintf (f, "\t:sc#%d:su#%" PRIu32 ":\\\n", pm->dlhead*pm->dlsec, (uint32_t)pm->dlsize);
-       (void)fprintf (f, "\t:se#%d:%s\\\n", blk_size, pm->doessf);
-       for (i=0; i<8; i++) {
-               if (pm->bsdlabel[i].pi_fstype == FS_HFS)
-                   (void)fprintf (f, "\t:p%c#%d:o%c#%d:t%c=macos:",
-                              'a'+i, pm->bsdlabel[i].pi_size,
-                              'a'+i, pm->bsdlabel[i].pi_offset,
-                              'a'+i);
-               else
-                   (void)fprintf (f, "\t:p%c#%d:o%c#%d:t%c=%s:",
-                              'a'+i, pm->bsdlabel[i].pi_size,
-                              'a'+i, pm->bsdlabel[i].pi_offset,
-                              'a'+i, getfslabelname(pm->bsdlabel[i].pi_fstype));
-               if (pm->bsdlabel[i].pi_fstype == FS_BSDFFS)
-                       (void)fprintf (f, "b%c#%d:f%c#%d",
-                          'a'+i, pm->bsdlabel[i].pi_fsize * pm->bsdlabel[i].pi_frag,
-                          'a'+i, pm->bsdlabel[i].pi_fsize);
-               if (i < 7)
-                       (void)fprintf (f, "\\\n");
-               else
-                       (void)fprintf (f, "\n");
-       }
-       fclose (f);
-#endif
 
-       /* Everything looks OK. */
        return true;
 }
 
diff -r deec85e7502e -r 520dbfa5a28d usr.sbin/sysinst/arch/mvme68k/md.c
--- a/usr.sbin/sysinst/arch/mvme68k/md.c        Mon Feb 10 19:32:47 2020 +0000
+++ b/usr.sbin/sysinst/arch/mvme68k/md.c        Mon Feb 10 21:39:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.8.2.1 2019/12/17 09:44:50 msaitoh Exp $       */
+/*     $NetBSD: md.c,v 1.8.2.2 2020/02/10 21:39:37 bouyer Exp $        */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -136,6 +136,12 @@
 
        for (i = 0; i < install->num; i++) {
                if (i > 0) {
+                       /* skip raw part and similar */
+                       if (install->infos[i].cur_flags &
+                           (PTI_SEC_CONTAINER|PTI_PSCHEME_INTERNAL|
+                           PTI_RAW_PART))
+                               continue;
+
                        if (install->infos[i].cur_start < last_end) {
                                snprintf(desc, sizeof desc,
                                    "%zu (%s)", i,
diff -r deec85e7502e -r 520dbfa5a28d usr.sbin/sysinst/arch/mvme68k/msg.md.de
--- a/usr.sbin/sysinst/arch/mvme68k/msg.md.de   Mon Feb 10 19:32:47 2020 +0000
+++ b/usr.sbin/sysinst/arch/mvme68k/msg.md.de   Mon Feb 10 21:39:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.md.de,v 1.1 2014/07/26 19:30:46 dholland Exp $     */
+/*     $NetBSD: msg.md.de,v 1.1.30.1 2020/02/10 21:39:37 bouyer Exp $  */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -55,12 +55,7 @@
 }
 
 message ordering
-{Die Anordnung der Partition %c ist falsch. Erneut editieren?}
-
-
-message emptypart
-{Nach der oder den leeren Partition(en) besteht eine gültige Partition %c.
-Bitte editieren Sie die Partitionstabelle noch einmal.}
+{Die Anordnung der Partition %s ist falsch. Erneut editieren?}
 
 
 message set_kernel_1
@@ -68,6 +63,10 @@
 
 .if notyet
 /* XXX: not yet implemented */
+message emptypart
+{Nach der oder den leeren Partition(en) existiert eine gültige Partition %c.
+Bitte editieren Sie die Partitionstabelle noch einmal.}
+
 message existing
 {Wollen Sie die vorhandene(n) BSD Partition(en) beibehalten?}
 
diff -r deec85e7502e -r 520dbfa5a28d usr.sbin/sysinst/arch/mvme68k/msg.md.en
--- a/usr.sbin/sysinst/arch/mvme68k/msg.md.en   Mon Feb 10 19:32:47 2020 +0000
+++ b/usr.sbin/sysinst/arch/mvme68k/msg.md.en   Mon Feb 10 21:39:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.md.en,v 1.1 2014/07/26 19:30:46 dholland Exp $     */
+/*     $NetBSD: msg.md.en,v 1.1.30.1 2020/02/10 21:39:37 bouyer Exp $  */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -54,17 +54,18 @@
 }
 
 message ordering
-{The order of partition %c is wrong.  Edit again?}
-
-message emptypart
-{There is a valid partition %c after empty partition(s).
-Please re-edit the partition table.}
+{The order of partition %s is wrong.  Edit again?}
 
 message set_kernel_1
 {Kernel (GENERIC)}
 
 .if notyet
 /* XXX: not yet implemented */
+
+message emptypart
+{There is a valid partition %c after empty partition(s).
+Please re-edit the partition table.}
+
 message existing
 {Do you want to preserve existing BSD partition(s)?}
 
diff -r deec85e7502e -r 520dbfa5a28d usr.sbin/sysinst/arch/mvme68k/msg.md.es
--- a/usr.sbin/sysinst/arch/mvme68k/msg.md.es   Mon Feb 10 19:32:47 2020 +0000
+++ b/usr.sbin/sysinst/arch/mvme68k/msg.md.es   Mon Feb 10 21:39:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.md.es,v 1.1 2014/07/26 19:30:46 dholland Exp $     */



Home | Main Index | Thread Index | Old Index