Module Name:    src
Committed By:   tsutsui
Date:           Tue Apr  7 10:45:06 UTC 2009

Modified Files:
        src/distrib/utils/sysinst: bsddisklabel.c defs.h disks.c msg.mi.de
            msg.mi.en msg.mi.es msg.mi.fr msg.mi.pl
        src/distrib/utils/sysinst/arch/acorn32: md.h
        src/distrib/utils/sysinst/arch/alpha: md.c md.h
        src/distrib/utils/sysinst/arch/amd64: md.h
        src/distrib/utils/sysinst/arch/arc: md.h
        src/distrib/utils/sysinst/arch/cobalt: md.h
        src/distrib/utils/sysinst/arch/i386: md.c md.h msg.md.de msg.md.en
            msg.md.es msg.md.fr msg.md.pl
        src/distrib/utils/sysinst/arch/macppc: md.h
        src/distrib/utils/sysinst/arch/sgimips: md.h
        src/distrib/utils/sysinst/arch/sparc: md.h

Log Message:
Improve UFS2 root handling on sysinst:
- add HAVE_UFS2_BOOT define on ports which have UFS2 capable loader
- reject UFS2 for root file system on ports !HAVE_UFS2_BOOT
- add a MI function to get bootxx name from root file system type
  per MD defines and remove md_bootxx_name() from arch/i386/md.c,
  so that alpha can use bootxx_ffsv2 for UFS2 as well as x86

Tested on i386 and alpha with FFSv1 and FFSv2, and also
tested on vax (on simh) for !HAVE_UFS2_BOOT case.
de translation is provided by mar...@.

No objection on tech-install, and "move forward with it" from pe...@.

XXX1: not tested on all ports, more ports might/could have UFS2 root support
XXX2: no es, fr, and pl translations, even en message should be improved
XXX3: alpha has a fixed en message without MSG


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/distrib/utils/sysinst/bsddisklabel.c
cvs rdiff -u -r1.141 -r1.142 src/distrib/utils/sysinst/defs.h
cvs rdiff -u -r1.103 -r1.104 src/distrib/utils/sysinst/disks.c
cvs rdiff -u -r1.47 -r1.48 src/distrib/utils/sysinst/msg.mi.de
cvs rdiff -u -r1.152 -r1.153 src/distrib/utils/sysinst/msg.mi.en
cvs rdiff -u -r1.24 -r1.25 src/distrib/utils/sysinst/msg.mi.es
cvs rdiff -u -r1.104 -r1.105 src/distrib/utils/sysinst/msg.mi.fr
cvs rdiff -u -r1.63 -r1.64 src/distrib/utils/sysinst/msg.mi.pl
cvs rdiff -u -r1.18 -r1.19 src/distrib/utils/sysinst/arch/acorn32/md.h
cvs rdiff -u -r1.45 -r1.46 src/distrib/utils/sysinst/arch/alpha/md.c
cvs rdiff -u -r1.21 -r1.22 src/distrib/utils/sysinst/arch/alpha/md.h
cvs rdiff -u -r1.24 -r1.25 src/distrib/utils/sysinst/arch/amd64/md.h
cvs rdiff -u -r1.14 -r1.15 src/distrib/utils/sysinst/arch/arc/md.h
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/sysinst/arch/cobalt/md.h
cvs rdiff -u -r1.120 -r1.121 src/distrib/utils/sysinst/arch/i386/md.c
cvs rdiff -u -r1.65 -r1.66 src/distrib/utils/sysinst/arch/i386/md.h
cvs rdiff -u -r1.15 -r1.16 src/distrib/utils/sysinst/arch/i386/msg.md.de
cvs rdiff -u -r1.57 -r1.58 src/distrib/utils/sysinst/arch/i386/msg.md.en
cvs rdiff -u -r1.10 -r1.11 src/distrib/utils/sysinst/arch/i386/msg.md.es
cvs rdiff -u -r1.47 -r1.48 src/distrib/utils/sysinst/arch/i386/msg.md.fr
cvs rdiff -u -r1.30 -r1.31 src/distrib/utils/sysinst/arch/i386/msg.md.pl
cvs rdiff -u -r1.16 -r1.17 src/distrib/utils/sysinst/arch/macppc/md.h
cvs rdiff -u -r1.23 -r1.24 src/distrib/utils/sysinst/arch/sgimips/md.h
cvs rdiff -u -r1.23 -r1.24 src/distrib/utils/sysinst/arch/sparc/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/distrib/utils/sysinst/bsddisklabel.c
diff -u src/distrib/utils/sysinst/bsddisklabel.c:1.50 src/distrib/utils/sysinst/bsddisklabel.c:1.51
--- src/distrib/utils/sysinst/bsddisklabel.c:1.50	Sun Apr  5 00:50:51 2009
+++ src/distrib/utils/sysinst/bsddisklabel.c	Tue Apr  7 10:45:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.50 2009/04/05 00:50:51 tsutsui Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.51 2009/04/07 10:45:04 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -56,6 +56,8 @@
 #include "msg_defs.h"
 #include "menu_defs.h"
 
