Skip to content
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

Add force option to safe-upgrade bootstrap cmd #1051

Merged
Merged
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
15 changes: 9 additions & 6 deletions packages/safe-upgrade/files/usr/sbin/safe-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,14 @@ function su.preserve_files_to_new_partition(args)
end

local function bootstrap(args)
--TODO: add --force option to upgrade SU
if is_su_installed() then
print(string.format("safe-upgrade version '%s' is already installed, aborting",
get_su_version()))
os.exit(su.EXIT_STATUS_ALREADY_INSTALLED)
if args.force then
print("Forcing the bootstrap.")
else
print(string.format("safe-upgrade version '%s' is already installed, aborting",
get_su_version()))
os.exit(su.EXIT_STATUS_ALREADY_INSTALLED)
end
end


Expand Down Expand Up @@ -421,8 +424,8 @@ local function parse_args()
parser:command('confirm', ('Confirm the current partition. Use when after an upgrade ' ..
'or after running "test-other-partition".'))

parser:command('bootstrap', 'Install the safe-upgrade mechanism')

local bootstrap = parser:command('bootstrap', 'Install the safe-upgrade mechanism')
bootstrap:flag("--force", "Install even it is already installed.")
parser:command('test-other-partition', 'Mark the other partition as testing partition.')

parser:command('board-supported', 'Exits with 0 if board is supported')
Expand Down
Loading