Commit Graph

6947 Commits

Author SHA1 Message Date
jnemeth e003a26f4c Add a third argument to the "cfn" function that is an argument to
gpt_change_ent().  The purpose of the third argument is to specify
whether the entry to be changed is a primary GPT entry or a secondary
GPT entry.  It is assumed that a secondary GPT entry will always
follow a corresponding primary entry.

This is in preparation for an upcoming change that will require it.
2019-06-21 02:14:59 +00:00
martin cad3861523 When biosboot is used on an existing wedge and we are switching to
the gpt of the parent device, do not pass the size of the wedge to
gpt_open, it certainly is smaller than the whole device.
Fixes bin/54312.
2019-06-20 10:56:38 +00:00
martin 08878476cc Do not try to close a NULL gpt. Fixes the core dump part of PR bin/54312 2019-06-20 10:41:58 +00:00
kre 1d7ccd04d7 Delete a redundant (useless) assignment. NFCI. 2019-06-04 11:59:05 +00:00
kre 43729d11af PR toolchain/54269
Make a SMALL dmesg even smaller.

When compiled -DSMALL, dmesg does nothing at all with the kernel
timestamps (it processes no options to be told what would be the
user's desire) so make it truly do (almost) nothing, rather than
some botched partial processing of them.

The "almost" is that a SMALL dmesg will now ignore spaces at the
beginning of each new message line ... those are (vanishingly)
unlikely to occur, as the kernel puts the timestamp (which starts
with '[' there) - fixing this would have meant even more #ifdef's
as the code that ignores that leading space is the only remaining
thing that (in a SMALL) dmesg looks at the value of the "tstamp"
variable, and if we don't keep some use of it, gcc complains...

These changes affect only SMALL dmesg (as installed on boot
floppies, etc) and have no intended effect on the version that's
installed on a normal (full size) running system.
2019-06-04 11:37:39 +00:00
christos 7031824410 We already incremented cl; fix indexing. Noticed by Xin Li @FreeBSD. 2019-06-04 00:08:00 +00:00
wiz 3969855bdf New sentence, new line. 2019-05-31 16:38:27 +00:00
mlelstv 8ba9fb4d1c Mention SATL support. 2019-05-31 05:47:22 +00:00
mlelstv c2d06938d9 Add support for ATA command pass-through to SCSI devices. 2019-05-30 21:32:08 +00:00
kre fe6f1f01c1 PR bin/54222
Don't use portal_node_reclaim() inappropriately.   It frees data we
did not allocate, but which might have been allocated by someone else.

While here, various other cleanups (avoid losing fd's if fork fails,
don't compose mangled st_mode S_IFMT values - puffs or's in what it
thinks is correct to the value we set, one case I saw was producing
0110600 for the mode, the 011 isn't any defined type at all - I'd
never seen ls print a '?' as the first char of ls -l output before!

This is still not really correct, but is I believe, better than before.
2019-05-23 11:13:17 +00:00
wiz 7a2e675187 Remove superfluous Pp. 2019-05-23 09:15:45 +00:00
kre 4ab11b0d22 Better handling of comments in portal.conf ... # now only introduces
a comment at beginning of line, or after whitespace.   This allows #
to be used as data otherwhere in the line (there is no escape mechanism).
2019-05-23 04:34:25 +00:00
kre de0c485250 KNF: blank lines after declarations, return (x) -> return x, and
eliminate spaces between cast and value being cast (most were OK already)
NFCI.
2019-05-23 02:39:06 +00:00
wiz 3a5a3e206b Sort SEE ALSO. 2019-05-08 06:10:30 +00:00
cnst f11bc4e580 bioctl(8): Xr ataraid(4), mpii(4) && mfii(4); 2019-05-08 03:29:59 +00:00
christos dfb7cec746 Add a -z flag to zero out the up to 4 bytes of padding in directory entry
names (including the terminating NUL), as well as directory entries with
extra free space (d->d_reclen > UFS_DIRSIZ(d)).

Inspired from FreeBSD:
    https://svnweb.freebsd.org/base?view=revision&revision=347066

While the kernel has been fixed to deal with the padding bytes (new
kernels will correctly zero out all the padding after the name), it
appears that there is still an issue with directory entries with extra
free space, since a newly created and populated filesystem gets modified
with "fsck_ffs -z".
2019-05-05 14:59:06 +00:00
christos b131cb44b1 simplify the endian byte-swapping code. 2019-05-05 13:24:19 +00:00
msaitoh 1ad0ba196b Suggested by Christos:
- Dont' cast malloc()'s return value.
 - Use calloc() instead of malloc().
2019-04-22 10:44:55 +00:00
maya f93d65267a wether -> whether 2019-04-21 11:45:08 +00:00
maya 2c4214cba2 Omit mention of old vnd(4) bug, now resolved.
Via elge, thanks.
2019-04-13 19:29:27 +00:00
pgoyette a398332c7f Add missing space in "quotas disabled" output from tunefs -N 2019-04-12 01:14:37 +00:00
kre 84b2b98300 KNF, 80 column police, a few other tidy ups (use if (ret == 0) rather
than if (!ret) when ret is not a boolean, and test fopen result against
NULL, for example).

NFCI.
2019-04-10 06:11:37 +00:00
kre c2cf8ad6d4 PR bin/53999 from rudolf (eq.cz)
Fix cgdconfig to report verification failures with gpt and mbr
verification methods (and not treat them as silent hard errors).
This also causes the cgd to be unconfigured when one of those
verification methods fails.

Add ATF tests to check that bad verification is reported, and
does not leave the cgd configured.

Patches from the PR applied.
2019-04-10 06:09:39 +00:00
tnn 3fe2f616e7 mention that -B is used to set the timeout for mbr_bootsel 2019-04-09 09:03:41 +00:00
martin 5bb85d19b9 PR bin/54088: make "destroy" remove the protective MBR too.
We could make this optional if someone comes up with a good reason
to leave it intact.
2019-04-04 14:03:40 +00:00
martin 920f8d883d Ignore -f with the "destroy" command completely (it was effectively
ignored already, so no functional change). Leave it as valid option
for compatibility.
2019-04-04 13:58:20 +00:00
martin f63c9f4407 Allow specifying the partition via -b startsec for the biosboot cmd. 2019-04-04 13:55:40 +00:00
mlelstv da22d85db7 Ignore EXT4 'kbytes written' field when validating alternate superblock. 2019-03-31 13:16:52 +00:00
mlelstv 25aaa28e7c No longer rely on data in disklabel to deduce alternate superblock
positions from block size. Instead use the same defaults as newfs_ext2fs.

Side effect is that fsck_ext2fs now works with wedges.
2019-03-31 10:55:58 +00:00
mlelstv fcaa2faa3e remove debug printfs from last commit. 2019-03-31 10:52:00 +00:00
mlelstv bbddb1419d Ignore recorded last mount point when validating alternate superblocks.
Compute log_bsize correctly. This fixes computation of alternate
superblock addresses.
2019-03-30 17:32:40 +00:00
martin d48fad1d9d Allow -b to specify a partition for "gpt unset" as well. 2019-03-26 14:55:02 +00:00
martin d0774e18ba When displaying a single partition (gpt show -i ...) display offset
and size in sectors (instead of the totally confusing bytes),
followed by the humanized byte offset/size.

This makes the numbers match the "gpt show" or "gpt show -a"
output.
2019-03-26 11:23:55 +00:00
martin 1756583860 Allow -b startsec to specify the partition to change for the set subcommand
as well.
Add another option, -N, as a quick way to remove all attributes.
2019-03-25 20:15:49 +00:00
wiz d774658d68 Bump date for previous. 2019-03-25 07:03:17 +00:00
manu eeb96f8c80 Add -U flag to dump(8) and dump_lfs(8) to specify dumpdates entry
This address situations where dump(8) cannot figure out the device being
dumped. It also allows tracking of subvolume dumps by using virtual
device as dumpdates entry.
2019-03-25 02:13:01 +00:00
martin 2ee402b3d0 Make the "show" subcommand accept -b startsec to identify a partition
(very usefull for scripts and other robotic callers).
2019-03-24 13:45:35 +00:00
martin f2b09ed0f6 Add support for specifying the partition to resize via -b startsec
(similar to label and other subcommands). Do not fully add gpt_find
functionality here, as resizing multiple partitions in one go does not
make sense.
2019-03-24 13:31:00 +00:00
mlelstv 5ca1f5a8c5 print little-endian header fields correctly. 2019-03-14 10:26:10 +00:00
mrg 6a0755298a make ext2fs rev1 the default. this enables LARGEFILES support. 2019-03-06 05:11:13 +00:00
mrg 51102cfc35 - smart vendor support now does try to guess the vendor,
adjust the BUGS to suit
- claim some copyright
2019-03-03 04:51:57 +00:00
mrg 37b18b6d27 add a samsung specific SMART table with:
235 - POR Recovery Count
	243 - SATA Downshift Count
	244 - Thermal Throttle Status
	245 - Timed Workload Media Wear
	251 - NAND Writes

all 5 turn up on newer samsung SSDs, though 3 of them all
read 65535 for me across muliplte devices.
2019-03-03 04:48:19 +00:00
jnemeth 487d107169 Make it clear when displaying data from the MBR. 2019-03-03 03:20:42 +00:00
jnemeth f23b40fcf3 add some more FAT file system types 2019-03-03 02:28:14 +00:00
christos c8d11eb8cc Use getfsspecname() to fill the filesystem argument in dumpdates.
While here, make sure that the error strings terminate with newline
consistently, and add a function that adds the system error string.
2019-03-01 16:42:11 +00:00
mrg 7aa75b6a2f add some intel specific smart values, and be more specific for
a bunch of micron/crucial values.
2019-03-01 02:33:43 +00:00
martin 8010630c8f Make "gpt migrate" work for disks with FAT32 and NTFS partitions 2019-02-10 10:35:51 +00:00
oster 6b6fd5e205 Correct printed IOCTL name that was incorrect since rev 1.5. 2019-02-06 22:38:10 +00:00
mrg 7b743cfc69 - add the string length as an explicit parameter to get_time_string()
- remove casts when the same type is used on both sides
- expand hours_buffer[] to fit the range of hours in an 'int'
- add a work around for the sprintf() truncation checker that fails
  to detect that 'minutes' and 'seconds' have a small range
2019-02-04 09:31:22 +00:00
mrg 82974f2217 check for snprintf() truncation and fail sanely if so, rather than
attempting to use a file that won't exist or isn't secure.
2019-02-04 08:21:11 +00:00