-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Change burn
task to Upgrade by default
#682
base: main
Are you sure you want to change the base?
Conversation
This is really cool. I think this will help so many people. I'll give it a try later today. |
defp format_result({_, 0}, _task), do: :ok | ||
|
||
defp format_result({%FwupStream{output: o}, _}, "upgrade") do | ||
if o =~ ~r/fwup: Expecting platform=#{mix_target()} and/ do |
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.
This messages comes from whatever the user puts in their fwup.config
, so it seems fragile. Does this work with a FAT-formatted MicroSD card? Like one that you get fresh from a store?
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.
Hmm, didn't think about that. I will try with a fresh card shortly
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.
I am getting the same message on a newly FAT formatted microSD and USB drive.
I'm wondering if they change here is to not be automatic and just prompt again asking for a confirmation to run the complete
task? Or...we just always run complete if the upgrade
task fails?
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.
Technically, even the task can be defined by the user as well and there may not even be an upgrade
or complete
task. Maybe this is considered a pure convenience and the only support for this "auto" work is with what's defined in official systems which all have this message and these tasks?
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.
The switch to the complete
task isn't working on my MBP:
Use 7.4 GiB memory card found at /dev/rdisk5? [Yn]
0% [ ]
fwup: Expecting platform=rpi0 and architecture=arm
FWUP upgrade was attempted but /dev/rdisk5 does not have a previous firmware.
Switching to use the complete task to format the entire card.
0% [ ]
fwup: Cannot open '/dev/rdisk5' for output.
Check file permissions or the read-only tab if this is an SD Card.
I think there's a race condition and there needs to be a pause?
mix burn --overwrite
works, though.
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
1841a40
to
b8c28e0
Compare
Did you MBP prompt you a second time for a password? I've been unable to reproduce on 3 machines (Linux, MBP, and Mac mini M1), but I get prompted for a password a second time when it does the next task. I'm more just curious now and can easily add in a quick pause to be safe. |
Before you add a pause, there might be another way. For example, the logic could be put in the I should show you live what I ran into when we pair on the |
In very specific cases, it might be desirable to fallback to another task when the target task fails. Most commonly this will be falling back to the `complete` task when the `upgrade` fails due to the firmware not having a previous firmware. The fallback will only occur if the failure is withing the tasks functions so checks before and after the task do not trigger a fallback (i.e. issues with archive or config file) This is inspired by nerves-project/nerves#682
In very specific cases, it might be desirable to fallback to another task when the target task fails. Most commonly this will be falling back to the `complete` task when the `upgrade` fails due to the firmware not having a previous firmware. The fallback will only occur if the failure is withing the tasks functions so checks before and after the task do not trigger a fallback (i.e. issues with archive or config file) This is inspired by nerves-project/nerves#682
This changes the
mix burn
(and subsequentlymix firmware.burn
) to use the FWUPupgrade
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 thecomplete
task to overwrite the device.You can also now specify
--overwrite
to force thecomplete
task and wipe the data on the device with the new firmware.see #679