Commit Graph

128 Commits

Author SHA1 Message Date
lukem ba51c8dc18 alpha also supports append & sunsum 2002-10-03 07:27:50 +00:00
lukem 454998fc21 correct comment 2002-10-03 05:31:25 +00:00
grant eda9e509bb sweep of errx/warnx, remove unnecessary trailing \n 2002-07-20 08:40:16 +00:00
wiz 059d2bb6c4 Mdoc nit. 2002-06-30 12:49:29 +00:00
lukem a88aa33faf - be consistent with formatting, and use FSTYPE instead of <fs>
- remove sparc and sun[23] BUGS that aren't relevant in this version
2002-06-30 08:10:40 +00:00
grant 724345d941 update to reflect current state of reality for alpha, pmax, sparc,
sparc64, sun2, sun3 and vax.
clean up examples.
include bugs/caveats from the (now removed) arch installboot man pages.
2002-06-30 04:39:05 +00:00
isaki 53175db820 Add x68k stuff. 2002-06-02 10:44:30 +00:00
matt 5d837662a3 Use to htobe16, not htons 2002-05-31 05:54:36 +00:00
tsutsui 8157a94d99 Define and use both HOSTTOTARGET32() and TARGET32TOHOST() properly.
(just for consistency)
2002-05-21 16:49:19 +00:00
tsutsui 6734af58f9 NEWS_BOOT_BLOCK_OFFSET is now changed to 0, so use NEWS_BOOT_BLOCK_BLOCKSIZE
to allocate buffer to read LABELSECTOR.
2002-05-21 14:59:38 +00:00
lukem 6a574a38b0 I made a mistake when converting Izumi Tsutsui's back-end to the shared
bbinfo.c module;  news* boot blocks occupy all of the first 16 sectors,
with a jump instruction to skip the label at bytes 64..511.
Replace news_clearboot() and news_setboot() callbacks with common
news_copydisklable() callback, and set bbinfo_params->offset to
NEWS_BOOT_BLOCK_OFFSET (which is now 0), and ->headeroffset to 0.

(Thanks to Izumi for picking this up; the perils of working on code at 2am)
2002-05-21 00:38:08 +00:00
wiz f02ecb7d7a No .Pp before section headers, and use .Nx instead of NetBSD in one place. 2002-05-20 20:24:49 +00:00
lukem d22f5cff9c - use uint8_t instead of char for boot block blobs
- bbinfo_params:
	- replace "int littleendian" with "bbinfo_endian endian"
	- add comments
- shared_bbinfo_clearboot():
	- add callback method to shared_bbinfo_clearboot()
	- don't clear from 0..headeroffset; use a callback to do that
- add news68k and newsmips support.
  From Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>, with a rework by me to
  take advantage of the new shared_bbinfo_clearboot() callback.
  (XXX: untested yet)
2002-05-20 16:05:26 +00:00
lukem ba66837514 more cosmetic tweaks 2002-05-20 15:04:25 +00:00
lukem a59ed8d893 cosmetic tweaks 2002-05-20 14:56:10 +00:00
lukem 2a775954a9 - clean up display of supported machines & fstypes to ensure that last
column gets a trailing "," if there's more entries to come.
- if getmachines() or getfstypes() is called with 3 NULL params, just
  print the list of supported items.
- in usage(), call getmachines() and getfstypes() with 3 NULL params.
  (i got sick of typing "installboot -m asdf" to get a list of
  supported machines during testing :)
2002-05-20 14:38:38 +00:00
lukem b4c170fd08 Enable sun3, using same sun68k backend as sun2.
XXX: sun3 port still needs to be cut over to using sun68k bootxx...
2002-05-17 17:42:36 +00:00
lukem 86dee8f439 Set pmBootSize of the block 2 applepartmapentry ("NetBSD Partition")
to roundup(size-of-bootxx, 512) instead of hardcoding it to 1024.

