Re: CVS commit: src/usr.sbin/sysinst

2020-10-12 Thread Martin Husemann
On Tue, Oct 13, 2020 at 12:15:58AM +0900, Izumi Tsutsui wrote:
> IIRC I added it to avoid users from accidentally destroy existing native
> Windows partition (for NetBSD/arc that initially required FAT partition).

I see. If needed we can add more safety checks when setting the newfs flag
(like we do in other places: silently run fsck_$fs -p) - but the way it was
now caused tricky fallout when the kernel was able to mount the new EFI
boot partition (due to a previous FAT partition starting at the same spot),
but copying the EFI bootloaders failed.

Martin


Re: CVS commit: src/usr.sbin/sysinst

2020-10-12 Thread Izumi Tsutsui
martin@ wrote:

> Module Name:  src
> Committed By: martin
> Date: Mon Oct 12 14:29:41 UTC 2020
> 
> Modified Files:
>   src/usr.sbin/sysinst: disks.c
> 
> Log Message:
> Remove very strange code that special-cased MSDOS file systems and refused
> to newfs the partition (despite explicit request to do so) if it was
> mountable.
> Accidently carried over from a dim and distant past, before we had
> fsck_newfs.

http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/src/distrib/utils/sysinst/Attic/disks.c#rev1.98
http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/src/distrib/utils/sysinst/arch/arc/Attic/md.c#rev1.29

IIRC I added it to avoid users from accidentally destroy existing native
Windows partition (for NetBSD/arc that initially required FAT partition).

---
Izumi Tsutsui


Re: CVS commit: src/usr.sbin/sysinst/arch

2020-02-03 Thread Martin Husemann
On Mon, Feb 03, 2020 at 05:45:29PM -, Christos Zoulas wrote:
> Write a function perhaps instead of open-coding it in 3 places?

I'm more inclined to completely remove it as I think it never can
happen with the current editing frontend and disklabel backend, but
going for minimal changes right now as this needs to go into 9.0 and I
can't test localy.

Martin


Re: CVS commit: src/usr.sbin/sysinst/arch

2020-02-03 Thread Christos Zoulas
In article <20200203130929.9de7df...@cvs.netbsd.org>,
Martin Husemann  wrote:
>-=-=-=-=-=-
>
>Module Name:   src
>Committed By:  martin
>Date:  Mon Feb  3 13:09:29 UTC 2020
>
>Modified Files:
>   src/usr.sbin/sysinst/arch/hp300: md.c
>   src/usr.sbin/sysinst/arch/mvme68k: md.c
>   src/usr.sbin/sysinst/arch/x68k: md.c
>
>Log Message:
>PR install/54921: skip non-user partitions when checking for overlaps

Write a function perhaps instead of open-coding it in 3 places?

christos



CVS commit: src/usr.sbin/sysinst/arch/i386

2019-11-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 18 16:05:55 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/i386: md.c

Log Message:
Fix previous: not a good idea to try to copy files from the not yet
extracted sets.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 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.



CVS commit: src/usr.sbin/sysinst/arch/i386

2019-11-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 18 16:05:55 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/i386: md.c

Log Message:
Fix previous: not a good idea to try to copy files from the not yet
extracted sets.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 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/arch/i386/md.c
diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.25 src/usr.sbin/sysinst/arch/i386/md.c:1.26
--- src/usr.sbin/sysinst/arch/i386/md.c:1.25	Mon Nov 18 08:16:32 2019
+++ src/usr.sbin/sysinst/arch/i386/md.c	Mon Nov 18 16:05:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.25 2019/11/18 08:16:32 martin Exp $ */
+/*	$NetBSD: md.c,v 1.26 2019/11/18 16:05:55 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -376,13 +376,6 @@ md_post_newfs_uefi(struct install_partit
 int
 md_post_newfs(struct install_partition_desc *install)
 {
-#if defined(__amd64__)
-	int ret;
-
-	ret = cp_within_target("/usr/mdec/prekern", "/prekern", 0);
-	if (ret)
-		return ret;
-#endif
 
 	return uefi_boot ? md_post_newfs_uefi(install)
 	: md_post_newfs_bios(install);
@@ -391,6 +384,15 @@ md_post_newfs(struct install_partition_d
 int
 md_post_extract(struct install_partition_desc *install)
 {
+#if defined(__amd64__)
+	if (get_kernel_set() == SET_KERNEL_2) {
+		int ret;
+
+		ret = cp_within_target("/usr/mdec/prekern", "/prekern", 0);
+		if (ret)
+			return ret;
+	}
+#endif
 	return 0;
 }
 



CVS commit: src/usr.sbin/sysinst/arch/i386

2019-11-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 18 08:16:32 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/i386: md.c

Log Message:
Fix previous: the install medium may not have /usr/mdec/prekern; it was
meant to copy the one from the just installed system.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 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.



CVS commit: src/usr.sbin/sysinst/arch/i386

2019-11-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 18 08:16:32 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/i386: md.c

Log Message:
Fix previous: the install medium may not have /usr/mdec/prekern; it was
meant to copy the one from the just installed system.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 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/arch/i386/md.c
diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.24 src/usr.sbin/sysinst/arch/i386/md.c:1.25
--- src/usr.sbin/sysinst/arch/i386/md.c:1.24	Sat Nov 16 21:25:14 2019
+++ src/usr.sbin/sysinst/arch/i386/md.c	Mon Nov 18 08:16:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.24 2019/11/16 21:25:14 martin Exp $ */
+/*	$NetBSD: md.c,v 1.25 2019/11/18 08:16:32 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -379,7 +379,7 @@ md_post_newfs(struct install_partition_d
 #if defined(__amd64__)
 	int ret;
 
-	ret = cp_to_target("/usr/mdec/prekern", "/prekern");
+	ret = cp_within_target("/usr/mdec/prekern", "/prekern", 0);
 	if (ret)
 		return ret;
 #endif



CVS commit: src/usr.sbin/sysinst

2019-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Nov 16 21:25:15 UTC 2019

Modified Files:
src/usr.sbin/sysinst: util.c
src/usr.sbin/sysinst/arch/amd64: md.c md.h
src/usr.sbin/sysinst/arch/i386: md.c msg.md.de msg.md.en msg.md.es
msg.md.fr msg.md.pl

Log Message:
On amd64 support installation with a KASLR kernel, via "custom install"
and selecting the GENERIC_KASLR kernel set.
Setup /prekern and boot.cfg accordingly.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/sysinst/util.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/arch/amd64/md.c
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sysinst/arch/amd64/md.h
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/sysinst/arch/i386/md.c
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/arch/i386/msg.md.de \
src/usr.sbin/sysinst/arch/i386/msg.md.en \
src/usr.sbin/sysinst/arch/i386/msg.md.es \
src/usr.sbin/sysinst/arch/i386/msg.md.fr \
src/usr.sbin/sysinst/arch/i386/msg.md.pl

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/util.c
diff -u src/usr.sbin/sysinst/util.c:1.39 src/usr.sbin/sysinst/util.c:1.40
--- src/usr.sbin/sysinst/util.c:1.39	Sat Nov 16 20:26:59 2019
+++ src/usr.sbin/sysinst/util.c	Sat Nov 16 21:25:14 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.39 2019/11/16 20:26:59 martin Exp $	*/
+/*	$NetBSD: util.c,v 1.40 2019/11/16 21:25:14 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1151,9 +1151,16 @@ get_and_unpack_sets(int update, msg setu
 	"> /tmp/boot.cfg.tmp'");
 mv_within_target_or_die("/tmp/boot.cfg.tmp",
 			"/boot.cfg");
+
 			}
 		}
 
+#ifdef MD_BOOT_CFG_FINALIZE
+		if (target_file_exists_p("/boot.cfg")) {
+			MD_BOOT_CFG_FINALIZE("/boot.cfg");
+		}
+#endif
+
 		/* Save keyboard type */
 		save_kb_encoding();
 

Index: src/usr.sbin/sysinst/arch/amd64/md.c
diff -u src/usr.sbin/sysinst/arch/amd64/md.c:1.1 src/usr.sbin/sysinst/arch/amd64/md.c:1.2
--- src/usr.sbin/sysinst/arch/amd64/md.c:1.1	Sat Jul 26 19:30:44 2014
+++ src/usr.sbin/sysinst/arch/amd64/md.c	Sat Nov 16 21:25:14 2019
@@ -1,5 +1,22 @@
-/*	$NetBSD: md.c,v 1.1 2014/07/26 19:30:44 dholland Exp $ */
+/*	$NetBSD: md.c,v 1.2 2019/11/16 21:25:14 martin Exp $ */
 
 /* md.c -- Machine specific code for amd64 */
 
 #include "../i386/md.c"
+
+void	amd64_md_boot_cfg_finalize(const char *path);
+
+void
+amd64_md_boot_cfg_finalize(const char *path)
+{
+	char buf[MAXPATHLEN];
+
+	if (get_kernel_set() != SET_KERNEL_2)
+		return;
+
+	run_program(RUN_CHROOT|RUN_FATAL,
+	"sh -c 'sed -e \"s:;boot:;pkboot:\" "
+	"< %s > %s.1", path, path);
+	snprintf(buf, sizeof buf, "%s.1", path);
+	mv_within_target_or_die(buf, path);
+}

Index: src/usr.sbin/sysinst/arch/amd64/md.h
diff -u src/usr.sbin/sysinst/arch/amd64/md.h:1.7 src/usr.sbin/sysinst/arch/amd64/md.h:1.8
--- src/usr.sbin/sysinst/arch/amd64/md.h:1.7	Wed Oct  2 11:16:01 2019
+++ src/usr.sbin/sysinst/arch/amd64/md.h	Sat Nov 16 21:25:14 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.7 2019/10/02 11:16:01 maya Exp $	*/
+/*	$NetBSD: md.h,v 1.8 2019/11/16 21:25:14 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -85,6 +85,7 @@
  * from floppy.
  */
 #define SET_KERNEL_1_NAME	"kern-GENERIC"
+#define	SET_KERNEL_2_NAME	"kern-GENERIC_KASLR"
 
 #define SET_KERNEL_GENERIC	SET_KERNEL_1
 
@@ -117,9 +118,13 @@ extern struct mbr_bootsel *mbs;
  */
 void x86_md_part_defaults(struct pm_devs*, struct part_usage_info**,
 size_t *num_usage_infos);
+
 #define MD_PART_DEFAULTS(A,B,C)	x86_md_part_defaults(A,&(B),&(C))
 
 /* no need to install bootblock if installing for UEFI */
 bool x86_md_need_bootblock(struct install_partition_desc *install);
 #define	MD_NEED_BOOTBLOCK(A)	x86_md_need_bootblock(A)
 
+/* post-process boot.cfg for KASLR if that kernel has been selected */
+void amd64_md_boot_cfg_finalize(const char*);
+#define	MD_BOOT_CFG_FINALIZE(P)	amd64_md_boot_cfg_finalize(P)

Index: src/usr.sbin/sysinst/arch/i386/md.c
diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.23 src/usr.sbin/sysinst/arch/i386/md.c:1.24
--- src/usr.sbin/sysinst/arch/i386/md.c:1.23	Sat Nov 16 18:08:36 2019
+++ src/usr.sbin/sysinst/arch/i386/md.c	Sat Nov 16 21:25:14 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.23 2019/11/16 18:08:36 martin Exp $ */
+/*	$NetBSD: md.c,v 1.24 2019/11/16 21:25:14 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -376,6 +376,13 @@ md_post_newfs_uefi(struct install_partit
 int
 md_post_newfs(struct install_partition_desc *install)
 {
+#if defined(__amd64__)
+	int ret;
+
+	ret = cp_to_target("/usr/mdec/prekern", "/prekern");
+	if (ret)
+		return ret;
+#endif
 
 	return uefi_boot ? md_post_newfs_uefi(install)
 	: md_post_newfs_bios(install);
@@ -911,5 +918,3 @@ x86_md_need_bootblock(struct install_par
 
 	return !uefi_boot;
 }
-
-

Index: src/usr.sbin/sysinst/arch/i386/msg.md.de
diff 

CVS commit: src/usr.sbin/sysinst

2019-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Nov 16 21:25:15 UTC 2019

Modified Files:
src/usr.sbin/sysinst: util.c
src/usr.sbin/sysinst/arch/amd64: md.c md.h
src/usr.sbin/sysinst/arch/i386: md.c msg.md.de msg.md.en msg.md.es
msg.md.fr msg.md.pl

Log Message:
On amd64 support installation with a KASLR kernel, via "custom install"
and selecting the GENERIC_KASLR kernel set.
Setup /prekern and boot.cfg accordingly.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/sysinst/util.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/arch/amd64/md.c
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sysinst/arch/amd64/md.h
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/sysinst/arch/i386/md.c
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/arch/i386/msg.md.de \
src/usr.sbin/sysinst/arch/i386/msg.md.en \
src/usr.sbin/sysinst/arch/i386/msg.md.es \
src/usr.sbin/sysinst/arch/i386/msg.md.fr \
src/usr.sbin/sysinst/arch/i386/msg.md.pl

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Nov 16 20:26:59 UTC 2019

Modified Files:
src/usr.sbin/sysinst: configmenu.c disks.c msg.mi.de msg.mi.en
msg.mi.es msg.mi.fr msg.mi.pl net.c partman.c run.c util.c

Log Message:
Make sure all menus have a translatable exit option (or none at all).


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/configmenu.c
cvs rdiff -u -r1.56 -r1.57 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/sysinst/net.c
cvs rdiff -u -r1.43 -r1.44 src/usr.sbin/sysinst/partman.c
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/run.c
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/sysinst/util.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Nov 16 20:26:59 UTC 2019

Modified Files:
src/usr.sbin/sysinst: configmenu.c disks.c msg.mi.de msg.mi.en
msg.mi.es msg.mi.fr msg.mi.pl net.c partman.c run.c util.c

Log Message:
Make sure all menus have a translatable exit option (or none at all).


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/configmenu.c
cvs rdiff -u -r1.56 -r1.57 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/sysinst/net.c
cvs rdiff -u -r1.43 -r1.44 src/usr.sbin/sysinst/partman.c
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/run.c
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/sysinst/util.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/configmenu.c
diff -u src/usr.sbin/sysinst/configmenu.c:1.10 src/usr.sbin/sysinst/configmenu.c:1.11
--- src/usr.sbin/sysinst/configmenu.c:1.10	Tue Jul 23 18:13:40 2019
+++ src/usr.sbin/sysinst/configmenu.c	Sat Nov 16 20:26:59 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: configmenu.c,v 1.10 2019/07/23 18:13:40 martin Exp $ */
+/* $NetBSD: configmenu.c,v 1.11 2019/11/16 20:26:59 martin Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -464,7 +464,7 @@ do_configmenu(struct install_partition_d
 
 	menu_no = new_menu(NULL, me, opts, 0, -4, 0, 70,
 		MC_SCROLL | MC_NOBOX | MC_DFLTEXIT,
-		configmenu_hdr, set_config, NULL, "XXX Help String",
+		configmenu_hdr, set_config, NULL, NULL,
 		MSG_doneconfig);
 
 	process_menu(menu_no, ce);

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.56 src/usr.sbin/sysinst/disks.c:1.57
--- src/usr.sbin/sysinst/disks.c:1.56	Wed Nov 13 18:57:26 2019
+++ src/usr.sbin/sysinst/disks.c	Sat Nov 16 20:26:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.56 2019/11/13 18:57:26 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.57 2019/11/16 20:26:59 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -852,7 +852,7 @@ find_disks(const char *doingwhat, bool a
 			menu_no = new_menu(MSG_Available_disks,
 dsk_menu, i, -1,
  4, 0, 0, MC_SCROLL,
-NULL, NULL, NULL, NULL, NULL);
+NULL, NULL, NULL, NULL, MSG_exit_menu_generic);
 			if (menu_no == -1)
 return -1;
 			msg_fmt_display(MSG_ask_disk, "%s", doingwhat);
@@ -2211,7 +2211,7 @@ add_select_partition(struct selected_par
 	3, 3, 0, 60,
 	MC_SUBMENU | MC_SCROLL | MC_NOCLEAR,
 	NULL, display_single_part, NULL,
-	NULL, NULL);
+	NULL, MSG_exit_menu_generic);
 	if (sel_menu != -1) {
 		struct selected_partition *newsels;
 		struct sel_menu_data data;
@@ -2410,8 +2410,7 @@ select_partitions(struct selected_partit
 	/* loop with menu */
 	update_sel_part_title();
 	m = new_menu(data.title, men, __arraycount(men), 3, 2, 0, 65, MC_SCROLL,
-	post_sel_part, fmt_sel_part_line, NULL, NULL,
-	"Source selection OK, proceed to target selection");
+	post_sel_part, fmt_sel_part_line, NULL, NULL, MSG_clone_src_done);
 	process_menu(m, );
 	free(data.title);
 	if (res->num_sel == 0)

Index: src/usr.sbin/sysinst/msg.mi.de
diff -u src/usr.sbin/sysinst/msg.mi.de:1.17 src/usr.sbin/sysinst/msg.mi.de:1.18
--- src/usr.sbin/sysinst/msg.mi.de:1.17	Tue Nov 12 16:33:14 2019
+++ src/usr.sbin/sysinst/msg.mi.de	Sat Nov 16 20:26:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.de,v 1.17 2019/11/12 16:33:14 martin Exp $	*/
+/*	$NetBSD: msg.mi.de,v 1.18 2019/11/16 20:26:59 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1498,3 +1498,5 @@ message clone_target_end		{Als letzte hi
 message clone_target_hdr
 {Einfügen der duplizierten Partitionen vor:}
 message clone_target_disp		{duplizierte Partition(en)}
+message clone_src_done
+{Quellselektion OK, weiter mit der Zielauswahl}

Index: src/usr.sbin/sysinst/msg.mi.en
diff -u src/usr.sbin/sysinst/msg.mi.en:1.24 src/usr.sbin/sysinst/msg.mi.en:1.25
--- src/usr.sbin/sysinst/msg.mi.en:1.24	Tue Nov 12 16:33:14 2019
+++ src/usr.sbin/sysinst/msg.mi.en	Sat Nov 16 20:26:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.24 2019/11/12 16:33:14 martin Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.25 2019/11/16 20:26:59 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1438,4 +1438,5 @@ message clone_target_end		{Add at end}
 message clone_target_hdr
 {Insert cloned partitions before:}
 message clone_target_disp		{cloned partition(s)}
-
+message clone_src_done
+{Source selection OK, proceed to target selection}

Index: src/usr.sbin/sysinst/msg.mi.es
diff -u src/usr.sbin/sysinst/msg.mi.es:1.18 src/usr.sbin/sysinst/msg.mi.es:1.19
--- src/usr.sbin/sysinst/msg.mi.es:1.18	Tue 

CVS commit: src/usr.sbin/sysinst/arch/i386

2019-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Nov 16 18:08:36 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/i386: md.c

Log Message:
knf style adjustments


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 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.



CVS commit: src/usr.sbin/sysinst/arch/i386

2019-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Nov 16 18:08:59 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/i386: menus.md

Log Message:
Make the bootblock selection menu more sane, pointed out by maxv


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/i386/menus.md

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst/arch/i386

2019-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Nov 16 18:08:59 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/i386: menus.md

Log Message:
Make the bootblock selection menu more sane, pointed out by maxv


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/i386/menus.md

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/arch/i386/menus.md
diff -u src/usr.sbin/sysinst/arch/i386/menus.md:1.2 src/usr.sbin/sysinst/arch/i386/menus.md:1.3
--- src/usr.sbin/sysinst/arch/i386/menus.md:1.2	Thu Jun 20 00:43:56 2019
+++ src/usr.sbin/sysinst/arch/i386/menus.md	Sat Nov 16 18:08:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: menus.md,v 1.2 2019/06/20 00:43:56 christos Exp $	*/
+/*	$NetBSD: menus.md,v 1.3 2019/11/16 18:08:59 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -34,7 +34,8 @@
 
 /* Menu definitions for sysinst. i386 version, machine dependent. */
 
-menu getboottype, title MSG_Bootblocks_selection, y=10, exit, no clear;
+menu getboottype, title MSG_Bootblocks_selection, y=10, exit, no clear,
+	exitstring MSG_Continue;
 	display action { msg_display(MSG_getboottype);
 		switch (((struct x86_boot_params *)arg)->bp_consdev) {
 		default:
@@ -52,7 +53,7 @@ menu getboottype, title MSG_Bootblocks_s
 			msg_display_add(MSG_console_unchanged);
 			break;
 		}};
