Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC)

- Fix for possible unset uid/gid in toproto
 - Fix for default mtree style
 - Update libelf
 - Importing libexecinfo
 - Resynchronize GCC, mpc, gmp, mpfr
 - build.sh: Replace params with show-params.
     This has been done as the make target has been renamed in the same
     way, while a new target named params has been added. This new
     target generates a file containing all the parameters, instead of
     printing it on the console.
 - Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org)
     get getservbyport() out of the inner loop

Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
This commit is contained in:
2013-12-06 12:04:52 +01:00
parent ff10274392
commit 84d9c625bf
4655 changed files with 379317 additions and 151059 deletions

View File

@@ -1,4 +1,4 @@
/* $NetBSD: amiga.c,v 1.7 2010/01/14 16:27:49 tsutsui Exp $ */
/* $NetBSD: amiga.c,v 1.8 2013/06/14 03:54:43 msaitoh Exp $ */
/*-
* Copyright (c) 1999, 2002 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if !defined(__lint)
__RCSID("$NetBSD: amiga.c,v 1.7 2010/01/14 16:27:49 tsutsui Exp $");
__RCSID("$NetBSD: amiga.c,v 1.8 2013/06/14 03:54:43 msaitoh Exp $");
#endif /* !__lint */
#include <sys/param.h>
@@ -76,7 +76,7 @@ amiga_setboot(ib_params *params)
char *dline;
int sumlen;
u_int32_t sum2, sum16;
struct stat bootstrapsb;
u_int32_t block[128*16];

View File

@@ -1,4 +1,4 @@
/* $NetBSD: hp300.c,v 1.13 2011/02/10 23:25:11 tsutsui Exp $ */
/* $NetBSD: hp300.c,v 1.15 2013/06/14 03:54:43 msaitoh Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -35,14 +35,15 @@
#include <sys/cdefs.h>
#if !defined(__lint)
__RCSID("$NetBSD: hp300.c,v 1.13 2011/02/10 23:25:11 tsutsui Exp $");
__RCSID("$NetBSD: hp300.c,v 1.15 2013/06/14 03:54:43 msaitoh Exp $");
#endif /* !__lint */
/* We need the target disklabel.h, not the hosts one..... */
#ifdef HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#include <nbinclude/hp300/disklabel.h>
#include <nbinclude/sys/disklabel.h>
#else
#else
#include <sys/disklabel.h>
#endif
#include <sys/fcntl.h>

View File

@@ -1,4 +1,4 @@
/* $NetBSD: hp700.c,v 1.4 2008/04/28 20:24:16 martin Exp $ */
/* $NetBSD: hp700.c,v 1.6 2013/06/14 03:54:43 msaitoh Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -35,14 +35,14 @@
#include <sys/cdefs.h>
#if !defined(__lint)
__RCSID("$NetBSD: hp700.c,v 1.4 2008/04/28 20:24:16 martin Exp $");
__RCSID("$NetBSD: hp700.c,v 1.6 2013/06/14 03:54:43 msaitoh Exp $");
#endif /* !__lint */
/* We need the target disklabel.h, not the hosts one..... */
#ifdef HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#include <nbinclude/sys/disklabel.h>
#else
#else
#include <sys/disklabel.h>
#endif
#include <sys/param.h>
@@ -178,9 +178,10 @@ hp700_setboot(ib_params *params)
} else if (be32toh(label.l.d_partitions[0].p_offset) +
be32toh(label.l.d_partitions[0].p_size) >
((unsigned)2*1024*1024*1024) / secsize) {
warnx("WARNING: Partition `a' of `%s' exceeds 2GB boundary.",
warnx("Partition `a' of `%s' exceeds 2GB boundary.",
params->filesystem);
warnx("WARNING: It won't boot since hp700 PDC can handle only 2GB.");
warnx("It won't boot since hp700 PDC can handle only 2GB.");
goto done;
}
/* read boot loader */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: i386.c,v 1.37 2011/08/14 17:50:17 christos Exp $ */
/* $NetBSD: i386.c,v 1.40 2013/06/14 03:54:43 msaitoh Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if !defined(__lint)
__RCSID("$NetBSD: i386.c,v 1.37 2011/08/14 17:50:17 christos Exp $");
__RCSID("$NetBSD: i386.c,v 1.40 2013/06/14 03:54:43 msaitoh Exp $");
#endif /* !__lint */
#include <sys/param.h>
@@ -79,21 +79,19 @@ struct ib_mach ib_mach_i386 =
{ "i386", i386_setboot, no_clearboot, i386_editboot,
IB_RESETVIDEO | IB_CONSOLE | IB_CONSPEED | IB_CONSADDR |
IB_KEYMAP | IB_PASSWORD | IB_TIMEOUT |
#if !defined(__minix)
IB_MODULES | IB_BOOTCONF |
IB_STAGE1START };
#else
IB_MODULES | IB_BOOTCONF };
#ifdef __minix
struct ib_mach ib_mach_i686 =
{ "i686", i386_setboot, no_clearboot, i386_editboot,
IB_RESETVIDEO | IB_CONSOLE | IB_CONSPEED | IB_CONSADDR |
IB_KEYMAP | IB_PASSWORD | IB_TIMEOUT |
IB_MODULES | IB_BOOTCONF };
#endif
#endif /* !defined(__minix) */
struct ib_mach ib_mach_amd64 =
{ "amd64", i386_setboot, no_clearboot, i386_editboot,
IB_RESETVIDEO | IB_CONSOLE | IB_CONSPEED | IB_CONSADDR |
IB_KEYMAP | IB_PASSWORD | IB_TIMEOUT |
IB_MODULES | IB_BOOTCONF };
IB_MODULES | IB_BOOTCONF |
IB_STAGE1START };
/*
* Attempting to write the 'labelsector' (or a sector near it - within 8k?)
@@ -191,7 +189,7 @@ write_boot_area(ib_params *params, uint8_t *buf, size_t len)
bad_write:
if (rv == -1)
warn("Writing `%s'", params->filesystem);
else
else
warnx("Writing `%s': short write, %u bytes",
params->filesystem, rv);
return 0;
@@ -257,7 +255,7 @@ update_i386_boot_params(ib_params *params, struct x86_boot_params *bpp)
if (i == __arraycount(consoles)) {
warnx("invalid console name, valid names are:");
(void)fprintf(stderr, "\t%s", consoles[0].name);
for (i = 1; consoles[i].name != NULL; i++)
for (i = 1; i < __arraycount(consoles); i++)
(void)fprintf(stderr, ", %s", consoles[i].name);
(void)fprintf(stderr, "\n");
return 1;
@@ -448,6 +446,9 @@ i386_setboot(ib_params *params)
/* Old BPB is shorter, leave zero filled */
u = disk_buf.b[1];
}
if (params->s1start != 0)
/* Fixup physical offset of filesytem */
bpb->bpbHiddenSecs = htole32(params->s1start);
memcpy(bootstrap.b + 2, disk_buf.b + 2, u);
}
#undef USE_F

View File

@@ -1,4 +1,4 @@
/* $NetBSD: landisk.c,v 1.5 2009/05/07 07:03:39 lukem Exp $ */
/* $NetBSD: landisk.c,v 1.6 2013/10/19 17:08:15 christos Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if !defined(__lint)
__RCSID("$NetBSD: landisk.c,v 1.5 2009/05/07 07:03:39 lukem Exp $");
__RCSID("$NetBSD: landisk.c,v 1.6 2013/10/19 17:08:15 christos Exp $");
#endif /* !__lint */
#include <sys/param.h>
@@ -68,7 +68,6 @@ landisk_setboot(ib_params *params)
size_t bootstrapsize;
int retval, i;
uint32_t bplen;
int bpbsize;
assert(params != NULL);
assert(params->fsfd != -1);
@@ -149,11 +148,11 @@ landisk_setboot(ib_params *params)
* 2b a0 11 jmp ENDOF(mbr_bpbFAT32)+1, nop
* (anything else) ; don't preserve
*/
bpbsize = 0;
#if 0
int bpbsize;
if (bootstrapbuf[1] == 0xa0 && bootstrapbuf[2] == 0x11 &&
(bootstrapbuf[0] == 0x2b /*|| bootstrapbuf[0] == 0x1d*/)) {
bpbsize = bootstrapbuf[0] + 2 - MBR_BPB_OFFSET;
bpbsize = bootstrapbuf[0] + 2 - MBR_BPB_OFFSET;
}
#endif

