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

Adjust burn task to detect if drive already has Nerves image #679

Open
jjcarstens opened this issue Dec 15, 2021 · 2 comments
Open

Adjust burn task to detect if drive already has Nerves image #679

jjcarstens opened this issue Dec 15, 2021 · 2 comments

Comments

@jjcarstens
Copy link
Member

By default mix burn (and subsequently mix firmware.burn) will completely overwrite the SD card because it defaults to using the complete task, losing all data on it

However, it may be possible to detect the SD card already has an image on it and adjust the task to use upgrade instead which would preserve the /data partition on disk like when upgrading OTA via SSH or NervesHub

@axelson
Copy link
Contributor

axelson commented Dec 15, 2021

Oooh, that would be nice! Another option would be for mix firmware.burn to not allow overwriting an existing nerves image and instead require mix firmware.burn --overwrite to actually overwrite the image.

@jjcarstens
Copy link
Member Author

That's precisely what I was thinking @axelson! Default to upgrade, which would fail if there is no Uboot env (according to Frank), then fallback to complete. And also allow --overwrite option to force it

jjcarstens added a commit that referenced this issue Dec 28, 2021
This changes the `mix burn` (and subsequently `mix firmware.burn`) to
use the FWUP `upgrade` task by default. If the upgrade fails because
the device does not actually have upgradable firmware on it, then the
task will fallback to using the `complete` task to overwrite the device.

You can also now specify `--overwrite` to force the `complete` task
and wipe the data on the device with the new firmware.

see #679
jjcarstens added a commit that referenced this issue Dec 29, 2021
This changes the `mix burn` (and subsequently `mix firmware.burn`) to
use the FWUP `upgrade` task by default. If the upgrade fails because
the device does not actually have upgradable firmware on it, then the
task will fallback to using the `complete` task to overwrite the device.

You can also now specify `--overwrite` to force the `complete` task
and wipe the data on the device with the new firmware.

see #679
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants