-
Notifications
You must be signed in to change notification settings - Fork 3.2k
bectl: Add -E flag to create an empty boot environment #1975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Love this. We're creating these by hand now. |
96a6c55 to
ddbe9a2
Compare
| return (set_error(lbh, err)); | ||
|
|
||
| err = zfs_create(lbh->lzh, buf, ZFS_TYPE_FILESYSTEM, NULL); | ||
| return (set_error(lbh, err)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err needs to be interpreted / mapped to a libbe(3) error here before we pass it to set_error and return it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added be_zfs_create and updated the zfs_create callsites to use it.
lib/libbe/tests/target_prog.c
Outdated
|
|
||
| libbe_print_on_error(lbh, true); | ||
|
|
||
| if (strcmp(argv[2], "empty") == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting seems off here (should be tab-indents), but maybe that's just GitHub rendering; the file's a littl inconsistent, but I can fix that in a follow-up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| atf_check -e match:"cannot be combined" -s not-exit:0 \ | ||
| bectl -r ${zpool}/ROOT create -E -e not-allowed empty-existing | ||
| atf_check -e match:"cannot be combined" -s not-exit:0 \ | ||
| bectl -r ${zpool}/ROOT create -E -r empty-recursive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of these tests, probably this one, should do something to also confirm that it's actually empty / not related to an existing BE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added: atf_check -o inline:"-\n" zfs get -H -o value origin ${zpool}/ROOT/empty
ddbe9a2 to
7f5e04d
Compare
|
Thanks for the feedback @kevans91 , I believe I've addressed all of the points. |
348dd66 to
65f61bd
Compare
Signed-off-by: Pat Maddox <[email protected]>
65f61bd to
b2143b3
Compare

Test plan: