Commit Graph

346 Commits

Author SHA1 Message Date
tsutsui edc3e298c6 Fix an old bug in NATIVELABEL_ONLY case in PR/50729 by me. (sigh)
'disklabel -r -w' writes a disklabel at a wrong sector in
NATIVELABEL_ONLY && !LABELUSESMBR && LABELSECTOR != 0 case
if the target disk doesn't have a valid disklabel, due to
incorrect LABEL_OFFSET value.

Found and investigated on NetBSD/hp300 bootable CD tests.
Maybe this affects ports that use distrib/utils/x_disklabel
but have no MBR support, i.e. only NetBSD/hp300 10.0 and
NetBSD/ews4800mips 9.0 and later.

Should be pulled up to netbsd-10 and netbsd-9.
2024-05-15 12:47:22 +00:00
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
hgutch ec184f3bfb Change back various occurrences of \*[Le], \*[Ge] (less/greater equal)
and \*(ua (upwards arrow) to literal "<=", ">=" and "^" whenever
appropriate (e.g., in code examples).
2022-08-28 10:48:15 +00:00
nia ccf8c4a2ce disklabel(8): convert malloc(x * y) to reallocarr 2021-11-03 14:25:39 +00:00
christos 141e8cbc5f first check, then copy 2021-05-29 17:41:51 +00:00
msaitoh 57920690e6 s/occurence/occurrence/ 2020-09-29 02:58:51 +00:00
msaitoh 811d5a8b03 s/parition/partition/ 2020-09-29 02:49:55 +00:00
mrg de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
isaki 002042ffe7 Fix a trivial wrong comment. x68k's arch is not m68010. 2019-08-03 04:21:37 +00:00
mlelstv 45a6f3d566 Fix NATIVELABEL_ONLY build. 2019-07-03 07:05:27 +00:00
wiz 400b2bc13c Sort and unify a bit. Add more macros. 2019-07-02 16:47:19 +00:00
mlelstv 1b979fcca7 Add options to define labelsector and -offset and number of slices.
Make options to chose alternate label position for systems using MBR
more intuitive. -m now selects mode with MBR, -n selects mode without,
independent of the machine defaults.
2019-07-02 16:23:47 +00:00
kamil bd8efe16d3 Avoid misaligned access in disklabel(8) in find_label()
Introduce a new helper variable tlp and use it for memory access.

Detected with MKSANITIZER/UBSan

A patch by <christos>
2018-06-27 01:14:48 +00:00
ryo fe33aa2786 Add initial support for ARMv8 (AARCH64) (by nisimura@ and ryo@)
- sys/arch/evbarm64 is gone and integrated into sys/arch/evbarm. (by skrll@)
- add support fdt. evbarm/conf/GENERIC64 fdt (bcm2837,sunxi,tegra) based generic 64bit kernel config. (by skrll@, jmcneill@)
2018-04-01 04:35:01 +00:00
skrll ac34435581 Remove port-acorn26
OK core@
2018-01-24 09:04:40 +00:00
wiz 01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
chs 037063a2ac use warnx() rather than warn() in a case where errno is not relevant. 2017-03-09 00:18:23 +00:00
snj b14abce7b5 revert part of revision 1.28. "e.g." is correct. bad igor! 2016-10-15 06:23:28 +00:00
sevan e2e783ad92 Remove ignored Pp macro, highlighted by mandoc -Tlint. 2016-09-11 02:10:31 +00:00
sevan a3477eb231 Grammar fix suggested by textproc/igor.
Syntax fix highlighted by mandoc -Tlint.
Bump date.
2016-09-11 01:59:10 +00:00
sevan a11e4d8d20 Document the version disklabel first appeared.
Fix spelling mistakes.
Replace contraction.
Bump date.
2016-09-11 01:48:00 +00:00
christos a97d476aa4 fix broken patch 2016-01-31 23:11:49 +00:00
christos 0636a2fe97 PR/50729: Izumi Tsutsui: Add "SMALLPROG"-like options to disklabel(8) 2016-01-31 18:57:29 +00:00
htodd 7f6bcf1f58 Fix build. 2015-07-18 06:00:46 +00:00
tsutsui 1d2382733b Fix botch in "make disklabel a MI tool" changes in rev 1.2.
After that chanage, "MAXPARTITIONS" constant is not for the target port.
If host's MAXPARTITIONS is larger than a value of the target label and
target endianness is different from the build host, bswaplabel() could
overwrite data beyond the disklabel and primary boot stored after
LABELSECTOR in images might be corrupted.

This fixes boot failure of sun2 liveimage built by
"build.sh -U -m sun2 release live-image"
on TME.

Should be pulled up to netbsd-7.
2015-07-17 20:30:21 +00:00
christos 874b0026ee Add missing doc flags (B,M,m) 2015-04-29 17:07:11 +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
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