CVS commit: [netbsd-9] src/usr.sbin/sysinst

2023-01-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan  2 10:13:31 UTC 2023

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: defs.h disklabel.c
src/usr.sbin/sysinst/arch/amiga [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/x68k [netbsd-9]: md.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1559):

usr.sbin/sysinst/arch/x68k/md.c: revision 1.13
usr.sbin/sysinst/disklabel.c: revision 1.49
usr.sbin/sysinst/defs.h: revision 1.85
usr.sbin/sysinst/arch/amiga/md.c: revision 1.8
usr.sbin/sysinst/arch/amiga/md.c: revision 1.9

Check on-disk disklabel properly even on ports without raw BSD disklabel.
Fixes PR install/56890.

Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.42.2.11 -r1.42.2.12 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.10.2.11 -r1.10.2.12 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.5.2.3 -r1.5.2.4 src/usr.sbin/sysinst/arch/amiga/md.c
cvs rdiff -u -r1.8.2.4 -r1.8.2.5 src/usr.sbin/sysinst/arch/x68k/md.c

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

Modified files:

Index: src/usr.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.42.2.11 src/usr.sbin/sysinst/defs.h:1.42.2.12
--- src/usr.sbin/sysinst/defs.h:1.42.2.11	Mon Feb 14 06:45:34 2022
+++ src/usr.sbin/sysinst/defs.h	Mon Jan  2 10:13:30 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.42.2.11 2022/02/14 06:45:34 msaitoh Exp $	*/
+/*	$NetBSD: defs.h,v 1.42.2.12 2023/01/02 10:13:30 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -643,6 +643,7 @@ bool	md_gpt_post_write(struct disk_parti
  */
 bool	md_pre_disklabel(struct install_partition_desc*, struct disk_partitions*);
 bool	md_post_disklabel(struct install_partition_desc*, struct disk_partitions*);
+bool	md_disklabel_is_default(const struct disklabel *);
 int	md_pre_mount(struct install_partition_desc*, size_t);
 int	md_post_newfs(struct install_partition_desc*);
 int	md_post_extract(struct install_partition_desc*, bool upgrade);

Index: src/usr.sbin/sysinst/disklabel.c
diff -u src/usr.sbin/sysinst/disklabel.c:1.10.2.11 src/usr.sbin/sysinst/disklabel.c:1.10.2.12
--- src/usr.sbin/sysinst/disklabel.c:1.10.2.11	Sat Dec 31 05:03:14 2022
+++ src/usr.sbin/sysinst/disklabel.c	Mon Jan  2 10:13:30 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.c,v 1.10.2.11 2022/12/31 05:03:14 snj Exp $	*/
+/*	$NetBSD: disklabel.c,v 1.10.2.12 2023/01/02 10:13:30 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -198,16 +198,7 @@ disklabel_parts_read(const char *disk, d
 	int fd;
 	char diskpath[MAXPATHLEN];
 	uint flags;
-#ifndef DISKLABEL_NO_ONDISK_VERIFY
-	bool have_raw_label = false;
-
-	/*
-	 * Verify we really have a disklabel.
-	 */
-	if (run_program(RUN_SILENT | RUN_ERROR_OK,
-	"disklabel -r %s", disk) == 0)
-		have_raw_label = true;
-#endif
+	bool have_own_label = false;
 
 	/* read partitions */
 
@@ -304,8 +295,30 @@ disklabel_parts_read(const char *disk, d
 	}
 	close(fd);
 
-#ifndef DISKLABEL_NO_ONDISK_VERIFY
-	if (!have_raw_label) {
+	/*
+	 * Verify we really have a disklabel on the target disk.
+	 */
+	if (run_program(RUN_SILENT | RUN_ERROR_OK,
+	"disklabel -r %s", disk) == 0) {
+		have_own_label = true;
+	}
+#ifdef DISKLABEL_NO_ONDISK_VERIFY
+	else {
+		/*
+		 * disklabel(8) with -r checks a native disklabel at
+		 * LABELOFFSET sector, but several ports don't have
+		 * a native label and use emulated one translated from
+		 * port specific MD disk partition information.
+		 * Unfortunately, there is no MI way to check whether
+		 * the disk has a native BSD disklabel by readdisklabel(9)
+		 * via DIOCGDINFO.  So check if returned label looks
+		 * defaults set by readdisklabel(9) per MD way.
+		 */
+		have_own_label = !md_disklabel_is_default(>l);
+	}
+#endif
+
+	if (!have_own_label) {
 		bool found_real_part = false;
 
 		if (parts->l.d_npartitions <= RAW_PART ||
@@ -338,7 +351,6 @@ no_valid_label:
 			return NULL;
 		}
 	}
-#endif
 
 	return >dp;
 }

Index: src/usr.sbin/sysinst/arch/amiga/md.c
diff -u src/usr.sbin/sysinst/arch/amiga/md.c:1.5.2.3 src/usr.sbin/sysinst/arch/amiga/md.c:1.5.2.4
--- src/usr.sbin/sysinst/arch/amiga/md.c:1.5.2.3	Wed Dec 14 15:39:45 2022
+++ src/usr.sbin/sysinst/arch/amiga/md.c	Mon Jan  2 10:13:30 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.3 2022/12/14 15:39:45 snj Exp $ */
+/*	$NetBSD: md.c,v 1.5.2.4 2023/01/02 10:13:30 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -101,6 +101,25 @@ md_post_disklabel(struct install_partiti
 	return true;
 }
 
+#ifdef DISKLABEL_NO_ONDISK_VERIFY
+/*
+ * hook to check if disklabel returned by readdisklabel(9) via DIOCGDINFO
+ * seems the default one, on ports that have no BSD disklabel on disks.
+ */
+bool
+md_disklabel_is_default(const struct disklabel *lp)
+{
+	bool maybe_default =
+	lp->d_npartitions == RAW_PART + 1 &&
+	

CVS commit: [netbsd-9] src/usr.sbin/sysinst

2023-01-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan  2 10:13:31 UTC 2023

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: defs.h disklabel.c
src/usr.sbin/sysinst/arch/amiga [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/x68k [netbsd-9]: md.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1559):

usr.sbin/sysinst/arch/x68k/md.c: revision 1.13
usr.sbin/sysinst/disklabel.c: revision 1.49
usr.sbin/sysinst/defs.h: revision 1.85
usr.sbin/sysinst/arch/amiga/md.c: revision 1.8
usr.sbin/sysinst/arch/amiga/md.c: revision 1.9

Check on-disk disklabel properly even on ports without raw BSD disklabel.
Fixes PR install/56890.

Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.42.2.11 -r1.42.2.12 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.10.2.11 -r1.10.2.12 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.5.2.3 -r1.5.2.4 src/usr.sbin/sysinst/arch/amiga/md.c
cvs rdiff -u -r1.8.2.4 -r1.8.2.5 src/usr.sbin/sysinst/arch/x68k/md.c

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



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2022-12-30 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Dec 31 05:03:14 UTC 2022

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disklabel.c label.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1558):
usr.sbin/sysinst/disklabel.c: 1.46-1.48
usr.sbin/sysinst/label.c: 1.40-1.41

disklabel_can_add_partition() did not consider additional partitions
(while there still is space in the disklabel). Part of PR 56886.

Fix free space accounting for partition size changes and deletions.
Part of PR 56886.

renumber_partitions() needs to deal with removed/added partitions.

Fix free space accounting when partitions change size or are deleted.
Part of PR 56886.

Fix inverted condition in previous and only apply special handling for
the "all of NetBSD" partition when we have an outer MBR label.
Pointed out by Izumi Tsutsui. Hopefully the last fix needed for PR 56886.


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.10 -r1.10.2.11 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.10.2.8 -r1.10.2.9 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: [netbsd-9] src/usr.sbin/sysinst

2022-12-30 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Dec 31 05:03:14 UTC 2022

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disklabel.c label.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1558):
usr.sbin/sysinst/disklabel.c: 1.46-1.48
usr.sbin/sysinst/label.c: 1.40-1.41

disklabel_can_add_partition() did not consider additional partitions
(while there still is space in the disklabel). Part of PR 56886.

Fix free space accounting for partition size changes and deletions.
Part of PR 56886.

renumber_partitions() needs to deal with removed/added partitions.

Fix free space accounting when partitions change size or are deleted.
Part of PR 56886.

Fix inverted condition in previous and only apply special handling for
the "all of NetBSD" partition when we have an outer MBR label.
Pointed out by Izumi Tsutsui. Hopefully the last fix needed for PR 56886.


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.10 -r1.10.2.11 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.10.2.8 -r1.10.2.9 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/disklabel.c
diff -u src/usr.sbin/sysinst/disklabel.c:1.10.2.10 src/usr.sbin/sysinst/disklabel.c:1.10.2.11
--- src/usr.sbin/sysinst/disklabel.c:1.10.2.10	Thu Oct 15 19:36:50 2020
+++ src/usr.sbin/sysinst/disklabel.c	Sat Dec 31 05:03:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.c,v 1.10.2.10 2020/10/15 19:36:50 bouyer Exp $	*/
+/*	$NetBSD: disklabel.c,v 1.10.2.11 2022/12/31 05:03:14 snj Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -520,6 +520,8 @@ disklabel_delete(struct disk_partitions 
 			if (parts->install_target ==
 			parts->l.d_partitions[part].p_offset)
 parts->install_target = -1;
+			parts->dp.free_space +=
+			parts->l.d_partitions[part].p_size;
 			parts->l.d_partitions[part].p_size = 0;
 			parts->l.d_partitions[part].p_offset = 0;
 			parts->l.d_partitions[part].p_fstype = FS_UNUSED;
@@ -821,6 +823,16 @@ disklabel_set_part_info(struct disk_part
 			was_inst_target = parts->l.d_partitions[part].p_offset
 			== parts->install_target;
 			parts->l.d_partitions[part].p_offset = info->start;
+			if (part != RAW_PART
+#if RAW_PART == 3
+&& (part != RAW_PART-1 ||
+parts->dp.parent == NULL)
+#endif
+			) {
+parts->dp.free_space +=
+parts->l.d_partitions[part].p_size -
+info->size;
+			}
 			parts->l.d_partitions[part].p_size = info->size;
 			parts->l.d_partitions[part].p_fstype =
 			dl_part_type_from_generic(info->nat_type);
@@ -939,7 +951,8 @@ disklabel_can_add_partition(const struct
 	if (disklabel_get_free_spaces_internal(parts, , 1,
 	parts->ptn_alignment, parts->ptn_alignment, 0, -1) < 1)
 		return false;
-
+	if (parts->l.d_npartitions < dl_maxpart)
+		return true;
 	for (i = 0; i < parts->l.d_npartitions; i++) {
 		if (i == RAW_PART)
 			continue;

Index: src/usr.sbin/sysinst/label.c
diff -u src/usr.sbin/sysinst/label.c:1.10.2.8 src/usr.sbin/sysinst/label.c:1.10.2.9
--- src/usr.sbin/sysinst/label.c:1.10.2.8	Wed Jun 22 23:48:54 2022
+++ src/usr.sbin/sysinst/label.c	Sat Dec 31 05:03:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: label.c,v 1.10.2.8 2022/06/22 23:48:54 msaitoh Exp $	*/
+/*	$NetBSD: label.c,v 1.10.2.9 2022/12/31 05:03:14 snj Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.10.2.8 2022/06/22 23:48:54 msaitoh Exp $");
+__RCSID("$NetBSD: label.c,v 1.10.2.9 2022/12/31 05:03:14 snj Exp $");
 #endif
 
 #include 
@@ -505,7 +505,7 @@ renumber_partitions(struct partition_usa
 		if (!pset->parts->pscheme->get_part_info(pset->parts, pno,
 		))
 			continue;
-		for (i = 0; i < pset->parts->num_part; i++) {
+		for (i = 0; i < pset->num; i++) {
 			if (pset->infos[i].cur_start != info.start)
 continue;
 			if (pset->infos[i].cur_flags != info.flags)
@@ -522,8 +522,9 @@ renumber_partitions(struct partition_usa
 		}
 	}
 
-	memcpy(pset->infos, ninfos, sizeof(*pset->infos)*pset->parts->num_part);
-	free(ninfos);
+	free(pset->infos);
+	pset->infos = ninfos;
+	pset->num = pset->parts->num_part;
 }
 
 /*
@@ -980,6 +981,9 @@ edit_ptn(menudesc *menu, void *arg)
 			if (!pset->parts->pscheme->set_part_info(pset->parts,
 			edit.id, , ))
 err_msg_win(err);
+			else
+pset->cur_free_space += edit.old_info.size -
+edit.info.size;
 		}
 
 		/*
@@ -1009,7 +1013,7 @@ edit_ptn(menudesc *menu, void *arg)
 		}
 		remember_deleted(pset,
 		pset->infos[edit.index].parts);
-		pset->cur_free_space += pset->infos[edit.index].size;
+		pset->cur_free_space += edit.info.size;
 		memmove(pset->infos+edit.index,
 		pset->infos+edit.index+1,
 		sizeof(*pset->infos)*(pset->num-edit.index));



CVS commit: [netbsd-9] src/usr.sbin/sysinst/arch

2022-12-14 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Dec 14 15:39:46 UTC 2022

Modified Files:
src/usr.sbin/sysinst/arch/amiga [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/atari [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/dummy [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/sparc [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/sparc64 [netbsd-9]: md.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1554):

usr.sbin/sysinst/arch/amiga/md.c: revision 1.10
usr.sbin/sysinst/arch/atari/md.c: revision 1.10
usr.sbin/sysinst/arch/dummy/md.c: revision 1.8
usr.sbin/sysinst/arch/sparc/md.c: revision 1.8
usr.sbin/sysinst/arch/sparc64/md.c: revision 1.8

Add set_default_sizemult() calls to some architectures obviously
lacking it.


To generate a diff of this commit:
cvs rdiff -u -r1.5.2.2 -r1.5.2.3 src/usr.sbin/sysinst/arch/amiga/md.c
cvs rdiff -u -r1.6.2.2 -r1.6.2.3 src/usr.sbin/sysinst/arch/atari/md.c
cvs rdiff -u -r1.5.2.2 -r1.5.2.3 src/usr.sbin/sysinst/arch/dummy/md.c
cvs rdiff -u -r1.5.2.2 -r1.5.2.3 src/usr.sbin/sysinst/arch/sparc/md.c
cvs rdiff -u -r1.5.2.2 -r1.5.2.3 src/usr.sbin/sysinst/arch/sparc64/md.c

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



CVS commit: [netbsd-9] src/usr.sbin/sysinst/arch

2022-12-14 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Dec 14 15:39:46 UTC 2022

Modified Files:
src/usr.sbin/sysinst/arch/amiga [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/atari [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/dummy [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/sparc [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/sparc64 [netbsd-9]: md.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1554):

usr.sbin/sysinst/arch/amiga/md.c: revision 1.10
usr.sbin/sysinst/arch/atari/md.c: revision 1.10
usr.sbin/sysinst/arch/dummy/md.c: revision 1.8
usr.sbin/sysinst/arch/sparc/md.c: revision 1.8
usr.sbin/sysinst/arch/sparc64/md.c: revision 1.8

Add set_default_sizemult() calls to some architectures obviously
lacking it.


To generate a diff of this commit:
cvs rdiff -u -r1.5.2.2 -r1.5.2.3 src/usr.sbin/sysinst/arch/amiga/md.c
cvs rdiff -u -r1.6.2.2 -r1.6.2.3 src/usr.sbin/sysinst/arch/atari/md.c
cvs rdiff -u -r1.5.2.2 -r1.5.2.3 src/usr.sbin/sysinst/arch/dummy/md.c
cvs rdiff -u -r1.5.2.2 -r1.5.2.3 src/usr.sbin/sysinst/arch/sparc/md.c
cvs rdiff -u -r1.5.2.2 -r1.5.2.3 src/usr.sbin/sysinst/arch/sparc64/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/amiga/md.c
diff -u src/usr.sbin/sysinst/arch/amiga/md.c:1.5.2.2 src/usr.sbin/sysinst/arch/amiga/md.c:1.5.2.3
--- src/usr.sbin/sysinst/arch/amiga/md.c:1.5.2.2	Wed Feb  2 04:25:38 2022
+++ src/usr.sbin/sysinst/arch/amiga/md.c	Wed Dec 14 15:39:45 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.2 2022/02/02 04:25:38 msaitoh Exp $ */
+/*	$NetBSD: md.c,v 1.5.2.3 2022/12/14 15:39:45 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -59,6 +59,7 @@ md_init_set_status(int flags)
 bool
 md_get_info(struct install_partition_desc *install)
 {
+	set_default_sizemult(pm->diskdev, MEG, pm->sectorsize);
 	return true;
 }
 

Index: src/usr.sbin/sysinst/arch/atari/md.c
diff -u src/usr.sbin/sysinst/arch/atari/md.c:1.6.2.2 src/usr.sbin/sysinst/arch/atari/md.c:1.6.2.3
--- src/usr.sbin/sysinst/arch/atari/md.c:1.6.2.2	Wed Feb  2 04:25:38 2022
+++ src/usr.sbin/sysinst/arch/atari/md.c	Wed Dec 14 15:39:45 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.6.2.2 2022/02/02 04:25:38 msaitoh Exp $ */
+/*	$NetBSD: md.c,v 1.6.2.3 2022/12/14 15:39:45 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -59,6 +59,7 @@ md_init_set_status(int flags)
 bool
 md_get_info(struct install_partition_desc *install)
 {
+	set_default_sizemult(pm->diskdev, MEG, pm->sectorsize);
 	return true;
 }
 

Index: src/usr.sbin/sysinst/arch/dummy/md.c
diff -u src/usr.sbin/sysinst/arch/dummy/md.c:1.5.2.2 src/usr.sbin/sysinst/arch/dummy/md.c:1.5.2.3
--- src/usr.sbin/sysinst/arch/dummy/md.c:1.5.2.2	Wed Feb  2 04:25:38 2022
+++ src/usr.sbin/sysinst/arch/dummy/md.c	Wed Dec 14 15:39:46 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.2 2022/02/02 04:25:38 msaitoh Exp $	*/
+/*	$NetBSD: md.c,v 1.5.2.3 2022/12/14 15:39:46 snj Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -52,6 +52,7 @@ md_init_set_status(int flags)
 bool
 md_get_info(struct install_partition_desc *desc)
 {
+	set_default_sizemult(pm->diskdev, MEG, pm->sectorsize);
 	return true;
 }
 

Index: src/usr.sbin/sysinst/arch/sparc/md.c
diff -u src/usr.sbin/sysinst/arch/sparc/md.c:1.5.2.2 src/usr.sbin/sysinst/arch/sparc/md.c:1.5.2.3
--- src/usr.sbin/sysinst/arch/sparc/md.c:1.5.2.2	Wed Feb  2 04:25:40 2022
+++ src/usr.sbin/sysinst/arch/sparc/md.c	Wed Dec 14 15:39:46 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.2 2022/02/02 04:25:40 msaitoh Exp $	*/
+/*	$NetBSD: md.c,v 1.5.2.3 2022/12/14 15:39:46 snj Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -67,6 +67,7 @@ md_init_set_status(int flags)
 bool
 md_get_info(struct install_partition_desc *install)
 {
+	set_default_sizemult(pm->diskdev, MEG, pm->sectorsize);
 	return true;
 }
 

Index: src/usr.sbin/sysinst/arch/sparc64/md.c
diff -u src/usr.sbin/sysinst/arch/sparc64/md.c:1.5.2.2 src/usr.sbin/sysinst/arch/sparc64/md.c:1.5.2.3
--- src/usr.sbin/sysinst/arch/sparc64/md.c:1.5.2.2	Wed Feb  2 04:25:36 2022
+++ src/usr.sbin/sysinst/arch/sparc64/md.c	Wed Dec 14 15:39:46 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5.2.2 2022/02/02 04:25:36 msaitoh Exp $	*/
+/*	$NetBSD: md.c,v 1.5.2.3 2022/12/14 15:39:46 snj Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -68,6 +68,8 @@ md_init_set_status(int flags)
 bool
 md_get_info(struct install_partition_desc *install)
 {
+
+	set_default_sizemult(pm->diskdev, MEG, pm->sectorsize);
 	return true;
 }
 



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2022-12-14 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Dec 14 15:36:52 UTC 2022

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: bsddisklabel.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1553):

usr.sbin/sysinst/bsddisklabel.c: revision 1.67

A little less (confusing) magic: adjust the size of / when adding /usr
only if / has not beenn manually resized.


To generate a diff of this commit:
cvs rdiff -u -r1.23.2.11 -r1.23.2.12 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.23.2.11 src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.12
--- src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.11	Thu Oct 15 19:36:50 2020
+++ src/usr.sbin/sysinst/bsddisklabel.c	Wed Dec 14 15:36:52 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.23.2.11 2020/10/15 19:36:50 bouyer Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.23.2.12 2022/12/14 15:36:52 snj Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -653,18 +653,23 @@ set_ptn_size(menudesc *m, void *arg)
 }
 			}
 			/* Remove space for /usr from / */