(Gets the new boot floppy working slightly further - still broken tho)
2002-05-16 01:35:44 +00:00
lukem a6fac9a778 ensure that members of apple_drvr_map and apple_part_map_entry are big endian 2002-05-15 15:43:01 +00:00
lukem 4ee46bcf79 advertise macppc support. other tart-ups 2002-05-15 13:39:22 +00:00
lukem 2b7c014c1c add setboot callback to write the Apple partition map 2002-05-15 13:38:42 +00:00
lukem 1d0ec965d1 don't print a warning if the callback failed; rely upon the callback
to do that for us.
2002-05-15 13:34:27 +00:00
lukem bc6c7991bf add missing prototype for static function 2002-05-15 09:58:19 +00:00
lukem 35749caf16 bootblock.h:
- unify sparc_bbinfo (1064 bytes, with 256 block entries)
  and sun68k_bbinfo (296 byte, with 64 block entries)
  into shared_bbinfo (512 bytes, with 118 block entries),
  which will be also shared by future bbinfo-using platforms
  (including macppc)
- add datestamp to *_BBINFO_MAGIC strings, to prevent installboot vs
  bootxx version skew.
- add macppc support

*/bootxx.c:
- migrate to new shared_bbinfo structure

installboot:
- add macppc support (still needs applepartmap support and testing)
- improve and add some more warnings & errors to installboot
- implement shared_bbinfo_clearboot() and shared_bbinfo_setboot(), which
  perform the majority of the work for bbinfo-using back-ends
  (rather than replicating that across multiple back-ends).
2002-05-15 09:56:59 +00:00
lukem 966b42a3e6 bootblock.h:
- unify sparc_bbinfo (1064 bytes, with 256 block entries)
  and sun68k_bbinfo (296 byte, with 64 block entries)
  into shared_bbinfo (512 bytes, with 118 block entries),
  which will be also shared by future bbinfo-using platforms
  (including macppc)
- add datestamp to *_BBINFO_MAGIC strings, to prevent installboot vs
  bootxx version skew.
- add macppc support

*/bootxx.c:
- migrate to new shared_bbinfo structure

installboot:
- add macppc support (still needs applepartmap support and testing)
- improve and add some more warnings & errors to installboot
- implement shared_bbinfo_clearboot() and shared_bbinfo_setboot(), which
  perform the majority of the work for bbinfo-using back-ends
  (rather than replicating that across multiple back-ends).
2002-05-15 09:44:54 +00:00
lukem 932b752477 - add fsstat (fstat(2) on fsfd) and s1stat (fstat(2) on s1fd) in ib_params,
and use instead of replicating the effort in various locations
- if filesystem is not a regular file, use sync(2) instead of fsync(2)
  after the bootstrap has been written
- move <sys/stat.h> and <stdint.h> into "installboot.h"
2002-05-15 02:18:22 +00:00
lukem f3c2131045 - add fsstat (fstat(2) on fsfd) and s1stat (fstat(2) on s1fd) in ib_params,
and use instead of replicating the effort in various locations
- if filesystem is not a regular file, use sync(2) instead of fsync(2)
  after the bootstrap has been written
2002-05-15 02:17:06 +00:00
lukem 714021421e `-b bno' isn't supported. (sync with similar fix in arch/sparc.c) 2002-05-14 15:29:50 +00:00
lukem 1279ab0cf5 pull in <sys/bootblock.h> in "installboot.h" instead of in arch/*.c
(and remove <dev/dec/dec_boot.h>, since <sys/bootblock.h> has that stuff now)
2002-05-14 06:40:32 +00:00
lukem 1bdd92ee90 user visible stuff:
- add `-B s2bno', to provide the starting block for the secondary bootstrap.
  intended for use on platforms where the blocks of the stage2 bootstrap
  are hardcoded into the stage1 bootstrap (currently: sparc, sun2)
- don't support `-b s1bno' for sparc or sun2, since the primary is always
  at a fixed location on the disk.
- if `filesystem' is a regular file, use fsync(2) instead of sync(2)

code changes:
- add hardcode_stage2(), which uses -B s2bno and the size of the
  provided secondary bootstrap (as an actual file, not as part of the
  `filesystem' argument) to provide a sequential list of blocks from s2bno,
  each block being the appropriate file system size (from
  params->fstype->blocksize)
