Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/sysinst (Finally) merge a slightly modified version...



details:   https://anonhg.NetBSD.org/src/rev/e5706c95108a
branches:  trunk
changeset: 331154:e5706c95108a
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Aug 03 16:09:38 2014 +0000

description:
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.

diffstat:

 usr.sbin/sysinst/Makefile.inc                |    12 +-
 usr.sbin/sysinst/arch/acorn32/md.c           |    44 +-
 usr.sbin/sysinst/arch/alpha/md.c             |    20 +-
 usr.sbin/sysinst/arch/amiga/md.c             |     6 +-
 usr.sbin/sysinst/arch/arc/md.c               |    98 +-
 usr.sbin/sysinst/arch/atari/md.c             |    16 +-
 usr.sbin/sysinst/arch/bebox/md.c             |     4 +-
 usr.sbin/sysinst/arch/cats/md.c              |    44 +-
 usr.sbin/sysinst/arch/cobalt/md.c            |    98 +-
 usr.sbin/sysinst/arch/emips/md.c             |    22 +-
 usr.sbin/sysinst/arch/evbarm/md.c            |    50 +-
 usr.sbin/sysinst/arch/evbmips/md.c           |     6 +-
 usr.sbin/sysinst/arch/evbppc/md.c            |     8 +-
 usr.sbin/sysinst/arch/evbsh3/md.c            |    22 +-
 usr.sbin/sysinst/arch/ews4800mips/md.c       |    36 +-
 usr.sbin/sysinst/arch/hp300/md.c             |    38 +-
 usr.sbin/sysinst/arch/hpcarm/md.c            |    10 +-
 usr.sbin/sysinst/arch/hpcmips/md.c           |     8 +-
 usr.sbin/sysinst/arch/hpcsh/md.c             |     4 +-
 usr.sbin/sysinst/arch/hppa/md.c              |    38 +-
 usr.sbin/sysinst/arch/i386/md.c              |    38 +-
 usr.sbin/sysinst/arch/landisk/md.c           |    12 +-
 usr.sbin/sysinst/arch/luna68k/md.c           |    24 +-
 usr.sbin/sysinst/arch/mac68k/md.c            |   130 +-
 usr.sbin/sysinst/arch/mac68k/menus.md.de     |    18 +-
 usr.sbin/sysinst/arch/mac68k/menus.md.en     |    18 +-
 usr.sbin/sysinst/arch/mac68k/menus.md.es     |    18 +-
 usr.sbin/sysinst/arch/mac68k/menus.md.pl     |    18 +-
 usr.sbin/sysinst/arch/macppc/md.c            |    28 +-
 usr.sbin/sysinst/arch/mipsco/md.c            |    26 +-
 usr.sbin/sysinst/arch/mvme68k/md.c           |    34 +-
 usr.sbin/sysinst/arch/news68k/md.c           |    26 +-
 usr.sbin/sysinst/arch/newsmips/md.c          |    26 +-
 usr.sbin/sysinst/arch/ofppc/md.c             |   136 +-
 usr.sbin/sysinst/arch/playstation2/md.c      |    19 +-
 usr.sbin/sysinst/arch/playstation2/msg.md.de |     7 +-
 usr.sbin/sysinst/arch/playstation2/msg.md.en |     6 +-
 usr.sbin/sysinst/arch/playstation2/msg.md.es |     6 +-
 usr.sbin/sysinst/arch/playstation2/msg.md.fr |     6 +-
 usr.sbin/sysinst/arch/playstation2/msg.md.pl |     6 +-
 usr.sbin/sysinst/arch/pmax/md.c              |    26 +-
 usr.sbin/sysinst/arch/prep/md.c              |    30 +-
 usr.sbin/sysinst/arch/sandpoint/md.c         |     8 +-
 usr.sbin/sysinst/arch/sgimips/md.c           |    34 +-
 usr.sbin/sysinst/arch/shark/md.c             |    30 +-
 usr.sbin/sysinst/arch/sparc/md.c             |    26 +-
 usr.sbin/sysinst/arch/sparc64/md.c           |    28 +-
 usr.sbin/sysinst/arch/vax/md.c               |    30 +-
 usr.sbin/sysinst/arch/x68k/md.c              |    60 +-
 usr.sbin/sysinst/arch/zaurus/md.c            |     6 +-
 usr.sbin/sysinst/bsddisklabel.c              |   351 +-
 usr.sbin/sysinst/configmenu.c                |    89 +-
 usr.sbin/sysinst/defs.h                      |   131 +-
 usr.sbin/sysinst/disks.c                     |   646 ++++-
 usr.sbin/sysinst/install.c                   |   100 +-
 usr.sbin/sysinst/label.c                     |    80 +-
 usr.sbin/sysinst/main.c                      |    75 +-
 usr.sbin/sysinst/mbr.c                       |    70 +-
 usr.sbin/sysinst/menus.mi                    |   231 ++-
 usr.sbin/sysinst/msg.mbr.de                  |     4 +-
 usr.sbin/sysinst/msg.mbr.en                  |     4 +-
 usr.sbin/sysinst/msg.mbr.es                  |     4 +-
 usr.sbin/sysinst/msg.mbr.fr                  |     4 +-
 usr.sbin/sysinst/msg.mbr.pl                  |     4 +-
 usr.sbin/sysinst/msg.mi.de                   |   178 +-
 usr.sbin/sysinst/msg.mi.en                   |   180 +-
 usr.sbin/sysinst/msg.mi.es                   |   179 +-
 usr.sbin/sysinst/msg.mi.fr                   |   180 +-
 usr.sbin/sysinst/msg.mi.pl                   |   178 +-
 usr.sbin/sysinst/net.c                       |   197 +-
 usr.sbin/sysinst/partman.c                   |  2793 ++++++++++++++++++++++++++
 usr.sbin/sysinst/run.c                       |    11 +-
 usr.sbin/sysinst/savenewlabel.c              |    61 +-
 usr.sbin/sysinst/sizemultname.c              |     6 +-
 usr.sbin/sysinst/target.c                    |    38 +-
 usr.sbin/sysinst/upgrade.c                   |    15 +-
 usr.sbin/sysinst/util.c                      |    91 +-
 77 files changed, 5817 insertions(+), 1547 deletions(-)

