Commit Graph

46 Commits

Author SHA1 Message Date
christos
0636a2fe97 PR/50729: Izumi Tsutsui: Add "SMALLPROG"-like options to disklabel(8) 2016-01-31 18:57:29 +00:00
christos
c902c296d4 fix mistake in previous 2015-04-27 17:05:58 +00:00
christos
74c7e628de make table smaller in size. 2015-04-25 21:43:53 +00:00
christos
52e8eb1316 Fix the 3 programs that use DTYPE_ (disklabel disk types) constants from the
kernel. Two of them are inside ifdefs.
2015-01-02 19:46:02 +00:00
matt
3bbdf28d09 Add OpenRISC 1000 & UCB RISC-V platform support. 2014-09-19 17:45:03 +00:00
apb
fa05229ce5 Fix typo in "dreamcast" port name. 2014-08-10 06:48:51 +00:00
matt
547b3a3b01 Changes to existing files to enable building AARCH64 userland.
evbarm64-el
This is clang only.  While gcc4.8 supports aarch64, no netbsd support has
been written for aarch64 with gcc4.8.
2014-08-10 05:56:36 +00:00
joerg
63b30d82c2 Print uint32_t field as such. 2014-07-15 20:18:30 +00:00
skrll
6d3ceb1d61 Rename NetBSD/hp700 to NetBSD/hppa.
Unfortunately our VCS isn't very helpful here.
2014-02-24 07:23:38 +00:00
matt
8176d96907 Add m68000/coldfire.
Add evbcf.
2013-08-22 00:26:23 +00:00
riz
eab0544017 A number of new earm MACHINE_ARCH have shown up recently; make sure
we can deduce their endianness.
2013-08-11 17:15:15 +00:00
christos
cb39557cb2 %td is for ptrdiff_t not for off_t 2013-05-15 00:47:43 +00:00
christos
1e2e5a9113 CVE 1020933: Prevent integer overflow by using wider type 2013-05-13 18:01:08 +00:00
christos
7d5016218f CVE 1020935: Prevent overflow 2013-05-13 17:58:50 +00:00
skrll
4cc906c4aa Add an arch_endian entry for x86_64. 2013-05-05 15:59:42 +00:00
matt
4fdf02c17a Make sure to initialize byteorder if native. 2013-05-03 21:23:36 +00:00
matt
b1e3ebd45b Fix tpyos. 2013-05-03 16:39:00 +00:00
matt
af8f0546ca Make disklabel a MI tool. It will use MACHINE/MACHINE_ARCH to determine
the disklabel params as well as allowing command-line options of -M <machine>
and -B {le,be} to specify MACHINE and byteorder to be used.
2013-05-03 16:05:11 +00:00
christos
772a10450c move dk_ioctl to a header file for the benefit of x-building. 2013-01-17 18:33:58 +00:00
cyber
05b3cc487c PR bin/45744
from Julian Fagir
Removing options that have had implementations removed.

-b: removed in -r1.4
-s: removed in -r1.2
2012-04-08 07:59:53 +00:00
bouyer
a47e2eb758 Add getlabelusesmbr(), as proposed in
http://mail-index.netbsd.org/tech-userlevel/2011/08/25/msg005404.html
This is used by disk tools such as disklabel(8) to dynamically decide is
the undelyling platform uses a disklabel-in-mbr-partition or not
(instead of using a compile-time list of ports).
getlabelusesmbr() reads the sysctl kern.labelusesmbr, takes its value from the
machdep #define LABELUSESMBR.
For evbmips, make LABELUSESMBR 1 if the platform uses pmon
as bootloader, and 0 (the previous value) otherwise.
2011-08-30 12:39:49 +00:00
joerg
baa8e84b6f Use __dead 2011-08-29 14:34:58 +00:00
apb
63df928b37 Change printf formats to match the data type of the values being
printed.  There's now a lot of PRIu16 and PRIu32, some PRIu8, some
SCNu32, and a few cases where %u and %d were reversed.  Multiplication
of 32-bit and 8-bit values is cast to uint64_t and printed with PRIu64.

Inspired by a report from Patrick Welche on current-users.
2011-01-06 21:39:01 +00:00
christos
621e83eac4 match printf formats and types from Patrick Welche 2011-01-06 19:34:28 +00:00
tsutsui
d3724ba41f Add necessary byteswap ops for tools disklabel(8) used with -F option
(treating a target disk as a regular file and suppressing ioctl(2)s)
on reading/writing disklabel in a target file.
This allows cross build enviroment creating bootable disk images
for targets in different endian.
No functional changes to native (non-tools) disklabel(8) command.

Closes PR toolchain/42357.
2010-01-05 15:45:26 +00:00
tsutsui
e7730664e0 Don't use #ifdef __${MACHINE_ARCH}__ to enable machine dependent features.
Instead, use proper macro defined in Makefile per ${MACHINE_ARCH}.

