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

Feature request: Fetch images automatically #3

Open
stevieb9 opened this issue Mar 22, 2019 · 9 comments
Open

Feature request: Fetch images automatically #3

stevieb9 opened this issue Mar 22, 2019 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@stevieb9
Copy link

I'm the author of RPi::WiringPi, WiringPi::API amongst others, and am wondering if you'd be interested in hacking into your distribution the ability to grab the "latest" version of the images from the Raspberry Pi download site automatically.

You've named this distribution "Pi" related, so it makes sense to keep it in that scope.

This isn't a 'bug' or an 'issue' per-se, it's a request to understand if the above fits your roadmap or not. If so, could you provide guidance as to how that could/might be built-in?

@ikluft ikluft self-assigned this Mar 22, 2019
@ikluft ikluft added the enhancement New feature or request label Mar 22, 2019
@ikluft
Copy link
Owner

ikluft commented Mar 22, 2019

That's a good idea. So we'll use this newly-created issue to track it.

Actually, the thought had occurred to me too while typing in the name of a downloaded file. There was obviously a step that can be automated there. The implementation would need a list of known distributions and their URLs. Probably also a local cache directory to avoid downloading the same gigabyte+ file more than once.

@stevieb9
Copy link
Author

stevieb9 commented Mar 22, 2019

By appearances, the "latest" of both Noobs and Rasbpian have direct links that could be fetched by easily, so long as those links don't change.

That said, if you're down with this idea, I could reach out to the Raspberry Pi team to see if they could provide an API or at least a JSON link where versions could be grabbed from.

I'm also the author of berrybrew (Perlbrew for Windows), so we may have a bit of clout getting information about stabilizing the information about releases.

berrybrew is written in C#, but I digress. Let's make this new feature work here, yes?

I often scour the CPAN for new distributions I find interesting, then write patches (PRs) for. This one came up, and thought... this is a very good example of something I'd like to include in the RPi offerings.

@stevieb9
Copy link
Author

stevieb9 commented Mar 23, 2019

Probably also a local cache directory to avoid downloading the same gigabyte+ file more than once.

Done by version number within the actual link (if available), and some form of checksum (which is available on the site itself).

Checksum and version doesn't match? warn/delete.

@ikluft
Copy link
Owner

ikluft commented Mar 23, 2019

That sounds great. Nice to meet you! Lots of good ideas.
We may also help the Raspberry Pi Foundation with writing the tool to provide that API, if that helps to convince them. Currently the list of RPi downloads is stuck around what was available in 2013. (New versions available by the links, but no new distributions.) So Fedora and FreeBSD aren't on the list. I made a list at https://metacpan.org/pod/distribution/PiFlash/doc/resources.pod where users can find more.
(edit: URL updated after I converted the doc from Markdown to POD so MetaCPAN will display it on the release page)

@stevieb9
Copy link
Author

Let's leave the nice(ities) off of this issue. We'll talk more tomorrow. I think we can combine to get things done. Reach me at my email.

This particular comment will eventually self destruct (due to a debouncing issue on my Pi).

@ikluft
Copy link
Owner

ikluft commented Mar 23, 2019

Making notes how this will have to be done... As I browsed some available downloads observing URL paths we'll need to process, I see we'll also need to allow the user to set which model of Raspberry Pi the download is for. It should default to the latest model, currently the RPi 3/3+ which is an aarch64 architecture.

@stevieb9
Copy link
Author

stevieb9 commented Mar 23, 2019

Reached out directly to a contact at the Raspberry Pi organization regarding access to any API or data for the downloads (or if they exist at all), and also created a forum post for good measure.

Will advise when I get any info back.

@stevieb9
Copy link
Author

Was advised about their archive site, which appears to be what we may be looking for. If you'd like, over the next week, I can develop a parser for the JSON data, and after that's done, perhaps we can discuss how to present the information to the user for selection.

@ikluft
Copy link
Owner

ikluft commented Mar 23, 2019

Interesting. It's a source of data. They're still missing Alpine, Arch, Fedora, FreeBSD, etc - we'll have to maintain our own list of what they're missing. I can parse JSON - but before I start, I should ask if that's something you're itching to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants