CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: rin Date: Sat Feb 6 12:18:45 UTC 2021 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Mention fdisk(8) and x86/mbr(8) in example for x86, for careless people like me ;). Bump date. To generate a diff of this commit: cvs rdiff -u -r1.99 -r1.100 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.99 src/usr.sbin/installboot/installboot.8:1.100 --- src/usr.sbin/installboot/installboot.8:1.99 Sat Jun 6 20:30:23 2020 +++ src/usr.sbin/installboot/installboot.8 Sat Feb 6 12:18:45 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.99 2020/06/06 20:30:23 wiz Exp $ +.\" $NetBSD: installboot.8,v 1.100 2021/02/06 12:18:45 rin Exp $ .\" .\" Copyright (c) 2002-2019 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 5, 2019 +.Dd February 6, 2021 .Dt INSTALLBOOT 8 .Os .Sh NAME @@ -784,8 +784,17 @@ Install new boot blocks on an existing .Sy FFSv2 mounted root file system on .Sq wd0 , -setting the timeout to five seconds, after copying a new secondary -bootstrap: +setting the timeout to five seconds, after installing an MBR bootcode and +copying a new secondary bootstrap: +.Dl Ic fdisk -c /usr/mdec/mbr /dev/rwd0d +.Bd -ragged -offset indent-two -compact +.Em Note : +See +.Xr fdisk 8 +and +.Xr x86/mbr 8 +for more details. +.Ed .Dl Ic cp /usr/mdec/boot /boot .Dl Ic installboot -v -o timeout=5 /dev/rwd0a /usr/mdec/bootxx_ffsv2 .Bd -ragged -offset indent-two -compact @@ -958,6 +967,7 @@ already present: .Xr disklabel 8 , .Xr dumpfs 8 , .Xr fdisk 8 , +.Xr x86/mbr 8 , .Xr x86/pxeboot 8 . .Sh HISTORY
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: rin Date: Thu Feb 25 03:44:28 UTC 2021 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Adjust manpage for amiga/boot ver 3.1. Bump date. To generate a diff of this commit: cvs rdiff -u -r1.100 -r1.101 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.100 src/usr.sbin/installboot/installboot.8:1.101 --- src/usr.sbin/installboot/installboot.8:1.100 Sat Feb 6 12:18:45 2021 +++ src/usr.sbin/installboot/installboot.8 Thu Feb 25 03:44:27 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.100 2021/02/06 12:18:45 rin Exp $ +.\" $NetBSD: installboot.8,v 1.101 2021/02/25 03:44:27 rin Exp $ .\" .\" Copyright (c) 2002-2019 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 6, 2021 +.Dd February 25, 2021 .Dt INSTALLBOOT 8 .Os .Sh NAME @@ -741,7 +741,7 @@ Remove the primary bootstrap from disk .Ss Nx Ns /amiga Modify the command line to change the default from "netbsd -ASn2" to "netbsd -S": -.Dl Ic installboot -m amiga -o command="netbsd -S" /dev/rsd0a /usr/mdec/bootxx_ffs +.Dl Ic installboot -m amiga -o command="netbsd -S" /dev/rsd0a /usr/mdec/bootxx_ffsv1 . .Ss Nx Ns /evbarm Install the
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: wiz Date: Tue May 7 08:14:59 UTC 2019 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Fix typos. Fix link. Use Pa for path. To generate a diff of this commit: cvs rdiff -u -r1.96 -r1.97 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.96 src/usr.sbin/installboot/installboot.8:1.97 --- src/usr.sbin/installboot/installboot.8:1.96 Tue May 7 05:02:42 2019 +++ src/usr.sbin/installboot/installboot.8 Tue May 7 08:14:59 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.96 2019/05/07 05:02:42 thorpej Exp $ +.\" $NetBSD: installboot.8,v 1.97 2019/05/07 08:14:59 wiz Exp $ .\" .\" Copyright (c) 2002-2019 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -299,15 +299,16 @@ Modify the default boot command line. Set the console device, must be one of: pc, com0, com1, com2, com3, com0kbd, com1kbd, com2kbd, com3kbd or auto. . -.It Sy dtb= +.It Sy dtb=/path/to/dtb/file .Sy [ evbarm ] Attempt to determine the board type from information in the device tree -blob file at . +blob file at +.Pa /path/to/dtb/file . If both .Sy board and .Sy dtb -optios are specified, +options are specified, .Sy board takes precendence. . @@ -479,7 +480,7 @@ packages with .Nm installboot installation overlays. If multiple overlays are found, overlays from paths closer to the front -of the list take precensence. +of the list take precedence. If not specified, the default path is .Pa /usr/pkg/share/u-boot . This environment variable is only used on platforms that support @@ -950,7 +951,7 @@ already present: .Xr disklabel 8 , .Xr dumpfs 8 , .Xr fdisk 8 , -.Xr pxeboot 8 +.Xr x86/pxeboot 8 . .Sh HISTORY This implementation of
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: tsutsui Date: Sat Jun 6 10:22:45 UTC 2020 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Fix ews4800mips example. Its raw partition is rsd0p, not rsd0c. To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.98 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.97 src/usr.sbin/installboot/installboot.8:1.98 --- src/usr.sbin/installboot/installboot.8:1.97 Tue May 7 08:14:59 2019 +++ src/usr.sbin/installboot/installboot.8 Sat Jun 6 10:22:45 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.97 2019/05/07 08:14:59 wiz Exp $ +.\" $NetBSD: installboot.8,v 1.98 2020/06/06 10:22:45 tsutsui Exp $ .\" .\" Copyright (c) 2002-2019 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -770,8 +770,14 @@ Install the System V Boot File System pr with the secondary bootstrap .Sq Pa /boot already present in the SysVBFS partition on the disk: -.Dl Ic installboot /dev/rsd0c /usr/mdec/bootxx_bfs -. +.Dl Ic installboot /dev/rsd0p /usr/mdec/bootxx_bfs +.Bd -ragged -offset indent-two -compact +.Em Note : +On +.Nx Ns /ews4800mips the p partition is the +.Dq whole disk +(i.e. raw) partition. +.Ed .Ss Nx Ns /i386 and Nx Ns /amd64 Install new boot blocks on an existing .Sy FFSv2
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: wiz Date: Sat Jun 6 20:30:23 UTC 2020 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Reduce macro arguments. To generate a diff of this commit: cvs rdiff -u -r1.98 -r1.99 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.98 src/usr.sbin/installboot/installboot.8:1.99 --- src/usr.sbin/installboot/installboot.8:1.98 Sat Jun 6 10:22:45 2020 +++ src/usr.sbin/installboot/installboot.8 Sat Jun 6 20:30:23 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.98 2020/06/06 10:22:45 tsutsui Exp $ +.\" $NetBSD: installboot.8,v 1.99 2020/06/06 20:30:23 wiz Exp $ .\" .\" Copyright (c) 2002-2019 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -774,9 +774,10 @@ already present in the SysVBFS partition .Bd -ragged -offset indent-two -compact .Em Note : On -.Nx Ns /ews4800mips the p partition is the +.Nx Ns /ews4800mips +the p partition is the .Dq whole disk -(i.e. raw) partition. +(i.e., raw) partition. .Ed .Ss Nx Ns /i386 and Nx Ns /amd64 Install new boot blocks on an existing
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: thorpej Date: Sun Jun 7 00:58:59 UTC 2020 Modified Files: src/usr.sbin/installboot: evboards.c Log Message: Update for proplib(3) API changes. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/installboot/evboards.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/installboot/evboards.c diff -u src/usr.sbin/installboot/evboards.c:1.4 src/usr.sbin/installboot/evboards.c:1.5 --- src/usr.sbin/installboot/evboards.c:1.4 Thu May 14 08:34:18 2020 +++ src/usr.sbin/installboot/evboards.c Sun Jun 7 00:58:58 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: evboards.c,v 1.4 2020/05/14 08:34:18 msaitoh Exp $ */ +/* $NetBSD: evboards.c,v 1.5 2020/06/07 00:58:58 thorpej Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: evboards.c,v 1.4 2020/05/14 08:34:18 msaitoh Exp $"); +__RCSID("$NetBSD: evboards.c,v 1.5 2020/06/07 00:58:58 thorpej Exp $"); #endif /* !__lint */ #include @@ -654,7 +654,7 @@ validate_ubinstall_object(evb_board boar if (prop_object_type(obj) == PROP_TYPE_STRING) { evb_ubinstall tobj = prop_dictionary_get(board, - prop_string_cstring_nocopy((prop_string_t)obj)); + prop_string_value((prop_string_t)obj)); /* * The target evb_ubinstall object must exist @@ -738,7 +738,7 @@ validate_board_object(evb_board obj, boo prop_object_iterator_t iter = prop_dictionary_iterator(obj); prop_dictionary_keysym_t key; while ((key = prop_object_iterator_next(iter)) != NULL) { - const char *cp = prop_dictionary_keysym_cstring_nocopy(key); + const char *cp = prop_dictionary_keysym_value(key); if (strcmp(cp, board_u_boot_install_key) == 0) { has_default_install = true; } else if (strncmp(cp, board_u_boot_install_key, @@ -807,13 +807,13 @@ evb_db_load_overlay(ib_params *params, c assert(board != NULL); if (!validate_board_object(board, true)) { warnx("invalid board object in '%s': '%s'", path, - prop_dictionary_keysym_cstring_nocopy(key)); + prop_dictionary_keysym_value(key)); continue; } /* Add "runtime-u-boot-path". */ prop_string_t string = - prop_string_create_cstring(runtime_uboot_path); + prop_string_create_copy(runtime_uboot_path); assert(string != NULL); prop_dictionary_set(board, board_u_boot_path_key, string); prop_object_release(string); @@ -942,7 +942,7 @@ evb_db_load_base(ib_params *params) assert(board != NULL); if (!validate_board_object(board, false)) { warnx("invalid board object in '%s': '%s'", path, - prop_dictionary_keysym_cstring_nocopy(key)); + prop_dictionary_keysym_value(key)); prop_dictionary_remove_keysym(board_db, key); } } @@ -1339,7 +1339,7 @@ evb_db_list_boards(ib_params *params, FI continue; fprintf(out, "%-30s %s\n", - prop_dictionary_keysym_cstring_nocopy(key), + prop_dictionary_keysym_value(key), evb_board_get_description(params, board)); if ((params->flags & IB_VERBOSE) && uboot_path) { @@ -1364,7 +1364,7 @@ evb_board_get_description(ib_params *par prop_string_t string; string = prop_dictionary_get(board, board_description_key); - return prop_string_cstring_nocopy(string); + return prop_string_value(string); } /* @@ -1379,7 +1379,7 @@ evb_board_get_uboot_pkg(ib_params *param string = prop_dictionary_get(board, board_u_boot_pkg_key); if (string == NULL) return NULL; - return prop_string_cstring_nocopy(string); + return prop_string_value(string); } /* @@ -1394,7 +1394,7 @@ evb_board_get_uboot_path(ib_params *para string = prop_dictionary_get(board, board_u_boot_path_key); if (string == NULL) return NULL; - return prop_string_cstring_nocopy(string); + return prop_string_value(string); } /* @@ -1440,7 +1440,7 @@ evb_board_get_uboot_install(ib_params *p * exists. */ install = prop_dictionary_get(board, - prop_string_cstring_nocopy((prop_string_t)install)); + prop_string_value((prop_string_t)install)); } return install; } @@ -1453,7 +1453,7 @@ evb_board_get_uboot_install(ib_params *p prop_object_iterator_t iter = prop_array_iterator(array); prop_string_t string; while ((string = prop_object_iterator_next(iter)) != NULL) - fprintf(stderr, " %s", prop_string_cstring_nocopy(string)); + fprintf(stderr, " %s", prop_string_value(string)); fprintf(stderr, "\n"); prop_object_iterator_release(iter); prop_object_release(array); @@ -1482,12 +1482,12 @@ evb_board_copy_uboot_media(ib_params *pa assert(iter != NULL); while ((key = prop_object_iterator_next(iter)) != NULL) { - cp = prop_dictionary_keysym_cstring_nocopy(key); + cp = prop_dictionary_keysym_value(key); if (strcmp(cp, board_u_boot_install_key) == 0 || strncmp(cp, board_u_boot_install_key, sizeof(board_u_boot_install_key) - 1) !=
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: wiz Date: Tue Aug 15 21:21:18 UTC 2017 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Remove superfluous Tn macros. To generate a diff of this commit: cvs rdiff -u -r1.94 -r1.95 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.94 src/usr.sbin/installboot/installboot.8:1.95 --- src/usr.sbin/installboot/installboot.8:1.94 Tue Aug 15 10:11:31 2017 +++ src/usr.sbin/installboot/installboot.8 Tue Aug 15 21:21:18 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.94 2017/08/15 10:11:31 mrg Exp $ +.\" $NetBSD: installboot.8,v 1.95 2017/08/15 21:21:18 wiz Exp $ .\" .\" Copyright (c) 2002-2017 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -238,7 +238,7 @@ Supported options are (with the machines .Sy [ alpha ] Recalculate and restore the Alpha checksum. This is the default for -.Nx Ns Tn /alpha . +.Nx Ns /alpha . . .It Sy append .Sy [ alpha , @@ -312,11 +312,11 @@ BIOS) will be used. .Sy pmax , .Sy vax ] Recalculate and restore the Sun and -.Nx Ns Tn /sparc +.Nx Ns /sparc compatible checksum. .Em Note : The existing -.Nx Ns Tn /sparc +.Nx Ns /sparc disklabel should use no more than 4 partitions. . .It Sy timeout= @@ -439,8 +439,7 @@ Installed into the bootstrap area of the .Nm . . .It Pa /usr/mdec/bootxx_fat16 -Primary bootstrap for -.Tn MS-DOS +Primary bootstrap for MS-DOS .Sy FAT16 file systems. This differs from @@ -493,8 +492,7 @@ file systems (the default LFS version). . .It Pa /usr/mdec/bootxx_msdos -Primary bootstrap for -.Tn MS-DOS +Primary bootstrap for MS-DOS .Sy FAT file systems. . @@ -527,16 +525,16 @@ is not found. . .El . -.Ss Nx Ns Tn /evbmips files +.Ss Nx Ns /evbmips files . The -.Nx Ns Tn /evbmips +.Nx Ns /evbmips bootstrap files currently only apply to the SBMIPS kernels for the SiByte/Broadcom BCM1250 and BCM1480 CPUs. .Bl -tag -width /usr/mdec/sbmips/bootxx_cd9660 . .It Pa /usr/mdec/sbmips/boot -.Nx Ns Tn /evbmips +.Nx Ns /evbmips secondary bootstrap for .Sy FFSv1 , .Sy FFSv2 , @@ -558,12 +556,12 @@ does not currently support evbmips direc . .El . -.Ss Nx Ns Tn /hppa files +.Ss Nx Ns /hppa files . .Bl -tag -width /usr/mdec/bootxx_ustarfs . .It Pa /usr/mdec/xxboot -.Nx Ns Tn /hppa +.Nx Ns /hppa primary bootstrap for .Sy FFSv1 , .Sy FFSv2 , @@ -571,7 +569,7 @@ primary bootstrap for and .Sy LFSv2 . .It Pa /usr/mdec/cdboot -.Nx Ns Tn /hppa +.Nx Ns /hppa primary bootstrap for ISO 9660 file system. .It Pa /usr/mdec/sdboot Synonym for @@ -579,50 +577,50 @@ Synonym for . .El . -.Ss Nx Ns Tn /macppc files +.Ss Nx Ns /macppc files . .Bl -tag -width /usr/mdec/bootxx_ustarfs . .It Pa /usr/mdec/bootxx -.Nx Ns Tn /macppc +.Nx Ns /macppc primary bootstrap. . .It Pa /usr/mdec/ofwboot -.Nx Ns Tn /macppc +.Nx Ns /macppc secondary bootstrap. . .It Pa /ofwboot Installed copy of -.Nx Ns Tn /macppc +.Nx Ns /macppc secondary bootstrap. . .El . -.Ss Nx Ns Tn /next68k files +.Ss Nx Ns /next68k files . .Bl -tag -width /usr/mdec/bootxx_ustarfs . .It Pa /usr/mdec/boot -.Nx Ns Tn /next68k +.Nx Ns /next68k bootstrap. . .El . -.Ss Nx Ns Tn /sparc64 files +.Ss Nx Ns /sparc64 files . .Bl -tag -width /usr/mdec/bootxx_ustarfs . .It Pa /usr/mdec/bootblk -.Nx Ns Tn /sparc64 +.Nx Ns /sparc64 primary bootstrap. . .It Pa /usr/mdec/ofwboot -.Nx Ns Tn /sparc64 +.Nx Ns /sparc64 secondary bootstrap. . .It Pa /ofwboot Installed copy of -.Nx Ns Tn /sparc64 +.Nx Ns /sparc64 secondary bootstrap. . .El @@ -646,12 +644,12 @@ Remove the primary bootstrap from disk .Sq sd1 : .Dl Ic installboot -c /dev/rsd1c . -.Ss Nx Ns Tn /amiga +.Ss Nx Ns /amiga Modify the command line to change the default from "netbsd -ASn2" to "netbsd -S": .Dl Ic installboot -m amiga -o command="netbsd -S" /dev/rsd0a /usr/mdec/bootxx_ffs . -.Ss Nx Ns Tn /ews4800mips +.Ss Nx Ns /ews4800mips Install the System V Boot File System primary bootstrap on to disk .Sq sd0 , with the secondary bootstrap @@ -659,7 +657,7 @@ with the secondary bootstrap already present in the SysVBFS partition on the disk: .Dl Ic installboot /dev/rsd0c /usr/mdec/bootxx_bfs . -.Ss Nx Ns Tn /i386 and Nx Ns Tn /amd64 +.Ss Nx Ns /i386 and Nx Ns /amd64 Install new boot blocks on an existing .Sy FFSv2 mounted root file system on @@ -753,7 +751,7 @@ to make the device itself bootable. Switch the existing installed bootstrap to use a serial console without reinstalling or altering other options such as timeout. .Dl Ic installboot -e -o console=com0 /dev/rwd0a -.Ss Nx Ns Tn /macppc +.Ss Nx Ns /macppc Note the .Nm utility is only required for macppc machines with OpenFirmware version 2 @@ -766,7 +764,7 @@ Install the Berkeley Fast File System pr .Dl Ic installboot /dev/rwd0c /usr/mdec/bootxx /
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: bad Date: Tue Mar 14 13:50:40 UTC 2017 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Document option console=auto. Works since at least NetBSD 6. [i386,amd64] To generate a diff of this commit: cvs rdiff -u -r1.90 -r1.91 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.90 src/usr.sbin/installboot/installboot.8:1.91 --- src/usr.sbin/installboot/installboot.8:1.90 Tue Jun 21 21:53:55 2016 +++ src/usr.sbin/installboot/installboot.8 Tue Mar 14 13:50:40 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.90 2016/06/21 21:53:55 alnsn Exp $ +.\" $NetBSD: installboot.8,v 1.91 2017/03/14 13:50:40 bad Exp $ .\" .\" Copyright (c) 2002-2015 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -265,7 +265,7 @@ Modify the default boot command line. .Sy [ amd64 , .Sy i386 ] Set the console device, \*[Lt]console name\*[Gt] must be one of: -pc, com0, com1, com2, com3, com0kbd, com1kbd, com2kbd or com3kbd. +pc, com0, com1, com2, com3, com0kbd, com1kbd, com2kbd, com3kbd or auto. . .It Sy ioaddr=\*[Lt]ioaddr\*[Gt] .Sy [ amd64 ,
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: wiz Date: Wed Mar 15 11:22:47 UTC 2017 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Bump date for previous. To generate a diff of this commit: cvs rdiff -u -r1.91 -r1.92 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.91 src/usr.sbin/installboot/installboot.8:1.92 --- src/usr.sbin/installboot/installboot.8:1.91 Tue Mar 14 13:50:40 2017 +++ src/usr.sbin/installboot/installboot.8 Wed Mar 15 11:22:47 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.91 2017/03/14 13:50:40 bad Exp $ +.\" $NetBSD: installboot.8,v 1.92 2017/03/15 11:22:47 wiz Exp $ .\" .\" Copyright (c) 2002-2015 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 10, 2012 +.Dd March 14, 2017 .Dt INSTALLBOOT 8 .Os .Sh NAME
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: alnsn Date: Tue Jun 21 21:53:55 UTC 2016 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Fix a typo: s/can be use/can be used/ To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.89 src/usr.sbin/installboot/installboot.8:1.90 --- src/usr.sbin/installboot/installboot.8:1.89 Sun Mar 22 22:35:08 2015 +++ src/usr.sbin/installboot/installboot.8 Tue Jun 21 21:53:55 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.89 2015/03/22 22:35:08 wiz Exp $ +.\" $NetBSD: installboot.8,v 1.90 2016/06/21 21:53:55 alnsn Exp $ .\" .\" Copyright (c) 2002-2015 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -172,7 +172,7 @@ Clear (remove) any existing bootstrap in . .It Fl e Edit the options of an existing bootstrap. -This can be use to change the options in bootxx_xxxfs files, +This can be used to change the options in bootxx_xxxfs files, raw disk partitions, and the .Pa pxeboot_ia32.bin file.
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: dsl Date: Sat Mar 10 18:42:19 UTC 2012 Modified Files: src/usr.sbin/installboot: installboot.8 src/usr.sbin/installboot/arch: i386.c Log Message: Some FAT16 filesystems don't have 'hidden sectors' correctly set to the offset of the filesystem on the disk. Let '-b s1blk' be used to fix the value. To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/usr.sbin/installboot/installboot.8 cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/installboot/arch/i386.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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.84 src/usr.sbin/installboot/installboot.8:1.85 --- src/usr.sbin/installboot/installboot.8:1.84 Sat Feb 11 07:27:25 2012 +++ src/usr.sbin/installboot/installboot.8 Sat Mar 10 18:42:18 2012 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.84 2012/02/11 07:27:25 ast Exp $ +.\" $NetBSD: installboot.8,v 1.85 2012/03/10 18:42:18 dsl Exp $ .\" .\" Copyright (c) 2002-2012 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 11, 2012 +.Dd March 10, 2012 .Dt INSTALLBOOT 8 .Os .Sh NAME @@ -165,6 +165,7 @@ at block number .Ar s1bno instead of the default location for the machine and file system type. .Sy [ alpha , +.Sy i386/amd64 (bootxx_fat16 only) , .Sy pmax , .Sy vax ] . @@ -453,6 +454,12 @@ any It also uses the information in the .Ql Boot Parameter Block to get the media and filesytem properties. +The +.Ql hidden sectors +field of the BPB must the offset of the partition in the disk. +This can be set using the +.Fl b Ar s1bno +option. . .It Pa /usr/mdec/bootxx_ffsv1 Primary bootstrap for Index: src/usr.sbin/installboot/arch/i386.c diff -u src/usr.sbin/installboot/arch/i386.c:1.37 src/usr.sbin/installboot/arch/i386.c:1.38 --- src/usr.sbin/installboot/arch/i386.c:1.37 Sun Aug 14 17:50:17 2011 +++ src/usr.sbin/installboot/arch/i386.c Sat Mar 10 18:42:18 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: i386.c,v 1.37 2011/08/14 17:50:17 christos Exp $ */ +/* $NetBSD: i386.c,v 1.38 2012/03/10 18:42:18 dsl Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: i386.c,v 1.37 2011/08/14 17:50:17 christos Exp $"); +__RCSID("$NetBSD: i386.c,v 1.38 2012/03/10 18:42:18 dsl Exp $"); #endif /* !__lint */ #include @@ -79,13 +79,15 @@ 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 | - IB_MODULES | IB_BOOTCONF }; + IB_MODULES | IB_BOOTCONF | + IB_STAGE1START }; 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?) @@ -440,6 +442,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
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: wiz Date: Sat Mar 10 19:38:17 UTC 2012 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Add missing word. To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.85 src/usr.sbin/installboot/installboot.8:1.86 --- src/usr.sbin/installboot/installboot.8:1.85 Sat Mar 10 18:42:18 2012 +++ src/usr.sbin/installboot/installboot.8 Sat Mar 10 19:38:16 2012 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.85 2012/03/10 18:42:18 dsl Exp $ +.\" $NetBSD: installboot.8,v 1.86 2012/03/10 19:38:16 wiz Exp $ .\" .\" Copyright (c) 2002-2012 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -456,7 +456,7 @@ It also uses the information in the to get the media and filesytem properties. The .Ql hidden sectors -field of the BPB must the offset of the partition in the disk. +field of the BPB must be the offset of the partition in the disk. This can be set using the .Fl b Ar s1bno option.
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: skrll Date: Mon Jan 9 19:39:19 UTC 2012 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: s/ISO9660/ISO 9660/ for consistency with rest of man page. To generate a diff of this commit: cvs rdiff -u -r1.79 -r1.80 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.79 src/usr.sbin/installboot/installboot.8:1.80 --- src/usr.sbin/installboot/installboot.8:1.79 Thu Nov 3 20:09:18 2011 +++ src/usr.sbin/installboot/installboot.8 Mon Jan 9 19:39:18 2012 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.79 2011/11/03 20:09:18 martin Exp $ +.\" $NetBSD: installboot.8,v 1.80 2012/01/09 19:39:18 skrll Exp $ .\" .\" Copyright (c) 2002-2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -610,7 +610,7 @@ bootstrap: .Dl Ic installboot -v -o timeout=5 /dev/rwd0a /usr/mdec/bootxx_ffsv1 . .Pp -Create a bootable CD-ROM with an ISO9660 +Create a bootable CD-ROM with an ISO 9660 file system for an i386 system with a serial console: .Dl Ic mkdir cdrom .Dl Ic cp sys/arch/i386/compile/mykernel/netbsd cdrom/netbsd
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: skrll Date: Mon Jan 9 19:40:09 UTC 2012 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Update for hp700. Bump date. To generate a diff of this commit: cvs rdiff -u -r1.80 -r1.81 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.80 src/usr.sbin/installboot/installboot.8:1.81 --- src/usr.sbin/installboot/installboot.8:1.80 Mon Jan 9 19:39:18 2012 +++ src/usr.sbin/installboot/installboot.8 Mon Jan 9 19:40:09 2012 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.80 2012/01/09 19:39:18 skrll Exp $ +.\" $NetBSD: installboot.8,v 1.81 2012/01/09 19:40:09 skrll Exp $ .\" .\" Copyright (c) 2002-2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 3, 2011 +.Dd January 9, 2012 .Dt INSTALLBOOT 8 .Os .Sh NAME @@ -521,6 +521,27 @@ is not found. . .El . +.Ss Nx Ns Tn /hp700 files +. +.Bl -tag -width /usr/mdec/bootxx_ustarfs +. +.It Pa /usr/mdec/xxboot +.Nx Ns Tn /hp700 +primary bootstrap for +.Sy FFSv1 , +.Sy FFSv2 , +.Sy LFSv1 , +and +.Sy LFSv2 . +.It Pa /usr/mdec/cdboot +.Nx Ns Tn /hp700 +primary bootstrap for ISO 9660 file system. +.It Pa /usr/mdec/sdboot +Synonym for +.Pa /usr/mdec/xxboot +. +.El +. .Ss Nx Ns Tn /macppc files . .Bl -tag -width /usr/mdec/bootxx_ustarfs
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: wiz Date: Fri Feb 10 16:25:47 UTC 2012 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Remove trailing whitespace. Put macro arguments on same line. To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.82 src/usr.sbin/installboot/installboot.8:1.83 --- src/usr.sbin/installboot/installboot.8:1.82 Thu Feb 9 18:35:44 2012 +++ src/usr.sbin/installboot/installboot.8 Fri Feb 10 16:25:47 2012 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.82 2012/02/09 18:35:44 ast Exp $ +.\" $NetBSD: installboot.8,v 1.83 2012/02/10 16:25:47 wiz Exp $ .\" .\" Copyright (c) 2002-2012 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -458,12 +458,11 @@ to get the media and filesytem propertie Primary bootstrap for .Sy FFSv1 file systems -(the +(the .Ql traditional .Nx file system prior to -.Nx -6). +.Nx 6 ) . Use .Xr dumpfs 8 to confirm the file system format is @@ -473,8 +472,7 @@ to confirm the file system format is Primary bootstrap for .Sy FFSv2 file systems (the default file system for some platforms as of -.Nx -6). +.Nx 6 ) . Use .Xr dumpfs 8 to confirm the file system format is
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: ast Date: Sat Feb 11 07:27:25 UTC 2012 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Use "NetBSD 6.0" and not "NetBSD 6" and sound less like a broken record. Add note where the actual example is because that's where it's expected. Part of earlier commit ok-ed by releng@ To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.83 src/usr.sbin/installboot/installboot.8:1.84 --- src/usr.sbin/installboot/installboot.8:1.83 Fri Feb 10 16:25:47 2012 +++ src/usr.sbin/installboot/installboot.8 Sat Feb 11 07:27:25 2012 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.83 2012/02/10 16:25:47 wiz Exp $ +.\" $NetBSD: installboot.8,v 1.84 2012/02/11 07:27:25 ast Exp $ .\" .\" Copyright (c) 2002-2012 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 9, 2012 +.Dd February 11, 2012 .Dt INSTALLBOOT 8 .Os .Sh NAME @@ -460,9 +460,8 @@ Primary bootstrap for file systems (the .Ql traditional -.Nx file system prior to -.Nx 6 ) . +.Nx 6.0 ) . Use .Xr dumpfs 8 to confirm the file system format is @@ -472,7 +471,7 @@ to confirm the file system format is Primary bootstrap for .Sy FFSv2 file systems (the default file system for some platforms as of -.Nx 6 ) . +.Nx 6.0 ) . Use .Xr dumpfs 8 to confirm the file system format is @@ -634,7 +633,16 @@ setting the timeout to five seconds, aft bootstrap: .Dl Ic cp /usr/mdec/boot /boot .Dl Ic installboot -v -o timeout=5 /dev/rwd0a /usr/mdec/bootxx_ffsv2 -. +.Bd -ragged -offset indent-two -compact +.Em Note : +Pre +.Nx 6.0 +systems used +.Sy FFSv1 +file systems on these platforms; double check with +.Xr dumpfs 8 +to be sure to use the correct secondary bootstrap. +.Ed .Pp Create a bootable CD-ROM with an ISO 9660 file system for an i386 system with a serial console:
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: lukem Date: Sun Apr 5 11:55:39 UTC 2009 Modified Files: src/usr.sbin/installboot: bbinfo.c installboot.c src/usr.sbin/installboot/arch: alpha.c hp300.c i386.c landisk.c next68k.c pmax.c vax.c Log Message: fix sign-compare issues To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/installboot/bbinfo.c cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/installboot/installboot.c cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/installboot/arch/alpha.c cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/installboot/arch/hp300.c cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/installboot/arch/i386.c cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/installboot/arch/landisk.c cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/installboot/arch/next68k.c cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/installboot/arch/pmax.c cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/installboot/arch/vax.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/installboot/bbinfo.c diff -u src/usr.sbin/installboot/bbinfo.c:1.13 src/usr.sbin/installboot/bbinfo.c:1.14 --- src/usr.sbin/installboot/bbinfo.c:1.13 Fri May 9 10:53:55 2008 +++ src/usr.sbin/installboot/bbinfo.c Sun Apr 5 11:55:39 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: bbinfo.c,v 1.13 2008/05/09 10:53:55 tsutsui Exp $ */ +/* $NetBSD: bbinfo.c,v 1.14 2009/04/05 11:55:39 lukem Exp $ */ /*- * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: bbinfo.c,v 1.13 2008/05/09 10:53:55 tsutsui Exp $"); +__RCSID("$NetBSD: bbinfo.c,v 1.14 2009/04/05 11:55:39 lukem Exp $"); #endif /* !__lint */ #include @@ -81,7 +81,7 @@ if (rv == -1) { warn("Reading `%s'", params->filesystem); goto done; - } else if (rv != bbparams->maxsize) { + } else if ((uint32_t)rv != bbparams->maxsize) { warnx("Reading `%s': short read", params->filesystem); goto done; } @@ -127,7 +127,7 @@ if (rv == -1) { warn("Writing `%s'", params->filesystem); goto done; - } else if (rv != bbparams->maxsize) { + } else if ((uint32_t)rv != bbparams->maxsize) { warnx("Writing `%s': short write", params->filesystem); goto done; } else @@ -202,9 +202,9 @@ } #define HOSTTOTARGET32(x) ((bbparams->endian == BBINFO_LITTLE_ENDIAN) \ - ? htole32((x)) : htobe32((x))) + ? (uint32_t)htole32((x)) : (uint32_t)htobe32((x))) #define TARGET32TOHOST(x) ((bbparams->endian == BBINFO_LITTLE_ENDIAN) \ - ? le32toh((x)) : be32toh((x))) + ? (uint32_t)le32toh((x)) : (uint32_t)be32toh((x))) /* Look for the bbinfo structure. */ bbinfop = NULL; @@ -314,7 +314,7 @@ if (rv == -1) { warn("Writing `%s'", params->filesystem); goto done; - } else if (rv != bbparams->maxsize) { + } else if ((uint32_t)rv != bbparams->maxsize) { warnx("Writing `%s': short write", params->filesystem); goto done; } else { Index: src/usr.sbin/installboot/installboot.c diff -u src/usr.sbin/installboot/installboot.c:1.30 src/usr.sbin/installboot/installboot.c:1.31 --- src/usr.sbin/installboot/installboot.c:1.30 Mon Apr 28 20:24:16 2008 +++ src/usr.sbin/installboot/installboot.c Sun Apr 5 11:55:39 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: installboot.c,v 1.30 2008/04/28 20:24:16 martin Exp $ */ +/* $NetBSD: installboot.c,v 1.31 2009/04/05 11:55:39 lukem Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: installboot.c,v 1.30 2008/04/28 20:24:16 martin Exp $"); +__RCSID("$NetBSD: installboot.c,v 1.31 2009/04/05 11:55:39 lukem Exp $"); #endif /* !__lint */ #include @@ -370,10 +370,9 @@ val = strtoul(option, &cp, 0); if (cp > option + len || (*cp != 0 && *cp != ',')) break; - OPTION(params, int, opt) = val; - if (OPTION(params, int, opt) != val) -/* value got truncated on int convertion */ + if (val > INT_MAX) break; + OPTION(params, int, opt) = (int)val; continue; default: errx(1, "Internal error: option `%s' has invalid type %d", Index: src/usr.sbin/installboot/arch/alpha.c diff -u src/usr.sbin/installboot/arch/alpha.c:1.18 src/usr.sbin/installboot/arch/alpha.c:1.19 --- src/usr.sbin/installboot/arch/alpha.c:1.18 Mon Apr 28 20:24:16 2008 +++ src/usr.sbin/installboot/arch/alpha.c Sun Apr 5 11:55:39 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: alpha.c,v 1.18 2008/04/28 20:24:16 martin Exp $ */ +/* $NetBSD: alpha.c,v 1.19 2009/04/05 11:55:39 lukem Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -95,7 +95,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: alpha.c,v 1.18 2008/04/28 20:24:16 martin Exp $"); +__RCSID("$NetBSD: alpha.c,v 1.19 2009/04/05 11:55:39 lukem Exp $"); #endif /* !__lint */ #include @@ -309,7 +309,7 @@ if (rv == -1) { warn("Writing `%s'", params->filesystem); goto done; - } else if (rv != bootstrapsize) { + } else if
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: lukem Date: Sun Apr 5 12:03:48 UTC 2009 Modified Files: src/usr.sbin/installboot: ffs.c Log Message: fix sign-compare issues To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/installboot/ffs.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/installboot/ffs.c diff -u src/usr.sbin/installboot/ffs.c:1.26 src/usr.sbin/installboot/ffs.c:1.27 --- src/usr.sbin/installboot/ffs.c:1.26 Sun Oct 12 16:03:27 2008 +++ src/usr.sbin/installboot/ffs.c Sun Apr 5 12:03:48 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ffs.c,v 1.26 2008/10/12 16:03:27 apb Exp $ */ +/* $NetBSD: ffs.c,v 1.27 2009/04/05 12:03:48 lukem Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: ffs.c,v 1.26 2008/10/12 16:03:27 apb Exp $"); +__RCSID("$NetBSD: ffs.c,v 1.27 2009/04/05 12:03:48 lukem Exp $"); #endif /* !__lint */ #include @@ -232,7 +232,7 @@ #endif rv = (*callback)(params, state, fsbtodb(fs, blk) + params->fstype->offset, - sblksize(fs, inode->di_size, lblk)); + sblksize(fs, (int64_t)inode->di_size, lblk)); lblk++; nblk--; if (rv != 1) @@ -263,7 +263,7 @@ char inodebuf[MAXBSIZE]; struct ufs2_dinode *inode; int level_i; - int64_t blk, lblk, nblk; + int64_t blk, lblk, nblk; int rv; #define LEVELS 4 struct { @@ -368,7 +368,7 @@ #endif rv = (*callback)(params, state, fsbtodb(fs, blk) + params->fstype->offset, - sblksize(fs, inode->di_size, lblk)); + sblksize(fs, (int64_t)inode->di_size, lblk)); lblk++; nblk--; if (rv != 1)
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: lukem Date: Sun Apr 5 12:04:04 UTC 2009 Modified Files: src/usr.sbin/installboot: Makefile Log Message: WARNS=4 To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/usr.sbin/installboot/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/installboot/Makefile diff -u src/usr.sbin/installboot/Makefile:1.40 src/usr.sbin/installboot/Makefile:1.41 --- src/usr.sbin/installboot/Makefile:1.40 Fri Aug 29 00:02:25 2008 +++ src/usr.sbin/installboot/Makefile Sun Apr 5 12:04:04 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.40 2008/08/29 00:02:25 gmcgarry Exp $ +# $NetBSD: Makefile,v 1.41 2009/04/05 12:04:04 lukem Exp $ # .include @@ -39,7 +39,7 @@ #SRCS+= ext2fs.c ext2fs_bswap.c .endif -WARNS?= 3 +WARNS?= 4 UFSSRC= ${NETBSDSRCDIR}/sys/ufs CPPFLAGS+= -I${.CURDIR} -I.
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: lukem Date: Thu May 7 07:09:49 UTC 2009 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Add reminder to confirm the ffs format using dumpfs(8). To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.72 src/usr.sbin/installboot/installboot.8:1.73 --- src/usr.sbin/installboot/installboot.8:1.72 Sun Oct 12 16:02:45 2008 +++ src/usr.sbin/installboot/installboot.8 Thu May 7 07:09:49 2009 @@ -1,6 +1,6 @@ -.\" $NetBSD: installboot.8,v 1.72 2008/10/12 16:02:45 apb Exp $ +.\" $NetBSD: installboot.8,v 1.73 2009/05/07 07:09:49 lukem Exp $ .\" -.\" Copyright (c) 2002-2003 The NetBSD Foundation, Inc. +.\" Copyright (c) 2002-2009 The NetBSD Foundation, Inc. .\" All rights reserved. .\" .\" This code is derived from software contributed to The NetBSD Foundation @@ -442,11 +442,19 @@ (the "traditional" .Nx file system). +Use +.Xr dumpfs 8 +to confirm the file system format is +.Sy FFSv1 . . .It Pa /usr/mdec/bootxx_ffsv2 Primary bootstrap for .Sy FFSv2 file systems. +Use +.Xr dumpfs 8 +to confirm the file system format is +.Sy FFSv2 . . .It Pa /usr/mdec/bootxx_lfsv1 Primary bootstrap for @@ -741,6 +749,7 @@ .Xr uname 3 , .Xr boot 8 , .Xr disklabel 8 , +.Xr dumpfs 8 , .Xr fdisk 8 , .Xr pxeboot 8 .
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: matt Date: Tue Jun 14 05:35:08 UTC 2011 Modified Files: src/usr.sbin/installboot: installboot.h machines.c Log Message: A small bit of constification To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/installboot/installboot.h \ src/usr.sbin/installboot/machines.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/installboot/installboot.h diff -u src/usr.sbin/installboot/installboot.h:1.37 src/usr.sbin/installboot/installboot.h:1.38 --- src/usr.sbin/installboot/installboot.h:1.37 Thu Jan 14 17:49:32 2010 +++ src/usr.sbin/installboot/installboot.h Tue Jun 14 05:35:08 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: installboot.h,v 1.37 2010/01/14 17:49:32 drochner Exp $ */ +/* $NetBSD: installboot.h,v 1.38 2011/06/14 05:35:08 matt Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -135,7 +135,7 @@ bbinfo_endian endian; }; -extern struct ib_mach *machines[]; +extern struct ib_mach * const machines[]; extern struct ib_fs fstypes[]; /* installboot.c */ Index: src/usr.sbin/installboot/machines.c diff -u src/usr.sbin/installboot/machines.c:1.37 src/usr.sbin/installboot/machines.c:1.38 --- src/usr.sbin/installboot/machines.c:1.37 Wed Jan 26 01:18:55 2011 +++ src/usr.sbin/installboot/machines.c Tue Jun 14 05:35:08 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: machines.c,v 1.37 2011/01/26 01:18:55 pooka Exp $ */ +/* $NetBSD: machines.c,v 1.38 2011/06/14 05:35:08 matt Exp $ */ /*- * Copyright (c) 2002-2005 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: machines.c,v 1.37 2011/01/26 01:18:55 pooka Exp $"); +__RCSID("$NetBSD: machines.c,v 1.38 2011/06/14 05:35:08 matt Exp $"); #endif /* !__lint */ #include @@ -68,7 +68,7 @@ ib_mach_vax, ib_mach_x68k; -struct ib_mach *machines[] = { +struct ib_mach * const machines[] = { &ib_mach_alpha, &ib_mach_amd64, &ib_mach_amiga,
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: martin Date: Mon Apr 25 07:04:51 UTC 2011 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Use rsd0c instead of the (far less common) rwd0c as boot disk in the sparc64 example. To generate a diff of this commit: cvs rdiff -u -r1.75 -r1.76 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.75 src/usr.sbin/installboot/installboot.8:1.76 --- src/usr.sbin/installboot/installboot.8:1.75 Sun Nov 21 21:07:46 2010 +++ src/usr.sbin/installboot/installboot.8 Mon Apr 25 07:04:50 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.75 2010/11/21 21:07:46 jym Exp $ +.\" $NetBSD: installboot.8,v 1.76 2011/04/25 07:04:50 martin Exp $ .\" .\" Copyright (c) 2002-2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -742,7 +742,7 @@ .Ss Nx Ns Tn /sparc64 Install the Berkeley Fast File System primary bootstrap on to disk .Sq wd0 : -.Dl Ic installboot /dev/rwd0c /usr/mdec/bootblk +.Dl Ic installboot /dev/rsd0c /usr/mdec/bootblk .Pp The secondary .Nx Ns Tn /sparc64
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: martin Date: Thu Nov 3 20:09:18 UTC 2011 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Minor nits in the sparc64 example To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.78 src/usr.sbin/installboot/installboot.8:1.79 --- src/usr.sbin/installboot/installboot.8:1.78 Mon Aug 29 14:09:01 2011 +++ src/usr.sbin/installboot/installboot.8 Thu Nov 3 20:09:18 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.78 2011/08/29 14:09:01 alnsn Exp $ +.\" $NetBSD: installboot.8,v 1.79 2011/11/03 20:09:18 martin Exp $ .\" .\" Copyright (c) 2002-2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -747,8 +747,8 @@ already present: .Dl Ic installboot /dev/rsd0c /usr/mdec/bootxx /boot . .Ss Nx Ns Tn /sparc64 -Install the Berkeley Fast File System primary bootstrap on to disk -.Sq wd0 : +Install the primary bootstrap on to disk +.Sq sd0 : .Dl Ic installboot /dev/rsd0c /usr/mdec/bootblk .Pp The secondary
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: martin Date: Thu Nov 3 20:46:41 UTC 2011 Modified Files: src/usr.sbin/installboot: installboot.c Log Message: Minor usage tweaks for SMALLPROG To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/installboot/installboot.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/installboot/installboot.c diff -u src/usr.sbin/installboot/installboot.c:1.35 src/usr.sbin/installboot/installboot.c:1.36 --- src/usr.sbin/installboot/installboot.c:1.35 Wed Aug 31 13:32:37 2011 +++ src/usr.sbin/installboot/installboot.c Thu Nov 3 20:46:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: installboot.c,v 1.35 2011/08/31 13:32:37 joerg Exp $ */ +/* $NetBSD: installboot.c,v 1.36 2011/11/03 20:46:41 martin Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: installboot.c,v 1.35 2011/08/31 13:32:37 joerg Exp $"); +__RCSID("$NetBSD: installboot.c,v 1.36 2011/11/03 20:46:41 martin Exp $"); #endif /* !__lint */ #include @@ -488,7 +488,7 @@ machine_usage(void) #ifdef TIOCGWINSZ struct winsize win; - if (ioctl(fileno(stderr), TIOCGWINSZ, &win) == 0) + if (ioctl(fileno(stderr), TIOCGWINSZ, &win) == 0 && win.ws_col > 0) wincol = win.ws_col; #endif @@ -533,6 +533,7 @@ getfstype(ib_params *param, const char * static void fstype_usage(void) { +#ifndef NO_STAGE2 const char *prefix; int i; @@ -546,6 +547,7 @@ fstype_usage(void) prefix=", "; } fputs("\n", stderr); +#endif } static void
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: tsutsui Date: Thu Jan 7 13:26:00 UTC 2010 Modified Files: src/usr.sbin/installboot: ext2fs.c ffs.c fstypes.c installboot.c installboot.h src/usr.sbin/installboot/arch: hp300.c next68k.c Log Message: Add a sectorsize parameter member in struct ib_params and use it where sector size (disk block size) is required, instead of DEV_BSIZE constant which means device I/O block size. "Looks reasonable" from dholland@, and fixes tools installboot(8) on Cygwin where DEV_BSIZE != 512 as mentioned in PR toolchain/42555. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/installboot/ext2fs.c cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/installboot/ffs.c cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/installboot/fstypes.c cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/installboot/installboot.c cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/installboot/installboot.h cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/installboot/arch/hp300.c cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/installboot/arch/next68k.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/installboot/ext2fs.c diff -u src/usr.sbin/installboot/ext2fs.c:1.4 src/usr.sbin/installboot/ext2fs.c:1.5 --- src/usr.sbin/installboot/ext2fs.c:1.4 Mon Oct 19 18:41:17 2009 +++ src/usr.sbin/installboot/ext2fs.c Thu Jan 7 13:26:00 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ext2fs.c,v 1.4 2009/10/19 18:41:17 bouyer Exp $ */ +/* $NetBSD: ext2fs.c,v 1.5 2010/01/07 13:26:00 tsutsui Exp $ */ /* * Copyright (c) 1997 Manuel Bouyer. @@ -59,7 +59,7 @@ #include #if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: ext2fs.c,v 1.4 2009/10/19 18:41:17 bouyer Exp $"); +__RCSID("$NetBSD: ext2fs.c,v 1.5 2010/01/07 13:26:00 tsutsui Exp $"); #endif /* !__lint */ #include @@ -108,7 +108,7 @@ assert(size > 0); assert(blk != NULL); - rv = pread(params->fsfd, blk, size, blkno * DEV_BSIZE); + rv = pread(params->fsfd, blk, size, blkno * params->sectorsize); if (rv == -1) { warn("Reading block %llu in `%s'", (unsigned long long)blkno, params->filesystem); @@ -127,7 +127,7 @@ { uint8_t sbbuf[SBSIZE]; - if (ext2fs_read_disk_block(params, SBOFF / DEV_BSIZE, SBSIZE, + if (ext2fs_read_disk_block(params, SBOFF / params->sectorsize, SBSIZE, sbbuf) == 0) e2fs_sbload((void *)sbbuf, &fs->e2fs); Index: src/usr.sbin/installboot/ffs.c diff -u src/usr.sbin/installboot/ffs.c:1.27 src/usr.sbin/installboot/ffs.c:1.28 --- src/usr.sbin/installboot/ffs.c:1.27 Sun Apr 5 12:03:48 2009 +++ src/usr.sbin/installboot/ffs.c Thu Jan 7 13:26:00 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ffs.c,v 1.27 2009/04/05 12:03:48 lukem Exp $ */ +/* $NetBSD: ffs.c,v 1.28 2010/01/07 13:26:00 tsutsui Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: ffs.c,v 1.27 2009/04/05 12:03:48 lukem Exp $"); +__RCSID("$NetBSD: ffs.c,v 1.28 2010/01/07 13:26:00 tsutsui Exp $"); #endif /* !__lint */ #include @@ -97,7 +97,7 @@ assert(size > 0); assert(blk != NULL); - rv = pread(params->fsfd, blk, size, blkno * DEV_BSIZE); + rv = pread(params->fsfd, blk, size, blkno * params->sectorsize); if (rv == -1) { warn("Reading block %llu in `%s'", (unsigned long long)blkno, params->filesystem); @@ -475,10 +475,10 @@ raid_match(ib_params *params) { /* XXX Assumes 512 bytes / sector */ - if (DEV_BSIZE != 512) { + if (params->sectorsize != 512) { warnx("Media is %d bytes/sector." " RAID is only supported on 512 bytes/sector media.", - DEV_BSIZE); + params->sectorsize); return 0; } return ffs_match_common(params, (off_t) RF_PROTECTED_SECTORS); @@ -497,7 +497,7 @@ fs = (struct fs *)sbbuf; for (i = 0; sblock_try[i] != -1; i++) { - loc = sblock_try[i] / DEV_BSIZE + offset; + loc = sblock_try[i] / params->sectorsize + offset; if (!ffs_read_disk_block(params, loc, SBLOCKSIZE, sbbuf)) continue; switch (fs->fs_magic) { Index: src/usr.sbin/installboot/fstypes.c diff -u src/usr.sbin/installboot/fstypes.c:1.11 src/usr.sbin/installboot/fstypes.c:1.12 --- src/usr.sbin/installboot/fstypes.c:1.11 Mon Apr 28 20:24:16 2008 +++ src/usr.sbin/installboot/fstypes.c Thu Jan 7 13:26:00 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: fstypes.c,v 1.11 2008/04/28 20:24:16 martin Exp $ */ +/* $NetBSD: fstypes.c,v 1.12 2010/01/07 13:26:00 tsutsui Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: fstypes.c,v 1.11 2008/04/28 20:24:16 martin Exp $"); +__RCSID("$NetBSD: fstypes.c,v 1.12 2010/01/07 13:26:00 tsutsui Exp $"); #endif /* !__lint */ #include @@ -95,7 +95,7 @@ for (i = 0; i < nblk; i++) { blocks[i].block = params->s2start + - i * (params->fstype->blocksize / 512); + i * (params->fstype->blocksize / par
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: tsutsui Date: Thu Jan 14 16:27:49 UTC 2010 Modified Files: src/usr.sbin/installboot: ext2fs.c ffs.c fstypes.c installboot.c machines.c sum.c src/usr.sbin/installboot/arch: amiga.c sparc64.c Log Message: Remove if defined(__RCSID) around __RCSID() macro. #include "nbtool_config.h" is enough for tools. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/installboot/ext2fs.c cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/installboot/ffs.c cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/installboot/fstypes.c cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/installboot/installboot.c cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/installboot/machines.c cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/installboot/sum.c cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/installboot/arch/amiga.c cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/installboot/arch/sparc64.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/installboot/ext2fs.c diff -u src/usr.sbin/installboot/ext2fs.c:1.5 src/usr.sbin/installboot/ext2fs.c:1.6 --- src/usr.sbin/installboot/ext2fs.c:1.5 Thu Jan 7 13:26:00 2010 +++ src/usr.sbin/installboot/ext2fs.c Thu Jan 14 16:27:49 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ext2fs.c,v 1.5 2010/01/07 13:26:00 tsutsui Exp $ */ +/* $NetBSD: ext2fs.c,v 1.6 2010/01/14 16:27:49 tsutsui Exp $ */ /* * Copyright (c) 1997 Manuel Bouyer. @@ -58,8 +58,8 @@ #endif #include -#if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: ext2fs.c,v 1.5 2010/01/07 13:26:00 tsutsui Exp $"); +#if !defined(__lint) +__RCSID("$NetBSD: ext2fs.c,v 1.6 2010/01/14 16:27:49 tsutsui Exp $"); #endif /* !__lint */ #include Index: src/usr.sbin/installboot/ffs.c diff -u src/usr.sbin/installboot/ffs.c:1.28 src/usr.sbin/installboot/ffs.c:1.29 --- src/usr.sbin/installboot/ffs.c:1.28 Thu Jan 7 13:26:00 2010 +++ src/usr.sbin/installboot/ffs.c Thu Jan 14 16:27:49 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ffs.c,v 1.28 2010/01/07 13:26:00 tsutsui Exp $ */ +/* $NetBSD: ffs.c,v 1.29 2010/01/14 16:27:49 tsutsui Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -34,8 +34,8 @@ #endif #include -#if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: ffs.c,v 1.28 2010/01/07 13:26:00 tsutsui Exp $"); +#if !defined(__lint) +__RCSID("$NetBSD: ffs.c,v 1.29 2010/01/14 16:27:49 tsutsui Exp $"); #endif /* !__lint */ #include Index: src/usr.sbin/installboot/fstypes.c diff -u src/usr.sbin/installboot/fstypes.c:1.12 src/usr.sbin/installboot/fstypes.c:1.13 --- src/usr.sbin/installboot/fstypes.c:1.12 Thu Jan 7 13:26:00 2010 +++ src/usr.sbin/installboot/fstypes.c Thu Jan 14 16:27:49 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: fstypes.c,v 1.12 2010/01/07 13:26:00 tsutsui Exp $ */ +/* $NetBSD: fstypes.c,v 1.13 2010/01/14 16:27:49 tsutsui Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -34,8 +34,8 @@ #endif #include -#if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: fstypes.c,v 1.12 2010/01/07 13:26:00 tsutsui Exp $"); +#if !defined(__lint) +__RCSID("$NetBSD: fstypes.c,v 1.13 2010/01/14 16:27:49 tsutsui Exp $"); #endif /* !__lint */ #include Index: src/usr.sbin/installboot/installboot.c diff -u src/usr.sbin/installboot/installboot.c:1.32 src/usr.sbin/installboot/installboot.c:1.33 --- src/usr.sbin/installboot/installboot.c:1.32 Thu Jan 7 13:26:00 2010 +++ src/usr.sbin/installboot/installboot.c Thu Jan 14 16:27:49 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: installboot.c,v 1.32 2010/01/07 13:26:00 tsutsui Exp $ */ +/* $NetBSD: installboot.c,v 1.33 2010/01/14 16:27:49 tsutsui Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -34,8 +34,8 @@ #endif #include -#if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: installboot.c,v 1.32 2010/01/07 13:26:00 tsutsui Exp $"); +#if !defined(__lint) +__RCSID("$NetBSD: installboot.c,v 1.33 2010/01/14 16:27:49 tsutsui Exp $"); #endif /* !__lint */ #include Index: src/usr.sbin/installboot/machines.c diff -u src/usr.sbin/installboot/machines.c:1.35 src/usr.sbin/installboot/machines.c:1.36 --- src/usr.sbin/installboot/machines.c:1.35 Mon Apr 28 20:24:16 2008 +++ src/usr.sbin/installboot/machines.c Thu Jan 14 16:27:49 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: machines.c,v 1.35 2008/04/28 20:24:16 martin Exp $ */ +/* $NetBSD: machines.c,v 1.36 2010/01/14 16:27:49 tsutsui Exp $ */ /*- * Copyright (c) 2002-2005 The NetBSD Foundation, Inc. @@ -34,8 +34,8 @@ #endif #include -#if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: machines.c,v 1.35 2008/04/28 20:24:16 martin Exp $"); +#if !defined(__lint) +__RCSID("$NetBSD: machines.c,v 1.36 2010/01/14 16:27:49 tsutsui Exp $"); #endif /* !__lint */ #include Index: src/usr.sbin/installboot/sum.c diff -u src/usr.sbin/installboot/sum.c:1.4 src/usr.sbin/installboot/sum.c:1.5 --- src/usr.sbin/installboot/sum.c:1.4 Mon Apr 28 20:24:16 2008 +++ src/usr.sbin/i
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: gdt Date: Wed Aug 3 14:47:28 UTC 2011 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Explain how to use -e -v without -o to see the current options. Caution that installing a new primary bootstrap will reset options to default values. To generate a diff of this commit: cvs rdiff -u -r1.76 -r1.77 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.76 src/usr.sbin/installboot/installboot.8:1.77 --- src/usr.sbin/installboot/installboot.8:1.76 Mon Apr 25 07:04:50 2011 +++ src/usr.sbin/installboot/installboot.8 Wed Aug 3 14:47:28 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.76 2011/04/25 07:04:50 martin Exp $ +.\" $NetBSD: installboot.8,v 1.77 2011/08/03 14:47:28 gdt Exp $ .\" .\" Copyright (c) 2002-2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 11, 2010 +.Dd August 3, 2011 .Dt INSTALLBOOT 8 .Os .Sh NAME @@ -75,6 +75,8 @@ .Pp One some architectures the options of an existing installed bootstrap, or those of a bootstrap file can be changed. +Installing a new primary bootstrap will reset those options to default +values. .Pp Generally, .Nx @@ -175,6 +177,11 @@ raw disk partitions, and the .Pa pxeboot_ia32.bin file. +With +.Fl v +and without +.Fl o , +show the current options. .Sy [ amd64 , i386 ] . .It Fl f
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: christos Date: Sun Aug 14 17:50:17 UTC 2011 Modified Files: src/usr.sbin/installboot: Makefile src/usr.sbin/installboot/arch: alpha.c i386.c Log Message: fix various gcc-4.5 warnings To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/usr.sbin/installboot/Makefile cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/installboot/arch/alpha.c cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/installboot/arch/i386.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/installboot/Makefile diff -u src/usr.sbin/installboot/Makefile:1.45 src/usr.sbin/installboot/Makefile:1.46 --- src/usr.sbin/installboot/Makefile:1.45 Tue Jun 21 22:49:45 2011 +++ src/usr.sbin/installboot/Makefile Sun Aug 14 13:50:16 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.45 2011/06/22 02:49:45 mrg Exp $ +# $NetBSD: Makefile,v 1.46 2011/08/14 17:50:16 christos Exp $ # .include @@ -52,8 +52,3 @@ .endif .include - -# XXX -.if ${HAVE_GCC} == 45 -COPTS.i386.c+= -Wno-error -.endif Index: src/usr.sbin/installboot/arch/alpha.c diff -u src/usr.sbin/installboot/arch/alpha.c:1.20 src/usr.sbin/installboot/arch/alpha.c:1.21 --- src/usr.sbin/installboot/arch/alpha.c:1.20 Mon Oct 26 10:26:25 2009 +++ src/usr.sbin/installboot/arch/alpha.c Sun Aug 14 13:50:17 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: alpha.c,v 1.20 2009/10/26 14:26:25 tsutsui Exp $ */ +/* $NetBSD: alpha.c,v 1.21 2011/08/14 17:50:17 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -95,7 +95,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: alpha.c,v 1.20 2009/10/26 14:26:25 tsutsui Exp $"); +__RCSID("$NetBSD: alpha.c,v 1.21 2011/08/14 17:50:17 christos Exp $"); #endif /* !__lint */ #include @@ -440,8 +440,7 @@ check_sparc(const struct alpha_boot_block * const bb, const char *when) { uint16_t bb16[256]; - const char * const wmsg = - "%s sparc %s 0x%04x invalid, expected 0x%04x"; +#define wmsg "%s sparc %s 0x%04x invalid, expected 0x%04x" memcpy(bb16, bb, sizeof(bb16)); if (compute_sunsum(bb16) != bb16[255]) Index: src/usr.sbin/installboot/arch/i386.c diff -u src/usr.sbin/installboot/arch/i386.c:1.36 src/usr.sbin/installboot/arch/i386.c:1.37 --- src/usr.sbin/installboot/arch/i386.c:1.36 Sun Jan 17 09:54:44 2010 +++ src/usr.sbin/installboot/arch/i386.c Sun Aug 14 13:50:17 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: i386.c,v 1.36 2010/01/17 14:54:44 drochner Exp $ */ +/* $NetBSD: i386.c,v 1.37 2011/08/14 17:50:17 christos Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: i386.c,v 1.36 2010/01/17 14:54:44 drochner Exp $"); +__RCSID("$NetBSD: i386.c,v 1.37 2011/08/14 17:50:17 christos Exp $"); #endif /* !__lint */ #include @@ -56,8 +56,6 @@ #include "installboot.h" -#define nelem(x) (sizeof (x)/sizeof *(x)) - static const struct console_name { const char *name; /* Name of console selection */ const int dev; /* value matching CONSDEV_* from sys/arch/i386/stand/lib/libi386.h */ @@ -124,10 +122,9 @@ } static int -write_boot_area(ib_params *params, void *v_buf, int len) +write_boot_area(ib_params *params, uint8_t *buf, size_t len) { int rv, i; - uint8_t *buf = v_buf; /* * Writing the 'label' sector (likely to be bytes 512-1023) could @@ -149,7 +146,7 @@ return 1; len -= 512 * 2; rv = pwrite_validate(params->fsfd, buf + 512 * 2, len, 512 * 2); - if (rv != len) + if (rv != (ssize_t)len) goto bad_write; return 1; } @@ -159,7 +156,7 @@ if (errno == EINVAL) { /* Assume the failure was due to to the sector size > 512 */ rv = pwrite_validate(params->fsfd, buf, len, 0); - if (rv == len) + if (rv == (ssize_t)len) return 1; if (rv != -1 || (errno != EROFS)) goto bad_write; @@ -179,7 +176,7 @@ /* Reset write-protext */ i = 0; ioctl(params->fsfd, DIOCWLABEL, &i); - if (rv == len) + if (rv == (ssize_t)len) return 1; #endif @@ -202,11 +199,11 @@ printf("flags %x, ", le32toh(bpp->bp_flags)); printf("speed %d, ", le32toh(bpp->bp_conspeed)); printf("ioaddr %x, ", le32toh(bpp->bp_consaddr)); - for (i = 0; i < nelem(consoles); i++) { + for (i = 0; i < __arraycount(consoles); i++) { if (consoles[i].dev == (int)le32toh(bpp->bp_consdev)) break; } - if (i == nelem(consoles)) + if (i == __arraycount(consoles)) printf("console %d\n", le32toh(bpp->bp_consdev)); else printf("console %s\n", consoles[i].name); @@ -245,11 +242,11 @@ if (params->flags & IB_CONSADDR) bp.bp_consaddr = htole32(params->consaddr); if (params->flags & IB_CONSOLE) { - for (i = 0; i < nelem(consoles); i++) + for (i = 0; i < __arraycount(consoles); i++) if (strcmp(consoles[i].name, params->console) == 0) break; - if (i == nelem(consoles)) { + if (i == __arraycount(consoles)) { warnx("invalid console name, valid names are:"); (void
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: alnsn Date: Mon Aug 29 14:09:02 UTC 2011 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Typo. To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.77 src/usr.sbin/installboot/installboot.8:1.78 --- src/usr.sbin/installboot/installboot.8:1.77 Wed Aug 3 14:47:28 2011 +++ src/usr.sbin/installboot/installboot.8 Mon Aug 29 14:09:01 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.77 2011/08/03 14:47:28 gdt Exp $ +.\" $NetBSD: installboot.8,v 1.78 2011/08/29 14:09:01 alnsn Exp $ .\" .\" Copyright (c) 2002-2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -73,7 +73,7 @@ or disable an existing bootstrap in .Ar filesystem . .Pp -One some architectures the options of an existing installed bootstrap, +On some architectures the options of an existing installed bootstrap, or those of a bootstrap file can be changed. Installing a new primary bootstrap will reset those options to default values.
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: jym Date: Sun Nov 21 21:07:46 UTC 2010 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Sort options. To generate a diff of this commit: cvs rdiff -u -r1.74 -r1.75 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.74 src/usr.sbin/installboot/installboot.8:1.75 --- src/usr.sbin/installboot/installboot.8:1.74 Thu Jan 14 17:49:32 2010 +++ src/usr.sbin/installboot/installboot.8 Sun Nov 21 21:07:46 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.74 2010/01/14 17:49:32 drochner Exp $ +.\" $NetBSD: installboot.8,v 1.75 2010/11/21 21:07:46 jym Exp $ .\" .\" Copyright (c) 2002-2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -244,6 +244,13 @@ .Ar filesystem , which must be a regular file in this case. . +.It Sy bootconf +.Sy [ amd64 , +.Sy i386 ] +(Don't) read a +.Dq boot.cfg +file. +. .It Sy command=\*[Lt]boot command\*[Gt] .Sy [ amiga ] Modify the default boot command line. @@ -272,6 +279,11 @@ and .Sq z . . +.It Sy modules +.Sy [ amd64 , +.Sy i386 ] +(Don't) load kernel modules. +. .It Sy password=\*[Lt]password\*[Gt] .Sy [ amd64 , .Sy i386 ] @@ -305,18 +317,6 @@ .Sy [ amd64 , .Sy i386 ] Set the timeout before the automatic boot begins to the given number of seconds. -. -.It Sy modules -.Sy [ amd64 , -.Sy i386 ] -(Don't) load kernel modules. -. -.It Sy bootconf -.Sy [ amd64 , -.Sy i386 ] -(Don't) read a -.Dq boot.cfg -file. .El . .It Fl t Ar fstype
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: ast Date: Sun Mar 22 09:45:50 UTC 2015 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Appease various mandoc -Tlint warnings and update copyright while we're here To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.87 src/usr.sbin/installboot/installboot.8:1.88 --- src/usr.sbin/installboot/installboot.8:1.87 Mon Feb 24 07:23:44 2014 +++ src/usr.sbin/installboot/installboot.8 Sun Mar 22 09:45:50 2015 @@ -1,6 +1,6 @@ -.\" $NetBSD: installboot.8,v 1.87 2014/02/24 07:23:44 skrll Exp $ +.\" $NetBSD: installboot.8,v 1.88 2015/03/22 09:45:50 ast Exp $ .\" -.\" Copyright (c) 2002-2012 The NetBSD Foundation, Inc. +.\" Copyright (c) 2002-2015 The NetBSD Foundation, Inc. .\" All rights reserved. .\" .\" This code is derived from software contributed to The NetBSD Foundation @@ -104,7 +104,6 @@ Copy the secondary bootstrap (usually or .Pa /usr/mdec/boot ) to the root directory of the target file system. -.Pp . .It Use @@ -131,7 +130,6 @@ single bootstrap file is used. The single bootstrap is installed like the primary bootstrap on other platforms: .Sy next68k . -.Pp .El .Pp The options and arguments recognized by @@ -432,7 +430,6 @@ overriding the result from Most .Nx ports will contain variations of the following files: -.Pp .Bl -tag -width /usr/mdec/bootxx_ustarfs . .It Pa /usr/mdec/bootxx_ Ns Sy FSTYPE @@ -751,7 +748,6 @@ which is used for the OpenFirmware to lo Install the bootstrap on to disk .Sq sd0 : .Dl Ic installboot /dev/rsd0c /usr/mdec/boot -.Pp . .Ss Nx Ns Tn /pmax Install the Berkeley Fast File System primary bootstrap on to disk
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: wiz Date: Sun Mar 22 22:35:09 UTC 2015 Modified Files: src/usr.sbin/installboot: installboot.8 Log Message: Use An in AUTHORS section. To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/usr.sbin/installboot/installboot.8 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/installboot/installboot.8 diff -u src/usr.sbin/installboot/installboot.8:1.88 src/usr.sbin/installboot/installboot.8:1.89 --- src/usr.sbin/installboot/installboot.8:1.88 Sun Mar 22 09:45:50 2015 +++ src/usr.sbin/installboot/installboot.8 Sun Mar 22 22:35:08 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: installboot.8,v 1.88 2015/03/22 09:45:50 ast Exp $ +.\" $NetBSD: installboot.8,v 1.89 2015/03/22 22:35:08 wiz Exp $ .\" .\" Copyright (c) 2002-2015 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -816,25 +816,40 @@ appeared in .Nx 1.6 . . .Sh AUTHORS +.An -nosplit The machine independent portion of this implementation of .Nm -was written by Luke Mewburn. +was written by +.An Luke Mewburn . The following people contributed to the various machine dependent back-ends: -Simon Burge (pmax), -Chris Demetriou (alpha), -Matthew Fredette (sun2, sun3), -Matthew Green (sparc64), -Ross Harvey (alpha), -Michael Hitch (amiga), -Paul Kranenburg (sparc), -David Laight (i386), -Christian Limpach (next68k), -Luke Mewburn (macppc), -Matt Thomas (vax), -Izumi Tsutsui (news68k, newsmips), +.An Simon Burge +(pmax), +.An Chris Demetriou +(alpha), +.An Matthew Fredette +(sun2, sun3), +.An Matthew Green +(sparc64), +.An Ross Harvey +(alpha), +.An Michael Hitch +(amiga), +.An Paul Kranenburg +(sparc), +.An David Laight +(i386), +.An Christian Limpach +(next68k), +.An Luke Mewburn +(macppc), +.An Matt Thomas +(vax), +.An Izumi Tsutsui +(news68k, newsmips), and -UCHIYAMA Yasushi (ews4800mips). +.An UCHIYAMA Yasushi +(ews4800mips). . .Sh BUGS There are not currently primary bootstraps to support all file systems
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: mlelstv Date: Fri Jun 5 05:03:21 UTC 2015 Modified Files: src/usr.sbin/installboot: Makefile installboot.c Log Message: Support wedge names. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/usr.sbin/installboot/Makefile cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/installboot/installboot.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/installboot/Makefile diff -u src/usr.sbin/installboot/Makefile:1.48 src/usr.sbin/installboot/Makefile:1.49 --- src/usr.sbin/installboot/Makefile:1.48 Mon Feb 24 07:23:44 2014 +++ src/usr.sbin/installboot/Makefile Fri Jun 5 05:03:21 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.48 2014/02/24 07:23:44 skrll Exp $ +# $NetBSD: Makefile,v 1.49 2015/06/05 05:03:21 mlelstv Exp $ # .include @@ -7,7 +7,6 @@ PROG= installboot MAN= installboot.8 SRCS= installboot.c sum.c machines.c fstypes.c - ARCH_XLAT= amd64-i386.c news68k-news.c newsmips-news.c ARCH_XLAT+= sun2-sun68k.c sun3-sun68k.c @@ -49,4 +48,7 @@ COPTS.${f}.c+= -Wno-pointer-sign .endfor .endif +LDADD+= -lutil +DPADD+= ${LIBUTIL} + .include Index: src/usr.sbin/installboot/installboot.c diff -u src/usr.sbin/installboot/installboot.c:1.36 src/usr.sbin/installboot/installboot.c:1.37 --- src/usr.sbin/installboot/installboot.c:1.36 Thu Nov 3 20:46:41 2011 +++ src/usr.sbin/installboot/installboot.c Fri Jun 5 05:03:21 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: installboot.c,v 1.36 2011/11/03 20:46:41 martin Exp $ */ +/* $NetBSD: installboot.c,v 1.37 2015/06/05 05:03:21 mlelstv Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -35,9 +35,10 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: installboot.c,v 1.36 2011/11/03 20:46:41 martin Exp $"); +__RCSID("$NetBSD: installboot.c,v 1.37 2015/06/05 05:03:21 mlelstv Exp $"); #endif /* !__lint */ +#include #include #include @@ -50,6 +51,7 @@ __RCSID("$NetBSD: installboot.c,v 1.36 2 #include #include #include +#include #include "installboot.h" @@ -105,6 +107,9 @@ main(int argc, char *argv[]) char *p; const char *op; ib_flags unsupported_flags; + char specname[MAXPATHLEN]; + char rawname[MAXPATHLEN]; + const char *special, *raw; setprogname(argv[0]); params = &installboot_params; @@ -229,7 +234,12 @@ main(int argc, char *argv[]) params->stage2 = argv[2]; } - params->filesystem = argv[0]; + special = getfsspecname(specname, sizeof(specname), argv[0]); + raw = getdiskrawname(rawname, sizeof(rawname), special); + if (raw != NULL) + special = raw; + + params->filesystem = special; if (params->flags & IB_NOWRITE) { op = "only"; mode = O_RDONLY;
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: mlelstv Date: Fri Jun 5 07:44:39 UTC 2015 Modified Files: src/usr.sbin/installboot: installboot.c Log Message: Can't use getfsspecname (and thus wedge names) while building tools. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/installboot/installboot.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/installboot/installboot.c diff -u src/usr.sbin/installboot/installboot.c:1.37 src/usr.sbin/installboot/installboot.c:1.38 --- src/usr.sbin/installboot/installboot.c:1.37 Fri Jun 5 05:03:21 2015 +++ src/usr.sbin/installboot/installboot.c Fri Jun 5 07:44:39 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: installboot.c,v 1.37 2015/06/05 05:03:21 mlelstv Exp $ */ +/* $NetBSD: installboot.c,v 1.38 2015/06/05 07:44:39 mlelstv Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: installboot.c,v 1.37 2015/06/05 05:03:21 mlelstv Exp $"); +__RCSID("$NetBSD: installboot.c,v 1.38 2015/06/05 07:44:39 mlelstv Exp $"); #endif /* !__lint */ #include @@ -51,7 +51,9 @@ __RCSID("$NetBSD: installboot.c,v 1.37 2 #include #include #include +#if !HAVE_NBTOOL_CONFIG_H #include +#endif #include "installboot.h" @@ -107,9 +109,11 @@ main(int argc, char *argv[]) char *p; const char *op; ib_flags unsupported_flags; +#if !HAVE_NBTOOL_CONFIG_H char specname[MAXPATHLEN]; char rawname[MAXPATHLEN]; const char *special, *raw; +#endif setprogname(argv[0]); params = &installboot_params; @@ -234,12 +238,16 @@ main(int argc, char *argv[]) params->stage2 = argv[2]; } +#if !HAVE_NBTOOL_CONFIG_H special = getfsspecname(specname, sizeof(specname), argv[0]); raw = getdiskrawname(rawname, sizeof(rawname), special); if (raw != NULL) special = raw; - params->filesystem = special; +#else + params->filesystem = argv[0]; +#endif + if (params->flags & IB_NOWRITE) { op = "only"; mode = O_RDONLY;
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: joerg Date: Sat Jun 6 15:45:47 UTC 2015 Modified Files: src/usr.sbin/installboot: Makefile Log Message: Linking against libutil is not appropiate for tools. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/usr.sbin/installboot/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/installboot/Makefile diff -u src/usr.sbin/installboot/Makefile:1.49 src/usr.sbin/installboot/Makefile:1.50 --- src/usr.sbin/installboot/Makefile:1.49 Fri Jun 5 05:03:21 2015 +++ src/usr.sbin/installboot/Makefile Sat Jun 6 15:45:47 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.49 2015/06/05 05:03:21 mlelstv Exp $ +# $NetBSD: Makefile,v 1.50 2015/06/06 15:45:47 joerg Exp $ # .include @@ -46,9 +46,9 @@ CPPFLAGS+= -I${.CURDIR} -I. .for f in i386 macppc COPTS.${f}.c+= -Wno-pointer-sign .endfor -.endif LDADD+= -lutil DPADD+= ${LIBUTIL} +.endif .include
CVS commit: src/usr.sbin/installboot/arch
Module Name:src Committed By: christos Date: Mon Jul 17 18:43:45 UTC 2017 Modified Files: src/usr.sbin/installboot/arch: landisk.c Log Message: don't complain if the mbr was all 0's. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/installboot/arch/landisk.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/installboot/arch/landisk.c diff -u src/usr.sbin/installboot/arch/landisk.c:1.6 src/usr.sbin/installboot/arch/landisk.c:1.7 --- src/usr.sbin/installboot/arch/landisk.c:1.6 Sat Oct 19 13:08:15 2013 +++ src/usr.sbin/installboot/arch/landisk.c Mon Jul 17 14:43:45 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: landisk.c,v 1.6 2013/10/19 17:08:15 christos Exp $ */ +/* $NetBSD: landisk.c,v 1.7 2017/07/17 18:43:45 christos Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: landisk.c,v 1.6 2013/10/19 17:08:15 christos Exp $"); +__RCSID("$NetBSD: landisk.c,v 1.7 2017/07/17 18:43:45 christos Exp $"); #endif /* !__lint */ #include @@ -100,12 +100,18 @@ landisk_setboot(ib_params *params) goto done; } if (mbr.mbr_magic != le16toh(MBR_MAGIC)) { - if (params->flags & IB_VERBOSE) { - printf( - "Ignoring MBR with invalid magic in sector 0 of `%s'\n", - params->filesystem); + const char *p = (const char *)&mbr; + const char *e = p + sizeof(mbr); + while (p < e && !*p) + p++; + if (p != e) { + if (params->flags & IB_VERBOSE) { +printf( + "Ignoring MBR with invalid magic in sector 0 of `%s'\n", +params->filesystem); + } + memset(&mbr, 0, sizeof(mbr)); } - memset(&mbr, 0, sizeof(mbr)); } /*
CVS commit: src/usr.sbin/installboot/arch
Module Name:src Committed By: thorpej Date: Tue May 7 04:35:32 UTC 2019 Modified Files: src/usr.sbin/installboot/arch: alpha.c amiga.c emips.c ews4800mips.c hp300.c hppa.c i386.c landisk.c macppc.c news.c next68k.c pmax.c sparc.c sparc64.c sun68k.c vax.c x68k.c Log Message: Use designated initializers for struct ib_mach. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/installboot/arch/alpha.c \ src/usr.sbin/installboot/arch/sun68k.c cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/installboot/arch/amiga.c cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/installboot/arch/emips.c \ src/usr.sbin/installboot/arch/hppa.c cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/installboot/arch/ews4800mips.c cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/installboot/arch/hp300.c \ src/usr.sbin/installboot/arch/pmax.c cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/installboot/arch/i386.c cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/installboot/arch/landisk.c \ src/usr.sbin/installboot/arch/news.c cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/installboot/arch/macppc.c \ src/usr.sbin/installboot/arch/sparc.c cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/installboot/arch/next68k.c cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/installboot/arch/sparc64.c \ src/usr.sbin/installboot/arch/vax.c cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/installboot/arch/x68k.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/installboot/arch/alpha.c diff -u src/usr.sbin/installboot/arch/alpha.c:1.21 src/usr.sbin/installboot/arch/alpha.c:1.22 --- src/usr.sbin/installboot/arch/alpha.c:1.21 Sun Aug 14 17:50:17 2011 +++ src/usr.sbin/installboot/arch/alpha.c Tue May 7 04:35:31 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: alpha.c,v 1.21 2011/08/14 17:50:17 christos Exp $ */ +/* $NetBSD: alpha.c,v 1.22 2019/05/07 04:35:31 thorpej Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -95,7 +95,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: alpha.c,v 1.21 2011/08/14 17:50:17 christos Exp $"); +__RCSID("$NetBSD: alpha.c,v 1.22 2019/05/07 04:35:31 thorpej Exp $"); #endif /* !__lint */ #include @@ -121,9 +121,14 @@ static void check_sparc(const struct alp static int alpha_clearboot(ib_params *); static int alpha_setboot(ib_params *); -struct ib_mach ib_mach_alpha = - { "alpha", alpha_setboot, alpha_clearboot, no_editboot, - IB_STAGE1START | IB_ALPHASUM | IB_APPEND | IB_SUNSUM }; +struct ib_mach ib_mach_alpha = { + .name = "alpha", + .setboot = alpha_setboot, + .clearboot = alpha_clearboot, + .editboot = no_editboot, + .valid_flags = IB_STAGE1START | IB_ALPHASUM | IB_APPEND | +IB_SUNSUM, +}; static int alpha_clearboot(ib_params *params) Index: src/usr.sbin/installboot/arch/sun68k.c diff -u src/usr.sbin/installboot/arch/sun68k.c:1.21 src/usr.sbin/installboot/arch/sun68k.c:1.22 --- src/usr.sbin/installboot/arch/sun68k.c:1.21 Mon Apr 28 20:24:16 2008 +++ src/usr.sbin/installboot/arch/sun68k.c Tue May 7 04:35:31 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sun68k.c,v 1.21 2008/04/28 20:24:16 martin Exp $ */ +/* $NetBSD: sun68k.c,v 1.22 2019/05/07 04:35:31 thorpej Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: sun68k.c,v 1.21 2008/04/28 20:24:16 martin Exp $"); +__RCSID("$NetBSD: sun68k.c,v 1.22 2019/05/07 04:35:31 thorpej Exp $"); #endif /* !__lint */ #include @@ -49,13 +49,21 @@ __RCSID("$NetBSD: sun68k.c,v 1.21 2008/0 static int sun68k_clearboot(ib_params *); static int sun68k_setboot(ib_params *); -struct ib_mach ib_mach_sun2 = - { "sun2", sun68k_setboot, sun68k_clearboot, no_editboot, - IB_STAGE2START }; - -struct ib_mach ib_mach_sun3 = - { "sun3", sun68k_setboot, sun68k_clearboot, no_editboot, - IB_STAGE2START }; +struct ib_mach ib_mach_sun2 = { + .name = "sun2", + .setboot = sun68k_setboot, + .clearboot = sun68k_clearboot, + .editboot = no_editboot, + .valid_flags = IB_STAGE2START, +}; + +struct ib_mach ib_mach_sun3 = { + .name = "sun3", + .setboot = sun68k_setboot, + .clearboot = sun68k_clearboot, + .editboot = no_editboot, + .valid_flags = IB_STAGE2START, +}; static struct bbinfo_params bbparams = { SUN68K_BBINFO_MAGIC, Index: src/usr.sbin/installboot/arch/amiga.c diff -u src/usr.sbin/installboot/arch/amiga.c:1.9 src/usr.sbin/installboot/arch/amiga.c:1.10 --- src/usr.sbin/installboot/arch/amiga.c:1.9 Fri Jun 5 05:02:48 2015 +++ src/usr.sbin/installboot/arch/amiga.c Tue May 7 04:35:31 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: amiga.c,v 1.9 2015/06/05 05:02:48 mlelstv Exp $ */ +/* $NetBSD: amiga.c,v 1.10 2019/05/07 04:35:31 thorpej Exp $ */ /*- * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: amiga.c,v 1.9 2015/06/05 05:02:48 mlelstv Exp $"); +__RCSID("$NetBSD: amiga.c,v 1.10 2019/05/07 04:35:31 thorpej Exp $"); #en
CVS commit: src/usr.sbin/installboot/arch
Module Name:src Committed By: kamil Date: Sat Jun 23 14:15:57 UTC 2018 Modified Files: src/usr.sbin/installboot/arch: i386.c Log Message: Fix integer overflow in installboot(8) Add a sanity check of the disk_buf first three bytes. The original code on a disk with nul bytes was causing integer overflow and thus calling the memcmp(3) functin in is_zero() with enormous length. Verity that the 0th byte is JMP, 1th a signed byte >=9 to prevent overflow and 2th byte NOP. Add a comment explaining the check. Detected with MKSANITIZER and ASan. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/usr.sbin/installboot/arch/i386.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/installboot/arch/i386.c diff -u src/usr.sbin/installboot/arch/i386.c:1.40 src/usr.sbin/installboot/arch/i386.c:1.41 --- src/usr.sbin/installboot/arch/i386.c:1.40 Fri Jun 14 03:54:43 2013 +++ src/usr.sbin/installboot/arch/i386.c Sat Jun 23 14:15:57 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: i386.c,v 1.40 2013/06/14 03:54:43 msaitoh Exp $ */ +/* $NetBSD: i386.c,v 1.41 2018/06/23 14:15:57 kamil Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: i386.c,v 1.40 2013/06/14 03:54:43 msaitoh Exp $"); +__RCSID("$NetBSD: i386.c,v 1.41 2018/06/23 14:15:57 kamil Exp $"); #endif /* !__lint */ #include @@ -418,8 +418,19 @@ i386_setboot(ib_params *params) return 0; } - /* Find size of old BPB, and copy into new bootcode */ - if (!is_zero(disk_buf.b + 3 + 8, disk_buf.b[1] - 1 - 8)) { + /* + * Find size of old BPB, and copy into new bootcode + * + * The 2nd byte (b[1]) contains jmp short relative offset. + * If it is zero or some invalid input that is smaller than 9, + * it will cause overflow and call is_zero() with enormous size. + * Add a paranoid check to prevent this scenario. + * + * Verify that b[0] contains JMP (0xeb) and b[2] NOP (0x90). + */ + if (disk_buf.b[0] == 0xeb && disk_buf.b[1] >= 9 && + disk_buf.b[2] == 0x90 && + !is_zero(disk_buf.b + 3 + 8, disk_buf.b[1] - 1 - 8)) { struct mbr_bpbFAT16 *bpb = (void *)(disk_buf.b + 3 + 8); /* Check enough space before the FAT for the bootcode */ u = le16toh(bpb->bpbBytesPerSec)
CVS commit: src/usr.sbin/installboot/arch
Module Name:src Committed By: msaitoh Date: Fri Jun 14 03:54:43 UTC 2013 Modified Files: src/usr.sbin/installboot/arch: amiga.c hp300.c hp700.c i386.c next68k.c Log Message: Remove trailng whitespaces. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/installboot/arch/amiga.c \ src/usr.sbin/installboot/arch/next68k.c cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/installboot/arch/hp300.c cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/installboot/arch/hp700.c cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/installboot/arch/i386.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/installboot/arch/amiga.c diff -u src/usr.sbin/installboot/arch/amiga.c:1.7 src/usr.sbin/installboot/arch/amiga.c:1.8 --- src/usr.sbin/installboot/arch/amiga.c:1.7 Thu Jan 14 16:27:49 2010 +++ src/usr.sbin/installboot/arch/amiga.c Fri Jun 14 03:54:43 2013 @@ -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 #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 @@ -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]; Index: src/usr.sbin/installboot/arch/next68k.c diff -u src/usr.sbin/installboot/arch/next68k.c:1.7 src/usr.sbin/installboot/arch/next68k.c:1.8 --- src/usr.sbin/installboot/arch/next68k.c:1.7 Thu Jan 7 13:26:00 2010 +++ src/usr.sbin/installboot/arch/next68k.c Fri Jun 14 03:54:43 2013 @@ -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 #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 @@ -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; } Index: src/usr.sbin/installboot/arch/hp300.c diff -u src/usr.sbin/installboot/arch/hp300.c:1.14 src/usr.sbin/installboot/arch/hp300.c:1.15 --- src/usr.sbin/installboot/arch/hp300.c:1.14 Fri May 3 21:32:04 2013 +++ src/usr.sbin/installboot/arch/hp300.c Fri Jun 14 03:54:43 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: hp300.c,v 1.14 2013/05/03 21:32:04 matt Exp $ */ +/* $NetBSD: hp300.c,v 1.15 2013/06/14 03:54:43 msaitoh Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: hp300.c,v 1.14 2013/05/03 21:32:04 matt 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. */ @@ -43,7 +43,7 @@ __RCSID("$NetBSD: hp300.c,v 1.14 2013/05 #include "nbtool_config.h" #include #include -#else +#else #include #endif #include Index: src/usr.sbin/installboot/arch/hp700.c diff -u src/usr.sbin/installboot/arch/hp700.c:1.5 src/usr.sbin/installboot/arch/hp700.c:1.6 --- src/usr.sbin/installboot/arch/hp700.c:1.5 Mon Jan 9 11:44:53 2012 +++ src/usr.sbin/installboot/arch/hp700.c Fri Jun 14 03:54:43 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: hp700.c,v 1.5 2012/01/09 11:44:53 skrll 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 #if !defined(__lint) -__RCSID("$NetBSD: hp700.c,v 1.5 2012/01/09 11:44:53 skrll Exp $"); +__RCSID("$NetBSD: hp700.c,v 1.6 2013/06/14 03:54:43 msaitoh Exp $"); #endif /* !_
CVS commit: src/usr.sbin/installboot/arch
Module Name:src Committed By: martin Date: Sun Jun 16 19:05:00 UTC 2013 Modified Files: src/usr.sbin/installboot/arch: vax.c Log Message: In the tool build is enough. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/installboot/arch/vax.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/installboot/arch/vax.c diff -u src/usr.sbin/installboot/arch/vax.c:1.16 src/usr.sbin/installboot/arch/vax.c:1.17 --- src/usr.sbin/installboot/arch/vax.c:1.16 Fri May 3 21:32:04 2013 +++ src/usr.sbin/installboot/arch/vax.c Sun Jun 16 19:05:00 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: vax.c,v 1.16 2013/05/03 21:32:04 matt Exp $ */ +/* $NetBSD: vax.c,v 1.17 2013/06/16 19:05:00 martin Exp $ */ /*- * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc. @@ -68,13 +68,12 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: vax.c,v 1.16 2013/05/03 21:32:04 matt Exp $"); +__RCSID("$NetBSD: vax.c,v 1.17 2013/06/16 19:05:00 martin Exp $"); #endif /* !__lint */ #include #ifdef HAVE_NBTOOL_CONFIG_H #include -#include #else #include #endif
CVS commit: src/usr.sbin/installboot/arch
Module Name:src Committed By: gson Date: Fri Apr 6 10:10:11 UTC 2012 Modified Files: src/usr.sbin/installboot/arch: i386.c Log Message: When printing the list of valid console names, don't treat the consoles[] array as NULL terminated, because it's not. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/installboot/arch/i386.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/installboot/arch/i386.c diff -u src/usr.sbin/installboot/arch/i386.c:1.38 src/usr.sbin/installboot/arch/i386.c:1.39 --- src/usr.sbin/installboot/arch/i386.c:1.38 Sat Mar 10 18:42:18 2012 +++ src/usr.sbin/installboot/arch/i386.c Fri Apr 6 10:10:11 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: i386.c,v 1.38 2012/03/10 18:42:18 dsl Exp $ */ +/* $NetBSD: i386.c,v 1.39 2012/04/06 10:10:11 gson Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: i386.c,v 1.38 2012/03/10 18:42:18 dsl Exp $"); +__RCSID("$NetBSD: i386.c,v 1.39 2012/04/06 10:10:11 gson Exp $"); #endif /* !__lint */ #include @@ -251,7 +251,7 @@ update_i386_boot_params(ib_params *param 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;
CVS commit: src/usr.sbin/installboot/arch
Module Name:src Committed By: skrll Date: Mon Jan 9 11:44:54 UTC 2012 Modified Files: src/usr.sbin/installboot/arch: hp700.c Log Message: Make it an error for the partition to exceed the PDC limit. Inspired by PR/45742 To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/installboot/arch/hp700.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/installboot/arch/hp700.c diff -u src/usr.sbin/installboot/arch/hp700.c:1.4 src/usr.sbin/installboot/arch/hp700.c:1.5 --- src/usr.sbin/installboot/arch/hp700.c:1.4 Mon Apr 28 20:24:16 2008 +++ src/usr.sbin/installboot/arch/hp700.c Mon Jan 9 11:44:53 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: hp700.c,v 1.4 2008/04/28 20:24:16 martin Exp $ */ +/* $NetBSD: hp700.c,v 1.5 2012/01/09 11:44:53 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: hp700.c,v 1.4 2008/04/28 20:24:16 martin Exp $"); +__RCSID("$NetBSD: hp700.c,v 1.5 2012/01/09 11:44:53 skrll Exp $"); #endif /* !__lint */ /* We need the target disklabel.h, not the hosts one. */ @@ -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 */
CVS commit: src/usr.sbin/installboot/arch
Module Name:src Committed By: christos Date: Sat Oct 19 17:08:15 UTC 2013 Modified Files: src/usr.sbin/installboot/arch: landisk.c Log Message: move all the unused code inside #if 0 To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/installboot/arch/landisk.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/installboot/arch/landisk.c diff -u src/usr.sbin/installboot/arch/landisk.c:1.5 src/usr.sbin/installboot/arch/landisk.c:1.6 --- src/usr.sbin/installboot/arch/landisk.c:1.5 Thu May 7 03:03:39 2009 +++ src/usr.sbin/installboot/arch/landisk.c Sat Oct 19 13:08:15 2013 @@ -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 #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 @@ -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
CVS commit: src/usr.sbin/installboot/arch
Module Name:src Committed By: christos Date: Mon Oct 21 15:37:46 UTC 2013 Modified Files: src/usr.sbin/installboot/arch: pmax.c Log Message: XXX: gcc initialize a variable To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/installboot/arch/pmax.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/installboot/arch/pmax.c diff -u src/usr.sbin/installboot/arch/pmax.c:1.14 src/usr.sbin/installboot/arch/pmax.c:1.15 --- src/usr.sbin/installboot/arch/pmax.c:1.14 Sun Apr 5 07:55:39 2009 +++ src/usr.sbin/installboot/arch/pmax.c Mon Oct 21 11:37:46 2013 @@ -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 #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 @@ -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;
CVS commit: src/usr.sbin/installboot/arch
Module Name:src Committed By: tsutsui Date: Mon Oct 26 14:26:25 UTC 2009 Modified Files: src/usr.sbin/installboot/arch: alpha.c Log Message: A checksum value in alpha boot block is stored in little endian, so use le64toh() to print it on the host tool. While here, use consistent (unsignd long long) casts on printing it. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/installboot/arch/alpha.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/installboot/arch/alpha.c diff -u src/usr.sbin/installboot/arch/alpha.c:1.19 src/usr.sbin/installboot/arch/alpha.c:1.20 --- src/usr.sbin/installboot/arch/alpha.c:1.19 Sun Apr 5 11:55:39 2009 +++ src/usr.sbin/installboot/arch/alpha.c Mon Oct 26 14:26:25 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: alpha.c,v 1.19 2009/04/05 11:55:39 lukem Exp $ */ +/* $NetBSD: alpha.c,v 1.20 2009/10/26 14:26:25 tsutsui Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -95,7 +95,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: alpha.c,v 1.19 2009/04/05 11:55:39 lukem Exp $"); +__RCSID("$NetBSD: alpha.c,v 1.20 2009/10/26 14:26:25 tsutsui Exp $"); #endif /* !__lint */ #include @@ -154,8 +154,8 @@ if (cksum != bb.bb_cksum) { // XXX check bb_cksum endian? warnx( "Old boot block checksum invalid (was %#llx, calculated %#llx)", - (unsigned long long)bb.bb_cksum, - (unsigned long long)cksum); + (unsigned long long)le64toh(bb.bb_cksum), + (unsigned long long)le64toh(cksum)); warnx("Boot block invalid"); return (0); } @@ -166,7 +166,7 @@ printf("Old bootstrap size: %llu\n", (unsigned long long)le64toh(bb.bb_secsize)); printf("Old bootstrap checksum: %#llx\n", - (unsigned long long)bb.bb_cksum); + (unsigned long long)le64toh(bb.bb_cksum)); } bb.bb_secstart = bb.bb_secsize = bb.bb_flags = 0; @@ -180,7 +180,7 @@ printf("New bootstrap size: %llu\n", (unsigned long long)le64toh(bb.bb_secsize)); printf("New bootstrap checksum: %#llx\n", - (unsigned long long)bb.bb_cksum); + (unsigned long long)le64toh(bb.bb_cksum)); if (params->flags & IB_VERBOSE) printf("%slearing boot block\n", @@ -296,7 +296,7 @@ printf("Bootstrap sector count: %llu\n", (unsigned long long)le64toh(bb.bb_secsize)); printf("New boot block checksum: %#llx\n", - (unsigned long long)bb.bb_cksum); + (unsigned long long)le64toh(bb.bb_cksum)); printf("%sriting bootstrap\n", (params->flags & IB_NOWRITE) ? "Not w" : "W"); } @@ -368,7 +368,8 @@ if (bb16 != NULL) memcpy(bb16, bb, sizeof(*bb)); if ((params->flags & IB_VERBOSE) && lastsum != bb->bb_cksum) - printf("alpha checksum now %016llx\n", (long long)bb->bb_cksum); + printf("alpha checksum now %016llx\n", + (unsigned long long)le64toh(bb->bb_cksum)); lastsum = bb->bb_cksum; } @@ -431,7 +432,7 @@ resum(params, bb, bb16); if (params->flags & IB_VERBOSE) printf("final harmonized checksum: %016llx\n", - (long long)bb->bb_cksum); + (unsigned long long)le64toh(bb->bb_cksum)); check_sparc(bb, "Final"); }
CVS commit: src/usr.sbin/installboot/arch
Module Name:src Committed By: lukem Date: Thu May 7 07:03:40 UTC 2009 Modified Files: src/usr.sbin/installboot/arch: i386.c landisk.c Log Message: refer to FFSv1 instead of UFSv1 To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/installboot/arch/i386.c cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/installboot/arch/landisk.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/installboot/arch/i386.c diff -u src/usr.sbin/installboot/arch/i386.c:1.32 src/usr.sbin/installboot/arch/i386.c:1.33 --- src/usr.sbin/installboot/arch/i386.c:1.32 Sun Apr 5 11:55:39 2009 +++ src/usr.sbin/installboot/arch/i386.c Thu May 7 07:03:39 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: i386.c,v 1.32 2009/04/05 11:55:39 lukem Exp $ */ +/* $NetBSD: i386.c,v 1.33 2009/05/07 07:03:39 lukem Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: i386.c,v 1.32 2009/04/05 11:55:39 lukem Exp $"); +__RCSID("$NetBSD: i386.c,v 1.33 2009/05/07 07:03:39 lukem Exp $"); #endif /* !__lint */ #include @@ -303,7 +303,7 @@ assert(params->stage1 != NULL); /* - * There is only 8k of space in a UFSv1 partition (and ustarfs) + * There is only 8k of space in a FFSv1 partition (and ustarfs) * so ensure we don't splat over anything important. */ if (params->s1stat.st_size > (off_t)(sizeof bootstrap)) { Index: src/usr.sbin/installboot/arch/landisk.c diff -u src/usr.sbin/installboot/arch/landisk.c:1.4 src/usr.sbin/installboot/arch/landisk.c:1.5 --- src/usr.sbin/installboot/arch/landisk.c:1.4 Sun Apr 5 11:55:39 2009 +++ src/usr.sbin/installboot/arch/landisk.c Thu May 7 07:03:39 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: landisk.c,v 1.4 2009/04/05 11:55:39 lukem Exp $ */ +/* $NetBSD: landisk.c,v 1.5 2009/05/07 07:03:39 lukem Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: landisk.c,v 1.4 2009/04/05 11:55:39 lukem Exp $"); +__RCSID("$NetBSD: landisk.c,v 1.5 2009/05/07 07:03:39 lukem Exp $"); #endif /* !__lint */ #include @@ -80,7 +80,7 @@ bootstrapbuf = NULL; /* - * There is only 8k of space in a UFSv1 partition (and ustarfs) + * There is only 8k of space in a FFSv1 partition (and ustarfs) * so ensure we don't splat over anything important. */ if (params->s1stat.st_size > 8192) {
CVS commit: src/usr.sbin/installboot/arch
Module Name:src Committed By: tsutsui Date: Thu Feb 10 23:25:11 UTC 2011 Modified Files: src/usr.sbin/installboot/arch: hp300.c Log Message: Fix botch in previous revision. Sorry for a stupid change. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/installboot/arch/hp300.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/installboot/arch/hp300.c diff -u src/usr.sbin/installboot/arch/hp300.c:1.12 src/usr.sbin/installboot/arch/hp300.c:1.13 --- src/usr.sbin/installboot/arch/hp300.c:1.12 Thu Jan 7 13:26:00 2010 +++ src/usr.sbin/installboot/arch/hp300.c Thu Feb 10 23:25:11 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: hp300.c,v 1.12 2010/01/07 13:26:00 tsutsui Exp $ */ +/* $NetBSD: hp300.c,v 1.13 2011/02/10 23:25:11 tsutsui Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: hp300.c,v 1.12 2010/01/07 13:26:00 tsutsui Exp $"); +__RCSID("$NetBSD: hp300.c,v 1.13 2011/02/10 23:25:11 tsutsui Exp $"); #endif /* !__lint */ /* We need the target disklabel.h, not the hosts one. */ @@ -108,7 +108,8 @@ * The bootstrap can be well over 8k, and must go into a BOOT * partition. Read NetBSD label to locate BOOT partition. */ - if (pread(params->fsfd, label, params->sectorsize, LABELSECTOR) + if (pread(params->fsfd, label, params->sectorsize, + LABELSECTOR * params->sectorsize) != (ssize_t)params->sectorsize) { warn("reading disklabel"); goto done;
CVS commit: src/usr.sbin/installboot/arch
Module Name:src Committed By: christos Date: Thu Nov 13 16:02:25 UTC 2014 Modified Files: src/usr.sbin/installboot/arch: vax.c Log Message: Use VAX_LABELOFFSET here; It needs to be the machine-specific one. Thanks to gcc-4.8 for discovering the bug and to Atari for having a LABELOFFSET of 516 > 512 :-) XXX: Perhaps we should put all those constants in instead of spreading them around. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/installboot/arch/vax.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/installboot/arch/vax.c diff -u src/usr.sbin/installboot/arch/vax.c:1.17 src/usr.sbin/installboot/arch/vax.c:1.18 --- src/usr.sbin/installboot/arch/vax.c:1.17 Sun Jun 16 15:05:00 2013 +++ src/usr.sbin/installboot/arch/vax.c Thu Nov 13 11:02:25 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: vax.c,v 1.17 2013/06/16 19:05:00 martin Exp $ */ +/* $NetBSD: vax.c,v 1.18 2014/11/13 16:02:25 christos Exp $ */ /*- * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: vax.c,v 1.17 2013/06/16 19:05:00 martin Exp $"); +__RCSID("$NetBSD: vax.c,v 1.18 2014/11/13 16:02:25 christos Exp $"); #endif /* !__lint */ #include @@ -88,6 +88,8 @@ __RCSID("$NetBSD: vax.c,v 1.17 2013/06/1 #include "installboot.h" +#define VAX_LABELOFFSET 64 + #ifndef __CTASSERT #define __CTASSERT(X) #endif @@ -210,12 +212,12 @@ vax_setboot(ib_params *params) /* * Copy disklabel from old boot block to new. - * Assume everything between LABELOFFSET and the start of + * Assume everything between VAX_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); + memcpy(bootstrapbuf + VAX_LABELOFFSET, + oldbb + VAX_LABELOFFSET, + offsetof(struct vax_boot_block,bb_magic1) - VAX_LABELOFFSET); /* point to bootblock at begining of bootstrap */ bb = (struct vax_boot_block*)bootstrapbuf;
CVS commit: src/usr.sbin/installboot/arch
Module Name:src Committed By: mlelstv Date: Fri Jun 5 05:02:48 UTC 2015 Modified Files: src/usr.sbin/installboot/arch: amiga.c Log Message: Compute bootloader checksum correctly also on little endian systems. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/installboot/arch/amiga.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/installboot/arch/amiga.c diff -u src/usr.sbin/installboot/arch/amiga.c:1.8 src/usr.sbin/installboot/arch/amiga.c:1.9 --- src/usr.sbin/installboot/arch/amiga.c:1.8 Fri Jun 14 03:54:43 2013 +++ src/usr.sbin/installboot/arch/amiga.c Fri Jun 5 05:02:48 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: amiga.c,v 1.8 2013/06/14 03:54:43 msaitoh Exp $ */ +/* $NetBSD: amiga.c,v 1.9 2015/06/05 05:02:48 mlelstv Exp $ */ /*- * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: amiga.c,v 1.8 2013/06/14 03:54:43 msaitoh Exp $"); +__RCSID("$NetBSD: amiga.c,v 1.9 2015/06/05 05:02:48 mlelstv Exp $"); #endif /* !__lint */ #include @@ -126,8 +126,8 @@ amiga_setboot(ib_params *params) } (void)strncpy(dline, params->command, CMDLN_LEN-1); - block[1] = 0; - block[1] = 0x - chksum(block, sumlen); + block[1] = htobe32(0); + block[1] = htobe32(0x - chksum(block, sumlen)); } if (params->flags & IB_NOWRITE) { @@ -164,7 +164,7 @@ chksum(block, size) for (i=0; i
CVS commit: src/usr.sbin/installboot/arch
Module Name:src Committed By: martin Date: Thu Apr 4 12:55:31 UTC 2013 Modified Files: src/usr.sbin/installboot/arch: vax.c Log Message: Fix installboot for VAX, as discussed on port-vax. Problem pointed out by Jonny Billquist, thanks to Marl Pizzolato for patiently explaining the various ways of booting a vax to me. Now VAX 780 can boot directly from VMB.EXE again. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/installboot/arch/vax.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/installboot/arch/vax.c diff -u src/usr.sbin/installboot/arch/vax.c:1.13 src/usr.sbin/installboot/arch/vax.c:1.14 --- src/usr.sbin/installboot/arch/vax.c:1.13 Sun Apr 5 11:55:39 2009 +++ src/usr.sbin/installboot/arch/vax.c Thu Apr 4 12:55:30 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: vax.c,v 1.13 2009/04/05 11:55:39 lukem Exp $ */ +/* $NetBSD: vax.c,v 1.14 2013/04/04 12:55:30 martin Exp $ */ /*- * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc. @@ -68,16 +68,18 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: vax.c,v 1.13 2009/04/05 11:55:39 lukem Exp $"); +__RCSID("$NetBSD: vax.c,v 1.14 2013/04/04 12:55:30 martin Exp $"); #endif /* !__lint */ #include +#include #include #include #include #include #include +#include #include #include "installboot.h" @@ -101,7 +103,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 +114,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 +156,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 +169,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 +190,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 +228,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_BOO
CVS commit: src/usr.sbin/installboot/arch
Module Name:src Committed By: martin Date: Thu Apr 4 16:11:13 UTC 2013 Modified Files: src/usr.sbin/installboot/arch: vax.c Log Message: Provide an empty __CTASSERT() for toolbuilds To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/installboot/arch/vax.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/installboot/arch/vax.c diff -u src/usr.sbin/installboot/arch/vax.c:1.14 src/usr.sbin/installboot/arch/vax.c:1.15 --- src/usr.sbin/installboot/arch/vax.c:1.14 Thu Apr 4 12:55:30 2013 +++ src/usr.sbin/installboot/arch/vax.c Thu Apr 4 16:11:12 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: vax.c,v 1.14 2013/04/04 12:55:30 martin Exp $ */ +/* $NetBSD: vax.c,v 1.15 2013/04/04 16:11:12 martin Exp $ */ /*- * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: vax.c,v 1.14 2013/04/04 12:55:30 martin Exp $"); +__RCSID("$NetBSD: vax.c,v 1.15 2013/04/04 16:11:12 martin Exp $"); #endif /* !__lint */ #include @@ -84,6 +84,10 @@ __RCSID("$NetBSD: vax.c,v 1.14 2013/04/0 #include "installboot.h" +#ifndef __CTASSERT +#define __CTASSERT(X) +#endif + static int load_bootstrap(ib_params *, char **, uint32_t *, uint32_t *, size_t *);
CVS commit: src/usr.sbin/installboot/arch
Module Name:src Committed By: matt Date: Fri May 3 21:32:05 UTC 2013 Modified Files: src/usr.sbin/installboot/arch: hp300.c vax.c Log Message: Make this build with the disk label change. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/installboot/arch/hp300.c cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/installboot/arch/vax.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/installboot/arch/hp300.c diff -u src/usr.sbin/installboot/arch/hp300.c:1.13 src/usr.sbin/installboot/arch/hp300.c:1.14 --- src/usr.sbin/installboot/arch/hp300.c:1.13 Thu Feb 10 23:25:11 2011 +++ src/usr.sbin/installboot/arch/hp300.c Fri May 3 21:32:04 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: hp300.c,v 1.13 2011/02/10 23:25:11 tsutsui Exp $ */ +/* $NetBSD: hp300.c,v 1.14 2013/05/03 21:32:04 matt Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -35,12 +35,13 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: hp300.c,v 1.13 2011/02/10 23:25:11 tsutsui Exp $"); +__RCSID("$NetBSD: hp300.c,v 1.14 2013/05/03 21:32:04 matt Exp $"); #endif /* !__lint */ /* We need the target disklabel.h, not the hosts one. */ #ifdef HAVE_NBTOOL_CONFIG_H #include "nbtool_config.h" +#include #include #else #include Index: src/usr.sbin/installboot/arch/vax.c diff -u src/usr.sbin/installboot/arch/vax.c:1.15 src/usr.sbin/installboot/arch/vax.c:1.16 --- src/usr.sbin/installboot/arch/vax.c:1.15 Thu Apr 4 16:11:12 2013 +++ src/usr.sbin/installboot/arch/vax.c Fri May 3 21:32:04 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: vax.c,v 1.15 2013/04/04 16:11:12 martin Exp $ */ +/* $NetBSD: vax.c,v 1.16 2013/05/03 21:32:04 matt Exp $ */ /*- * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc. @@ -68,11 +68,16 @@ #include #if !defined(__lint) -__RCSID("$NetBSD: vax.c,v 1.15 2013/04/04 16:11:12 martin Exp $"); +__RCSID("$NetBSD: vax.c,v 1.16 2013/05/03 21:32:04 matt Exp $"); #endif /* !__lint */ #include +#ifdef HAVE_NBTOOL_CONFIG_H +#include +#include +#else #include +#endif #include #include