Module Name:    src
Committed By:   msaitoh
Date:           Wed Feb  2 04:25:41 UTC 2022

Modified Files:
        src/usr.sbin/sysinst [netbsd-9]: defs.h gpt.c install.c main.c target.c
            upgrade.c util.c
        src/usr.sbin/sysinst/arch/acorn32 [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/alpha [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/amiga [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/arc [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/atari [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/bebox [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/cats [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/cobalt [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/dummy [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/emips [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/evbarm [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/evbmips [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/evbppc [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/evbsh3 [netbsd-9]: md.c
        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/hpcarm [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/hpcmips [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/hpcsh [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/hppa [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/i386 [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/landisk [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/luna68k [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/mac68k [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/macppc [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/news68k [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/newsmips [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/ofppc [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/playstation2 [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/sandpoint [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/sgimips [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/shark [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/sparc [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/sparc64 [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/vax [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/x68k [netbsd-9]: md.c
        src/usr.sbin/sysinst/arch/zaurus [netbsd-9]: md.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1422):
        usr.sbin/sysinst/util.c: revision 1.64
        usr.sbin/sysinst/arch/hpcsh/md.c: revision 1.11
        usr.sbin/sysinst/arch/alpha/md.c: revision 1.10
        usr.sbin/sysinst/arch/sparc64/md.c: revision 1.7
        usr.sbin/sysinst/arch/emips/md.c: revision 1.10
        usr.sbin/sysinst/arch/cobalt/md.c: revision 1.15
        usr.sbin/sysinst/arch/x68k/md.c: revision 1.12
        usr.sbin/sysinst/arch/sandpoint/md.c: revision 1.10
        usr.sbin/sysinst/arch/luna68k/md.c: revision 1.10
        usr.sbin/sysinst/arch/hp300/md.c: revision 1.12
        usr.sbin/sysinst/arch/vax/md.c: revision 1.8
        usr.sbin/sysinst/arch/hpcmips/md.c: revision 1.10
        usr.sbin/sysinst/target.c: revision 1.16
        usr.sbin/sysinst/arch/mvme68k/md.c: revision 1.12
        usr.sbin/sysinst/arch/arc/md.c: revision 1.14
        usr.sbin/sysinst/target.c: revision 1.17
        usr.sbin/sysinst/arch/i386/md.c: revision 1.34
        usr.sbin/sysinst/arch/mac68k/md.c: revision 1.11
        usr.sbin/sysinst/arch/atari/md.c: revision 1.8
        usr.sbin/sysinst/arch/sgimips/md.c: revision 1.10
        usr.sbin/sysinst/arch/acorn32/md.c: revision 1.8
        usr.sbin/sysinst/install.c: revision 1.22
        usr.sbin/sysinst/arch/amiga/md.c: revision 1.7
        usr.sbin/sysinst/arch/cats/md.c: revision 1.6
        usr.sbin/sysinst/arch/dummy/md.c: revision 1.7
        usr.sbin/sysinst/arch/shark/md.c: revision 1.7
        usr.sbin/sysinst/arch/pmax/md.c: revision 1.9
        usr.sbin/sysinst/arch/newsmips/md.c: revision 1.7
        usr.sbin/sysinst/arch/mipsco/md.c: revision 1.9
        usr.sbin/sysinst/arch/landisk/md.c: revision 1.15
        usr.sbin/sysinst/arch/hppa/md.c: revision 1.9
        usr.sbin/sysinst/arch/prep/md.c: revision 1.14
        usr.sbin/sysinst/defs.h: revision 1.77
        usr.sbin/sysinst/arch/ofppc/md.c: revision 1.13
        usr.sbin/sysinst/arch/ews4800mips/md.c: revision 1.8
        usr.sbin/sysinst/defs.h: revision 1.78
        usr.sbin/sysinst/arch/macppc/md.c: revision 1.7
        usr.sbin/sysinst/arch/evbppc/md.c: revision 1.10
        usr.sbin/sysinst/defs.h: revision 1.79
        usr.sbin/sysinst/gpt.c: revision 1.27
        usr.sbin/sysinst/arch/bebox/md.c: revision 1.10
        usr.sbin/sysinst/gpt.c: revision 1.28
        usr.sbin/sysinst/arch/sparc/md.c: revision 1.7
        usr.sbin/sysinst/arch/evbsh3/md.c: revision 1.7
        usr.sbin/sysinst/arch/evbarm/md.c: revision 1.22
        usr.sbin/sysinst/arch/news68k/md.c: revision 1.8
        usr.sbin/sysinst/upgrade.c: revision 1.19
        usr.sbin/sysinst/arch/zaurus/md.c: revision 1.12
        usr.sbin/sysinst/arch/playstation2/md.c: revision 1.10
        usr.sbin/sysinst/arch/hpcarm/md.c: revision 1.11
        usr.sbin/sysinst/arch/evbmips/md.c: revision 1.10
        usr.sbin/sysinst/main.c: revision 1.28
Add an option to set the directory where we look for message catalogs.
Try to get rid of all wedges we created (after unmounting).
When upgrading, update the boot code post extraction from
the updated target file system.
Do not defer wedge deletions when we have nothing mounted.
Define and use a constant for maximum disk name length.


To generate a diff of this commit:
cvs rdiff -u -r1.42.2.9 -r1.42.2.10 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.6.2.9 -r1.6.2.10 src/usr.sbin/sysinst/gpt.c
cvs rdiff -u -r1.9.2.4 -r1.9.2.5 src/usr.sbin/sysinst/install.c
cvs rdiff -u -r1.17.2.4 -r1.17.2.5 src/usr.sbin/sysinst/main.c
cvs rdiff -u -r1.8.2.5 -r1.8.2.6 src/usr.sbin/sysinst/target.c
cvs rdiff -u -r1.12.2.4 -r1.12.2.5 src/usr.sbin/sysinst/upgrade.c
cvs rdiff -u -r1.29.2.8 -r1.29.2.9 src/usr.sbin/sysinst/util.c
cvs rdiff -u -r1.5.2.1 -r1.5.2.2 src/usr.sbin/sysinst/arch/acorn32/md.c
cvs rdiff -u -r1.6.2.3 -r1.6.2.4 src/usr.sbin/sysinst/arch/alpha/md.c
cvs rdiff -u -r1.5.2.1 -r1.5.2.2 src/usr.sbin/sysinst/arch/amiga/md.c
cvs rdiff -u -r1.8.2.4 -r1.8.2.5 src/usr.sbin/sysinst/arch/arc/md.c
cvs rdiff -u -r1.6.2.1 -r1.6.2.2 src/usr.sbin/sysinst/arch/atari/md.c
cvs rdiff -u -r1.5.2.3 -r1.5.2.4 src/usr.sbin/sysinst/arch/bebox/md.c
cvs rdiff -u -r1.4.2.1 -r1.4.2.2 src/usr.sbin/sysinst/arch/cats/md.c
cvs rdiff -u -r1.8.2.4 -r1.8.2.5 src/usr.sbin/sysinst/arch/cobalt/md.c
cvs rdiff -u -r1.5.2.1 -r1.5.2.2 src/usr.sbin/sysinst/arch/dummy/md.c
cvs rdiff -u -r1.7.2.2 -r1.7.2.3 src/usr.sbin/sysinst/arch/emips/md.c
cvs rdiff -u -r1.8.2.7 -r1.8.2.8 src/usr.sbin/sysinst/arch/evbarm/md.c
cvs rdiff -u -r1.5.2.3 -r1.5.2.4 src/usr.sbin/sysinst/arch/evbmips/md.c
cvs rdiff -u -r1.5.2.3 -r1.5.2.4 src/usr.sbin/sysinst/arch/evbppc/md.c
cvs rdiff -u -r1.5.2.1 -r1.5.2.2 src/usr.sbin/sysinst/arch/evbsh3/md.c
cvs rdiff -u -r1.4.2.2 -r1.4.2.3 src/usr.sbin/sysinst/arch/ews4800mips/md.c
cvs rdiff -u -r1.8.2.3 -r1.8.2.4 src/usr.sbin/sysinst/arch/hp300/md.c
cvs rdiff -u -r1.5.2.3 -r1.5.2.4 src/usr.sbin/sysinst/arch/hpcarm/md.c
cvs rdiff -u -r1.5.2.3 -r1.5.2.4 src/usr.sbin/sysinst/arch/hpcmips/md.c
cvs rdiff -u -r1.6.2.3 -r1.6.2.4 src/usr.sbin/sysinst/arch/hpcsh/md.c
cvs rdiff -u -r1.7.2.1 -r1.7.2.2 src/usr.sbin/sysinst/arch/hppa/md.c
cvs rdiff -u -r1.20.2.8 -r1.20.2.9 src/usr.sbin/sysinst/arch/i386/md.c
cvs rdiff -u -r1.10.2.3 -r1.10.2.4 src/usr.sbin/sysinst/arch/landisk/md.c
cvs rdiff -u -r1.7.2.2 -r1.7.2.3 src/usr.sbin/sysinst/arch/luna68k/md.c
cvs rdiff -u -r1.8.2.2 -r1.8.2.3 src/usr.sbin/sysinst/arch/mac68k/md.c
cvs rdiff -u -r1.5.2.1 -r1.5.2.2 src/usr.sbin/sysinst/arch/macppc/md.c
cvs rdiff -u -r1.6.2.2 -r1.6.2.3 src/usr.sbin/sysinst/arch/mipsco/md.c
cvs rdiff -u -r1.8.2.3 -r1.8.2.4 src/usr.sbin/sysinst/arch/mvme68k/md.c
cvs rdiff -u -r1.6.2.1 -r1.6.2.2 src/usr.sbin/sysinst/arch/news68k/md.c
cvs rdiff -u -r1.5.2.1 -r1.5.2.2 src/usr.sbin/sysinst/arch/newsmips/md.c
cvs rdiff -u -r1.7.2.3 -r1.7.2.4 src/usr.sbin/sysinst/arch/ofppc/md.c
cvs rdiff -u -r1.5.2.3 -r1.5.2.4 src/usr.sbin/sysinst/arch/playstation2/md.c
cvs rdiff -u -r1.6.2.2 -r1.6.2.3 src/usr.sbin/sysinst/arch/pmax/md.c
cvs rdiff -u -r1.8.2.4 -r1.8.2.5 src/usr.sbin/sysinst/arch/prep/md.c
cvs rdiff -u -r1.5.2.3 -r1.5.2.4 src/usr.sbin/sysinst/arch/sandpoint/md.c
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/usr.sbin/sysinst/arch/sgimips/md.c
cvs rdiff -u -r1.5.2.1 -r1.5.2.2 src/usr.sbin/sysinst/arch/shark/md.c
cvs rdiff -u -r1.5.2.1 -r1.5.2.2 src/usr.sbin/sysinst/arch/sparc/md.c
cvs rdiff -u -r1.5.2.1 -r1.5.2.2 src/usr.sbin/sysinst/arch/sparc64/md.c
cvs rdiff -u -r1.6.2.1 -r1.6.2.2 src/usr.sbin/sysinst/arch/vax/md.c
cvs rdiff -u -r1.8.2.3 -r1.8.2.4 src/usr.sbin/sysinst/arch/x68k/md.c
cvs rdiff -u -r1.5.2.3 -r1.5.2.4 src/usr.sbin/sysinst/arch/zaurus/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/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.42.2.9 src/usr.sbin/sysinst/defs.h:1.42.2.10
--- src/usr.sbin/sysinst/defs.h:1.42.2.9	Thu Aug 19 04:52:10 2021
+++ src/usr.sbin/sysinst/defs.h	Wed Feb  2 04:25:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.42.2.9 2021/08/19 04:52:10 snj Exp $	*/
+/*	$NetBSD: defs.h,v 1.42.2.10 2022/02/02 04:25:36 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -58,6 +58,7 @@ const char *getfslabelname(uint, uint);
 #define STRSIZE		255
 #define	MENUSTRSIZE	80
 #define SSTRSIZE	30
+#define	DISKNAMESIZE	24	/* max(strlen("/dev/rsd22c")) */
 
 /* these are used for different alignment defaults */
 #define	HUGE_DISK_SIZE	(daddr_t)(128 * (GIG / 512))
@@ -644,7 +645,7 @@ bool	md_pre_disklabel(struct install_par
 bool	md_post_disklabel(struct install_partition_desc*, struct disk_partitions*);
 int	md_pre_mount(struct install_partition_desc*, size_t);
 int	md_post_newfs(struct install_partition_desc*);
-int	md_post_extract(struct install_partition_desc*);
+int	md_post_extract(struct install_partition_desc*, bool upgrade);
 void	md_cleanup_install(struct install_partition_desc*);
 
  /* MD functions if user selects upgrade - in order called */
@@ -904,6 +905,7 @@ int	target_dir_exists_p(const char *);
 int	target_file_exists_p(const char *);
 int	target_symlink_exists_p(const char *);
 void	unwind_mounts(void);
+void	register_post_umount_delwedge(const char *disk, const char *wedge);
 int	target_mounted(void);
 void	umount_root(void);
 

Index: src/usr.sbin/sysinst/gpt.c
diff -u src/usr.sbin/sysinst/gpt.c:1.6.2.9 src/usr.sbin/sysinst/gpt.c:1.6.2.10
--- src/usr.sbin/sysinst/gpt.c:1.6.2.9	Thu Oct 15 19:36:50 2020
+++ src/usr.sbin/sysinst/gpt.c	Wed Feb  2 04:25:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt.c,v 1.6.2.9 2020/10/15 19:36:50 bouyer Exp $	*/
+/*	$NetBSD: gpt.c,v 1.6.2.10 2022/02/02 04:25:36 msaitoh Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@ bool	gpt_parts_check(void);	/* check for
 #define GUID_STR_LEN	40
 #define	GPT_PTYPE_ALLOC	32	/* initial type array allocation, should be >
 				 * gpt type -l | wc -l */
-#define	GPT_DEV_LEN	16	/* dkNN */
+#define	GPT_DEV_LEN	DISKNAMESIZE	/* dkNN */
 
 #define	GPT_PARTS_PER_SEC	4	/* a 512 byte sector holds 4 entries */
 #define	GPT_DEFAULT_MAX_PARTS	128
@@ -1607,6 +1607,9 @@ gpt_free(struct disk_partitions *arg)
 
 	assert(parts != NULL);
 	for (p = parts->partitions; p != NULL; p = n) {
+		if (p->gp_flags & GPEF_WEDGE)
+			register_post_umount_delwedge(parts->dp.disk,
+			    p->gp_dev_name);
 		free(__UNCONST(p->last_mounted));
 		n = p->gp_next;
 		free(p);

Index: src/usr.sbin/sysinst/install.c
diff -u src/usr.sbin/sysinst/install.c:1.9.2.4 src/usr.sbin/sysinst/install.c:1.9.2.5
--- src/usr.sbin/sysinst/install.c:1.9.2.4	Thu Oct 15 19:36:51 2020
+++ src/usr.sbin/sysinst/install.c	Wed Feb  2 04:25:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: install.c,v 1.9.2.4 2020/10/15 19:36:51 bouyer Exp $	*/
+/*	$NetBSD: install.c,v 1.9.2.5 2022/02/02 04:25:36 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -230,7 +230,7 @@ do_install(void)
 	    MSG_extractcomplete, MSG_abortinst) != 0)
 		goto error;
 
-	if (md_post_extract(&install) != 0)
+	if (md_post_extract(&install, false) != 0)
 		goto error;
 
 	do_configmenu(&install);

Index: src/usr.sbin/sysinst/main.c
diff -u src/usr.sbin/sysinst/main.c:1.17.2.4 src/usr.sbin/sysinst/main.c:1.17.2.5
--- src/usr.sbin/sysinst/main.c:1.17.2.4	Thu Oct 15 19:36:51 2020
+++ src/usr.sbin/sysinst/main.c	Wed Feb  2 04:25:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.17.2.4 2020/10/15 19:36:51 bouyer Exp $	*/
+/*	$NetBSD: main.c,v 1.17.2.5 2022/02/02 04:25:36 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -91,7 +91,7 @@ char dist_postfix[SSTRSIZE];
 char dist_tgz_postfix[SSTRSIZE];
 WINDOW *mainwin;
 
-static void select_language(void);
+static void select_language(const char*);
 __dead static void usage(void);
 __dead static void miscsighandler(int);
 static void ttysighandler(int);
@@ -208,6 +208,7 @@ int
 main(int argc, char **argv)
 {
 	int ch;
+	const char *msg_cat_dir = NULL;
 
 	init();
 
@@ -223,7 +224,7 @@ main(int argc, char **argv)
 	}
 
 	/* argv processing */
-	while ((ch = getopt(argc, argv, "Dr:f:C:"
+	while ((ch = getopt(argc, argv, "Dr:f:C:m:"
 #ifndef NO_PARTMAN
 	    "p"
 #endif
@@ -243,6 +244,10 @@ main(int argc, char **argv)
 			/* Define colors */
 			sscanf(optarg, "%u:%u", &clr_arg.bg, &clr_arg.fg);
 			break;
+		case 'm':
+			/* set message catalog directory */
+			msg_cat_dir = optarg;
+			break;
 #ifndef NO_PARTMAN
 		case 'p':
 			/* Partition tool */
@@ -296,7 +301,7 @@ main(int argc, char **argv)
 	/* Ensure we have mountpoint for target filesystems */
 	mkdir(targetroot_mnt, S_IRWXU| S_IRGRP|S_IXGRP | S_IROTH|S_IXOTH);
 
-	select_language();
+	select_language(msg_cat_dir);
 	get_kb_encoding();
 	init_lang();
 
@@ -326,103 +331,123 @@ set_language(menudesc *m, void *arg)
 	return 1;
 }
 
+/*
+ * Search for sysinstmsg.* files in the given dir, collect
+ * their names and return the number of files found.
+ * fnames[0] is preallocated and duplicates are ignored.
+ */
+struct found_msgs {
+	char **lang_msg, **fnames;
+	int max_lang, num_lang;
+
+};
 static void
-select_language(void)
+find_language_files(const char *path, struct found_msgs *res)
 {
 	DIR *dir;
 	struct dirent *dirent;
-	char **lang_msg, **fnames;
-	char prefix[PATH_MAX], fname[PATH_MAX];
-	int max_lang = 16, num_lang = 0;
+	char fname[PATH_MAX];
 	const char *cp;
-	menu_ent *opt = 0;
-	int lang_menu = -1;
-	int lang;
 
-#ifdef CATALOG_DIR
-	strcpy(prefix, CATALOG_DIR "/");
-	dir = opendir(CATALOG_DIR);
-	if (!dir) {
-		strcpy(prefix, "./");
-		dir = opendir(".");
-	}
-#else
-	dir = opendir(".");
-	strcpy(prefix, "./");
-#endif
+	res->num_lang = 0;
+	dir = opendir(path);
 	if (!dir)
 		return;
 
-	lang_msg = malloc(max_lang * sizeof *lang_msg);
-	fnames = malloc(max_lang * sizeof *fnames);
-	if (!lang_msg || !fnames)
-		goto done;
-
-	lang_msg[0] = strdup(msg_string(MSG_sysinst_message_language));
-	fnames[0] = 0;
-	num_lang = 1;
-
 	while ((dirent = readdir(dir)) != 0) {
 		if (memcmp(dirent->d_name, "sysinstmsgs.", 12))
 			continue;
-		strcpy(fname, prefix);
+
+		if (res->num_lang == 0)
+			res->num_lang = 1;
+		strcpy(fname, path);
+		strcat(fname, "/");
 		strcat(fname, dirent->d_name);
 		if (msg_file(fname))
 			continue;
 		cp = msg_string(MSG_sysinst_message_language);
-		if (!strcmp(cp, lang_msg[0]))
+		if (!strcmp(cp, res->lang_msg[0]))
 			continue;
-		if (num_lang == max_lang) {
+		if (res->num_lang == res->max_lang) {
 			char **new;
-			max_lang *= 2;
-			new = realloc(lang_msg, max_lang * sizeof *lang_msg);
+			res->max_lang *= 2;
+			new = realloc(res->lang_msg,
+			    res->max_lang * sizeof *res->lang_msg);
 			if (!new)
 				break;
-			lang_msg = new;
-			new = realloc(fnames, max_lang * sizeof *fnames);
+			res->lang_msg = new;
+			new = realloc(res->fnames,
+			    res->max_lang * sizeof *res->fnames);
 			if (!new)
 				break;
-			fnames = new;
+			res->fnames = new;
 		}
-		fnames[num_lang] = strdup(fname);
-		lang_msg[num_lang++] = strdup(cp);
+		res->fnames[res->num_lang] = strdup(fname);
+		res->lang_msg[res->num_lang++] = strdup(cp);
 	}
-	msg_file(0);
+
 	closedir(dir);
-	dir = 0;
+}
+
+static void
+select_language(const char *msg_cat_path)
+{
+	struct found_msgs found;
+	menu_ent *opt = 0;
+	const char *cp;
+	int lang_menu = -1;
+	int lang;
+
+	found.max_lang = 16;
+	found.num_lang = 0;
+	found.lang_msg = malloc(found.max_lang * sizeof *found.lang_msg);
+	found.fnames = malloc(found.max_lang * sizeof *found.fnames);
+	if (!found.lang_msg || !found.fnames)
+		goto done;
+	found.lang_msg[0] = strdup(msg_string(MSG_sysinst_message_language));
+	found.fnames[0] = NULL;
+
+	if (msg_cat_path != NULL)
+		find_language_files(msg_cat_path, &found);
+	if (found.num_lang == 0)
+		find_language_files(".", &found);
+#ifdef CATALOG_DIR
+	if (found.num_lang == 0)
+		find_language_files(CATALOG_DIR, &found);
+#endif
+
+	msg_file(0);
 
-	if (num_lang == 1)
+	if (found.num_lang <= 1)
 		goto done;
 
-	opt = calloc(num_lang, sizeof *opt);
+	opt = calloc(found.num_lang, sizeof *opt);
 	if (!opt)
 		goto done;
 
-	for (lang = 0; lang < num_lang; lang++) {
-		opt[lang].opt_name = lang_msg[lang];
+	for (lang = 0; lang < found.num_lang; lang++) {
+		opt[lang].opt_name = found.lang_msg[lang];
 		opt[lang].opt_action = set_language;
 	}
 
-	lang_menu = new_menu(NULL, opt, num_lang, -1, 12, 0, 0, MC_NOEXITOPT,
-		NULL, NULL, NULL, NULL, NULL);
+	lang_menu = new_menu(NULL, opt, found.num_lang, -1, 12, 0, 0,
+	    MC_NOEXITOPT, NULL, NULL, NULL, NULL, NULL);
 
 	if (lang_menu != -1) {
 		msg_display(MSG_hello);
-		process_menu(lang_menu, fnames);
+		process_menu(lang_menu, found.fnames);
 	}
 
     done:
-	if (dir)
-		closedir(dir);
 	if (lang_menu != -1)
 		free_menu(lang_menu);
 	free(opt);
-	while (num_lang) {
-		free(lang_msg[--num_lang]);
-		free(fnames[num_lang]);
+	for (int i = 0; i < found.num_lang; i++) {
+		free(found.lang_msg[i]);
+		free(found.fnames[i]);
 	}
-	free(lang_msg);
-	free(fnames);
+	free(found.lang_msg);
+	free(found.fnames);
 
 	/* set locale according to selected language */
 	cp = msg_string(MSG_sysinst_message_locale);
@@ -476,6 +501,7 @@ usage(void)
 	    "where:\n"
 	    "\t-D\n\t\trun in debug mode\n"
 	    "\t-f definition_file\n\t\toverride built-in defaults from file\n"
+	    "\t-m msg_catalog_dir\n\t\tuse translation files from msg_catalog_dir\n"
 	    "\t-r release\n\t\toverride release name\n"
 	    "\t-C bg:fg\n\t\tuse different color scheme\n"
 #ifndef NO_PARTMAN

Index: src/usr.sbin/sysinst/target.c
diff -u src/usr.sbin/sysinst/target.c:1.8.2.5 src/usr.sbin/sysinst/target.c:1.8.2.6
--- src/usr.sbin/sysinst/target.c:1.8.2.5	Thu Oct 15 19:36:51 2020
+++ src/usr.sbin/sysinst/target.c	Wed Feb  2 04:25:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: target.c,v 1.8.2.5 2020/10/15 19:36:51 bouyer Exp $	*/
+/*	$NetBSD: target.c,v 1.8.2.6 2022/02/02 04:25:36 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -71,7 +71,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: target.c,v 1.8.2.5 2020/10/15 19:36:51 bouyer Exp $");
+__RCSID("$NetBSD: target.c,v 1.8.2.6 2022/02/02 04:25:36 msaitoh Exp $");
 #endif
 
 /*
@@ -83,6 +83,7 @@ __RCSID("$NetBSD: target.c,v 1.8.2.5 202
 
 #include <sys/param.h>			/* XXX vm_param.h always defines TRUE*/
 #include <sys/types.h>
+#include <sys/ioctl.h>
 #include <sys/sysctl.h>
 #include <sys/stat.h>			/* stat() */
 #include <sys/mount.h>			/* statfs() */
@@ -93,7 +94,7 @@ __RCSID("$NetBSD: target.c,v 1.8.2.5 202
 #include <unistd.h>
 #include <curses.h>			/* defines TRUE, but checks  */
 #include <errno.h>
-
+#include <util.h>
 
 #include "defs.h"
 #include "md.h"
@@ -119,6 +120,13 @@ struct unwind_mount {
 	char um_mountpoint[4];		/* Allocated longer... */
 };
 
+/* Record a wedge for later deletion after all file systems have been unmounted */
+struct umount_delwedge {
+	struct umount_delwedge *next;
+	char disk[DISKNAMESIZE], wedge[DISKNAMESIZE];
+};
+struct umount_delwedge *post_umount_dwlist = NULL;
+
 /* Unwind-mount stack */
 struct unwind_mount *unwind_mountlist = NULL;
 
@@ -519,6 +527,41 @@ target_mount(const char *opts, const cha
 	return target_mount_do(opts, from, on);
 }
 
+static bool
+delete_wedge(const char *disk, const char *wedge)
+{
+	struct dkwedge_info dkw;
+	char diskpath[MAXPATHLEN];
+	int fd, error;
+
+	fd = opendisk(disk, O_RDWR, diskpath, sizeof(diskpath), 0);
+	if (fd < 0)
+		return false;
+	memset(&dkw, 0, sizeof(dkw));
+	strlcpy(dkw.dkw_devname, wedge, sizeof(dkw.dkw_devname));
+	error = ioctl(fd, DIOCDWEDGE, &dkw);
+	close(fd);
+	return error == 0;
+}
+
+void
+register_post_umount_delwedge(const char *disk, const char *wedge)
+{
+	struct umount_delwedge *dw;
+
+	if (unwind_mountlist == NULL) {
+		/* we have nothing mounted, can delete it right now */
+		delete_wedge(disk, wedge);
+		return;
+	}
+
+	dw = calloc(1, sizeof(*dw));
+	dw->next = post_umount_dwlist;
+	strlcpy(dw->disk, disk, sizeof(dw->disk));
+	strlcpy(dw->wedge, wedge, sizeof(dw->wedge));
+	post_umount_dwlist = dw;
+}
+
 /*
  * unwind the mount stack, unmounting mounted filesystems.
  * For now, ignore any errors in unmount. 
@@ -529,6 +572,7 @@ void
 unwind_mounts(void)
 {
 	struct unwind_mount *m;
+	struct umount_delwedge *dw;
 	static volatile int unwind_in_progress = 0;
 
 	/* signal safety */
@@ -547,6 +591,11 @@ unwind_mounts(void)
 			target_prefix(), m->um_mountpoint);
 		free(m);
 	}
+	while ((dw = post_umount_dwlist) != NULL) {
+		post_umount_dwlist = dw->next;
+		delete_wedge(dw->disk, dw->wedge);
+		free(dw);
+	}
 	unwind_in_progress = 0;
 }
 

Index: src/usr.sbin/sysinst/upgrade.c
diff -u src/usr.sbin/sysinst/upgrade.c:1.12.2.4 src/usr.sbin/sysinst/upgrade.c:1.12.2.5
--- src/usr.sbin/sysinst/upgrade.c:1.12.2.4	Thu Aug 19 04:52:10 2021
+++ src/usr.sbin/sysinst/upgrade.c	Wed Feb  2 04:25:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: upgrade.c,v 1.12.2.4 2021/08/19 04:52:10 snj Exp $	*/
+/*	$NetBSD: upgrade.c,v 1.12.2.5 2022/02/02 04:25:36 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -120,7 +120,7 @@ do_upgrade(void)
 	    MSG_upgrcomplete, MSG_abortupgr) != 0)
 		goto free_install;
 
-	if (md_post_extract(&install))
+	if (md_post_extract(&install, true))
 		goto free_install;
 
 	merge_X("/usr/X11R6");

Index: src/usr.sbin/sysinst/util.c
diff -u src/usr.sbin/sysinst/util.c:1.29.2.8 src/usr.sbin/sysinst/util.c:1.29.2.9
--- src/usr.sbin/sysinst/util.c:1.29.2.8	Thu Nov  5 08:10:21 2020
+++ src/usr.sbin/sysinst/util.c	Wed Feb  2 04:25:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.29.2.8 2020/11/05 08:10:21 sborrill Exp $	*/
+/*	$NetBSD: util.c,v 1.29.2.9 2022/02/02 04:25:36 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -2232,9 +2232,9 @@ free_usage_set(struct partition_usage_se
 void
 free_install_desc(struct install_partition_desc *install)
 {
-#ifndef NO_CLONES
 	size_t i, j;
 
+#ifndef NO_CLONES
 	for (i = 0; i < install->num; i++) {
 		struct selected_partitions *src = install->infos[i].clone_src;
 		if (!(install->infos[i].flags & PUIFLG_CLONE_PARTS) ||
@@ -2246,6 +2246,22 @@ free_install_desc(struct install_partiti
 				install->infos[j].clone_src = NULL; 
 	}
 #endif
+
+	for (i = 0; i < install->num; i++) {
+		struct disk_partitions * parts = install->infos[i].parts;
+
+		if (parts == NULL)
+			continue;
+
+		if (parts->pscheme->free)
+			parts->pscheme->free(parts);
+
+		/* NULL all other references to this parts */
+		for (j = i+1; j < install->num; j++)
+			if (install->infos[j].parts == parts)
+				install->infos[j].parts = NULL;
+	}
+
 	free(install->write_back);
 	free(install->infos);
 }

Index: src/usr.sbin/sysinst/arch/acorn32/md.c
diff -u src/usr.sbin/sysinst/arch/acorn32/md.c:1.5.2.1 src/usr.sbin/sysinst/arch/acorn32/md.c:1.5.2.2
--- src/usr.sbin/sysinst/arch/acorn32/md.c:1.5.2.1	Thu Oct 15 19:36:51 2020
+++ src/usr.sbin/sysinst/arch/acorn32/md.c	Wed Feb  2 04:25:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.1 2020/10/15 19:36:51 bouyer Exp $ */
+/*	$NetBSD: md.c,v 1.5.2.2 2022/02/02 04:25:38 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -249,7 +249,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/alpha/md.c
diff -u src/usr.sbin/sysinst/arch/alpha/md.c:1.6.2.3 src/usr.sbin/sysinst/arch/alpha/md.c:1.6.2.4
--- src/usr.sbin/sysinst/arch/alpha/md.c:1.6.2.3	Thu Oct 15 19:36:54 2020
+++ src/usr.sbin/sysinst/arch/alpha/md.c	Wed Feb  2 04:25:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.6.2.3 2020/10/15 19:36:54 bouyer Exp $ */
+/*	$NetBSD: md.c,v 1.6.2.4 2022/02/02 04:25:36 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -175,7 +175,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/amiga/md.c
diff -u src/usr.sbin/sysinst/arch/amiga/md.c:1.5.2.1 src/usr.sbin/sysinst/arch/amiga/md.c:1.5.2.2
--- src/usr.sbin/sysinst/arch/amiga/md.c:1.5.2.1	Thu Oct 15 19:36:54 2020
+++ src/usr.sbin/sysinst/arch/amiga/md.c	Wed Feb  2 04:25:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.1 2020/10/15 19:36:54 bouyer Exp $ */
+/*	$NetBSD: md.c,v 1.5.2.2 2022/02/02 04:25:38 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -115,7 +115,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/arc/md.c
diff -u src/usr.sbin/sysinst/arch/arc/md.c:1.8.2.4 src/usr.sbin/sysinst/arch/arc/md.c:1.8.2.5
--- src/usr.sbin/sysinst/arch/arc/md.c:1.8.2.4	Thu Oct 15 19:36:51 2020
+++ src/usr.sbin/sysinst/arch/arc/md.c	Wed Feb  2 04:25:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.8.2.4 2020/10/15 19:36:51 bouyer Exp $ */
+/*	$NetBSD: md.c,v 1.8.2.5 2022/02/02 04:25:37 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -188,7 +188,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/atari/md.c
diff -u src/usr.sbin/sysinst/arch/atari/md.c:1.6.2.1 src/usr.sbin/sysinst/arch/atari/md.c:1.6.2.2
--- src/usr.sbin/sysinst/arch/atari/md.c:1.6.2.1	Thu Oct 15 19:36:55 2020
+++ src/usr.sbin/sysinst/arch/atari/md.c	Wed Feb  2 04:25:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.6.2.1 2020/10/15 19:36:55 bouyer Exp $ */
+/*	$NetBSD: md.c,v 1.6.2.2 2022/02/02 04:25:38 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -144,7 +144,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/bebox/md.c
diff -u src/usr.sbin/sysinst/arch/bebox/md.c:1.5.2.3 src/usr.sbin/sysinst/arch/bebox/md.c:1.5.2.4
--- src/usr.sbin/sysinst/arch/bebox/md.c:1.5.2.3	Thu Oct 15 19:36:55 2020
+++ src/usr.sbin/sysinst/arch/bebox/md.c	Wed Feb  2 04:25:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.3 2020/10/15 19:36:55 bouyer Exp $ */
+/*	$NetBSD: md.c,v 1.5.2.4 2022/02/02 04:25:40 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -160,7 +160,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/cats/md.c
diff -u src/usr.sbin/sysinst/arch/cats/md.c:1.4.2.1 src/usr.sbin/sysinst/arch/cats/md.c:1.4.2.2
--- src/usr.sbin/sysinst/arch/cats/md.c:1.4.2.1	Thu Oct 15 19:36:54 2020
+++ src/usr.sbin/sysinst/arch/cats/md.c	Wed Feb  2 04:25:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.4.2.1 2020/10/15 19:36:54 bouyer Exp $ */
+/*	$NetBSD: md.c,v 1.4.2.2 2022/02/02 04:25:38 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -170,7 +170,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/cobalt/md.c
diff -u src/usr.sbin/sysinst/arch/cobalt/md.c:1.8.2.4 src/usr.sbin/sysinst/arch/cobalt/md.c:1.8.2.5
--- src/usr.sbin/sysinst/arch/cobalt/md.c:1.8.2.4	Thu Oct 15 19:36:51 2020
+++ src/usr.sbin/sysinst/arch/cobalt/md.c	Wed Feb  2 04:25:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.8.2.4 2020/10/15 19:36:51 bouyer Exp $ */
+/*	$NetBSD: md.c,v 1.8.2.5 2022/02/02 04:25:36 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -205,7 +205,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/dummy/md.c
diff -u src/usr.sbin/sysinst/arch/dummy/md.c:1.5.2.1 src/usr.sbin/sysinst/arch/dummy/md.c:1.5.2.2
--- src/usr.sbin/sysinst/arch/dummy/md.c:1.5.2.1	Thu Oct 15 19:36:51 2020
+++ src/usr.sbin/sysinst/arch/dummy/md.c	Wed Feb  2 04:25:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.1 2020/10/15 19:36:51 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.5.2.2 2022/02/02 04:25:38 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -94,7 +94,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/emips/md.c
diff -u src/usr.sbin/sysinst/arch/emips/md.c:1.7.2.2 src/usr.sbin/sysinst/arch/emips/md.c:1.7.2.3
--- src/usr.sbin/sysinst/arch/emips/md.c:1.7.2.2	Thu Oct 15 19:36:55 2020
+++ src/usr.sbin/sysinst/arch/emips/md.c	Wed Feb  2 04:25:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.7.2.2 2020/10/15 19:36:55 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.7.2.3 2022/02/02 04:25:36 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -162,7 +162,7 @@ md_post_newfs(struct install_partition_d
  * On emips, we take this opportunity to update the boot loader.
  */
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	char ldr_path[STRSIZE];
 

Index: src/usr.sbin/sysinst/arch/evbarm/md.c
diff -u src/usr.sbin/sysinst/arch/evbarm/md.c:1.8.2.7 src/usr.sbin/sysinst/arch/evbarm/md.c:1.8.2.8
--- src/usr.sbin/sysinst/arch/evbarm/md.c:1.8.2.7	Wed May 12 06:53:55 2021
+++ src/usr.sbin/sysinst/arch/evbarm/md.c	Wed Feb  2 04:25:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.8.2.7 2021/05/12 06:53:55 msaitoh Exp $ */
+/*	$NetBSD: md.c,v 1.8.2.8 2022/02/02 04:25:40 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -270,7 +270,7 @@ evbarm_extract_finalize(int update)
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 
 	return 0;

Index: src/usr.sbin/sysinst/arch/evbmips/md.c
diff -u src/usr.sbin/sysinst/arch/evbmips/md.c:1.5.2.3 src/usr.sbin/sysinst/arch/evbmips/md.c:1.5.2.4
--- src/usr.sbin/sysinst/arch/evbmips/md.c:1.5.2.3	Thu Oct 15 19:36:53 2020
+++ src/usr.sbin/sysinst/arch/evbmips/md.c	Wed Feb  2 04:25:40 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.5.2.3 2020/10/15 19:36:53 bouyer Exp $ */
+/* $NetBSD: md.c,v 1.5.2.4 2022/02/02 04:25:40 msaitoh Exp $ */
 
 /*
  * Copyright 1997,2002 Piermont Information Systems Inc.
@@ -160,7 +160,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/evbppc/md.c
diff -u src/usr.sbin/sysinst/arch/evbppc/md.c:1.5.2.3 src/usr.sbin/sysinst/arch/evbppc/md.c:1.5.2.4
--- src/usr.sbin/sysinst/arch/evbppc/md.c:1.5.2.3	Thu Oct 15 19:36:53 2020
+++ src/usr.sbin/sysinst/arch/evbppc/md.c	Wed Feb  2 04:25:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.3 2020/10/15 19:36:53 bouyer Exp $ */
+/*	$NetBSD: md.c,v 1.5.2.4 2022/02/02 04:25:39 msaitoh Exp $ */
 
 /*
  * Copyright 1997,2002 Piermont Information Systems Inc.
@@ -161,7 +161,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/evbsh3/md.c
diff -u src/usr.sbin/sysinst/arch/evbsh3/md.c:1.5.2.1 src/usr.sbin/sysinst/arch/evbsh3/md.c:1.5.2.2
--- src/usr.sbin/sysinst/arch/evbsh3/md.c:1.5.2.1	Thu Oct 15 19:36:52 2020
+++ src/usr.sbin/sysinst/arch/evbsh3/md.c	Wed Feb  2 04:25:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.1 2020/10/15 19:36:52 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.5.2.2 2022/02/02 04:25:40 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -182,7 +182,7 @@ md_init_set_status(int flags)
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/ews4800mips/md.c
diff -u src/usr.sbin/sysinst/arch/ews4800mips/md.c:1.4.2.2 src/usr.sbin/sysinst/arch/ews4800mips/md.c:1.4.2.3
--- src/usr.sbin/sysinst/arch/ews4800mips/md.c:1.4.2.2	Thu Oct 15 19:36:55 2020
+++ src/usr.sbin/sysinst/arch/ews4800mips/md.c	Wed Feb  2 04:25:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.4.2.2 2020/10/15 19:36:55 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.4.2.3 2022/02/02 04:25:39 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -183,7 +183,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/hp300/md.c
diff -u src/usr.sbin/sysinst/arch/hp300/md.c:1.8.2.3 src/usr.sbin/sysinst/arch/hp300/md.c:1.8.2.4
--- src/usr.sbin/sysinst/arch/hp300/md.c:1.8.2.3	Thu Oct 15 19:36:51 2020
+++ src/usr.sbin/sysinst/arch/hp300/md.c	Wed Feb  2 04:25:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.8.2.3 2020/10/15 19:36:51 bouyer Exp $ */
+/*	$NetBSD: md.c,v 1.8.2.4 2022/02/02 04:25:37 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -203,7 +203,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/hpcarm/md.c
diff -u src/usr.sbin/sysinst/arch/hpcarm/md.c:1.5.2.3 src/usr.sbin/sysinst/arch/hpcarm/md.c:1.5.2.4
--- src/usr.sbin/sysinst/arch/hpcarm/md.c:1.5.2.3	Thu Oct 15 19:36:54 2020
+++ src/usr.sbin/sysinst/arch/hpcarm/md.c	Wed Feb  2 04:25:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.3 2020/10/15 19:36:54 bouyer Exp $ */
+/*	$NetBSD: md.c,v 1.5.2.4 2022/02/02 04:25:40 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -230,7 +230,7 @@ out:
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/hpcmips/md.c
diff -u src/usr.sbin/sysinst/arch/hpcmips/md.c:1.5.2.3 src/usr.sbin/sysinst/arch/hpcmips/md.c:1.5.2.4
--- src/usr.sbin/sysinst/arch/hpcmips/md.c:1.5.2.3	Thu Oct 15 19:36:54 2020
+++ src/usr.sbin/sysinst/arch/hpcmips/md.c	Wed Feb  2 04:25:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.3 2020/10/15 19:36:54 bouyer Exp $ */
+/*	$NetBSD: md.c,v 1.5.2.4 2022/02/02 04:25:37 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -193,7 +193,7 @@ md_update(struct install_partition_desc 
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/hpcsh/md.c
diff -u src/usr.sbin/sysinst/arch/hpcsh/md.c:1.6.2.3 src/usr.sbin/sysinst/arch/hpcsh/md.c:1.6.2.4
--- src/usr.sbin/sysinst/arch/hpcsh/md.c:1.6.2.3	Thu Oct 15 19:36:53 2020
+++ src/usr.sbin/sysinst/arch/hpcsh/md.c	Wed Feb  2 04:25:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.6.2.3 2020/10/15 19:36:53 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.6.2.4 2022/02/02 04:25:36 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -192,7 +192,7 @@ md_update(struct install_partition_desc 
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 
 	return 0;

Index: src/usr.sbin/sysinst/arch/hppa/md.c
diff -u src/usr.sbin/sysinst/arch/hppa/md.c:1.7.2.1 src/usr.sbin/sysinst/arch/hppa/md.c:1.7.2.2
--- src/usr.sbin/sysinst/arch/hppa/md.c:1.7.2.1	Thu Oct 15 19:36:55 2020
+++ src/usr.sbin/sysinst/arch/hppa/md.c	Wed Feb  2 04:25:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.7.2.1 2020/10/15 19:36:55 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.7.2.2 2022/02/02 04:25:39 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -194,7 +194,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/i386/md.c
diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.20.2.8 src/usr.sbin/sysinst/arch/i386/md.c:1.20.2.9
--- src/usr.sbin/sysinst/arch/i386/md.c:1.20.2.8	Wed Nov  4 13:31:23 2020
+++ src/usr.sbin/sysinst/arch/i386/md.c	Wed Feb  2 04:25:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.20.2.8 2020/11/04 13:31:23 sborrill Exp $ */
+/*	$NetBSD: md.c,v 1.20.2.9 2022/02/02 04:25:37 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -233,12 +233,12 @@ md_post_disklabel(struct install_partiti
  * Do all legacy bootblock update/setup here
  */
 static int
-md_post_newfs_bios(struct install_partition_desc *install)
+update_bios_boot(struct install_partition_desc *install, bool use_target_files)
 {
 	int ret;
 	size_t len;
 	char boot_options[1024];
-	char *bootxx_filename;
+	char *bootxx_filename, *p;
 	/*
 	 * XXX - this code retains a lot of cruft from when we went
 	 * to great pains to exclude installboot from the ramdisk
@@ -282,13 +282,22 @@ md_post_newfs_bios(struct install_partit
 			return 0;
 	}
 
-	ret = cp_to_target("/usr/mdec/boot", "/boot");
+	if (use_target_files)
+		ret = cp_within_target("/usr/mdec/boot", "/", 0);
+	else
+		ret = cp_to_target("/usr/mdec/boot", "/");
 	if (ret)
 		return ret;
 	if (pm && pm->no_part)
 		return 0;
 
-        bootxx_filename = bootxx_name(install);
+	p = bootxx_name(install);
+	if (p && use_target_files) {
+		bootxx_filename = strdup(target_expand(p));
+		free(p);
+	} else {
+	        bootxx_filename = p;
+	}
         if (bootxx_filename != NULL) {
 		char rdev[PATH_MAX];
 
@@ -314,6 +323,12 @@ md_post_newfs_bios(struct install_partit
 	return ret;
 }
 
+static int
+md_post_newfs_bios(struct install_partition_desc *install)
+{
+	return update_bios_boot(install, false);
+}
+
 /*
  * Make sure our bootloader(s) are in the proper directory in the boot
  * boot partition (or update them).
@@ -321,7 +336,7 @@ md_post_newfs_bios(struct install_partit
 static int
 copy_uefi_boot(const struct part_usage_info *boot)
 {
-	char dev[MAXPATHLEN], path[MAXPATHLEN];
+	char dev[MAXPATHLEN], path[MAXPATHLEN], src[MAXPATHLEN];
 	size_t i;
 	int err;
 
@@ -349,9 +364,10 @@ copy_uefi_boot(const struct part_usage_i
 	make_target_dir(path);
 
 	for (i = 0; i < __arraycount(uefi_bootloaders); i++) {
-		if (access(uefi_bootloaders[i], R_OK) != 0)
+		strcpy(src, target_expand(uefi_bootloaders[i]));
+		if (access(src, R_OK) != 0)
 			continue;
-		err = cp_to_target(uefi_bootloaders[i], path);
+		err = cp_within_target(uefi_bootloaders[i], path, 0);
 		if (err)
 			return err;
 	}
@@ -363,19 +379,59 @@ copy_uefi_boot(const struct part_usage_i
  * Find (U)EFI boot partition and install/update bootloaders
  */
 static int
-md_post_newfs_uefi(struct install_partition_desc *install)
+update_uefi_boot_code(struct install_partition_desc *install)
 {
-	size_t i;
+	size_t i, boot_part;
 
+	boot_part = ~0U;
 	for (i = 0; i < install->num; i++) {
 		if (!(install->infos[i].instflags & PUIINST_BOOT))
 			continue;
-
-		return copy_uefi_boot(&install->infos[i]);
+		boot_part = i;
+		break;
+	}
+	if (boot_part == ~0U) {
+		/*
+		 * Didn't find an explicitly marked boot partition,
+		 * check if we have any EFI System Partitions and
+		 * use the first.
+		 */
+		for (i = 0; i < install->num; i++) {
+			if (install->infos[i].type != PT_EFI_SYSTEM)
+				continue;
+			boot_part = i;
+			break;
+		}
 	}
 
+	if (boot_part < install->num)
+		return copy_uefi_boot(&install->infos[boot_part]);
+
 	return -1;	/* no EFI boot partition found */
 }
+ 
+/*
+ * Find bootloader options and update bootloader
+ */
+static int
+update_bios_boot_code(struct install_partition_desc *install)
+{
+	return update_bios_boot(install, true);
+}
+
+static int
+update_boot_code(struct install_partition_desc *install)
+{
+	return uefi_boot ?
+	    update_uefi_boot_code(install)
+	    : update_bios_boot_code(install);
+}
+
+static int
+md_post_newfs_uefi(struct install_partition_desc *install)
+{
+	return update_uefi_boot_code(install);
+}
 
 /*
  * hook called after upgrade() or install() has finished setting
@@ -391,8 +447,11 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
+	if (upgrade)
+		update_boot_code(install);
+
 #if defined(__amd64__)
 	if (get_kernel_set() == SET_KERNEL_2) {
 		int ret;
@@ -402,6 +461,7 @@ md_post_extract(struct install_partition
 			return ret;
 	}
 #endif
+
 	return 0;
 }
 
@@ -461,7 +521,6 @@ md_pre_update(struct install_partition_d
 int
 md_update(struct install_partition_desc *install)
 {
-	md_post_newfs(install);
 	return 1;
 }
 

Index: src/usr.sbin/sysinst/arch/landisk/md.c
diff -u src/usr.sbin/sysinst/arch/landisk/md.c:1.10.2.3 src/usr.sbin/sysinst/arch/landisk/md.c:1.10.2.4
--- src/usr.sbin/sysinst/arch/landisk/md.c:1.10.2.3	Thu Oct 15 19:36:53 2020
+++ src/usr.sbin/sysinst/arch/landisk/md.c	Wed Feb  2 04:25:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.10.2.3 2020/10/15 19:36:53 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.10.2.4 2022/02/02 04:25:39 msaitoh Exp $	*/
 
 /*
  * Copyright 1997,2002 Piermont Information Systems Inc.
@@ -179,7 +179,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/luna68k/md.c
diff -u src/usr.sbin/sysinst/arch/luna68k/md.c:1.7.2.2 src/usr.sbin/sysinst/arch/luna68k/md.c:1.7.2.3
--- src/usr.sbin/sysinst/arch/luna68k/md.c:1.7.2.2	Thu Oct 15 19:36:52 2020
+++ src/usr.sbin/sysinst/arch/luna68k/md.c	Wed Feb  2 04:25:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.7.2.2 2020/10/15 19:36:52 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.7.2.3 2022/02/02 04:25:37 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -208,7 +208,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 
 	return 0;

Index: src/usr.sbin/sysinst/arch/mac68k/md.c
diff -u src/usr.sbin/sysinst/arch/mac68k/md.c:1.8.2.2 src/usr.sbin/sysinst/arch/mac68k/md.c:1.8.2.3
--- src/usr.sbin/sysinst/arch/mac68k/md.c:1.8.2.2	Thu Oct 15 19:36:51 2020
+++ src/usr.sbin/sysinst/arch/mac68k/md.c	Wed Feb  2 04:25:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.8.2.2 2020/10/15 19:36:51 bouyer Exp $ */
+/*	$NetBSD: md.c,v 1.8.2.3 2022/02/02 04:25:37 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -528,7 +528,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/macppc/md.c
diff -u src/usr.sbin/sysinst/arch/macppc/md.c:1.5.2.1 src/usr.sbin/sysinst/arch/macppc/md.c:1.5.2.2
--- src/usr.sbin/sysinst/arch/macppc/md.c:1.5.2.1	Thu Oct 15 19:36:55 2020
+++ src/usr.sbin/sysinst/arch/macppc/md.c	Wed Feb  2 04:25:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.1 2020/10/15 19:36:55 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.5.2.2 2022/02/02 04:25:39 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -185,7 +185,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/mipsco/md.c
diff -u src/usr.sbin/sysinst/arch/mipsco/md.c:1.6.2.2 src/usr.sbin/sysinst/arch/mipsco/md.c:1.6.2.3
--- src/usr.sbin/sysinst/arch/mipsco/md.c:1.6.2.2	Thu Oct 15 19:36:54 2020
+++ src/usr.sbin/sysinst/arch/mipsco/md.c	Wed Feb  2 04:25:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.6.2.2 2020/10/15 19:36:54 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.6.2.3 2022/02/02 04:25:39 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -178,7 +178,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/mvme68k/md.c
diff -u src/usr.sbin/sysinst/arch/mvme68k/md.c:1.8.2.3 src/usr.sbin/sysinst/arch/mvme68k/md.c:1.8.2.4
--- src/usr.sbin/sysinst/arch/mvme68k/md.c:1.8.2.3	Thu Oct 15 19:36:54 2020
+++ src/usr.sbin/sysinst/arch/mvme68k/md.c	Wed Feb  2 04:25:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.8.2.3 2020/10/15 19:36:54 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.8.2.4 2022/02/02 04:25:37 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -206,7 +206,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/news68k/md.c
diff -u src/usr.sbin/sysinst/arch/news68k/md.c:1.6.2.1 src/usr.sbin/sysinst/arch/news68k/md.c:1.6.2.2
--- src/usr.sbin/sysinst/arch/news68k/md.c:1.6.2.1	Thu Oct 15 19:36:55 2020
+++ src/usr.sbin/sysinst/arch/news68k/md.c	Wed Feb  2 04:25:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.6.2.1 2020/10/15 19:36:55 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.6.2.2 2022/02/02 04:25:40 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -164,7 +164,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 
 	return 0;

Index: src/usr.sbin/sysinst/arch/newsmips/md.c
diff -u src/usr.sbin/sysinst/arch/newsmips/md.c:1.5.2.1 src/usr.sbin/sysinst/arch/newsmips/md.c:1.5.2.2
--- src/usr.sbin/sysinst/arch/newsmips/md.c:1.5.2.1	Thu Oct 15 19:36:54 2020
+++ src/usr.sbin/sysinst/arch/newsmips/md.c	Wed Feb  2 04:25:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.1 2020/10/15 19:36:54 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.5.2.2 2022/02/02 04:25:39 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -160,7 +160,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/ofppc/md.c
diff -u src/usr.sbin/sysinst/arch/ofppc/md.c:1.7.2.3 src/usr.sbin/sysinst/arch/ofppc/md.c:1.7.2.4
--- src/usr.sbin/sysinst/arch/ofppc/md.c:1.7.2.3	Thu Oct 15 19:36:53 2020
+++ src/usr.sbin/sysinst/arch/ofppc/md.c	Wed Feb  2 04:25:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.7.2.3 2020/10/15 19:36:53 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.7.2.4 2022/02/02 04:25:39 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -425,7 +425,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	char bootdev[100], bootbdev[100], version[64];
 	struct disk_partitions *parts;

Index: src/usr.sbin/sysinst/arch/playstation2/md.c
diff -u src/usr.sbin/sysinst/arch/playstation2/md.c:1.5.2.3 src/usr.sbin/sysinst/arch/playstation2/md.c:1.5.2.4
--- src/usr.sbin/sysinst/arch/playstation2/md.c:1.5.2.3	Thu Oct 15 19:36:53 2020
+++ src/usr.sbin/sysinst/arch/playstation2/md.c	Wed Feb  2 04:25:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.3 2020/10/15 19:36:53 bouyer Exp $ */
+/*	$NetBSD: md.c,v 1.5.2.4 2022/02/02 04:25:40 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -185,7 +185,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/pmax/md.c
diff -u src/usr.sbin/sysinst/arch/pmax/md.c:1.6.2.2 src/usr.sbin/sysinst/arch/pmax/md.c:1.6.2.3
--- src/usr.sbin/sysinst/arch/pmax/md.c:1.6.2.2	Thu Oct 15 19:36:54 2020
+++ src/usr.sbin/sysinst/arch/pmax/md.c	Wed Feb  2 04:25:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.6.2.2 2020/10/15 19:36:54 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.6.2.3 2022/02/02 04:25:38 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -186,7 +186,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/prep/md.c
diff -u src/usr.sbin/sysinst/arch/prep/md.c:1.8.2.4 src/usr.sbin/sysinst/arch/prep/md.c:1.8.2.5
--- src/usr.sbin/sysinst/arch/prep/md.c:1.8.2.4	Thu Oct 15 19:36:55 2020
+++ src/usr.sbin/sysinst/arch/prep/md.c	Wed Feb  2 04:25:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.8.2.4 2020/10/15 19:36:55 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.8.2.5 2022/02/02 04:25:39 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -179,7 +179,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	char rawdev[100], bootpart[100], bootloader[100];
 	int contype;

Index: src/usr.sbin/sysinst/arch/sandpoint/md.c
diff -u src/usr.sbin/sysinst/arch/sandpoint/md.c:1.5.2.3 src/usr.sbin/sysinst/arch/sandpoint/md.c:1.5.2.4
--- src/usr.sbin/sysinst/arch/sandpoint/md.c:1.5.2.3	Thu Oct 15 19:36:52 2020
+++ src/usr.sbin/sysinst/arch/sandpoint/md.c	Wed Feb  2 04:25:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.3 2020/10/15 19:36:52 bouyer Exp $ */
+/*	$NetBSD: md.c,v 1.5.2.4 2022/02/02 04:25:37 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -195,7 +195,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/sgimips/md.c
diff -u src/usr.sbin/sysinst/arch/sgimips/md.c:1.8.2.1 src/usr.sbin/sysinst/arch/sgimips/md.c:1.8.2.2
--- src/usr.sbin/sysinst/arch/sgimips/md.c:1.8.2.1	Thu Oct 15 19:36:53 2020
+++ src/usr.sbin/sysinst/arch/sgimips/md.c	Wed Feb  2 04:25:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.8.2.1 2020/10/15 19:36:53 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.8.2.2 2022/02/02 04:25:38 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -191,7 +191,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/shark/md.c
diff -u src/usr.sbin/sysinst/arch/shark/md.c:1.5.2.1 src/usr.sbin/sysinst/arch/shark/md.c:1.5.2.2
--- src/usr.sbin/sysinst/arch/shark/md.c:1.5.2.1	Thu Oct 15 19:36:53 2020
+++ src/usr.sbin/sysinst/arch/shark/md.c	Wed Feb  2 04:25:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.1 2020/10/15 19:36:53 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.5.2.2 2022/02/02 04:25:38 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -161,7 +161,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	msg_display(MSG_setbootdevice);
 	process_menu(MENU_ok, NULL);

Index: src/usr.sbin/sysinst/arch/sparc/md.c
diff -u src/usr.sbin/sysinst/arch/sparc/md.c:1.5.2.1 src/usr.sbin/sysinst/arch/sparc/md.c:1.5.2.2
--- src/usr.sbin/sysinst/arch/sparc/md.c:1.5.2.1	Thu Oct 15 19:36:52 2020
+++ src/usr.sbin/sysinst/arch/sparc/md.c	Wed Feb  2 04:25:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.1 2020/10/15 19:36:52 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.5.2.2 2022/02/02 04:25:40 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -127,7 +127,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/sparc64/md.c
diff -u src/usr.sbin/sysinst/arch/sparc64/md.c:1.5.2.1 src/usr.sbin/sysinst/arch/sparc64/md.c:1.5.2.2
--- src/usr.sbin/sysinst/arch/sparc64/md.c:1.5.2.1	Thu Oct 15 19:36:53 2020
+++ src/usr.sbin/sysinst/arch/sparc64/md.c	Wed Feb  2 04:25:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.1 2020/10/15 19:36:53 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.5.2.2 2022/02/02 04:25:36 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -123,7 +123,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/vax/md.c
diff -u src/usr.sbin/sysinst/arch/vax/md.c:1.6.2.1 src/usr.sbin/sysinst/arch/vax/md.c:1.6.2.2
--- src/usr.sbin/sysinst/arch/vax/md.c:1.6.2.1	Thu Oct 15 19:36:52 2020
+++ src/usr.sbin/sysinst/arch/vax/md.c	Wed Feb  2 04:25:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.6.2.1 2020/10/15 19:36:52 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.6.2.2 2022/02/02 04:25:37 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -164,7 +164,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/x68k/md.c
diff -u src/usr.sbin/sysinst/arch/x68k/md.c:1.8.2.3 src/usr.sbin/sysinst/arch/x68k/md.c:1.8.2.4
--- src/usr.sbin/sysinst/arch/x68k/md.c:1.8.2.3	Thu Oct 15 19:36:52 2020
+++ src/usr.sbin/sysinst/arch/x68k/md.c	Wed Feb  2 04:25:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.8.2.3 2020/10/15 19:36:52 bouyer Exp $ */
+/*	$NetBSD: md.c,v 1.8.2.4 2022/02/02 04:25:36 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -292,7 +292,7 @@ md_post_newfs(struct install_partition_d
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Index: src/usr.sbin/sysinst/arch/zaurus/md.c
diff -u src/usr.sbin/sysinst/arch/zaurus/md.c:1.5.2.3 src/usr.sbin/sysinst/arch/zaurus/md.c:1.5.2.4
--- src/usr.sbin/sysinst/arch/zaurus/md.c:1.5.2.3	Thu Oct 15 19:36:52 2020
+++ src/usr.sbin/sysinst/arch/zaurus/md.c	Wed Feb  2 04:25:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.3 2020/10/15 19:36:52 bouyer Exp $	*/
+/*	$NetBSD: md.c,v 1.5.2.4 2022/02/02 04:25:40 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -207,7 +207,7 @@ out:
 }
 
 int
-md_post_extract(struct install_partition_desc *install)
+md_post_extract(struct install_partition_desc *install, bool upgrade)
 {
 	return 0;
 }

Reply via email to