-			if (root < pset->num && pset->infos[i].cur_part_id ==
-			NO_PART) {
-				pset->infos[root].size -= p->def_size;
+			if (root < pset->num &&
+			 pset->infos[root].cur_part_id == NO_PART &&
+			 pset->infos[root].size ==
+	pset->infos[root].def_size) {
+/*
+ * root partition does not yet exist and
+ * has default size
+ */
+pset->infos[root].size -= p->def_size;
 pset->cur_free_space += p->def_size;
 			}
-			/* hack to add free space to default sized /usr */
-			if (strcmp(answer, dflt) == 0) {
-size = p->def_size;
-pset->infos[root].flags &= ~PUIFLAG_EXTEND;
-p->flags |= PUIFLAG_EXTEND;
-goto adjust_free;
-			}
+			/*
+			 * hack to add free space to /usr if
+			 * previously / got it
+			 */
+			if (pset->infos[root].flags & PUIFLAG_EXTEND)
+extend = true;
 		}
 		if (new_size_val < 0)
 			continue;
@@ -687,7 +692,6 @@ set_ptn_size(menudesc *m, void *arg)
 	}
 	if (p->limit != 0 && size > p->limit)
 		size = p->limit;
-adjust_free:
 	if ((p->flags & (PUIFLG_IS_OUTER|PUIFLG_JUST_MOUNTPOINT)) == 0)
 		pset->cur_free_space += p->size - size;
 	p->size = is_percent ? -size : size;
@@ -1205,6 +1209,7 @@ fill_defaults(struct partition_usage_set
 			wanted->infos[root].limit;
 		}
 	}
+	wanted->infos[root].def_size = wanted->infos[root].size;
 }
 
 /*



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2022-12-14 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Dec 14 15:36:52 UTC 2022

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: bsddisklabel.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1553):

usr.sbin/sysinst/bsddisklabel.c: revision 1.67

A little less (confusing) magic: adjust the size of / when adding /usr
only if / has not beenn manually resized.


To generate a diff of this commit:
cvs rdiff -u -r1.23.2.11 -r1.23.2.12 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: [netbsd-9] src/usr.sbin/sysinst/arch/landisk

2022-10-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Oct  4 17:14:08 UTC 2022

Modified Files:
src/usr.sbin/sysinst/arch/landisk [netbsd-9]: md.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1535):
usr.sbin/sysinst/arch/landisk/md.c: revision 1.16
PR install/57025: revert bogus rev 1.9 which was only papering over
a bug in the adoption of the MBR handling code and fix the original
conversion bug instead:
 - run fdisk to install the MBR bootcode on the raw disk partition
 - run installboot against the NetBSD root partition (not the raw partition).


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.4 -r1.10.2.5 src/usr.sbin/sysinst/arch/landisk/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/landisk/md.c
diff -u src/usr.sbin/sysinst/arch/landisk/md.c:1.10.2.4 src/usr.sbin/sysinst/arch/landisk/md.c:1.10.2.5
--- src/usr.sbin/sysinst/arch/landisk/md.c:1.10.2.4	Wed Feb  2 04:25:39 2022
+++ src/usr.sbin/sysinst/arch/landisk/md.c	Tue Oct  4 17:14:08 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.10.2.4 2022/02/02 04:25:39 msaitoh Exp $	*/
+/*	$NetBSD: md.c,v 1.10.2.5 2022/10/04 17:14:08 snj Exp $	*/
 
 /*
  * Copyright 1997,2002 Piermont Information Systems Inc.
@@ -130,7 +130,9 @@ md_pre_disklabel(struct install_partitio
 	msg_string(parts->pscheme->short_name));
 
 	/* write edited "MBR" onto disk. */
-	if (!parts->pscheme->write_to_disk(parts)) {
+	if (!parts->pscheme->write_to_disk(parts) ||
+	run_program(RUN_SILENT | RUN_ERROR_OK,
+	"/sbin/fdisk -f -i -c /usr/mdec/mbr %s", parts->disk)) {
 		msg_display(MSG_wmbrfail);
 		process_menu(MENU_ok, NULL);
 		return false;
@@ -166,7 +168,7 @@ md_post_newfs(struct install_partition_d
 	bootxx = bootxx_name(install);
 	if (bootxx != NULL) {
 		error = run_program(RUN_DISPLAY,
-		"/usr/sbin/installboot -v /dev/r%sd %s", pm->diskdev, bootxx);
+		"/usr/sbin/installboot -v /dev/r%sa %s", pm->diskdev, bootxx);
 		free(bootxx);
 	} else
 		error = -1;



CVS commit: [netbsd-9] src/usr.sbin/sysinst/arch/landisk

2022-10-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Oct  4 17:14:08 UTC 2022

Modified Files:
src/usr.sbin/sysinst/arch/landisk [netbsd-9]: md.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1535):
usr.sbin/sysinst/arch/landisk/md.c: revision 1.16
PR install/57025: revert bogus rev 1.9 which was only papering over
a bug in the adoption of the MBR handling code and fix the original
conversion bug instead:
 - run fdisk to install the MBR bootcode on the raw disk partition
 - run installboot against the NetBSD root partition (not the raw partition).


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.4 -r1.10.2.5 src/usr.sbin/sysinst/arch/landisk/md.c

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



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2022-06-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jun 22 23:48:54 UTC 2022

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: label.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1476):
usr.sbin/sysinst/label.c: revision 1.39
PR 56893: fix input validation when the user moves a new partition to
a totaly different part of the disk. Fix size handling for freshly
added partitions (which would previously use random stack data due to
bogus error checking).


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.7 -r1.10.2.8 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.10.2.7 src/usr.sbin/sysinst/label.c:1.10.2.8
--- src/usr.sbin/sysinst/label.c:1.10.2.7	Wed May 12 06:53:55 2021
+++ src/usr.sbin/sysinst/label.c	Wed Jun 22 23:48:54 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: label.c,v 1.10.2.7 2021/05/12 06:53:55 msaitoh Exp $	*/
+/*	$NetBSD: label.c,v 1.10.2.8 2022/06/22 23:48:54 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.10.2.7 2021/05/12 06:53:55 msaitoh Exp $");
+__RCSID("$NetBSD: label.c,v 1.10.2.8 2022/06/22 23:48:54 msaitoh Exp $");
 #endif
 
 #include 
@@ -258,14 +258,18 @@ edit_fs_start(menudesc *m, void *arg)
 
 	start = getpartoff(edit->pset->parts, edit->info.start);
 	if (edit->info.size != 0) {
-		/* Try to keep end in the same place */
-		end = edit->info.start + edit->info.size;
-		if (end < start)
-			edit->info.size = edit->pset->parts->pscheme->
-			max_free_space_at(edit->pset->parts,
-			edit->info.start);
-		else
-			edit->info.size = end - start;
+		if (start < (edit->info.start+edit->info.size)) {
+			/* Try to keep end in the same place */
+			end = edit->info.start + edit->info.size;
+			if (end < start)
+edit->info.size = edit->pset->parts->pscheme->
+max_free_space_at(edit->pset->parts,
+edit->info.start);
+			else
+edit->info.size = end - start;
+		} else {
+			edit->info.size = 0;
+		}
 	}
 	edit->info.start = start;
 	return 0;
@@ -279,8 +283,9 @@ edit_fs_size(menudesc *m, void *arg)
 	daddr_t size;
 
 	/* get original partition data, in case start moved already */
-	edit->pset->parts->pscheme->get_part_info(edit->pset->parts,
-	edit->id, );
+	if (!edit->pset->parts->pscheme->get_part_info(edit->pset->parts,
+	edit->id, ))
+		pinfo = edit->info;
 	/* ask for new size with old start and current values */
 	size = getpartsize(edit->pset->parts, pinfo.start,
 	edit->info.start, edit->info.size);



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2022-06-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jun 22 23:48:54 UTC 2022

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: label.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1476):
usr.sbin/sysinst/label.c: revision 1.39
PR 56893: fix input validation when the user moves a new partition to
a totaly different part of the disk. Fix size handling for freshly
added partitions (which would previously use random stack data due to
bogus error checking).


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.7 -r1.10.2.8 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: [netbsd-9] src/usr.sbin/sysinst

2022-02-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Feb 14 06:45:34 UTC 2022

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: defs.h target.c
src/usr.sbin/sysinst/arch/i386 [netbsd-9]: md.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1427):
usr.sbin/sysinst/defs.h: revision 1.80
usr.sbin/sysinst/target.c: revision 1.18
usr.sbin/sysinst/arch/i386/md.c: revision 1.35
x86: fix previous: in the UEFI case copy the bootloaders from install
media during initial installation, but use the (by then: updated)
files from the target disk for system upgrades.