- add blocksize and needswap run-time parameters to ib_fs
- in *_match(), set params->fstype->blocksize to the underlying block size
  (8KB for raw), and params->fstype->needswap as appropriate
- rename IB_STARTBLOCK to IB_STAGE1START, and add IB_STAGE2START
- use hardcode_stage2() to implement raw_findstage2() and IB_STAGE2BLOCK
  support for ffs_findstage2()
- improve some comments, add some prototypes, ...
2002-05-14 06:18:50 +00:00
pk a4a641e5be Stop directory entry search if d_reclen == 0. 2002-05-07 12:22:23 +00:00
lukem 1b44564120 sparc now has a back-end 2002-05-06 23:18:20 +00:00
pk efad6f6e12 Add sparc module. 2002-05-06 16:24:45 +00:00
lukem e427ebdd56 s/bootinfo.h/bootblock.h/ 2002-05-06 13:34:18 +00:00
lukem 3efe6f707b add missing "sys/". noted by Martti Kuparinen <martti.kuparinen@iki.fi> 2002-05-06 12:16:55 +00:00
lukem 5123a119e3 replace <dev/sun/sun_boot.h> with <sys/bootinfo.h> 2002-05-06 05:28:30 +00:00
lukem b0dfae0396 document what uses the optional secondary arg. add sun2 example 2002-05-06 02:30:28 +00:00
lukem ce61e6de03 - sanity check bbi_block_count determined from bbinfo
- use warnx() instead of warn() in a couple of places
2002-05-06 01:49:48 +00:00
lukem 033fe17be5 tweak asserts 2002-05-02 13:03:32 +00:00
lukem 80ae5fb69d implement "raw" file system type. this can be used when the primary
bootstrap is being installed at a particular block offset and the underlying
filesystem doesn't matter (e.g, alpha ustarboot in ustar floppies)
2002-04-30 14:45:12 +00:00
lukem d9e55fca47 display sector start & count in decimal rather than hex 2002-04-30 14:24:33 +00:00
lukem 1a478e4092 add some more assert()s 2002-04-30 14:21:17 +00:00
lukem fa2a19276b consistently use sizeof(bb) instead of SUN68K_BOOT_BLOCK_MAX_SIZE 2002-04-29 13:07:41 +00:00
lukem 8feb052770 s/_SRC_TOP_/NETBSDSRCDIR/ 2002-04-26 16:23:14 +00:00
tv 4887cf3412 HAVE_CONFIG_Hize. Also get *_boot.h from "../../sys/" when HAVE_CONFIG_H,
rather than creating more stubs.
2002-04-25 18:11:53 +00:00
lukem 2fddf94b34 convert from "sun68k_bbinfo.h" to <dev/sun/sun_boot.h> 2002-04-24 01:35:25 +00:00
lukem 1608f561f2 after consideration, don't bother with compat symlinks, as it might
cause end-user confusion if the syntax changed between
/usr/mdec/installboot and /usr/sbin/installboot
2002-04-23 02:39:33 +00:00
bjh21 1723b1333c When printf'ing a size_t, cast it to unsigned long and use a %lu format.
This gets rid of a warning when compiling for ARM.
2002-04-22 23:24:10 +00:00
bjh21 a3e433c6fa include <bsd.own.mk> for _SRC_TOP_ 2002-04-22 23:23:05 +00:00
fredette 7493ba97a6 Install the compatability symlink for sun2.
In the sun68k handler, add some sync()s to make sure we
get a coherent picture of the filesystem.  Maybe should
be in the MI filesystem code?
2002-04-22 21:11:45 +00:00
lukem 878d42b158 Add sun2 backend from Matthew Fredette.
(Implemented with "sun68k.c" as it should eventually support "sun3" as well.)
2002-04-22 17:17:35 +00:00
lukem ed5fff8877 formatting consistency frobs 2002-04-22 16:03:07 +00:00
lukem 8eb8919e12 - Add code from Matt Fredette <fredette@theory.lcs.mit.edu> to implement
fstype checking, and back-end "ffs" support.
- Consistently use at least uint32_t for blocknumbers (vs. int / long / ...)
- Consistently use uintXX_t instead of u_intXX_t.
- Move various duplicated prototypes into "installboot.h"
2002-04-19 07:08:51 +00:00
fredette 4897886acb Small fix to a warning message that was displaying the wrong filename. 2002-04-17 04:00:44 +00:00
lukem d280442683 - support optional secondary bootstrap arg for install (unused by
existing backends, but future ones need it)
- use "bootstrap" instead of "boot block" in various messages where appropriate
- rename some members of ib_params
2002-04-12 06:50:41 +00:00
lukem 050f6eec3e run fsync on the fsfd before closing 2002-04-12 03:15:20 +00:00
lukem aa5396b0ec check size of reading bootblock against the correct size... 2002-04-11 08:02:27 +00:00
lukem 38cd7942e5 - add no_parseopt(), no_setboot() and no_clearboot() methods for back-ends
to use when they don't support a particular method
- don't automatically generate machines.c anymore
- add entries for i386 (temporarily unsupported) and shark
  (permanently unsupported)
