Commit Graph

318 Commits

Author SHA1 Message Date
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
christos b7825cc95f - simplify getinput.
- add adjust command.
2013-01-15 23:52:48 +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
phx 233e75c9c0 Define USE_MBR for ofppc. 2011-08-18 08:42:07 +00:00
wiz e74a53f0f9 Sort sections. Remove comma in enumeration of two items. 2011-08-02 10:21:12 +00:00
christos e0f66530c3 mention that we don't handle more than 2TB disks/partitions. 2011-07-25 16:31:05 +00:00
dholland df520b1013 Disable COMPAT_386BSD_MBRPART. The code is still here if anyone needs it
for some reason. (But I have no idea why that would be -- if you have one
of these really ancient partitions and you're about to run disklabel, you
can easily run fdisk first and change the partition type to NetBSD.)

As it stands, the code will munch FreeBSD installs under some
circumstances, which is really not acceptable behavior.

The code, along with the kernel support that's been disabled by
default for several years, and some related but less dangerous code in
sysinst, should prboably be removed entirely after -6 is branched.

Discussed on tech-kern and tech-userlevel; closes PR 44496.

This is also almost certainly the cause of PR 42521 and PR 38841.
2011-02-12 22:23:01 +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
dholland 0bf3480c62 Change getnum() to use intmax_t instead of int, so it doesn't overflow
between 2^31 and 2^32. Adjust call sites accordingly. PR 43354.
2010-05-28 07:40:53 +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
nakayama 1c54a66d99 System utilities, boot programs and kernel modules are machine
(port) specific not CPU, so use MACHINE not MACHINE_ARCH.
2009-12-13 05:01:32 +00:00
pooka d6224f4507 Remove support for NetBSD/playstation2. 2009-12-05 16:29:10 +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
tsutsui 93f39165ae Make dreamcast, evbsh3, and mmeye use -DUSE_MBR.
All of these ports use src/sys/arch/sh3/sh3/disksubr.c
which is MBR aware.
2009-11-28 11:26:36 +00:00
abs b861177ec4 - Display "Enter '?' for help" when starting interactive mode
- Use %.40g rather than %g when printing sectors and MB for existing
  partition size/offset.
  Changes [1.93802e+06c, 1953525105s, 953870M]:
  to:     [1938021c, 1953525105s, 953869.6875M]:
2009-11-28 10:52:10 +00:00
abs e115d85122 Shuffle the order of examples to put the interactive option (-i) ahead
of $EDITOR and "disklabel -w -r /dev/rsd0c sd2212 foo"
2009-11-28 10:28:22 +00:00
tsutsui ab4082e001 - u_short -> uint16_t
- KNF a bit
2009-10-24 18:15:45 +00:00
snj 550147bd6a Remove 3rd and 4th clauses in christos' license. OK christos. 2009-10-21 01:07:44 +00:00
mhitch 0428b65ea1 fix sign-compare issues in vax-specific code. 2009-05-04 18:09:04 +00:00
lukem 07f7688506 fix sign-compare issues 2009-03-16 12:56:19 +00:00
abs 515e52158b Convert more MACHINE tests to MACHINE_ARCH 2009-02-14 13:50:50 +00:00
apb 44f43cf298 Remove local definitions of PRIxxxx macros in favour of the
centralised definitions from tools/compat/compat_defs.h, which
are included via nbtool_config.h.
2009-01-18 21:15:14 +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
aymeric fc91709981 The hpcsh kernel does for sure USE_MBR. Make disklabel use it too on hpcsh.
With this, it is possible to bootstrap a MBR partitioned CF card without
partitioning and disklabelling it first on another platform.
2008-03-11 08:18:22 +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
perry a3b6213467 As pointed out by James Wetterau, we wish to complement, as in the
logical operation, rather than compliment, as in praise, the magic
number of the disk.

There are probably other instances of this in the tree. We should fix
them.
2007-01-27 19:20:28 +00:00
hubertf df06563bc3 Remove more duplicate #includes,
from Slava Semushin <slava.semushin@gmail.com>
2007-01-17 21:59:49 +00:00
nonaka 5637a5d46a zaurus use MBR partition info. 2006-12-18 13:39:10 +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