diffs (truncated from 11944 to 300 lines):

diff -r a8f9ea08cdcd -r e5706c95108a usr.sbin/sysinst/Makefile.inc
--- a/usr.sbin/sysinst/Makefile.inc     Sun Aug 03 13:14:59 2014 +0000
+++ b/usr.sbin/sysinst/Makefile.inc     Sun Aug 03 16:09:38 2014 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.2 2014/07/26 19:32:22 dholland Exp $
+#      $NetBSD: Makefile.inc,v 1.3 2014/08/03 16:09:38 martin Exp $
 #
 # Makefile for sysinst
 
@@ -17,7 +17,7 @@
 
 SRCS+= menu_defs.c msg_defs.c main.c install.c upgrade.c \
        txtwalk.c run.c factor.c net.c disks.c disks_lfs.c util.c geom.c \
-       label.c target.c md.c sizemultname.c configmenu.c checkrc.c
+       label.c target.c md.c sizemultname.c configmenu.c checkrc.c partman.c
 
 SRCS+= ${MD_OPTIONS:MAOUT2ELF:S/AOUT2ELF/aout2elf.c/}
 SRCS+= ${MENUS_MD:Mmenus.mbr:S/menus.mbr/mbr.c/}
@@ -49,7 +49,12 @@
 
 CPPFLAGS+=     -I. -I${.CURDIR}/../.. -I${.CURDIR} \
                -DREL=\"${DISTRIBVER}\" -DMACH=\"${MACHINE}\" \
-               -DMACH_${MACHINE} -DARCH_${MACHINE_ARCH}
+               -DMACH_${MACHINE} -DARCH_${MACHINE_ARCH} \
+               ${NODISKLABEL:D-DNO_DISKLABEL}
+
+.if (defined(DEBUG))
+CPPFLAGS+=-DDEBUG -g -O0
+.endif
 
 .if (!defined(SMALLPROG) || defined(SMALLPROG_INET6)) && (${USE_INET6} != "no")
 CPPFLAGS+=-DINET6
@@ -67,6 +72,7 @@
 COPTS.msg_defs.c += -Wno-format-nonliteral
 COPTS.bsddisklabel.c += -Wno-format-nonliteral
 COPTS.md.c += -Wno-format-nonliteral