+static int check_partitions(void);
+
 /* For the current state of this file blame [email protected] */
 /* Even though he wasn't the last to hack it, but he did admit doing so :-) */
 
@@ -704,7 +706,7 @@
 		msg_display(MSG_abort);
 		return 0;
 	}
-	if (md_check_partitions() == 0)
+	if (check_partitions() == 0)
 		goto edit_check;
 
 	/* Disk name */
@@ -716,3 +718,41 @@
 	/* Everything looks OK. */
 	return (1);
 }
+
+/*
+ * check that there is at least a / somewhere.
+ */
+static int
+check_partitions(void)
+{
+#ifdef HAVE_BOOTXX_xFS
+	int rv;
+	char *bootxx;
+#endif
+#ifndef HAVE_UFS2_BOOT
+	int fstype;
+#endif
+
+#ifdef HAVE_BOOTXX_xFS
+	/* check if we have boot code for the root partition type */
+	bootxx = bootxx_name();
+	if (bootxx != NULL) {
+		rv = access(bootxx, R_OK);
+		free(bootxx);
+	}
+	if (bootxx == NULL || rv != 0) {
+		process_menu(MENU_ok, deconst(MSG_No_Bootcode));
+		return 0;
+	}
+#endif
+#ifndef HAVE_UFS2_BOOT
+	fstype = bsdlabel[rootpart].pi_fstype;
+	if (fstype == FS_BSDFFS &&
+	    (bsdlabel[rootpart].pi_flags & PIF_FFSv2) != 0) {
+		process_menu(MENU_ok, deconst(MSG_cannot_ufs2_root));
+		return 0;
+	}
+#endif
+
+	return md_check_partitions();
+}

Index: src/distrib/utils/sysinst/defs.h
diff -u src/distrib/utils/sysinst/defs.h:1.141 src/distrib/utils/sysinst/defs.h:1.142
--- src/distrib/utils/sysinst/defs.h:1.141	Sun Apr  5 02:18:41 2009
+++ src/distrib/utils/sysinst/defs.h	Tue Apr  7 10:45:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.141 2009/04/05 02:18:41 tsutsui Exp $	*/
+/*	$NetBSD: defs.h,v 1.142 2009/04/07 10:45:04 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -339,6 +339,7 @@
 int	mount_disks(void);
 int	set_swap(const char *, partinfo *);
 int	check_swap(const char *, int);
+char	*bootxx_name(void);
 
 /* from disks_lfs.c */
 int	fs_is_lfs(void *);

Index: src/distrib/utils/sysinst/disks.c
diff -u src/distrib/utils/sysinst/disks.c:1.103 src/distrib/utils/sysinst/disks.c:1.104
--- src/distrib/utils/sysinst/disks.c:1.103	Mon Feb 23 23:12:24 2009
+++ src/distrib/utils/sysinst/disks.c	Tue Apr  7 10:45:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.103 2009/02/23 23:12:24 ad Exp $ */
+/*	$NetBSD: disks.c,v 1.104 2009/04/07 10:45:04 tsutsui Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -823,3 +823,49 @@
 	rval = -1;
 	goto done;
 }
+
+#ifdef HAVE_BOOTXX_xFS
+char *
+bootxx_name(void)
+{
+	int fstype;
+	const char *bootxxname;
+	char *bootxx;
+
+	/* check we have boot code for the root partition type */
+	fstype = bsdlabel[rootpart].pi_fstype;
+	switch (fstype) {
+#if defined(BOOTXX_FFSV1) || defined(BOOTXX_FFSV2)
+	case FS_BSDFFS:
+		if (bsdlabel[rootpart].pi_flags & PIF_FFSv2) {
+#ifdef BOOTXX_FFSV2
+			bootxxname = BOOTXX_FFSV2;
+#else
+			bootxxname = NULL;
+#endif
+		} else {
+#ifdef BOOTXX_FFSV1
+			bootxxname = BOOTXX_FFSV1;
+#else
+			bootxxname = NULL;
+#endif
+		}
+		break;
+#endif
+#ifdef BOOTXX_LFS
+	case FS_BSDLFS:
+		bootxxname = BOOTXX_LFS;
+		break;
+#endif
+	default:
+		bootxxname = NULL;
+		break;
+	}
+
+	if (bootxxname == NULL)
+		return NULL;
+
+	asprintf(&bootxx, "%s/%s", BOOTXXDIR, bootxxname);
+	return bootxx;
+}
+#endif

Index: src/distrib/utils/sysinst/msg.mi.de
diff -u src/distrib/utils/sysinst/msg.mi.de:1.47 src/distrib/utils/sysinst/msg.mi.de:1.48
--- src/distrib/utils/sysinst/msg.mi.de:1.47	Wed Jan 28 16:31:49 2009
+++ src/distrib/utils/sysinst/msg.mi.de	Tue Apr  7 10:45:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.de,v 1.47 2009/01/28 16:31:49 martin Exp $	*/
+/*	$NetBSD: msg.mi.de,v 1.48 2009/04/07 10:45:04 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -845,6 +845,13 @@
 message partitions_overlap
 {Die Partitionen %c und %c überlappen sich.}
 
+message No_Bootcode
+{Kein Bootcode für die Rootpartition vorhanden}
+
+message cannot_ufs2_root
+{Leider existiert für diese Maschine kein Bootloader für FFSv2 Dateisysteme,
+daher kann das Root-Dateisystem nicht im FFSv2 Format angelegt werden.}
+
 message edit_partitions_again
 {
 

Index: src/distrib/utils/sysinst/msg.mi.en
diff -u src/distrib/utils/sysinst/msg.mi.en:1.152 src/distrib/utils/sysinst/msg.mi.en:1.153
--- src/distrib/utils/sysinst/msg.mi.en:1.152	Sun Dec 21 11:02:42 2008
+++ src/distrib/utils/sysinst/msg.mi.en	Tue Apr  7 10:45:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.152 2008/12/21 11:02:42 martin Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.153 2009/04/07 10:45:04 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -787,6 +787,13 @@
 message partitions_overlap
 {partitions %c and %c overlap.}
 
+message No_Bootcode
+{No bootcode for root partition}
+
+message cannot_ufs2_root
+{Sorry, the root file system can't be FFSv2 due to lack of bootloader support
+on this port.}
+
 message edit_partitions_again
 {
 

Index: src/distrib/utils/sysinst/msg.mi.es
diff -u src/distrib/utils/sysinst/msg.mi.es:1.24 src/distrib/utils/sysinst/msg.mi.es:1.25
--- src/distrib/utils/sysinst/msg.mi.es:1.24	Wed Jan 28 16:31:49 2009
+++ src/distrib/utils/sysinst/msg.mi.es	Tue Apr  7 10:45:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.es,v 1.24 2009/01/28 16:31:49 martin Exp $	*/
+/*	$NetBSD: msg.mi.es,v 1.25 2009/04/07 10:45:04 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -812,6 +812,13 @@
 message partitions_overlap
 {las particiones %c y %c se solapan.}
 
+message No_Bootcode
+{No hay código de arranque para la partición root}
+
+message cannot_ufs2_root
+{Sorry, the root file system can't be FFSv2 due to lack of bootloader support
+on this port.}
+
 message edit_partitions_again
 {
 

Index: src/distrib/utils/sysinst/msg.mi.fr
diff -u src/distrib/utils/sysinst/msg.mi.fr:1.104 src/distrib/utils/sysinst/msg.mi.fr:1.105
--- src/distrib/utils/sysinst/msg.mi.fr:1.104	Wed Jan 28 16:31:49 2009
+++ src/distrib/utils/sysinst/msg.mi.fr	Tue Apr  7 10:45:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.fr,v 1.104 2009/01/28 16:31:49 martin Exp $	*/
+/*	$NetBSD: msg.mi.fr,v 1.105 2009/04/07 10:45:04 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -865,6 +865,13 @@
 message partitions_overlap
 {Les partitions %c et %c se recouvrent.}
 
+message No_Bootcode
+{Pas de programme de démarrage pour la partition racine}
+
+message cannot_ufs2_root
+{Sorry, the root file system can't be FFSv2 due to lack of bootloader support
+on this port.}
+
 message edit_partitions_again
 {
 Vous pouvez éditer la table de partitions à la main, ou abandonner et

Index: src/distrib/utils/sysinst/msg.mi.pl
diff -u src/distrib/utils/sysinst/msg.mi.pl:1.63 src/distrib/utils/sysinst/msg.mi.pl:1.64
--- src/distrib/utils/sysinst/msg.mi.pl:1.63	Wed Jan 28 16:31:49 2009
+++ src/distrib/utils/sysinst/msg.mi.pl	Tue Apr  7 10:45:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.pl,v 1.63 2009/01/28 16:31:49 martin Exp $	*/
+/*	$NetBSD: msg.mi.pl,v 1.64 2009/04/07 10:45:04 tsutsui Exp $	*/
 /*	Based on english version: */
 /*	NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp       */
 
@@ -785,6 +785,13 @@
 message partitions_overlap
 {partycje %c i %c pokrycia.}
 
+message No_Bootcode
+{No bootcode for root partition}
+
+message cannot_ufs2_root
+{Sorry, the root file system can't be FFSv2 due to lack of bootloader support
+on this port.}
+
 message edit_partitions_again
 {
 

Index: src/distrib/utils/sysinst/arch/acorn32/md.h
diff -u src/distrib/utils/sysinst/arch/acorn32/md.h:1.18 src/distrib/utils/sysinst/arch/acorn32/md.h:1.19
--- src/distrib/utils/sysinst/arch/acorn32/md.h:1.18	Mon Feb  4 08:42:41 2008
+++ src/distrib/utils/sysinst/arch/acorn32/md.h	Tue Apr  7 10:45:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.18 2008/02/04 08:42:41 chris Exp $	*/
+/*	$NetBSD: md.h,v 1.19 2009/04/07 10:45:04 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -48,6 +48,9 @@
 #define	PART_USR	PART_E
 #define	PART_FIRST_FREE	PART_F
 
+/* have support for booting from UFS2 */
+#define	HAVE_UFS2_BOOT
+
 /*
  *  Default filesets to fetch and install during installation
  *  or upgrade. The standard sets are:

Index: src/distrib/utils/sysinst/arch/alpha/md.c
diff -u src/distrib/utils/sysinst/arch/alpha/md.c:1.45 src/distrib/utils/sysinst/arch/alpha/md.c:1.46
--- src/distrib/utils/sysinst/arch/alpha/md.c:1.45	Tue Oct  7 09:58:14 2008
+++ src/distrib/utils/sysinst/arch/alpha/md.c	Tue Apr  7 10:45:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.45 2008/10/07 09:58:14 abs Exp $	*/
+/*	$NetBSD: md.c,v 1.46 2009/04/07 10:45:04 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -126,12 +126,13 @@
 int
 md_post_newfs(void)
 {
+	char *bootxx;
 
 	printf (msg_string(MSG_dobootblks), diskdev);
 	cp_to_target("/usr/mdec/boot", "/boot");
-	if (run_program(RUN_DISPLAY | RUN_NO_CLEAR,
-	    "/usr/sbin/installboot /dev/r%sc /usr/mdec/bootxx_ffs",
-	    diskdev))
+	bootxx = bootxx_name();
+	if (bootxx == NULL || run_program(RUN_DISPLAY | RUN_NO_CLEAR,
+	    "/usr/sbin/installboot /dev/r%sc %s", diskdev, bootxx))
 		process_menu(MENU_ok,
 			 deconst("Warning: disk is probably not bootable"));
 

Index: src/distrib/utils/sysinst/arch/alpha/md.h
diff -u src/distrib/utils/sysinst/arch/alpha/md.h:1.21 src/distrib/utils/sysinst/arch/alpha/md.h:1.22
--- src/distrib/utils/sysinst/arch/alpha/md.h:1.21	Sun Feb 26 10:25:52 2006
+++ src/distrib/utils/sysinst/arch/alpha/md.h	Tue Apr  7 10:45:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.21 2006/02/26 10:25:52 dsl Exp $	*/
+/*	$NetBSD: md.h,v 1.22 2009/04/07 10:45:04 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -52,6 +52,15 @@
 #define XNEEDMB 50	/* XXXTHORPEJ */
 #define DEFROOTSIZE	128
 
+/* have support for booting from UFS2 */
+#define	HAVE_UFS2_BOOT
+
+/* have file system specific primary boot loader */
+#define	HAVE_BOOTXX_xFS
+#define	BOOTXXDIR	"/usr/mdec"
+#define	BOOTXX_FFSV1	"bootxx_ffs"
+#define	BOOTXX_FFSV2	"bootxx_ffsv2"
+
 /*
  * Default filesets to fetch and install during installation
  * or upgrade.

Index: src/distrib/utils/sysinst/arch/amd64/md.h
diff -u src/distrib/utils/sysinst/arch/amd64/md.h:1.24 src/distrib/utils/sysinst/arch/amd64/md.h:1.25
--- src/distrib/utils/sysinst/arch/amd64/md.h:1.24	Sun Apr  5 00:50:52 2009
+++ src/distrib/utils/sysinst/arch/amd64/md.h	Tue Apr  7 10:45:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.24 2009/04/05 00:50:52 tsutsui Exp $	*/
+/*	$NetBSD: md.h,v 1.25 2009/04/07 10:45:05 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -53,12 +53,20 @@
 #define	DEFUSRSIZE	0
 #define	DEFSWAPSIZE	(-1)
 
+/* Megs required for a full X installation. */
+#define XNEEDMB 50
+
 /* use UFS2 by default for ffs */
 #define	DEFAULT_UFS2
+
+/* have support for booting form UFS2 */
 #define	HAVE_UFS2_BOOT
 
-/* Megs required for a full X installation. */
-#define XNEEDMB 50
+/* have file system specific primary boot loader */
+#define	HAVE_BOOTXX_xFS
+#define	BOOTXXDIR	"/usr/mdec"
+#define	BOOTXX_FFSV1	"bootxx_ffsv1"
+#define	BOOTXX_FFSV2	"bootxx_ffsv2"
 
 
 /*

Index: src/distrib/utils/sysinst/arch/arc/md.h
diff -u src/distrib/utils/sysinst/arch/arc/md.h:1.14 src/distrib/utils/sysinst/arch/arc/md.h:1.15
--- src/distrib/utils/sysinst/arch/arc/md.h:1.14	Sat Feb  2 04:20:02 2008
+++ src/distrib/utils/sysinst/arch/arc/md.h	Tue Apr  7 10:45:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.14 2008/02/02 04:20:02 tsutsui Exp $	*/
+/*	$NetBSD: md.h,v 1.15 2009/04/07 10:45:05 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -75,6 +75,9 @@
 /* Megs required for a full X installation. */
 #define XNEEDMB 100
 
+/* have support for booting from UFS2 */
+#define	HAVE_UFS2_BOOT
+
 
 /*
  *  Default filesets to fetch and install during installation

Index: src/distrib/utils/sysinst/arch/cobalt/md.h
diff -u src/distrib/utils/sysinst/arch/cobalt/md.h:1.1 src/distrib/utils/sysinst/arch/cobalt/md.h:1.2
--- src/distrib/utils/sysinst/arch/cobalt/md.h:1.1	Sat Feb  2 09:14:32 2008
+++ src/distrib/utils/sysinst/arch/cobalt/md.h	Tue Apr  7 10:45:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.1 2008/02/02 09:14:32 tsutsui Exp $	*/
+/*	$NetBSD: md.h,v 1.2 2009/04/07 10:45:05 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -75,6 +75,9 @@
 /* Megs required for a full X installation. */
 #define XNEEDMB 100
 
+/* have support for booting from UFS2 */
+#define	HAVE_UFS2_BOOT
+
 
 /*
  *  Default filesets to fetch and install during installation

Index: src/distrib/utils/sysinst/arch/i386/md.c
diff -u src/distrib/utils/sysinst/arch/i386/md.c:1.120 src/distrib/utils/sysinst/arch/i386/md.c:1.121
--- src/distrib/utils/sysinst/arch/i386/md.c:1.120	Sat Apr  4 11:03:24 2009
+++ src/distrib/utils/sysinst/arch/i386/md.c	Tue Apr  7 10:45:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.120 2009/04/04 11:03:24 ad Exp $ */
+/*	$NetBSD: md.c,v 1.121 2009/04/07 10:45:05 tsutsui Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -68,7 +68,6 @@
 static void md_upgrade_mbrtype(void);
 static int md_read_bootcode(const char *, struct mbr_sector *);
 static unsigned int get_bootmodel(void);
-static char *md_bootxx_name(void);
 
 
 int
@@ -342,7 +341,7 @@
 
 	snprintf(bootxx, sizeof bootxx, "/dev/r%s%c", diskdev, 'a' + rootpart);
 	td = open(bootxx, O_RDWR, 0);
-	bootxx_filename = md_bootxx_name();
+	bootxx_filename = bootxx_name();
 	if (bootxx_filename != NULL) {
 		sd = open(bootxx_filename, O_RDONLY);
 		free(bootxx_filename);
@@ -406,7 +405,7 @@
 	char *bootxx;
 
 	/* check we have boot code for the root partition type */
-	bootxx = md_bootxx_name();
+	bootxx = bootxx_name();
 	rval = access(bootxx, R_OK);
 	free(bootxx);
 	if (rval == 0)
@@ -614,32 +613,6 @@
 	set_kernel_set(get_bootmodel());
 }
 