To generate a diff of this commit:
cvs rdiff -u -r1.42.2.10 -r1.42.2.11 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.8.2.6 -r1.8.2.7 src/usr.sbin/sysinst/target.c
cvs rdiff -u -r1.20.2.9 -r1.20.2.10 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/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.42.2.10 src/usr.sbin/sysinst/defs.h:1.42.2.11
--- src/usr.sbin/sysinst/defs.h:1.42.2.10	Wed Feb  2 04:25:36 2022
+++ src/usr.sbin/sysinst/defs.h	Mon Feb 14 06:45:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.42.2.10 2022/02/02 04:25:36 msaitoh Exp $	*/
+/*	$NetBSD: defs.h,v 1.42.2.11 2022/02/14 06:45:34 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -899,6 +899,7 @@ void	dup_file_into_target(const char *);
 void	mv_within_target_or_die(const char *, const char *);
 int	cp_within_target(const char *, const char *, int);
 int	target_mount(const char *, const char *, const char *);
+int	target_unmount(const char *);
 int	target_mount_do(const char *, const char *, const char *);
 int	target_test(unsigned int, const char *);
 int	target_dir_exists_p(const char *);

Index: src/usr.sbin/sysinst/target.c
diff -u src/usr.sbin/sysinst/target.c:1.8.2.6 src/usr.sbin/sysinst/target.c:1.8.2.7
--- src/usr.sbin/sysinst/target.c:1.8.2.6	Wed Feb  2 04:25:36 2022
+++ src/usr.sbin/sysinst/target.c	Mon Feb 14 06:45:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: target.c,v 1.8.2.6 2022/02/02 04:25:36 msaitoh Exp $	*/
+/*	$NetBSD: target.c,v 1.8.2.7 2022/02/14 06:45:34 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -71,7 +71,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: target.c,v 1.8.2.6 2022/02/02 04:25:36 msaitoh Exp $");
+__RCSID("$NetBSD: target.c,v 1.8.2.7 2022/02/14 06:45:34 msaitoh Exp $");
 #endif
 
 /*
@@ -527,6 +527,33 @@ target_mount(const char *opts, const cha
 	return target_mount_do(opts, from, on);
 }
 
+int
+target_unmount(const char *mount_point)
+{
+	struct unwind_mount *m, *prev = NULL;
+	int error;
+
+	for (m = unwind_mountlist; m != NULL; prev = m, m = m->um_prev)
+		if (strcmp(m->um_mountpoint, mount_point) == 0)
+			break;
+
+	if (m == NULL)
+		return ENOTDIR;
+
+	error = run_program(0, "/sbin/umount %s%s",
+		target_prefix(), m->um_mountpoint);
+	if (error)
+		return error;
+
+	if (m == unwind_mountlist)
+		unwind_mountlist = m->um_prev;
+	else
+		prev->um_prev = m->um_prev;
+	free(m);
+
+	return 0;
+}
+
 static bool
 delete_wedge(const char *disk, const char *wedge)
 {

Index: src/usr.sbin/sysinst/arch/i386/md.c
diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.20.2.9 src/usr.sbin/sysinst/arch/i386/md.c:1.20.2.10
--- src/usr.sbin/sysinst/arch/i386/md.c:1.20.2.9	Wed Feb  2 04:25:37 2022
+++ src/usr.sbin/sysinst/arch/i386/md.c	Mon Feb 14 06:45:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.20.2.9 2022/02/02 04:25:37 msaitoh Exp $ */
+/*	$NetBSD: md.c,v 1.20.2.10 2022/02/14 06:45:34 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -334,9 +334,10 @@ md_post_newfs_bios(struct install_partit
  * boot partition (or update them).
  */
 static int
