Commit Graph

258 Commits

Author SHA1 Message Date
Simon J. Gerraty
d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Dmitry Chagin
de59f46a82 bsdlabel: Fix whitespace.
MFC after:		1 week
2023-02-07 10:43:40 +03:00
Dmitry Chagin
901b050b36 bsdlabel: Remove a write-only variable.
Since r149061 (2005) the total_size variable is write-only.

Differential Revision:	https://reviews.freebsd.org/D38368
MFC after:		2 weeks
2023-02-07 10:43:18 +03:00
Mateusz Piotrowski
fd06117525 *: Do not use the no-op -r flag for bsdlabel(8)
The -r flag is ignored by the FreeBSD implementation of bsdlabel(8)
(also called disklabel(8) in the past). Remove its use from examples
and tests in the tree.

This commit does not touch historical documentation under share/doc/smm
and files under contrib/netbsd-tests.

Reviewed by:	imp
MFC after:	2 weeks
Approved by:	imp (src)
Fixes:		57dfbec57b More axe-work:
Differential Revision:	https://reviews.freebsd.org/D34585
2022-03-17 17:28:07 +01:00
Conrad Meyer
ac8e5d02cf Remove deprecated GEOM classes
Follow-up on r322318 and r322319 and remove the deprecated modules.

Shift some now-unused kernel files into userspace utilities that incorporate
them.  Remove references to removed GEOM classes in userspace utilities.

Reviewed by:	imp (earlier version)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D21249
2019-08-13 20:06:55 +00:00
Brad Davis
a0bc3b5965 Move disktab to sbin/bsdlabel/
This leverages CONFS to handle the install.

Approved by:	re (blanket, pkgbase), will (mentor)
Differential Revision:	https://reviews.freebsd.org/D17217
2018-09-18 20:52:24 +00:00
Pedro F. Giffuni
8a16b7a18f General further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
2017-11-20 19:49:47 +00:00
Pedro F. Giffuni
df57947f08 spdx: initial adoption of licensing ID tags.
The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.

Initially, only tag files that use BSD 4-Clause "Original" license.

RelNotes:	yes
Differential Revision:	https://reviews.freebsd.org/D13133
2017-11-18 14:26:50 +00:00
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Enji Cooper
22289a8c3d sbin: normalize paths using SRCTOP-relative paths or :H when possible
This simplifies make logic/output

MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2017-03-04 11:33:01 +00:00
Warner Losh
fbbd9655e5 Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96
2017-02-28 23:42:47 +00:00
Yoshihiro Takahashi
2b375b4edd Remove pc98 support completely.
I thank all developers and contributors for pc98.

Relnotes:	yes
2017-01-28 02:22:15 +00:00
Sevan Janiyan
620e4a8c55 Add history section for bsdlabel(8)
http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD-Tahoe/usr/man/cat8/disklabel.0
Remove tab after space, highlighted by igor

PR:		212436
Approved by:	bcr (mentor)
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D8104
2016-10-05 19:56:10 +00:00
Marcelo Araujo
fb6a35935a Use NULL instead of 0 for pointers.
strchr(3) will return NULL if the character does not appear in the
string.

MFC after:	2 weeks.
2016-04-18 07:40:36 +00:00
Glen Barber
406d87b1c3 Explicitly add more files to the 'runtime' package.
Sponsored by:	The FreeBSD Foundation
2016-02-09 20:19:31 +00:00
Edward Tomasz Napierala
b8c19fd719 It's 2015, and some people are still trying to use fdisk and then
go asking what debug flags to set for GEOM to make it work.  Advice
them to use gpart(8) instead.

Something similar should probably done with disklabel,
but I need to rewrite the disklabel examples first.

Reviewed by:	wblock@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3315
2015-09-02 14:08:43 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Joel Dahl
f7e00d4bbd mdoc: remove EOL whitespace. 2014-12-29 13:50:59 +00:00
Baptiste Daroussin
13eb765f2d Convert sbin/ to LIBADD
Reduce overlinking
2014-11-25 11:23:12 +00:00
Simon J. Gerraty
ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Marcel Moolenaar
e7d939bda2 Remove ia64.
This includes:
o   All directories named *ia64*
o   All files named *ia64*
o   All ia64-specific code guarded by __ia64__
o   All ia64-specific makefile logic
o   Mention of ia64 in comments and documentation

This excludes:
o   Everything under contrib/
o   Everything under crypto/
o   sys/xen/interface
o   sys/sys/elf_common.h

Discussed at: BSDcan
2014-07-07 00:27:09 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
3caf0790a8 Merge head@256284 2013-10-13 02:35:19 +00:00
Sergey Kandaurov
05d98029e9 Sweep man pages replacing ad -> ada.
Approved by:	re (blackend)
MFC after:	1 week
X-MFC note:	stable/9 only
2013-10-01 18:41:53 +00:00
Simon J. Gerraty
7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Andrey V. Elsukov
b9f41b60f4 It seems that libdisk(3) incorrectly sets d_secperunit value.
Automatically fix it like GEOM_PART_BSD does.

MFC after:	1 week
2012-04-11 06:35:13 +00:00
Ed Schouten
6b99842ada Globally replace u_int*_t from (non-contributed) man pages.
The reasoning behind this, is that if we are consistent in our
documentation about the uint*_t stuff, people will be less tempted to
write new code that uses the non-standard types.