-	option MSG_Use_normal_bootblocks, action
+	option MSG_Use_normal_bootblocks, exit, action
 	{((struct x86_boot_params *)arg)->bp_consdev = 0; m->cursel = 7;};
 	option MSG_Use_serial_com0, action
 	{((struct x86_boot_params *)arg)->bp_consdev = 1; m->cursel = 5;};
@@ -63,7 +64,7 @@ menu getboottype, title MSG_Bootblocks_s
 	option MSG_Use_serial_com3, action
 	{((struct x86_boot_params *)arg)->bp_consdev = 4; m->cursel = 5;};
 	option MSG_serial_baud_rate, sub menu consolebaud;
-	option MSG_Use_existing_bootblocks, action
+	option MSG_Use_existing_bootblocks, exit, action
 	{((struct x86_boot_params *)arg)->bp_consdev = ~0; m->cursel = 7;};
 
 menu consolebaud, title MSG_serial_baud_rate, x=40, y=13;



CVS commit: src/usr.sbin/sysinst/arch/i386

2019-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Nov 16 18:08:36 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/i386: md.c

Log Message:
knf style adjustments


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 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/arch/i386/md.c
diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.22 src/usr.sbin/sysinst/arch/i386/md.c:1.23
--- src/usr.sbin/sysinst/arch/i386/md.c:1.22	Tue Nov 12 16:33:14 2019
+++ src/usr.sbin/sysinst/arch/i386/md.c	Sat Nov 16 18:08:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.22 2019/11/12 16:33:14 martin Exp $ */
+/*	$NetBSD: md.c,v 1.23 2019/11/16 18:08:36 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -256,11 +256,12 @@ md_post_newfs_bios(struct install_partit
 		 * Too hard to double check, so just 'know' the device numbers.
 		 */
 		len = sizeof condev;