+COPTS.partman.c += -Wno-format-nonliteral
 
 # Host to ftp from.  Default:
 #      "ftp.NetBSD.org"
diff -r a8f9ea08cdcd -r e5706c95108a usr.sbin/sysinst/arch/acorn32/md.c
--- a/usr.sbin/sysinst/arch/acorn32/md.c        Sun Aug 03 13:14:59 2014 +0000
+++ b/usr.sbin/sysinst/arch/acorn32/md.c        Sun Aug 03 16:09:38 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.1 2014/07/26 19:30:44 dholland Exp $ */
+/*     $NetBSD: md.c,v 1.2 2014/08/03 16:09:38 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -73,12 +73,12 @@
        struct filecore_bootblock *fcbb = (struct filecore_bootblock *)bb;
        int offset = 0;
 
-       if (strncmp(diskdev, "wd", 2) == 0)
-               disktype = "ST506";
+       if (strncmp(pm->diskdev, "wd", 2) == 0)
+               pm->disktype = "ST506";
        else
-               disktype = "SCSI";
+               pm->disktype = "SCSI";
 
-       snprintf(dev_name, 100, "/dev/r%s%c", diskdev, 'a' + getrawpartition());
+       snprintf(dev_name, 100, "/dev/r%s%c", pm->diskdev, 'a' + getrawpartition());
 
        fd = open(dev_name, O_RDONLY, 0);
        if (fd < 0) {
@@ -173,31 +173,31 @@
        }
        close(fd);
 
-       dlcyl = disklabel.d_ncylinders;
-       dlhead = disklabel.d_ntracks;
-       dlsec = disklabel.d_nsectors;
-       sectorsize = disklabel.d_secsize;
-       dlcylsize = disklabel.d_secpercyl;
+       pm->dlcyl = disklabel.d_ncylinders;
+       pm->dlhead = disklabel.d_ntracks;
+       pm->dlsec = disklabel.d_nsectors;
+       pm->sectorsize = disklabel.d_secsize;
+       pm->dlcylsize = disklabel.d_secpercyl;
 
        /*
-        * Compute whole disk size. Take max of (dlcyl*dlhead*dlsec)
+        * Compute whole disk size. Take max of (pm->dlcyl*pm->dlhead*pm->dlsec)
         * and secperunit,  just in case the disk is already labelled.
         * (If our new label's RAW_PART size ends up smaller than the
         * in-core RAW_PART size  value, updating the label will fail.)
         */
-       dlsize = dlcyl*dlhead*dlsec;
-       if (disklabel.d_secperunit > dlsize)
-               dlsize = disklabel.d_secperunit;
+       pm->dlsize = pm->dlcyl*pm->dlhead*pm->dlsec;
+       if (disklabel.d_secperunit > pm->dlsize)
+               pm->dlsize = disklabel.d_secperunit;
 
-       ptstart = offset;
+       pm->ptstart = offset;
 /*     endwin();
-       printf("dlcyl=%d\n", dlcyl);
-       printf("dlhead=%d\n", dlhead);
-       printf("dlsec=%d\n", dlsec);
-       printf("secsz=%d\n", sectorsize);
-       printf("cylsz=%d\n", dlcylsize);
-       printf("dlsz=%d\n", dlsize);
-       printf("pstart=%d\n", ptstart);
+       printf("pm->dlcyl=%d\n", pm->dlcyl);
+       printf("pm->dlhead=%d\n", pm->dlhead);
+       printf("pm->dlsec=%d\n", pm->dlsec);
+       printf("secsz=%d\n", pm->sectorsize);
+       printf("cylsz=%d\n", pm->dlcylsize);
+       printf("dlsz=%d\n", pm->dlsize);
+       printf("pstart=%d\n", pm->ptstart);
        printf("pstart=%d\n", partsize);
        printf("secpun=%d\n", disklabel.d_secperunit);
        backtowin();*/