__${MACHINE_ARCH}__ doesn't represent an architecture of tool's target
but an architecture of binaries being compiled, so required features
are not prolery enabled or unintentionally enabled on certain host
and target combinations during src/tools build.
2009-11-28 12:14:53 +00:00
mhitch
0428b65ea1 fix sign-compare issues in vax-specific code. 2009-05-04 18:09:04 +00:00
lukem
6543a91fea Remove the \n and tabs from the __COPYRIGHT() strings.
(Tweak some to use a consistent format.)
2008-07-20 01:20:21 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
dyoung
6f3106eba2 Let the operator use the DISKLABELSECTOR and DISKLABELOFFSET
environment variables to override the sector number, and the
bytes-offset in the sector, where disklabel(8) writes a disklabel.

If disklabel(8) was compiled as a host tool, then the defaults
still come from the port's LABELOFFSET and LABELSECTOR #defines.
Otherwise, the defaults still come from the sysctls, kern.labelsector
and kern.labeloffset.

This change helps me create a bootable CompactFlash image with both
a Master Boot Record (MBR) and a BSD disklabel for the RouterBOARD
153.  The RB 153 is an evbmips board with a CompactFlash slot.  It
searches the MBR on a CompactFlash card for a partition containing
an ELF kernel.  When disklabel(8) is built for evbmips, it will
ordinarily overwrite an MBR with the BSD disklabel.
2007-06-05 21:48:46 +00:00
matt
1863ad163e Remove defunct B from getopt string. 2007-04-12 18:41:23 +00:00
drochner
628f1591c1 include <signal.h> where signal(3) is used 2007-02-08 21:36:58 +00:00
hubertf
df06563bc3 Remove more duplicate #includes,
from Slava Semushin <slava.semushin@gmail.com>
2007-01-17 21:59:49 +00:00
jmmv
91af0d68b1 Add a '-l' flag and a 'L' command to interactive mode to list all known
file system types.  (Similar to what fdisk does for partition types.)

Closes PR bin/12954.
2006-11-26 16:16:31 +00:00
christos
29c1a4c22e GCC4 fixes from Mike Pumford 2006-06-25 21:32:39 +00:00
christos
65c3a16644 PR/33695: Arnaud Lacombe: Add compatibility syntax for FreeBSD interoperability. 2006-06-11 15:51:31 +00:00
christos
0bf2e0005a fix gcc warning. 2006-06-07 15:27:13 +00:00
dsl
46b640e7c6 Coverty 521: fclose() temporary file used when editing label. 2006-03-18 11:38:59 +00:00
jmc
fa63539af8 Fix acorn builds 2005-12-07 04:38:32 +00:00
dsl
409a3e040d Fix alpha build - pointed out by Kurt Schreiner on port-alpha 2005-10-20 20:08:33 +00:00
dsl
65151c95f1 Rototil the way disklabel -r reads and writes labels.
In particular the 'read' part plays 'hunt the disklabel' in order to get a
label into a local buffer - from where it can be displayed/edited.
The 'write' part makes a separate scan of the disk looking for places to
write the label.
The main changes are:
- It can no longer write the first 8k of the mbr to the pbr (or v.v.)
- All labels on the disk (that it can find) get updated during a write
- With -A all the labels are displayed (inc. those deleted by -D)
- Addition of -D which will delete (by one's complimenting dk_magic{2}) and
  existing labels before writing labels to the expected locations.
- -v gives some verbose output to stderr, -vv more etc
A better basis for processing incorrect endian labels, or labels from other
architectures.
2005-10-19 21:22:21 +00:00
uwe
a71ee33abc When building as host tool don't include "../../include/util.h".
getlabel{offset,sector} and opendisk functions declared in that file
are not used in this case anyway, and <util.h> pulls in unwatned
includes (e.g. <utmpx.h> doesn't exist on FreeBSD 4.*).

XXX: We can probably undo the #if !HAVE_NBTOOL_CONFIG_H kludge in
<util.h> now.
2005-08-27 22:21:14 +00:00
dsl
506fe1826c Rip out the support for writing bootstrap code. installboot(8) contains
support for hp300, hp700 and vax, $MACHINE is never arm32.
Fix usage output to only contain progname() once - bug introduced in rev 1.89
2005-06-17 21:20:18 +00:00
dsl
37bbe98710 Remove the never changed 'bootxx' variable 2005-06-15 20:49:41 +00:00
dsl
f74e227614 Remove all the code that was under 'NUMBOOT > 1' nothing has set that for
a long time.
2005-06-15 20:19:03 +00:00
dyoung
1726c417de Make disklabel(8) into a host-tool, "nbdisklabel." Move disklabel.c
to main.c to avoid a name collision with lib/libc/gen/disklabel.c
when we build nbdisklabel.  Still todo: commit host-tool build
infrastructure to src/tools/disklabel/.
2005-06-12 19:18:34 +00:00