Commit Graph

69 Commits

Author SHA1 Message Date
Kyle Evans
3443420646 bectl(8): Sort BEs lightly by active (now or later) BE, then others
While it could be preferred to do this at insert in libbe(3), there's no
convenient way to insert at the head of an nvlist. Instead, we'll make two
passes over- once to print anything active either now or at nextboot, and
another to print everything else.

This doesn't actually impact performance in a significant way here, so we'll
worry about further optimizations if the need actually arises.
2018-08-04 06:29:46 +00:00
Kyle Evans
77d5a868a0 bectl(8): Add some relevant bectl list -a information
bectl list -a should show the boot environment, its relevant dataset, and
the snapshot it was created from. The header also changes to indicate the
rough order in which these things will show.

While here, start doing a little bit of spring cleaning and splitting
different bits out.
2018-08-04 06:14:54 +00:00
Kyle Evans
4146029bb3 bectl(8): Take origin snapshot into account when calculating used space
This more closely matches the behavior for beadm. The associated libbe(3)
API is still getting worked out a little bit.
2018-08-03 02:04:57 +00:00
Kyle Evans
74c55b3d38 bectl(8): Just use a single pointer for all string props 2018-08-03 01:51:44 +00:00
Kyle Evans
970fd6543a bectl(8): Move dataset printing out into its own function
This may later get reused for printing snapshot and/or origin snapshot
information.
2018-08-03 01:46:46 +00:00
Kyle Evans
4503a8b6c7 bectl(8): Remove sneaky comment 2018-07-26 18:57:51 +00:00
Kyle Evans
83244ec1ec bectl(8): Hack together a more proper bectl list
Note that the space is currently just the 'used' property of the dataset.
2018-07-26 18:56:50 +00:00
Kyle Evans
2e355bd3ff bectl(8): Remove the jail mount point with unjail 2018-07-26 04:12:31 +00:00
Kyle Evans
a2d93d3c98 bectl(8): Redo jail using jail(3) API
The jail is created with allow.mount, allow.mount.devfs, and
enforce_statfs=1. Upon creation, we immediately attach, chdir to "/", and
drop the user into a shell inside the jail.

The default IP for this is arbitrarily 10.20.30.40.
2018-07-26 04:07:36 +00:00
Kyle Evans
ad765da4e8 bectl(8): Support unjailing a boot environment
The given parameter may either be a jid, jail name, or a BE name.  In all
cases, the parameter will be resolved to a jid and bectl(8) will
sanity-check that there's actually a BE mounted at the requested jail root
before invoking jail_remove(2).
2018-07-26 03:14:58 +00:00
Kyle Evans
734e362fa1 libbe(3)/bectl(8): Provide and use proper alloc/free for property lists 2018-07-25 16:00:48 +00:00
Kyle Evans
b29bf2f84e libbe(3)/be(8): Drop WARNS overrides, fix all fallout
Based on the idea that we shouldn't have all-new library and utility going
into base that need WARNS=1...

- Decent amount of constification
- Lots of parentheses
- Minor other nits
2018-07-25 15:14:35 +00:00
Kyle Evans
3682d5e902 bectl(8): Start dumping out BE information with bectl list
For the moment, this is a primitive nvlist dump of what we get back from
be_get_bootenv_props as a proof-of-concept and to make sure that we're
getting back the kind of information we want to see from list.
2018-07-25 14:30:47 +00:00
Kyle Evans
16a10da86c bectl(8): Consistent style 2018-07-25 04:06:09 +00:00
Kyle Evans
2c8489579a bectl(8): Rename error messages 2018-07-25 03:57:28 +00:00
Kyle Evans
9e004b219e bectl.c: Chase rename 2018-07-25 01:04:50 +00:00
Kyle Evans
268af06d3e Normalize bectl(8)/libbe(3) Makefiles, remove Makefile copyright/license
Approved by:	hselaskey
2018-07-24 19:55:02 +00:00
Kyle Evans
edbfe3bcb5 bectl(8): Chase rename in manpage 2018-07-24 13:24:30 +00:00
Kyle Evans
5952343e02 Rename be(1) to bectl(8); continues to live in /sbin
Discussed with:	rpokala, allanjude
2018-07-24 13:21:44 +00:00