diff -r a8f9ea08cdcd -r e5706c95108a usr.sbin/sysinst/arch/alpha/md.c
--- a/usr.sbin/sysinst/arch/alpha/md.c  Sun Aug 03 13:14:59 2014 +0000
+++ b/usr.sbin/sysinst/arch/alpha/md.c  Sun Aug 03 16:09:38 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.1 2014/07/26 19:30:44 dholland Exp $ */
+/*     $NetBSD: md.c,v 1.2 2014/08/03 16:09:38 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -67,7 +67,7 @@
        int fd;
        char dev_name[100];
 
-       snprintf (dev_name, 100, "/dev/r%s%c", diskdev, 'a' + getrawpartition());
+       snprintf (dev_name, 100, "/dev/r%s%c", pm->diskdev, 'a' + getrawpartition());
 
        fd = open (dev_name, O_RDONLY, 0);
        if (fd < 0) {
@@ -83,10 +83,10 @@
        }
        close(fd);
 
-       dlcyl = disklabel.d_ncylinders;
-       dlhead = disklabel.d_ntracks;
-       sectorsize = disklabel.d_secsize;
-       dlsize = disklabel.d_secperunit;
+       pm->dlcyl = disklabel.d_ncylinders;
+       pm->dlhead = disklabel.d_ntracks;
+       pm->sectorsize = disklabel.d_secsize;
+       pm->dlsize = disklabel.d_secperunit;
 
        /*
         * Tru64 UNIX's disklabel is the same format as BSD disklabel,
@@ -96,8 +96,8 @@
         * dlsec (sectors/track) and dlcylsize (sectors/cylinder) values.
         * See PR/48697 for details.
         */
-       dlsec = dlsize / (dlhead * dlcyl);
-       dlcylsize = dlsec * dlhead;
+       pm->dlsec = pm->dlsize / (pm->dlhead * pm->dlcyl);
+       pm->dlcylsize = pm->dlsec * pm->dlhead;
 
        return 1;
 }
@@ -151,12 +151,12 @@
        char *bootxx;
        int error;
 
-       msg_display(MSG_dobootblks, diskdev);
+       msg_display(MSG_dobootblks, pm->diskdev);
        cp_to_target("/usr/mdec/boot", "/boot");
        bootxx = bootxx_name();
        if (bootxx != NULL) {
                error = run_program(RUN_DISPLAY | RUN_NO_CLEAR,
-                   "/usr/sbin/installboot /dev/r%sc %s", diskdev, bootxx);
+                   "/usr/sbin/installboot /dev/r%sc %s", pm->diskdev, bootxx);
                free(bootxx);
        } else
                error = -1;
diff -r a8f9ea08cdcd -r e5706c95108a usr.sbin/sysinst/arch/amiga/md.c
--- a/usr.sbin/sysinst/arch/amiga/md.c  Sun Aug 03 13:14:59 2014 +0000
+++ b/usr.sbin/sysinst/arch/amiga/md.c  Sun Aug 03 16:09:38 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.1 2014/07/26 19:30:44 dholland Exp $ */
+/*     $NetBSD: md.c,v 1.2 2014/08/03 16:09:38 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -107,9 +107,9 @@
 md_post_newfs(void)
 {
        /* boot blocks ... */
-       msg_display(MSG_dobootblks, diskdev);
+       msg_display(MSG_dobootblks, pm->diskdev);
        return run_program(RUN_DISPLAY,
-           "/usr/mdec/installboot -v /usr/mdec/xxboot /dev/r%sa", diskdev);
+           "/usr/mdec/installboot -v /usr/mdec/xxboot /dev/r%sa", pm->diskdev);
 }
 
 int
diff -r a8f9ea08cdcd -r e5706c95108a usr.sbin/sysinst/arch/arc/md.c
--- a/usr.sbin/sysinst/arch/arc/md.c    Sun Aug 03 13:14:59 2014 +0000
+++ b/usr.sbin/sysinst/arch/arc/md.c    Sun Aug 03 16:09:38 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.1 2014/07/26 19:30:44 dholland Exp $ */
+/*     $NetBSD: md.c,v 1.2 2014/08/03 16:09:39 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -88,62 +88,62 @@
         * Initialize global variables that track space used on this disk.
         * Standard 4.4BSD 8-partition labels always cover whole disk.
         */
-       if (ptsize == 0)
-               ptsize = dlsize - ptstart;
-       if (dlsize == 0)
-               dlsize = ptstart + ptsize;
+       if (pm->ptsize == 0)
+               pm->ptsize = pm->dlsize - pm->ptstart;
+       if (pm->dlsize == 0)
+               pm->dlsize = pm->ptstart + pm->ptsize;
 
-       partstart = ptstart;
-       ptend = ptstart + ptsize;
+       partstart = pm->ptstart;
+       ptend = pm->ptstart + pm->ptsize;
 
        /* Ask for layout type -- standard or special */
        msg_display(MSG_layout,
-                   ptsize / (MEG / sectorsize),
+                   pm->ptsize / (MEG / pm->sectorsize),
                    DEFROOTSIZE + DEFSWAPSIZE + DEFUSRSIZE,
                    DEFROOTSIZE + DEFSWAPSIZE + DEFUSRSIZE + XNEEDMB);
 
        process_menu(MENU_layout, NULL);
 
        /* Set so we use the 'real' geometry for rounding, input in MB */
-       current_cylsize = dlcylsize;
+       pm->current_cylsize = pm->dlcylsize;
        set_sizemultname_meg();
 
        /* Build standard partitions */
-       memset(&bsdlabel, 0, sizeof bsdlabel);
+       memset(&pm->bsdlabel, 0, sizeof pm->bsdlabel);
 
        /* Set initial partition types to unused */
        for (part = 0 ; part < maxpart ; ++part)
-               bsdlabel[part].pi_fstype = FS_UNUSED;
+               pm->bsdlabel[part].pi_fstype = FS_UNUSED;
 
        /* Whole disk partition */
        part_raw = getrawpartition();
        if (part_raw == -1)
                part_raw = PART_C;      /* for sanity... */
-       bsdlabel[part_raw].pi_offset = 0;
-       bsdlabel[part_raw].pi_size = dlsize;
+       pm->bsdlabel[part_raw].pi_offset = 0;
+       pm->bsdlabel[part_raw].pi_size = pm->dlsize;
 
        if (part_raw == PART_D) {
                /* Probably a system that expects an i386 style mbr */
                part_bsd = PART_C;
-               bsdlabel[PART_C].pi_offset = ptstart;
-               bsdlabel[PART_C].pi_size = ptsize;
+               pm->bsdlabel[PART_C].pi_offset = pm->ptstart;
+               pm->bsdlabel[PART_C].pi_size = pm->ptsize;
        } else {
                part_bsd = part_raw;
        }
 
-       if (bootsize != 0) {
-               bsdlabel[PART_BOOT_FAT12].pi_fstype = FS_MSDOS;
-               bsdlabel[PART_BOOT_FAT12].pi_size = bootsize;
-               bsdlabel[PART_BOOT_FAT12].pi_offset = bootstart;
-               bsdlabel[PART_BOOT_FAT12].pi_flags |= PART_BOOT_FAT12_PI_FLAGS;
-               strlcpy(bsdlabel[PART_BOOT_FAT12].pi_mount,
+       if (pm->bootsize != 0) {
+               pm->bsdlabel[PART_BOOT_FAT12].pi_fstype = FS_MSDOS;
+               pm->bsdlabel[PART_BOOT_FAT12].pi_size = pm->bootsize;
+               pm->bsdlabel[PART_BOOT_FAT12].pi_offset = pm->bootstart;
+               pm->bsdlabel[PART_BOOT_FAT12].pi_flags |= PART_BOOT_FAT12_PI_FLAGS;
+               strlcpy(pm->bsdlabel[PART_BOOT_FAT12].pi_mount,
                    PART_BOOT_FAT12_PI_MOUNT,
-                   sizeof bsdlabel[PART_BOOT_FAT12].pi_mount);
+                   sizeof pm->bsdlabel[PART_BOOT_FAT12].pi_mount);
        }
 
 #ifdef PART_REST
-       bsdlabel[PART_REST].pi_offset = 0;
-       bsdlabel[PART_REST].pi_size = ptstart;
+       pm->bsdlabel[PART_REST].pi_offset = 0;
+       pm->bsdlabel[PART_REST].pi_size = pm->ptstart;
 #endif
 
        /*
@@ -153,27 +153,27 @@
         * partitions on a multiboot i386 system.
         */
         for (i = maxpart; i--;) {
-               if (bsdlabel[i].pi_size != 0)
+               if (pm->bsdlabel[i].pi_size != 0)
                        /* Don't overwrite special partitions */
                        continue;
-               p = &oldlabel[i];
+               p = &pm->oldlabel[i];



Home | Main Index | Thread Index | Old Index