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

Using the download (-d) option doesn't actually download firmware updates #4

Closed
morgant opened this issue Mar 25, 2023 · 2 comments
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@morgant
Copy link
Owner

morgant commented Mar 25, 2023

For some reason, the -d (download) option doesn't actually download firmware and instead calls fw_update -n, which is dry-run mode. That lists the firmware that would be installed, but doesn't download anything.

It'd be preferable if it used fw_update -F ${some_path}, which will download firmware from the default URL to the ${some_path} directory. I'm not sure if we want to put that in a subdirectory of /tmp (with root-only permissions, of course) or something like /home/_swupdate/ (like sysupgrade does with /home/_sysupgrade/). I'm leaning toward the latter as it'd be preserved across reboots.

Of course, if we do that, we should probably also then update the -i (install) option to download firmware to and install it from /home/_swupdate/ (or whatever directory we end up using) with fw_update -p ${some_path}.

@morgant morgant added the bug Something isn't working label Mar 25, 2023
@morgant morgant added this to the 0.5 milestone Mar 25, 2023
@morgant morgant self-assigned this Mar 25, 2023
@morgant morgant modified the milestones: 0.5, 0.7 Mar 29, 2023
@morgant morgant modified the milestones: 0.7, 0.8 Jul 2, 2023
morgant added a commit that referenced this issue Jul 7, 2023
…are() & install_firmware() functions which download firmware files to the local sets dir /home/_swupdate and install from there, respectively. Issue #4
@morgant
Copy link
Owner Author

morgant commented Jul 7, 2023

I've started this and added a swupdate -b option (like sysupgrade(8); defaults to /home/_swupdate) and download_firmware() & install_firmware() functions which will download firmware to it and install from it, respectively.

Needs more testing, especially whether it's redownloading the firmware files each time. Also, what if one wants to install firmware that has already been downloaded, but not try to refetch them again first?

@morgant
Copy link
Owner Author

morgant commented Jul 8, 2023

I haven't looked at the fw_update(8) source yet, but in my testing, it:

  • Does not redownload firmware files to the base directory if the same version already exists in the base directory
  • If a firmware file is deleted from the base directory, it will redownload only that one file to the base directory

So, it seems to do everything I'd hoped and doesn't really need any additional work on my end to handle those situations. Yay!

@morgant morgant closed this as completed Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant