Module Name: src
Committed By: msaitoh
Date: Tue Dec 17 09:44:52 UTC 2019
Modified Files:
src/usr.sbin/sysinst [netbsd-9]: bsddisklabel.c defs.h disklabel.c
disks.c gpt.c label.c main.c mbr.c msg.mi.de msg.mi.en msg.mi.es
msg.mi.fr msg.mi.pl partitions.c partitions.h partman.c wskbd.c
src/usr.sbin/sysinst/arch/alpha [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/amiga [netbsd-9]: md.h
src/usr.sbin/sysinst/arch/arc [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/cobalt [netbsd-9]: md.c md.h
src/usr.sbin/sysinst/arch/emips [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/evbarm [netbsd-9]: md.c menus.md.en
menus.md.es menus.md.fr menus.md.pl
src/usr.sbin/sysinst/arch/ews4800mips [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/hp300 [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/i386 [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/mipsco [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/mvme68k [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/pmax [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/prep [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/x68k [netbsd-9]: md.c md.h
Log Message:
Pull up following revision(s) (requested by martin in ticket #560):
usr.sbin/sysinst/partitions.h: revision 1.11
usr.sbin/sysinst/defs.h: revision 1.49
usr.sbin/sysinst/mbr.c: revision 1.23
usr.sbin/sysinst/msg.mi.en: revision 1.26
usr.sbin/sysinst/disks.c: revision 1.58
usr.sbin/sysinst/arch/evbarm/menus.md.pl: revision 1.2
usr.sbin/sysinst/msg.mi.es: revision 1.20
usr.sbin/sysinst/arch/mvme68k/md.c: revision 1.9
usr.sbin/sysinst/gpt.c: revision 1.13
usr.sbin/sysinst/arch/evbarm/md.c: revision 1.10
usr.sbin/sysinst/arch/arc/md.c: revision 1.10
usr.sbin/sysinst/disklabel.c: revision 1.18
usr.sbin/sysinst/bsddisklabel.c: revision 1.33
usr.sbin/sysinst/disklabel.c: revision 1.19
usr.sbin/sysinst/main.c: revision 1.19
usr.sbin/sysinst/partman.c: revision 1.45
usr.sbin/sysinst/arch/alpha/md.c: revision 1.7
usr.sbin/sysinst/msg.mi.de: revision 1.19
usr.sbin/sysinst/arch/evbarm/menus.md.en: revision 1.2
usr.sbin/sysinst/arch/x68k/md.h: revision 1.4
usr.sbin/sysinst/arch/x68k/md.c: revision 1.9
usr.sbin/sysinst/arch/evbarm/menus.md.es: revision 1.2
usr.sbin/sysinst/wskbd.c: revision 1.4
usr.sbin/sysinst/label.c: revision 1.15
usr.sbin/sysinst/arch/amiga/md.h: revision 1.5
usr.sbin/sysinst/label.c: revision 1.16
usr.sbin/sysinst/arch/hp300/md.c: revision 1.9
usr.sbin/sysinst/arch/emips/md.c: revision 1.8
usr.sbin/sysinst/label.c: revision 1.17
usr.sbin/sysinst/arch/pmax/md.c: revision 1.7
usr.sbin/sysinst/partitions.c: revision 1.6
usr.sbin/sysinst/arch/prep/md.c: revision 1.10
usr.sbin/sysinst/arch/mipsco/md.c: revision 1.7
usr.sbin/sysinst/partitions.c: revision 1.7
usr.sbin/sysinst/partitions.c: revision 1.8
usr.sbin/sysinst/arch/ews4800mips/md.c: revision 1.5
usr.sbin/sysinst/disklabel.c: revision 1.20
usr.sbin/sysinst/arch/evbarm/menus.md.fr: revision 1.2
usr.sbin/sysinst/msg.mi.fr: revision 1.24
usr.sbin/sysinst/disklabel.c: revision 1.21
usr.sbin/sysinst/partitions.h: revision 1.9
usr.sbin/sysinst/msg.mi.pl: revision 1.27
usr.sbin/sysinst/disklabel.c: revision 1.22
usr.sbin/sysinst/disklabel.c: revision 1.23
usr.sbin/sysinst/arch/i386/md.c: revision 1.27
usr.sbin/sysinst/disklabel.c: revision 1.24
usr.sbin/sysinst/disklabel.c: revision 1.25
usr.sbin/sysinst/arch/cobalt/md.h: revision 1.5
usr.sbin/sysinst/disklabel.c: revision 1.26
usr.sbin/sysinst/disklabel.c: revision 1.27
usr.sbin/sysinst/partitions.h: revision 1.10
usr.sbin/sysinst/arch/cobalt/md.c: revision 1.10
PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.
Get rid of the evbarm preliminary menu: do not bother to ask the user
whether this is a RPi - query the FDT instead.
PR 54065: add optional "old compat" variant of ext2fs in file system
type selection and use that as default for the cobalt boot file system.
For now rely on the kernel mapping native RDB partitions.
Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.
Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)
Fix inverted comparison
Do not try to change the keyboard layout if we are not running on the
console.
When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.
Remove bogus assert.
When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.
Adapt MD parts to changes in get_fs_part_type (pass partition type).
If a fictious label has no RAW_PART assume there is no valid disk label.
Pass proper track size when initializing the default alignment - this is
important with sunlabels.
Fix overlapping partitions display
Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.
Do not show disklabel command invocation by default (only if there are
errors).
After installing boot blocks with RUN_NO_CLEAR (and handling the
potential errors) make sure to clear the stdscreen.
To generate a diff of this commit:
cvs rdiff -u -r1.23.2.7 -r1.23.2.8 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.42.2.4 -r1.42.2.5 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.10.2.6 -r1.10.2.7 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.44.2.11 -r1.44.2.12 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.6.2.6 -r1.6.2.7 src/usr.sbin/sysinst/gpt.c
cvs rdiff -u -r1.10.2.3 -r1.10.2.4 src/usr.sbin/sysinst/label.c
cvs rdiff -u -r1.17.2.1 -r1.17.2.2 src/usr.sbin/sysinst/main.c
cvs rdiff -u -r1.19.2.3 -r1.19.2.4 src/usr.sbin/sysinst/mbr.c
cvs rdiff -u -r1.13.2.4 -r1.13.2.5 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.19.2.5 -r1.19.2.6 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.14.2.4 -r1.14.2.5 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.17.2.5 -r1.17.2.6 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.20.2.5 -r1.20.2.6 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/usr.sbin/sysinst/partitions.c
cvs rdiff -u -r1.4.2.4 -r1.4.2.5 src/usr.sbin/sysinst/partitions.h
cvs rdiff -u -r1.41.2.2 -r1.41.2.3 src/usr.sbin/sysinst/partman.c
cvs rdiff -u -r1.3 -r1.3.2.1 src/usr.sbin/sysinst/wskbd.c
cvs rdiff -u -r1.6 -r1.6.2.1 src/usr.sbin/sysinst/arch/alpha/md.c
cvs rdiff -u -r1.3.2.1 -r1.3.2.2 src/usr.sbin/sysinst/arch/amiga/md.h
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/usr.sbin/sysinst/arch/arc/md.c
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/usr.sbin/sysinst/arch/cobalt/md.c
cvs rdiff -u -r1.3.2.1 -r1.3.2.2 src/usr.sbin/sysinst/arch/cobalt/md.h
cvs rdiff -u -r1.7 -r1.7.2.1 src/usr.sbin/sysinst/arch/emips/md.c
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/usr.sbin/sysinst/arch/evbarm/md.c
cvs rdiff -u -r1.1 -r1.1.30.1 src/usr.sbin/sysinst/arch/evbarm/menus.md.en \
src/usr.sbin/sysinst/arch/evbarm/menus.md.es \
src/usr.sbin/sysinst/arch/evbarm/menus.md.fr \
src/usr.sbin/sysinst/arch/evbarm/menus.md.pl
cvs rdiff -u -r1.4 -r1.4.2.1 src/usr.sbin/sysinst/arch/ews4800mips/md.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/usr.sbin/sysinst/arch/hp300/md.c
cvs rdiff -u -r1.20.2.3 -r1.20.2.4 src/usr.sbin/sysinst/arch/i386/md.c
cvs rdiff -u -r1.6 -r1.6.2.1 src/usr.sbin/sysinst/arch/mipsco/md.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/usr.sbin/sysinst/arch/mvme68k/md.c
cvs rdiff -u -r1.6 -r1.6.2.1 src/usr.sbin/sysinst/arch/pmax/md.c
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/usr.sbin/sysinst/arch/prep/md.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/usr.sbin/sysinst/arch/x68k/md.c
cvs rdiff -u -r1.2.2.1 -r1.2.2.2 src/usr.sbin/sysinst/arch/x68k/md.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/sysinst/bsddisklabel.c
diff -u src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.7 src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.8
--- src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.7 Mon Dec 9 19:33:25 2019
+++ src/usr.sbin/sysinst/bsddisklabel.c Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: bsddisklabel.c,v 1.23.2.7 2019/12/09 19:33:25 bouyer Exp $ */
+/* $NetBSD: bsddisklabel.c,v 1.23.2.8 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1320,7 +1320,7 @@ apply_settings_to_partitions(struct pm_d
infos[i].size = min(want->size, space.size);
infos[i].nat_type =
ps->pscheme->get_fs_part_type(
- want->fs_type, want->fs_version);
+ want->type, want->fs_type, want->fs_version);
infos[i].last_mounted = want->mount;
infos[i].fs_type = want->fs_type;
infos[i].fs_sub_type = want->fs_version;
@@ -1400,7 +1400,7 @@ apply_settings_to_partitions(struct pm_d
infos[i].size = min(want->size, space.size);
infos[i].nat_type =
wanted->parts->pscheme->get_fs_part_type(
- want->fs_type, want->fs_version);
+ want->type, want->fs_type, want->fs_version);
infos[i].last_mounted = want->mount;
infos[i].fs_type = want->fs_type;
infos[i].fs_sub_type = want->fs_version;
@@ -1444,7 +1444,7 @@ apply_settings_to_partitions(struct pm_d
infos[i].start = want->cur_start;
infos[i].size = want->size;
infos[i].nat_type = wanted->parts->pscheme->get_fs_part_type(
- want->fs_type, want->fs_version);
+ want->type, want->fs_type, want->fs_version);
infos[i].last_mounted = want->mount;
infos[i].fs_type = want->fs_type;
infos[i].fs_sub_type = want->fs_version;
Index: src/usr.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.42.2.4 src/usr.sbin/sysinst/defs.h:1.42.2.5
--- src/usr.sbin/sysinst/defs.h:1.42.2.4 Sun Nov 17 13:45:26 2019
+++ src/usr.sbin/sysinst/defs.h Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: defs.h,v 1.42.2.4 2019/11/17 13:45:26 msaitoh Exp $ */
+/* $NetBSD: defs.h,v 1.42.2.5 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -583,7 +583,6 @@ void remove_gpt_options(void);
/* Machine dependent functions .... */
void md_init(void);
-void md_prelim_menu(void);
void md_init_set_status(int); /* SFLAG_foo */
/* MD functions if user selects install - in order called */
Index: src/usr.sbin/sysinst/disklabel.c
diff -u src/usr.sbin/sysinst/disklabel.c:1.10.2.6 src/usr.sbin/sysinst/disklabel.c:1.10.2.7
--- src/usr.sbin/sysinst/disklabel.c:1.10.2.6 Mon Dec 9 19:31:18 2019
+++ src/usr.sbin/sysinst/disklabel.c Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: disklabel.c,v 1.10.2.6 2019/12/09 19:31:18 bouyer Exp $ */
+/* $NetBSD: disklabel.c,v 1.10.2.7 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 2018 The NetBSD Foundation, Inc.
@@ -170,10 +170,16 @@ disklabel_parts_read(const char *disk, d
int fd;
char diskpath[MAXPATHLEN];
uint flags;
+#ifndef DISKLABEL_NO_ONDISK_VERIFY
+ bool have_raw_label = false;
+ /*
+ * Verify we really have a disklabel.
+ */
if (run_program(RUN_SILENT | RUN_ERROR_OK,
- "disklabel -r %s", disk) != 0)
- return NULL;
+ "disklabel -r %s", disk) == 0)
+ have_raw_label = true;
+#endif
/* read partitions */
@@ -219,7 +225,7 @@ disklabel_parts_read(const char *disk, d
parts->dp.disk = strdup(disk);
parts->dp.disk_start = start;
parts->dp.disk_size = parts->dp.free_space = len;
- disklabel_init_default_alignment(parts, 0);
+ disklabel_init_default_alignment(parts, parts->l.d_secpercyl);
for (int part = 0; part < parts->l.d_npartitions; part++) {
if (parts->l.d_partitions[part].p_fstype == FS_UNUSED
@@ -259,6 +265,42 @@ disklabel_parts_read(const char *disk, d
}
close(fd);
+#ifndef DISKLABEL_NO_ONDISK_VERIFY
+ if (!have_raw_label) {
+ bool found_real_part = false;
+
+ if (parts->l.d_npartitions <= RAW_PART ||
+ parts->l.d_partitions[RAW_PART].p_size == 0)
+ goto no_valid_label;
+
+ /*
+ * Check if kernel translation gave us "something" besides
+ * the raw or the whole-disk partition.
+ * If not: report missing disklabel.
+ */
+ for (int part = 0; part < parts->l.d_npartitions; part++) {
+ if (parts->l.d_partitions[part].p_fstype == FS_UNUSED)
+ continue;
+ if (part == 0 &&
+ parts->l.d_partitions[part].p_offset ==
+ parts->l.d_partitions[RAW_PART].p_offset &&
+ parts->l.d_partitions[part].p_size ==
+ parts->l.d_partitions[RAW_PART].p_size)
+ continue;
+ if (part == RAW_PART)
+ continue;
+ found_real_part = true;
+ break;
+ }
+ if (!found_real_part) {
+ /* no partion there yet */
+no_valid_label:
+ free(parts);
+ return NULL;
+ }
+ }
+#endif
+
return &parts->dp;
}
@@ -373,7 +415,7 @@ disklabel_write_to_disk(struct disk_part
*/
#ifdef DISKLABEL_CMD
/* disklabel the disk */
- rv = run_program(RUN_DISPLAY, "%s -f %s %s '%s' '%s'",
+ rv = run_program(0, "%s -f %s %s '%s' '%s'",
DISKLABEL_CMD, fname, disk, disktype, packname);
#endif
@@ -598,7 +640,7 @@ disklabel_create_custom_part_type(const
}
static const struct part_type_desc *
-disklabel_get_fs_part_type(unsigned fstype, unsigned subtype)
+disklabel_get_fs_part_type(enum part_type pt, unsigned fstype, unsigned subtype)
{
return disklabel_find_type(fstype, false);
}
Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.44.2.11 src/usr.sbin/sysinst/disks.c:1.44.2.12
--- src/usr.sbin/sysinst/disks.c:1.44.2.11 Sun Nov 17 13:45:26 2019
+++ src/usr.sbin/sysinst/disks.c Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: disks.c,v 1.44.2.11 2019/11/17 13:45:26 msaitoh Exp $ */
+/* $NetBSD: disks.c,v 1.44.2.12 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -113,6 +113,8 @@ getfslabelname(uint f, uint f_version)
else if (f == FS_BSDFFS && f_version > 0)
return f_version == 2 ?
msg_string(MSG_fs_type_ffsv2) : msg_string(MSG_fs_type_ffs);
+ else if (f == FS_EX2FS && f_version == 1)
+ return msg_string(MSG_fs_type_ext2old);
else if (f >= __arraycount(fstypenames) || fstypenames[f] == NULL)
return "invalid";
return fstypenames[f];
@@ -1177,7 +1179,10 @@ make_filesystems(struct install_partitio
fsname = "v7fs";
break;
case FS_EX2FS:
- asprintf(&newfs, "/sbin/newfs_ext2fs");
+ asprintf(&newfs,
+ ptn->fs_version == 1 ?
+ "/sbin/newfs_ext2fs -O 0" :
+ "/sbin/newfs_ext2fs");
mnt_opts = "-text2fs";
fsname = "ext2fs";
break;
Index: src/usr.sbin/sysinst/gpt.c
diff -u src/usr.sbin/sysinst/gpt.c:1.6.2.6 src/usr.sbin/sysinst/gpt.c:1.6.2.7
--- src/usr.sbin/sysinst/gpt.c:1.6.2.6 Sun Nov 17 13:45:26 2019
+++ src/usr.sbin/sysinst/gpt.c Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: gpt.c,v 1.6.2.6 2019/11/17 13:45:26 msaitoh Exp $ */
+/* $NetBSD: gpt.c,v 1.6.2.7 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 2018 The NetBSD Foundation, Inc.
@@ -874,10 +874,17 @@ gpt_find_type(const char *desc)
}
static const struct part_type_desc *
-gpt_get_fs_part_type(unsigned fstype, unsigned fs_sub_type)
+gpt_get_fs_part_type(enum part_type pt, unsigned fstype, unsigned fs_sub_type)
{
size_t i;
+ /* Try with complet match (including part_type) first */
+ for (i = 0; i < __arraycount(gpt_fs_types); i++)
+ if (fstype == gpt_fs_types[i].fstype &&
+ pt == gpt_fs_types[i].ptype)
+ return gpt_find_type(gpt_fs_types[i].name);
+
+ /* If that did not work, ignore part_type */
for (i = 0; i < __arraycount(gpt_fs_types); i++)
if (fstype == gpt_fs_types[i].fstype)
return gpt_find_type(gpt_fs_types[i].name);
Index: src/usr.sbin/sysinst/label.c
diff -u src/usr.sbin/sysinst/label.c:1.10.2.3 src/usr.sbin/sysinst/label.c:1.10.2.4
--- src/usr.sbin/sysinst/label.c:1.10.2.3 Sun Nov 17 13:45:26 2019
+++ src/usr.sbin/sysinst/label.c Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: label.c,v 1.10.2.3 2019/11/17 13:45:26 msaitoh Exp $ */
+/* $NetBSD: label.c,v 1.10.2.4 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.10.2.3 2019/11/17 13:45:26 msaitoh Exp $");
+__RCSID("$NetBSD: label.c,v 1.10.2.4 2019/12/17 09:44:50 msaitoh Exp $");
#endif
#include <sys/types.h>
@@ -60,8 +60,7 @@ __RCSID("$NetBSD: label.c,v 1.10.2.3 201
* local prototypes
*/
static bool boringpart(const struct disk_part_info *info);
-static bool checklabel(struct disk_partitions*, char[MENUSTRSIZE],
- char[MENUSTRSIZE]);
+static bool checklabel(struct disk_partitions*, char *, char *);
static void show_partition_adder(menudesc *, struct partition_usage_set*);
/*
@@ -107,7 +106,7 @@ real_partition(const struct partition_us
*/
static bool
checklabel(struct disk_partitions *parts,
- char ovl1[MENUSTRSIZE], char ovl2[MENUSTRSIZE])
+ char *ovl1, char *ovl2)
{
part_id i, j;
struct disk_part_info info;
@@ -124,7 +123,7 @@ checklabel(struct disk_partitions *parts
/*
* check succeeding partitions for overlap.
- * O(n^2), but n is small (currently <= 16).
+ * O(n^2), but n is small.
*/
istart = info.start;
iend = istart + info.size;
@@ -146,12 +145,12 @@ checklabel(struct disk_partitions *parts
/* overlap? */
if ((istart <= jstart && jstart < iend) ||
(jstart <= istart && istart < jend)) {
- snprintf(ovl1, sizeof(*ovl1),
+ snprintf(ovl1, MENUSTRSIZE,
"%" PRIu64 " - %" PRIu64 " %s, %s",
istart / sizemult, iend / sizemult,
multname,
getfslabelname(fs_type, fs_sub_type));
- snprintf(ovl2, sizeof(*ovl2),
+ snprintf(ovl2, MENUSTRSIZE,
"%" PRIu64 " - %" PRIu64 " %s, %s",
jstart / sizemult, jend / sizemult,
multname,
@@ -461,6 +460,9 @@ init_fs_type_ext(menudesc *menu, void *a
else
menu->cursel = 1;
return;
+ } else if (t == FS_EX2FS && edit->info.fs_sub_type == 1) {
+ menu->cursel = FSMAXTYPES;
+ return;
}
/* skip the two FFS entries, and do not add FFS later again */
for (ndx = 2, i = 0; i < FSMAXTYPES && ndx < max; i++) {
@@ -484,17 +486,16 @@ set_fstype_ext(menudesc *menu, void *arg
{
struct single_part_fs_edit *edit = arg;
size_t i, ndx, max = menu->numopts;
+ enum part_type pt;
if (menu->cursel == 0 || menu->cursel == 1) {
edit->info.fs_type = FS_BSDFFS;
edit->info.fs_sub_type = menu->cursel == 0 ? 2 : 1;
- edit->info.nat_type = edit->pset->parts->pscheme->
- get_fs_part_type(edit->info.fs_type,
- edit->info.fs_sub_type);
- edit->wanted->type = edit->info.nat_type->generic_ptype;
- edit->wanted->fs_type = edit->info.fs_type;
- edit->wanted->fs_version = edit->info.fs_sub_type;
- return 1;
+ goto found_type;
+ } else if (menu->cursel == FSMAXTYPES) {
+ edit->info.fs_type = FS_EX2FS;
+ edit->info.fs_sub_type = 1;
+ goto found_type;
}
for (ndx = 2, i = 0; i < FSMAXTYPES && ndx < max; i++) {
@@ -508,19 +509,23 @@ set_fstype_ext(menudesc *menu, void *arg
if (ndx == (size_t)menu->cursel) {
edit->info.fs_type = i;
edit->info.fs_sub_type = 0;
- edit->info.nat_type = edit->pset->parts->pscheme->
- get_fs_part_type(i, 0);
- if (edit->info.nat_type == NULL)
- edit->info.nat_type = edit->pset->parts->
- pscheme->get_generic_part_type(PT_root);
- edit->wanted->type = edit->info.nat_type->generic_ptype;
- edit->wanted->fs_type = edit->info.fs_type;
- edit->wanted->fs_version = edit->info.fs_sub_type;
- break;
+ goto found_type;
}
ndx++;
}
return 1;
+
+found_type:
+ pt = edit->info.nat_type ? edit->info.nat_type->generic_ptype : PT_root;
+ edit->info.nat_type = edit->pset->parts->pscheme->
+ get_fs_part_type(pt, edit->info.fs_type, edit->info.fs_sub_type);
+ if (edit->info.nat_type == NULL)
+ edit->info.nat_type = edit->pset->parts->pscheme->
+ get_generic_part_type(PT_root);
+ edit->wanted->type = edit->info.nat_type->generic_ptype;
+ edit->wanted->fs_type = edit->info.fs_type;
+ edit->wanted->fs_version = edit->info.fs_sub_type;
+ return 1;
}
/*
@@ -534,7 +539,7 @@ edit_fs_type_ext(menudesc *menu, void *a
int m;
size_t i, ndx, cnt;
- cnt = __arraycount(fstypenames)-1;
+ cnt = __arraycount(fstypenames);
opts = calloc(cnt, sizeof(*opts));
if (opts == NULL)
return 1;
@@ -557,6 +562,9 @@ edit_fs_type_ext(menudesc *menu, void *a
opts[ndx].opt_action = set_fstype_ext;
ndx++;
}
+ opts[ndx].opt_name = msg_string(MSG_fs_type_ext2old);
+ opts[ndx].opt_action = set_fstype_ext;
+ ndx++;
assert(ndx == cnt);
m = new_menu(MSG_Select_the_type, opts, ndx,
30, 6, 10, 0, MC_SUBMENU | MC_SCROLL,
@@ -596,13 +604,15 @@ static int
set_fstype(menudesc *menu, void *arg)
{
struct single_part_fs_edit *edit = arg;
+ enum part_type pt;
int ndx;
+ pt = edit->info.nat_type ? edit->info.nat_type->generic_ptype : PT_root;
if (menu->cursel < 2) {
edit->info.fs_type = FS_BSDFFS;
edit->info.fs_sub_type = menu->cursel == 0 ? 2 : 1;
edit->info.nat_type = edit->pset->parts->pscheme->
- get_fs_part_type(FS_BSDFFS, 2);
+ get_fs_part_type(pt, FS_BSDFFS, 2);
if (edit->info.nat_type == NULL)
edit->info.nat_type = edit->pset->parts->
pscheme->get_generic_part_type(PT_root);
@@ -620,7 +630,7 @@ set_fstype(menudesc *menu, void *arg)
edit->info.fs_type = edit_fs_common_types[ndx];
edit->info.fs_sub_type = 0;
edit->info.nat_type = edit->pset->parts->pscheme->
- get_fs_part_type(edit->info.fs_type, 0);
+ get_fs_part_type(pt, edit->info.fs_type, 0);
if (edit->info.nat_type == NULL)
edit->info.nat_type = edit->pset->parts->
pscheme->get_generic_part_type(PT_root);
@@ -644,6 +654,10 @@ edit_fs_type(menudesc *menu, void *arg)
/*
* Shortcut to full menu if we have an exotic value
*/
+ if (edit->info.fs_type == FS_EX2FS && edit->info.fs_sub_type == 1) {
+ edit_fs_type_ext(menu, arg);
+ return 0;
+ }
for (i = 0; i < __arraycount(edit_fs_common_types); i++)
if (edit->info.fs_type == edit_fs_common_types[i])
break;
@@ -789,7 +803,7 @@ edit_ptn(menudesc *menu, void *arg)
edit.info.fs_type = FS_BSDFFS;
edit.info.fs_sub_type = 2;
edit.info.nat_type = pset->parts->pscheme->
- get_fs_part_type(edit.info.fs_type,
+ get_fs_part_type(PT_root, edit.info.fs_type,
edit.info.fs_sub_type);
edit.wanted->instflags = PUIINST_NEWFS;
}
Index: src/usr.sbin/sysinst/main.c
diff -u src/usr.sbin/sysinst/main.c:1.17.2.1 src/usr.sbin/sysinst/main.c:1.17.2.2
--- src/usr.sbin/sysinst/main.c:1.17.2.1 Sun Nov 17 13:45:26 2019
+++ src/usr.sbin/sysinst/main.c Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.17.2.1 2019/11/17 13:45:26 msaitoh Exp $ */
+/* $NetBSD: main.c,v 1.17.2.2 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -164,9 +164,6 @@ init_lang(void)
multname = msg_string(MSG_secname);
}
-__weakref_visible void prelim_menu(void)
- __weak_reference(md_prelim_menu);
-
int
main(int argc, char **argv)
{
@@ -264,12 +261,6 @@ main(int argc, char **argv)
get_kb_encoding();
init_lang();
-#ifdef __weak_reference
- /* if md wants to ask anything before we start, do it now */
- if (prelim_menu != 0)
- prelim_menu();
-#endif
-
/* Menu processing */
if (partman_go)
partman();
Index: src/usr.sbin/sysinst/mbr.c
diff -u src/usr.sbin/sysinst/mbr.c:1.19.2.3 src/usr.sbin/sysinst/mbr.c:1.19.2.4
--- src/usr.sbin/sysinst/mbr.c:1.19.2.3 Sun Nov 17 13:45:26 2019
+++ src/usr.sbin/sysinst/mbr.c Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: mbr.c,v 1.19.2.3 2019/11/17 13:45:26 msaitoh Exp $ */
+/* $NetBSD: mbr.c,v 1.19.2.4 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1046,7 +1046,7 @@ mbr_get_part_type_count(void)
}
static const struct part_type_desc *
-mbr_get_fs_part_type(unsigned fs_type, unsigned sub_type)
+mbr_get_fs_part_type(enum part_type pt, unsigned fs_type, unsigned sub_type)
{
if (known_part_types == 0)
map_mbr_part_types();
Index: src/usr.sbin/sysinst/msg.mi.de
diff -u src/usr.sbin/sysinst/msg.mi.de:1.13.2.4 src/usr.sbin/sysinst/msg.mi.de:1.13.2.5
--- src/usr.sbin/sysinst/msg.mi.de:1.13.2.4 Sun Nov 17 13:45:26 2019
+++ src/usr.sbin/sysinst/msg.mi.de Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: msg.mi.de,v 1.13.2.4 2019/11/17 13:45:26 msaitoh Exp $ */
+/* $NetBSD: msg.mi.de,v 1.13.2.5 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1346,6 +1346,7 @@ message free_space_line {Speicherplatz b
message fs_type_ffsv2 {FFSv2}
message fs_type_ffs {FFS}
+message fs_type_ext2old {Linux Ext2 (old)}
message other_fs_type {Anderer Typ}
message editpack {Namen der Festplatte festlegen}
Index: src/usr.sbin/sysinst/msg.mi.en
diff -u src/usr.sbin/sysinst/msg.mi.en:1.19.2.5 src/usr.sbin/sysinst/msg.mi.en:1.19.2.6
--- src/usr.sbin/sysinst/msg.mi.en:1.19.2.5 Sun Nov 17 13:45:26 2019
+++ src/usr.sbin/sysinst/msg.mi.en Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: msg.mi.en,v 1.19.2.5 2019/11/17 13:45:26 msaitoh Exp $ */
+/* $NetBSD: msg.mi.en,v 1.19.2.6 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1276,6 +1276,7 @@ message free_space_line {Space at $0..$1
message fs_type_ffsv2 {FFSv2}
message fs_type_ffs {FFS}
+message fs_type_ext2old {Linux Ext2 (old)}
message other_fs_type {Other type}
message editpack {Edit name of the disk}
Index: src/usr.sbin/sysinst/msg.mi.es
diff -u src/usr.sbin/sysinst/msg.mi.es:1.14.2.4 src/usr.sbin/sysinst/msg.mi.es:1.14.2.5
--- src/usr.sbin/sysinst/msg.mi.es:1.14.2.4 Sun Nov 17 13:45:26 2019
+++ src/usr.sbin/sysinst/msg.mi.es Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: msg.mi.es,v 1.14.2.4 2019/11/17 13:45:26 msaitoh Exp $ */
+/* $NetBSD: msg.mi.es,v 1.14.2.5 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1326,6 +1326,7 @@ message free_space_line {Espacio en $0..
message fs_type_ffsv2 {FFSv2}
message fs_type_ffs {FFS}
+message fs_type_ext2old {Linux Ext2 (old)}
message other_fs_type {Other type}
message editpack {Edit name of the disk}
Index: src/usr.sbin/sysinst/msg.mi.fr
diff -u src/usr.sbin/sysinst/msg.mi.fr:1.17.2.5 src/usr.sbin/sysinst/msg.mi.fr:1.17.2.6
--- src/usr.sbin/sysinst/msg.mi.fr:1.17.2.5 Sun Nov 17 13:45:26 2019
+++ src/usr.sbin/sysinst/msg.mi.fr Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: msg.mi.fr,v 1.17.2.5 2019/11/17 13:45:26 msaitoh Exp $ */
+/* $NetBSD: msg.mi.fr,v 1.17.2.6 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1378,6 +1378,7 @@ message free_space_line {Espace � $0..$1
message fs_type_ffsv2 {FFSv2}
message fs_type_ffs {FFS}
+message fs_type_ext2old {Linux Ext2 (old)}
message other_fs_type {Other type}
message editpack {Changer le nom du disque}
Index: src/usr.sbin/sysinst/msg.mi.pl
diff -u src/usr.sbin/sysinst/msg.mi.pl:1.20.2.5 src/usr.sbin/sysinst/msg.mi.pl:1.20.2.6
--- src/usr.sbin/sysinst/msg.mi.pl:1.20.2.5 Sun Nov 17 13:45:26 2019
+++ src/usr.sbin/sysinst/msg.mi.pl Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: msg.mi.pl,v 1.20.2.5 2019/11/17 13:45:26 msaitoh Exp $ */
+/* $NetBSD: msg.mi.pl,v 1.20.2.6 2019/12/17 09:44:50 msaitoh Exp $ */
/* Based on english version: */
/* NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp */
@@ -1275,6 +1275,7 @@ message free_space_line {Miejsce od $0..
message fs_type_ffsv2 {FFSv2}
message fs_type_ffs {FFS}
+message fs_type_ext2old {Linux Ext2 (old)}
message other_fs_type {Inny typ}
message editpack {Edytuj nazwe dysku}
Index: src/usr.sbin/sysinst/partitions.c
diff -u src/usr.sbin/sysinst/partitions.c:1.1.2.3 src/usr.sbin/sysinst/partitions.c:1.1.2.4
--- src/usr.sbin/sysinst/partitions.c:1.1.2.3 Sun Nov 17 13:45:26 2019
+++ src/usr.sbin/sysinst/partitions.c Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: partitions.c,v 1.1.2.3 2019/11/17 13:45:26 msaitoh Exp $ */
+/* $NetBSD: partitions.c,v 1.1.2.4 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 2018 The NetBSD Foundation, Inc.
@@ -79,7 +79,9 @@ generic_adapt_foreign_part_info(const st
return false;
/* slightly simplistic, enhance when needed */
- dest->nat_type = myself->pscheme->get_fs_part_type(dest->fs_type,
+ dest->nat_type = myself->pscheme->get_fs_part_type(
+ dest->nat_type ? dest->nat_type->generic_ptype : PT_root,
+ dest->fs_type,
dest->fs_sub_type);
if (dest->nat_type == NULL)
dest->nat_type = myself->pscheme->get_generic_part_type(
Index: src/usr.sbin/sysinst/partitions.h
diff -u src/usr.sbin/sysinst/partitions.h:1.4.2.4 src/usr.sbin/sysinst/partitions.h:1.4.2.5
--- src/usr.sbin/sysinst/partitions.h:1.4.2.4 Sun Nov 17 13:45:26 2019
+++ src/usr.sbin/sysinst/partitions.h Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: partitions.h,v 1.4.2.4 2019/11/17 13:45:26 msaitoh Exp $ */
+/* $NetBSD: partitions.h,v 1.4.2.5 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 2018 The NetBSD Foundation, Inc.
@@ -222,7 +222,8 @@ struct disk_partitioning_scheme {
* Get the prefered native partition type for a specific file system
* type (FS_*) and subtype (fs specific value)
*/
- const struct part_type_desc * (*get_fs_part_type)(unsigned, unsigned);
+ const struct part_type_desc * (*get_fs_part_type)(
+ enum part_type, unsigned, unsigned);
/*
* Create a custom partition type. If the type already exists
* (or there is a collision), the old existing type will be
@@ -579,3 +580,4 @@ bool generic_adapt_foreign_part_info(
*/
void partitions_init(void);
void partitions_cleanup(void);
+
Index: src/usr.sbin/sysinst/partman.c
diff -u src/usr.sbin/sysinst/partman.c:1.41.2.2 src/usr.sbin/sysinst/partman.c:1.41.2.3
--- src/usr.sbin/sysinst/partman.c:1.41.2.2 Sun Nov 17 13:45:26 2019
+++ src/usr.sbin/sysinst/partman.c Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: partman.c,v 1.41.2.2 2019/11/17 13:45:26 msaitoh Exp $ */
+/* $NetBSD: partman.c,v 1.41.2.3 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 2012 Eugene Lozovoy
@@ -2138,7 +2138,8 @@ pm_setfstype(struct pm_devs *pm_cur, par
if (!pm_cur->parts->pscheme->get_part_info(pm_cur->parts, id, &info))
return;
- info.nat_type = pm_cur->parts->pscheme->get_fs_part_type(fstype, fs_subtype);
+ info.nat_type = pm_cur->parts->pscheme->get_fs_part_type(PT_root,
+ fstype, fs_subtype);
if (info.nat_type == NULL)
return;
info.fs_type = fstype;
Index: src/usr.sbin/sysinst/wskbd.c
diff -u src/usr.sbin/sysinst/wskbd.c:1.3 src/usr.sbin/sysinst/wskbd.c:1.3.2.1
--- src/usr.sbin/sysinst/wskbd.c:1.3 Sat Jun 22 20:46:07 2019
+++ src/usr.sbin/sysinst/wskbd.c Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: wskbd.c,v 1.3 2019/06/22 20:46:07 christos Exp $ */
+/* $NetBSD: wskbd.c,v 1.3.2.1 2019/12/17 09:44:50 msaitoh Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: wskbd.c,v 1.3 2019/06/22 20:46:07 christos Exp $");
+__RCSID("$NetBSD: wskbd.c,v 1.3.2.1 2019/12/17 09:44:50 msaitoh Exp $");
#include <unistd.h>
#include <stdlib.h>
@@ -93,6 +93,13 @@ get_kb_encoding(void)
menu_ent opt[__arraycount(kb_types)];
const char *dflt = msg_string(MSG_kb_default);
+ /*
+ * Check if we are running on a wscons keyboard at all,
+ * do not bother to try changing the layout if not.
+ */
+ if (ioctl(0, WSKBDIO_GTYPE, &i) == -1)
+ return;
+
memset(opt, 0, sizeof(opt));
fd = open("/dev/wskbd0", O_WRONLY);
if (fd < 0)
Index: src/usr.sbin/sysinst/arch/alpha/md.c
diff -u src/usr.sbin/sysinst/arch/alpha/md.c:1.6 src/usr.sbin/sysinst/arch/alpha/md.c:1.6.2.1
--- src/usr.sbin/sysinst/arch/alpha/md.c:1.6 Sat Jul 13 17:13:36 2019
+++ src/usr.sbin/sysinst/arch/alpha/md.c Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.6 2019/07/13 17:13:36 martin Exp $ */
+/* $NetBSD: md.c,v 1.6.2.1 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -166,6 +166,11 @@ md_post_newfs(struct install_partition_d
process_menu(MENU_ok,
__UNCONST("Warning: disk is probably not bootable"));
+ wclear(stdscr);
+ touchwin(stdscr);
+ clearok(stdscr, 1);
+ refresh();
+
return 0;
}
Index: src/usr.sbin/sysinst/arch/amiga/md.h
diff -u src/usr.sbin/sysinst/arch/amiga/md.h:1.3.2.1 src/usr.sbin/sysinst/arch/amiga/md.h:1.3.2.2
--- src/usr.sbin/sysinst/arch/amiga/md.h:1.3.2.1 Sun Nov 17 07:04:36 2019
+++ src/usr.sbin/sysinst/arch/amiga/md.h Tue Dec 17 09:44:51 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: md.h,v 1.3.2.1 2019/11/17 07:04:36 martin Exp $ */
+/* $NetBSD: md.h,v 1.3.2.2 2019/12/17 09:44:51 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -71,6 +71,13 @@
/*
+ * We rely on kernel support to translate native RDB partitions
+ * to in-core disklabels, so we can not check for existance of "real"
+ * disklabels on-disk before offering disklabel partitions.
+ */
+#define DISKLABEL_NO_ONDISK_VERIFY 1
+
+/*
* prototypes for MD code.
*/
Index: src/usr.sbin/sysinst/arch/arc/md.c
diff -u src/usr.sbin/sysinst/arch/arc/md.c:1.8.2.1 src/usr.sbin/sysinst/arch/arc/md.c:1.8.2.2
--- src/usr.sbin/sysinst/arch/arc/md.c:1.8.2.1 Sun Aug 18 13:19:51 2019
+++ src/usr.sbin/sysinst/arch/arc/md.c Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.8.2.1 2019/08/18 13:19:51 msaitoh Exp $ */
+/* $NetBSD: md.c,v 1.8.2.2 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -271,7 +271,7 @@ md_parts_use_wholedisk(struct disk_parti
};
boot_part.nat_type = parts->pscheme->get_fs_part_type(
- boot_part.fs_type, boot_part.fs_sub_type);
+ PT_root, boot_part.fs_type, boot_part.fs_sub_type);
return parts_use_wholedisk(parts, 1, &boot_part);
}
Index: src/usr.sbin/sysinst/arch/cobalt/md.c
diff -u src/usr.sbin/sysinst/arch/cobalt/md.c:1.8.2.1 src/usr.sbin/sysinst/arch/cobalt/md.c:1.8.2.2
--- src/usr.sbin/sysinst/arch/cobalt/md.c:1.8.2.1 Sun Aug 18 13:19:53 2019
+++ src/usr.sbin/sysinst/arch/cobalt/md.c Tue Dec 17 09:44:51 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.8.2.1 2019/08/18 13:19:53 msaitoh Exp $ */
+/* $NetBSD: md.c,v 1.8.2.2 2019/12/17 09:44:51 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -286,7 +286,7 @@ md_parts_use_wholedisk(struct disk_parti
};
boot_part.nat_type = parts->pscheme->get_fs_part_type(
- boot_part.fs_type, boot_part.fs_sub_type);
+ PT_root, boot_part.fs_type, boot_part.fs_sub_type);
return parts_use_wholedisk(parts, 1, &boot_part);
}
Index: src/usr.sbin/sysinst/arch/cobalt/md.h
diff -u src/usr.sbin/sysinst/arch/cobalt/md.h:1.3.2.1 src/usr.sbin/sysinst/arch/cobalt/md.h:1.3.2.2
--- src/usr.sbin/sysinst/arch/cobalt/md.h:1.3.2.1 Sun Nov 17 07:04:38 2019
+++ src/usr.sbin/sysinst/arch/cobalt/md.h Tue Dec 17 09:44:51 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: md.h,v 1.3.2.1 2019/11/17 07:04:38 martin Exp $ */
+/* $NetBSD: md.h,v 1.3.2.2 2019/12/17 09:44:51 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -48,6 +48,7 @@
#define PART_BOOT (5 * 1024 * 1024) /* 5MB boot partition */
#define PART_BOOT_MIN (1 * 1024 * 1024) /* 1MB minimum */
#define PART_BOOT_TYPE FS_EX2FS
+#define PART_BOOT_SUBT 1 /* use "old" ext2 */
#define PART_BOOT_MOUNT "/stand"
/* default partition size */
Index: src/usr.sbin/sysinst/arch/emips/md.c
diff -u src/usr.sbin/sysinst/arch/emips/md.c:1.7 src/usr.sbin/sysinst/arch/emips/md.c:1.7.2.1
--- src/usr.sbin/sysinst/arch/emips/md.c:1.7 Sat Jul 13 17:13:37 2019
+++ src/usr.sbin/sysinst/arch/emips/md.c Tue Dec 17 09:44:51 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.7 2019/07/13 17:13:37 martin Exp $ */
+/* $NetBSD: md.c,v 1.7.2.1 2019/12/17 09:44:51 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -175,6 +175,11 @@ md_post_extract(struct install_partition
"/bin/dd if=%s of=/dev/reflash0c bs=512", ldr_path))
process_menu(MENU_ok, __UNCONST("Warning: the system "
"is probably not bootable"));
+
+ wclear(stdscr);
+ touchwin(stdscr);
+ clearok(stdscr, 1);
+ refresh();
}
return 0;
Index: src/usr.sbin/sysinst/arch/evbarm/md.c
diff -u src/usr.sbin/sysinst/arch/evbarm/md.c:1.8.2.1 src/usr.sbin/sysinst/arch/evbarm/md.c:1.8.2.2
--- src/usr.sbin/sysinst/arch/evbarm/md.c:1.8.2.1 Sun Aug 18 13:19:52 2019
+++ src/usr.sbin/sysinst/arch/evbarm/md.c Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.8.2.1 2019/08/18 13:19:52 msaitoh Exp $ */
+/* $NetBSD: md.c,v 1.8.2.2 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -48,18 +48,20 @@
#include "msg_defs.h"
#include "menu_defs.h"
-int boardtype = 0;
-
-void
-md_prelim_menu(void)
-{
- /* get the boardtype from the user */
- process_menu(MENU_prelim, NULL);
-}
+int boardtype = BOARD_TYPE_NORMAL;
void
md_init(void)
{
+ int rv;
+
+ rv =run_program(RUN_SILENT|RUN_ERROR_OK, "sh -c 'ofctl -p / model | "
+ "fgrep \"Raspberry Pi\"'");
+ if (rv != 0)
+ return;
+
+ /* this is some kind of Raspberry Pi */
+ boardtype = BOARD_TYPE_RPI;
}
void
Index: src/usr.sbin/sysinst/arch/evbarm/menus.md.en
diff -u src/usr.sbin/sysinst/arch/evbarm/menus.md.en:1.1 src/usr.sbin/sysinst/arch/evbarm/menus.md.en:1.1.30.1
--- src/usr.sbin/sysinst/arch/evbarm/menus.md.en:1.1 Sat Jul 26 19:30:45 2014
+++ src/usr.sbin/sysinst/arch/evbarm/menus.md.en Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: menus.md.en,v 1.1 2014/07/26 19:30:45 dholland Exp $ */
+/* $NetBSD: menus.md.en,v 1.1.30.1 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -35,7 +35,3 @@
/* evbarm machine dependent menus, english */
-menu prelim, title "What kind of system do you have?", y=-10;
- option "Raspberry PI", exit, action { boardtype = 1; };
- option "Other", exit, action { boardtype = 0; };
-
Index: src/usr.sbin/sysinst/arch/evbarm/menus.md.es
diff -u src/usr.sbin/sysinst/arch/evbarm/menus.md.es:1.1 src/usr.sbin/sysinst/arch/evbarm/menus.md.es:1.1.30.1
--- src/usr.sbin/sysinst/arch/evbarm/menus.md.es:1.1 Sat Jul 26 19:30:45 2014
+++ src/usr.sbin/sysinst/arch/evbarm/menus.md.es Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: menus.md.es,v 1.1 2014/07/26 19:30:45 dholland Exp $ */
+/* $NetBSD: menus.md.es,v 1.1.30.1 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -35,7 +35,3 @@
/* evbarm machine dependent menus, spanish */
-menu prelim, title "What kind of system do you have?", y=-10;
- option "Raspberry PI", exit, action { boardtype = 1; };
- option "Other", exit, action { boardtype = 0; };
-
Index: src/usr.sbin/sysinst/arch/evbarm/menus.md.fr
diff -u src/usr.sbin/sysinst/arch/evbarm/menus.md.fr:1.1 src/usr.sbin/sysinst/arch/evbarm/menus.md.fr:1.1.30.1
--- src/usr.sbin/sysinst/arch/evbarm/menus.md.fr:1.1 Sat Jul 26 19:30:45 2014
+++ src/usr.sbin/sysinst/arch/evbarm/menus.md.fr Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: menus.md.fr,v 1.1 2014/07/26 19:30:45 dholland Exp $ */
+/* $NetBSD: menus.md.fr,v 1.1.30.1 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -35,7 +35,3 @@
/* evbarm machine dependent menus, french */
-menu prelim, title "What kind of system do you have?", y=-10;
- option "Raspberry PI", exit, action { boardtype = 1; };
- option "Other", exit, action { boardtype = 0; };
-
Index: src/usr.sbin/sysinst/arch/evbarm/menus.md.pl
diff -u src/usr.sbin/sysinst/arch/evbarm/menus.md.pl:1.1 src/usr.sbin/sysinst/arch/evbarm/menus.md.pl:1.1.30.1
--- src/usr.sbin/sysinst/arch/evbarm/menus.md.pl:1.1 Sat Jul 26 19:30:45 2014
+++ src/usr.sbin/sysinst/arch/evbarm/menus.md.pl Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: menus.md.pl,v 1.1 2014/07/26 19:30:45 dholland Exp $ */
+/* $NetBSD: menus.md.pl,v 1.1.30.1 2019/12/17 09:44:50 msaitoh Exp $ */
/* Based on english version: */
/* NetBSD: menus.md.en,v 1.2 2002/03/31 02:14:06 thorpej Exp */
@@ -37,7 +37,3 @@
/* evbarm machine dependent menus, Polish */
-menu prelim, title "What kind of system do you have?", y=-10;
- option "Raspberry PI", exit, action { boardtype = 1; };
- option "Other", exit, action { boardtype = 0; };
-
Index: src/usr.sbin/sysinst/arch/ews4800mips/md.c
diff -u src/usr.sbin/sysinst/arch/ews4800mips/md.c:1.4 src/usr.sbin/sysinst/arch/ews4800mips/md.c:1.4.2.1
--- src/usr.sbin/sysinst/arch/ews4800mips/md.c:1.4 Sat Jul 13 17:13:37 2019
+++ src/usr.sbin/sysinst/arch/ews4800mips/md.c Tue Dec 17 09:44:51 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.4 2019/07/13 17:13:37 martin Exp $ */
+/* $NetBSD: md.c,v 1.4.2.1 2019/12/17 09:44:51 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -259,7 +259,7 @@ md_parts_use_wholedisk(struct disk_parti
};
boot_part.nat_type = parts->pscheme->get_fs_part_type(
- boot_part.fs_type, boot_part.fs_sub_type);
+ PT_root, boot_part.fs_type, boot_part.fs_sub_type);
return parts_use_wholedisk(parts, 1, &boot_part);
}
Index: src/usr.sbin/sysinst/arch/hp300/md.c
diff -u src/usr.sbin/sysinst/arch/hp300/md.c:1.8 src/usr.sbin/sysinst/arch/hp300/md.c:1.8.2.1
--- src/usr.sbin/sysinst/arch/hp300/md.c:1.8 Sat Jul 13 17:13:37 2019
+++ src/usr.sbin/sysinst/arch/hp300/md.c Tue Dec 17 09:44:51 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.8 2019/07/13 17:13:37 martin Exp $ */
+/* $NetBSD: md.c,v 1.8.2.1 2019/12/17 09:44:51 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -187,6 +187,12 @@ md_post_newfs(struct install_partition_d
"/usr/sbin/installboot /dev/r%sc /usr/mdec/uboot.lif", pm->diskdev))
process_menu(MENU_ok,
__UNCONST("Warning: disk is probably not bootable"));
+
+ wclear(stdscr);
+ touchwin(stdscr);
+ clearok(stdscr, 1);
+ refresh();
+
return 0;
}
Index: src/usr.sbin/sysinst/arch/i386/md.c
diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.20.2.3 src/usr.sbin/sysinst/arch/i386/md.c:1.20.2.4
--- src/usr.sbin/sysinst/arch/i386/md.c:1.20.2.3 Tue Nov 19 06:19:04 2019
+++ src/usr.sbin/sysinst/arch/i386/md.c Tue Dec 17 09:44:51 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.20.2.3 2019/11/19 06:19:04 msaitoh Exp $ */
+/* $NetBSD: md.c,v 1.20.2.4 2019/12/17 09:44:51 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -837,8 +837,6 @@ md_gpt_post_write(struct disk_partitions
{
struct disk_part_info info;
- assert(efi_id == NO_PART); /* XXX EFI support still missing */
-
if (root_id != NO_PART) {
/* we always update the gpt boot record for now */
if (!parts->pscheme->get_part_info(parts, root_id, &info))
Index: src/usr.sbin/sysinst/arch/mipsco/md.c
diff -u src/usr.sbin/sysinst/arch/mipsco/md.c:1.6 src/usr.sbin/sysinst/arch/mipsco/md.c:1.6.2.1
--- src/usr.sbin/sysinst/arch/mipsco/md.c:1.6 Sat Jul 13 17:13:39 2019
+++ src/usr.sbin/sysinst/arch/mipsco/md.c Tue Dec 17 09:44:51 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.6 2019/07/13 17:13:39 martin Exp $ */
+/* $NetBSD: md.c,v 1.6.2.1 2019/12/17 09:44:51 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -168,6 +168,12 @@ md_post_newfs(struct install_partition_d
"/usr/mdec/installboot /dev/r%sc /usr/mdec/bootxx_ffs", pm->diskdev))
process_menu(MENU_ok,
__UNCONST("Warning: disk is probably not bootable"));
+
+ wclear(stdscr);
+ touchwin(stdscr);
+ clearok(stdscr, 1);
+ refresh();
+
return 0;
}
Index: src/usr.sbin/sysinst/arch/mvme68k/md.c
diff -u src/usr.sbin/sysinst/arch/mvme68k/md.c:1.8 src/usr.sbin/sysinst/arch/mvme68k/md.c:1.8.2.1
--- src/usr.sbin/sysinst/arch/mvme68k/md.c:1.8 Sat Jul 13 17:13:39 2019
+++ src/usr.sbin/sysinst/arch/mvme68k/md.c Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.8 2019/07/13 17:13:39 martin Exp $ */
+/* $NetBSD: md.c,v 1.8.2.1 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -190,6 +190,12 @@ md_post_newfs(struct install_partition_d
target_expand("/.bootsd"), pm->diskdev))
process_menu(MENU_ok,
__UNCONST("Warning: disk is probably not bootable"));
+
+ wclear(stdscr);
+ touchwin(stdscr);
+ clearok(stdscr, 1);
+ refresh();
+
return 0;
}
Index: src/usr.sbin/sysinst/arch/pmax/md.c
diff -u src/usr.sbin/sysinst/arch/pmax/md.c:1.6 src/usr.sbin/sysinst/arch/pmax/md.c:1.6.2.1
--- src/usr.sbin/sysinst/arch/pmax/md.c:1.6 Sat Jul 13 17:13:39 2019
+++ src/usr.sbin/sysinst/arch/pmax/md.c Tue Dec 17 09:44:51 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.6 2019/07/13 17:13:39 martin Exp $ */
+/* $NetBSD: md.c,v 1.6.2.1 2019/12/17 09:44:51 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -177,6 +177,11 @@ md_post_newfs(struct install_partition_d
process_menu(MENU_ok,
__UNCONST("Warning: disk is probably not bootable"));
+ wclear(stdscr);
+ touchwin(stdscr);
+ clearok(stdscr, 1);
+ refresh();
+
return 0;
}
Index: src/usr.sbin/sysinst/arch/prep/md.c
diff -u src/usr.sbin/sysinst/arch/prep/md.c:1.8.2.1 src/usr.sbin/sysinst/arch/prep/md.c:1.8.2.2
--- src/usr.sbin/sysinst/arch/prep/md.c:1.8.2.1 Sun Aug 18 13:19:52 2019
+++ src/usr.sbin/sysinst/arch/prep/md.c Tue Dec 17 09:44:51 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.8.2.1 2019/08/18 13:19:52 msaitoh Exp $ */
+/* $NetBSD: md.c,v 1.8.2.2 2019/12/17 09:44:51 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -282,7 +282,7 @@ md_parts_use_wholedisk(struct disk_parti
};
boot_part.nat_type = parts->pscheme->get_fs_part_type(
- boot_part.fs_type, boot_part.fs_sub_type);
+ PT_root, boot_part.fs_type, boot_part.fs_sub_type);
return parts_use_wholedisk(parts, 1, &boot_part);
}
Index: src/usr.sbin/sysinst/arch/x68k/md.c
diff -u src/usr.sbin/sysinst/arch/x68k/md.c:1.8 src/usr.sbin/sysinst/arch/x68k/md.c:1.8.2.1
--- src/usr.sbin/sysinst/arch/x68k/md.c:1.8 Sat Jul 13 17:13:40 2019
+++ src/usr.sbin/sysinst/arch/x68k/md.c Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.8 2019/07/13 17:13:40 martin Exp $ */
+/* $NetBSD: md.c,v 1.8.2.1 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -276,6 +276,12 @@ md_post_newfs(struct install_partition_d
pm->diskdev))
process_menu(MENU_ok,
__UNCONST("Warning: disk is probably not bootable"));
+
+ wclear(stdscr);
+ touchwin(stdscr);
+ clearok(stdscr, 1);
+ refresh();
+
return 0;
}
Index: src/usr.sbin/sysinst/arch/x68k/md.h
diff -u src/usr.sbin/sysinst/arch/x68k/md.h:1.2.2.1 src/usr.sbin/sysinst/arch/x68k/md.h:1.2.2.2
--- src/usr.sbin/sysinst/arch/x68k/md.h:1.2.2.1 Sun Nov 17 07:04:35 2019
+++ src/usr.sbin/sysinst/arch/x68k/md.h Tue Dec 17 09:44:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: md.h,v 1.2.2.1 2019/11/17 07:04:35 martin Exp $ */
+/* $NetBSD: md.h,v 1.2.2.2 2019/12/17 09:44:50 msaitoh Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -89,3 +89,10 @@
* On x68k, do what the 1.2 install scripts did.
*/
#define DISKLABEL_CMD "disklabel -w"
+
+/*
+ * We rely on kernel support to translate Human68k partitions
+ * to in-core disklabels, so we can not check for existance of "real"
+ * disklabels on-disk before offering disklabel partitions.
+ */
+#define DISKLABEL_NO_ONDISK_VERIFY 1