CVS commit: [netbsd-5] src/distrib/utils/sysinst

2013-05-11 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat May 11 22:41:10 UTC 2013

Modified Files:
src/distrib/utils/sysinst [netbsd-5]: menus.mi

Log Message:
distrib/utils/sysinst/menus.mi  1.35, 1.43

Some v6 dns server are outdated, so replace them with google's
public servers.
[msaitoh, ticket #1846]


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.33.2.1 src/distrib/utils/sysinst/menus.mi

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

Modified files:

Index: src/distrib/utils/sysinst/menus.mi
diff -u src/distrib/utils/sysinst/menus.mi:1.33 src/distrib/utils/sysinst/menus.mi:1.33.2.1
--- src/distrib/utils/sysinst/menus.mi:1.33	Fri Aug  8 02:54:06 2008
+++ src/distrib/utils/sysinst/menus.mi	Sat May 11 22:41:10 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: menus.mi,v 1.33 2008/08/08 02:54:06 simonb Exp $	*/
+/*	$NetBSD: menus.mi,v 1.33.2.1 2013/05/11 22:41:10 riz Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -347,28 +347,20 @@ menu localdirsource, y=-4, x=0, w=70, no
 		action { src_prompt(MSG_Set_dir, set_dir, 60); };
 
 menu namesrv6, title MSG_Select_IPv6_DNS_server;
-	option ns9.iij.ad.jp, exit, action
+	option google-public-dns-a.google.com, exit, action
 		{
 #ifdef INET6
-		  strlcpy(net_namesvr6, 2001:240::1, sizeof(net_namesvr6));
-		  yesno = 1;
-#else
-		  yesno = 0;
-#endif
-		}; 
-	option ns-wide.wide.ad.jp, exit, action
-		{
-#ifdef INET6
-		  strlcpy(net_namesvr6, 2001:200:0:1::3, sizeof(net_namesvr6));
+		  strlcpy(net_namesvr6, 2001:4860:4860::,
+		  sizeof(net_namesvr6));
 		  yesno = 1;
 #else
 		  yesno = 0;
 #endif
 		}; 
-	option light.imasy.or.jp, exit, action
+	option google-public-dns-b.google.com, exit, action
 		{
 #ifdef INET6
-		  strlcpy(net_namesvr6, 3ffe:505:0:1:2a0:c9ff:fe61:6521,
+		  strlcpy(net_namesvr6, 2001:4860:4860::8844,
 		  sizeof(net_namesvr6));
 		  yesno = 1;
 #else



CVS commit: [netbsd-5] src/distrib/utils/sysinst

2010-05-19 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu May 20 05:09:41 UTC 2010

Modified Files:
src/distrib/utils/sysinst [netbsd-5]: mbr.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1375):
distrib/utils/sysinst/mbr.c: revision 1.83
The 16bit bootmenu valid magic is slightly week, collisions have been
seen in the wild. So, before accepting arbitrary strings from there,
validate at least slightly and ignore if the entries are not properly
0 terminated or contain controll characters.


To generate a diff of this commit:
cvs rdiff -u -r1.79.14.1 -r1.79.14.2 src/distrib/utils/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/distrib/utils/sysinst/mbr.c
diff -u src/distrib/utils/sysinst/mbr.c:1.79.14.1 src/distrib/utils/sysinst/mbr.c:1.79.14.2
--- src/distrib/utils/sysinst/mbr.c:1.79.14.1	Mon May 18 19:35:13 2009
+++ src/distrib/utils/sysinst/mbr.c	Thu May 20 05:09:40 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbr.c,v 1.79.14.1 2009/05/18 19:35:13 bouyer Exp $ */
+/*	$NetBSD: mbr.c,v 1.79.14.2 2010/05/20 05:09:40 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1377,6 +1377,45 @@
 	return unknown;
 }
 
+#ifdef BOOTSEL
+static int
+validate_and_set_names(mbr_info_t *mbri, const struct mbr_bootsel *src,
+uint32_t ext_base)
+{
+	size_t i, l;
+	const unsigned char *p;
+
+	/*
+	 * The 16 bit magic used to detect wether mbr_bootsel is valid
+	 * or not is pretty week - collisions have been seen in the wild;
+	 * but maybe it is just foreign tools corruption reminiscents
+	 * of NetBSD MBRs. Anyway, before accepting a boot menu definition,
+	 * make sure it is kinda sane.
+	 */
+
+	for (i = 0; i  MBR_PART_COUNT; i++) {
+		/*
+		 * Make sure the name does not contain controll chars
+		 * (not using iscntrl due to minimalistic locale support
+		 * in miniroot environments) and is properly 0-terminated.
+		 */
+		for (l = 0, p = (const unsigned char *)src-mbrbs_nametab[i];
+		*p != 0; l++, p++) {
+			if (l 	MBR_BS_PARTNAMESIZE)
+return 0;
+			if (*p  ' ')	/* hacky 'iscntrl' */
+return 0;
+		}
+	}
+
+	memcpy(mbri-mbrb, src, sizeof(*src));
+
+	if (ext_base == 0)
+		return mbri-mbrb.mbrbs_defkey - SCAN_1;
+	return 0;
+}
+#endif
+
 int
 read_mbr(const char *disk, mbr_info_t *mbri)
 {
@@ -1434,15 +1473,14 @@
 #if BOOTSEL
 		if (mbrs-mbr_bootsel_magic == htole16(MBR_MAGIC)) {
 			/* old bootsel, grab bootsel info */
-			mbri-mbrb = *(struct mbr_bootsel *)
-((uint8_t *)mbrs + MBR_BS_OLD_OFFSET);
-			if (ext_base == 0)
-bootkey = mbri-mbrb.mbrbs_defkey - SCAN_1;
+			bootkey = validate_and_set_names(mbri, 
+(struct mbr_bootsel *)
+((uint8_t *)mbrs + MBR_BS_OLD_OFFSET),
+ext_base);
 		} else if (mbrs-mbr_bootsel_magic == htole16(MBR_BS_MAGIC)) {
 			/* new location */
-			mbri-mbrb = mbrs-mbr_bootsel;
-			if (ext_base == 0)
-bootkey = mbri-mbrb.mbrbs_defkey - SCAN_1;
+			bootkey = validate_and_set_names(mbri,
+			mbrs-mbr_bootsel, ext_base);
 		}
 		/* Save original flags for mbr code update tests */
 		mbri-oflags = mbri-mbrb.mbrbs_flags;



CVS commit: [netbsd-5] src/distrib/utils/sysinst

2010-05-19 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu May 20 05:36:35 UTC 2010

Modified Files:
src/distrib/utils/sysinst [netbsd-5]: mbr.c msg.mbr.de msg.mbr.en
msg.mbr.es msg.mbr.fr msg.mbr.pl

Log Message:
Pull up following revision(s) (requested by martin in ticket #1396):
distrib/utils/sysinst/mbr.c: revision 1.84
distrib/utils/sysinst/msg.mbr.de: revision 1.10
distrib/utils/sysinst/msg.mbr.en: revision 1.14
distrib/utils/sysinst/msg.mbr.es: revision 1.5
distrib/utils/sysinst/msg.mbr.fr: revision 1.16
distrib/utils/sysinst/msg.mbr.pl: revision 1.12
Fix a varargs argument type mismatch on 32bit archs - change format to
explicitly use %lu and cast the passed value accordingly.


To generate a diff of this commit:
cvs rdiff -u -r1.79.14.2 -r1.79.14.3 src/distrib/utils/sysinst/mbr.c
cvs rdiff -u -r1.8 -r1.8.22.1 src/distrib/utils/sysinst/msg.mbr.de
cvs rdiff -u -r1.13 -r1.13.30.1 src/distrib/utils/sysinst/msg.mbr.en
cvs rdiff -u -r1.4 -r1.4.30.1 src/distrib/utils/sysinst/msg.mbr.es
cvs rdiff -u -r1.14 -r1.14.28.1 src/distrib/utils/sysinst/msg.mbr.fr
cvs rdiff -u -r1.11 -r1.11.28.1 src/distrib/utils/sysinst/msg.mbr.pl

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

Modified files:

Index: src/distrib/utils/sysinst/mbr.c
diff -u src/distrib/utils/sysinst/mbr.c:1.79.14.2 src/distrib/utils/sysinst/mbr.c:1.79.14.3
--- src/distrib/utils/sysinst/mbr.c:1.79.14.2	Thu May 20 05:09:40 2010
+++ src/distrib/utils/sysinst/mbr.c	Thu May 20 05:36:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbr.c,v 1.79.14.2 2010/05/20 05:09:40 snj Exp $ */
+/*	$NetBSD: mbr.c,v 1.79.14.3 2010/05/20 05:36:35 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1156,8 +1156,8 @@
 
 	msg_display(MSG_editparttable);
 
-	msg_table_add(MSG_part_header, dlsize/sizemult, multname, multname,
-	multname, multname);
+	msg_table_add(MSG_part_header, (unsigned long)(dlsize/sizemult),
+	multname, multname, multname, multname);
 
 	if (num_opts == 0) {
 		num_opts = 6;
@@ -1282,6 +1282,10 @@
 		return(md_mbr_use_wholedisk(mbri));
 	}
 
+	/* Default to MB, and use bios geometry for cylinder size */
+	set_sizemultname_meg();
+	current_cylsize = bhead * bsec;
+
 	mbr_menu = new_menu(NULL, NULL, 16, 0, -1, 15, 70,
 			MC_NOBOX | MC_ALWAYS_SCROLL | MC_NOCLEAR,
 			set_mbr_header, set_mbr_label, NULL,
@@ -1289,10 +1293,6 @@
 	if (mbr_menu == -1)
 		return 0;
 
-	/* Default to MB, and use bios geometry for cylinder size */
-	set_sizemultname_meg();
-	current_cylsize = bhead * bsec;
-
 	for (;;) {
 		ptstart = 0;
 		ptsize = 0;

Index: src/distrib/utils/sysinst/msg.mbr.de
diff -u src/distrib/utils/sysinst/msg.mbr.de:1.8 src/distrib/utils/sysinst/msg.mbr.de:1.8.22.1
--- src/distrib/utils/sysinst/msg.mbr.de:1.8	Thu Feb 15 12:00:15 2007
+++ src/distrib/utils/sysinst/msg.mbr.de	Thu May 20 05:36:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mbr.de,v 1.8 2007/02/15 12:00:15 rillig Exp $	*/
+/*	$NetBSD: msg.mbr.de,v 1.8.22.1 2010/05/20 05:36:35 snj Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -66,7 +66,7 @@
 
 /* the %s's will expand into three character strings */
 message part_header
-{   Festplattenkapazität insgesamt %d %s.
+{   Festplattenkapazität insgesamt %lu %s.
 
 .if BOOTSEL
Start(%3s) Größe(%3s) Flag TypBootmenü

Index: src/distrib/utils/sysinst/msg.mbr.en
diff -u src/distrib/utils/sysinst/msg.mbr.en:1.13 src/distrib/utils/sysinst/msg.mbr.en:1.13.30.1
--- src/distrib/utils/sysinst/msg.mbr.en:1.13	Sun Apr 23 23:09:48 2006
+++ src/distrib/utils/sysinst/msg.mbr.en	Thu May 20 05:36:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mbr.en,v 1.13 2006/04/23 23:09:48 hubertf Exp $	*/
+/*	$NetBSD: msg.mbr.en,v 1.13.30.1 2010/05/20 05:36:35 snj Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -67,7 +67,7 @@
 
 /* the %s's will expand into three character strings */
 message part_header
-{   Total disk size %d %s.
+{   Total disk size %lu %s.
 
 .if BOOTSEL
Start(%3s)  Size(%3s) Flg KindBootmenu

Index: src/distrib/utils/sysinst/msg.mbr.es
diff -u src/distrib/utils/sysinst/msg.mbr.es:1.4 src/distrib/utils/sysinst/msg.mbr.es:1.4.30.1
--- src/distrib/utils/sysinst/msg.mbr.es:1.4	Thu Dec  8 16:51:45 2005
+++ src/distrib/utils/sysinst/msg.mbr.es	Thu May 20 05:36:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mbr.es,v 1.4 2005/12/08 16:51:45 xtraeme Exp $	*/
+/*	$NetBSD: msg.mbr.es,v 1.4.30.1 2010/05/20 05:36:35 snj Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -66,7 +66,7 @@
 
 /* the %s's will expand into three character strings */
 message part_header
-{   Tamaño total del disco %d %s.
+{   Tamaño total del disco %lu %s.
 
 .if BOOTSEL
Inicio(%3s) Tamaño(%3s) Opc TipoBootmenu

Index: src/distrib/utils/sysinst/msg.mbr.fr
diff -u src/distrib/utils/sysinst/msg.mbr.fr:1.14 

CVS commit: [netbsd-5] src/distrib/utils/sysinst

2010-01-16 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Jan 16 17:43:34 UTC 2010

Modified Files:
src/distrib/utils/sysinst [netbsd-5]: net.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1242):
distrib/utils/sysinst/net.c: revision 1.124
Use the proper structs for ioctls to fetch network configuration.
Might fix PR 42436.


To generate a diff of this commit:
cvs rdiff -u -r1.117.8.2 -r1.117.8.3 src/distrib/utils/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/distrib/utils/sysinst/net.c
diff -u src/distrib/utils/sysinst/net.c:1.117.8.2 src/distrib/utils/sysinst/net.c:1.117.8.3
--- src/distrib/utils/sysinst/net.c:1.117.8.2	Thu Jan 22 22:18:26 2009
+++ src/distrib/utils/sysinst/net.c	Sat Jan 16 17:43:34 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: net.c,v 1.117.8.2 2009/01/22 22:18:26 snj Exp $	*/
+/*	$NetBSD: net.c,v 1.117.8.3 2010/01/16 17:43:34 bouyer Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -301,7 +301,25 @@
 }
 
 static int
-do_ifreq(struct ifmediareq *ifmr, unsigned long cmd)
+do_ifreq(struct ifreq *ifr, unsigned long cmd)
+{
+	int sock;
+	int rval;
+
+	sock = socket(PF_INET, SOCK_DGRAM, 0);
+	if (sock == -1)
+		return -1;
+
+	memset(ifr, 0, sizeof *ifr);
+	strncpy(ifr-ifr_name, net_dev, sizeof ifr-ifr_name);
+	rval = ioctl(sock, cmd, ifr);
+	close(sock);
+
+	return rval;
+}
+
+static int
+do_ifmreq(struct ifmediareq *ifmr, unsigned long cmd)
 {
 	int sock;
 	int rval;
@@ -322,19 +340,20 @@
 static void
 get_ifinterface_info(void)
 {
+	struct ifreq ifr;
 	struct ifmediareq ifmr;
-	struct sockaddr_in *sa_in = (void *)((struct ifreq *)ifmr)-ifr_addr;
+	struct sockaddr_in *sa_in = (void*)ifr.ifr_addr;
 	int modew;
 	const char *media_opt;
 	const char *sep;
 
-	if (do_ifreq(ifmr, SIOCGIFADDR) == 0  sa_in-sin_addr.s_addr != 0)
+	if (do_ifreq(ifr, SIOCGIFADDR) == 0  sa_in-sin_addr.s_addr != 0)
 		strlcpy(net_ip, inet_ntoa(sa_in-sin_addr), sizeof net_ip);
 
-	if (do_ifreq(ifmr, SIOCGIFNETMASK) == 0  sa_in-sin_addr.s_addr != 0)
+	if (do_ifreq(ifr, SIOCGIFNETMASK) == 0  sa_in-sin_addr.s_addr != 0)
 		strlcpy(net_mask, inet_ntoa(sa_in-sin_addr), sizeof net_mask);
 
-	if (do_ifreq(ifmr, SIOCGIFMEDIA) == 0) {
+	if (do_ifmreq(ifmr, SIOCGIFMEDIA) == 0) {
 		/* Get the name of the media word */
 		modew = ifmr.ifm_current;
 		strlcpy(net_media, get_media_subtype_string(modew),



CVS commit: [netbsd-5] src/distrib/utils/sysinst

2010-01-08 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jan  9 01:31:57 UTC 2010

Modified Files:
src/distrib/utils/sysinst [netbsd-5]: disks.c

Log Message:
Pull up following revision(s) (requested by cegger in ticket #1217):
distrib/utils/sysinst/disks.c: revision 1.108
When creating /etc/fstab:
for the first swap partition use type sw,dp instead of sw, so dump device
gets configured correctly if swap is not on the second partition.
Fixes PR install/42148.


To generate a diff of this commit:
cvs rdiff -u -r1.100.2.5 -r1.100.2.6 src/distrib/utils/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/distrib/utils/sysinst/disks.c
diff -u src/distrib/utils/sysinst/disks.c:1.100.2.5 src/distrib/utils/sysinst/disks.c:1.100.2.6
--- src/distrib/utils/sysinst/disks.c:1.100.2.5	Sat Oct  3 23:22:23 2009
+++ src/distrib/utils/sysinst/disks.c	Sat Jan  9 01:31:57 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.100.2.5 2009/10/03 23:22:23 snj Exp $ */
+/*	$NetBSD: disks.c,v 1.100.2.6 2010/01/09 01:31:57 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -652,6 +652,7 @@
 {
 	FILE *f;
 	int i, swap_dev = -1;
+	const char *dump_dev;
 
 	/* Create the fstab. */
 	make_target_dir(/etc);
@@ -707,10 +708,14 @@
 			fstype = msdos;
 			break;
 		case FS_SWAP:
-			if (swap_dev == -1)
+			if (swap_dev == -1) {
 swap_dev = i;
-			scripting_fprintf(f, /dev/%s%c\t\tnone\tswap\tsw\t\t 0 0\n,
-diskdev, 'a' + i);
+dump_dev = ,dp;
+			} else {
+dump_dev =;
+			}
+			scripting_fprintf(f, /dev/%s%c\t\tnone\tswap\tsw%s\t\t 0 0\n,
+diskdev, 'a' + i, dump_dev);
 			continue;
 #ifdef USE_SYSVBFS
 		case FS_SYSVBFS:



CVS commit: [netbsd-5] src/distrib/utils/sysinst

2009-10-10 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Sat Oct 10 20:22:34 UTC 2009

Modified Files:
src/distrib/utils/sysinst [netbsd-5]: util.c

Log Message:
Pull up the following revisions(s) (requested by snj in ticket #1082):
distrib/utils/sysinst/util.c:   revision 1.161

Don't extract xetc to /, but rather in /.sysinst (like etc) so we don't blow
away existing config files. Wait until all sets have been unpacked to run
postinstall.  Previously we ran it after extracting etc, which meant that
/var/db/obsolete/ was not fully populated.


To generate a diff of this commit:
cvs rdiff -u -r1.151.14.3 -r1.151.14.4 src/distrib/utils/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/distrib/utils/sysinst/util.c
diff -u src/distrib/utils/sysinst/util.c:1.151.14.3 src/distrib/utils/sysinst/util.c:1.151.14.4
--- src/distrib/utils/sysinst/util.c:1.151.14.3	Fri Oct  9 08:09:24 2009
+++ src/distrib/utils/sysinst/util.c	Sat Oct 10 20:22:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.151.14.3 2009/10/09 08:09:24 sborrill Exp $	*/
+/*	$NetBSD: util.c,v 1.151.14.4 2009/10/10 20:22:34 sborrill Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -669,7 +669,7 @@
 
 	tarstats.nfound++;	
 	/* cd to the target root. */
-	if (update  dist-set == SET_ETC) {
+	if (update  (dist-set == SET_ETC || dist-set == SET_X11_ETC)) {
 		make_target_dir(/.sysinst);
 		target_chdir_or_die(/.sysinst);
 	} else
@@ -710,23 +710,6 @@
 		/* Plausibly we should unlink an empty xfer_dir as well */
 	}
 
-	if (update  dist-set == SET_ETC) {
-		int oldsendmail;
-		oldsendmail = run_program(RUN_DISPLAY | RUN_CHROOT |
-	  RUN_ERROR_OK | RUN_PROGRESS,
-	  /usr/sbin/postinstall -s /.sysinst -d / check mailerconf);
-		if (oldsendmail == 1) {
-			msg_display(MSG_oldsendmail);
-			process_menu(MENU_yesno, NULL);
-			if (yesno) {
-run_program(RUN_DISPLAY | RUN_CHROOT,
-	/usr/sbin/postinstall -s /.sysinst -d / fix mailerconf);
-			}
-		}
-		run_program(RUN_DISPLAY | RUN_CHROOT,
-			/usr/sbin/postinstall -s /.sysinst -d / fix);
-	}
-
 	set_status[dist-set] |= SET_INSTALLED;
 	tarstats.nsuccess++;
 	return SET_OK;
@@ -847,6 +830,28 @@
 		msg_clear();
 	}
 
+	/*
+	 * postinstall needs to be run after extracting all sets, because
+	 * otherwise /var/db/obsolete will only have current information
+	 * from the base, comp, and etc sets.
+	 */
+	if (update  (set_status[SET_ETC]  SET_INSTALLED)) {
+		int oldsendmail;
+		oldsendmail = run_program(RUN_DISPLAY | RUN_CHROOT |
+	  RUN_ERROR_OK | RUN_PROGRESS,
+	  /usr/sbin/postinstall -s /.sysinst -d / check mailerconf);
+		if (oldsendmail == 1) {
+			msg_display(MSG_oldsendmail);
+			process_menu(MENU_yesno, NULL);
+			if (yesno) {
+run_program(RUN_DISPLAY | RUN_CHROOT,
+	/usr/sbin/postinstall -s /.sysinst -d / fix mailerconf);
+			}
+		}
+		run_program(RUN_DISPLAY | RUN_CHROOT,
+			/usr/sbin/postinstall -s /.sysinst -d / fix);
+	}
+
 	/* Configure the system */
 	if (set_status[SET_BASE]  SET_INSTALLED)
 		run_makedev();



CVS commit: [netbsd-5] src/distrib/utils/sysinst

2009-10-09 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Oct  9 08:09:24 UTC 2009

Modified Files:
src/distrib/utils/sysinst [netbsd-5]: util.c

Log Message:
Pull up the following revisions(s) (requested by snj in ticket #1081):
distrib/utils/sysinst/util.c:   revision 1.160

/usr/X11R7/lib/X11/xkb/symbols/pc went from a directory to a file, so on
upgrades we need to remove it before extracting the xbase set.


To generate a diff of this commit:
cvs rdiff -u -r1.151.14.2 -r1.151.14.3 src/distrib/utils/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/distrib/utils/sysinst/util.c
diff -u src/distrib/utils/sysinst/util.c:1.151.14.2 src/distrib/utils/sysinst/util.c:1.151.14.3
--- src/distrib/utils/sysinst/util.c:1.151.14.2	Wed Feb 18 01:17:23 2009
+++ src/distrib/utils/sysinst/util.c	Fri Oct  9 08:09:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.151.14.2 2009/02/18 01:17:23 snj Exp $	*/
+/*	$NetBSD: util.c,v 1.151.14.3 2009/10/09 08:09:24 sborrill Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -675,6 +675,14 @@
 	} else
 		target_chdir_or_die(/);
 
+	/*
+	 * /usr/X11R7/lib/X11/xkb/symbols/pc was a directory in 5.0
+	 * but is a file in 5.1 and beyond, so on upgrades we need to
+	 * delete it before extracting the xbase set.
+	 */
+	if (update  dist-set == SET_X11_BASE)
+		run_program(0, rm -rf usr/X11R7/lib/X11/xkb/symbols/pc);
+
 	/* now extract set files into ./. */
 	if (verbose == 0)
 		rval = run_program(RUN_DISPLAY | RUN_PROGRESS, 



CVS commit: [netbsd-5] src/distrib/utils/sysinst

2009-10-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct  3 23:22:23 UTC 2009

Modified Files:
src/distrib/utils/sysinst [netbsd-5]: disks.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1046):
distrib/utils/sysinst/disks.c: revision 1.107
In get_descr(), initialize dd_descr to an empty string before probing
ATA and SCSI identification. Fixes issues with xbd and raid.


To generate a diff of this commit:
cvs rdiff -u -r1.100.2.4 -r1.100.2.5 src/distrib/utils/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/distrib/utils/sysinst/disks.c
diff -u src/distrib/utils/sysinst/disks.c:1.100.2.4 src/distrib/utils/sysinst/disks.c:1.100.2.5
--- src/distrib/utils/sysinst/disks.c:1.100.2.4	Sat Sep  5 12:57:00 2009
+++ src/distrib/utils/sysinst/disks.c	Sat Oct  3 23:22:23 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.100.2.4 2009/09/05 12:57:00 bouyer Exp $ */
+/*	$NetBSD: disks.c,v 1.100.2.5 2009/10/03 23:22:23 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -288,6 +288,8 @@
 	if (fd  0)
 		goto done;
 
+	dd-dd_descr[0] = '\0';
+
 	/* try ATA */
 	if (get_descr_ata(dd, fd))
 		goto done;



CVS commit: [netbsd-5] src/distrib/utils/sysinst

2009-09-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Sep  5 12:57:00 UTC 2009

Modified Files:
src/distrib/utils/sysinst [netbsd-5]: disks.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #924):
distrib/utils/sysinst/disks.c: revision 1.106
PR# install/41925: sysinst find_disks() should display more than just
   the device name
Try ATA/SCSI identify commands and when successful, use the model information
along with the disk size when creating the 'Available disks' menu.
Instead of having a list of disks (wd0, wd1, sd0) the menu now looks like:
  Available disks
 a: wd0 (977M, SanDisk SDCFB-1024)
  b: wd1 (233G, FUJITSU MHY2250BH)
  c: sd0 (246M, LEXAR JUMPDRIVE ELITE)
ok martin@


To generate a diff of this commit:
cvs rdiff -u -r1.100.2.3 -r1.100.2.4 src/distrib/utils/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/distrib/utils/sysinst/disks.c
diff -u src/distrib/utils/sysinst/disks.c:1.100.2.3 src/distrib/utils/sysinst/disks.c:1.100.2.4
--- src/distrib/utils/sysinst/disks.c:1.100.2.3	Mon May 18 19:35:14 2009
+++ src/distrib/utils/sysinst/disks.c	Sat Sep  5 12:57:00 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.100.2.3 2009/05/18 19:35:14 bouyer Exp $ */
+/*	$NetBSD: disks.c,v 1.100.2.4 2009/09/05 12:57:00 bouyer Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -56,6 +56,12 @@
 #include sys/disklabel.h
 #undef static
 
+#include dev/scsipi/scsipi_all.h
+#include sys/scsiio.h
+
+#include dev/ata/atareg.h
+#include sys/ataio.h
+
 #include defs.h
 #include md.h
 #include msg_defs.h
@@ -66,6 +72,7 @@
 #define MAX_DISKS 15
 struct disk_desc {
 	char	dd_name[SSTRSIZE];
+	char	dd_descr[70];
 	uint	dd_no_mbr;
 	uint	dd_cyl;
 	uint	dd_head;
@@ -88,6 +95,213 @@
 
 static const char *disk_names[] = { DISK_NAMES, vnd, NULL };
 
+/* from src/sbin/atactl/atactl.c
+ * extract_string: copy a block of bytes out of ataparams and make
+ * a proper string out of it, truncating trailing spaces and preserving
+ * strict typing. And also, not doing unaligned accesses.
+ */
+static void
+ata_extract_string(char *buf, size_t bufmax,
+		   uint8_t *bytes, unsigned numbytes,
+		   int needswap)
+{
+	unsigned i;
+	size_t j;
+	unsigned char ch1, ch2;
+
+	for (i = 0, j = 0; i  numbytes; i += 2) {
+		ch1 = bytes[i];
+		ch2 = bytes[i+1];
+		if (needswap  j  bufmax-1) {
+			buf[j++] = ch2;
+		}
+		if (j  bufmax-1) {
+			buf[j++] = ch1;
+		}
+		if (!needswap  j  bufmax-1) {
+			buf[j++] = ch2;
+		}
+	}
+	while (j  0  buf[j-1] == ' ') {
+		j--;
+	}
+	buf[j] = '\0';
+}
+
+/*
+ * from src/sbin/scsictl/scsi_subr.c
+ */
+#define STRVIS_ISWHITE(x) ((x) == ' ' || (x) == '\0' || (x) == (u_char)'\377')
+
+static void
+scsi_strvis(char *sdst, size_t dlen, const char *ssrc, size_t slen)
+{
+	u_char *dst = (u_char *)sdst;
+	const u_char *src = (const u_char *)ssrc;
+
+	/* Trim leading and trailing blanks and NULs. */
+	while (slen  0  STRVIS_ISWHITE(src[0]))
+		++src, --slen;
+	while (slen  0  STRVIS_ISWHITE(src[slen - 1]))
+		--slen;
+
+	while (slen  0) {
+		if (*src  0x20 || *src = 0x80) {
+			/* non-printable characters */
+			dlen -= 4;
+			if (dlen  1)
+break;
+			*dst++ = '\\';
+			*dst++ = ((*src  0300)  6) + '0';
+			*dst++ = ((*src  0070)  3) + '0';
+			*dst++ = ((*src  0007)  0) + '0';
+		} else if (*src == '\\') {
+			/* quote characters */
+			dlen -= 2;
+			if (dlen  1)
+break;
+			*dst++ = '\\';
+			*dst++ = '\\';
+		} else {
+			/* normal characters */
+			if (--dlen  1)
+break;
+			*dst++ = *src;
+		}
+		++src, --slen;
+	}
+
+	*dst++ = 0;
+}
+
+
+static int
+get_descr_scsi(struct disk_desc *dd, int fd)
+{
+	struct scsipi_inquiry_data inqbuf;
+	struct scsipi_inquiry cmd;
+	scsireq_t req;
+/* x4 in case every character is escaped, +1 for NUL. */
+	char vendor[(sizeof(inqbuf.vendor) * 4) + 1],
+	 product[(sizeof(inqbuf.product) * 4) + 1],
+	 revision[(sizeof(inqbuf.revision) * 4) + 1];
+	char size[5];
+	int error;
+
+	memset(inqbuf, 0, sizeof(inqbuf));
+	memset(cmd, 0, sizeof(cmd));
+	memset(req, 0, sizeof(req));
+
+	cmd.opcode = INQUIRY;
+	cmd.length = sizeof(inqbuf);
+	memcpy(req.cmd, cmd, sizeof(cmd));
+	req.cmdlen = sizeof(cmd);
+	req.databuf = inqbuf;
+	req.datalen = sizeof(inqbuf);
+	req.timeout = 1;
+	req.flags = SCCMD_READ;
+	req.senselen = SENSEBUFLEN;
+
+	error = ioctl(fd, SCIOCCOMMAND, req);
+	if (error == -1 || req.retsts != SCCMD_OK)
+		return 0;
+
+	scsi_strvis(vendor, sizeof(vendor), inqbuf.vendor,
+	sizeof(inqbuf.vendor));
+	scsi_strvis(product, sizeof(product), inqbuf.product,
+	sizeof(inqbuf.product));
+	scsi_strvis(revision, sizeof(revision), inqbuf.revision,
+	sizeof(inqbuf.revision));
+
+	humanize_number(size, sizeof(size),
+	(uint64_t)dd-dd_secsize * (uint64_t)dd-dd_totsec,
+	, HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL);
+	
+	snprintf(dd-dd_descr, 

CVS commit: [netbsd-5] src/distrib/utils/sysinst/arch/mac68k

2009-05-27 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed May 27 21:21:47 UTC 2009

Modified Files:
src/distrib/utils/sysinst/arch/mac68k [netbsd-5]: md.c

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #778):
distrib/utils/sysinst/arch/mac68k/md.c: revision 1.54
Fix build by explicitly narrowing dlsize to an unsigned 32-bit quantity as
supported by disklabel.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.53.2.1 src/distrib/utils/sysinst/arch/mac68k/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/distrib/utils/sysinst/arch/mac68k/md.c
diff -u src/distrib/utils/sysinst/arch/mac68k/md.c:1.53 src/distrib/utils/sysinst/arch/mac68k/md.c:1.53.2.1
--- src/distrib/utils/sysinst/arch/mac68k/md.c:1.53	Tue Oct  7 09:58:15 2008
+++ src/distrib/utils/sysinst/arch/mac68k/md.c	Wed May 27 21:21:47 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.53 2008/10/07 09:58:15 abs Exp $ */
+/*	$NetBSD: md.c,v 1.53.2.1 2009/05/27 21:21:47 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -44,6 +44,7 @@
 #include fcntl.h
 #include sys/ioctl.h
 #include sys/utsname.h
+#include machine/int_fmtio.h
 #include defs.h
 #include md.h
 #include msg_defs.h
@@ -1083,7 +1084,7 @@
 	(void)fprintf (f, %s|NetBSD installation generated:\\\n, bsddiskname);
 	(void)fprintf (f, \t:dt=%s:ty=winchester:\\\n, disktype);
 	(void)fprintf (f, \t:nc#%d:nt#%d:ns#%d:\\\n, dlcyl, dlhead, dlsec);
-	(void)fprintf (f, \t:sc#%d:su#%d:\\\n, dlhead*dlsec, dlsize);
+	(void)fprintf (f, \t:sc#%d:su#% PRIu32 :\\\n, dlhead*dlsec, (uint32_t)dlsize);
 	(void)fprintf (f, \t:se#%d:%s\\\n, blk_size, doessf);
 	for (i=0; i8; i++) {
 		if (bsdlabel[i].pi_fstype == FS_HFS)