View File

@@ -1,4 +1,4 @@
/* $NetBSD: next68k.c,v 1.7 2010/01/07 13:26:00 tsutsui Exp $ */
/* $NetBSD: next68k.c,v 1.8 2013/06/14 03:54:43 msaitoh Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if !defined(__lint)
__RCSID("$NetBSD: next68k.c,v 1.7 2010/01/07 13:26:00 tsutsui Exp $");
__RCSID("$NetBSD: next68k.c,v 1.8 2013/06/14 03:54:43 msaitoh Exp $");
#endif /* !__lint */
#include <sys/param.h>
@@ -154,7 +154,7 @@ next68k_setboot(ib_params *params)
goto done;
}
if (bootsize > be16toh(next68klabel->cd_front) * cd_secsize -
if (bootsize > be16toh(next68klabel->cd_front) * cd_secsize -
NEXT68K_LABEL_SIZE) {
warnx("Boot program is larger than front porch space");
goto done;
@@ -174,7 +174,7 @@ next68k_setboot(ib_params *params)
/* can only fit one copy */
b0 = b1 = NEXT68K_LABEL_SIZE / cd_secsize;
else {
if (2 * bootsize > (fp * cd_secsize -
if (2 * bootsize > (fp * cd_secsize -
NEXT68K_LABEL_DEFAULTBOOT0_1 *
params->sectorsize))
/* can fit two copies starting after label */
@@ -230,7 +230,7 @@ next68k_setboot(ib_params *params)
goto done;
}
}
b0 *= sec_netonb_mult;
b1 *= sec_netonb_mult;
@@ -247,7 +247,7 @@ next68k_setboot(ib_params *params)
goto done;
}
if ((size_t)rv != bootsize) {
warnx("Writing `%s' at %d: short write",
warnx("Writing `%s' at %d: short write",
params->filesystem, b0);
goto done;
}

View File

@@ -1,4 +1,4 @@
/* $NetBSD: pmax.c,v 1.14 2009/04/05 11:55:39 lukem Exp $ */
/* $NetBSD: pmax.c,v 1.15 2013/10/21 15:37:46 christos Exp $ */
/*-
* Copyright (c) 1999, 2002 The NetBSD Foundation, Inc.
@@ -98,7 +98,7 @@
#include <sys/cdefs.h>
#if !defined(__lint)
__RCSID("$NetBSD: pmax.c,v 1.14 2009/04/05 11:55:39 lukem Exp $");
__RCSID("$NetBSD: pmax.c,v 1.15 2013/10/21 15:37:46 christos Exp $");
#endif /* !__lint */
#include <sys/param.h>
@@ -188,7 +188,7 @@ pmax_setboot(ib_params *params)
uint32_t startblock;
int retval;
char *bootstrapbuf;
size_t bootstrapsize;
size_t bootstrapsize = 0; /* XXX: gcc */
uint32_t bootstrapload, bootstrapexec;
ssize_t rv;

View File

@@ -1,4 +1,4 @@
/* $NetBSD: vax.c,v 1.13 2009/04/05 11:55:39 lukem Exp $ */
/* $NetBSD: vax.c,v 1.17 2013/06/16 19:05:00 martin Exp $ */
/*-
* Copyright (c) 1999, 2002 The NetBSD Foundation, Inc.
@@ -68,20 +68,30 @@
#include <sys/cdefs.h>
#if !defined(__lint)
__RCSID("$NetBSD: vax.c,v 1.13 2009/04/05 11:55:39 lukem Exp $");
__RCSID("$NetBSD: vax.c,v 1.17 2013/06/16 19:05:00 martin Exp $");
#endif /* !__lint */
#include <sys/param.h>
#ifdef HAVE_NBTOOL_CONFIG_H
#include <nbinclude/vax/disklabel.h>
#else
#include <sys/disklabel.h>
#endif
#include <assert.h>
#include <err.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "installboot.h"
#ifndef __CTASSERT
#define __CTASSERT(X)
#endif
static int load_bootstrap(ib_params *, char **,
uint32_t *, uint32_t *, size_t *);
@@ -101,7 +111,7 @@ vax_clearboot(ib_params *params)
assert(params != NULL);
assert(params->fsfd != -1);
assert(params->filesystem != NULL);
assert(sizeof(struct vax_boot_block) == VAX_BOOT_BLOCK_BLOCKSIZE);
__CTASSERT(sizeof(bb)==VAX_BOOT_BLOCK_BLOCKSIZE);
rv = pread(params->fsfd, &bb, sizeof(bb), VAX_BOOT_BLOCK_OFFSET);
if (rv == -1) {
@@ -112,7 +122,7 @@ vax_clearboot(ib_params *params)
return (0);
}
if (bb.bb_id_offset * 2 != offsetof(struct vax_boot_block, bb_magic1)
if (bb.bb_id_offset*2 >= VAX_BOOT_BLOCK_BLOCKSIZE
|| bb.bb_magic1 != VAX_BOOT_MAGIC1) {
warnx(
"Old boot block magic number invalid; boot block invalid");
@@ -154,10 +164,10 @@ static int
vax_setboot(ib_params *params)
{
struct stat bootstrapsb;
struct vax_boot_block bb;
struct vax_boot_block *bb;
uint32_t startblock;
int retval;
char *bootstrapbuf;
char *bootstrapbuf, oldbb[VAX_BOOT_BLOCK_BLOCKSIZE];
size_t bootstrapsize;
uint32_t bootstrapload, bootstrapexec;
ssize_t rv;
@@ -167,8 +177,12 @@ vax_setboot(ib_params *params)
assert(params->filesystem != NULL);
assert(params->s1fd != -1);
assert(params->stage1 != NULL);
assert(sizeof(struct vax_boot_block) == VAX_BOOT_BLOCK_BLOCKSIZE);
/* see sys/arch/vax/boot/xxboot/start.S for explanation */
__CTASSERT(offsetof(struct vax_boot_block,bb_magic1) == 0x19e);
__CTASSERT(sizeof(struct vax_boot_block) == VAX_BOOT_BLOCK_BLOCKSIZE);
startblock = 0;
retval = 0;
bootstrapbuf = NULL;
@@ -184,16 +198,29 @@ vax_setboot(ib_params *params)
&bootstrapexec, &bootstrapsize))
goto done;
rv = pread(params->fsfd, &bb, sizeof(bb), VAX_BOOT_BLOCK_OFFSET);
/* read old boot block */
rv = pread(params->fsfd, oldbb, sizeof(oldbb), VAX_BOOT_BLOCK_OFFSET);
if (rv == -1) {
warn("Reading `%s'", params->filesystem);
goto done;
} else if (rv != sizeof(bb)) {
} else if (rv != sizeof(oldbb)) {
warnx("Reading `%s': short read", params->filesystem);
goto done;
}
/* fill in the updated boot block fields */
/*
* Copy disklabel from old boot block to new.
* Assume everything between LABELOFFSET and the start of
* the param block is scratch area and can be copied over.
*/
memcpy(bootstrapbuf+LABELOFFSET,
oldbb+LABELOFFSET,
offsetof(struct vax_boot_block,bb_magic1)-LABELOFFSET);
/* point to bootblock at begining of bootstrap */
bb = (struct vax_boot_block*)bootstrapbuf;
/* fill in the updated boot block fields */
if (params->flags & IB_APPEND) {
struct stat filesyssb;
@@ -209,46 +236,21 @@ vax_setboot(ib_params *params)
}
startblock = howmany(filesyssb.st_size,
VAX_BOOT_BLOCK_BLOCKSIZE);
} else if (params->flags & IB_STAGE1START) {
startblock = params->s1start;
} else {
startblock = VAX_BOOT_BLOCK_OFFSET / VAX_BOOT_BLOCK_BLOCKSIZE
+ 1;
bb->bb_lbn_hi = htole16((uint16_t) (startblock >> 16));
bb->bb_lbn_low = htole16((uint16_t) (startblock >> 0));
}
bb.bb_id_offset = offsetof(struct vax_boot_block, bb_magic1) / 2;
bb.bb_mbone = 1;
bb.bb_lbn_hi = htole16((uint16_t) (startblock >> 16));
bb.bb_lbn_low = htole16((uint16_t) (startblock >> 0));
/*
* Now the identification block
*/
bb.bb_magic1 = VAX_BOOT_MAGIC1;
bb.bb_mbz1 = 0;
bb.bb_sum1 = ~(bb.bb_magic1 + bb.bb_mbz1 + bb.bb_pad1);
bb.bb_mbz2 = 0;
bb.bb_volinfo = VAX_BOOT_VOLINFO_NONE;
bb.bb_pad2a = 0;
bb.bb_pad2b = 0;
bb.bb_size = htole32(bootstrapsize / VAX_BOOT_BLOCK_BLOCKSIZE);
bb.bb_load = htole32(VAX_BOOT_LOAD);
bb.bb_entry = htole32(VAX_BOOT_ENTRY);
bb.bb_sum3 = htole32(le32toh(bb.bb_size) + le32toh(bb.bb_load) \
+ le32toh(bb.bb_entry));
if (params->flags & IB_SUNSUM) {
uint16_t sum;
sum = compute_sunsum((uint16_t *)&bb);
if (! set_sunsum(params, (uint16_t *)&bb, sum))
sum = compute_sunsum((uint16_t *)bb);
if (! set_sunsum(params, (uint16_t *)bb, sum))
goto done;
}
if (params->flags & IB_VERBOSE) {
printf("Bootstrap start sector: %u\n", startblock);
printf("Bootstrap sector count: %u\n", le32toh(bb.bb_size));
printf("Bootstrap sector count: %u\n", le32toh(bb->bb_size));
printf("%sriting bootstrap\n",
(params->flags & IB_NOWRITE) ? "Not w" : "W");
}
@@ -256,8 +258,7 @@ vax_setboot(ib_params *params)
retval = 1;
goto done;
}
rv = pwrite(params->fsfd, bootstrapbuf, bootstrapsize,
startblock * VAX_BOOT_BLOCK_BLOCKSIZE);
rv = pwrite(params->fsfd, bootstrapbuf, bootstrapsize, 0);
if (rv == -1) {
warn("Writing `%s'", params->filesystem);
goto done;
@@ -265,19 +266,7 @@ vax_setboot(ib_params *params)
warnx("Writing `%s': short write", params->filesystem);
goto done;
}
if (params->flags & IB_VERBOSE)
printf("Writing boot block\n");
rv = pwrite(params->fsfd, &bb, sizeof(bb), VAX_BOOT_BLOCK_OFFSET);
if (rv == -1) {
warn("Writing `%s'", params->filesystem);
goto done;
} else if (rv != sizeof(bb)) {
warnx("Writing `%s': short write", params->filesystem);
goto done;
} else {
retval = 1;
}
retval = 1;
done:
if (bootstrapbuf)