-copy_uefi_boot(const struct part_usage_info *boot)
+copy_uefi_boot(const struct part_usage_info *boot, bool target_is_populated)
 {
 	char dev[MAXPATHLEN], path[MAXPATHLEN], src[MAXPATHLEN];
+	const char *s;
 	size_t i;
 	int err;
 
@@ -364,13 +365,18 @@ copy_uefi_boot(const struct part_usage_i
 	make_target_dir(path);
 
 	for (i = 0; i < __arraycount(uefi_bootloaders); i++) {
-		strcpy(src, target_expand(uefi_bootloaders[i]));
+		s = uefi_bootloaders[i];
+		strcpy(src, target_is_populated ? target_expand(s) : s);
 		if (access(src, R_OK) != 0)
 			continue;
-		err = cp_within_target(uefi_bootloaders[i], path, 0);
+		err = target_is_populated ?
+		cp_within_target(s, path, 0) :
+		cp_to_target(s, path);
 		if (err)
 			return err;
 	}
+	if (boot->mount[0] == 0)
+		target_unmount("/mnt");
 
 	return 0;
 }
@@ -379,7 +385,8 @@ copy_uefi_boot(const struct part_usage_i
  * Find (U)EFI boot partition and install/update bootloaders
  */
 static int
-update_uefi_boot_code(struct install_partition_desc *install)
+update_uefi_boot_code(struct install_partition_desc *install,
+bool target_is_populated)
 {
 	

CVS commit: [netbsd-9] src/usr.sbin/sysinst

2022-02-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Feb 14 06:45:34 UTC 2022

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: defs.h target.c
src/usr.sbin/sysinst/arch/i386 [netbsd-9]: md.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1427):
usr.sbin/sysinst/defs.h: revision 1.80
usr.sbin/sysinst/target.c: revision 1.18
usr.sbin/sysinst/arch/i386/md.c: revision 1.35
x86: fix previous: in the UEFI case copy the bootloaders from install
media during initial installation, but use the (by then: updated)
files from the target disk for system upgrades.


To generate a diff of this commit:
cvs rdiff -u -r1.42.2.10 -r1.42.2.11 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.8.2.6 -r1.8.2.7 src/usr.sbin/sysinst/target.c
cvs rdiff -u -r1.20.2.9 -r1.20.2.10 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: [netbsd-9] src/usr.sbin/sysinst

2022-02-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb  2 04:25:41 UTC 2022

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

Log Message:
Pull up following revision(s) (requested by martin in ticket #1422):
usr.sbin/sysinst/util.c: revision 1.64
usr.sbin/sysinst/arch/hpcsh/md.c: revision 1.11
usr.sbin/sysinst/arch/alpha/md.c: revision 1.10
usr.sbin/sysinst/arch/sparc64/md.c: revision 1.7
usr.sbin/sysinst/arch/emips/md.c: revision 1.10
usr.sbin/sysinst/arch/cobalt/md.c: revision 1.15
usr.sbin/sysinst/arch/x68k/md.c: revision 1.12
usr.sbin/sysinst/arch/sandpoint/md.c: revision 1.10
usr.sbin/sysinst/arch/luna68k/md.c: revision 1.10
usr.sbin/sysinst/arch/hp300/md.c: revision 1.12
usr.sbin/sysinst/arch/vax/md.c: revision 1.8
usr.sbin/sysinst/arch/hpcmips/md.c: revision 1.10
usr.sbin/sysinst/target.c: revision 1.16
usr.sbin/sysinst/arch/mvme68k/md.c: revision 1.12
usr.sbin/sysinst/arch/arc/md.c: revision 1.14
usr.sbin/sysinst/target.c: revision 1.17
usr.sbin/sysinst/arch/i386/md.c: revision 1.34
usr.sbin/sysinst/arch/mac68k/md.c: revision 1.11
usr.sbin/sysinst/arch/atari/md.c: revision 1.8
usr.sbin/sysinst/arch/sgimips/md.c: revision 1.10
usr.sbin/sysinst/arch/acorn32/md.c: revision 1.8
usr.sbin/sysinst/install.c: revision 1.22
usr.sbin/sysinst/arch/amiga/md.c: revision 1.7
usr.sbin/sysinst/arch/cats/md.c: revision 1.6
usr.sbin/sysinst/arch/dummy/md.c: revision 1.7
usr.sbin/sysinst/arch/shark/md.c: revision 1.7
usr.sbin/sysinst/arch/pmax/md.c: revision 1.9
usr.sbin/sysinst/arch/newsmips/md.c: revision 1.7
usr.sbin/sysinst/arch/mipsco/md.c: revision 1.9
usr.sbin/sysinst/arch/landisk/md.c: revision 1.15
usr.sbin/sysinst/arch/hppa/md.c: revision 1.9
usr.sbin/sysinst/arch/prep/md.c: revision 1.14
usr.sbin/sysinst/defs.h: revision 1.77
usr.sbin/sysinst/arch/ofppc/md.c: revision 1.13
usr.sbin/sysinst/arch/ews4800mips/md.c: revision 1.8
usr.sbin/sysinst/defs.h: revision 1.78
usr.sbin/sysinst/arch/macppc/md.c: revision 1.7
usr.sbin/sysinst/arch/evbppc/md.c: revision 1.10
usr.sbin/sysinst/defs.h: revision 1.79
usr.sbin/sysinst/gpt.c: revision 1.27
usr.sbin/sysinst/arch/bebox/md.c: revision 1.10
usr.sbin/sysinst/gpt.c: revision 1.28
usr.sbin/sysinst/arch/sparc/md.c: 

CVS commit: [netbsd-9] src/usr.sbin/sysinst

2022-02-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb  2 04:25:41 UTC 2022

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

Log Message:
Pull up following revision(s) (requested by martin in ticket #1422):
usr.sbin/sysinst/util.c: revision 1.64
usr.sbin/sysinst/arch/hpcsh/md.c: revision 1.11
usr.sbin/sysinst/arch/alpha/md.c: revision 1.10
usr.sbin/sysinst/arch/sparc64/md.c: revision 1.7
usr.sbin/sysinst/arch/emips/md.c: revision 1.10
usr.sbin/sysinst/arch/cobalt/md.c: revision 1.15
usr.sbin/sysinst/arch/x68k/md.c: revision 1.12
usr.sbin/sysinst/arch/sandpoint/md.c: revision 1.10
usr.sbin/sysinst/arch/luna68k/md.c: revision 1.10
usr.sbin/sysinst/arch/hp300/md.c: revision 1.12
usr.sbin/sysinst/arch/vax/md.c: revision 1.8
usr.sbin/sysinst/arch/hpcmips/md.c: revision 1.10
usr.sbin/sysinst/target.c: revision 1.16
usr.sbin/sysinst/arch/mvme68k/md.c: revision 1.12
usr.sbin/sysinst/arch/arc/md.c: revision 1.14
usr.sbin/sysinst/target.c: revision 1.17
usr.sbin/sysinst/arch/i386/md.c: revision 1.34
usr.sbin/sysinst/arch/mac68k/md.c: revision 1.11
usr.sbin/sysinst/arch/atari/md.c: revision 1.8
usr.sbin/sysinst/arch/sgimips/md.c: revision 1.10
usr.sbin/sysinst/arch/acorn32/md.c: revision 1.8
usr.sbin/sysinst/install.c: revision 1.22
usr.sbin/sysinst/arch/amiga/md.c: revision 1.7
usr.sbin/sysinst/arch/cats/md.c: revision 1.6
usr.sbin/sysinst/arch/dummy/md.c: revision 1.7
usr.sbin/sysinst/arch/shark/md.c: revision 1.7
usr.sbin/sysinst/arch/pmax/md.c: revision 1.9
usr.sbin/sysinst/arch/newsmips/md.c: revision 1.7
usr.sbin/sysinst/arch/mipsco/md.c: revision 1.9
usr.sbin/sysinst/arch/landisk/md.c: revision 1.15
usr.sbin/sysinst/arch/hppa/md.c: revision 1.9
usr.sbin/sysinst/arch/prep/md.c: revision 1.14
usr.sbin/sysinst/defs.h: revision 1.77
usr.sbin/sysinst/arch/ofppc/md.c: revision 1.13
usr.sbin/sysinst/arch/ews4800mips/md.c: revision 1.8
usr.sbin/sysinst/defs.h: revision 1.78
usr.sbin/sysinst/arch/macppc/md.c: revision 1.7
usr.sbin/sysinst/arch/evbppc/md.c: revision 1.10
usr.sbin/sysinst/defs.h: revision 1.79
usr.sbin/sysinst/gpt.c: revision 1.27
usr.sbin/sysinst/arch/bebox/md.c: revision 1.10
usr.sbin/sysinst/gpt.c: revision 1.28
usr.sbin/sysinst/arch/sparc/md.c: 

CVS commit: [netbsd-9] src/usr.sbin/sysinst

2022-01-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 20 11:45:28 UTC 2022

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: msg.mi.de msg.mi.en msg.mi.es
msg.mi.fr msg.mi.pl net.c

Log Message:
Pull up following revision(s) (requested by nia in ticket #1406):

usr.sbin/sysinst/net.c: revision 1.40
usr.sbin/sysinst/msg.mi.pl: revision 1.37
usr.sbin/sysinst/msg.mi.fr: revision 1.36
usr.sbin/sysinst/msg.mi.de: revision 1.35
usr.sbin/sysinst/msg.mi.en: revision 1.37
usr.sbin/sysinst/net.c: revision 1.37
usr.sbin/sysinst/net.c: revision 1.38
usr.sbin/sysinst/msg.mi.es: revision 1.31
usr.sbin/sysinst/net.c: revision 1.39

sysinst(8): Add initial support for connecting to Wi-Fi networks
by spawning wpa_supplicant.
Reviewed by martin.

sysinst(8): Avoid asking Wi-Fi questions about non-Wi-Fi devices.

sysinst(8): Add a "data" argument to do_ifreq that is set after the
ifr struct is zeroed.

This allows us to simplify the code by not having 2x socket creation
code for checking whether interfaces are wireless.
sysinst(8): use scan_ssid=1 so hidden wifi networks can be used


To generate a diff of this commit:
cvs rdiff -u -r1.13.2.9 -r1.13.2.10 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.19.2.10 -r1.19.2.11 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.14.2.9 -r1.14.2.10 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.17.2.10 -r1.17.2.11 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.20.2.10 -r1.20.2.11 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.33.2.2 -r1.33.2.3 src/usr.sbin/sysinst/net.c

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



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2022-01-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 20 11:45:28 UTC 2022

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: msg.mi.de msg.mi.en msg.mi.es
msg.mi.fr msg.mi.pl net.c

Log Message:
Pull up following revision(s) (requested by nia in ticket #1406):

usr.sbin/sysinst/net.c: revision 1.40
usr.sbin/sysinst/msg.mi.pl: revision 1.37
usr.sbin/sysinst/msg.mi.fr: revision 1.36
usr.sbin/sysinst/msg.mi.de: revision 1.35
usr.sbin/sysinst/msg.mi.en: revision 1.37
usr.sbin/sysinst/net.c: revision 1.37
usr.sbin/sysinst/net.c: revision 1.38
usr.sbin/sysinst/msg.mi.es: revision 1.31
usr.sbin/sysinst/net.c: revision 1.39

sysinst(8): Add initial support for connecting to Wi-Fi networks
by spawning wpa_supplicant.
Reviewed by martin.

sysinst(8): Avoid asking Wi-Fi questions about non-Wi-Fi devices.

sysinst(8): Add a "data" argument to do_ifreq that is set after the
ifr struct is zeroed.

This allows us to simplify the code by not having 2x socket creation
code for checking whether interfaces are wireless.
sysinst(8): use scan_ssid=1 so hidden wifi networks can be used


To generate a diff of this commit:
cvs rdiff -u -r1.13.2.9 -r1.13.2.10 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.19.2.10 -r1.19.2.11 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.14.2.9 -r1.14.2.10 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.17.2.10 -r1.17.2.11 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.20.2.10 -r1.20.2.11 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.33.2.2 -r1.33.2.3 src/usr.sbin/sysinst/net.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.13.2.9 src/usr.sbin/sysinst/msg.mi.de:1.13.2.10
--- src/usr.sbin/sysinst/msg.mi.de:1.13.2.9	Thu Nov  5 08:10:21 2020
+++ src/usr.sbin/sysinst/msg.mi.de	Thu Jan 20 11:45:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.de,v 1.13.2.9 2020/11/05 08:10:21 sborrill Exp $	*/
+/*	$NetBSD: msg.mi.de,v 1.13.2.10 2022/01/20 11:45:28 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -639,6 +639,12 @@ message net_defroute
 message net_media
 {Art der Netzwerkverbindung}
 
+message net_ssid
+{WLAN-SSID?}
+
+message net_passphrase
+{WLAN-Passwort?}
+
 message netok
 {Nachfolgend sehen Sie die aktuellen Netzwerkeinstellungen.
 

Index: src/usr.sbin/sysinst/msg.mi.en
diff -u src/usr.sbin/sysinst/msg.mi.en:1.19.2.10 src/usr.sbin/sysinst/msg.mi.en:1.19.2.11
--- src/usr.sbin/sysinst/msg.mi.en:1.19.2.10	Thu Nov  5 08:10:21 2020
+++ src/usr.sbin/sysinst/msg.mi.en	Thu Jan 20 11:45:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.19.2.10 2020/11/05 08:10:21 sborrill Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.19.2.11 2022/01/20 11:45:28 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -616,6 +616,12 @@ message net_defroute
 message net_media
 {Network media type}
 
+message net_ssid
+{Wi-Fi SSID?}
+
+message net_passphrase
+{Wi-Fi passphrase?}
+
 message netok
 {The following are the values you entered.
 

Index: src/usr.sbin/sysinst/msg.mi.es
diff -u src/usr.sbin/sysinst/msg.mi.es:1.14.2.9 src/usr.sbin/sysinst/msg.mi.es:1.14.2.10
--- src/usr.sbin/sysinst/msg.mi.es:1.14.2.9	Thu Nov  5 08:10:21 2020
+++ src/usr.sbin/sysinst/msg.mi.es	Thu Jan 20 11:45:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.es,v 1.14.2.9 2020/11/05 08:10:21 sborrill Exp $	*/
+/*	$NetBSD: msg.mi.es,v 1.14.2.10 2022/01/20 11:45:28 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -632,6 +632,12 @@ message net_defroute
 message net_media
 {Tipo de medio de la red}
 
+message net_ssid
+{Wi-Fi SSID?}
+
+message net_passphrase
+{Wi-Fi passphrase?}
+
 message netok
 {Ha introducido los siguientes valores.
 

Index: src/usr.sbin/sysinst/msg.mi.fr
diff -u src/usr.sbin/sysinst/msg.mi.fr:1.17.2.10 src/usr.sbin/sysinst/msg.mi.fr:1.17.2.11
--- src/usr.sbin/sysinst/msg.mi.fr:1.17.2.10	Thu Nov  5 08:10:21 2020
+++ src/usr.sbin/sysinst/msg.mi.fr	Thu Jan 20 11:45:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.fr,v 1.17.2.10 2020/11/05 08:10:21 sborrill Exp $	*/
+/*	$NetBSD: msg.mi.fr,v 1.17.2.11 2022/01/20 11:45:28 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -626,6 +626,12 @@ message net_defroute
 message net_media
 {Type de réseau (média)}
 
+message net_ssid
+{Wi-Fi SSID?}
+
+message net_passphrase
+{Wi-Fi passphrase?}
+
 message netok
 {Vous avez spécifié les valeurs suivantes :
 

Index: src/usr.sbin/sysinst/msg.mi.pl
diff -u src/usr.sbin/sysinst/msg.mi.pl:1.20.2.10 src/usr.sbin/sysinst/msg.mi.pl:1.20.2.11
--- src/usr.sbin/sysinst/msg.mi.pl:1.20.2.10	Thu Nov  5 08:10:21 2020
+++ src/usr.sbin/sysinst/msg.mi.pl	Thu Jan 20 11:45:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.pl,v 1.20.2.10 2020/11/05 08:10:21 sborrill Exp $	*/
+/*	$NetBSD: msg.mi.pl,v 1.20.2.11 2022/01/20 

CVS commit: [netbsd-9] src/usr.sbin/sysinst

2021-08-18 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Aug 19 04:52:10 UTC 2021

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: defs.h disks.c upgrade.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1333):
usr.sbin/sysinst/defs.h: revision 1.72
usr.sbin/sysinst/disks.c: revision 1.75
usr.sbin/sysinst/upgrade.c: revision 1.18
PR 56354: all actions to set up swap space are not guaranteed to gain
us enough virtual memory anyway, so drop return codes from set_swap*.
The state for cleanup (which swap dev to unuse) has been made global
some time ago anyway.
Previously use of the return values was inconsistent. Error reporting
will only confuse users and sometimes the situation is hard to fix or
even impossible (like in miniroots copide to swap space for booting).


To generate a diff of this commit:
cvs rdiff -u -r1.42.2.8 -r1.42.2.9 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.44.2.15 -r1.44.2.16 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.12.2.3 -r1.12.2.4 src/usr.sbin/sysinst/upgrade.c

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

Modified files:

Index: src/usr.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.42.2.8 src/usr.sbin/sysinst/defs.h:1.42.2.9
--- src/usr.sbin/sysinst/defs.h:1.42.2.8	Thu Oct 15 19:36:51 2020
+++ src/usr.sbin/sysinst/defs.h	Thu Aug 19 04:52:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.42.2.8 2020/10/15 19:36:51 bouyer Exp $	*/
+/*	$NetBSD: defs.h,v 1.42.2.9 2021/08/19 04:52:10 snj Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -696,13 +696,8 @@ void	disp_cur_fspart(int, int);
 int	make_filesystems(struct install_partition_desc *);
 int	make_fstab(struct install_partition_desc *);
 int	mount_disks(struct install_partition_desc *);
-/*
- * set_swap_if_low_ram and set_swap return -1 on error,
- * 0 if no swap was added on purpose and
- * 1 if swap has been added (and needs to be cleared later).
- */
-int	set_swap_if_low_ram(struct install_partition_desc *);
-int	set_swap(struct install_partition_desc *);
+void	set_swap_if_low_ram(struct install_partition_desc *);
+void	set_swap(struct install_partition_desc *);
 void	clear_swap(void);
 int	check_swap(const char *, int);
 char *bootxx_name(struct install_partition_desc *);

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.44.2.15 src/usr.sbin/sysinst/disks.c:1.44.2.16
--- src/usr.sbin/sysinst/disks.c:1.44.2.15	Thu Oct 15 19:36:50 2020
+++ src/usr.sbin/sysinst/disks.c	Thu Aug 19 04:52:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.44.2.15 2020/10/15 19:36:50 bouyer Exp $ */
+/*	$NetBSD: disks.c,v 1.44.2.16 2021/08/19 04:52:10 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1915,16 +1915,15 @@ mount_disks(struct install_partition_des
 
 static char swap_dev[PATH_MAX];
 
-int
+void
 set_swap_if_low_ram(struct install_partition_desc *install)
 {
 	swap_dev[0] = 0;
 	if (get_ramsize() <= TINY_RAM_SIZE)
-		return set_swap(install);
-	return 0;
+		set_swap(install);
 }
 
-int
+void
 set_swap(struct install_partition_desc *install)
 {
 	size_t i;
@@ -1936,20 +1935,16 @@ set_swap(struct install_partition_desc *
 			break;
 	}
 	if (i >= install->num)
-		return 0;
+		return;
 
 	if (!install->infos[i].parts->pscheme->get_part_device(
 	install->infos[i].parts, install->infos[i].cur_part_id, swap_dev,
 	sizeof swap_dev, NULL, plain_name, true, true))
-		return -1;
+		return;
 
 	rval = swapctl(SWAP_ON, swap_dev, 0);
-	if (rval != 0) {
+	if (rval != 0)
 		swap_dev[0] = 0;
-		return -1;
-	}
-
-	return 1;
 }
 
 void

Index: src/usr.sbin/sysinst/upgrade.c
diff -u src/usr.sbin/sysinst/upgrade.c:1.12.2.3 src/usr.sbin/sysinst/upgrade.c:1.12.2.4
--- src/usr.sbin/sysinst/upgrade.c:1.12.2.3	Mon Feb 10 21:39:37 2020
+++ src/usr.sbin/sysinst/upgrade.c	Thu Aug 19 04:52:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: upgrade.c,v 1.12.2.3 2020/02/10 21:39:37 bouyer Exp $	*/
+/*	$NetBSD: upgrade.c,v 1.12.2.4 2021/08/19 04:52:10 snj Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -81,8 +81,7 @@ do_upgrade(void)
 		install.cur_system = true;
 	}
 
-	if (set_swap_if_low_ram() < 0)
-		return;
+	set_swap_if_low_ram();
 
 	if (md_pre_update() < 0)
 		goto free_install;



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2021-08-18 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Aug 19 04:52:10 UTC 2021

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: defs.h disks.c upgrade.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1333):
usr.sbin/sysinst/defs.h: revision 1.72
usr.sbin/sysinst/disks.c: revision 1.75
usr.sbin/sysinst/upgrade.c: revision 1.18
PR 56354: all actions to set up swap space are not guaranteed to gain
us enough virtual memory anyway, so drop return codes from set_swap*.
The state for cleanup (which swap dev to unuse) has been made global
some time ago anyway.
Previously use of the return values was inconsistent. Error reporting
will only confuse users and sometimes the situation is hard to fix or
even impossible (like in miniroots copide to swap space for booting).


To generate a diff of this commit:
cvs rdiff -u -r1.42.2.8 -r1.42.2.9 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.44.2.15 -r1.44.2.16 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.12.2.3 -r1.12.2.4 src/usr.sbin/sysinst/upgrade.c

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



CVS commit: [netbsd-9] src/usr.sbin/sysinst/arch/i386

2019-11-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 19 06:19:04 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/i386 [netbsd-9]: md.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #443):
usr.sbin/sysinst/arch/i386/md.c: revision 1.25
usr.sbin/sysinst/arch/i386/md.c: revision 1.26
Fix previous: the install medium may not have /usr/mdec/prekern; it was
meant to copy the one from the just installed system.
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.20.2.2 -r1.20.2.3 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.20.2.2 src/usr.sbin/sysinst/arch/i386/md.c:1.20.2.3
--- src/usr.sbin/sysinst/arch/i386/md.c:1.20.2.2	Sun Nov 17 13:45:26 2019
+++ src/usr.sbin/sysinst/arch/i386/md.c	Tue Nov 19 06:19:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.20.2.2 2019/11/17 13:45:26 msaitoh Exp $ */
+/*	$NetBSD: md.c,v 1.20.2.3 2019/11/19 06:19:04 msaitoh 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_to_target("/usr/mdec/prekern", "/prekern");
-	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: [netbsd-9] src/usr.sbin/sysinst/arch/i386

2019-11-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 19 06:19:04 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/i386 [netbsd-9]: md.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #443):
usr.sbin/sysinst/arch/i386/md.c: revision 1.25
usr.sbin/sysinst/arch/i386/md.c: revision 1.26
Fix previous: the install medium may not have /usr/mdec/prekern; it was
meant to copy the one from the just installed system.
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.20.2.2 -r1.20.2.3 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: [netbsd-9] src/usr.sbin/sysinst

2019-11-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov 17 13:45:26 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: Makefile.inc bsddisklabel.c
configmenu.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 net.c part_edit.c partitions.c partitions.h partman.c
run.c util.c
src/usr.sbin/sysinst/arch/amd64 [netbsd-9]: md.c md.h
src/usr.sbin/sysinst/arch/ews4800mips [netbsd-9]: Makefile
src/usr.sbin/sysinst/arch/i386 [netbsd-9]: md.c menus.md msg.md.de
msg.md.en msg.md.es msg.md.fr msg.md.pl
src/usr.sbin/sysinst/arch/playstation2 [netbsd-9]: msg.md.de msg.md.en
msg.md.es msg.md.fr msg.md.pl

Log Message:
Pull up following revision(s) (requested by martin in ticket #436):
usr.sbin/sysinst/disks.c: revision 1.55
usr.sbin/sysinst/msg.mi.en: revision 1.24
usr.sbin/sysinst/mbr.c: revision 1.22
usr.sbin/sysinst/disks.c: revision 1.56
usr.sbin/sysinst/msg.mi.en: revision 1.25
usr.sbin/sysinst/disks.c: revision 1.57
usr.sbin/sysinst/arch/playstation2/msg.md.pl: revision 1.3
usr.sbin/sysinst/Makefile.inc: revision 1.30
usr.sbin/sysinst/configmenu.c: revision 1.11
usr.sbin/sysinst/util.c: revision 1.35
usr.sbin/sysinst/gpt.c: revision 1.12
usr.sbin/sysinst/util.c: revision 1.36
usr.sbin/sysinst/arch/playstation2/msg.md.de: revision 1.3
usr.sbin/sysinst/arch/i386/menus.md: revision 1.3
usr.sbin/sysinst/util.c: revision 1.37
usr.sbin/sysinst/part_edit.c: revision 1.11
usr.sbin/sysinst/arch/i386/msg.md.en: revision 1.2
usr.sbin/sysinst/util.c: revision 1.38
usr.sbin/sysinst/part_edit.c: revision 1.12
usr.sbin/sysinst/arch/i386/msg.md.en: revision 1.3
usr.sbin/sysinst/util.c: revision 1.39
usr.sbin/sysinst/part_edit.c: revision 1.13
usr.sbin/sysinst/arch/i386/msg.md.en: revision 1.4
usr.sbin/sysinst/disklabel.c: revision 1.15
usr.sbin/sysinst/bsddisklabel.c: revision 1.30
usr.sbin/sysinst/arch/i386/msg.md.es: revision 1.2
usr.sbin/sysinst/bsddisklabel.c: revision 1.31
usr.sbin/sysinst/arch/i386/msg.md.es: revision 1.3
usr.sbin/sysinst/arch/i386/msg.md.es: revision 1.4
usr.sbin/sysinst/mbr.h: revision 1.4
usr.sbin/sysinst/main.c: revision 1.18
usr.sbin/sysinst/partman.c: revision 1.44
usr.sbin/sysinst/msg.mi.de: revision 1.17
usr.sbin/sysinst/arch/i386/msg.md.fr: revision 1.2
usr.sbin/sysinst/msg.mi.de: revision 1.18
usr.sbin/sysinst/arch/i386/msg.md.fr: revision 1.3
usr.sbin/sysinst/arch/playstation2/msg.md.en: revision 1.3
usr.sbin/sysinst/arch/i386/msg.md.fr: revision 1.4
usr.sbin/sysinst/arch/amd64/md.c: revision 1.2
usr.sbin/sysinst/arch/ews4800mips/Makefile: revision 1.3
usr.sbin/sysinst/arch/playstation2/msg.md.es: revision 1.3
usr.sbin/sysinst/label.c: revision 1.13
usr.sbin/sysinst/Makefile.inc: revision 1.29
usr.sbin/sysinst/label.c: revision 1.14
usr.sbin/sysinst/util.c: revision 1.40
usr.sbin/sysinst/partitions.c: revision 1.5
usr.sbin/sysinst/arch/amd64/md.h: revision 1.8
usr.sbin/sysinst/msg.mi.es: revision 1.18
usr.sbin/sysinst/net.c: revision 1.34
usr.sbin/sysinst/msg.mi.es: revision 1.19
usr.sbin/sysinst/arch/i386/msg.md.pl: revision 1.2
usr.sbin/sysinst/arch/i386/md.c: revision 1.22
usr.sbin/sysinst/msg.mi.fr: revision 1.22
usr.sbin/sysinst/arch/playstation2/msg.md.fr: revision 1.3
usr.sbin/sysinst/arch/i386/msg.md.pl: revision 1.3
usr.sbin/sysinst/arch/i386/md.c: revision 1.23
usr.sbin/sysinst/msg.mi.pl: revision 1.25
usr.sbin/sysinst/msg.mi.fr: revision 1.23
usr.sbin/sysinst/arch/i386/msg.md.pl: revision 1.4
usr.sbin/sysinst/arch/i386/md.c: revision 1.24
usr.sbin/sysinst/partitions.h: revision 1.8
usr.sbin/sysinst/msg.mi.pl: revision 1.26
usr.sbin/sysinst/arch/i386/msg.md.de: revision 1.2
usr.sbin/sysinst/arch/i386/msg.md.de: revision 1.3
usr.sbin/sysinst/arch/i386/msg.md.de: revision 1.4
usr.sbin/sysinst/run.c: revision 1.13
usr.sbin/sysinst/defs.h: revision 1.46
usr.sbin/sysinst/install.c: revision 1.12
usr.sbin/sysinst/defs.h: revision 1.47
usr.sbin/sysinst/install.c: revision 1.13
usr.sbin/sysinst/defs.h: revision 1.48
Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).
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)
Make cloning support 

CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-11-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov 17 13:45:26 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: Makefile.inc bsddisklabel.c
configmenu.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 net.c part_edit.c partitions.c partitions.h partman.c
run.c util.c
src/usr.sbin/sysinst/arch/amd64 [netbsd-9]: md.c md.h
src/usr.sbin/sysinst/arch/ews4800mips [netbsd-9]: Makefile
src/usr.sbin/sysinst/arch/i386 [netbsd-9]: md.c menus.md msg.md.de
msg.md.en msg.md.es msg.md.fr msg.md.pl
src/usr.sbin/sysinst/arch/playstation2 [netbsd-9]: msg.md.de msg.md.en
msg.md.es msg.md.fr msg.md.pl

Log Message:
Pull up following revision(s) (requested by martin in ticket #436):
usr.sbin/sysinst/disks.c: revision 1.55
usr.sbin/sysinst/msg.mi.en: revision 1.24
usr.sbin/sysinst/mbr.c: revision 1.22
usr.sbin/sysinst/disks.c: revision 1.56
usr.sbin/sysinst/msg.mi.en: revision 1.25
usr.sbin/sysinst/disks.c: revision 1.57
usr.sbin/sysinst/arch/playstation2/msg.md.pl: revision 1.3
usr.sbin/sysinst/Makefile.inc: revision 1.30
usr.sbin/sysinst/configmenu.c: revision 1.11
usr.sbin/sysinst/util.c: revision 1.35
usr.sbin/sysinst/gpt.c: revision 1.12
usr.sbin/sysinst/util.c: revision 1.36
usr.sbin/sysinst/arch/playstation2/msg.md.de: revision 1.3
usr.sbin/sysinst/arch/i386/menus.md: revision 1.3
usr.sbin/sysinst/util.c: revision 1.37
usr.sbin/sysinst/part_edit.c: revision 1.11
usr.sbin/sysinst/arch/i386/msg.md.en: revision 1.2
usr.sbin/sysinst/util.c: revision 1.38
usr.sbin/sysinst/part_edit.c: revision 1.12
usr.sbin/sysinst/arch/i386/msg.md.en: revision 1.3
usr.sbin/sysinst/util.c: revision 1.39
usr.sbin/sysinst/part_edit.c: revision 1.13
usr.sbin/sysinst/arch/i386/msg.md.en: revision 1.4
usr.sbin/sysinst/disklabel.c: revision 1.15
usr.sbin/sysinst/bsddisklabel.c: revision 1.30
usr.sbin/sysinst/arch/i386/msg.md.es: revision 1.2
usr.sbin/sysinst/bsddisklabel.c: revision 1.31
usr.sbin/sysinst/arch/i386/msg.md.es: revision 1.3
usr.sbin/sysinst/arch/i386/msg.md.es: revision 1.4
usr.sbin/sysinst/mbr.h: revision 1.4
usr.sbin/sysinst/main.c: revision 1.18
usr.sbin/sysinst/partman.c: revision 1.44
usr.sbin/sysinst/msg.mi.de: revision 1.17
usr.sbin/sysinst/arch/i386/msg.md.fr: revision 1.2
usr.sbin/sysinst/msg.mi.de: revision 1.18
usr.sbin/sysinst/arch/i386/msg.md.fr: revision 1.3
usr.sbin/sysinst/arch/playstation2/msg.md.en: revision 1.3
usr.sbin/sysinst/arch/i386/msg.md.fr: revision 1.4
usr.sbin/sysinst/arch/amd64/md.c: revision 1.2
usr.sbin/sysinst/arch/ews4800mips/Makefile: revision 1.3
usr.sbin/sysinst/arch/playstation2/msg.md.es: revision 1.3
usr.sbin/sysinst/label.c: revision 1.13
usr.sbin/sysinst/Makefile.inc: revision 1.29
usr.sbin/sysinst/label.c: revision 1.14
usr.sbin/sysinst/util.c: revision 1.40
usr.sbin/sysinst/partitions.c: revision 1.5
usr.sbin/sysinst/arch/amd64/md.h: revision 1.8
usr.sbin/sysinst/msg.mi.es: revision 1.18
usr.sbin/sysinst/net.c: revision 1.34
usr.sbin/sysinst/msg.mi.es: revision 1.19
usr.sbin/sysinst/arch/i386/msg.md.pl: revision 1.2
usr.sbin/sysinst/arch/i386/md.c: revision 1.22
usr.sbin/sysinst/msg.mi.fr: revision 1.22
usr.sbin/sysinst/arch/playstation2/msg.md.fr: revision 1.3
usr.sbin/sysinst/arch/i386/msg.md.pl: revision 1.3
usr.sbin/sysinst/arch/i386/md.c: revision 1.23
usr.sbin/sysinst/msg.mi.pl: revision 1.25
usr.sbin/sysinst/msg.mi.fr: revision 1.23
usr.sbin/sysinst/arch/i386/msg.md.pl: revision 1.4
usr.sbin/sysinst/arch/i386/md.c: revision 1.24
usr.sbin/sysinst/partitions.h: revision 1.8
usr.sbin/sysinst/msg.mi.pl: revision 1.26
usr.sbin/sysinst/arch/i386/msg.md.de: revision 1.2
usr.sbin/sysinst/arch/i386/msg.md.de: revision 1.3
usr.sbin/sysinst/arch/i386/msg.md.de: revision 1.4
usr.sbin/sysinst/run.c: revision 1.13
usr.sbin/sysinst/defs.h: revision 1.46
usr.sbin/sysinst/install.c: revision 1.12
usr.sbin/sysinst/defs.h: revision 1.47
usr.sbin/sysinst/install.c: revision 1.13
usr.sbin/sysinst/defs.h: revision 1.48
Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).
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)
Make cloning support 

CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-10-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 28 02:53:17 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: bsddisklabel.c disks.c part_edit.c
partitions.c partitions.h

Log Message:
Pull up following revision(s) (requested by martin in ticket #382):
usr.sbin/sysinst/part_edit.c: revision 1.10
usr.sbin/sysinst/part_edit.c: revision 1.9
usr.sbin/sysinst/partitions.c: revision 1.3
usr.sbin/sysinst/partitions.c: revision 1.4
usr.sbin/sysinst/partitions.h: revision 1.7
usr.sbin/sysinst/bsddisklabel.c: revision 1.29
usr.sbin/sysinst/disks.c: revision 1.54
Honor the "no_mbr" flag (used especially for raid and xbd devices)
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.
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.23.2.4 -r1.23.2.5 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.44.2.9 -r1.44.2.10 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.7.2.1 -r1.7.2.2 src/usr.sbin/sysinst/part_edit.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/usr.sbin/sysinst/partitions.c
cvs rdiff -u -r1.4.2.2 -r1.4.2.3 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/bsddisklabel.c
diff -u src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.4 src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.5
--- src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.4	Wed Oct 23 06:04:44 2019
+++ src/usr.sbin/sysinst/bsddisklabel.c	Mon Oct 28 02:53:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.23.2.4 2019/10/23 06:04:44 msaitoh Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.23.2.5 2019/10/28 02:53:17 msaitoh 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/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.44.2.9 src/usr.sbin/sysinst/disks.c:1.44.2.10
--- src/usr.sbin/sysinst/disks.c:1.44.2.9	Wed Oct 23 06:30:16 2019
+++ src/usr.sbin/sysinst/disks.c	Mon Oct 28 02:53:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.44.2.9 2019/10/23 06:30:16 msaitoh Exp $ */
+/*	$NetBSD: disks.c,v 1.44.2.10 2019/10/28 02:53:17 msaitoh 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/part_edit.c
diff -u src/usr.sbin/sysinst/part_edit.c:1.7.2.1 src/usr.sbin/sysinst/part_edit.c:1.7.2.2
--- src/usr.sbin/sysinst/part_edit.c:1.7.2.1	Mon Oct 28 02:49:12 2019
+++ src/usr.sbin/sysinst/part_edit.c	Mon Oct 28 02:53:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: part_edit.c,v 1.7.2.1 2019/10/28 02:49:12 msaitoh Exp $ */
+/*	$NetBSD: part_edit.c,v 1.7.2.2 2019/10/28 02:53:17 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -1218,6 +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.1.2.1 src/usr.sbin/sysinst/partitions.c:1.1.2.2
--- src/usr.sbin/sysinst/partitions.c:1.1.2.1	Sun Aug 18 13:21:40 2019
+++ src/usr.sbin/sysinst/partitions.c	Mon Oct 28 02:53:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partitions.c,v 1.1.2.1 2019/08/18 13:21:40 msaitoh Exp $	*/
+/*	$NetBSD: partitions.c,v 1.1.2.2 2019/10/28 02:53:17 msaitoh Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ 

CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-10-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 28 02:53:17 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: bsddisklabel.c disks.c part_edit.c
partitions.c partitions.h

Log Message:
Pull up following revision(s) (requested by martin in ticket #382):
usr.sbin/sysinst/part_edit.c: revision 1.10
usr.sbin/sysinst/part_edit.c: revision 1.9
usr.sbin/sysinst/partitions.c: revision 1.3
usr.sbin/sysinst/partitions.c: revision 1.4
usr.sbin/sysinst/partitions.h: revision 1.7
usr.sbin/sysinst/bsddisklabel.c: revision 1.29
usr.sbin/sysinst/disks.c: revision 1.54
Honor the "no_mbr" flag (used especially for raid and xbd devices)
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.
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.23.2.4 -r1.23.2.5 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.44.2.9 -r1.44.2.10 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.7.2.1 -r1.7.2.2 src/usr.sbin/sysinst/part_edit.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/usr.sbin/sysinst/partitions.c
cvs rdiff -u -r1.4.2.2 -r1.4.2.3 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: [netbsd-9] src/usr.sbin/sysinst

2019-10-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 28 02:49:12 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: part_edit.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #380):
usr.sbin/sysinst/part_edit.c: revision 1.8
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.7.2.1 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: [netbsd-9] src/usr.sbin/sysinst

2019-10-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 28 02:49:12 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: part_edit.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #380):
usr.sbin/sysinst/part_edit.c: revision 1.8
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.7.2.1 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.7.2.1
--- src/usr.sbin/sysinst/part_edit.c:1.7	Fri Jul 12 18:25:08 2019
+++ src/usr.sbin/sysinst/part_edit.c	Mon Oct 28 02:49:12 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.7.2.1 2019/10/28 02:49:12 msaitoh 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: [netbsd-9] src/usr.sbin/sysinst

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:27:22 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: msg.mi.pl

Log Message:
Pull up following revision(s) (requested by kamil in ticket #377):

usr.sbin/sysinst/msg.mi.pl: revision 1.24

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.20.2.2 -r1.20.2.3 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.20.2.2 src/usr.sbin/sysinst/msg.mi.pl:1.20.2.3
--- src/usr.sbin/sysinst/msg.mi.pl:1.20.2.2	Sun Aug 18 13:25:21 2019
+++ src/usr.sbin/sysinst/msg.mi.pl	Thu Oct 24 16:27:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.pl,v 1.20.2.2 2019/08/18 13:25:21 msaitoh Exp $	*/
+/*	$NetBSD: msg.mi.pl,v 1.20.2.3 2019/10/24 16:27:21 martin 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: [netbsd-9] src/usr.sbin/sysinst

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:27:22 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: msg.mi.pl

Log Message:
Pull up following revision(s) (requested by kamil in ticket #377):

usr.sbin/sysinst/msg.mi.pl: revision 1.24

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.20.2.2 -r1.20.2.3 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: [netbsd-9] src/usr.sbin/sysinst

2019-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 23 06:30:16 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #369):
usr.sbin/sysinst/disks.c: revision 1.51
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.44.2.8 -r1.44.2.9 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: [netbsd-9] src/usr.sbin/sysinst

2019-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 23 06:30:16 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #369):
usr.sbin/sysinst/disks.c: revision 1.51
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.44.2.8 -r1.44.2.9 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.44.2.8 src/usr.sbin/sysinst/disks.c:1.44.2.9
--- src/usr.sbin/sysinst/disks.c:1.44.2.8	Wed Oct 23 06:04:44 2019
+++ src/usr.sbin/sysinst/disks.c	Wed Oct 23 06:30:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.44.2.8 2019/10/23 06:04:44 msaitoh Exp $ */
+/*	$NetBSD: disks.c,v 1.44.2.9 2019/10/23 06:30:16 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1487,12 +1487,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) {
@@ -1505,11 +1507,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: [netbsd-9] src/usr.sbin/sysinst

2019-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 23 06:04:44 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: bsddisklabel.c disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #365):
usr.sbin/sysinst/bsddisklabel.c: revision 1.28
usr.sbin/sysinst/disks.c: revision 1.53
Skip unwanted (zero sized) partitions.


To generate a diff of this commit:
cvs rdiff -u -r1.23.2.3 -r1.23.2.4 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.44.2.7 -r1.44.2.8 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.23.2.3 src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.4
--- src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.3	Thu Aug 29 06:46:13 2019
+++ src/usr.sbin/sysinst/bsddisklabel.c	Wed Oct 23 06:04:44 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.23.2.3 2019/08/29 06:46:13 msaitoh Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.23.2.4 2019/10/23 06:04:44 msaitoh 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.44.2.7 src/usr.sbin/sysinst/disks.c:1.44.2.8
--- src/usr.sbin/sysinst/disks.c:1.44.2.7	Wed Oct 23 05:58:13 2019
+++ src/usr.sbin/sysinst/disks.c	Wed Oct 23 06:04:44 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.44.2.7 2019/10/23 05:58:13 msaitoh Exp $ */
+/*	$NetBSD: disks.c,v 1.44.2.8 2019/10/23 06:04:44 msaitoh 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: [netbsd-9] src/usr.sbin/sysinst

2019-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 23 06:04:44 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: bsddisklabel.c disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #365):
usr.sbin/sysinst/bsddisklabel.c: revision 1.28
usr.sbin/sysinst/disks.c: revision 1.53
Skip unwanted (zero sized) partitions.


To generate a diff of this commit:
cvs rdiff -u -r1.23.2.3 -r1.23.2.4 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.44.2.7 -r1.44.2.8 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: [netbsd-9] src/usr.sbin/sysinst

2019-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 23 06:03:24 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disklabel.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #364):
usr.sbin/sysinst/disklabel.c: revision 1.14
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.10.2.3 -r1.10.2.4 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.10.2.3 src/usr.sbin/sysinst/disklabel.c:1.10.2.4
--- src/usr.sbin/sysinst/disklabel.c:1.10.2.3	Sun Aug 18 13:22:49 2019
+++ src/usr.sbin/sysinst/disklabel.c	Wed Oct 23 06:03:24 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.c,v 1.10.2.3 2019/08/18 13:22:49 msaitoh Exp $	*/
+/*	$NetBSD: disklabel.c,v 1.10.2.4 2019/10/23 06:03:24 msaitoh 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: [netbsd-9] src/usr.sbin/sysinst

2019-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 23 06:03:24 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disklabel.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #364):
usr.sbin/sysinst/disklabel.c: revision 1.14
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.10.2.3 -r1.10.2.4 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: [netbsd-9] src/usr.sbin/sysinst

2019-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 23 06:01:55 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: msg.mi.en msg.mi.fr

Log Message:
Pull up following revision(s) (requested by martin in ticket #363):
usr.sbin/sysinst/msg.mi.en: revision 1.23
usr.sbin/sysinst/msg.mi.fr: revision 1.21
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.19.2.2 -r1.19.2.3 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.17.2.2 -r1.17.2.3 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: [netbsd-9] src/usr.sbin/sysinst

2019-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 23 06:01:55 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: msg.mi.en msg.mi.fr

Log Message:
Pull up following revision(s) (requested by martin in ticket #363):
usr.sbin/sysinst/msg.mi.en: revision 1.23
usr.sbin/sysinst/msg.mi.fr: revision 1.21
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.19.2.2 -r1.19.2.3 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.17.2.2 -r1.17.2.3 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.19.2.2 src/usr.sbin/sysinst/msg.mi.en:1.19.2.3
--- src/usr.sbin/sysinst/msg.mi.en:1.19.2.2	Sun Aug 18 13:25:21 2019
+++ src/usr.sbin/sysinst/msg.mi.en	Wed Oct 23 06:01:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.19.2.2 2019/08/18 13:25:21 msaitoh Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.19.2.3 2019/10/23 06:01:55 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -977,7 +977,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.17.2.2 src/usr.sbin/sysinst/msg.mi.fr:1.17.2.3
--- src/usr.sbin/sysinst/msg.mi.fr:1.17.2.2	Sun Aug 18 13:25:21 2019
+++ src/usr.sbin/sysinst/msg.mi.fr	Wed Oct 23 06:01:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.fr,v 1.17.2.2 2019/08/18 13:25:21 msaitoh Exp $	*/
+/*	$NetBSD: msg.mi.fr,v 1.17.2.3 2019/10/23 06:01:55 msaitoh 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
@@ -1050,7 +1050,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}
@@ -1059,8 +1058,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}
@@ -1068,7 +1067,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é}
 
@@ -1331,7 +1330,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}
 
@@ -1377,7 +1376,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: [netbsd-9] src/usr.sbin/sysinst

2019-10-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 23 05:58:13 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #362):
usr.sbin/sysinst/disks.c: revision 1.52
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.44.2.6 -r1.44.2.7 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: [netbsd-9] src/usr.sbin/sysinst

2019-10-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 23 05:58:13 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #362):
usr.sbin/sysinst/disks.c: revision 1.52
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.44.2.6 -r1.44.2.7 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.44.2.6 src/usr.sbin/sysinst/disks.c:1.44.2.7
--- src/usr.sbin/sysinst/disks.c:1.44.2.6	Fri Aug  9 06:21:00 2019
+++ src/usr.sbin/sysinst/disks.c	Wed Oct 23 05:58:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.44.2.6 2019/08/09 06:21:00 msaitoh Exp $ */
+/*	$NetBSD: disks.c,v 1.44.2.7 2019/10/23 05:58:13 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1928,12 +1928,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: [netbsd-9] src/usr.sbin/sysinst

2019-08-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Aug 29 06:46:13 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: bsddisklabel.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #130):
usr.sbin/sysinst/bsddisklabel.c: revision 1.27
Remove dead (#if 0) code.


To generate a diff of this commit:
cvs rdiff -u -r1.23.2.2 -r1.23.2.3 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.23.2.2 src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.3
--- src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.2	Fri Aug  2 05:45:54 2019
+++ src/usr.sbin/sysinst/bsddisklabel.c	Thu Aug 29 06:46:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.23.2.2 2019/08/02 05:45:54 msaitoh Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.23.2.3 2019/08/29 06:46:13 msaitoh 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 

CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-08-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Aug 29 06:46:13 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: bsddisklabel.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #130):
usr.sbin/sysinst/bsddisklabel.c: revision 1.27
Remove dead (#if 0) code.


To generate a diff of this commit:
cvs rdiff -u -r1.23.2.2 -r1.23.2.3 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug 28 10:01:57 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: mbr.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #125):
usr.sbin/sysinst/mbr.c: revision 1.21
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.19.2.1 -r1.19.2.2 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.19.2.1 src/usr.sbin/sysinst/mbr.c:1.19.2.2
--- src/usr.sbin/sysinst/mbr.c:1.19.2.1	Sun Aug 18 13:21:40 2019
+++ src/usr.sbin/sysinst/mbr.c	Wed Aug 28 10:01:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbr.c,v 1.19.2.1 2019/08/18 13:21:40 msaitoh Exp $ */
+/*	$NetBSD: mbr.c,v 1.19.2.2 2019/08/28 10:01:57 msaitoh 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug 28 10:01:57 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: mbr.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #125):
usr.sbin/sysinst/mbr.c: revision 1.21
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.19.2.1 -r1.19.2.2 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug 28 10:00:53 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: defs.h upgrade.c util.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #123):
usr.sbin/sysinst/util.c: revision 1.32
usr.sbin/sysinst/upgrade.c: revision 1.13
usr.sbin/sysinst/defs.h: revision 1.44
Do not offer to upgrade 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.42.2.1 -r1.42.2.2 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.12 -r1.12.2.1 src/usr.sbin/sysinst/upgrade.c
cvs rdiff -u -r1.29.2.2 -r1.29.2.3 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.42.2.1 src/usr.sbin/sysinst/defs.h:1.42.2.2
--- src/usr.sbin/sysinst/defs.h:1.42.2.1	Thu Aug  8 05:51:43 2019
+++ src/usr.sbin/sysinst/defs.h	Wed Aug 28 10:00:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.42.2.1 2019/08/08 05:51:43 msaitoh Exp $	*/
+/*	$NetBSD: defs.h,v 1.42.2.2 2019/08/28 10:00:53 msaitoh 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.12.2.1
--- src/usr.sbin/sysinst/upgrade.c:1.12	Tue Jul 23 18:13:40 2019
+++ src/usr.sbin/sysinst/upgrade.c	Wed Aug 28 10:00:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: upgrade.c,v 1.12 2019/07/23 18:13:40 martin Exp $	*/
+/*	$NetBSD: upgrade.c,v 1.12.2.1 2019/08/28 10:00:53 msaitoh 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.29.2.2 src/usr.sbin/sysinst/util.c:1.29.2.3
--- src/usr.sbin/sysinst/util.c:1.29.2.2	Sun Aug 18 13:29:15 2019
+++ src/usr.sbin/sysinst/util.c	Wed Aug 28 10:00:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.29.2.2 2019/08/18 13:29:15 msaitoh Exp $	*/
+/*	$NetBSD: util.c,v 1.29.2.3 2019/08/28 10:00:53 msaitoh 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug 28 10:00:53 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: defs.h upgrade.c util.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #123):
usr.sbin/sysinst/util.c: revision 1.32
usr.sbin/sysinst/upgrade.c: revision 1.13
usr.sbin/sysinst/defs.h: revision 1.44
Do not offer to upgrade 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.42.2.1 -r1.42.2.2 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.12 -r1.12.2.1 src/usr.sbin/sysinst/upgrade.c
cvs rdiff -u -r1.29.2.2 -r1.29.2.3 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Aug 27 04:21:01 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: gpt.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #119):
usr.sbin/sysinst/gpt.c: revision 1.11
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.6.2.4 -r1.6.2.5 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.6.2.4 src/usr.sbin/sysinst/gpt.c:1.6.2.5
--- src/usr.sbin/sysinst/gpt.c:1.6.2.4	Sun Aug 18 13:21:40 2019
+++ src/usr.sbin/sysinst/gpt.c	Tue Aug 27 04:21:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt.c,v 1.6.2.4 2019/08/18 13:21:40 msaitoh Exp $	*/
+/*	$NetBSD: gpt.c,v 1.6.2.5 2019/08/27 04:21:01 msaitoh 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Aug 27 04:21:01 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: gpt.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #119):
usr.sbin/sysinst/gpt.c: revision 1.11
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.6.2.4 -r1.6.2.5 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Aug 18 13:32:50 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: checkrc.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #89):
usr.sbin/sysinst/checkrc.c: revision 1.2
Fix memory leak (found by MKSANITIZER=yes build).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.30.1 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Aug 18 13:32:50 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: checkrc.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #89):
usr.sbin/sysinst/checkrc.c: revision 1.2
Fix memory leak (found by MKSANITIZER=yes build).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.30.1 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.1.30.1
--- src/usr.sbin/sysinst/checkrc.c:1.1	Sat Jul 26 19:30:44 2014
+++ src/usr.sbin/sysinst/checkrc.c	Sun Aug 18 13:32:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: checkrc.c,v 1.1 2014/07/26 19:30:44 dholland Exp $ */
+/* $NetBSD: checkrc.c,v 1.1.30.1 2019/08/18 13:32:50 msaitoh 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Aug 18 13:29:15 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: install.c util.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #83):
usr.sbin/sysinst/util.c: revision 1.31
usr.sbin/sysinst/install.c: revision 1.10
usr.sbin/sysinst/install.c: revision 1.11
Fix some memory leaks in error paths
Oops, avoid double free.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.2.1 src/usr.sbin/sysinst/install.c
cvs rdiff -u -r1.29.2.1 -r1.29.2.2 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Aug 18 13:29:15 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: install.c util.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #83):
usr.sbin/sysinst/util.c: revision 1.31
usr.sbin/sysinst/install.c: revision 1.10
usr.sbin/sysinst/install.c: revision 1.11
Fix some memory leaks in error paths
Oops, avoid double free.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.2.1 src/usr.sbin/sysinst/install.c
cvs rdiff -u -r1.29.2.1 -r1.29.2.2 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.9.2.1
--- src/usr.sbin/sysinst/install.c:1.9	Tue Jul 23 18:13:40 2019
+++ src/usr.sbin/sysinst/install.c	Sun Aug 18 13:29:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: install.c,v 1.9 2019/07/23 18:13:40 martin Exp $	*/
+/*	$NetBSD: install.c,v 1.9.2.1 2019/08/18 13:29:15 msaitoh 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();
 
@@ -214,7 +214,8 @@ do_install(void)
 
 	md_cleanup_install();
 
-	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.29.2.1 src/usr.sbin/sysinst/util.c:1.29.2.2
--- src/usr.sbin/sysinst/util.c:1.29.2.1	Sun Aug 18 13:25:21 2019
+++ src/usr.sbin/sysinst/util.c	Sun Aug 18 13:29:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.29.2.1 2019/08/18 13:25:21 msaitoh Exp $	*/
+/*	$NetBSD: util.c,v 1.29.2.2 2019/08/18 13:29:15 msaitoh 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Aug 18 13:25:21 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: msg.mi.de msg.mi.en msg.mi.es
msg.mi.fr msg.mi.pl util.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #82):
usr.sbin/sysinst/util.c: revision 1.30
usr.sbin/sysinst/msg.mi.fr: revision 1.19
usr.sbin/sysinst/msg.mi.de: revision 1.15
usr.sbin/sysinst/msg.mi.es: revision 1.16
usr.sbin/sysinst/msg.mi.pl: revision 1.22
usr.sbin/sysinst/msg.mi.en: revision 1.21
PR 54473: fix error prompt when a set file is missing


To generate a diff of this commit:
cvs rdiff -u -r1.13.2.1 -r1.13.2.2 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.19.2.1 -r1.19.2.2 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.14.2.1 -r1.14.2.2 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.17.2.1 -r1.17.2.2 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.20.2.1 -r1.20.2.2 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.29 -r1.29.2.1 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Aug 18 13:25:21 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: msg.mi.de msg.mi.en msg.mi.es
msg.mi.fr msg.mi.pl util.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #82):
usr.sbin/sysinst/util.c: revision 1.30
usr.sbin/sysinst/msg.mi.fr: revision 1.19
usr.sbin/sysinst/msg.mi.de: revision 1.15
usr.sbin/sysinst/msg.mi.es: revision 1.16
usr.sbin/sysinst/msg.mi.pl: revision 1.22
usr.sbin/sysinst/msg.mi.en: revision 1.21
PR 54473: fix error prompt when a set file is missing


To generate a diff of this commit:
cvs rdiff -u -r1.13.2.1 -r1.13.2.2 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.19.2.1 -r1.19.2.2 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.14.2.1 -r1.14.2.2 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.17.2.1 -r1.17.2.2 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.20.2.1 -r1.20.2.2 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.29 -r1.29.2.1 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.13.2.1 src/usr.sbin/sysinst/msg.mi.de:1.13.2.2
--- src/usr.sbin/sysinst/msg.mi.de:1.13.2.1	Sun Aug 18 13:21:40 2019
+++ src/usr.sbin/sysinst/msg.mi.de	Sun Aug 18 13:25:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.de,v 1.13.2.1 2019/08/18 13:21:40 msaitoh Exp $	*/
+/*	$NetBSD: msg.mi.de,v 1.13.2.2 2019/08/18 13:25:21 msaitoh 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.19.2.1 src/usr.sbin/sysinst/msg.mi.en:1.19.2.2
--- src/usr.sbin/sysinst/msg.mi.en:1.19.2.1	Sun Aug 18 13:21:40 2019
+++ src/usr.sbin/sysinst/msg.mi.en	Sun Aug 18 13:25:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.19.2.1 2019/08/18 13:21:40 msaitoh Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.19.2.2 2019/08/18 13:25:21 msaitoh 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.14.2.1 src/usr.sbin/sysinst/msg.mi.es:1.14.2.2
--- src/usr.sbin/sysinst/msg.mi.es:1.14.2.1	Sun Aug 18 13:21:40 2019
+++ src/usr.sbin/sysinst/msg.mi.es	Sun Aug 18 13:25:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.es,v 1.14.2.1 2019/08/18 13:21:40 msaitoh Exp $	*/
+/*	$NetBSD: msg.mi.es,v 1.14.2.2 2019/08/18 13:25:21 msaitoh 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.17.2.1 src/usr.sbin/sysinst/msg.mi.fr:1.17.2.2
--- src/usr.sbin/sysinst/msg.mi.fr:1.17.2.1	Sun Aug 18 13:21:40 2019
+++ src/usr.sbin/sysinst/msg.mi.fr	Sun Aug 18 13:25:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.fr,v 1.17.2.1 2019/08/18 13:21:40 msaitoh Exp $	*/
+/*	$NetBSD: msg.mi.fr,v 1.17.2.2 2019/08/18 13:25:21 msaitoh 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.20.2.1 src/usr.sbin/sysinst/msg.mi.pl:1.20.2.2
--- src/usr.sbin/sysinst/msg.mi.pl:1.20.2.1	Sun Aug 18 13:21:40 2019
+++ src/usr.sbin/sysinst/msg.mi.pl	Sun Aug 18 13:25:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.pl,v 1.20.2.1 2019/08/18 13:21:40 msaitoh Exp $	*/
+/*	$NetBSD: msg.mi.pl,v 1.20.2.2 2019/08/18 13:25:21 msaitoh 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 

CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-08-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Aug 18 13:22:49 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disklabel.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #79):
usr.sbin/sysinst/disklabel.c: revision 1.13
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.10.2.2 -r1.10.2.3 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.10.2.2 src/usr.sbin/sysinst/disklabel.c:1.10.2.3
--- src/usr.sbin/sysinst/disklabel.c:1.10.2.2	Sun Aug 18 13:21:40 2019
+++ src/usr.sbin/sysinst/disklabel.c	Sun Aug 18 13:22:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.c,v 1.10.2.2 2019/08/18 13:21:40 msaitoh Exp $	*/
+/*	$NetBSD: disklabel.c,v 1.10.2.3 2019/08/18 13:22:49 msaitoh 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Aug 18 13:22:49 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disklabel.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #79):
usr.sbin/sysinst/disklabel.c: revision 1.13
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.10.2.2 -r1.10.2.3 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Aug 18 13:21:40 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: 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:
Pull up following revision(s) (requested by martin in ticket #78):
usr.sbin/sysinst/gpt.c: revision 1.10
usr.sbin/sysinst/disklabel.c: revision 1.12
usr.sbin/sysinst/msg.mi.fr: revision 1.18
usr.sbin/sysinst/msg.mi.de: revision 1.14
usr.sbin/sysinst/partitions.c: revision 1.2
usr.sbin/sysinst/msg.mi.es: revision 1.15
usr.sbin/sysinst/msg.mi.pl: revision 1.21
usr.sbin/sysinst/partitions.h: revision 1.6
usr.sbin/sysinst/msg.mi.en: revision 1.20
usr.sbin/sysinst/mbr.c: revision 1.20
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.10.2.1 -r1.10.2.2 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.6.2.3 -r1.6.2.4 src/usr.sbin/sysinst/gpt.c
cvs rdiff -u -r1.19 -r1.19.2.1 src/usr.sbin/sysinst/mbr.c \
src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.13 -r1.13.2.1 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.14 -r1.14.2.1 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.17 -r1.17.2.1 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.20 -r1.20.2.1 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.1 -r1.1.2.1 src/usr.sbin/sysinst/partitions.c
cvs rdiff -u -r1.4.2.1 -r1.4.2.2 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Aug 18 13:21:40 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: 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:
Pull up following revision(s) (requested by martin in ticket #78):
usr.sbin/sysinst/gpt.c: revision 1.10
usr.sbin/sysinst/disklabel.c: revision 1.12
usr.sbin/sysinst/msg.mi.fr: revision 1.18
usr.sbin/sysinst/msg.mi.de: revision 1.14
usr.sbin/sysinst/partitions.c: revision 1.2
usr.sbin/sysinst/msg.mi.es: revision 1.15
usr.sbin/sysinst/msg.mi.pl: revision 1.21
usr.sbin/sysinst/partitions.h: revision 1.6
usr.sbin/sysinst/msg.mi.en: revision 1.20
usr.sbin/sysinst/mbr.c: revision 1.20
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.10.2.1 -r1.10.2.2 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.6.2.3 -r1.6.2.4 src/usr.sbin/sysinst/gpt.c
cvs rdiff -u -r1.19 -r1.19.2.1 src/usr.sbin/sysinst/mbr.c \
src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.13 -r1.13.2.1 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.14 -r1.14.2.1 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.17 -r1.17.2.1 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.20 -r1.20.2.1 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.1 -r1.1.2.1 src/usr.sbin/sysinst/partitions.c
cvs rdiff -u -r1.4.2.1 -r1.4.2.2 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.10.2.1 src/usr.sbin/sysinst/disklabel.c:1.10.2.2
--- src/usr.sbin/sysinst/disklabel.c:1.10.2.1	Thu Aug  8 05:51:43 2019
+++ src/usr.sbin/sysinst/disklabel.c	Sun Aug 18 13:21:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.c,v 1.10.2.1 2019/08/08 05:51:43 msaitoh Exp $	*/
+/*	$NetBSD: disklabel.c,v 1.10.2.2 2019/08/18 13:21:40 msaitoh 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.6.2.3 src/usr.sbin/sysinst/gpt.c:1.6.2.4
--- src/usr.sbin/sysinst/gpt.c:1.6.2.3	Thu Aug  8 05:51:43 2019
+++ src/usr.sbin/sysinst/gpt.c	Sun Aug 18 13:21:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt.c,v 1.6.2.3 2019/08/08 05:51:43 msaitoh Exp $	*/
+/*	$NetBSD: gpt.c,v 1.6.2.4 2019/08/18 13:21:40 msaitoh 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.19.2.1
--- src/usr.sbin/sysinst/mbr.c:1.19	Fri Jul 26 08:18:47 2019
+++ src/usr.sbin/sysinst/mbr.c	Sun Aug 18 13:21:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbr.c,v 1.19 2019/07/26 08:18:47 martin Exp $ */
+/*	$NetBSD: mbr.c,v 1.19.2.1 2019/08/18 13:21:40 msaitoh 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)
 			

CVS commit: [netbsd-9] src/usr.sbin/sysinst/arch

2019-08-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Aug 18 13:19:53 UTC 2019

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

Log Message:
Pull up following revision(s) (requested by martin in ticket #77):
usr.sbin/sysinst/arch/sandpoint/md.c: revision 1.6
usr.sbin/sysinst/arch/playstation2/md.c: revision 1.6
usr.sbin/sysinst/arch/evbppc/md.c: revision 1.6
usr.sbin/sysinst/arch/hpcarm/md.c: revision 1.6
usr.sbin/sysinst/arch/zaurus/md.c: revision 1.6
usr.sbin/sysinst/arch/arc/md.c: revision 1.9
usr.sbin/sysinst/arch/hpcmips/md.c: revision 1.6
usr.sbin/sysinst/arch/bebox/md.c: revision 1.6
usr.sbin/sysinst/arch/hpcsh/md.c: revision 1.7
usr.sbin/sysinst/arch/landisk/md.c: revision 1.11
usr.sbin/sysinst/arch/prep/md.c: revision 1.9
usr.sbin/sysinst/arch/i386/md.c: revision 1.21
usr.sbin/sysinst/arch/evbmips/md.c: revision 1.6
usr.sbin/sysinst/arch/evbarm/md.c: revision 1.9
usr.sbin/sysinst/arch/cobalt/md.c: revision 1.9
usr.sbin/sysinst/arch/ofppc/md.c: revision 1.8
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.8.2.1 src/usr.sbin/sysinst/arch/arc/md.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/usr.sbin/sysinst/arch/bebox/md.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/usr.sbin/sysinst/arch/cobalt/md.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/usr.sbin/sysinst/arch/evbarm/md.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/usr.sbin/sysinst/arch/evbmips/md.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/usr.sbin/sysinst/arch/evbppc/md.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/usr.sbin/sysinst/arch/hpcarm/md.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/usr.sbin/sysinst/arch/hpcmips/md.c
cvs rdiff -u -r1.6 -r1.6.2.1 src/usr.sbin/sysinst/arch/hpcsh/md.c
cvs rdiff -u -r1.20 -r1.20.2.1 src/usr.sbin/sysinst/arch/i386/md.c
cvs rdiff -u -r1.10 -r1.10.2.1 src/usr.sbin/sysinst/arch/landisk/md.c
cvs rdiff -u -r1.7 -r1.7.2.1 src/usr.sbin/sysinst/arch/ofppc/md.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/usr.sbin/sysinst/arch/playstation2/md.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/usr.sbin/sysinst/arch/prep/md.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/usr.sbin/sysinst/arch/sandpoint/md.c
cvs rdiff -u -r1.5 -r1.5.2.1 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: [netbsd-9] src/usr.sbin/sysinst/arch

2019-08-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Aug 18 13:19:53 UTC 2019

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

Log Message:
Pull up following revision(s) (requested by martin in ticket #77):
usr.sbin/sysinst/arch/sandpoint/md.c: revision 1.6
usr.sbin/sysinst/arch/playstation2/md.c: revision 1.6
usr.sbin/sysinst/arch/evbppc/md.c: revision 1.6
usr.sbin/sysinst/arch/hpcarm/md.c: revision 1.6
usr.sbin/sysinst/arch/zaurus/md.c: revision 1.6
usr.sbin/sysinst/arch/arc/md.c: revision 1.9
usr.sbin/sysinst/arch/hpcmips/md.c: revision 1.6
usr.sbin/sysinst/arch/bebox/md.c: revision 1.6
usr.sbin/sysinst/arch/hpcsh/md.c: revision 1.7
usr.sbin/sysinst/arch/landisk/md.c: revision 1.11
usr.sbin/sysinst/arch/prep/md.c: revision 1.9
usr.sbin/sysinst/arch/i386/md.c: revision 1.21
usr.sbin/sysinst/arch/evbmips/md.c: revision 1.6
usr.sbin/sysinst/arch/evbarm/md.c: revision 1.9
usr.sbin/sysinst/arch/cobalt/md.c: revision 1.9
usr.sbin/sysinst/arch/ofppc/md.c: revision 1.8
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.8.2.1 src/usr.sbin/sysinst/arch/arc/md.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/usr.sbin/sysinst/arch/bebox/md.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/usr.sbin/sysinst/arch/cobalt/md.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/usr.sbin/sysinst/arch/evbarm/md.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/usr.sbin/sysinst/arch/evbmips/md.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/usr.sbin/sysinst/arch/evbppc/md.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/usr.sbin/sysinst/arch/hpcarm/md.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/usr.sbin/sysinst/arch/hpcmips/md.c
cvs rdiff -u -r1.6 -r1.6.2.1 src/usr.sbin/sysinst/arch/hpcsh/md.c
cvs rdiff -u -r1.20 -r1.20.2.1 src/usr.sbin/sysinst/arch/i386/md.c
cvs rdiff -u -r1.10 -r1.10.2.1 src/usr.sbin/sysinst/arch/landisk/md.c
cvs rdiff -u -r1.7 -r1.7.2.1 src/usr.sbin/sysinst/arch/ofppc/md.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/usr.sbin/sysinst/arch/playstation2/md.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/usr.sbin/sysinst/arch/prep/md.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/usr.sbin/sysinst/arch/sandpoint/md.c
cvs rdiff -u -r1.5 -r1.5.2.1 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.8.2.1
--- 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	Sun Aug 18 13:19:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.8 2019/07/13 17:13:36 martin Exp $ */
+/*	$NetBSD: md.c,v 1.8.2.1 2019/08/18 13:19:51 msaitoh 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.5.2.1
--- 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	Sun Aug 18 13:19:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.5 2019/07/13 17:13:36 martin Exp $ */
+/*	$NetBSD: md.c,v 1.5.2.1 2019/08/18 13:19:52 msaitoh 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.8.2.1
--- src/usr.sbin/sysinst/arch/cobalt/md.c:1.8	

CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-08-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Aug 18 13:17:39 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: partman.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #76):
usr.sbin/sysinst/partman.c: revision 1.42
Make sure to completely initialize dynamic menu entries.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.41.2.1 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Aug 18 13:17:39 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: partman.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #76):
usr.sbin/sysinst/partman.c: revision 1.42
Make sure to completely initialize dynamic menu entries.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.41.2.1 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.41.2.1
--- src/usr.sbin/sysinst/partman.c:1.41	Thu Jul 25 19:01:08 2019
+++ src/usr.sbin/sysinst/partman.c	Sun Aug 18 13:17:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partman.c,v 1.41 2019/07/25 19:01:08 martin Exp $ */
+/*	$NetBSD: partman.c,v 1.41.2.1 2019/08/18 13:17:39 msaitoh 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  9 06:21:01 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #33):
usr.sbin/sysinst/disks.c: revision 1.50
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.44.2.5 -r1.44.2.6 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.44.2.5 src/usr.sbin/sysinst/disks.c:1.44.2.6
--- src/usr.sbin/sysinst/disks.c:1.44.2.5	Fri Aug  9 06:20:12 2019
+++ src/usr.sbin/sysinst/disks.c	Fri Aug  9 06:21:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.44.2.5 2019/08/09 06:20:12 msaitoh Exp $ */
+/*	$NetBSD: disks.c,v 1.44.2.6 2019/08/09 06:21:00 msaitoh 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  9 06:21:01 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #33):
usr.sbin/sysinst/disks.c: revision 1.50
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.44.2.5 -r1.44.2.6 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  9 06:20:12 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #32):
usr.sbin/sysinst/disks.c: revision 1.49
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.44.2.4 -r1.44.2.5 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.44.2.4 src/usr.sbin/sysinst/disks.c:1.44.2.5
--- src/usr.sbin/sysinst/disks.c:1.44.2.4	Thu Aug  8 05:53:03 2019
+++ src/usr.sbin/sysinst/disks.c	Fri Aug  9 06:20:12 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.44.2.4 2019/08/08 05:53:03 msaitoh Exp $ */
+/*	$NetBSD: disks.c,v 1.44.2.5 2019/08/09 06:20:12 msaitoh 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  9 06:20:12 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #32):
usr.sbin/sysinst/disks.c: revision 1.49
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.44.2.4 -r1.44.2.5 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Aug  8 05:53:03 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #29):
usr.sbin/sysinst/disks.c: revision 1.48
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.44.2.3 -r1.44.2.4 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.44.2.3 src/usr.sbin/sysinst/disks.c:1.44.2.4
--- src/usr.sbin/sysinst/disks.c:1.44.2.3	Thu Aug  8 05:51:43 2019
+++ src/usr.sbin/sysinst/disks.c	Thu Aug  8 05:53:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.44.2.3 2019/08/08 05:51:43 msaitoh Exp $ */
+/*	$NetBSD: disks.c,v 1.44.2.4 2019/08/08 05:53:03 msaitoh 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Aug  8 05:53:03 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #29):
usr.sbin/sysinst/disks.c: revision 1.48
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.44.2.3 -r1.44.2.4 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Aug  8 05:51:44 UTC 2019

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

Log Message:
Pull up following revision(s) (requested by martin in ticket #28):
usr.sbin/sysinst/disklabel.c: revision 1.11
usr.sbin/sysinst/target.c: revision 1.10
usr.sbin/sysinst/disks.c: revision 1.47
usr.sbin/sysinst/txtwalk.c: revision 1.2
usr.sbin/sysinst/partitions.h: revision 1.5
usr.sbin/sysinst/txtwalk.h: revision 1.2
usr.sbin/sysinst/arch/ews4800mips/md.h: revision 1.4
usr.sbin/sysinst/gpt.c: revision 1.9
usr.sbin/sysinst/defs.h: revision 1.43
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.42.2.1 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.10 -r1.10.2.1 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.44.2.2 -r1.44.2.3 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.6.2.2 -r1.6.2.3 src/usr.sbin/sysinst/gpt.c
cvs rdiff -u -r1.4 -r1.4.2.1 src/usr.sbin/sysinst/partitions.h
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/usr.sbin/sysinst/target.c
cvs rdiff -u -r1.1 -r1.1.30.1 src/usr.sbin/sysinst/txtwalk.c \
src/usr.sbin/sysinst/txtwalk.h
cvs rdiff -u -r1.3 -r1.3.2.1 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.42.2.1
--- src/usr.sbin/sysinst/defs.h:1.42	Fri Jul 26 08:18:47 2019
+++ src/usr.sbin/sysinst/defs.h	Thu Aug  8 05:51:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.42 2019/07/26 08:18:47 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.42.2.1 2019/08/08 05:51:43 msaitoh 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.10.2.1
--- src/usr.sbin/sysinst/disklabel.c:1.10	Fri Jul 26 08:18:47 2019
+++ src/usr.sbin/sysinst/disklabel.c	Thu Aug  8 05:51:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.c,v 1.10 2019/07/26 08:18:47 martin Exp $	*/
+/*	$NetBSD: disklabel.c,v 1.10.2.1 2019/08/08 05:51:43 msaitoh 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.44.2.2 src/usr.sbin/sysinst/disks.c:1.44.2.3
--- src/usr.sbin/sysinst/disks.c:1.44.2.2	Mon Aug  5 04:36:42 2019
+++ src/usr.sbin/sysinst/disks.c	Thu Aug  8 05:51:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.44.2.2 2019/08/05 04:36:42 msaitoh Exp $ */
+/*	$NetBSD: disks.c,v 1.44.2.3 2019/08/08 05:51:43 msaitoh 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 

CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-08-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Aug  8 05:51:44 UTC 2019

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

Log Message:
Pull up following revision(s) (requested by martin in ticket #28):
usr.sbin/sysinst/disklabel.c: revision 1.11
usr.sbin/sysinst/target.c: revision 1.10
usr.sbin/sysinst/disks.c: revision 1.47
usr.sbin/sysinst/txtwalk.c: revision 1.2
usr.sbin/sysinst/partitions.h: revision 1.5
usr.sbin/sysinst/txtwalk.h: revision 1.2
usr.sbin/sysinst/arch/ews4800mips/md.h: revision 1.4
usr.sbin/sysinst/gpt.c: revision 1.9
usr.sbin/sysinst/defs.h: revision 1.43
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.42.2.1 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.10 -r1.10.2.1 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.44.2.2 -r1.44.2.3 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.6.2.2 -r1.6.2.3 src/usr.sbin/sysinst/gpt.c
cvs rdiff -u -r1.4 -r1.4.2.1 src/usr.sbin/sysinst/partitions.h
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/usr.sbin/sysinst/target.c
cvs rdiff -u -r1.1 -r1.1.30.1 src/usr.sbin/sysinst/txtwalk.c \
src/usr.sbin/sysinst/txtwalk.h
cvs rdiff -u -r1.3 -r1.3.2.1 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Aug  5 04:38:47 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: label.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #16):
usr.sbin/sysinst/label.c: revision 1.12
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.10.2.1 -r1.10.2.2 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Aug  5 04:38:47 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: label.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #16):
usr.sbin/sysinst/label.c: revision 1.12
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.10.2.1 -r1.10.2.2 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.10.2.1 src/usr.sbin/sysinst/label.c:1.10.2.2
--- src/usr.sbin/sysinst/label.c:1.10.2.1	Fri Aug  2 05:41:46 2019
+++ src/usr.sbin/sysinst/label.c	Mon Aug  5 04:38:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: label.c,v 1.10.2.1 2019/08/02 05:41:46 msaitoh Exp $	*/
+/*	$NetBSD: label.c,v 1.10.2.2 2019/08/05 04:38:47 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.10.2.1 2019/08/02 05:41:46 msaitoh Exp $");
+__RCSID("$NetBSD: label.c,v 1.10.2.2 2019/08/05 04:38:47 msaitoh 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Aug  5 04:37:44 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: gpt.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #15):
usr.sbin/sysinst/gpt.c: revision 1.8
When reading an existing gpt, match the wedges already existing
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.6.2.1 -r1.6.2.2 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.6.2.1 src/usr.sbin/sysinst/gpt.c:1.6.2.2
--- src/usr.sbin/sysinst/gpt.c:1.6.2.1	Mon Aug  5 04:34:54 2019
+++ src/usr.sbin/sysinst/gpt.c	Mon Aug  5 04:37:44 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt.c,v 1.6.2.1 2019/08/05 04:34:54 msaitoh Exp $	*/
+/*	$NetBSD: gpt.c,v 1.6.2.2 2019/08/05 04:37:44 msaitoh 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Aug  5 04:37:44 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: gpt.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #15):
usr.sbin/sysinst/gpt.c: revision 1.8
When reading an existing gpt, match the wedges already existing
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.6.2.1 -r1.6.2.2 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Aug  5 04:36:42 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #14):
usr.sbin/sysinst/disks.c: revision 1.46
Properly handle partitions that we were requested to mount but not newfs.


To generate a diff of this commit:
cvs rdiff -u -r1.44.2.1 -r1.44.2.2 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.44.2.1 src/usr.sbin/sysinst/disks.c:1.44.2.2
--- src/usr.sbin/sysinst/disks.c:1.44.2.1	Fri Aug  2 05:41:46 2019
+++ src/usr.sbin/sysinst/disks.c	Mon Aug  5 04:36:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.44.2.1 2019/08/02 05:41:46 msaitoh Exp $ */
+/*	$NetBSD: disks.c,v 1.44.2.2 2019/08/05 04:36:42 msaitoh 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);
 



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-08-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Aug  5 04:36:42 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #14):
usr.sbin/sysinst/disks.c: revision 1.46
Properly handle partitions that we were requested to mount but not newfs.


To generate a diff of this commit:
cvs rdiff -u -r1.44.2.1 -r1.44.2.2 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Aug  5 04:34:54 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: gpt.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #8):
usr.sbin/sysinst/gpt.c: revision 1.7
Deal with missing labels when parsing gpt(8) output.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.2.1 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Aug  5 04:34:54 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: gpt.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #8):
usr.sbin/sysinst/gpt.c: revision 1.7
Deal with missing labels when parsing gpt(8) output.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.2.1 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.6 src/usr.sbin/sysinst/gpt.c:1.6.2.1
--- src/usr.sbin/sysinst/gpt.c:1.6	Sun Jul 28 16:30:36 2019
+++ src/usr.sbin/sysinst/gpt.c	Mon Aug  5 04:34:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt.c,v 1.6 2019/07/28 16:30:36 martin Exp $	*/
+/*	$NetBSD: gpt.c,v 1.6.2.1 2019/08/05 04:34:54 msaitoh Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -212,8 +212,7 @@ gpt_add_info(struct gpt_part_entry *part
 	} else if (strcmp(tag, "GUID:") == 0) {
 		strlcpy(part->gp_id, val, sizeof(part->gp_id));
 	} else if (strcmp(tag, "Label:") == 0) {
-		if (strlen(val) > 0)
-			strlcpy(part->gp_label, val, sizeof(part->gp_label));
+		strlcpy(part->gp_label, val, sizeof(part->gp_label));
 	} else if (strcmp(tag, "Attributes:") == 0) {
 		char *n;
 



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-08-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  2 05:45:54 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: bsddisklabel.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #6):
usr.sbin/sysinst/bsddisklabel.c: revision 1.26
If we can not fit a planned partition, retry with a bit more slope
in size.


To generate a diff of this commit:
cvs rdiff -u -r1.23.2.1 -r1.23.2.2 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  2 05:45:54 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: bsddisklabel.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #6):
usr.sbin/sysinst/bsddisklabel.c: revision 1.26
If we can not fit a planned partition, retry with a bit more slope
in size.


To generate a diff of this commit:
cvs rdiff -u -r1.23.2.1 -r1.23.2.2 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.23.2.1 src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.2
--- src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.1	Fri Aug  2 05:43:20 2019
+++ src/usr.sbin/sysinst/bsddisklabel.c	Fri Aug  2 05:45:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.23.2.1 2019/08/02 05:43:20 msaitoh Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.23.2.2 2019/08/02 05:45:54 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1424,8 +1424,12 @@ apply_settings_to_partitions(struct pm_d
 			continue;
 
 		size_t cnt = wanted->parts->pscheme->get_free_spaces(
-		wanted->parts, , 1, want->size-2*align, align, from,
+		wanted->parts, , 1, want->size-align, align, from,
 		-1);
+		if (cnt == 0)
+			cnt = wanted->parts->pscheme->get_free_spaces(
+			wanted->parts, , 1,
+			want->size-5*align, align, from, -1);
 
 		if (cnt == 0)
 			continue;	/* no free space for this partition */



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-08-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  2 05:43:21 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: bsddisklabel.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #5):
usr.sbin/sysinst/bsddisklabel.c: revision 1.24
usr.sbin/sysinst/bsddisklabel.c: revision 1.25
PR 54423: fix handling of user defined partitions
PR 54423: complete initialization of install info for user defined partitions


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.2.1 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.23 src/usr.sbin/sysinst/bsddisklabel.c:1.23.2.1
--- src/usr.sbin/sysinst/bsddisklabel.c:1.23	Sun Jul 28 16:30:36 2019
+++ src/usr.sbin/sysinst/bsddisklabel.c	Fri Aug  2 05:43:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.23 2019/07/28 16:30:36 martin Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.23.2.1 2019/08/02 05:43:20 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -365,24 +365,25 @@ add_other_ptn_size(menudesc *menu, void 
 			/* we need absolute mount paths */
 			memmove(new_mp+1, new_mp, sizeof(new_mp)-1);
 			new_mp[0] = '/';
-			/* duplicates? */
-			bool duplicate = false;
-			for (size_t i = 0; i < pset->num; i++) {
-if (strcmp(pset->infos[i].mount,
-new_mp) == 0) {
-	args = new_mp;
-	err = str_arg_subst(
-	msg_string(MSG_mp_already_exists),
-	1, );
-	err_msg_win(err);
-	free(err);
-	duplicate = true;
-	break;
-}
-			}
-			if (!duplicate)
+		}
+
+		/* duplicates? */
+		bool duplicate = false;
+		for (size_t i = 0; i < pset->num; i++) {
+			if (strcmp(pset->infos[i].mount,
+			new_mp) == 0) {
+				args = new_mp;
+err = str_arg_subst(
+msg_string(MSG_mp_already_exists),
+1, );
+err_msg_win(err);
+free(err);
+duplicate = true;
 break;
+			}
 		}
+		if (!duplicate)
+			break;
 	}
 
 	m = realloc(pset->menu_opts, (pset->num+4)*sizeof(*pset->menu_opts));
@@ -400,6 +401,11 @@ add_other_ptn_size(menudesc *menu, void 
 	p += pset->num;
 	memset(m, 0, sizeof(*m));
 	memset(p, 0, sizeof(*p));
+	p->parts = pset->parts;
+	p->cur_part_id = NO_PART;
+	p->type = PT_root;
+	p->fs_type = FS_BSDFFS;
+	p->fs_version = 2;
 	strncpy(p->mount, new_mp, sizeof(p->mount));
 
 	menu->cursel = pset->num;



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-08-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  2 05:43:21 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: bsddisklabel.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #5):
usr.sbin/sysinst/bsddisklabel.c: revision 1.24
usr.sbin/sysinst/bsddisklabel.c: revision 1.25
PR 54423: fix handling of user defined partitions
PR 54423: complete initialization of install info for user defined partitions


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.2.1 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: [netbsd-9] src/usr.sbin/sysinst

2019-08-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  2 05:41:46 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c label.c target.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #4):
usr.sbin/sysinst/target.c: revision 1.9
usr.sbin/sysinst/disks.c: revision 1.45
usr.sbin/sysinst/label.c: revision 1.11
Do not strip the trailing / on root mounts when evaluation "last mounted
on". Fix some /dev/ and raw vs. block device confusion on system upgrades.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.44.2.1 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.10 -r1.10.2.1 src/usr.sbin/sysinst/label.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/usr.sbin/sysinst/target.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.44 src/usr.sbin/sysinst/disks.c:1.44.2.1
--- src/usr.sbin/sysinst/disks.c:1.44	Thu Jul 25 13:11:15 2019
+++ src/usr.sbin/sysinst/disks.c	Fri Aug  2 05:41:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.44 2019/07/25 13:11:15 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.44.2.1 2019/08/02 05:41:46 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -80,6 +80,8 @@ struct disk_desc {
 	daddr_t	dd_totsec;
 };
 
+static const char name_prefix[] = "NAME=";
+
 /* Local prototypes */
 static int foundffs(struct data *, size_t);
 #ifdef USE_SYSVBFS
@@ -1399,23 +1401,37 @@ done_with_disks:
 	return 0;
 }
 
-
-
 static int
 /*ARGSUSED*/
 foundffs(struct data *list, size_t num)
 {
 	int error;
+	char rbuf[PATH_MAX], buf[PATH_MAX];
+	const char *rdev, *dev;
 
 	if (num < 2 || strcmp(list[1].u.s_val, "/") == 0 ||
 	strstr(list[2].u.s_val, "noauto") != NULL)
 		return 0;
 
-	error = fsck_preen(list[0].u.s_val, "ffs", false);
+	/* need the raw device for fsck_preen */
+	if (strncmp(list[0].u.s_val, name_prefix, sizeof(name_prefix)-1)
+	 != 0) {
+		strcpy(rbuf, "/dev/r");
+		strlcat(rbuf, list[0].u.s_val, sizeof(rbuf));
+		rdev = rbuf;
+		strcpy(buf, "/dev/");
+		strlcat(buf, list[0].u.s_val, sizeof(buf));
+		dev = buf;
+	} else {
+		rdev = list[0].u.s_val;
+		dev = list[0].u.s_val;
+	}
+
+	error = fsck_preen(rdev, "ffs", false);
 	if (error != 0)
 		return error;
 
-	error = target_mount("", list[0].u.s_val, list[1].u.s_val);
+	error = target_mount("", dev, list[1].u.s_val);
 	if (error != 0) {
 		msg_fmt_display(MSG_mount_failed, "%s", list[0].u.s_val);
 		if (!ask_noyes(NULL))

Index: src/usr.sbin/sysinst/label.c
diff -u src/usr.sbin/sysinst/label.c:1.10 src/usr.sbin/sysinst/label.c:1.10.2.1
--- src/usr.sbin/sysinst/label.c:1.10	Fri Jul 26 08:18:47 2019
+++ src/usr.sbin/sysinst/label.c	Fri Aug  2 05:41:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: label.c,v 1.10 2019/07/26 08:18:47 martin Exp $	*/
+/*	$NetBSD: label.c,v 1.10.2.1 2019/08/02 05:41:46 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.10 2019/07/26 08:18:47 martin Exp $");
+__RCSID("$NetBSD: label.c,v 1.10.2.1 2019/08/02 05:41:46 msaitoh Exp $");
 #endif
 
 #include 
@@ -1487,6 +1487,12 @@ canonicalize_last_mounted(char *path)
 {
 	char *p;
 
+	if (path == NULL)
+		return;
+
+	if (strcmp(path, "/") == 0)
+		return;	/* in this case a "trailing" slash is allowed */
+
 	for (;;) {
 		p = strrchr(path, '/');
 		if (p == NULL)

Index: src/usr.sbin/sysinst/target.c
diff -u src/usr.sbin/sysinst/target.c:1.8 src/usr.sbin/sysinst/target.c:1.8.2.1
--- src/usr.sbin/sysinst/target.c:1.8	Tue Jul 23 18:13:40 2019
+++ src/usr.sbin/sysinst/target.c	Fri Aug  2 05:41:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: target.c,v 1.8 2019/07/23 18:13:40 martin Exp $	*/
+/*	$NetBSD: target.c,v 1.8.2.1 2019/08/02 05:41:46 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -71,7 +71,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: target.c,v 1.8 2019/07/23 18:13:40 martin Exp $");
+__RCSID("$NetBSD: target.c,v 1.8.2.1 2019/08/02 05:41:46 msaitoh Exp $");
 #endif
 
 /*
@@ -209,6 +209,9 @@ target_already_root(void)
 bool
 is_root_part_mount(const char *last_mounted)
 {
+	if (last_mounted == NULL)
+		return false;
+
 	return strcmp(last_mounted, "/") == 0 ||
 	strcmp(last_mounted, "/targetroot") == 0 ||
 	strcmp(last_mounted, "/altroot") == 0;



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-08-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  2 05:41:46 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c label.c target.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #4):
usr.sbin/sysinst/target.c: revision 1.9
usr.sbin/sysinst/disks.c: revision 1.45
usr.sbin/sysinst/label.c: revision 1.11
Do not strip the trailing / on root mounts when evaluation "last mounted
on". Fix some /dev/ and raw vs. block device confusion on system upgrades.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.44.2.1 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.10 -r1.10.2.1 src/usr.sbin/sysinst/label.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/usr.sbin/sysinst/target.c

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