I am not going to bump the man page dates, as these changes can be
considered style nits. The meaning of the man pages is unaffected.

MFC after:	1 month
2012-02-12 18:29:56 +00:00
Ulrich Spörlein
4b85a12f71 Spelling fixes for sbin/ 2012-01-07 16:09:33 +00:00
Ed Schouten
b3608ae18f Replace index() and rindex() calls with strchr() and strrchr().
The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.
2012-01-03 18:51:58 +00:00
Maxim Sobolev
3fd209e4f2 Use in-label sectorsize to determine position of the label when
writing label into a file image. The most common use - putting disklabel
into ISO file. Before this change the label would always go to
the offset 512, while geom_part code expects it to be in the 1st
sector (i.e. 2048 incase of ISO). BSD disklabels provide good and
lightweight way to logically split livecds. It is non-intrusive as
far as ISO9660 goes (both boot-wise and metadata-wise) and
completely transparent to anything but BSD, so you can have
BSD-specific area appended after regular ISO.

And with a little bit of GEOM trickery you can do even more
interesting stuff with it.

For example we make "hybrid" bootable CDs using this method.
We create bootable ISO with kernel and such and append UFS
image compressed with UZIP and it works like a charm. We put
label based on the offsef of the BSD part into the ISO. The kernel
boots off normal ISO9660 part, tastes label attaches it,
tastes UZIP, attaches it and finally mounts UFS using GEOM_LABEL.
This provides much better way of eliminating waste than doing
"crunched" build.

MFC after:	1 month
2011-12-31 00:09:33 +00:00
Ed Schouten
1d23e44c17 Add missing static keyword.
All global variables and functions are marked static. Simply because
this is an enum, doesn't mean we can't do so as well.
2011-12-11 19:28:04 +00:00
Andrey V. Elsukov
b06ce6855c Fix multi-line comment formatting.
MFC after:	2 weeks
2011-11-07 07:51:10 +00:00
Andrey V. Elsukov
fd4bbf84f2 Add recommendation to use gpart(8) when user tries write disklabel
or bootcode to already opened provider.

MFC after:	1 week
2011-11-06 20:32:55 +00:00
Andrey V. Elsukov
b11075cdeb Remove unneeded checks.
MFC after:	1 week
2011-11-06 19:03:07 +00:00
Andrey V. Elsukov
982e6e69cd bsdlabel(8) could automatically fill many of disklabel's deprecated
fields, but user could specify some of those fields when edits disklabel
with `bsdlabel -e`. But without -A flag these fields might be
overwritten with default values from the virgin disklabel.
So, don't overwrite such fields if they are not zero. Also add checks
to prevent creating disklabel with less than DEFPARTITIONS and more
than MAXPARTITIONS partitions.

PR:		bin/162332
Tested by:	Eugene Grosbein
MFC after:	1 week
2011-11-06 18:59:42 +00:00
Andrey V. Elsukov
1fd45acda6 To be in sync with GEOM_PART_BSD limit the maximum number of supported
partitions to 20.

MFC after:	1 week
2011-11-06 17:30:32 +00:00
Ulrich Spörlein
a58711550d Widen fields that display partition offset/length.
This makes partitions between 50GiB and 2TiB (16TiB for 4k drives) print
correctly aligned.

While here, fix type of secsize. g_sectorsize() returns ssize_t, don't
store this in an unsigned var. Bump WARNS to 6.

MFC after:	4 weeks
2011-03-10 08:24:33 +00:00
Ulrich Spörlein
4c8dfc4aff Remove dead code in bsdlabel depending on __alpha__ 2011-03-10 08:24:21 +00:00
Ulrich Spörlein
15a6186cd1 Remove bsdlabel test-script that was full of broken assumptions.
- the default label now includes an a: partition by default
- the c: partition is no longer exported via devfs
- writing of the labels usually works in all cases, though the script
  assumes half of them have to fail
2011-03-10 08:24:10 +00:00
Ulrich Spörlein
1cc06c674e Remove bsdlabel.5, which hasn't been installed in over 7 years
and contains little more than an out-dated copy of <sys/disklabel.h>
2011-03-10 08:23:58 +00:00
Kevin Lo
a2299ad8e5 Closing file descriptors when it's done 2010-12-01 08:07:32 +00:00
Rebecca Cran
1161d4202c Fix some more warnings found by clang. 2010-11-22 20:10:48 +00:00
Jaakko Heinonen
e45d37b2e9 Don't attempt to write label with GEOM_BSD based method if the class is
not available. This improves error reporting when bsdlabel(8) is unable
to open a device for writing. If GEOM_BSD was unavailable, only a rather
obscure error message "Class not found" was printed.

PR:		bin/58390
Reviewed by:	ae
Discussed with:	marcel
MFC after:	1 month
2010-08-27 11:08:11 +00:00
Warner Losh
25faff346c MFtbemd:
Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want
to test of all the CPUs of a given family conform.
2010-08-23 22:24:11 +00:00
Jaakko Heinonen
fb26ece72c - Check that strtoul(3) succeeds to convert the entire string in a few
places.
- In getasciilabel(), set the disk type only when a valid type is given.

PR:		bin/86765
MFC after:	2 weeks
2010-08-15 17:49:41 +00:00