Module Name: src
Committed By: bouyer
Date: Tue Jun 5 08:12:54 UTC 2018
Modified Files:
src/usr.sbin/sysinst [netbsd-8]: bsddisklabel.c defs.h disks.c mbr.c
menus.mi msg.mi.de msg.mi.en msg.mi.es msg.mi.fr msg.mi.pl
src/usr.sbin/sysinst/arch/i386 [netbsd-8]: md.c
Log Message:
Pull up following revision(s) (requested by martin in ticket #860):
usr.sbin/sysinst/msg.mi.de: revision 1.7
usr.sbin/sysinst/arch/i386/md.c: revision 1.10
usr.sbin/sysinst/msg.mi.fr: revision 1.10
usr.sbin/sysinst/arch/i386/md.c: revision 1.11
usr.sbin/sysinst/menus.mi: revision 1.13
usr.sbin/sysinst/arch/i386/md.c: revision 1.9
usr.sbin/sysinst/msg.mi.es: revision 1.7
usr.sbin/sysinst/msg.mi.en: revision 1.11
usr.sbin/sysinst/mbr.c: revision 1.6
usr.sbin/sysinst/disks.c: revision 1.15
usr.sbin/sysinst/bsddisklabel.c: revision 1.4
usr.sbin/sysinst/disks.c: revision 1.16
usr.sbin/sysinst/msg.mi.pl: revision 1.9
usr.sbin/sysinst/defs.h: revision 1.11
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).
In the generated /etc/fstab, do not use the (temporary, during sysinst)
path name for the file in the comment, but instead the one it will
have on the target system.
Reorder fetch options: http before ftp
Default console device and speed to that used by syinst
add missing brace.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.20.1 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.9 -r1.9.8.1 src/usr.sbin/sysinst/defs.h \
src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.13.6.1 -r1.13.6.2 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.5 -r1.5.8.1 src/usr.sbin/sysinst/mbr.c
cvs rdiff -u -r1.11 -r1.11.6.1 src/usr.sbin/sysinst/menus.mi
cvs rdiff -u -r1.6 -r1.6.8.1 src/usr.sbin/sysinst/msg.mi.de \
src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.10 -r1.10.8.1 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.8 -r1.8.8.1 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.6.8.1 -r1.6.8.2 src/usr.sbin/sysinst/arch/i386/md.c
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.2 src/usr.sbin/sysinst/bsddisklabel.c:1.2.20.1
--- src/usr.sbin/sysinst/bsddisklabel.c:1.2 Sun Aug 3 16:09:38 2014
+++ src/usr.sbin/sysinst/bsddisklabel.c Tue Jun 5 08:12:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: bsddisklabel.c,v 1.2 2014/08/03 16:09:38 martin Exp $ */
+/* $NetBSD: bsddisklabel.c,v 1.2.20.1 2018/06/05 08:12:54 bouyer Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -566,6 +566,9 @@ make_bsd_partitions(void)
int no_swap = 0, valid_part = -1;
partinfo *p, savedlabel[MAXPARTITIONS];
+ if (pm && pm->no_part)
+ return 1;
+
memcpy(&savedlabel, &pm->bsdlabel, sizeof savedlabel);
/*
Index: src/usr.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.9 src/usr.sbin/sysinst/defs.h:1.9.8.1
--- src/usr.sbin/sysinst/defs.h:1.9 Mon May 11 13:07:57 2015
+++ src/usr.sbin/sysinst/defs.h Tue Jun 5 08:12:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: defs.h,v 1.9 2015/05/11 13:07:57 martin Exp $ */
+/* $NetBSD: defs.h,v 1.9.8.1 2018/06/05 08:12:54 bouyer Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -300,6 +300,7 @@ typedef struct pm_devs_t {
partinfo bsdlabel[MAXPARTITIONS]; /* What we want it to look like */
int gpt;
int no_mbr; /* set for raid (etc) */
+ int no_part; /* can not be partitioned, e.g. dk0 */
int rootpart; /* partition we install into */
const char *disktype; /* ST506, SCSI, ... */
const char *doessf;
Index: src/usr.sbin/sysinst/msg.mi.fr
diff -u src/usr.sbin/sysinst/msg.mi.fr:1.9 src/usr.sbin/sysinst/msg.mi.fr:1.9.8.1
--- src/usr.sbin/sysinst/msg.mi.fr:1.9 Fri Jun 19 12:27:02 2015
+++ src/usr.sbin/sysinst/msg.mi.fr Tue Jun 5 08:12:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: msg.mi.fr,v 1.9 2015/06/19 12:27:02 youri Exp $ */
+/* $NetBSD: msg.mi.fr,v 1.9.8.1 2018/06/05 08:12:54 bouyer Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1300,3 +1300,13 @@ message addusertowheel {Ajouter cet util
message Delete_partition
{Supprimer la partition}
+
+message No_filesystem_newfs
+{The selected partition does not seem to have a valid file system.
+Do you want to newfs (format) it?}
+
+message Auto_add_swap_part
+{A swap partition (named %s) seems to exist on %s.
+Do you want to use that?}
+
+
Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.13.6.1 src/usr.sbin/sysinst/disks.c:1.13.6.2
--- src/usr.sbin/sysinst/disks.c:1.13.6.1 Mon May 7 04:03:20 2018
+++ src/usr.sbin/sysinst/disks.c Tue Jun 5 08:12:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: disks.c,v 1.13.6.1 2018/05/07 04:03:20 snj Exp $ */
+/* $NetBSD: disks.c,v 1.13.6.2 2018/06/05 08:12:54 bouyer Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -68,7 +68,7 @@
struct disk_desc {
char dd_name[SSTRSIZE];
char dd_descr[70];
- uint dd_no_mbr;
+ bool dd_no_mbr, dd_no_part;
uint dd_cyl;
uint dd_head;
uint dd_sec;
@@ -104,7 +104,7 @@ static int foundffs(struct data *, size_
#ifdef USE_SYSVBFS
static int foundsysvbfs(struct data *, size_t);
#endif
-static int fsck_preen(const char *, int, const char *);
+static int fsck_preen(const char *, int, const char *, bool silent);
static void fixsb(const char *, const char *, char);
static bool is_gpt(const char *);
static int incoregpt(pm_devs_t *, partinfo *);
@@ -113,7 +113,8 @@ static int incoregpt(pm_devs_t *, partin
#define DISK_NAMES "wd", "sd", "ld", "raid"
#endif
-static const char *disk_names[] = { DISK_NAMES, "vnd", "cgd", NULL };
+static const char *disk_names[] = { DISK_NAMES,
+ "vnd", "cgd", "dk:no_part", NULL };
static bool tmpfs_on_var_shm(void);
@@ -396,8 +397,118 @@ get_default_cdrom(void)
return cdrom_devices[0];
}
+static void
+get_wedge_descr(struct disk_desc *dd)
+{
+ struct dkwedge_info dkw;
+ char buf[MAXPATHLEN];
+ int fd;
+
+ fd = opendisk(dd->dd_name, O_RDONLY, buf, sizeof(buf), 0);
+ if (fd == -1)
+ return;
+
+ if (ioctl(fd, DIOCGWEDGEINFO, &dkw) == 0) {
+ fprintf(stderr, "device %s\n", dd->dd_name);
+ sprintf(dd->dd_descr, "%s (%s@%s)",
+ dkw.dkw_wname, dkw.dkw_devname, dkw.dkw_parent);
+ }
+ close(fd);
+}
+
+static bool
+get_name_and_parent(const char *dev, char *name, char *parent)
+{
+ struct dkwedge_info dkw;
+ char buf[MAXPATHLEN];
+ int fd;
+ bool res = false;
+
+ fd = opendisk(dev, O_RDONLY, buf, sizeof(buf), 0);
+ if (fd == -1)
+ return false;
+
+ if (ioctl(fd, DIOCGWEDGEINFO, &dkw) == 0) {
+ strcpy(name, (const char *)dkw.dkw_wname);
+ strcpy(parent, dkw.dkw_parent);
+ res = true;
+ }
+ close(fd);
+ return res;
+}
+
+static bool
+find_swap_part_on(const char *dev, char *swap_name)
+{
+ struct dkwedge_info *dkw;
+ struct dkwedge_list dkwl;
+ char buf[MAXPATHLEN];
+ size_t bufsize;
+ int fd;
+ u_int i;
+ bool res = false;
+
+ dkw = NULL;
+ dkwl.dkwl_buf = dkw;
+ dkwl.dkwl_bufsize = 0;
+
+ fd = opendisk(dev, O_RDONLY, buf, sizeof(buf), 0);
+ if (fd == -1)
+ return false;
+
+ for (;;) {
+ if (ioctl(fd, DIOCLWEDGES, &dkwl) == -1) {
+ dkwl.dkwl_ncopied = 0;
+ break;
+ }
+ if (dkwl.dkwl_nwedges == dkwl.dkwl_ncopied)
+ break;
+ bufsize = dkwl.dkwl_nwedges * sizeof(*dkw);
+ if (dkwl.dkwl_bufsize < bufsize) {
+ dkw = realloc(dkwl.dkwl_buf, bufsize);
+ if (dkw == NULL)
+ break;
+ dkwl.dkwl_buf = dkw;
+ dkwl.dkwl_bufsize = bufsize;
+ }
+ }
+
+ for (i = 0; i < dkwl.dkwl_nwedges; i++) {
+ res = strcmp(dkw[i].dkw_ptype, DKW_PTYPE_SWAP) == 0;
+ if (res) {
+ strcpy(swap_name, (const char*)dkw[i].dkw_wname);
+ break;
+ }
+ }
+
+ close(fd);
+
+ return res;
+}
+
+static bool
+is_ffs_wedge(const char *dev)
+{
+ struct dkwedge_info dkw;
+ char buf[MAXPATHLEN];
+ int fd;
+ bool res;
+
+ fd = opendisk(dev, O_RDONLY, buf, sizeof(buf), 0);
+ if (fd == -1)
+ return false;
+
+ if (ioctl(fd, DIOCGWEDGEINFO, &dkw) == -1)
+ return false;
+
+ res = strcmp(dkw.dkw_ptype, DKW_PTYPE_FFS) == 0;
+ close(fd);
+
+ return res;
+}
+
static int
-get_disks(struct disk_desc *dd)
+get_disks(struct disk_desc *dd, bool with_non_partitionable)
{
const char **xd;
char *cp;
@@ -412,18 +523,33 @@ get_disks(struct disk_desc *dd)
for (i = 0; i < MAX_DISKS; i++) {
strlcpy(dd->dd_name, *xd, sizeof dd->dd_name - 2);
cp = strchr(dd->dd_name, ':');
- if (cp != NULL)
+ if (cp != NULL) {
dd->dd_no_mbr = !strcmp(cp, ":no_mbr");
- else {
- dd->dd_no_mbr = 0;
+ dd->dd_no_part = !strcmp(cp, ":no_part");
+ } else {
+ dd->dd_no_mbr = false;
+ dd->dd_no_part = false;
cp = strchr(dd->dd_name, 0);
}
+ if (dd->dd_no_part && !with_non_partitionable)
+ continue;
snprintf(cp, 2 + 1, "%d", i);
if (!get_geom(dd->dd_name, &l)) {
if (errno == ENOENT)
break;
- continue;
+ if (errno != ENOTTY || !dd->dd_no_part)
+ /*
+ * Allow plain partitions,
+ * like already existing wedges
+ * (like dk0) if marked as
+ * non-partitioning device.
+ * For all other cases, continue
+ * with the next disk.
+ */
+ continue;
+ if (!is_ffs_wedge(dd->dd_name))
+ continue;
}
/*
@@ -433,12 +559,17 @@ get_disks(struct disk_desc *dd)
if (is_active_rootpart(dd->dd_name, 0))
continue;
- dd->dd_cyl = l.d_ncylinders;
- dd->dd_head = l.d_ntracks;
- dd->dd_sec = l.d_nsectors;
- dd->dd_secsize = l.d_secsize;
- dd->dd_totsec = l.d_secperunit;
- get_descr(dd);
+ if (!dd->dd_no_part) {
+ dd->dd_cyl = l.d_ncylinders;
+ dd->dd_head = l.d_ntracks;
+ dd->dd_sec = l.d_nsectors;
+ dd->dd_secsize = l.d_secsize;
+ dd->dd_totsec = l.d_secperunit;
+ }
+ if (dd->dd_no_part)
+ get_wedge_descr(dd);
+ else
+ get_descr(dd);
dd++;
numdisks++;
if (numdisks >= MAX_DISKS)
@@ -454,13 +585,13 @@ find_disks(const char *doingwhat)
struct disk_desc disks[MAX_DISKS];
menu_ent dsk_menu[nelem(disks) + 1]; // + 1 for extended partitioning entry
struct disk_desc *disk;
- int i, already_found;
- int numdisks, selected_disk = -1;
+ int i = 0, skipped = 0;
+ int already_found, numdisks, selected_disk = -1;
int menu_no;
pm_devs_t *pm_i, *pm_last = NULL;
/* Find disks. */
- numdisks = get_disks(disks);
+ numdisks = get_disks(disks, partman_go <= 0);
/* need a redraw here, kernel messages hose everything */
touchwin(stdscr);
@@ -484,7 +615,8 @@ find_disks(const char *doingwhat)
} else {
/* One or more disks found! */
for (i = 0; i < numdisks; i++) {
- dsk_menu[i].opt_name = disks[i].dd_descr;
+ dsk_menu[i].opt_name =
+ disks[i].dd_descr;
dsk_menu[i].opt_menu = OPT_NOMENU;
dsk_menu[i].opt_flags = OPT_EXIT;
dsk_menu[i].opt_action = set_menu_select;
@@ -496,7 +628,9 @@ find_disks(const char *doingwhat)
dsk_menu[i].opt_action = set_menu_select;
}
menu_no = new_menu(MSG_Available_disks,
- dsk_menu, numdisks + ((partman_go<0)?1:0), -1, 4, 0, 0, MC_SCROLL,
+ dsk_menu, numdisks
+ + ((partman_go<0)?1:0), -1,
+ 4, 0, 0, MC_SCROLL,
NULL, NULL, NULL, NULL, NULL);
if (menu_no == -1)
return -1;
@@ -545,20 +679,32 @@ find_disks(const char *doingwhat)
pm->gpt = is_gpt(pm->diskdev);
pm->no_mbr = disk->dd_no_mbr || pm->gpt;
- pm->sectorsize = disk->dd_secsize;
- pm->dlcyl = disk->dd_cyl;
- pm->dlhead = disk->dd_head;
- pm->dlsec = disk->dd_sec;
- pm->dlsize = disk->dd_totsec;
- if (pm->dlsize == 0)
- pm->dlsize = disk->dd_cyl * disk->dd_head * disk->dd_sec;
- if (pm->dlsize > UINT32_MAX && ! partman_go) {
- if (logfp)
- fprintf(logfp, "Cannot process disk %s: too big size (%d)\n",
- pm->diskdev, (int)pm->dlsize);
- msg_display(MSG_toobigdisklabel);
- process_menu(MENU_ok, NULL);
- return -1;
+ pm->no_part = disk->dd_no_part;
+ if (!pm->no_part) {
+ pm->sectorsize = disk->dd_secsize;
+ pm->dlcyl = disk->dd_cyl;
+ pm->dlhead = disk->dd_head;
+ pm->dlsec = disk->dd_sec;
+ pm->dlsize = disk->dd_totsec;
+ if (pm->dlsize == 0)
+ pm->dlsize = disk->dd_cyl * disk->dd_head * disk->dd_sec;
+ if (pm->dlsize > UINT32_MAX && ! partman_go) {
+ if (logfp)
+ fprintf(logfp, "Cannot process disk %s: too big size (%d)\n",
+ pm->diskdev, (int)pm->dlsize);
+ msg_display(MSG_toobigdisklabel);
+ process_menu(MENU_ok, NULL);
+ return -1;
+ }
+ } else {
+ pm->sectorsize = 0;
+ pm->dlcyl = 0;
+ pm->dlhead = 0;
+ pm->dlsec = 0;
+ pm->dlsize = 0;
+ pm->rootpart = -1;
+ pm->no_mbr = 1;
+ memset(&pm->bsdlabel, 0, sizeof(pm->bsdlabel));
}
pm->dlcylsize = pm->dlhead * pm->dlsec;
@@ -576,13 +722,17 @@ find_disks(const char *doingwhat)
break;
}
- return numdisks;
+ return numdisks-skipped;
}
void
label_read(void)
{
+
+ if (pm->no_part)
+ return;
+
check_available_binaries();
/* Get existing/default label */
@@ -659,6 +809,9 @@ write_disklabel (void)
{
int rv = 0;
+ if (pm && pm->no_part)
+ return 0;
+
#ifdef DISKLABEL_CMD
/* disklabel the disk */
rv = run_program(RUN_DISPLAY, "%s -f /tmp/disktab %s '%s'",
@@ -688,6 +841,32 @@ make_filesystems(void)
char *newfs = NULL, *dev = NULL, *devdev = NULL;
partinfo *lbl;
+ if (pm->no_part) {
+ /* check if this target device already has a ffs */
+ error = fsck_preen(pm->diskdev, -1, "ffs", true);
+ if (error) {
+ if (!ask_noyes(MSG_No_filesystem_newfs))
+ return EINVAL;
+ error = run_program(RUN_DISPLAY | RUN_PROGRESS,
+ "/sbin/newfs -V2 -O2 /dev/r%s", pm->diskdev);
+ }
+
+ md_pre_mount();
+
+ make_target_dir("/");
+ asprintf(&devdev, "/dev/%s", pm->diskdev);
+ if (devdev == NULL)
+ return (ENOMEM);
+ error = target_mount_do("-o async", devdev, "/");
+ if (error) {
+ msg_display(MSG_mountfail, devdev, ' ',
+ "/");
+ process_menu(MENU_ok, NULL);
+ }
+ free(devdev);
+ return error;
+ }
+
if (maxpart > nelem(pm->bsdlabel))
maxpart = nelem(pm->bsdlabel);
@@ -797,7 +976,7 @@ make_filesystems(void)
"%s /dev/r%s", newfs, dev);
} else {
/* We'd better check it isn't dirty */
- error = fsck_preen(pm->diskdev, ptn, lbl->fsname);
+ error = fsck_preen(pm->diskdev, ptn, lbl->fsname, false);
}
free(newfs);
if (error != 0) {
@@ -860,8 +1039,30 @@ make_fstab(void)
#endif
}
- scripting_fprintf(f, "# NetBSD %s/etc/fstab\n# See /usr/share/examples/"
- "fstab/ for more examples.\n", target_prefix());
+ scripting_fprintf(f, "# NetBSD /etc/fstab\n# See /usr/share/examples/"
+ "fstab/ for more examples.\n");
+
+ if (pm->no_part) {
+ /* single dk? target */
+ char buf[200], parent[200], swap[200], *prompt;
+ int res;
+
+ if (!get_name_and_parent(pm->diskdev, buf, parent))
+ goto done_with_disks;
+ scripting_fprintf(f, "NAME=%s\t/\tffs\trw\t\t1 1\n",
+ buf);
+ if (!find_swap_part_on(parent, swap))
+ goto done_with_disks;
+ asprintf(&prompt, msg_string(MSG_Auto_add_swap_part),
+ swap, parent);
+ res = ask_yesno(prompt);
+ free(prompt);
+ if (res)
+ scripting_fprintf(f, "NAME=%s\tnone"
+ "\tswap\tsw,dp\t\t0 0\n", swap);
+ goto done_with_disks;
+ }
+
if (! partman_go) {
/* We want to process only one disk... */
pm_i = pm;
@@ -959,6 +1160,7 @@ make_fstab(void)
if (!partman_go)
break;
}
+done_with_disks:
if (tmp_ramdisk_size != 0) {
#ifdef HAVE_TMPFS
scripting_fprintf(f, "tmpfs\t\t/tmp\ttmpfs\trw,-m=1777,-s=%"
@@ -1011,7 +1213,7 @@ foundffs(struct data *list, size_t num)
strstr(list[2].u.s_val, "noauto") != NULL)
return 0;
- error = fsck_preen(list[0].u.s_val, ' '-'a', "ffs");
+ error = fsck_preen(list[0].u.s_val, ' '-'a', "ffs", false);
if (error != 0)
return error;
@@ -1048,7 +1250,7 @@ foundsysvbfs(struct data *list, size_t n
* Returns 0 on success, or nonzero return code from fsck() on failure.
*/
static int
-fsck_preen(const char *disk, int ptn, const char *fsname)
+fsck_preen(const char *disk, int ptn, const char *fsname, bool silent)
{
char *prog;
int error;
@@ -1066,9 +1268,9 @@ fsck_preen(const char *disk, int ptn, co
}
if (!strcmp(fsname,"ffs"))
fixsb(prog, disk, ptn);
- error = run_program(0, "%s -p -q /dev/r%s%c", prog, disk, ptn);
+ error = run_program(silent? RUN_SILENT|RUN_ERROR_OK : 0, "%s -p -q /dev/r%s%c", prog, disk, ptn);
free(prog);
- if (error != 0) {
+ if (error != 0 && !silent) {
msg_display(MSG_badfs, disk, ptn, error);
if (ask_noyes(NULL))
error = 0;
@@ -1140,7 +1342,7 @@ mount_root(void)
int error;
int ptn = (pm->isspecial)? 0 - 'a' : pm->rootpart;
- error = fsck_preen(pm->diskdev, ptn, "ffs");
+ error = fsck_preen(pm->diskdev, ptn, "ffs", false);
if (error != 0)
return error;
Index: src/usr.sbin/sysinst/mbr.c
diff -u src/usr.sbin/sysinst/mbr.c:1.5 src/usr.sbin/sysinst/mbr.c:1.5.8.1
--- src/usr.sbin/sysinst/mbr.c:1.5 Sun May 10 10:14:02 2015
+++ src/usr.sbin/sysinst/mbr.c Tue Jun 5 08:12:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: mbr.c,v 1.5 2015/05/10 10:14:02 martin Exp $ */
+/* $NetBSD: mbr.c,v 1.5.8.1 2018/06/05 08:12:54 bouyer Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1267,8 +1267,11 @@ edit_mbr(mbr_info_t *mbri)
uint bsdstart, bsdsize;
uint start;
- /* Ask full/part */
+ /* If targeting a wedge, do not ask for further partitioning */
+ if (pm && pm->no_part)
+ return 1;
+ /* Ask full/part */
part = &mbrs->mbr_parts[0];
get_ptn_alignment(part); /* update ptn_alignment */
if (partman_go)
Index: src/usr.sbin/sysinst/menus.mi
diff -u src/usr.sbin/sysinst/menus.mi:1.11 src/usr.sbin/sysinst/menus.mi:1.11.6.1
--- src/usr.sbin/sysinst/menus.mi:1.11 Sun Dec 11 00:56:34 2016
+++ src/usr.sbin/sysinst/menus.mi Tue Jun 5 08:12:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: menus.mi,v 1.11 2016/12/11 00:56:34 alnsn Exp $ */
+/* $NetBSD: menus.mi,v 1.11.6.1 2018/06/05 08:12:54 bouyer Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -327,8 +327,8 @@ menu sizechoice, sub menu, y=0, title MS
menu distmedium, title MSG_Select_medium, y=-5;
option MSG_cdrom, exit, action { *(int *)arg = get_via_cdrom(); };
- option MSG_ftp, exit, action { *(int *)arg = get_via_ftp("ftp"); };
option MSG_http, exit, action { *(int *)arg = get_via_ftp("http"); };
+ option MSG_ftp, exit, action { *(int *)arg = get_via_ftp("ftp"); };
option MSG_nfs, exit, action { *(int *)arg = get_via_nfs(); };
option MSG_floppy, exit, action { *(int *)arg = get_via_floppy(); };
option MSG_local_fs, exit, action { *(int *)arg = get_via_localfs(); };
Index: src/usr.sbin/sysinst/msg.mi.de
diff -u src/usr.sbin/sysinst/msg.mi.de:1.6 src/usr.sbin/sysinst/msg.mi.de:1.6.8.1
--- src/usr.sbin/sysinst/msg.mi.de:1.6 Sun May 17 10:13:24 2015
+++ src/usr.sbin/sysinst/msg.mi.de Tue Jun 5 08:12:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: msg.mi.de,v 1.6 2015/05/17 10:13:24 martin Exp $ */
+/* $NetBSD: msg.mi.de,v 1.6.8.1 2018/06/05 08:12:54 bouyer Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1261,3 +1261,14 @@ message addusertowheel {Do you wish to a
message Delete_partition
{Partition l�schen}
+
+message No_filesystem_newfs
+{Die ausgew�hlte Zielpartition scheint kein g�ltiges Dateisystem zu enthalten.
+M�chten Sie ein neues erstellen (die Partition formatieren)?}
+
+message Auto_add_swap_part
+{Eine Auslagerungspartitons (mit Namen %s)
+scheint bereits auf der Festplatte %s zu existieren.
+M�chten Sie diese benutzen?}
+
+
Index: src/usr.sbin/sysinst/msg.mi.es
diff -u src/usr.sbin/sysinst/msg.mi.es:1.6 src/usr.sbin/sysinst/msg.mi.es:1.6.8.1
--- src/usr.sbin/sysinst/msg.mi.es:1.6 Sun May 17 10:13:24 2015
+++ src/usr.sbin/sysinst/msg.mi.es Tue Jun 5 08:12:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: msg.mi.es,v 1.6 2015/05/17 10:13:24 martin Exp $ */
+/* $NetBSD: msg.mi.es,v 1.6.8.1 2018/06/05 08:12:54 bouyer Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1242,3 +1242,13 @@ message addusertowheel {Do you wish to a
message Delete_partition
{Borrar partici�n}
+
+message No_filesystem_newfs
+{The selected partition does not seem to have a valid file system.
+Do you want to newfs (format) it?}
+
+message Auto_add_swap_part
+{A swap partition (named %s) seems to exist on %s.
+Do you want to use that?}
+
+
Index: src/usr.sbin/sysinst/msg.mi.en
diff -u src/usr.sbin/sysinst/msg.mi.en:1.10 src/usr.sbin/sysinst/msg.mi.en:1.10.8.1
--- src/usr.sbin/sysinst/msg.mi.en:1.10 Sun May 17 10:13:24 2015
+++ src/usr.sbin/sysinst/msg.mi.en Tue Jun 5 08:12:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: msg.mi.en,v 1.10 2015/05/17 10:13:24 martin Exp $ */
+/* $NetBSD: msg.mi.en,v 1.10.8.1 2018/06/05 08:12:54 bouyer Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1189,3 +1189,11 @@ message addusertowheel {Do you wish to a
message Delete_partition
{Delete partition}
+message No_filesystem_newfs
+{The selected partition does not seem to have a valid file system.
+Do you want to newfs (format) it?}
+
+message Auto_add_swap_part
+{A swap partition (named %s) seems to exist on %s.
+Do you want to use that?}
+
Index: src/usr.sbin/sysinst/msg.mi.pl
diff -u src/usr.sbin/sysinst/msg.mi.pl:1.8 src/usr.sbin/sysinst/msg.mi.pl:1.8.8.1
--- src/usr.sbin/sysinst/msg.mi.pl:1.8 Sun May 17 10:13:24 2015
+++ src/usr.sbin/sysinst/msg.mi.pl Tue Jun 5 08:12:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: msg.mi.pl,v 1.8 2015/05/17 10:13:24 martin Exp $ */
+/* $NetBSD: msg.mi.pl,v 1.8.8.1 2018/06/05 08:12:54 bouyer Exp $ */
/* Based on english version: */
/* NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp */
@@ -1198,3 +1198,13 @@ message addusertowheel {Do you wish to a
message Delete_partition
{Usun partycje}
+
+message No_filesystem_newfs
+{The selected partition does not seem to have a valid file system.
+Do you want to newfs (format) it?}
+
+message Auto_add_swap_part
+{A swap partition (named %s) seems to exist on %s.
+Do you want to use that?}
+
+
Index: src/usr.sbin/sysinst/arch/i386/md.c
diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.6.8.1 src/usr.sbin/sysinst/arch/i386/md.c:1.6.8.2
--- src/usr.sbin/sysinst/arch/i386/md.c:1.6.8.1 Thu Apr 12 13:54:11 2018
+++ src/usr.sbin/sysinst/arch/i386/md.c Tue Jun 5 08:12:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.6.8.1 2018/04/12 13:54:11 martin Exp $ */
+/* $NetBSD: md.c,v 1.6.8.2 2018/06/05 08:12:54 bouyer Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -322,7 +322,7 @@ md_post_newfs(void)
* Too hard to double check, so just 'know' the device numbers.
*/
len = sizeof condev;
- if (sysctl(conmib, nelem(conmib), &condev, &len, NULL, 0) != -1
+ if (sysctl(conmib, __arraycount(conmib), &condev, &len, NULL, 0) != -1
&& (condev & ~3) == 0x800) {
/* Motherboard serial port */
boottype.bp_consdev = (condev & 3) + 1;
@@ -331,18 +331,36 @@ md_post_newfs(void)
boottype.bp_conspeed = t.c_ispeed;
}
- process_menu(MENU_getboottype, &boottype);
- msg_display(MSG_dobootblks, pm->diskdev);
- if (boottype.bp_consdev == ~0u)
- /* Use existing bootblocks */
- return 0;
+ if (pm == NULL || !pm->no_part) {
+ /*
+ * Get console device, should either be ttyE0 or tty0n.
+ * Too hard to double check, so just 'know' the device numbers.
+ */
+ len = sizeof condev;
+ if (sysctl(conmib, nelem(conmib), &condev, &len, NULL, 0) != -1
+ && (condev & ~3) == 0x800) {
+ /* Motherboard serial port */
+ boottype.bp_consdev = (condev & 3) + 1;
+ /* Defaulting the baud rate to that of stdin should suffice */
+ if (tcgetattr(0, &t) != -1)
+ boottype.bp_conspeed = t.c_ispeed;
+ }
+
+ process_menu(MENU_getboottype, &boottype);
+ msg_display(MSG_dobootblks, pm->diskdev);
+ if (boottype.bp_consdev == ~0u)
+ /* Use existing bootblocks */
+ return 0;
+ }
ret = cp_to_target("/usr/mdec/boot", "/boot");
if (ret)
return ret;
+ if (pm && pm->no_part)
+ return 0;
- bootxx_filename = bootxx_name();
- if (bootxx_filename != NULL) {
+ bootxx_filename = bootxx_name();
+ if (bootxx_filename != NULL) {
snprintf(boot_options, sizeof boot_options,
"console=%s,speed=%u", consoles[boottype.bp_consdev],
boottype.bp_conspeed);