Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

OS-8264 Pool-bootable SmartOS (and Triton) cannot handle sdc-factoryreset #1110

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/smartdc/bin/sdc-factoryreset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ function usage()
exit 1
}

function wipe_bootpools()
{
# disable booting on all pools -- XXX KEBE ASKS, make this optional?
for pool in $(piadm bootable | grep -v non-bootable | awk '{print $1}')
do
piadm bootable -d $pool
done
}

if [[ -n $1 ]] && [[ $1 = "--help" ]]; then
usage
fi
Expand Down Expand Up @@ -72,6 +81,7 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
[[ -n ${SYS_ZPOOL} ]] || SYS_ZPOOL=zones

zfs set smartdc:factoryreset=yes ${SYS_ZPOOL}/var
wipe_bootpools
$final_command
else
abort
Expand Down