NetBSD/tools/compat
lukem 1c33b4e6a4 Overhaul MBR handling (part 1):
<sys/bootblock.h>:
    *	Added definitions for the Master Boot Record (MBR) used by
	a variety of systems (primarily i386), including the format
	of the BIOS Parameter Block (BPB).
	This information was cribbed from a variety of sources
	including <sys/disklabel_mbr.h> which this is a superset of.

	As part of this, some data structure elements and #defines
	were renamed to be more "namespace friendly" and consistent
	with other bootblocks and MBR documentation.
	Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
    *	Deprecated in favor of <sys/bootblock.h> (the latter is more
	"host tool" friendly).

amd64 & i386:
    *	Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
	be consistent with the naming convention of the msdosfs tools.

    *	Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
	and it's confusing to have two functionally equivalent bootblocks,
	especially given that "ufs" has multiple meanings (it could be
	a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

    *	Rework pbr.S (the first sector of bootxx_*):
	    +	Ensure that BPB (bytes 11..89) and the partition table
		(bytes 446..509) do not contain code.
	    +	Add support for booting from FAT partitions if BOOT_FROM_FAT
		is defined.  (Only set for bootxx_msdos).
	    +	Remove "dummy" partition 3; if people want to installboot(8)
		these to the start of the disk they can use fdisk(8) to
		create a real MBR partition table...
	    +	Compile with TERSE_ERROR so it fits because of the above.
		Whilst this is less user friendly, I feel it's important
		to have a valid partition table and BPB in the MBR/PBR.

    *	Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
	with other platforms.

    *	Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
    	we can boot off FAT partitions.

    *	Crank version of /usr/mdec/boot to 3.1, and fix some of the other
	entries in the version file.

installboot(8) (i386):
    *	Read the existing MBR of the filesystem and retain the BIOS
    	Parameter Block (BPB) in bytes 11..89 and the MBR partition
	table in bytes 446..509.  (Previously installboot(8) would
	trash those two sections of the MBR.)

mbrlabel(8):
    *	Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
	to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).