-static char *
-md_bootxx_name(void)
-{
-	int fstype;
-	const char *bootfs = 0;
-	char *bootxx;
-
-	/* check we have boot code for the root partition type */
-	fstype = bsdlabel[rootpart].pi_fstype;
-	if (fstype == FS_BSDFFS)
-		if (bsdlabel[rootpart].pi_flags & PIF_FFSv2)
-			bootfs = "ffsv2";
-		else
-			bootfs = "ffsv1";
-	else if (fstype == FS_BSDLFS)
-			bootfs = "lfsv2";
-	else
-		bootfs = mountnames[fstype];
-
-	if (bootfs == NULL)
-		return NULL;
-
-	asprintf(&bootxx, "/usr/mdec/bootxx_%s", bootfs);
-	return bootxx;
-}
-
 int
 md_post_extract(void)
 {

Index: src/distrib/utils/sysinst/arch/i386/md.h
diff -u src/distrib/utils/sysinst/arch/i386/md.h:1.65 src/distrib/utils/sysinst/arch/i386/md.h:1.66
--- src/distrib/utils/sysinst/arch/i386/md.h:1.65	Sun Apr  5 00:50:52 2009
+++ src/distrib/utils/sysinst/arch/i386/md.h	Tue Apr  7 10:45:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.65 2009/04/05 00:50:52 tsutsui Exp $	*/
+/*	$NetBSD: md.h,v 1.66 2009/04/07 10:45:05 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -54,12 +54,20 @@
 #define	DEFSWAPSIZE	(-1)
 #define	DEFROOTSIZE	32
 
+/* Megs required for a full X installation. */
+#define XNEEDMB 50
+
 /* use UFS2 by default for ffs */
 #define	DEFAULT_UFS2
+
+/* have support for booting from UFS2 */
 #define	HAVE_UFS2_BOOT
 
-/* Megs required for a full X installation. */
-#define XNEEDMB 50
+/* have file system specific primary boot loader */
+#define	HAVE_BOOTXX_xFS
+#define	BOOTXXDIR	"/usr/mdec"
+#define	BOOTXX_FFSV1	"bootxx_ffsv1"
+#define	BOOTXX_FFSV2	"bootxx_ffsv2"
 
 /*
  *  Default filesets to fetch and install during installation

Index: src/distrib/utils/sysinst/arch/i386/msg.md.de
diff -u src/distrib/utils/sysinst/arch/i386/msg.md.de:1.15 src/distrib/utils/sysinst/arch/i386/msg.md.de:1.16
--- src/distrib/utils/sysinst/arch/i386/msg.md.de:1.15	Wed Apr 30 15:29:11 2008
+++ src/distrib/utils/sysinst/arch/i386/msg.md.de	Tue Apr  7 10:45:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.de,v 1.15 2008/04/30 15:29:11 ad Exp $	*/
+/*	$NetBSD: msg.md.de,v 1.16 2009/04/07 10:45:05 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -74,8 +74,6 @@
 message serial_baud_rate	{Serielle baud Rate}
 message Use_existing_bootblocks	{Vorhandene Bootblöcke benutzen}
 
-message No_Bootcode		{Kein Bootcode für die Rootpartition vorhanden}
-
 message dobootblks
 {Installiere die Bootblöcke auf %s ...
 }

Index: src/distrib/utils/sysinst/arch/i386/msg.md.en
diff -u src/distrib/utils/sysinst/arch/i386/msg.md.en:1.57 src/distrib/utils/sysinst/arch/i386/msg.md.en:1.58
--- src/distrib/utils/sysinst/arch/i386/msg.md.en:1.57	Wed Apr 30 15:29:11 2008
+++ src/distrib/utils/sysinst/arch/i386/msg.md.en	Tue Apr  7 10:45:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.en,v 1.57 2008/04/30 15:29:11 ad Exp $	*/
+/*	$NetBSD: msg.md.en,v 1.58 2009/04/07 10:45:05 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -73,8 +73,6 @@
 message serial_baud_rate	{Set serial baud rate}
 message Use_existing_bootblocks	{Use existing bootblocks}
 
-message No_Bootcode		{No bootcode for root partition}
-
 message dobootblks
 {Installing boot blocks on %s....
 }

Index: src/distrib/utils/sysinst/arch/i386/msg.md.es
diff -u src/distrib/utils/sysinst/arch/i386/msg.md.es:1.10 src/distrib/utils/sysinst/arch/i386/msg.md.es:1.11
--- src/distrib/utils/sysinst/arch/i386/msg.md.es:1.10	Wed Apr 30 15:29:11 2008
+++ src/distrib/utils/sysinst/arch/i386/msg.md.es	Tue Apr  7 10:45:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.es,v 1.10 2008/04/30 15:29:11 ad Exp $	*/
+/*	$NetBSD: msg.md.es,v 1.11 2009/04/07 10:45:05 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -73,8 +73,6 @@
 message serial_baud_rate	{Baudios puerto serie}
 message Use_existing_bootblocks	{Usar bootblocks existente}
 
-message No_Bootcode		{No hay código de arranque para la partición root}
-
 message dobootblks
 {Instalando bloques de arranque en %s....
 }

Index: src/distrib/utils/sysinst/arch/i386/msg.md.fr
diff -u src/distrib/utils/sysinst/arch/i386/msg.md.fr:1.47 src/distrib/utils/sysinst/arch/i386/msg.md.fr:1.48
--- src/distrib/utils/sysinst/arch/i386/msg.md.fr:1.47	Wed Apr 30 15:29:11 2008
+++ src/distrib/utils/sysinst/arch/i386/msg.md.fr	Tue Apr  7 10:45:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.fr,v 1.47 2008/04/30 15:29:11 ad Exp $	*/
+/*	$NetBSD: msg.md.fr,v 1.48 2009/04/07 10:45:05 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -69,8 +69,6 @@
 message serial_baud_rate	{Vitesse du port série}
 message Use_existing_bootblocks	{Conserver le programme de démarrage existant}
 
-message No_Bootcode		{Pas de programme de démarrage pour la partition racine}
-
 message dobootblks
 {Installation programme de démarrage sur %s ...
 }

Index: src/distrib/utils/sysinst/arch/i386/msg.md.pl
diff -u src/distrib/utils/sysinst/arch/i386/msg.md.pl:1.30 src/distrib/utils/sysinst/arch/i386/msg.md.pl:1.31
--- src/distrib/utils/sysinst/arch/i386/msg.md.pl:1.30	Wed Apr 30 15:29:11 2008
+++ src/distrib/utils/sysinst/arch/i386/msg.md.pl	Tue Apr  7 10:45:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.pl,v 1.30 2008/04/30 15:29:11 ad Exp $	*/
+/*	$NetBSD: msg.md.pl,v 1.31 2009/04/07 10:45:05 tsutsui Exp $	*/
 /*	Based on english version: */
 /*	NetBSD: msg.md.en,v 1.24 2001/01/27 07:34:39 jmc Exp 	*/
 
@@ -71,8 +71,6 @@
 message serial_baud_rate	{Serial baud rate}
 message Use_existing_bootblocks	{Use existing bootblocks}
 
-message No_Bootcode		{No bootcode for root partition}
-
 message dobootblks
 {Instalowanie bootblokow na %s....
 }

Index: src/distrib/utils/sysinst/arch/macppc/md.h
diff -u src/distrib/utils/sysinst/arch/macppc/md.h:1.16 src/distrib/utils/sysinst/arch/macppc/md.h:1.17
--- src/distrib/utils/sysinst/arch/macppc/md.h:1.16	Sun Feb 26 10:25:53 2006
+++ src/distrib/utils/sysinst/arch/macppc/md.h	Tue Apr  7 10:45:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.16 2006/02/26 10:25:53 dsl Exp $	*/
+/*	$NetBSD: md.h,v 1.17 2009/04/07 10:45:05 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -51,6 +51,9 @@
 /* Megs required for a full X installation. */
 #define XNEEDMB 35	/* XXXTHORPEJ */
 
+/* have support for booting from UFS2 */
+#define	HAVE_UFS2_BOOT
+
 /*
  * Default filesets to fetch and install during installation
  * or upgrade.

Index: src/distrib/utils/sysinst/arch/sgimips/md.h
diff -u src/distrib/utils/sysinst/arch/sgimips/md.h:1.23 src/distrib/utils/sysinst/arch/sgimips/md.h:1.24
--- src/distrib/utils/sysinst/arch/sgimips/md.h:1.23	Mon Nov 12 15:07:36 2007
+++ src/distrib/utils/sysinst/arch/sgimips/md.h	Tue Apr  7 10:45:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.23 2007/11/12 15:07:36 jmmv Exp $	*/
+/*	$NetBSD: md.h,v 1.24 2009/04/07 10:45:05 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -58,6 +58,9 @@
 #define DEFUSRSIZE	120	/* Default /usr size, if /home */
 #define XNEEDMB		100	/* Extra megs for full X installation */
 
+/* have support for booting from UFS2 */
+#define	HAVE_UFS2_BOOT
+
 /*
  * Machine-specific command to write a new label to a disk.
  * If not defined, we assume the port does not support disklabels and

Index: src/distrib/utils/sysinst/arch/sparc/md.h
diff -u src/distrib/utils/sysinst/arch/sparc/md.h:1.23 src/distrib/utils/sysinst/arch/sparc/md.h:1.24
--- src/distrib/utils/sysinst/arch/sparc/md.h:1.23	Fri Aug 11 13:35:54 2006
+++ src/distrib/utils/sysinst/arch/sparc/md.h	Tue Apr  7 10:45:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.23 2006/08/11 13:35:54 hubertf Exp $	*/
+/*	$NetBSD: md.h,v 1.24 2009/04/07 10:45:05 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -56,6 +56,9 @@
 #define DEFUSRSIZE	100	/* Default /usr size, if /home */
 #define XNEEDMB		35	/* Extra megs for full X installation */
 
+/* have support for booting from UFS2 */
+#define	HAVE_UFS2_BOOT
+
 /*
  * Default filesets to fetch and install during installation
  * or upgrade.

Reply via email to