-		if (sysctl(conmib, __arraycount(conmib), , , NULL, 0) != -1
-		&& (condev & ~3) == 0x800) {
+		if (sysctl(conmib, __arraycount(conmib), , , 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 */
+			/* Defaulting the baud rate to that of stdin should
+			   suffice */
 			if (tcgetattr(0, ) != -1)
 boottype.bp_conspeed = t.c_ispeed;
 		}



CVS commit: src/usr.sbin/sysinst/arch/i386

2019-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Nov 16 17:53:02 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/i386: msg.md.de msg.md.en msg.md.es msg.md.fr
msg.md.pl

Log Message:
Fix table of bios geomatries


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/i386/msg.md.de \
src/usr.sbin/sysinst/arch/i386/msg.md.en \
src/usr.sbin/sysinst/arch/i386/msg.md.es \
src/usr.sbin/sysinst/arch/i386/msg.md.fr \
src/usr.sbin/sysinst/arch/i386/msg.md.pl

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst/arch/i386

2019-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Nov 16 17:53:02 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/i386: msg.md.de msg.md.en msg.md.es msg.md.fr
msg.md.pl

Log Message:
Fix table of bios geomatries


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/i386/msg.md.de \
src/usr.sbin/sysinst/arch/i386/msg.md.en \
src/usr.sbin/sysinst/arch/i386/msg.md.es \
src/usr.sbin/sysinst/arch/i386/msg.md.fr \
src/usr.sbin/sysinst/arch/i386/msg.md.pl

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/arch/i386/msg.md.de
diff -u src/usr.sbin/sysinst/arch/i386/msg.md.de:1.2 src/usr.sbin/sysinst/arch/i386/msg.md.de:1.3
--- src/usr.sbin/sysinst/arch/i386/msg.md.de:1.2	Thu Nov 14 19:26:58 2019
+++ src/usr.sbin/sysinst/arch/i386/msg.md.de	Sat Nov 16 17:53:02 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.de,v 1.2 2019/11/14 19:26:58 martin Exp $	*/
+/*	$NetBSD: msg.md.de,v 1.3 2019/11/16 17:53:02 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -82,8 +82,8 @@ message onebiosmatch
 }
 
 message onebiosmatch_header
-{BIOS # Zylinder Köpfe Sektoren Anzahl Sektoren  GB 
---  -  --- --- 
+{BIOS # Zylinder Köpfe Sektoren Anzahl Sektoren   GB 
+--  -  ---  
 }
 
 message onebiosmatch_row
@@ -97,13 +97,13 @@ message Use_one_of_these_disks
 {Benutzen Sie eine dieser Festplatten}
 
 message biosmultmatch
-{Diese Festplatte entspricht der folgenden BIOS Disk:
+{Diese Festplatte entspricht den folgenden BIOS Disks:
 
 }
 
 message biosmultmatch_header
-{   BIOS # Zylinder Köpfe Sektoren Anzahl Sektoren  GB 
-   --  -  --- --- 
+{   BIOS # Zylinder Köpfe Sektoren  Anzahl Sektoren   GB 
+   --  -    
 }
 
 message biosmultmatch_row
Index: src/usr.sbin/sysinst/arch/i386/msg.md.en
diff -u src/usr.sbin/sysinst/arch/i386/msg.md.en:1.2 src/usr.sbin/sysinst/arch/i386/msg.md.en:1.3
--- src/usr.sbin/sysinst/arch/i386/msg.md.en:1.2	Thu Nov 14 19:26:58 2019
+++ src/usr.sbin/sysinst/arch/i386/msg.md.en	Sat Nov 16 17:53:02 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.en,v 1.2 2019/11/14 19:26:58 martin Exp $	*/
+/*	$NetBSD: msg.md.en,v 1.3 2019/11/16 17:53:02 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -82,8 +82,8 @@ message onebiosmatch
 }
 
 message onebiosmatch_header
-{BIOS # cylinders heads sectors total sectors  GB 
--- - - --- - --- 
+{BIOS # cylinders heads sectors total sectors   GB 
+-- - - --- -  
 }
 
 message onebiosmatch_row
Index: src/usr.sbin/sysinst/arch/i386/msg.md.es
diff -u src/usr.sbin/sysinst/arch/i386/msg.md.es:1.2 src/usr.sbin/sysinst/arch/i386/msg.md.es:1.3
--- src/usr.sbin/sysinst/arch/i386/msg.md.es:1.2	Thu Nov 14 19:26:58 2019
+++ src/usr.sbin/sysinst/arch/i386/msg.md.es	Sat Nov 16 17:53:02 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.es,v 1.2 2019/11/14 19:26:58 martin Exp $	*/
+/*	$NetBSD: msg.md.es,v 1.3 2019/11/16 17:53:02 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -82,8 +82,8 @@ message onebiosmatch
 }
 
 message onebiosmatch_header
-{BIOS # cilindros cabez sectors sect. totales GB 
--- - - --- - --- 
+{BIOS # cilindros cabez sectors sect. totales   GB 
+-- - - --- -  
 }
 
 message onebiosmatch_row
@@ -102,7 +102,7 @@ message biosmultmatch
 }
 
 message biosmultmatch_header
-{   BIOS # cilindros cabez sectors sect totales  GB 
+{   BIOS # cilindros cabez sectors  sect totales   GB 
-- - - --- -  
 }
 
Index: src/usr.sbin/sysinst/arch/i386/msg.md.fr
diff -u src/usr.sbin/sysinst/arch/i386/msg.md.fr:1.2 src/usr.sbin/sysinst/arch/i386/msg.md.fr:1.3
--- src/usr.sbin/sysinst/arch/i386/msg.md.fr:1.2	Thu Nov 14 19:26:58 2019
+++ src/usr.sbin/sysinst/arch/i386/msg.md.fr	Sat Nov 16 17:53:02 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.fr,v 1.2 2019/11/14 19:26:58 martin Exp $	*/
+/*	$NetBSD: msg.md.fr,v 1.3 2019/11/16 17:53:02 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -82,8 +82,8 @@ message onebiosmatch
 }
 
 message onebiosmatch_header
-{BIOS # cylindres têtes secteurs nb total de secteurs  GB 
--- - -   --- 
+{BIOS # cylindres têtes secteurs nb total de secteurs   GB 
+-- - -    
 }
 
 message onebiosmatch_row	/* XXX adjust for length of titles above */
@@ -102,8 +102,8 @@ message biosmultmatch
 }
 
 message biosmultmatch_header
-{   BIOS # cylindres têtes secteurs nb total de secteurs  GB 
-   -- - -   --- 
+{   BIOS # cylindres têtes secteurs nb 

CVS commit: src/usr.sbin/sysinst

2019-11-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Nov 16 15:50:46 UTC 2019

Modified Files:
src/usr.sbin/sysinst: part_edit.c

Log Message:
Drop unused variable.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/part_edit.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/part_edit.c
diff -u src/usr.sbin/sysinst/part_edit.c:1.12 src/usr.sbin/sysinst/part_edit.c:1.13
--- src/usr.sbin/sysinst/part_edit.c:1.12	Wed Nov 13 18:57:26 2019
+++ src/usr.sbin/sysinst/part_edit.c	Sat Nov 16 15:50:45 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: part_edit.c,v 1.12 2019/11/13 18:57:26 martin Exp $ */
+/*	$NetBSD: part_edit.c,v 1.13 2019/11/16 15:50:45 joerg Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -462,7 +462,7 @@ add_part_clone(menudesc *menu, void *arg
 	struct disk_partitions *csrc;
 	struct disk_part_free_space space;
 	daddr_t offset, align;
-	size_t s, clone_cnt;
+	size_t s;
 	part_id cid;
 	struct selected_partitions selected;
 	struct single_clone_data *new_clones;
@@ -543,7 +543,6 @@ add_part_clone(menudesc *menu, void *arg
 		if (cid == NO_PART)
 			continue;
 		parts->pscheme->get_part_info(parts, cid, );
-			clone_cnt++;
 		offset = rounddown(cinfo.start+cinfo.size+align, align);
 	}
 



CVS commit: src/usr.sbin/sysinst

2019-11-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Nov 16 15:50:46 UTC 2019

Modified Files:
src/usr.sbin/sysinst: part_edit.c

Log Message:
Drop unused variable.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/part_edit.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst/arch

2019-11-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov 14 19:26:58 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/i386: msg.md.de msg.md.en msg.md.es msg.md.fr
msg.md.pl
src/usr.sbin/sysinst/arch/playstation2: msg.md.de msg.md.en msg.md.es
msg.md.fr msg.md.pl

Log Message:
Fix missing newlines in bios match display, pointed out by maxv.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/arch/i386/msg.md.de \
src/usr.sbin/sysinst/arch/i386/msg.md.en \
src/usr.sbin/sysinst/arch/i386/msg.md.es \
src/usr.sbin/sysinst/arch/i386/msg.md.fr \
src/usr.sbin/sysinst/arch/i386/msg.md.pl
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/playstation2/msg.md.de \
src/usr.sbin/sysinst/arch/playstation2/msg.md.en \
src/usr.sbin/sysinst/arch/playstation2/msg.md.es \
src/usr.sbin/sysinst/arch/playstation2/msg.md.fr \
src/usr.sbin/sysinst/arch/playstation2/msg.md.pl

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/arch/i386/msg.md.de
diff -u src/usr.sbin/sysinst/arch/i386/msg.md.de:1.1 src/usr.sbin/sysinst/arch/i386/msg.md.de:1.2
--- src/usr.sbin/sysinst/arch/i386/msg.md.de:1.1	Sat Jul 26 19:30:45 2014
+++ src/usr.sbin/sysinst/arch/i386/msg.md.de	Thu Nov 14 19:26:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.de,v 1.1 2014/07/26 19:30:45 dholland Exp $	*/
+/*	$NetBSD: msg.md.de,v 1.2 2019/11/14 19:26:58 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -82,8 +82,8 @@ message onebiosmatch
 }
 
 message onebiosmatch_header
-{BIOS # Zylinder Köpfe Sektoren Anzahl Sektoren  GB
---  -  --- ---
+{BIOS # Zylinder Köpfe Sektoren Anzahl Sektoren  GB 
+--  -  --- --- 
 }
 
 message onebiosmatch_row
@@ -102,8 +102,8 @@ message biosmultmatch
 }
 
 message biosmultmatch_header
-{   BIOS # Zylinder Köpfe Sektoren Anzahl Sektoren  GB
-   --  -  --- ---
+{   BIOS # Zylinder Köpfe Sektoren Anzahl Sektoren  GB 
+   --  -  --- --- 
 }
 
 message biosmultmatch_row
Index: src/usr.sbin/sysinst/arch/i386/msg.md.en
diff -u src/usr.sbin/sysinst/arch/i386/msg.md.en:1.1 src/usr.sbin/sysinst/arch/i386/msg.md.en:1.2
--- src/usr.sbin/sysinst/arch/i386/msg.md.en:1.1	Sat Jul 26 19:30:45 2014
+++ src/usr.sbin/sysinst/arch/i386/msg.md.en	Thu Nov 14 19:26:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.en,v 1.1 2014/07/26 19:30:45 dholland Exp $	*/
+/*	$NetBSD: msg.md.en,v 1.2 2019/11/14 19:26:58 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -82,8 +82,8 @@ message onebiosmatch
 }
 
 message onebiosmatch_header
-{BIOS # cylinders heads sectors total sectors  GB
--- - - --- - ---
+{BIOS # cylinders heads sectors total sectors  GB 
+-- - - --- - --- 
 }
 
 message onebiosmatch_row
@@ -102,8 +102,8 @@ message biosmultmatch
 }
 
 message biosmultmatch_header
-{   BIOS # cylinders heads sectors total sectors   GB
-   -- - - --- - 
+{   BIOS # cylinders heads sectors total sectors   GB 
+   -- - - --- -  
 }
 
 message biosmultmatch_row
Index: src/usr.sbin/sysinst/arch/i386/msg.md.es
diff -u src/usr.sbin/sysinst/arch/i386/msg.md.es:1.1 src/usr.sbin/sysinst/arch/i386/msg.md.es:1.2
--- src/usr.sbin/sysinst/arch/i386/msg.md.es:1.1	Sat Jul 26 19:30:45 2014
+++ src/usr.sbin/sysinst/arch/i386/msg.md.es	Thu Nov 14 19:26:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.es,v 1.1 2014/07/26 19:30:45 dholland Exp $	*/
+/*	$NetBSD: msg.md.es,v 1.2 2019/11/14 19:26:58 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -82,8 +82,8 @@ message onebiosmatch
 }
 
 message onebiosmatch_header
-{BIOS # cilindros cabez sectors sect. totales GB
--- - - --- - ---
+{BIOS # cilindros cabez sectors sect. totales GB 
+-- - - --- - --- 
 }
 
 message onebiosmatch_row
@@ -102,8 +102,8 @@ message biosmultmatch
 }
 
 message biosmultmatch_header
-{   BIOS # cilindros cabez sectors sect totales  GB
-   -- - - --- - 
+{   BIOS # cilindros cabez sectors sect totales  GB 
+   -- - - --- -  
 }
 
 message biosmultmatch_row
Index: src/usr.sbin/sysinst/arch/i386/msg.md.fr
diff -u src/usr.sbin/sysinst/arch/i386/msg.md.fr:1.1 src/usr.sbin/sysinst/arch/i386/msg.md.fr:1.2
--- src/usr.sbin/sysinst/arch/i386/msg.md.fr:1.1	Sat Jul 26 19:30:45 2014
+++ src/usr.sbin/sysinst/arch/i386/msg.md.fr	Thu Nov 14 19:26:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.fr,v 1.1 2014/07/26 19:30:45 dholland Exp $	*/
+/*	$NetBSD: msg.md.fr,v 1.2 2019/11/14 19:26:58 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont 

CVS commit: src/usr.sbin/sysinst/arch

2019-11-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov 14 19:26:58 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/i386: msg.md.de msg.md.en msg.md.es msg.md.fr
msg.md.pl
src/usr.sbin/sysinst/arch/playstation2: msg.md.de msg.md.en msg.md.es
msg.md.fr msg.md.pl

Log Message:
Fix missing newlines in bios match display, pointed out by maxv.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/arch/i386/msg.md.de \
src/usr.sbin/sysinst/arch/i386/msg.md.en \
src/usr.sbin/sysinst/arch/i386/msg.md.es \
src/usr.sbin/sysinst/arch/i386/msg.md.fr \
src/usr.sbin/sysinst/arch/i386/msg.md.pl
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/playstation2/msg.md.de \
src/usr.sbin/sysinst/arch/playstation2/msg.md.en \
src/usr.sbin/sysinst/arch/playstation2/msg.md.es \
src/usr.sbin/sysinst/arch/playstation2/msg.md.fr \
src/usr.sbin/sysinst/arch/playstation2/msg.md.pl

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-11-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov 14 13:58:22 UTC 2019

Modified Files:
src/usr.sbin/sysinst: Makefile.inc defs.h util.c

Log Message:
Make tar extraction flags depend on our usage of pax-as-tar or bsdtar.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/sysinst/Makefile.inc
cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/sysinst/util.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/Makefile.inc
diff -u src/usr.sbin/sysinst/Makefile.inc:1.29 src/usr.sbin/sysinst/Makefile.inc:1.30
--- src/usr.sbin/sysinst/Makefile.inc:1.29	Wed Nov 13 18:57:26 2019
+++ src/usr.sbin/sysinst/Makefile.inc	Thu Nov 14 13:58:22 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.29 2019/11/13 18:57:26 martin Exp $
+#	$NetBSD: Makefile.inc,v 1.30 2019/11/14 13:58:22 martin Exp $
 #
 # Makefile for sysinst
 
@@ -68,6 +68,10 @@ MSG_CMP_SH=	${.CURDIR}/../../msg_cmp.sh
 
 SETS_TAR_SUFF=${"${USE_XZ_SETS:Uno}"!="no":?"tar.xz":"tgz"}
 
+.if ${MKBSDTAR:Uno} == "no"
+CPPFLAGS+=	-DUSING_PAXASTAR
+.endif
+
 CATALOGDIR=	/usr/share/sysinst/catalog
 CPPFLAGS+=	-I. -I${.CURDIR}/../.. -I${.CURDIR} \
 		-I${.CURDIR}/../../../../sbin/fsck \

Index: src/usr.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.47 src/usr.sbin/sysinst/defs.h:1.48
--- src/usr.sbin/sysinst/defs.h:1.47	Wed Nov 13 18:57:26 2019
+++ src/usr.sbin/sysinst/defs.h	Thu Nov 14 13:58:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.47 2019/11/13 18:57:26 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.48 2019/11/14 13:58:22 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -508,6 +508,12 @@ int  clean_xfer_dir;
 #define	SETS_TAR_SUFF	 "tgz"
 #endif
 
+#ifdef	USING_PAXASTAR
+#define	TAR_EXTRACT_FLAGS	"-xhepf"
+#else
+#define	TAR_EXTRACT_FLAGS	"-xpPf"
+#endif
+
 /* Abs. path we extract binary sets from */
 char ext_dir_bin[STRSIZE];
 

Index: src/usr.sbin/sysinst/util.c
diff -u src/usr.sbin/sysinst/util.c:1.37 src/usr.sbin/sysinst/util.c:1.38
--- src/usr.sbin/sysinst/util.c:1.37	Wed Nov 13 18:57:26 2019
+++ src/usr.sbin/sysinst/util.c	Thu Nov 14 13:58:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.37 2019/11/13 18:57:26 martin Exp $	*/
+/*	$NetBSD: util.c,v 1.38 2019/11/14 13:58:22 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -975,7 +975,8 @@ extract_file(distinfo *dist, int update)
 
 	/* now extract set files into "./". */
 	rval = run_program(RUN_DISPLAY | RUN_PROGRESS,
-			"progress -zf %s tar --chroot -xpPf -", path);
+			"progress -zf %s tar --chroot "
+			TAR_EXTRACT_FLAGS " -", path);
 
 	chdir(owd);
 	free(owd);



CVS commit: src/usr.sbin/sysinst

2019-11-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov 14 13:58:22 UTC 2019

Modified Files:
src/usr.sbin/sysinst: Makefile.inc defs.h util.c

Log Message:
Make tar extraction flags depend on our usage of pax-as-tar or bsdtar.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/sysinst/Makefile.inc
cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/sysinst/util.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst/arch/ews4800mips

2019-11-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 13 18:58:09 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/ews4800mips: Makefile

Log Message:
Drop MBR and cloning support on crunched install media.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/ews4800mips/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst/arch/ews4800mips

2019-11-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 13 18:58:09 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/ews4800mips: Makefile

Log Message:
Drop MBR and cloning support on crunched install media.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/ews4800mips/Makefile

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/arch/ews4800mips/Makefile
diff -u src/usr.sbin/sysinst/arch/ews4800mips/Makefile:1.2 src/usr.sbin/sysinst/arch/ews4800mips/Makefile:1.3
--- src/usr.sbin/sysinst/arch/ews4800mips/Makefile:1.2	Thu Jun 13 06:34:31 2019
+++ src/usr.sbin/sysinst/arch/ews4800mips/Makefile	Wed Nov 13 18:58:09 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2019/06/13 06:34:31 martin Exp $
+#	$NetBSD: Makefile,v 1.3 2019/11/13 18:58:09 martin Exp $
 #
 # Makefile for ews4800mips
 #
@@ -8,6 +8,8 @@ LANGUAGES=	# no translations
 .ifdef SMALLPROG
 NOPARTMAN=	yes
 NO_GPT=		yes
+NO_MBR=		yes
+NO_CLONES=	yes
 .endif
 
 .include "../../Makefile.inc"



CVS commit: src/usr.sbin/sysinst

2019-11-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 13 18:57:26 UTC 2019

Modified Files:
src/usr.sbin/sysinst: Makefile.inc bsddisklabel.c defs.h disks.c
install.c label.c part_edit.c util.c

Log Message:
Make cloning support optional, so we can save some space on very small
install media.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/sysinst/Makefile.inc
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.46 -r1.47 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.55 -r1.56 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/install.c
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/sysinst/label.c
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sysinst/part_edit.c
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/sysinst/util.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/Makefile.inc
diff -u src/usr.sbin/sysinst/Makefile.inc:1.28 src/usr.sbin/sysinst/Makefile.inc:1.29
--- src/usr.sbin/sysinst/Makefile.inc:1.28	Thu Oct 31 09:44:13 2019
+++ src/usr.sbin/sysinst/Makefile.inc	Wed Nov 13 18:57:26 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.28 2019/10/31 09:44:13 martin Exp $
+#	$NetBSD: Makefile.inc,v 1.29 2019/11/13 18:57:26 martin Exp $
 #
 # Makefile for sysinst
 
@@ -43,6 +43,9 @@ CPPFLAGS.gpt.c+=	-I${GPT_DIR}
 CPPFLAGS+=	-DHAVE_MBR
 SRCS+=	mbr.c
 .endif
+.if ${NO_CLONES:Uno} == "yes"
+CPPFLAGS+=	-DNO_CLONES
+.endif
 
 MSG_MD?=	msg.md.${SYSINSTLANG}
 MENUS_MD?=	menus.md.${SYSINSTLANG}

Index: src/usr.sbin/sysinst/bsddisklabel.c
diff -u src/usr.sbin/sysinst/bsddisklabel.c:1.30 src/usr.sbin/sysinst/bsddisklabel.c:1.31
--- src/usr.sbin/sysinst/bsddisklabel.c:1.30	Tue Nov 12 16:33:14 2019
+++ src/usr.sbin/sysinst/bsddisklabel.c	Wed Nov 13 18:57:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.30 2019/11/12 16:33:14 martin Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.31 2019/11/13 18:57:26 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -251,11 +251,13 @@ draw_size_menu_line(menudesc *m, int opt
 		mount = swap;
 	} else if (pset->infos[opt].mount[0]) {
 		mount = pset->infos[opt].mount;
+#ifndef NO_CLONES
 	} else if (pset->infos[opt].flags & PUIFLG_CLONE_PARTS) {
 		snprintf(swap, sizeof swap, "%zu %s",
 		pset->infos[opt].clone_src->num_sel,
 		msg_string(MSG_clone_target_disp));
 		mount = swap;
+#endif
 	} else {
 		mount = NULL;
 		if (pset->infos[opt].parts->pscheme->other_partition_identifier
@@ -353,6 +355,7 @@ add_other_ptn_size(menudesc *menu, void 
 	return -1;
 }
 
+#ifndef NO_CLONES
 static int
 inst_ext_clone(menudesc *menu, void *arg)
 {
@@ -430,6 +433,7 @@ err:
 	free_selected_partitions();
 	return 0;
 }
+#endif
 
 static size_t
 fill_ptn_menu(struct partition_usage_set *pset)
@@ -440,7 +444,14 @@ fill_ptn_menu(struct partition_usage_set
 	size_t i;
 	daddr_t free_space;
 
-	memset(pset->menu_opts, 0, (pset->num+4)*sizeof(*pset->menu_opts));
+#ifdef NO_CLONES
+#define	ADD_ITEMS	3
+#else
+#define	ADD_ITEMS	4
+#endif
+
+	memset(pset->menu_opts, 0, (pset->num+ADD_ITEMS)
+	*sizeof(*pset->menu_opts));
 	for (m = pset->menu_opts, p = pset->infos, i = 0; i < pset->num;
 	m++, p++, i++) {
 		if (p->flags & PUIFLG_CLONE_PARTS)
@@ -457,9 +468,11 @@ fill_ptn_menu(struct partition_usage_set
 	m->opt_action = add_other_ptn_size;
 	m++;
 
+#ifndef NO_CLONES
 	m->opt_name = MSG_clone_from_elsewhere;
 	m->opt_action = inst_ext_clone;
 	m++;
+#endif
 
 	m->opt_name = MSG_askunits;
 	m->opt_menu = MENU_sizechoice;
@@ -1136,6 +1149,7 @@ sort_and_sync_parts(struct partition_usa
 	pset->infos = infos;
 }
 
+#ifndef NO_CLONES
 /*
  * Convert clone entries with more than one source into
  * several entries with a single source each.
@@ -1188,6 +1202,7 @@ normalize_clones(struct part_usage_info 
 	free(*infos);
 	*infos = ui;
 }
+#endif
 
 static void
 apply_settings_to_partitions(struct pm_devs *p, struct disk_partitions *parts,
@@ -1195,13 +1210,18 @@ apply_settings_to_partitions(struct pm_d
 {
 	size_t i, exp_ndx = ~0U;
 	daddr_t planned_space = 0, nsp, from, align;
-	struct disk_part_info *infos, cinfo, srcinfo;
+	struct disk_part_info *infos;
+#ifndef NO_CLONES
+	struct disk_part_info cinfo, srcinfo;
+	struct selected_partition *sp;
+#endif
 	struct disk_part_free_space space;
 	struct disk_partitions *ps = NULL;
-	struct selected_partition *sp;
 	part_id pno, new_part_id;
 
+#ifndef NO_CLONES
 	normalize_clones(>infos, >num);
+#endif
 
 	infos = calloc(wanted->num, sizeof(*infos));
 	if (infos == NULL) {
@@ -1329,6 +1349,7 @@ apply_settings_to_partitions(struct pm_d
 			continue;
 		if (want->flags & (PUIFLG_JUST_MOUNTPOINT|PUIFLG_IS_OUTER))
 			continue;
+#ifndef NO_CLONES
 		if ((want->flags & PUIFLG_CLONE_PARTS) &&
 		want->clone_src != NULL &&
 		want->clone_ndx < want->clone_src->num_sel) {
@@ -1358,6 +1379,9 @@ 

CVS commit: src/usr.sbin/sysinst

2019-11-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 13 18:57:26 UTC 2019

Modified Files:
src/usr.sbin/sysinst: Makefile.inc bsddisklabel.c defs.h disks.c
install.c label.c part_edit.c util.c

Log Message:
Make cloning support optional, so we can save some space on very small
install media.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/sysinst/Makefile.inc
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.46 -r1.47 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.55 -r1.56 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/install.c
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/sysinst/label.c
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sysinst/part_edit.c
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/sysinst/util.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-11-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 12 18:04:37 UTC 2019

Modified Files:
src/usr.sbin/sysinst: util.c

Log Message:
PR 54467: we trust our own sets, extract them with -P to allow symlink
redirection (especially for updates and chroot services - back out
once a better solution for those is implemented)


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/sysinst/util.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/util.c
diff -u src/usr.sbin/sysinst/util.c:1.35 src/usr.sbin/sysinst/util.c:1.36
--- src/usr.sbin/sysinst/util.c:1.35	Tue Nov 12 16:33:14 2019
+++ src/usr.sbin/sysinst/util.c	Tue Nov 12 18:04:37 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.35 2019/11/12 16:33:14 martin Exp $	*/
+/*	$NetBSD: util.c,v 1.36 2019/11/12 18:04:37 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -975,7 +975,7 @@ extract_file(distinfo *dist, int update)
 
 	/* now extract set files into "./". */
 	rval = run_program(RUN_DISPLAY | RUN_PROGRESS,
-			"progress -zf %s tar --chroot -xpf -", path);
+			"progress -zf %s tar --chroot -xpPf -", path);
 
 	chdir(owd);
 	free(owd);



CVS commit: src/usr.sbin/sysinst

2019-11-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 12 18:04:37 UTC 2019

Modified Files:
src/usr.sbin/sysinst: util.c

Log Message:
PR 54467: we trust our own sets, extract them with -P to allow symlink
redirection (especially for updates and chroot services - back out
once a better solution for those is implemented)


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/sysinst/util.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-11-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 12 16:33:14 UTC 2019

Modified Files:
src/usr.sbin/sysinst: bsddisklabel.c defs.h disklabel.c disks.c gpt.c
install.c label.c main.c mbr.c mbr.h msg.mi.de msg.mi.en msg.mi.es
msg.mi.fr msg.mi.pl part_edit.c partitions.c partitions.h util.c
src/usr.sbin/sysinst/arch/i386: md.c

Log Message:
Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.45 -r1.46 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.54 -r1.55 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sysinst/gpt.c \
src/usr.sbin/sysinst/install.c
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/label.c
cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/sysinst/main.c \
src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/sysinst/mbr.c \
src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/mbr.h
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/part_edit.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/sysinst/partitions.c
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sysinst/partitions.h
cvs rdiff -u -r1.34 -r1.35 src/usr.sbin/sysinst/util.c
cvs rdiff -u -r1.21 -r1.22 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.29 src/usr.sbin/sysinst/bsddisklabel.c:1.30
--- src/usr.sbin/sysinst/bsddisklabel.c:1.29	Fri Oct 25 12:24:34 2019
+++ src/usr.sbin/sysinst/bsddisklabel.c	Tue Nov 12 16:33:14 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.29 2019/10/25 12:24:34 martin Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.30 2019/11/12 16:33:14 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -251,6 +251,11 @@ draw_size_menu_line(menudesc *m, int opt
 		mount = swap;
 	} else if (pset->infos[opt].mount[0]) {
 		mount = pset->infos[opt].mount;
+	} else if (pset->infos[opt].flags & PUIFLG_CLONE_PARTS) {
+		snprintf(swap, sizeof swap, "%zu %s",
+		pset->infos[opt].clone_src->num_sel,
+		msg_string(MSG_clone_target_disp));
+		mount = swap;
 	} else {
 		mount = NULL;
 		if (pset->infos[opt].parts->pscheme->other_partition_identifier
@@ -319,7 +324,7 @@ add_other_ptn_size(menudesc *menu, void 
 			break;
 	}
 
-	m = realloc(pset->menu_opts, (pset->num+4)*sizeof(*pset->menu_opts));
+	m = realloc(pset->menu_opts, (pset->num+5)*sizeof(*pset->menu_opts));
 	if (m == NULL)
 		return 0;
 	p = realloc(pset->infos, (pset->num+1)*sizeof(*pset->infos));
@@ -348,6 +353,84 @@ add_other_ptn_size(menudesc *menu, void 
 	return -1;
 }
 
+static int
+inst_ext_clone(menudesc *menu, void *arg)
+{
+	struct selected_partitions selected;
+	struct clone_target_menu_data data;
+	struct partition_usage_set *pset = arg;
+	struct part_usage_info *p;
+	menu_ent *men;
+	int num_men, i;
+ 
+	if (!select_partitions(, pm->parts))
+		return 0;
+
+	num_men = pset->num+1;
+	men = calloc(num_men, sizeof *men);
+	if (men == NULL)
+		return 0;
+	for (i = 0; i < num_men; i++)
+		men[i].opt_action = clone_target_select;
+	men[num_men-1].opt_name = MSG_clone_target_end;
+
+	memset(, 0, sizeof data);
+	data.usage = *pset;
+	data.res = -1;
+
+	data.usage.menu = new_menu(MSG_clone_target_hdr,
+	men, num_men, 3, 2, 0, 65, MC_SCROLL,
+	NULL, draw_size_menu_line, NULL, NULL, MSG_cancel);
+	process_menu(data.usage.menu, );
+	free_menu(data.usage.menu);
+	free(men);
+
+	if (data.res < 0)
+		goto err;
+
+	/* insert clone record */
+	men = realloc(pset->menu_opts, (pset->num+5)*sizeof(*pset->menu_opts));
+	if (men == NULL)
+		goto err;
+	pset->menu_opts = men;
+	menu->opts = men;
+	menu->numopts = pset->num+4;
+
+	p = realloc(pset->infos, (pset->num+1)*sizeof(*pset->infos));
+	if (p == NULL)
+		goto err;
+	pset->infos = p;
+
+	men += data.res;
+	p += data.res;
+	memmove(men+1, men, sizeof(*men)*((pset->num+4)-data.res));
+	memmove(p+1, p, sizeof(*p)*((pset->num)-data.res));
+	memset(men, 0, sizeof(*men));
+	memset(p, 0, sizeof(*p));
+	p->flags = PUIFLG_CLONE_PARTS;
+	p->cur_part_id = NO_PART;
+	p->clone_src = malloc(sizeof(selected));
+	if (p->clone_src != NULL) {
+		*p->clone_src = selected;
+		p->clone_ndx = ~0U;
+		p->size = selected_parts_size();
+		p->parts = pset->parts;
+	} else {
+		p->clone_ndx = 0;
+		free_selected_partitions();
+	}
+
+	menu->cursel = data.res == 0 ? 1 : 0;
+	pset->num++;
+	fill_ptn_menu(pset);
+
+	return -1;
+
+err:
+	free_selected_partitions();
+	return 0;
+}
+
 static size_t
 

CVS commit: src/usr.sbin/sysinst

2019-11-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 12 16:33:14 UTC 2019

Modified Files:
src/usr.sbin/sysinst: bsddisklabel.c defs.h disklabel.c disks.c gpt.c
install.c label.c main.c mbr.c mbr.h msg.mi.de msg.mi.en msg.mi.es
msg.mi.fr msg.mi.pl part_edit.c partitions.c partitions.h util.c
src/usr.sbin/sysinst/arch/i386: md.c

Log Message:
Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.45 -r1.46 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.54 -r1.55 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sysinst/gpt.c \
src/usr.sbin/sysinst/install.c
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/label.c
cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/sysinst/main.c \
src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/sysinst/mbr.c \
src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/mbr.h
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/part_edit.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/sysinst/partitions.c
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sysinst/partitions.h
cvs rdiff -u -r1.34 -r1.35 src/usr.sbin/sysinst/util.c
cvs rdiff -u -r1.21 -r1.22 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.



CVS commit: src/usr.sbin/sysinst

2019-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 31 09:44:13 UTC 2019

Modified Files:
src/usr.sbin/sysinst: Makefile.inc

Log Message:
After RELEASEMACHINEDIR has the right defaults now, simplify subdir settings
and do not hardcode any architecture exceptions.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/sysinst/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 31 09:44:13 UTC 2019

Modified Files:
src/usr.sbin/sysinst: Makefile.inc

Log Message:
After RELEASEMACHINEDIR has the right defaults now, simplify subdir settings
and do not hardcode any architecture exceptions.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/sysinst/Makefile.inc

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/Makefile.inc
diff -u src/usr.sbin/sysinst/Makefile.inc:1.27 src/usr.sbin/sysinst/Makefile.inc:1.28
--- src/usr.sbin/sysinst/Makefile.inc:1.27	Sun Oct 13 07:28:21 2019
+++ src/usr.sbin/sysinst/Makefile.inc	Thu Oct 31 09:44:13 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.27 2019/10/13 07:28:21 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.28 2019/10/31 09:44:13 martin Exp $
 #
 # Makefile for sysinst
 
@@ -74,10 +74,8 @@ CPPFLAGS+=	-I. -I${.CURDIR}/../.. -I${.C
 		${NODISKLABEL:D-DNO_DISKLABEL} \
 		${NOPARTMAN:D-DNO_PARTMAN}
 
-.if ${MACHINE} == "evbarm" \
-|| ${MACHINE} == "evbmips" \
-|| ${MACHINE} == "evbsh3"
-CPPFLAGS+=	-DARCH_SUBDIR="\"${MACHINE}-${MACHINE_ARCH}\""
+.if ${RELEASEMACHINEDIR} != ${MACHINE}
+CPPFLAGS+=	-DARCH_SUBDIR="\"${RELEASEMACHINEDIR}\""
 CPPFLAGS+=	-DPKG_ARCH_SUBDIR="\"${MACHINE_ARCH}\""
 .endif
 



CVS commit: src/usr.sbin/sysinst

2019-10-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 26 07:32:52 UTC 2019

Modified Files:
src/usr.sbin/sysinst: part_edit.c partitions.c

Log Message:
In non-MBR specific files, #ifdef all tests for MBR for architectures
that do not even compile in MBR support.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/part_edit.c
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/partitions.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/part_edit.c
diff -u src/usr.sbin/sysinst/part_edit.c:1.9 src/usr.sbin/sysinst/part_edit.c:1.10
--- src/usr.sbin/sysinst/part_edit.c:1.9	Fri Oct 25 12:24:34 2019
+++ src/usr.sbin/sysinst/part_edit.c	Sat Oct 26 07:32:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: part_edit.c,v 1.9 2019/10/25 12:24:34 martin Exp $ */
+/*	$NetBSD: part_edit.c,v 1.10 2019/10/26 07:32:52 martin Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -1218,8 +1218,10 @@ select_part_scheme(
 		if (bootable && p->have_boot_support != NULL &&
 		!p->have_boot_support(dev->diskdev))
 			continue;
+#ifdef HAVE_MBR
 		if (dev->no_mbr && p->name == MSG_parttype_mbr)
 			continue;
+#endif
 		if (p->size_limit && dev->dlsize > p->size_limit) {
 			char buf[255], hum_lim[5];
 

Index: src/usr.sbin/sysinst/partitions.c
diff -u src/usr.sbin/sysinst/partitions.c:1.3 src/usr.sbin/sysinst/partitions.c:1.4
--- src/usr.sbin/sysinst/partitions.c:1.3	Fri Oct 25 12:49:58 2019
+++ src/usr.sbin/sysinst/partitions.c	Sat Oct 26 07:32:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partitions.c,v 1.3 2019/10/25 12:49:58 martin Exp $	*/
+/*	$NetBSD: partitions.c,v 1.4 2019/10/26 07:32:52 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -53,8 +53,10 @@ partitions_read_disk(const char *dev, da
 		return NULL;
 
 	for (ps = available_part_schemes; *ps; ps++) {
+#ifdef HAVE_MBR
 		if (no_mbr && (*ps)->name == MSG_parttype_mbr)
 			continue;
+#endif
 		struct disk_partitions *parts =
 		(*ps)->read_from_disk(dev, 0, disk_size, *ps);
 		if (parts)



CVS commit: src/usr.sbin/sysinst

2019-10-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 26 07:32:52 UTC 2019

Modified Files:
src/usr.sbin/sysinst: part_edit.c partitions.c

Log Message:
In non-MBR specific files, #ifdef all tests for MBR for architectures
that do not even compile in MBR support.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/part_edit.c
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/partitions.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 12:49:58 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c partitions.c partitions.h

Log Message:
On device where we do not want a MBR (raid, xbd) skip the MBR partitioning
scheme when trying to read partitions from disk. The generic reader will
fall back to disklabel then.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/partitions.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/sysinst/partitions.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.53 src/usr.sbin/sysinst/disks.c:1.54
--- src/usr.sbin/sysinst/disks.c:1.53	Mon Oct 21 16:10:54 2019
+++ src/usr.sbin/sysinst/disks.c	Fri Oct 25 12:49:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.53 2019/10/21 16:10:54 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.54 2019/10/25 12:49:58 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -901,7 +901,8 @@ find_disks(const char *doingwhat, bool a
 		pm_i->parts =
 		partitions_read_disk(
 		pm_i->diskdev,
-		disk->dd_totsec);
+		disk->dd_totsec,
+		disk->dd_no_mbr);
 	}
 }
 continue;
@@ -929,7 +930,8 @@ find_disks(const char *doingwhat, bool a
 			pm->dlsize = disk->dd_cyl * disk->dd_head
 			* disk->dd_sec;
 
-		pm->parts = partitions_read_disk(pm->diskdev, disk->dd_totsec);
+		pm->parts = partitions_read_disk(pm->diskdev,
+		disk->dd_totsec, disk->dd_no_mbr);
 
 again:
 
@@ -1443,7 +1445,7 @@ find_part_by_name(const char *name, stru
 			if (strcmp(disks[n].dd_name, pm->diskdev) == 0)
 continue;
 			ps = partitions_read_disk(disks[n].dd_name,
-			disks[n].dd_totsec);
+			disks[n].dd_totsec, disks[n].dd_no_mbr);
 			if (ps == NULL)
 continue;
 			if (ps->pscheme->find_by_name == NULL)

Index: src/usr.sbin/sysinst/partitions.c
diff -u src/usr.sbin/sysinst/partitions.c:1.2 src/usr.sbin/sysinst/partitions.c:1.3
--- src/usr.sbin/sysinst/partitions.c:1.2	Wed Aug 14 13:02:23 2019
+++ src/usr.sbin/sysinst/partitions.c	Fri Oct 25 12:49:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partitions.c,v 1.2 2019/08/14 13:02:23 martin Exp $	*/
+/*	$NetBSD: partitions.c,v 1.3 2019/10/25 12:49:58 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@ size_t num_available_part_schemes;
  * Generic reader - query a disk device and read all partitions from it
  */
 struct disk_partitions *
-partitions_read_disk(const char *dev, daddr_t disk_size)
+partitions_read_disk(const char *dev, daddr_t disk_size, bool no_mbr)
 {
 	const struct disk_partitioning_scheme **ps;
 
@@ -53,6 +53,8 @@ partitions_read_disk(const char *dev, da
 		return NULL;
 
 	for (ps = available_part_schemes; *ps; ps++) {
+		if (no_mbr && (*ps)->name == MSG_parttype_mbr)
+			continue;
 		struct disk_partitions *parts =
 		(*ps)->read_from_disk(dev, 0, disk_size, *ps);
 		if (parts)

Index: src/usr.sbin/sysinst/partitions.h
diff -u src/usr.sbin/sysinst/partitions.h:1.6 src/usr.sbin/sysinst/partitions.h:1.7
--- src/usr.sbin/sysinst/partitions.h:1.6	Wed Aug 14 13:02:23 2019
+++ src/usr.sbin/sysinst/partitions.h	Fri Oct 25 12:49:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partitions.h,v 1.6 2019/08/14 13:02:23 martin Exp $	*/
+/*	$NetBSD: partitions.h,v 1.7 2019/10/25 12:49:58 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -549,7 +549,7 @@ extern size_t num_available_part_schemes
  * Generic reader - query a disk device and read all partitions from it
  */
 struct disk_partitions *
-partitions_read_disk(const char *, daddr_t disk_size);
+partitions_read_disk(const char *, daddr_t disk_size, bool no_mbr);
 
 /*
  * One time initialization



CVS commit: src/usr.sbin/sysinst

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 12:49:58 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c partitions.c partitions.h

Log Message:
On device where we do not want a MBR (raid, xbd) skip the MBR partitioning
scheme when trying to read partitions from disk. The generic reader will
fall back to disklabel then.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/partitions.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/sysinst/partitions.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 12:24:34 UTC 2019

Modified Files:
src/usr.sbin/sysinst: bsddisklabel.c part_edit.c

Log Message:
Honor the "no_mbr" flag (used especially for raid and xbd devices)


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/part_edit.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.28 src/usr.sbin/sysinst/bsddisklabel.c:1.29
--- src/usr.sbin/sysinst/bsddisklabel.c:1.28	Mon Oct 21 16:10:54 2019
+++ src/usr.sbin/sysinst/bsddisklabel.c	Fri Oct 25 12:24:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.28 2019/10/21 16:10:54 martin Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.29 2019/10/25 12:24:34 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1341,7 +1341,7 @@ make_bsd_partitions(struct install_parti
 		return true;
 
 	if (parts == NULL) {
-		pscheme = select_part_scheme(pm, NULL, true, NULL);
+		pscheme = select_part_scheme(pm, NULL, !pm->no_mbr, NULL);
 		if (pscheme == NULL)
 			return false;
 		parts = pscheme->create_new_for_disk(pm->diskdev,

Index: src/usr.sbin/sysinst/part_edit.c
diff -u src/usr.sbin/sysinst/part_edit.c:1.8 src/usr.sbin/sysinst/part_edit.c:1.9
--- src/usr.sbin/sysinst/part_edit.c:1.8	Thu Oct 24 18:17:08 2019
+++ src/usr.sbin/sysinst/part_edit.c	Fri Oct 25 12:24:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: part_edit.c,v 1.8 2019/10/24 18:17:08 martin Exp $ */
+/*	$NetBSD: part_edit.c,v 1.9 2019/10/25 12:24:34 martin Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -1218,6 +1218,8 @@ select_part_scheme(
 		if (bootable && p->have_boot_support != NULL &&
 		!p->have_boot_support(dev->diskdev))
 			continue;
+		if (dev->no_mbr && p->name == MSG_parttype_mbr)
+			continue;
 		if (p->size_limit && dev->dlsize > p->size_limit) {
 			char buf[255], hum_lim[5];
 



CVS commit: src/usr.sbin/sysinst

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 12:24:34 UTC 2019

Modified Files:
src/usr.sbin/sysinst: bsddisklabel.c part_edit.c

Log Message:
Honor the "no_mbr" flag (used especially for raid and xbd devices)


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/part_edit.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 18:17:08 UTC 2019

Modified Files:
src/usr.sbin/sysinst: part_edit.c

Log Message:
When we fail to setup for "all of the disk for NetBSD" report
failure, instead of silently aborting the install.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sysinst/part_edit.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 18:17:08 UTC 2019

Modified Files:
src/usr.sbin/sysinst: part_edit.c

Log Message:
When we fail to setup for "all of the disk for NetBSD" report
failure, instead of silently aborting the install.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sysinst/part_edit.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/part_edit.c
diff -u src/usr.sbin/sysinst/part_edit.c:1.7 src/usr.sbin/sysinst/part_edit.c:1.8
--- src/usr.sbin/sysinst/part_edit.c:1.7	Fri Jul 12 18:25:08 2019
+++ src/usr.sbin/sysinst/part_edit.c	Thu Oct 24 18:17:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: part_edit.c,v 1.7 2019/07/12 18:25:08 martin Exp $ */
+/*	$NetBSD: part_edit.c,v 1.8 2019/10/24 18:17:08 martin Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -1152,8 +1152,10 @@ edit_outer_parts(struct disk_partitions 
 return false;
 			}
 		}
-		if (!md_parts_use_wholedisk(parts))
+		if (!md_parts_use_wholedisk(parts)) {
+			hit_enter_to_continue(MSG_No_free_space, NULL);
 			return false;
+		}
 		if (parts->pscheme->post_edit_verify) {
 			return
 			parts->pscheme->post_edit_verify(parts, true) == 2;



CVS commit: src/usr.sbin/sysinst

2019-10-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Oct 23 18:08:31 UTC 2019

Modified Files:
src/usr.sbin/sysinst: msg.mi.pl

Log Message:
Fix polish translation for sysinst

PR install/53870 by Guest01
PR install/53871 by Guest01

patch by Krzysztof Lasocki


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/sysinst/msg.mi.pl

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/msg.mi.pl
diff -u src/usr.sbin/sysinst/msg.mi.pl:1.23 src/usr.sbin/sysinst/msg.mi.pl:1.24
--- src/usr.sbin/sysinst/msg.mi.pl:1.23	Wed Oct  2 11:16:04 2019
+++ src/usr.sbin/sysinst/msg.mi.pl	Wed Oct 23 18:08:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.pl,v 1.23 2019/10/02 11:16:04 maya Exp $	*/
+/*	$NetBSD: msg.mi.pl,v 1.24 2019/10/23 18:08:31 kamil Exp $	*/
 /*	Based on english version: */
 /*	NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp   */
 
@@ -75,15 +75,16 @@ message mount_failed
 
 message hello
 {Witaj w sysinst, systemie instalacyjnym NetBSD-@@VERSION@@.
-To oparte na menu narzedzie zostalo stworzone aby pomoc ci zainstalowac
-NetBSD na twardym dysku, lub zaktualizowac istniejacy system NetBSD,
-zuzywajac minimum czasu. W ponizszych menu mozesz zmienic aktualne
-ustawienia poprzez naciskanie klawiszy (a, b, c, ...). Klawisze strzalek
-takze moga dzialac. Aktywujesz ustawienie poprzez nacisniecie ENTER.
+To oparte na menu narzedzie (sysinst) zostalo zaprojektowane w celu
+ulatwienia instalacji NetBSD na dysku twardym, lub uaktualnienia istniejacego 
+systemu NetBSD przy minimalnym nakladzie pracy. W ponizszych menu, aby wybrac
+pozycje wpisz litere (a, b, c, ...). Mozesz tez uzyc CTRL+N/CTRL+P, aby wybrac
+nastepna/poprzednia pozycje. Klawisze strzalek i Page-up/Page-down takze moga
+dzialac. Aby aktywowac biezacy wybor z menu, nacisnij klawisz Enter.
 }
 
 message thanks
-{Dziekujemy za uzywanie NetBSD!
+{Dziekujemy za wybranie NetBSD!
 }
 
 message installusure
@@ -483,8 +484,12 @@ message distset
 {Dystrybucja NetBSD jest rozbita w kolekcje pakietow dystrybucyjnych.
 Czesc z nich to pakiety podstawowe wymagane przez wszystkie instalacje,
 a czesc nie jest przez wszystkie wymagana. Mozesz zainstalowac je
-wszystkie (Pelna instalacja) lub wybrac z opcjonalnych pakietow.
-} /* XXX add 'minimal installation' */
+wszystkie (Pelna instalacja) lub wybrac z opcjonalnych pakietow. Mozesz
+takze zainstalowac tylko podstawowy zestaw (minimalna instalacja), lub
+wybrac te, ktore chcesz (Inna instalacja)
+}
+
+
 
 message ftpsource
 {Ponizej masz site %s, katalog, uzytkownika, oraz haslo gotowe do uzycia.



CVS commit: src/usr.sbin/sysinst

2019-10-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Oct 23 18:08:31 UTC 2019

Modified Files:
src/usr.sbin/sysinst: msg.mi.pl

Log Message:
Fix polish translation for sysinst

PR install/53870 by Guest01
PR install/53871 by Guest01

patch by Krzysztof Lasocki


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/sysinst/msg.mi.pl

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-10-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Oct 21 16:10:54 UTC 2019

Modified Files:
src/usr.sbin/sysinst: bsddisklabel.c disks.c

Log Message:
Skip unwanted (zero sized) partitions.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.52 -r1.53 src/usr.sbin/sysinst/disks.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-10-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Oct 21 16:10:54 UTC 2019

Modified Files:
src/usr.sbin/sysinst: bsddisklabel.c disks.c

Log Message:
Skip unwanted (zero sized) partitions.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.52 -r1.53 src/usr.sbin/sysinst/disks.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.27 src/usr.sbin/sysinst/bsddisklabel.c:1.28
--- src/usr.sbin/sysinst/bsddisklabel.c:1.27	Wed Aug 28 15:19:05 2019
+++ src/usr.sbin/sysinst/bsddisklabel.c	Mon Oct 21 16:10:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.27 2019/08/28 15:19:05 martin Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.28 2019/10/21 16:10:54 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1278,6 +1278,8 @@ apply_settings_to_partitions(struct pm_d
 		for (i = 0; i < wanted->num; i++) {
 			if (wanted->infos[i].cur_part_id != NO_PART)
 continue;
+			if (wanted->infos[i].size <= 0)
+continue;
 			if (t.start == infos[i].start) {
 wanted->infos[i].cur_part_id = pno;
 wanted->infos[i].cur_start = infos[i].start;

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.52 src/usr.sbin/sysinst/disks.c:1.53
--- src/usr.sbin/sysinst/disks.c:1.52	Mon Oct 21 14:07:42 2019
+++ src/usr.sbin/sysinst/disks.c	Mon Oct 21 16:10:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.52 2019/10/21 14:07:42 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.53 2019/10/21 16:10:54 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1290,6 +1290,9 @@ make_fstab(struct install_partition_desc
 
 		const struct part_usage_info *ptn = >infos[i];
 
+		if (ptn->size == 0)
+			continue;
+
 		if (ptn->type != PT_swap &&
 		(ptn->instflags & PUIINST_MOUNT) == 0)
 			continue;



CVS commit: src/usr.sbin/sysinst

2019-10-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Oct 21 16:10:00 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disklabel.c

Log Message:
When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/sysinst/disklabel.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/disklabel.c
diff -u src/usr.sbin/sysinst/disklabel.c:1.13 src/usr.sbin/sysinst/disklabel.c:1.14
--- src/usr.sbin/sysinst/disklabel.c:1.13	Wed Aug 14 13:58:00 2019
+++ src/usr.sbin/sysinst/disklabel.c	Mon Oct 21 16:09:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.c,v 1.13 2019/08/14 13:58:00 martin Exp $	*/
+/*	$NetBSD: disklabel.c,v 1.14 2019/10/21 16:09:59 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -717,6 +717,8 @@ again:
 continue;
 			if (parts->l.d_partitions[i].p_fstype == FS_UNUSED)
 continue;
+			if (parts->l.d_partitions[i].p_size == 0)
+continue;
 
 			s = parts->l.d_partitions[i].p_offset;
 			e = parts->l.d_partitions[i].p_size + s;
@@ -823,11 +825,17 @@ disklabel_get_part_device(const struct d
 	if (ptn >= parts->l.d_npartitions)
 		return false;
 
-	for (id = part_index = 0; id < ptn &&
-	part_index < parts->l.d_npartitions; part_index++)
-		if (parts->l.d_partitions[part_index].p_fstype != FS_UNUSED ||
-		parts->l.d_partitions[part_index].p_size != 0)
-			id++;
+	for (id = part_index = 0; part_index < parts->l.d_npartitions;
+	part_index++) {
+		if (parts->l.d_partitions[part_index].p_fstype == FS_UNUSED &&
+		parts->l.d_partitions[part_index].p_size == 0)
+			continue;
+		if (id == ptn)
+			break;
+		id++;
+		if (id > ptn)
+			return false;
+	}
 
 	if (part != 0)
 		*part = part_index;



CVS commit: src/usr.sbin/sysinst

2019-10-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Oct 21 16:10:00 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disklabel.c

Log Message:
When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/sysinst/disklabel.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-10-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Oct 21 14:07:42 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c

Log Message:
Remove a hardcoded assumption that for BIOS boot we always will have
the first partition as root - in mixed EFI/BIOS setups this might not
be true (and in general the user is free to define arbitrary orders).
Pointed out by Robert Nestor.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/usr.sbin/sysinst/disks.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-10-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Oct 21 14:07:42 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c

Log Message:
Remove a hardcoded assumption that for BIOS boot we always will have
the first partition as root - in mixed EFI/BIOS setups this might not
be true (and in general the user is free to define arbitrary orders).
Pointed out by Robert Nestor.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/usr.sbin/sysinst/disks.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/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.51 src/usr.sbin/sysinst/disks.c:1.52
--- src/usr.sbin/sysinst/disks.c:1.51	Tue Aug 20 06:38:17 2019
+++ src/usr.sbin/sysinst/disks.c	Mon Oct 21 14:07:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.51 2019/08/20 06:38:17 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.52 2019/10/21 14:07:42 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1955,12 +1955,30 @@ check_swap(const char *disk, int remove_
 char *
 bootxx_name(struct install_partition_desc *install)
 {
-	int fstype;
+	size_t i;
+	int fstype = -1;
 	const char *bootxxname;
 	char *bootxx;
 
+	/* find a partition to be mounted as / */
+	for (i = 0; i < install->num; i++) {
+		if ((install->infos[i].instflags & PUIINST_MOUNT)
+		&& strcmp(install->infos[i].mount, "/") == 0) {
+			fstype = install->infos[i].fs_type;
+			break;
+		}
+	}
+	if (fstype < 0) {
+		/* not found? take first root type partition instead */
+		for (i = 0; i < install->num; i++) {
+			if (install->infos[i].type == PT_root) {
+fstype = install->infos[i].fs_type;
+break;
+			}
+		}
+	}
+
 	/* check we have boot code for the root partition type */
-	fstype = install->infos[0].fs_type;
 	switch (fstype) {
 #if defined(BOOTXX_FFSV1) || defined(BOOTXX_FFSV2)
 	case FS_BSDFFS:



CVS commit: src/usr.sbin/sysinst

2019-10-17 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Oct 17 08:54:50 UTC 2019

Modified Files:
src/usr.sbin/sysinst: msg.mi.en msg.mi.fr

Log Message:
Sentence begins with capital letter ("yes or no?"). Also add a few french
sentences, to make it less awful, but not complete. Not tested.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/sysinst/msg.mi.fr

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/msg.mi.en
diff -u src/usr.sbin/sysinst/msg.mi.en:1.22 src/usr.sbin/sysinst/msg.mi.en:1.23
--- src/usr.sbin/sysinst/msg.mi.en:1.22	Wed Oct  2 11:16:04 2019
+++ src/usr.sbin/sysinst/msg.mi.en	Thu Oct 17 08:54:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.22 2019/10/02 11:16:04 maya Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.23 2019/10/17 08:54:50 maxv Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -980,7 +980,7 @@ message Configure_network {Configure net
 message Partition_a_disk {Partition a disk}
 message Logging_functions {Logging functions}
 message Halt_the_system {Halt the system}
-message yes_or_no {yes or no?}
+message yes_or_no {Yes or no?}
 message Hit_enter_to_continue {Hit enter to continue}
 message Choose_your_installation {Choose your installation}
 

Index: src/usr.sbin/sysinst/msg.mi.fr
diff -u src/usr.sbin/sysinst/msg.mi.fr:1.20 src/usr.sbin/sysinst/msg.mi.fr:1.21
--- src/usr.sbin/sysinst/msg.mi.fr:1.20	Wed Oct  2 11:16:04 2019
+++ src/usr.sbin/sysinst/msg.mi.fr	Thu Oct 17 08:54:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.fr,v 1.20 2019/10/02 11:16:04 maya Exp $	*/
+/*	$NetBSD: msg.mi.fr,v 1.21 2019/10/17 08:54:50 maxv Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -269,7 +269,7 @@ message add_another_ptn
  *  $1 = size unit			GB
  */
 message fssizesok
-{Go on.  Free space $0 $1.}
+{Valider. Espace libre $0 $1.}
 
 /* Called with: 			Example
  *  $0 = missing space			1.4
@@ -1053,7 +1053,6 @@ message Finished {Terminée}
 message Command_failed {Échec}
 message Command_ended_on_signal {Commande terminée par un signal}
 
-
 message NetBSD_VERSION_Install_System {NetBSD-@@VERSION@@ Programme d'installation}
 message Exit_Install_System {Quitter le programme d'installation}
 message Install_NetBSD_to_hard_disk {Installation de NetBSD sur disque dur}
@@ -1062,8 +1061,8 @@ message Re_install_sets_or_install_addit
 message Reboot_the_computer {Redémarrer l'ordinateur}
 message Utility_menu {Utilitaires}
 message Config_menu {Configuration}
-message exit_menu_generic {Quitter}
 message exit_utility_menu {Quitter}
+message exit_menu_generic {Quitter}
 message NetBSD_VERSION_Utilities {Utilitaires NetBSD-@@VERSION@@}
 message Run_bin_sh {Exécuter /bin/sh}
 message Set_timezone {Configurer le fuseau horaire}
@@ -1071,7 +1070,7 @@ message Configure_network {Configurer le
 message Partition_a_disk {Partitionner un disque}
 message Logging_functions {Journaux}
 message Halt_the_system {Arrêter le système}
-message yes_or_no {oui ou non?}
+message yes_or_no {Oui ou non?}
 message Hit_enter_to_continue {Appuyez sur la touche Entrée pour continuer}
 message Choose_your_installation {Choisir le type d'installation désiré}
 
@@ -1334,7 +1333,7 @@ message	custom_type	{Unknown}
 
 message dl_type_invalid	{Invalid file system type code (0 .. 255)}
 
-message	cancel		{Cancel}
+message	cancel		{Annuler}
 
 message	out_of_range	{Invalid value}
 
@@ -1380,7 +1379,7 @@ message	fs_type_ffsv2	{FFSv2}
 message	fs_type_ffs	{FFS}
 message	other_fs_type	{Other type}
 
-message	editpack	{Edit name of the disk}
+message	editpack	{Changer le nom du disque}
 message	edit_disk_pack_hdr
 {The name of the disk is arbitrary. 
 It is useful for distinguishing between multiple disks.



CVS commit: src/usr.sbin/sysinst

2019-10-17 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Oct 17 08:54:50 UTC 2019

Modified Files:
src/usr.sbin/sysinst: msg.mi.en msg.mi.fr

Log Message:
Sentence begins with capital letter ("yes or no?"). Also add a few french
sentences, to make it less awful, but not complete. Not tested.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/sysinst/msg.mi.fr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct  6 00:07:11 UTC 2019

Modified Files:
src/usr.sbin/sysinst: Makefile.inc

Log Message:
remove, not comment, the partman.c option


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/sysinst/Makefile.inc

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/Makefile.inc
diff -u src/usr.sbin/sysinst/Makefile.inc:1.25 src/usr.sbin/sysinst/Makefile.inc:1.26
--- src/usr.sbin/sysinst/Makefile.inc:1.25	Sun Oct  6 00:05:10 2019
+++ src/usr.sbin/sysinst/Makefile.inc	Sun Oct  6 00:07:11 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.25 2019/10/06 00:05:10 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.26 2019/10/06 00:07:11 mrg Exp $
 #
 # Makefile for sysinst
 
@@ -126,9 +126,6 @@ CPPFLAGS+=-DINET6
 COPTS+=-Wno-format-truncation
 .endif
 
-# XXX overlapping strncpy/snprintf buffers!
-#COPTS.partman.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 8:? -Wno-error :}
-
 # Host to ftp from.  Default:
 #	"ftp.NetBSD.org"
 #



CVS commit: src/usr.sbin/sysinst

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct  6 00:07:11 UTC 2019

Modified Files:
src/usr.sbin/sysinst: Makefile.inc

Log Message:
remove, not comment, the partman.c option


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/sysinst/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct  6 00:05:10 UTC 2019

Modified Files:
src/usr.sbin/sysinst: Makefile.inc partman.c

Log Message:
avoid calling snprintf/strlcat with an input parameter the same
as the output.  from martin@.  fixes gcc 8 restrict warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/sysinst/Makefile.inc
cvs rdiff -u -r1.42 -r1.43 src/usr.sbin/sysinst/partman.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct  6 00:05:10 UTC 2019

Modified Files:
src/usr.sbin/sysinst: Makefile.inc partman.c

Log Message:
avoid calling snprintf/strlcat with an input parameter the same
as the output.  from martin@.  fixes gcc 8 restrict warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/sysinst/Makefile.inc
cvs rdiff -u -r1.42 -r1.43 src/usr.sbin/sysinst/partman.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/Makefile.inc
diff -u src/usr.sbin/sysinst/Makefile.inc:1.24 src/usr.sbin/sysinst/Makefile.inc:1.25
--- src/usr.sbin/sysinst/Makefile.inc:1.24	Fri Oct  4 09:47:28 2019
+++ src/usr.sbin/sysinst/Makefile.inc	Sun Oct  6 00:05:10 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.24 2019/10/04 09:47:28 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.25 2019/10/06 00:05:10 mrg Exp $
 #
 # Makefile for sysinst
 
@@ -127,7 +127,7 @@ COPTS+=-Wno-format-truncation
 .endif
 
 # XXX overlapping strncpy/snprintf buffers!
-COPTS.partman.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 8:? -Wno-error :}
+#COPTS.partman.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 8:? -Wno-error :}
 
 # Host to ftp from.  Default:
 #	"ftp.NetBSD.org"

Index: src/usr.sbin/sysinst/partman.c
diff -u src/usr.sbin/sysinst/partman.c:1.42 src/usr.sbin/sysinst/partman.c:1.43
--- src/usr.sbin/sysinst/partman.c:1.42	Tue Aug 13 17:57:49 2019
+++ src/usr.sbin/sysinst/partman.c	Sun Oct  6 00:05:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partman.c,v 1.42 2019/08/13 17:57:49 martin Exp $ */
+/*	$NetBSD: partman.c,v 1.43 2019/10/06 00:05:10 mrg Exp $ */
 
 /*
  * Copyright 2012 Eugene Lozovoy
@@ -950,7 +950,8 @@ pm_vnd_edit_menufmt(menudesc *m, int opt
 			break;
 		case PMV_MENU_NSECTORS:
 			if (dev_ptr->manual_geom && !dev_ptr->is_exist)
-snprintf(buf, SSTRSIZE, "%d", dev_ptr->nsectors);
+snprintf(buf, SSTRSIZE, "%d",
+dev_ptr->nsectors);
 			wprintw(m->mw, "%*s %s", -lcol_width,
 			msg_string(MSG_vnd_spt_fmt), buf);
 			break;
@@ -962,7 +963,8 @@ pm_vnd_edit_menufmt(menudesc *m, int opt
 			break;
 		case PMV_MENU_NCYLINDERS:
 			if (dev_ptr->manual_geom && !dev_ptr->is_exist)
-snprintf(buf, SSTRSIZE, "%d", dev_ptr->ncylinders);
+snprintf(buf, SSTRSIZE, "%d",
+dev_ptr->ncylinders);
 			wprintw(m->mw, "%*s %s", -lcol_width,
 			msg_string(MSG_vnd_cyl_fmt), buf);
 			break;
@@ -983,10 +985,13 @@ pm_vnd_set_value(menudesc *m, void *arg)
 			dev_ptr->filepath, dev_ptr->filepath, STRSIZE);
 			if (dev_ptr->filepath[0] != '/') {
 strlcpy(buf, dev_ptr->filepath, MOUNTLEN);
-snprintf(dev_ptr->filepath, MOUNTLEN, "/%s", buf);
+snprintf(dev_ptr->filepath, MOUNTLEN, "/%s",
+buf);
 			}
-			if (dev_ptr->filepath[strlen(dev_ptr->filepath) - 1] == '/')
-dev_ptr->filepath[strlen(dev_ptr->filepath) - 1] = '\0';
+			if (dev_ptr->filepath[strlen(dev_ptr->filepath) - 1]
+			== '/')
+dev_ptr->filepath[strlen(dev_ptr->filepath)
+ - 1] = '\0';
 			return 0;
 		case PMV_MENU_EXIST:
 			dev_ptr->is_exist = !dev_ptr->is_exist;
@@ -1540,15 +1545,18 @@ pm_lvm_edit_menufmt(menudesc *m, int opt
 	int i;
 	char buf[STRSIZE];
 	lvms_t *dev_ptr = arg;
-	strlcpy(buf, msg_string(MSG_auto), STRSIZE);
+	strlcpy(buf, msg_string(MSG_auto), sizeof buf);
 
 	switch (opt) {
 		case PML_MENU_PV:
 			buf[0] = '\0';
-			for (i = 0; i < MAX_LVM_PV; i++)
-if (dev_ptr->pv[i].pm != NULL)
-	snprintf(buf, STRSIZE, "%s %s",
-	buf, dev_ptr->pv[i].pm_name);
+			for (i = 0; i < MAX_LVM_PV; i++) {
+if (dev_ptr->pv[i].pm != NULL) {
+	strlcat(buf, " ", sizeof buf);
+	strlcat(buf, dev_ptr->pv[i].pm_name,
+	sizeof buf);
+}
+			}
 			wprintw(m->mw, "%-20s: %s",
 			 msg_string(MSG_lvm_disks_fmt), buf);
 			break;
@@ -1565,13 +1573,15 @@ pm_lvm_edit_menufmt(menudesc *m, int opt
 			break;
 		case PML_MENU_MAXPHYSICALVOLUMES:
 			if (dev_ptr->maxphysicalvolumes > 0)
-snprintf(buf, STRSIZE, "%d", dev_ptr->maxphysicalvolumes);
+snprintf(buf, STRSIZE, "%d",
+dev_ptr->maxphysicalvolumes);
 			wprintw(m->mw, "%-20s: %s",
 			msg_string(MSG_lvm_maxpv_fmt), buf);
 			break;
 		case PML_MENU_PHYSICALEXTENTSIZE:
 			if (dev_ptr->physicalextentsize > 0)
-snprintf(buf, STRSIZE, "%dM", dev_ptr->physicalextentsize);
+snprintf(buf, STRSIZE, "%dM",
+dev_ptr->physicalextentsize);
 			wprintw(m->mw, "%-20s: %s",
 			msg_string(MSG_lvm_extsiz_fmt), buf);
 			break;
@@ -1872,8 +1882,7 @@ pm_lvm_commit(void)
 {
 	int i, ii, error;
 	uint used_size = 0;
-	char params[STRSIZE*3];
-	char devs[STRSIZE*3];
+	char params[STRSIZE*3], devs[STRSIZE*3], arg[STRSIZE];
 
 	for (i = 0; i < MAX_LVM_VG; i++) {
 		/* Stage 0: checks */
@@ -1891,26 +1900,37 @@ pm_lvm_commit(void)
 		for (ii = 0; ii < MAX_LVM_PV && ! error; ii++)
 			if (lvms[i].pv[ii].pm != NULL) {
 run_program(RUN_SILENT | 

CVS commit: src/usr.sbin/sysinst

2019-10-04 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Oct  4 21:36:02 UTC 2019

Modified Files:
src/usr.sbin/sysinst: util.c

Log Message:
add a size_t len to get_iso9660_volname() so it can properly do
bounds checking.

ok martin@


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/sysinst/util.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/util.c
diff -u src/usr.sbin/sysinst/util.c:1.33 src/usr.sbin/sysinst/util.c:1.34
--- src/usr.sbin/sysinst/util.c:1.33	Wed Oct  2 11:16:04 2019
+++ src/usr.sbin/sysinst/util.c	Fri Oct  4 21:36:02 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.33 2019/10/02 11:16:04 maya Exp $	*/
+/*	$NetBSD: util.c,v 1.34 2019/10/04 21:36:02 mrg Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -171,7 +171,8 @@ int have_raid, have_vnd, have_cgd, have_
  */
 
 static int check_for(unsigned int mode, const char *pathname);
-static int get_iso9660_volname(int dev, int sess, char *volname);
+static int get_iso9660_volname(int dev, int sess, char *volname,
+		size_t volnamelen);
 static int get_available_cds(void);
 static int binary_available(const char *prog);
 
@@ -377,7 +378,7 @@ get_via_floppy(void)
  * Get the volume name of a ISO9660 file system
  */
 static int
-get_iso9660_volname(int dev, int sess, char *volname)
+get_iso9660_volname(int dev, int sess, char *volname, size_t volnamelen)
 {
 	int blkno, error, last;
 	char buf[ISO_BLKSIZE];
@@ -394,8 +395,9 @@ get_iso9660_volname(int dev, int sess, c
 		if (isonum_711((const unsigned char *)>type)
 		 == ISO_VD_PRIMARY) {
 			pd = (struct iso_primary_descriptor*)buf;
-			strncpy(volname, pd->volume_id, sizeof pd->volume_id);
-			last = sizeof pd->volume_id-1;
+			strncpy(volname, pd->volume_id, volnamelen - 1);
+			volname[volnamelen - 1] = '\0';
+			last = volnamelen - 1;
 			while (last >= 0
 			&& (volname[last] == ' ' || volname[last] == 0))
 last--;
@@ -456,7 +458,8 @@ get_available_cds_helper(void *arg, cons
 			dev = open(dname, O_RDONLY, 0);
 			if (dev == -1)
 continue;
-			error = get_iso9660_volname(dev, sess, volname);
+			error = get_iso9660_volname(dev, sess, volname,
+			sizeof volname);
 			close(dev);
 			if (error)
 continue;



CVS commit: src/usr.sbin/sysinst

2019-10-04 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Oct  4 21:36:02 UTC 2019

Modified Files:
src/usr.sbin/sysinst: util.c

Log Message:
add a size_t len to get_iso9660_volname() so it can properly do
bounds checking.

ok martin@


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/sysinst/util.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug 28 15:19:06 UTC 2019

Modified Files:
src/usr.sbin/sysinst: bsddisklabel.c

Log Message:
Remove dead (#if 0) code.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/sysinst/bsddisklabel.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.26 src/usr.sbin/sysinst/bsddisklabel.c:1.27
--- src/usr.sbin/sysinst/bsddisklabel.c:1.26	Thu Aug  1 17:50:16 2019
+++ src/usr.sbin/sysinst/bsddisklabel.c	Wed Aug 28 15:19:05 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.26 2019/08/01 17:50:16 martin Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.27 2019/08/28 15:19:05 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -147,73 +147,6 @@ default_parts_init[] =
 	{ .def_size = DEFVARSIZE*(MEG/512), .mount = "/var", .type = PT_root },
 };
 
-#if 0 // XXX
-static int
-save_ptn(int ptn, daddr_t start, daddr_t size, int fstype, const char *mountpt)
-{
-	static int maxptn;
-	partinfo *p;
-	int pp;
-	char *buf;
-
-	if (maxptn == 0)
-		maxptn = getmaxpartitions();
-
-	if (ptn < 0 || PI_FSTYPE(>bsdlabel[ptn]) != FS_UNUSED) {
-		ptn = getrawpartition() + 1;
-#ifdef PART_FIRST_FREE
-		if (ptn < PART_FIRST_FREE)
-			ptn = PART_FIRST_FREE;
-#endif
-		for (;; ptn++) {
-			if (ptn >= maxptn)
-return -1;
-// XXX			if (ptn == PART_USR)
-//continue;
-			if (PI_FSTYPE(>bsdlabel[ptn]) == FS_UNUSED)
-break;
-		}
-	}
-
-	if (fstype == FS_UNUSED)
-		return ptn;
-
-	p = pm->bsdlabel + ptn;
-	PI_SET_OFFSET(p, start);
-	PI_SET_SIZE(p, size);
-	set_ptype(p, fstype, mountpt ? PIF_NEWFS : 0);
-
-	/* Hack because we does not have something like FS_LVMPV */
-	p->lvmpv = 0;
-	if (mountpt != NULL && strcmp(mountpt, "lvm") == 0)
-		p->lvmpv = 1;
-	else if (mountpt != NULL) {
-		for (pp = 0; pp < maxptn; pp++) {
-			if (strcmp(pm->bsdlabel[pp].pi_mount, mountpt) == 0)
-pm->bsdlabel[pp].pi_flags &= ~PIF_MOUNT;
-		}
-		if (mountpt[0] != '/')
-			asprintf(, "/%s", mountpt);
-		else
-			asprintf(, "%s", mountpt);
-		strlcpy(p->pi_mount, buf, sizeof p->pi_mount);
-		p->pi_flags |= PIF_MOUNT;
-		/* Default to UFS2. */
-		if (PI_FSTYPE(p) == FS_BSDFFS) {
-#ifdef DEFAULT_UFS2
-#ifndef HAVE_UFS2_BOOT
-			if (strcmp(mountpt, "/") != 0)
-#endif
-p->pi_flags |= PIF_FFSv2;
-#endif
-		}
-		free(buf);
-	}
-	return ptn;
-}
-#endif
-
-
 static const char size_separator[] =
 "--- - ";
 static char size_menu_title[STRSIZE];
@@ -644,177 +577,7 @@ get_ptn_sizes(struct partition_usage_set
 	pset->menu = -1;
 	pset->menu_opts = NULL;
 
-	if (!pset->ok)
-		return false;
-
-#if 0
-	if (cur_ptns.menu_no < 0) {
-		/* If there is a swap partition elsewhere, don't add one here.*/
-		if (no_swap || (swap_created && partman_go)) {
-			cur_ptns.ptn_sizes[PI_SWAP].size = 0;
-		} else {
-#if DEFSWAPSIZE == -1
-			/* Dynamic swap size. */
-			cur_ptns.ptn_sizes[PI_SWAP].dflt_size = get_ramsize();
-			cur_ptns.ptn_sizes[PI_SWAP].size =
-			cur_ptns.ptn_sizes[PI_SWAP].dflt_size;
-#endif
-		}
-
-		/* If installing X increase default size of /usr */
-		if (set_X11_selected())
-			cur_ptns.ptn_sizes[PI_USR].dflt_size += XNEEDMB;
-
-		/* Start of planning to give free space to / */
-		cur_ptns.pool_part = _ptns.ptn_sizes[PI_ROOT];
-		/* Make size of root include default size of /usr */
-		cur_ptns.ptn_sizes[PI_ROOT].size += cur_ptns.ptn_sizes[PI_USR].dflt_size;
-
-		sm = MEG / pm->sectorsize;
-
-		if (root_limit != 0) {
-			/* Bah - bios can not read all the disk, limit root */
-			cur_ptns.ptn_sizes[PI_ROOT].limit = root_limit -
-			part_start;
-			/* Allocate a /usr partition if bios can't read
-			 * everything except swap.
-			 */
-			if (cur_ptns.ptn_sizes[PI_ROOT].limit
-			< sectors - cur_ptns.ptn_sizes[PI_SWAP].size * sm) {
-/* Root won't be able to access all the space */
-/* Claw back space for /usr */
-cur_ptns.ptn_sizes[PI_USR].size =
-		cur_ptns.ptn_sizes[PI_USR].dflt_size;
-cur_ptns.ptn_sizes[PI_ROOT].size -=
-		cur_ptns.ptn_sizes[PI_USR].dflt_size;
-cur_ptns.ptn_sizes[PI_ROOT].changed = 1;
-/* Give free space to /usr */
-cur_ptns.pool_part = _ptns.ptn_sizes[PI_USR];
-			}
-		}
-
-		/* Change preset sizes from MB to sectors */
-		cur_ptns.free_space = sectors;
-		for (p = cur_ptns.ptn_sizes; p->mount[0]; p++) {
-			p->size = NUMSEC(p->size, sm, pm->dlcylsize);
-			p->dflt_size = NUMSEC(p->dflt_size, sm, pm->dlcylsize);
-			cur_ptns.free_space -= p->size;
-		}
-
-		/* Steal space from swap to make things fit.. */
-		if (cur_ptns.free_space < 0) {
-			i = roundup(-cur_ptns.free_space, pm->dlcylsize);
-			if (i > cur_ptns.ptn_sizes[PI_SWAP].size)
-i = cur_ptns.ptn_sizes[PI_SWAP].size;
-			cur_ptns.ptn_sizes[PI_SWAP].size -= i;
-			cur_ptns.free_space += i;
-		}
-
-		/* 

CVS commit: src/usr.sbin/sysinst

2019-08-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug 28 15:19:06 UTC 2019

Modified Files:
src/usr.sbin/sysinst: bsddisklabel.c

Log Message:
Remove dead (#if 0) code.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/sysinst/bsddisklabel.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 27 17:23:24 UTC 2019

Modified Files:
src/usr.sbin/sysinst: mbr.c

Log Message:
When requesting no special FS sub type, default to FAT32 with LBA.
Fixes one part of PR 54490.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/sysinst/mbr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 27 17:23:24 UTC 2019

Modified Files:
src/usr.sbin/sysinst: mbr.c

Log Message:
When requesting no special FS sub type, default to FAT32 with LBA.
Fixes one part of PR 54490.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/sysinst/mbr.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/mbr.c
diff -u src/usr.sbin/sysinst/mbr.c:1.20 src/usr.sbin/sysinst/mbr.c:1.21
--- src/usr.sbin/sysinst/mbr.c:1.20	Wed Aug 14 13:02:23 2019
+++ src/usr.sbin/sysinst/mbr.c	Tue Aug 27 17:23:24 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbr.c,v 1.20 2019/08/14 13:02:23 martin Exp $ */
+/*	$NetBSD: mbr.c,v 1.21 2019/08/27 17:23:24 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1047,6 +1047,9 @@ mbr_get_fs_part_type(unsigned fs_type, u
 	case FS_EX2FS:
 		return _gen_type_desc[MBR_PTYPE_LNXEXT2].gen;
 	case FS_MSDOS:
+		if (sub_type == 0)
+			sub_type = MBR_PTYPE_FAT32L;
+
 		switch (sub_type) {
 		case MBR_PTYPE_FAT12:
 		case MBR_PTYPE_FAT16S:



CVS commit: src/usr.sbin/sysinst

2019-08-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 27 14:11:00 UTC 2019

Modified Files:
src/usr.sbin/sysinst: defs.h upgrade.c util.c

Log Message:
Do not offer to upgared the "current system" if we are running off a CD
(i.e. / is mounted read-only)


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/upgrade.c
cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/sysinst/util.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.43 src/usr.sbin/sysinst/defs.h:1.44
--- src/usr.sbin/sysinst/defs.h:1.43	Wed Aug  7 10:08:04 2019
+++ src/usr.sbin/sysinst/defs.h	Tue Aug 27 14:11:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.43 2019/08/07 10:08:04 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.44 2019/08/27 14:11:00 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -712,6 +712,7 @@ bool	parts_use_wholedisk(struct disk_par
 bool	md_parts_use_wholedisk(struct disk_partitions*);
 
 /* from util.c */
+bool	root_is_read_only(void);
 void	get_ptn_alignment(const struct disk_partitions *parts, daddr_t *align, daddr_t *p0off);
 char*	str_arg_subst(const char *, size_t, const char **);
 void	msg_display_subst(const char *, size_t, ...);

Index: src/usr.sbin/sysinst/upgrade.c
diff -u src/usr.sbin/sysinst/upgrade.c:1.12 src/usr.sbin/sysinst/upgrade.c:1.13
--- src/usr.sbin/sysinst/upgrade.c:1.12	Tue Jul 23 18:13:40 2019
+++ src/usr.sbin/sysinst/upgrade.c	Tue Aug 27 14:11:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: upgrade.c,v 1.12 2019/07/23 18:13:40 martin Exp $	*/
+/*	$NetBSD: upgrade.c,v 1.13 2019/08/27 14:11:00 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -64,7 +64,7 @@ do_upgrade(void)
 
 	get_ramsize();
 
-	if (find_disks(msg_string(MSG_upgrade), true) < 0)
+	if (find_disks(msg_string(MSG_upgrade), !root_is_read_only()) < 0)
 		return;
 
 	if (pm->parts == NULL && !pm->cur_system) {
@@ -208,7 +208,7 @@ do_reinstall_sets()
 	if (!ask_noyes(NULL))
 		return;
 
-	if (find_disks(msg_string(MSG_reinstall), true) < 0)
+	if (find_disks(msg_string(MSG_reinstall), !root_is_read_only()) < 0)
 		return;
 
 	if (!pm->cur_system) {

Index: src/usr.sbin/sysinst/util.c
diff -u src/usr.sbin/sysinst/util.c:1.31 src/usr.sbin/sysinst/util.c:1.32
--- src/usr.sbin/sysinst/util.c:1.31	Sat Aug 17 18:03:12 2019
+++ src/usr.sbin/sysinst/util.c	Tue Aug 27 14:11:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.31 2019/08/17 18:03:12 martin Exp $	*/
+/*	$NetBSD: util.c,v 1.32 2019/08/27 14:11:00 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -537,6 +537,17 @@ boot_media_still_needed(void)
 	return 0;
 }
 
+bool
+root_is_read_only(void)
+{
+	struct statvfs sb;
+
+	if (statvfs("/", ) == 0)
+		return sb.f_flag & ST_RDONLY;
+
+	return false;
+}
+
 /*
  * Get from a CDROM distribution.
  * Also used on "installation using bootable install media"



CVS commit: src/usr.sbin/sysinst

2019-08-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 27 14:11:00 UTC 2019

Modified Files:
src/usr.sbin/sysinst: defs.h upgrade.c util.c

Log Message:
Do not offer to upgared the "current system" if we are running off a CD
(i.e. / is mounted read-only)


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/upgrade.c
cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/sysinst/util.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 26 12:14:06 UTC 2019

Modified Files:
src/usr.sbin/sysinst: gpt.c

Log Message:
Fix a bug when installing to pre-exising GPT partitions.
Handle GPT labels with spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/gpt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 26 12:14:06 UTC 2019

Modified Files:
src/usr.sbin/sysinst: gpt.c

Log Message:
Fix a bug when installing to pre-exising GPT partitions.
Handle GPT labels with spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/gpt.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/gpt.c
diff -u src/usr.sbin/sysinst/gpt.c:1.10 src/usr.sbin/sysinst/gpt.c:1.11
--- src/usr.sbin/sysinst/gpt.c:1.10	Wed Aug 14 13:02:23 2019
+++ src/usr.sbin/sysinst/gpt.c	Mon Aug 26 12:14:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt.c,v 1.10 2019/08/14 13:02:23 martin Exp $	*/
+/*	$NetBSD: gpt.c,v 1.11 2019/08/26 12:14:06 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -1131,7 +1131,7 @@ gpt_modify_part(const char *disk, struct
 	/* Check label */
 	if (strcmp(p->gp_label, old.gp_label) != 0) {
 		if (run_program(RUN_SILENT,
-		"gpt label -b %" PRIu64 " -l %s %s",
+		"gpt label -b %" PRIu64 " -l \'%s\' %s",
 		p->gp_start, p->gp_label, disk) != 0)
 			return false;
 	}
@@ -1213,6 +1213,20 @@ gpt_add_wedge(const char *disk, struct g
 	return true;
 }
 
+static void
+escape_spaces(char *dest, const char *src)
+{
+	unsigned char c;
+
+	while (*src) {
+		c = *src++;
+		if (isspace(c) || c == '\\')
+			*dest++ = '\\';
+		*dest++ = c;
+	}
+	*dest = 0;
+}
+
 static bool
 gpt_get_part_device(const struct disk_partitions *arg,
 part_id id, char *devname, size_t max_devname_len, int *part,
@@ -1221,6 +1235,7 @@ gpt_get_part_device(const struct disk_pa
 	const struct gpt_disk_partitions *parts =
 	(const struct gpt_disk_partitions*)arg;
 	struct  gpt_part_entry *p = parts->partitions;
+	char tmpname[GPT_LABEL_LEN*2];
 	part_id no;
 
 
@@ -1239,12 +1254,14 @@ gpt_get_part_device(const struct disk_pa
 
 	switch (usage) {
 	case logical_name:
-		if (p->gp_label[0] != 0)
+		if (p->gp_label[0] != 0) {
+			escape_spaces(tmpname, p->gp_label);
 			snprintf(devname, max_devname_len,
-			"NAME=%s", p->gp_label);
-		else
+			"NAME=%s", tmpname);
+		} else {
 			snprintf(devname, max_devname_len,
 			"NAME=%s", p->gp_id);
+		}
 		break;
 	case plain_name:
 		assert(p->gp_flags & GPEF_WEDGE);
@@ -1275,7 +1292,7 @@ gpt_write_to_disk(struct disk_partitions
 {
 	struct gpt_disk_partitions *parts = (struct gpt_disk_partitions*)arg;
 	struct gpt_part_entry *p, *n;
-	char label_arg[sizeof(p->gp_label) + 4];
+	char label_arg[sizeof(p->gp_label) + 10];
 	char diskpath[MAXPATHLEN];
 	int fd, bits = 0;
 	bool root_is_new = false, efi_is_new = false;
@@ -1295,11 +1312,9 @@ gpt_write_to_disk(struct disk_partitions
 	close(fd);
 
 	/*
-	 * Mark all partitions as "have no wedge yet". While there,
-	 * collect first root and efi partition (if available)
+	 * Collect first root and efi partition (if available)
 	 */
 	for (pno = 0, p = parts->partitions; p != NULL; p = p->gp_next, pno++) {
-		p->gp_flags &= ~GPEF_WEDGE;
 		if (root_id == NO_PART && p->gp_type != NULL) {
 			if (p->gp_type->gent.generic_ptype == PT_root &&
 			p->gp_start == pm->ptstart) {
@@ -1373,7 +1388,7 @@ gpt_write_to_disk(struct disk_partitions
 		if (p->gp_label[0] == 0)
 			label_arg[0] = 0;
 		else
-			sprintf(label_arg, "-l %s", p->gp_label);
+			sprintf(label_arg, "-l \'%s\'", p->gp_label);
 
 		if (p->gp_type != NULL)
 			run_program(RUN_SILENT,



CVS commit: src/usr.sbin/sysinst

2019-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 20 06:38:18 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c

Log Message:
PR install/54480: when upgrading a system and re-mounting the target /
with proper options, and the installed system does not use NAME= syntax
in fstab(5), use the device name we used to get here, instead of the
name from fstab, it might be different to what the real system calls the
device (compact flash root showing up as wd0 native, but sd? on the
card reader used for updating it right now).

This is an abuse of the upgrade functionality and in general pretty dangerous
when multiple devices are used in the upgraded fstab (e.g. separate /usr),
and it used to work more by accident with the old code.

However, it is a quite usefull way to upgrade tiny systems with compact flash
root, and it used to work - so support it properly (as far as we can).


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/usr.sbin/sysinst/disks.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/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.50 src/usr.sbin/sysinst/disks.c:1.51
--- src/usr.sbin/sysinst/disks.c:1.50	Thu Aug  8 13:45:19 2019
+++ src/usr.sbin/sysinst/disks.c	Tue Aug 20 06:38:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.50 2019/08/08 13:45:19 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.51 2019/08/20 06:38:17 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1484,12 +1484,14 @@ process_found_fs(struct data *list, size
 	const char *fsname = (const char*)item->var;
 	part_id pno;
 	struct disk_partitions *parts;
-	bool first;
+	size_t len;
+	bool first, is_root;
 
 	if (num < 2 || strstr(list[2].u.s_val, "noauto") != NULL)
 		return 0;
 
-	if ((strcmp(list[1].u.s_val, "/") == 0) && target_mounted())
+	is_root = strcmp(list[1].u.s_val, "/") == 0;
+	if (is_root && target_mounted())
 		return 0;
 
 	if (strcmp(item->head, name_prefix) == 0) {
@@ -1502,11 +1504,36 @@ process_found_fs(struct data *list, size
 		parts->pscheme->get_part_device(parts, pno,
 		rdev, sizeof(rdev), NULL, raw_dev_name, true);
 	} else {
-		/* plain device name */
-		strcpy(rdev, "/dev/r");
-		strlcat(rdev, list[0].u.s_val, sizeof(rdev));
-		strcpy(dev, "/dev/");
-		strlcat(dev, list[0].u.s_val, sizeof(dev));
+		/* this fstab entry uses the plain device name */
+		if (is_root) {
+			/*
+			 * PR 54480: we can not use the current device name
+			 * as it might be different from the real environment.
+			 * This is an abuse of the functionality, but it used
+			 * to work before (and still does work if only a single
+			 * target disk is involved).
+			 * Use the device name from the current "pm" instead.
+			 */
+			strcpy(rdev, "/dev/r");
+			strlcat(rdev, pm->diskdev, sizeof(rdev));
+			strcpy(dev, "/dev/");
+			strlcat(dev, pm->diskdev, sizeof(dev));
+			/* copy over the partition letter, if any */
+			len = strlen(list[0].u.s_val);
+			if (list[0].u.s_val[len-1] >= 'a' &&
+			list[0].u.s_val[len-1] <=
+			('a' + getmaxpartitions())) {
+strlcat(rdev, [0].u.s_val[len-1],
+sizeof(rdev));
+strlcat(dev, [0].u.s_val[len-1],
+sizeof(dev));
+			}
+		} else {
+			strcpy(rdev, "/dev/r");
+			strlcat(rdev, list[0].u.s_val, sizeof(rdev));
+			strcpy(dev, "/dev/");
+			strlcat(dev, list[0].u.s_val, sizeof(dev));
+		}
 	}
 
 	if (with_fsck) {



CVS commit: src/usr.sbin/sysinst

2019-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 20 06:38:18 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c

Log Message:
PR install/54480: when upgrading a system and re-mounting the target /
with proper options, and the installed system does not use NAME= syntax
in fstab(5), use the device name we used to get here, instead of the
name from fstab, it might be different to what the real system calls the
device (compact flash root showing up as wd0 native, but sd? on the
card reader used for updating it right now).

This is an abuse of the upgrade functionality and in general pretty dangerous
when multiple devices are used in the upgraded fstab (e.g. separate /usr),
and it used to work more by accident with the old code.

However, it is a quite usefull way to upgrade tiny systems with compact flash
root, and it used to work - so support it properly (as far as we can).


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/usr.sbin/sysinst/disks.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug 18 11:11:48 UTC 2019

Modified Files:
src/usr.sbin/sysinst: checkrc.c

Log Message:
Fix memory leak (found by MKSANITIZER=yes build).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/checkrc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug 18 11:11:48 UTC 2019

Modified Files:
src/usr.sbin/sysinst: checkrc.c

Log Message:
Fix memory leak (found by MKSANITIZER=yes build).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/checkrc.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/checkrc.c
diff -u src/usr.sbin/sysinst/checkrc.c:1.1 src/usr.sbin/sysinst/checkrc.c:1.2
--- src/usr.sbin/sysinst/checkrc.c:1.1	Sat Jul 26 19:30:44 2014
+++ src/usr.sbin/sysinst/checkrc.c	Sun Aug 18 11:11:48 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: checkrc.c,v 1.1 2014/07/26 19:30:44 dholland Exp $ */
+/* $NetBSD: checkrc.c,v 1.2 2019/08/18 11:11:48 martin Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -81,6 +81,7 @@ static int
 check(const char *varname, int filetocheck)
 {
 	char *buf;
+	int rv;
 
 	create_script(varname, filetocheck);
 
@@ -98,10 +99,9 @@ check(const char *varname, int filetoche
 		fflush(logfp);
 	}
 
-	if (strncmp(buf, "YES", strlen("YES")) == 0)
-		return 1;
-	else
-		return 0;
+	rv = strncmp(buf, "YES", strlen("YES")) == 0;
+	free(buf);
+	return rv;
 }
 
 int



CVS commit: src/usr.sbin/sysinst

2019-08-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug 17 18:08:06 UTC 2019

Modified Files:
src/usr.sbin/sysinst: install.c

Log Message:
Oops, avoid double free.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/install.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug 17 18:08:06 UTC 2019

Modified Files:
src/usr.sbin/sysinst: install.c

Log Message:
Oops, avoid double free.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/install.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/install.c
diff -u src/usr.sbin/sysinst/install.c:1.10 src/usr.sbin/sysinst/install.c:1.11
--- src/usr.sbin/sysinst/install.c:1.10	Sat Aug 17 18:03:12 2019
+++ src/usr.sbin/sysinst/install.c	Sat Aug 17 18:08:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: install.c,v 1.10 2019/08/17 18:03:12 martin Exp $	*/
+/*	$NetBSD: install.c,v 1.11 2019/08/17 18:08:06 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -214,8 +214,6 @@ do_install(void)
 
 	md_cleanup_install();
 
-	free(install.infos);
-
 	hit_enter_to_continue(MSG_instcomplete, NULL);
 
 error:



CVS commit: src/usr.sbin/sysinst

2019-08-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug 17 18:03:12 UTC 2019

Modified Files:
src/usr.sbin/sysinst: install.c util.c

Log Message:
Fix some memory leaks in error paths


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/install.c
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/sysinst/util.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug 17 18:03:12 UTC 2019

Modified Files:
src/usr.sbin/sysinst: install.c util.c

Log Message:
Fix some memory leaks in error paths


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/install.c
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/sysinst/util.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/install.c
diff -u src/usr.sbin/sysinst/install.c:1.9 src/usr.sbin/sysinst/install.c:1.10
--- src/usr.sbin/sysinst/install.c:1.9	Tue Jul 23 18:13:40 2019
+++ src/usr.sbin/sysinst/install.c	Sat Aug 17 18:03:12 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: install.c,v 1.9 2019/07/23 18:13:40 martin Exp $	*/
+/*	$NetBSD: install.c,v 1.10 2019/08/17 18:03:12 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -165,7 +165,7 @@ do_install(void)
 		if (!md_get_info() ||
 		!md_make_bsd_partitions()) {
 			hit_enter_to_continue(MSG_abort_inst, NULL);
-			return;
+			goto error;
 		}
 
 		/* Last chance ... do you really want to do this? */
@@ -173,7 +173,7 @@ do_install(void)
 		refresh();
 		msg_fmt_display(MSG_lastchance, "%s", pm->diskdev);
 		if (!ask_noyes(NULL))
-			return;
+			goto error;
 
 		/*
 		 * Check if we have a secondary partitioning and
@@ -194,19 +194,19 @@ do_install(void)
 		make_filesystems() ||
 		make_fstab() != 0 ||
 		md_post_newfs() != 0)
-		return;
+		goto error;
 	}
 
 	/* Unpack the distribution. */
 	process_menu(MENU_distset, );
 	if (retcode == 0)
-		return;
+		goto error;
 	if (get_and_unpack_sets(0, MSG_disksetupdone,
 	MSG_extractcomplete, MSG_abortinst) != 0)
-		return;
+		goto error;
 
 	if (md_post_extract() != 0)
-		return;
+		goto error;
 
 	do_configmenu();
 
@@ -217,4 +217,7 @@ do_install(void)
 	free(install.infos);
 
 	hit_enter_to_continue(MSG_instcomplete, NULL);
+
+error:
+	free(install.infos);
 }

Index: src/usr.sbin/sysinst/util.c
diff -u src/usr.sbin/sysinst/util.c:1.30 src/usr.sbin/sysinst/util.c:1.31
--- src/usr.sbin/sysinst/util.c:1.30	Sat Aug 17 17:51:19 2019
+++ src/usr.sbin/sysinst/util.c	Sat Aug 17 18:03:12 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.30 2019/08/17 17:51:19 martin Exp $	*/
+/*	$NetBSD: util.c,v 1.31 2019/08/17 18:03:12 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -933,6 +933,7 @@ extract_file(distinfo *dist, int update)
 			1, >name);
 			hit_enter_to_continue(err, NULL);
 			free(err);
+			free(owd);
 			return SET_RETRY;
 		}
 #ifdef SUPPORT_8_3_SOURCE_FILESYSTEM



CVS commit: src/usr.sbin/sysinst

2019-08-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug 17 17:51:19 UTC 2019

Modified Files:
src/usr.sbin/sysinst: msg.mi.de msg.mi.en msg.mi.es msg.mi.fr msg.mi.pl
util.c

Log Message:
PR 54473: fix error prompt when a set file is missing


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/sysinst/util.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug 17 17:51:19 UTC 2019

Modified Files:
src/usr.sbin/sysinst: msg.mi.de msg.mi.en msg.mi.es msg.mi.fr msg.mi.pl
util.c

Log Message:
PR 54473: fix error prompt when a set file is missing


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/sysinst/util.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/msg.mi.de
diff -u src/usr.sbin/sysinst/msg.mi.de:1.14 src/usr.sbin/sysinst/msg.mi.de:1.15
--- src/usr.sbin/sysinst/msg.mi.de:1.14	Wed Aug 14 13:02:23 2019
+++ src/usr.sbin/sysinst/msg.mi.de	Sat Aug 17 17:51:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.de,v 1.14 2019/08/14 13:02:23 martin Exp $	*/
+/*	$NetBSD: msg.mi.de,v 1.15 2019/08/17 17:51:19 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -679,8 +679,11 @@ Installation abgebrochen.}
 message delete_xfer_file
 {Nach der Installation löschen}
 
+/* Called with: 			Example
+ *  $0 = set name			base
+ */
 message notarfile
-{Das Release-Paket %s existiert nicht.}
+{Das Release-Paket $0 existiert nicht.}
 
 message endtarok
 {Alle Distributionspakete wurden erfolgreich entpackt.}

Index: src/usr.sbin/sysinst/msg.mi.en
diff -u src/usr.sbin/sysinst/msg.mi.en:1.20 src/usr.sbin/sysinst/msg.mi.en:1.21
--- src/usr.sbin/sysinst/msg.mi.en:1.20	Wed Aug 14 13:02:23 2019
+++ src/usr.sbin/sysinst/msg.mi.en	Sat Aug 17 17:51:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.20 2019/08/14 13:02:23 martin Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.21 2019/08/17 17:51:19 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -652,8 +652,11 @@ Install aborted.}
 message delete_xfer_file
 {Delete after install}
 
+/* Called with: 			Example
+ *  $0 = set name			base
+ */
 message notarfile
-{Release set %s does not exist.}
+{Release set $0 does not exist.}
 
 message endtarok
 {All selected distribution sets unpacked successfully.}

Index: src/usr.sbin/sysinst/msg.mi.es
diff -u src/usr.sbin/sysinst/msg.mi.es:1.15 src/usr.sbin/sysinst/msg.mi.es:1.16
--- src/usr.sbin/sysinst/msg.mi.es:1.15	Wed Aug 14 13:02:23 2019
+++ src/usr.sbin/sysinst/msg.mi.es	Sat Aug 17 17:51:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.es,v 1.15 2019/08/14 13:02:23 martin Exp $	*/
+/*	$NetBSD: msg.mi.es,v 1.16 2019/08/17 17:51:19 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -668,8 +668,11 @@ Instalación interrumpida.}
 message delete_xfer_file
 {A eliminar después de la instalación}
 
+/* Called with: 			Example
+ *  $0 = set name			base
+ */
 message notarfile
-{El conjunto %s no existe.}
+{El conjunto $0 no existe.}
 
 message endtarok
 {Todos los conjuntos de distribución han sido desempaquetados

Index: src/usr.sbin/sysinst/msg.mi.fr
diff -u src/usr.sbin/sysinst/msg.mi.fr:1.18 src/usr.sbin/sysinst/msg.mi.fr:1.19
--- src/usr.sbin/sysinst/msg.mi.fr:1.18	Wed Aug 14 13:02:23 2019
+++ src/usr.sbin/sysinst/msg.mi.fr	Sat Aug 17 17:51:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.fr,v 1.18 2019/08/14 13:02:23 martin Exp $	*/
+/*	$NetBSD: msg.mi.fr,v 1.19 2019/08/17 17:51:19 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -684,8 +684,11 @@ message delete_xfer_file
 Effacer après l'installation
 }
 
+/* Called with: 			Example
+ *  $0 = set name			base
+ */
 message notarfile
-{Le composant %s n'existe pas.}
+{Le composant $0 n'existe pas.}
 
 message endtarok
 {

Index: src/usr.sbin/sysinst/msg.mi.pl
diff -u src/usr.sbin/sysinst/msg.mi.pl:1.21 src/usr.sbin/sysinst/msg.mi.pl:1.22
--- src/usr.sbin/sysinst/msg.mi.pl:1.21	Wed Aug 14 13:02:23 2019
+++ src/usr.sbin/sysinst/msg.mi.pl	Sat Aug 17 17:51:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.pl,v 1.21 2019/08/14 13:02:23 martin Exp $	*/
+/*	$NetBSD: msg.mi.pl,v 1.22 2019/08/17 17:51:19 martin Exp $	*/
 /*	Based on english version: */
 /*	NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp   */
 
@@ -648,8 +648,11 @@ Instalacja przerwana.}
 message delete_xfer_file
 {Usun po zakonczeniu instalacji}
 
+/* Called with: 			Example
+ *  $0 = set name			base
+ */
 message notarfile
-{Pakiet %s nie istnieje.}
+{Pakiet $0 nie istnieje.}
 
 message endtarok
 {Wszystkie wybrane pakiety dystrybucji zostaly rozpakowane.}

Index: src/usr.sbin/sysinst/util.c
diff -u src/usr.sbin/sysinst/util.c:1.29 src/usr.sbin/sysinst/util.c:1.30
--- src/usr.sbin/sysinst/util.c:1.29	Wed Jul 24 10:22:04 2019
+++ src/usr.sbin/sysinst/util.c	Sat Aug 17 17:51:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.29 2019/07/24 10:22:04 roy Exp $	*/
+/*	$NetBSD: util.c,v 1.30 2019/08/17 17:51:19 

CVS commit: src/usr.sbin/sysinst

2019-08-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug 14 13:58:00 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disklabel.c

Log Message:
Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/disklabel.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug 14 13:58:00 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disklabel.c

Log Message:
Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/disklabel.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/disklabel.c
diff -u src/usr.sbin/sysinst/disklabel.c:1.12 src/usr.sbin/sysinst/disklabel.c:1.13
--- src/usr.sbin/sysinst/disklabel.c:1.12	Wed Aug 14 13:02:23 2019
+++ src/usr.sbin/sysinst/disklabel.c	Wed Aug 14 13:58:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.c,v 1.12 2019/08/14 13:02:23 martin Exp $	*/
+/*	$NetBSD: disklabel.c,v 1.13 2019/08/14 13:58:00 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -814,9 +814,25 @@ disklabel_get_part_device(const struct d
 part_id ptn, char *devname, size_t max_devname_len, int *part,
 enum dev_name_usage which_name, bool with_path)
 {
+	const struct disklabel_disk_partitions *parts =
+	(const struct disklabel_disk_partitions*)arg;
+	part_id id;
+	int part_index;
+	char pname;
+
+	if (ptn >= parts->l.d_npartitions)
+		return false;
+
+	for (id = part_index = 0; id < ptn &&
+	part_index < parts->l.d_npartitions; part_index++)
+		if (parts->l.d_partitions[part_index].p_fstype != FS_UNUSED ||
+		parts->l.d_partitions[part_index].p_size != 0)
+			id++;
 
 	if (part != 0)
-		*part = ptn;
+		*part = part_index;
+
+	pname = 'a'+ part_index;
 
 	switch (which_name) {
 	case parent_device_only:
@@ -826,18 +842,18 @@ disklabel_get_part_device(const struct d
 	case plain_name:
 		if (with_path)
 			snprintf(devname, max_devname_len, _PATH_DEV "%s%c",
-			arg->disk, (char)ptn + 'a');
+			arg->disk, pname);
 		else
 			snprintf(devname, max_devname_len, "%s%c",
-			arg->disk, (char)ptn + 'a');
+			arg->disk, pname);
 		return true;
 	case raw_dev_name:
 		if (with_path)
 			snprintf(devname, max_devname_len, _PATH_DEV "r%s%c",
-			arg->disk, (char)ptn + 'a');
+			arg->disk, pname);
 		else
 			snprintf(devname, max_devname_len, "r%s%c",
-			arg->disk, (char)ptn + 'a');
+			arg->disk, pname);
 		return true;
 	}
 
@@ -1024,7 +1040,7 @@ disklabel_find_by_name(struct disk_parti
 	(const struct disklabel_disk_partitions*)arg;
 	char *sl, part;
 	ptrdiff_t n;
-	part_id pno;
+	part_id pno, id, i;
 
 	sl = strrchr(name, '/');
 	if (sl == NULL)
@@ -1040,7 +1056,11 @@ disklabel_find_by_name(struct disk_parti
 		return NO_PART;
 	if (parts->l.d_partitions[pno].p_fstype == FS_UNUSED)
 		return NO_PART;
-	return pno;
+	for (id = 0, i = 0; i < pno; i++)
+		if (parts->l.d_partitions[i].p_fstype != FS_UNUSED ||
+		parts->l.d_partitions[i].p_size != 0)
+			id++;
+	return id;
 }
 
 static void



CVS commit: src/usr.sbin/sysinst

2019-08-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug 14 13:02:23 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disklabel.c gpt.c mbr.c msg.mi.de msg.mi.en
msg.mi.es msg.mi.fr msg.mi.pl partitions.c partitions.h

Log Message:
On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/gpt.c
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/sysinst/mbr.c \
src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/partitions.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/partitions.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sysinst/disklabel.c
diff -u src/usr.sbin/sysinst/disklabel.c:1.11 src/usr.sbin/sysinst/disklabel.c:1.12
--- src/usr.sbin/sysinst/disklabel.c:1.11	Wed Aug  7 10:08:04 2019
+++ src/usr.sbin/sysinst/disklabel.c	Wed Aug 14 13:02:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.c,v 1.11 2019/08/07 10:08:04 martin Exp $	*/
+/*	$NetBSD: disklabel.c,v 1.12 2019/08/14 13:02:23 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -164,7 +164,8 @@ disklabel_parts_new(const char *dev, dad
 }
 
 static struct disk_partitions *
-disklabel_parts_read(const char *disk, daddr_t start, daddr_t len)
+disklabel_parts_read(const char *disk, daddr_t start, daddr_t len,
+const struct disk_partitioning_scheme *scheme)
 {
 	int fd;
 	char diskpath[MAXPATHLEN];
@@ -214,7 +215,7 @@ disklabel_parts_read(const char *disk, d
 
 	if (len > disklabel_parts.size_limit)
 		len = disklabel_parts.size_limit;
-	parts->dp.pscheme = _parts;
+	parts->dp.pscheme = scheme;
 	parts->dp.disk = disk;
 	parts->dp.disk_start = start;
 	parts->dp.disk_size = parts->dp.free_space = len;

Index: src/usr.sbin/sysinst/gpt.c
diff -u src/usr.sbin/sysinst/gpt.c:1.9 src/usr.sbin/sysinst/gpt.c:1.10
--- src/usr.sbin/sysinst/gpt.c:1.9	Wed Aug  7 10:08:04 2019
+++ src/usr.sbin/sysinst/gpt.c	Wed Aug 14 13:02:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt.c,v 1.9 2019/08/07 10:08:04 martin Exp $	*/
+/*	$NetBSD: gpt.c,v 1.10 2019/08/14 13:02:23 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -249,7 +249,8 @@ update_part_from_wedge_info(struct gpt_d
 }
 
 static struct disk_partitions *
-gpt_read_from_disk(const char *dev, daddr_t start, daddr_t len)
+gpt_read_from_disk(const char *dev, daddr_t start, daddr_t len,
+const struct disk_partitioning_scheme *scheme)
 {
 	char diskpath[MAXPATHLEN];
 	int fd;
@@ -362,7 +363,7 @@ gpt_read_from_disk(const char *dev, dadd
 		return NULL;
 	}
 
-	parts->dp.pscheme = _parts;
+	parts->dp.pscheme = scheme;
 	parts->dp.disk = dev;
 	parts->dp.disk_start = start;
 	parts->dp.disk_size = disk_size;

Index: src/usr.sbin/sysinst/mbr.c
diff -u src/usr.sbin/sysinst/mbr.c:1.19 src/usr.sbin/sysinst/mbr.c:1.20
--- src/usr.sbin/sysinst/mbr.c:1.19	Fri Jul 26 08:18:47 2019
+++ src/usr.sbin/sysinst/mbr.c	Wed Aug 14 13:02:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbr.c,v 1.19 2019/07/26 08:18:47 martin Exp $ */
+/*	$NetBSD: mbr.c,v 1.20 2019/08/14 13:02:23 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -880,7 +880,8 @@ mbr_calc_free_space(struct mbr_disk_part
 }
 
 static struct disk_partitions *
-mbr_read_from_disk(const char *disk, daddr_t start, daddr_t len)
+mbr_read_from_disk(const char *disk, daddr_t start, daddr_t len,
+const struct disk_partitioning_scheme *scheme)
 {
 	struct mbr_disk_partitions *parts;
 
@@ -892,7 +893,7 @@ mbr_read_from_disk(const char *disk, dad
 	if (!parts)
 		return NULL;
 
-	parts->dp.pscheme = _parts;
+	parts->dp.pscheme = scheme;
 	parts->dp.disk = disk;
 	if (len >= mbr_parts.size_limit)
 		len = mbr_parts.size_limit;
@@ -1629,7 +1630,8 @@ mbr_read_disklabel(struct disk_partition
 
 		if (!force_empty)
 			myparts->dlabel = disklabel_parts.read_from_disk(
-			myparts->dp.disk, part.start, part.size);
+			myparts->dp.disk, part.start, part.size,
+			_parts);
 
 		if (myparts->dlabel == NULL && part.size > 0) {
 			/* we just created the outer partitions? */
Index: src/usr.sbin/sysinst/msg.mi.en
diff -u src/usr.sbin/sysinst/msg.mi.en:1.19 src/usr.sbin/sysinst/msg.mi.en:1.20
--- src/usr.sbin/sysinst/msg.mi.en:1.19	Tue Jul 23 18:13:40 2019
+++ src/usr.sbin/sysinst/msg.mi.en	Wed Aug 14 13:02:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.19 2019/07/23 18:13:40 martin Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.20 2019/08/14 13:02:23 martin Exp $	*/
 
 /*
  * Copyright 1997 

CVS commit: src/usr.sbin/sysinst

2019-08-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug 14 13:02:23 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disklabel.c gpt.c mbr.c msg.mi.de msg.mi.en
msg.mi.es msg.mi.fr msg.mi.pl partitions.c partitions.h

Log Message:
On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/gpt.c
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/sysinst/mbr.c \
src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/partitions.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/partitions.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst/arch

2019-08-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug 14 12:55:37 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/arc: md.c
src/usr.sbin/sysinst/arch/bebox: md.c
src/usr.sbin/sysinst/arch/cobalt: md.c
src/usr.sbin/sysinst/arch/evbarm: md.c
src/usr.sbin/sysinst/arch/evbmips: md.c
src/usr.sbin/sysinst/arch/evbppc: md.c
src/usr.sbin/sysinst/arch/hpcarm: md.c
src/usr.sbin/sysinst/arch/hpcmips: md.c
src/usr.sbin/sysinst/arch/hpcsh: md.c
src/usr.sbin/sysinst/arch/i386: md.c
src/usr.sbin/sysinst/arch/landisk: md.c
src/usr.sbin/sysinst/arch/ofppc: md.c
src/usr.sbin/sysinst/arch/playstation2: md.c
src/usr.sbin/sysinst/arch/prep: md.c
src/usr.sbin/sysinst/arch/sandpoint: md.c
src/usr.sbin/sysinst/arch/zaurus: md.c

Log Message:
When we ask the user to select a partitioning scheme and they refuse
(that is: select "Exit" in the menu), abort installation.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/arch/arc/md.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/arch/bebox/md.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/arch/cobalt/md.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/arch/evbarm/md.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/arch/evbmips/md.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/arch/evbppc/md.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/arch/hpcarm/md.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/arch/hpcmips/md.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/sysinst/arch/hpcsh/md.c
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/sysinst/arch/i386/md.c
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/arch/landisk/md.c
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sysinst/arch/ofppc/md.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/arch/playstation2/md.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/arch/prep/md.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/arch/sandpoint/md.c
cvs rdiff -u -r1.5 -r1.6 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/arch/arc/md.c
diff -u src/usr.sbin/sysinst/arch/arc/md.c:1.8 src/usr.sbin/sysinst/arch/arc/md.c:1.9
--- src/usr.sbin/sysinst/arch/arc/md.c:1.8	Sat Jul 13 17:13:36 2019
+++ src/usr.sbin/sysinst/arch/arc/md.c	Wed Aug 14 12:55:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.8 2019/07/13 17:13:36 martin Exp $ */
+/*	$NetBSD: md.c,v 1.9 2019/08/14 12:55:35 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -75,7 +75,7 @@ md_get_info(struct install_partition_des
 		select_part_scheme(pm, NULL, true, NULL);
 
 		if (!ps)
-			return true;
+			return false;
 
 		struct disk_partitions *parts =
 		   (*ps->create_new_for_disk)(pm->diskdev,

Index: src/usr.sbin/sysinst/arch/bebox/md.c
diff -u src/usr.sbin/sysinst/arch/bebox/md.c:1.5 src/usr.sbin/sysinst/arch/bebox/md.c:1.6
--- src/usr.sbin/sysinst/arch/bebox/md.c:1.5	Sat Jul 13 17:13:36 2019
+++ src/usr.sbin/sysinst/arch/bebox/md.c	Wed Aug 14 12:55:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5 2019/07/13 17:13:36 martin Exp $ */
+/*	$NetBSD: md.c,v 1.6 2019/08/14 12:55:35 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -68,7 +68,7 @@ md_get_info(struct install_partition_des
 		select_part_scheme(pm, NULL, true, NULL);
 
 		if (!ps)
-			return true;
+			return false;
 
 		struct disk_partitions *parts =
 		   (*ps->create_new_for_disk)(pm->diskdev,

Index: src/usr.sbin/sysinst/arch/cobalt/md.c
diff -u src/usr.sbin/sysinst/arch/cobalt/md.c:1.8 src/usr.sbin/sysinst/arch/cobalt/md.c:1.9
--- src/usr.sbin/sysinst/arch/cobalt/md.c:1.8	Sat Jul 13 17:13:36 2019
+++ src/usr.sbin/sysinst/arch/cobalt/md.c	Wed Aug 14 12:55:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.8 2019/07/13 17:13:36 martin Exp $ */
+/*	$NetBSD: md.c,v 1.9 2019/08/14 12:55:36 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -75,7 +75,7 @@ md_get_info(struct install_partition_des
 		select_part_scheme(pm, NULL, true, NULL);
 
 		if (!ps)
-			return true;
+			return false;
 
 		struct disk_partitions *parts =
 		   (*ps->create_new_for_disk)(pm->diskdev,

Index: src/usr.sbin/sysinst/arch/evbarm/md.c
diff -u src/usr.sbin/sysinst/arch/evbarm/md.c:1.8 src/usr.sbin/sysinst/arch/evbarm/md.c:1.9
--- src/usr.sbin/sysinst/arch/evbarm/md.c:1.8	Sat Jul 13 17:13:37 2019
+++ src/usr.sbin/sysinst/arch/evbarm/md.c	Wed Aug 14 12:55:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.8 2019/07/13 17:13:37 martin Exp $ */
+/*	$NetBSD: md.c,v 1.9 2019/08/14 12:55:36 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -82,7 +82,7 @@ md_get_info(struct install_partition_des
 		select_part_scheme(pm, NULL, true, NULL);
 
 		if (!ps)
-			return true;
+			return false;
 
 		struct disk_partitions *parts =
 		   

CVS commit: src/usr.sbin/sysinst/arch

2019-08-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug 14 12:55:37 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/arc: md.c
src/usr.sbin/sysinst/arch/bebox: md.c
src/usr.sbin/sysinst/arch/cobalt: md.c
src/usr.sbin/sysinst/arch/evbarm: md.c
src/usr.sbin/sysinst/arch/evbmips: md.c
src/usr.sbin/sysinst/arch/evbppc: md.c
src/usr.sbin/sysinst/arch/hpcarm: md.c
src/usr.sbin/sysinst/arch/hpcmips: md.c
src/usr.sbin/sysinst/arch/hpcsh: md.c
src/usr.sbin/sysinst/arch/i386: md.c
src/usr.sbin/sysinst/arch/landisk: md.c
src/usr.sbin/sysinst/arch/ofppc: md.c
src/usr.sbin/sysinst/arch/playstation2: md.c
src/usr.sbin/sysinst/arch/prep: md.c
src/usr.sbin/sysinst/arch/sandpoint: md.c
src/usr.sbin/sysinst/arch/zaurus: md.c

Log Message:
When we ask the user to select a partitioning scheme and they refuse
(that is: select "Exit" in the menu), abort installation.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/arch/arc/md.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/arch/bebox/md.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/arch/cobalt/md.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/arch/evbarm/md.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/arch/evbmips/md.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/arch/evbppc/md.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/arch/hpcarm/md.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/arch/hpcmips/md.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/sysinst/arch/hpcsh/md.c
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/sysinst/arch/i386/md.c
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/arch/landisk/md.c
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sysinst/arch/ofppc/md.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/arch/playstation2/md.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/arch/prep/md.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/arch/sandpoint/md.c
cvs rdiff -u -r1.5 -r1.6 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.



CVS commit: src/usr.sbin/sysinst

2019-08-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug 14 12:49:38 UTC 2019

Added Files:
src/usr.sbin/sysinst: README.md_defs

Log Message:
Provide some documentation for macros / defines used in the machine
dependent backend parts of sysinst.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/usr.sbin/sysinst/README.md_defs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug 14 12:49:38 UTC 2019

Added Files:
src/usr.sbin/sysinst: README.md_defs

Log Message:
Provide some documentation for macros / defines used in the machine
dependent backend parts of sysinst.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/usr.sbin/sysinst/README.md_defs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/usr.sbin/sysinst/README.md_defs
diff -u /dev/null src/usr.sbin/sysinst/README.md_defs:1.1
--- /dev/null	Wed Aug 14 12:49:38 2019
+++ src/usr.sbin/sysinst/README.md_defs	Wed Aug 14 12:49:37 2019
@@ -0,0 +1,85 @@
+/* $NetBSD: README.md_defs,v 1.1 2019/08/14 12:49:37 martin Exp $ */
+
+The following is trying to document the most important machine dependent
+defines used in the sysinst code.
+
+
+If HAVE_GPT is true, the MD code may limit the space used for the
+GPT at the beginning of the disk to allow e.g. a bootloader
+being added after it (see evbarm on allwinner SoCs, u-boot is
+copied at 8k into the image).
+
+/* Size limit for the initial GPT part, in bytes */
+#define	MD_GPT_INITIAL_SIZE		(8*1024)
+
+
+The default installation description is created as a static array using
+lots of conditionals. It may be overriden / replaced in the MD code
+(see below), an example for that is arch/i386/md.c when we have been
+booted from UEFI firmware.
+
+Name		Value / example		Description
+PART_BOOT	(8*MEG) (undefined)	if defined, a boot partition
+	of this size (in bytes, rounded)
+	will be part of the default partition
+	suggestions. Must be compile time
+	const! Use MD_PART_DEFAULTS if
+	runtime adjustment is needed.
+PART_BOOT_MOUNT	"/boot" (undefined)	Add boot partition to fstab for
+	this mount point
+PART_BOOT_TYPE	FS_BSDFS		Kind of filesystem used
+PART_BOOT_SUBT	MBR_PTYPE_FAT12		File system specific sub type
+
+
+The boot partition is always inserted at the front of the suggested default
+partitions, to cope with firmwares that may not be able to load from the
+whole disk.
+
+If multiple boot partitions are required (see ofppc, where various schemes
+are supported, depending on exact model), the variables above can all be
+repeated with _BOOT1_ or _BOOT2_ name instead of _BOOT_.
+
+
+ATTENTION:
+	PART_BOOT	is in BYTE (not MB), while most other sizes
+			(DEFROOTSIZE, DEFSWAP, ...) are in MB!
+
+
+The following macros provide optional MD hooks:
+
+MD_PART_DEFAULTS	may be undefined
+
+used like:
+
+	void MD_PART_DEFAULTS(struct pm_dev*, struct part_usage_info*,
+	size_t num_usage_infos),
+
+Called before any of the partition usage defaults is ever used, can be used
+to adjust e.g. partition sizes to actual system requirements (align boot
+partition with cylindersize), or (since it is a macro and all params are
+by references) to completely swap the defaults (e.g. EFI vs. biosboot).
+If swapping, make sure allocation and num_usage_infos stays consistent,
+old allocation is done by calloc(3), use free(3) to release.
+
+
+MD_NEED_BOOTBLOCK	may be undefined
+
+used like:
+
+	bool MD_NEED_BOOTBLOCK(struct install_partition_desc *install)
+
+returns true if this setup needs boot blocks. Used for example on x86
+when UEFI installs do not need any bootblocks, but BIOS ones do.
+
+
+HAVE_PLAIN_DISKLABEL_BOOT	may be undefined, only used on architectures
+that have MBR as primary with disklabel as
+secondary partitioning scheme (RAW_PART != 2)
+
+used like:
+
+	bool HAVE_PLAIN_DISKLABEL_BOOT(const char *disk)
+
+returns true if the disk could be made bootable with only a disklabel
+(and no MBR).
+



CVS commit: src/usr.sbin/sysinst

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 17:57:49 UTC 2019

Modified Files:
src/usr.sbin/sysinst: partman.c

Log Message:
Make sure to completely initialize dynamic menu entries.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/sysinst/partman.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 17:57:49 UTC 2019

Modified Files:
src/usr.sbin/sysinst: partman.c

Log Message:
Make sure to completely initialize dynamic menu entries.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/sysinst/partman.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/partman.c
diff -u src/usr.sbin/sysinst/partman.c:1.41 src/usr.sbin/sysinst/partman.c:1.42
--- src/usr.sbin/sysinst/partman.c:1.41	Thu Jul 25 19:01:08 2019
+++ src/usr.sbin/sysinst/partman.c	Tue Aug 13 17:57:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partman.c,v 1.41 2019/07/25 19:01:08 martin Exp $ */
+/*	$NetBSD: partman.c,v 1.42 2019/08/13 17:57:49 martin Exp $ */
 
 /*
  * Copyright 2012 Eugene Lozovoy
@@ -2802,8 +2802,7 @@ pm_upddevlist(menudesc *m, void *arg)
 		return -1;
 
 	SLIST_FOREACH(pm_i, _head, l) {
-		m->opts[i].opt_name = NULL;
-		m->opts[i].opt_exp_name = NULL;
+		memset(>opts[i], 0, sizeof m->opts[i]);
 		m->opts[i].opt_action = pm_submenu;
 		((struct part_entry *)arg)[i].dev_ptr = pm_i;
 		((struct part_entry *)arg)[i].id = NO_PART;
@@ -2837,8 +2836,7 @@ pm_upddevlist(menudesc *m, void *arg)
 if (i >= MAX_ENTRIES)
 	break;
 i++;
-m->opts[i].opt_name = NULL;
-m->opts[i].opt_exp_name = NULL;
+memset(>opts[i], 0, sizeof m->opts[i]);
 m->opts[i].opt_action = pm_submenu;
 ((struct part_entry *)arg)[i].parts =
 pm_i->parts;
@@ -2860,8 +2858,7 @@ pm_upddevlist(menudesc *m, void *arg)
 if (i >= MAX_ENTRIES)
 	break;
 i++;
-m->opts[i].opt_name = NULL;
-m->opts[i].opt_exp_name = NULL;
+memset(>opts[i], 0, sizeof m->opts[i]);
 m->opts[i].opt_action = pm_submenu;
 ((struct part_entry *)arg)[i].parts = secondary;
 ((struct part_entry *)arg)[i].dev_ptr = pm_i;



CVS commit: src/usr.sbin/sysinst

2019-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  8 13:45:19 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c

Log Message:
Do not even consider to fsck partitions where we do not know the file
system type. Add v7fs support.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.sbin/sysinst/disks.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/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.49 src/usr.sbin/sysinst/disks.c:1.50
--- src/usr.sbin/sysinst/disks.c:1.49	Thu Aug  8 11:41:16 2019
+++ src/usr.sbin/sysinst/disks.c	Thu Aug  8 13:45:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.49 2019/08/08 11:41:16 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.50 2019/08/08 13:45:19 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1121,6 +1121,8 @@ make_filesystems(struct install_partitio
 		 */
 		ptn = >infos[i];
 		parts = ptn->parts;
+		newfs = NULL;
+		fsname = NULL;
 
 		if (ptn->size == 0 || parts == NULL|| ptn->type == PT_swap)
 			continue;			
@@ -1136,7 +1138,6 @@ make_filesystems(struct install_partitio
 		parts->pscheme->get_part_device(parts, ptn->cur_part_id,
 		rdev, sizeof rdev, , raw_dev_name, true);
 
-		newfs = NULL;
 		switch (ptn->fs_type) {
 		case FS_APPLEUFS:
 			asprintf(, "/sbin/newfs");
@@ -1168,6 +1169,11 @@ make_filesystems(struct install_partitio
 			mnt_opts = "-tsysvbfs";
 			fsname = "sysvbfs";
 			break;
+		case FS_V7:
+			asprintf(, "/sbin/newfs_v7fs");
+			mnt_opts = "-tv7fs";
+			fsname = "v7fs";
+			break;
 		case FS_EX2FS:
 			asprintf(, "/sbin/newfs_ext2fs");
 			mnt_opts = "-text2fs";
@@ -1192,7 +1198,8 @@ make_filesystems(struct install_partitio
 error = run_program(RUN_DISPLAY | RUN_PROGRESS,
 			"%s %s", newfs, rdev);
 			}
-		} else if (ptn->instflags & (PUIINST_MOUNT|PUIINST_BOOT)) {
+		} else if ((ptn->instflags & (PUIINST_MOUNT|PUIINST_BOOT))
+		&& fsname != NULL) {
 			/* We'd better check it isn't dirty */
 			error = fsck_preen(devdev, fsname, false);
 		}



CVS commit: src/usr.sbin/sysinst

2019-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  8 13:45:19 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c

Log Message:
Do not even consider to fsck partitions where we do not know the file
system type. Add v7fs support.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.sbin/sysinst/disks.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  8 11:41:16 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c

Log Message:
Do not try to fsck partitions we are never going to mount.
Found by Andreas Gustafsson's baremetal test bed.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/usr.sbin/sysinst/disks.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/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.48 src/usr.sbin/sysinst/disks.c:1.49
--- src/usr.sbin/sysinst/disks.c:1.48	Wed Aug  7 10:12:32 2019
+++ src/usr.sbin/sysinst/disks.c	Thu Aug  8 11:41:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.48 2019/08/07 10:12:32 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.49 2019/08/08 11:41:16 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1192,7 +1192,7 @@ make_filesystems(struct install_partitio
 error = run_program(RUN_DISPLAY | RUN_PROGRESS,
 			"%s %s", newfs, rdev);
 			}
-		} else {
+		} else if (ptn->instflags & (PUIINST_MOUNT|PUIINST_BOOT)) {
 			/* We'd better check it isn't dirty */
 			error = fsck_preen(devdev, fsname, false);
 		}



CVS commit: src/usr.sbin/sysinst

2019-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  8 11:41:16 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c

Log Message:
Do not try to fsck partitions we are never going to mount.
Found by Andreas Gustafsson's baremetal test bed.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/usr.sbin/sysinst/disks.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug  7 10:12:32 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c

Log Message:
When creating the /etc/fstab for new installs, the sense of the "noauto"
flag was inverted (editor mishap?)


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/sysinst/disks.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/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.47 src/usr.sbin/sysinst/disks.c:1.48
--- src/usr.sbin/sysinst/disks.c:1.47	Wed Aug  7 10:08:04 2019
+++ src/usr.sbin/sysinst/disks.c	Wed Aug  7 10:12:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.47 2019/08/07 10:08:04 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.48 2019/08/07 10:12:32 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1352,7 +1352,7 @@ make_fstab(struct install_partition_desc
 		  "%s%s\t\t%s\t%s\trw%s%s%s%s%s%s%s%s\t\t %d %d\n",
 		   s, dev, mp, fstype,
 		   ptn->mountflags & PUIMNT_LOG ? ",log" : "",
-		   ptn->mountflags & PUIMNT_NOAUTO ? "" : ",noauto",
+		   ptn->mountflags & PUIMNT_NOAUTO ? ",noauto" : "",
 		   ptn->mountflags & PUIMNT_ASYNC ? ",async" : "",
 		   ptn->mountflags & PUIMNT_NOATIME ? ",noatime" : "",
 		   ptn->mountflags & PUIMNT_NODEV ? ",nodev" : "",



CVS commit: src/usr.sbin/sysinst

2019-08-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug  7 10:12:32 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c

Log Message:
When creating the /etc/fstab for new installs, the sense of the "noauto"
flag was inverted (editor mishap?)


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/sysinst/disks.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug  7 10:08:04 UTC 2019

Modified Files:
src/usr.sbin/sysinst: defs.h disklabel.c disks.c gpt.c partitions.h
target.c txtwalk.c txtwalk.h
src/usr.sbin/sysinst/arch/ews4800mips: md.h

Log Message:
Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.46 -r1.47 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/gpt.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/sysinst/partitions.h
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/target.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/txtwalk.c \
src/usr.sbin/sysinst/txtwalk.h
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/arch/ews4800mips/md.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug  7 10:08:04 UTC 2019

Modified Files:
src/usr.sbin/sysinst: defs.h disklabel.c disks.c gpt.c partitions.h
target.c txtwalk.c txtwalk.h
src/usr.sbin/sysinst/arch/ews4800mips: md.h

Log Message:
Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.46 -r1.47 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/gpt.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/sysinst/partitions.h
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/target.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/txtwalk.c \
src/usr.sbin/sysinst/txtwalk.h
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/arch/ews4800mips/md.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.42 src/usr.sbin/sysinst/defs.h:1.43
--- src/usr.sbin/sysinst/defs.h:1.42	Fri Jul 26 08:18:47 2019
+++ src/usr.sbin/sysinst/defs.h	Wed Aug  7 10:08:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.42 2019/07/26 08:18:47 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.43 2019/08/07 10:08:04 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -806,6 +806,7 @@ int	target_file_exists_p(const char *);
 int	target_symlink_exists_p(const char *);
 void	unwind_mounts(void);
 int	target_mounted(void);
+void	umount_root(void);
 
 /* from partman.c */
 #ifndef NO_PARTMAN

Index: src/usr.sbin/sysinst/disklabel.c
diff -u src/usr.sbin/sysinst/disklabel.c:1.10 src/usr.sbin/sysinst/disklabel.c:1.11
--- src/usr.sbin/sysinst/disklabel.c:1.10	Fri Jul 26 08:18:47 2019
+++ src/usr.sbin/sysinst/disklabel.c	Wed Aug  7 10:08:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.c,v 1.10 2019/07/26 08:18:47 martin Exp $	*/
+/*	$NetBSD: disklabel.c,v 1.11 2019/08/07 10:08:04 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -1016,6 +1016,32 @@ disklabel_get_alignment(const struct dis
 	return parts->ptn_alignment;
 }
 
+static part_id
+disklabel_find_by_name(struct disk_partitions *arg, const char *name)
+{
+	const struct disklabel_disk_partitions *parts =
+	(const struct disklabel_disk_partitions*)arg;
+	char *sl, part;
+	ptrdiff_t n;
+	part_id pno;
+
+	sl = strrchr(name, '/');
+	if (sl == NULL)
+		return NO_PART;
+	n = sl - name;
+	if (strncmp(name, parts->l.d_packname, n) != 0)
+		return NO_PART;
+	part = name[n+1];
+	if (part < 'a')
+		return NO_PART;
+	pno = part - 'a';
+	if (pno >= parts->l.d_npartitions)
+		return NO_PART;
+	if (parts->l.d_partitions[pno].p_fstype == FS_UNUSED)
+		return NO_PART;
+	return pno;
+}
+
 static void
 disklabel_free(struct disk_partitions *arg)
 {
@@ -1034,6 +1060,7 @@ disklabel_parts = {
 	.read_from_disk = disklabel_parts_read,
 	.create_new_for_disk = disklabel_parts_new,
 	.change_disk_geom = disklabel_change_geom,
+	.find_by_name = disklabel_find_by_name,
 	.get_disk_pack_name = disklabel_get_disk_pack_name,
 	.set_disk_pack_name = disklabel_set_disk_pack_name,
 	.delete_all_partitions = disklabel_delete_all,

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.46 src/usr.sbin/sysinst/disks.c:1.47
--- src/usr.sbin/sysinst/disks.c:1.46	Sat Aug  3 12:09:22 2019
+++ src/usr.sbin/sysinst/disks.c	Wed Aug  7 10:08:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.46 2019/08/03 12:09:22 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.47 2019/08/07 10:08:04 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -46,6 +46,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -80,13 +81,22 @@ struct disk_desc {
 	daddr_t	dd_totsec;
 };
 
-static const char name_prefix[] = "NAME=";
+#define	NAME_PREFIX	"NAME="
+static const char name_prefix[] = NAME_PREFIX;
+
+/* things we could have as /sbin/newfs_* and /sbin/fsck_* */
+static const char *extern_fs_with_chk[] = {
+	"ext2fs", "lfs", "msdos", "v7fs"
+};
+
+/* things we could have as /sbin/newfs_* but not /sbin/fsck_* */
+static const char *extern_fs_newfs_only[] = {
+	"sysvbfs", "udf"
+};
 
 /* Local prototypes */
-static int foundffs(struct data *, size_t);
-#ifdef USE_SYSVBFS
-static int foundsysvbfs(struct data *, size_t);
-#endif
+static int found_fs(struct data *, size_t, const struct lookfor*);
+static int found_fs_nocheck(struct data *, size_t, const struct lookfor*);
 static int fsck_preen(const char *, const char *, bool silent);
 static void fixsb(const char *, const char *);
 
@@ -1153,20 +1163,16 @@ make_filesystems(struct install_partitio
 			mnt_opts = "-tmsdos";
 			fsname = "msdos";
 			

CVS commit: src/usr.sbin/sysinst

2019-08-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug  4 10:29:42 UTC 2019

Modified Files:
src/usr.sbin/sysinst: label.c

Log Message:
Fix copy: when we find a FFSv1 filesystem, properly record it
that way - so the correct bootblocks get installed on system upgrades.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sysinst/label.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug  4 10:29:42 UTC 2019

Modified Files:
src/usr.sbin/sysinst: label.c

Log Message:
Fix copy: when we find a FFSv1 filesystem, properly record it
that way - so the correct bootblocks get installed on system upgrades.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sysinst/label.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/label.c
diff -u src/usr.sbin/sysinst/label.c:1.11 src/usr.sbin/sysinst/label.c:1.12
--- src/usr.sbin/sysinst/label.c:1.11	Thu Aug  1 16:32:06 2019
+++ src/usr.sbin/sysinst/label.c	Sun Aug  4 10:29:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: label.c,v 1.11 2019/08/01 16:32:06 martin Exp $	*/
+/*	$NetBSD: label.c,v 1.12 2019/08/04 10:29:41 martin Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.11 2019/08/01 16:32:06 martin Exp $");
+__RCSID("$NetBSD: label.c,v 1.12 2019/08/04 10:29:41 martin Exp $");
 #endif
 
 #include 
@@ -1578,7 +1578,7 @@ get_last_mounted(int fd, daddr_t partsta
 			if (fs_type)
 *fs_type = FS_BSDFFS;
 			if (fs_sub_type)
-*fs_sub_type = 2;
+*fs_sub_type = 1;
 			continue;
 		case FS_UFS2_MAGIC:
 		case FS_UFS2_MAGIC_SWAPPED:



CVS commit: src/usr.sbin/sysinst

2019-08-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug  3 14:00:42 UTC 2019

Modified Files:
src/usr.sbin/sysinst: gpt.c

Log Message:
When reading an existing gpt, match the wedges already existing ons
on the parent device, so we can use them directly if we should proceed
with an unmodified partition table.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sysinst/gpt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug  3 14:00:42 UTC 2019

Modified Files:
src/usr.sbin/sysinst: gpt.c

Log Message:
When reading an existing gpt, match the wedges already existing ons
on the parent device, so we can use them directly if we should proceed
with an unmodified partition table.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sysinst/gpt.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/gpt.c
diff -u src/usr.sbin/sysinst/gpt.c:1.7 src/usr.sbin/sysinst/gpt.c:1.8
--- src/usr.sbin/sysinst/gpt.c:1.7	Fri Aug  2 10:44:22 2019
+++ src/usr.sbin/sysinst/gpt.c	Sat Aug  3 14:00:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt.c,v 1.7 2019/08/02 10:44:22 martin Exp $	*/
+/*	$NetBSD: gpt.c,v 1.8 2019/08/03 14:00:42 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -228,11 +228,34 @@ gpt_add_info(struct gpt_part_entry *part
 	}
 }
 
+/*
+ * Find the partition matching this wedge info and record that we
+ * have a wedge already.
+ */
+static void
+update_part_from_wedge_info(struct gpt_disk_partitions *parts,
+const struct dkwedge_info *dkw)
+{
+	for (struct gpt_part_entry *p = parts->partitions; p != NULL;
+	p = p->gp_next) {
+		if (p->gp_start != dkw->dkw_offset ||
+		(uint64_t)p->gp_size != dkw->dkw_size)
+			continue;
+		p->gp_flags |= GPEF_WEDGE;
+		strlcpy(p->gp_dev_name, dkw->dkw_devname,
+		sizeof p->gp_dev_name);
+		return;
+	}
+}
+
 static struct disk_partitions *
 gpt_read_from_disk(const char *dev, daddr_t start, daddr_t len)
 {
 	char diskpath[MAXPATHLEN];
 	int fd;
+	struct dkwedge_info *dkw;
+	struct dkwedge_list dkwl;
+	size_t bufsize, dk;
 
 	assert(start == 0);
 	assert(have_gpt);
@@ -384,6 +407,26 @@ gpt_read_from_disk(const char *dev, dadd
 
 		parts->dp.free_space -= p->gp_size;
 	}
+
+	/*
+	 * Check if we have any (matching/auto-configured) wedges already
+	 */
+	dkw = NULL;
+	dkwl.dkwl_buf = dkw;
+	dkwl.dkwl_bufsize = 0;
+	if (ioctl(fd, DIOCLWEDGES, ) == 0) {
+		/* do not even try to deal with any races at this point */
+		bufsize = dkwl.dkwl_nwedges * sizeof(*dkw);
+		dkw = malloc(bufsize);
+		dkwl.dkwl_buf = dkw;
+		dkwl.dkwl_bufsize = bufsize;
+		if (dkw != NULL && ioctl(fd, DIOCLWEDGES, ) == 0) {
+			for (dk = 0; dk < dkwl.dkwl_ncopied; dk++)
+update_part_from_wedge_info(parts, [dk]);
+		}
+		free(dkw);
+	}
+
 	close(fd);
 
 	return >dp;



CVS commit: src/usr.sbin/sysinst

2019-08-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug  3 12:09:22 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c

Log Message:
Properly handle partitions that we were requested to mount but not newfs.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.sbin/sysinst/disks.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/sysinst

2019-08-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug  3 12:09:22 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c

Log Message:
Properly handle partitions that we were requested to mount but not newfs.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.sbin/sysinst/disks.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/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.45 src/usr.sbin/sysinst/disks.c:1.46
--- src/usr.sbin/sysinst/disks.c:1.45	Thu Aug  1 16:32:06 2019
+++ src/usr.sbin/sysinst/disks.c	Sat Aug  3 12:09:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.45 2019/08/01 16:32:06 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.46 2019/08/03 12:09:22 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1112,17 +1112,14 @@ make_filesystems(struct install_partitio
 		ptn = >infos[i];
 		parts = ptn->parts;
 
-		if (ptn->size == 0 || parts == NULL)
-			continue;
+		if (ptn->size == 0 || parts == NULL|| ptn->type == PT_swap)
+			continue;			
 
 		if (parts->pscheme->get_part_device(parts, ptn->cur_part_id,
 		devdev, sizeof devdev, , parent_device_only, false)
 		&& is_active_rootpart(devdev, partno))
 			continue;
 
-		if (!(ptn->instflags & PUIINST_NEWFS))
-			continue;
-
 		parts->pscheme->get_part_device(parts, ptn->cur_part_id,
 		devdev, sizeof devdev, , plain_name, true);
 



  1   2   3   >