2003-10-08 04:25:43 +00:00
..
sys Overhaul MBR handling (part 1): 2003-10-08 04:25:43 +00:00
ufs use reachover relative paths in compat include files instead of 2003-05-14 00:30:26 +00:00
Makefile Rework how dependency generation is performed: 2003-08-01 17:03:41 +00:00
README It's "HP-UX" not "HP/UX". (Thanks Giles). 2002-09-29 07:05:28 +00:00
compat_defs.h If SIZE_MAX is not defined, but SIZE_T_MAX is defined (e.g. FreeBSD), 2003-08-27 18:33:26 +00:00
compat_pwd.h work around FreeBSD defining user_from_uid() in stdlib.h 2002-07-03 17:17:04 +00:00
config.h.in More properly host-tool-ify stat 2003-07-25 03:21:15 +00:00
configure netbsd.org->NetBSD.org 2003-07-26 20:17:31 +00:00
configure.ac netbsd.org->NetBSD.org 2003-07-26 20:17:31 +00:00
db.h Make almost all tools compile and run properly on non-NetBSD hosts. (In 2002-01-29 10:20:28 +00:00
defs.mk.in Add a new feature-test macro, _NETBSD_SOURCE. If this is defined 2003-04-28 23:16:11 +00:00
fgetln.c netbsd.org->NetBSD.org 2003-07-26 20:17:31 +00:00
flock.c fix minor typo -> s/lokcing/locking/ 2002-06-07 21:13:55 +00:00
fts.h Always use NetBSD's fts(3) in compat builds. Some systems (notably 2002-09-16 04:10:36 +00:00
getmode.c Include config.h unconditionally; clean up. 2002-01-31 19:23:14 +00:00
glob.h * Always include the NetBSD glob(3) in libnbcompat, as the host 2002-09-13 19:07:01 +00:00
issetugid.c Add a stub issetugid() for platforms that don't have it. For now, we assume 2002-04-18 15:31:51 +00:00
lchflags.c if target is not a symlink, silently succeed rather than failing with 2003-03-19 09:26:38 +00:00
lchmod.c if target is not a symlink, silently succeed rather than failing with 2003-03-19 09:26:38 +00:00
lchown.c if target is not a symlink, silently succeed rather than failing with 2003-03-19 09:26:38 +00:00
md2.h * Always include the NetBSD glob(3) in libnbcompat, as the host 2002-09-13 19:07:01 +00:00
md4.h Adjust pathnames to {md{4,5},sha1}.h after their removal from 2003-10-01 11:59:06 +00:00
md5.h Adjust pathnames to {md{4,5},sha1}.h after their removal from 2003-10-01 11:59:06 +00:00
mpool.h Make many host tools compile on non-NetBSD hosts. Not complete, but 2002-01-21 20:04:36 +00:00
namespace.h Make sure there are no weak references in libnbcompat (avoids linker 2002-01-31 19:20:14 +00:00
nl_types.h Make almost all tools compile and run properly on non-NetBSD hosts. (In 2002-01-29 10:20:28 +00:00
pread.c Include config.h unconditionally; clean up. 2002-01-31 19:23:14 +00:00
putc_unlocked.c FreeBSD #defines putc_unlocked in stdio.h, so guard against that also 2003-03-21 14:40:26 +00:00
pwrite.c Include config.h unconditionally; clean up. 2002-01-31 19:23:14 +00:00
rmd160.h * Always include the NetBSD glob(3) in libnbcompat, as the host 2002-09-13 19:07:01 +00:00
setenv.c Include config.h unconditionally; clean up. 2002-01-31 19:23:14 +00:00
setgroupent.c Add some more bits of host compatibility. 2002-02-26 22:29:38 +00:00
setpassent.c Add some more bits of host compatibility. 2002-02-26 22:29:38 +00:00
setprogname.c Provide a default string so host tools that forget to call setprogname() 2002-01-31 19:21:58 +00:00
sha1.h Adjust pathnames to {md{4,5},sha1}.h after their removal from 2003-10-01 11:59:06 +00:00
snprintf.c Include config.h unconditionally; clean up. 2002-01-31 19:23:14 +00:00
tzfile.h Roll in fixes to permit cross-compiling from non-NetBSD hosts. This 2002-01-31 22:43:33 +00:00
vis.h * Always include the NetBSD glob(3) in libnbcompat, as the host 2002-09-13 19:07:01 +00:00

README

$NetBSD: README,v 1.8 2002/09/29 07:05:28 lukem Exp $

Special notes for cross-hosting a NetBSD build on certain platforms.  
Only those platforms which have been tested to complete a "build.sh" run
are listed.

=====

HP-UX:

* zlib must be available.
  This will be fixed in the future to include zlib in libnbcompat.

=====

LINUX:

* Tested on RedHat Linux 7.1 (i386).
  Tested on RedHat Linux 7.3 (i686) on 16 Sep 2002.  Requires "LANG=C"
  in the environment.

* The gcc (and libstdc++, if needed) package must be installed, along
  with the typical system development packages (glibc-devel, etc.).

* The ncurses-devel package must be installed (for nbinfo).

* The zlib and zlib-devel packages must be installed.  This will be
  fixed in the future to include zlib in libnbcompat.

=====

NETBSD (earlier releases):

* Tested on NetBSD 1.5.2 (machine-independently).

* Should need no special setup.

=====

SOLARIS:

* Tested on Solaris/x86 8 (5.8) with gcc 2.95.2 and Solaris/sparc 8 (5.8)
  with gcc 3.2 (not yet tested with SUNWspro).

* $HOST_CC needs to be set properly (for gcc, it should be set to "gcc",
  otherwise the improper /usr/ucb/cc may be invoked by accident).

* The SUNWzlib package (or a built version of zlib visible to $HOST_CC,
  such as SMCzlib from sunfreeware.com) must be installed.  This will be
  fixed in the future to include zlib in libnbcompat.

* Needs the following paths, in this order, in $PATH:

      /usr/xpg4/bin
      /usr/ccs/bin
      <path to host C and C++ compilers>
      /usr/bin

  /usr/ucb may optionally be placed before /usr/bin, per your preference,
  but /usr/ucb *MUST NOT* be before /usr/ccs/bin or before the path to
  the host C and C++ compilers.