2002-04-11 07:56:13 +00:00
thorpej 2e5904a52c Need <string.h> for memcmp(). 2002-04-09 02:06:29 +00:00
bjh21 8a4f44d684 Install the compat symlink into ${DESTDIR}. 2002-04-06 15:27:55 +00:00
bjh21 de69a8cbe5 Don't install the compat symlink if this is a HOSTPROG. 2002-04-06 13:59:12 +00:00
lukem c81588447f Add framework for adding compat symlink from /usr/mdec/installboot ->
/usr/sbin/installboot.
Enable pmax.
2002-04-04 23:01:38 +00:00
bjh21 33ce139ee0 Pull in config.h as necessary to get byte-order macros etc. 2002-04-04 17:53:04 +00:00
mrg 4cf62149f5 be sure to pad the bootblock. 2002-04-04 15:36:44 +00:00
mrg 96adf034f8 clean up a bit, use fewer magic numbers. 2002-04-04 15:17:34 +00:00
mrg 5b7f1cce2d LP64isms. also, be sure to use <string.h> if we use memset or memcpy. 2002-04-04 14:00:55 +00:00
lukem 67c2e40115 Add sparc64 back-end, contributed by Matthew Green. 2002-04-04 13:45:25 +00:00
wiz 3b288fe0ef Mostly typo fixes, some formatting nits. 2002-04-04 11:06:47 +00:00
lukem 9c89a064fd -n and -v are optional ... 2002-04-04 07:27:44 +00:00
lukem c1455b1b9a update description, history, authors, examples, bugs,
including pmax specific stuff
2002-04-04 07:24:55 +00:00
simonb d024fa98e3 Include <limits.h> to explicitly get LONG_MAX. 2002-04-04 03:27:53 +00:00
lukem 9f1d1d933d don't pull in <dev/sun/disklabel.h> just for SUN_DKMAGIC; instead,
provide local copy of that #define.
2002-04-04 00:32:06 +00:00
lukem 06d7c45c38 Add support for alpha, based on {vax,pmax}.c and
sys/arch/alpha/stand/installboot.
XXX: not fully tested yet.
2002-04-03 10:21:01 +00:00
lukem c37fa0cedc Migrate MD files to arch/ subdir. Suggested by Hubert Feyrer. 2002-04-03 09:09:01 +00:00
lukem 3d78281f15 Add pmax installboot back-end; from vax.c and arch/pmax/stand/installboot/*.
XXX: not tested yet.
2002-04-03 06:34:31 +00:00
lukem 36e058bfe4 whitespace foo 2002-04-03 06:29:11 +00:00
lukem 93c03c6edc replace machines.c rebuild with "regenmachines", which needs to be run
manually
2002-04-03 05:58:44 +00:00
lukem 07e4618075 Machine independent "unified" installboot(8).
Currently only supports vax, with more MD back-ends to be added RSN.
2002-04-03 05:21:16 +00:00