Commit Graph

36 Commits

Author SHA1 Message Date
martin 77a3a1ee2a Minor usage tweaks for SMALLPROG 2011-11-03 20:46:41 +00:00
joerg bec77c5f43 Use __dead 2011-08-31 13:32:36 +00:00
drochner 79f027bbd6 On i386/amd64, define two flag bits in the boot parameters which control
whether modules are loaded and whether boot.cfg is evaluated, and
set both to "off" per default in the PXE bootloader.
Extend "installboot" to toggle the bits.
This way, pxeboot works with existing dhcp server setups (and as
described in the manpage) out of the box. Also, boot.cfg reading
involves a stat() call which is horribly inefficient with the
TFTP pseudo file system.
2010-01-14 17:49:31 +00:00
tsutsui e5f39b5e90 Remove if defined(__RCSID) around __RCSID() macro.
#include "nbtool_config.h" is enough for tools.
2010-01-14 16:27:49 +00:00
tsutsui 17ad8ece63 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.
2010-01-07 13:26:00 +00:00
lukem 2b2f4703f2 fix sign-compare issues 2009-04-05 11:48:02 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
dsl f2ccbd036f Don't treat -f and an invalid flag.
Report the hex value of unknown unsupported (for the specified arch) flags.
2008-03-06 21:05:27 +00:00
dsl 486d411937 Add a -f (force) parameter to installboot(8).
If specified then checks on the disks BPB are not done, and any existing BPB
is deleted.
This is needed soince newfs(8) doesn't overwrite the BPB - which is basically
the FAT superblock.
Update documentation and add an example of using bootxx_fat16.
2007-02-15 22:23:11 +00:00
christos f80d108fb1 fix initializers 2006-10-22 21:06:19 +00:00
christos 98a919c136 Coverity CID 55: Do things in a different order to appease coverity. 2006-04-22 19:57:04 +00:00
dogcow 4c1a82844d Since installboot is part of tools, and TIOCGWINSZ is not present on all
systems (PR/32878), make the window sizing stuff conditional.

Also, fix formatting of 'supported file system types are' line.
2006-02-22 07:10:26 +00:00
dsl b22a0afa5c Ignore entre is in the 'machines' table that have no name.
Use terminal with to break line of machine names.
2006-02-18 12:42:26 +00:00
dsl cce659e230 Move the MD definitions into the MD files, leaving machines.c with just
a list of the supported machines.
2006-02-18 10:08:07 +00:00
jmmv e7ab8d7413 Installing the primary bootstrap requires two arguments, so ensure they are
present.  Otherwise, an assertion is triggered (and core is dumped) in the
MD setboot code (just try 'installboot /dev/fd0a' on, e.g., i386).
2005-12-26 13:30:25 +00:00
dsl e0e1f6caed Don't try to determine the type of the target filesystem unless a second
stage bootstrap is specified.  It is only needed when we need to copy the
sector numbers of the second stage into the first stage.
Document that a configured baud rate of zero will cause the baud rate set by
the bios to be used.
2005-11-12 09:35:31 +00:00
wiz f72297cc7e Sync usage with man page (sort options). 2005-11-11 21:24:01 +00:00
dsl 8c893c964a Add a -e (edit) option to allow the bootstrap options of an installed
bootstrap or a file containing such a bootstrap to be changed/displayed.
In particular this will (soon) let you modify the parameters for pxeboot.
2005-11-11 21:09:50 +00:00
isaki 723dc0caf2 Use errx() rather than err() where appropriate. 2005-07-10 07:12:13 +00:00
dsl 0b10fdb3b8 Add an option to set bp_consaddr (serial console IO port address)
Only complain about small patch area if we would write something non-zero there.
2004-08-15 22:00:12 +00:00
jmc b2f782612f Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
2004-06-20 22:20:14 +00:00
dsl 7b024ef69c Add a -o keymap=zyz option that will set the boot keymap.
If a character in the map is typed, it gets replaced by the one following.
2004-03-13 22:51:50 +00:00
jmmv b635f565e7 Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
2004-01-05 23:23:32 +00:00
petrov 674b7e97b8 Format fixes. 2003-05-08 20:33:44 +00:00
dsl c4582ac81d Change 'ulong' to 'unsigned long' so it compiles as a host tool on freebsd. 2003-04-29 09:39:23 +00:00
dsl ed45ba76c7 Change the way -o options are parsed, now done in MI code with a check after
all the options have been processed that they are supported my the
specific system.
Add i386 MD options (console, password, speed and timeout)
(Approved by christos and lukem)
2003-04-15 14:22:13 +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 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 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
lukem 1a478e4092 add some more assert()s 2002-04-30 14:21:17 +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
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 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
simonb d024fa98e3 Include <limits.h> to explicitly get LONG_MAX. 2002-04-04 03:27:53 +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