-
Notifications
You must be signed in to change notification settings - Fork 164
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 example scripts for how to extract source files #2867
Conversation
2e227a4
to
5f5dcd0
Compare
6e68296
to
ca742d4
Compare
Not sure is this is a correct PR where should I ask this, but since kdump is merged, can we have a script for extracting the kernel debug information (kernel-debug.tar.gz) from the eve-kernel / eve-new-kernel containers? (kernel debug info eventuallywill be needed for kdumps debugging). |
@rouming what information do you need? The kernel OCI containers contain a file with KERNEL_SOURCE= but do you need to pull something else out of the OCI container? |
Side note: I got a whole bunch of errors - but it still worked - when I ran it in bash terminal Codespaces. Just started a new Codespaces on this checkpoint and ran
I assume those come from sourcing the Ah, yes, because the source of every
|
I have been trying to wrap my head around what we are trying to get from the apk script (will look at go after). Existing SBoM tools (like Syft) scan the image and pull out the package information into a purl. I think you are trying to replicate that, but also turn it into several layers above: the actual source URL (purl for apk doesn't include the actual URL) and upstream source that APKBUILD uses, etc. Is that correct? If so, would we be better served by having this tool consume an SBoM in standard format and building on it? I am not sure we need to replicate everything they do. For example, the output from spdx-json: "referenceCategory": "PACKAGE_MANAGER",
"referenceLocator": "pkg:alpine/findmnt@2.38-r1?arch=x86_64&upstream=util-linux&distro=busybox-1.35.0",
"referenceType": "purl" Granted, that example is missing the commit, but if it did, we would have enough to create the URL and retrieve information from it. FYI, Syft does get the aports commit, but only includes it in its own output format, not the standard SPDX or spdx-json formats. I have an open issue there. |
Getting lots of deprecation errors on the go one. I ran it with
In addition, I ran the whole thing in
|
What is the purpose of the go one? Is it to find licenses? Get the sources? In other words, is it to:
My general thought would be like with the apk: let an SBoM tool gather it, let us build on top of it. Although there probably are go libraries for parsing |
The first one requires no script - cat $(find . -name go.sum) does not I hope that both of these scripts will be short lived; at some level they merely cast the textual description in https://github.com/lf-edge/eve/blob/master/docs/EVE-IMAGE-SOURCES.md to code. |
d9a979e
to
3973984
Compare
OK, got it. These definitely should be top-level then, but I am wondering if they should exist outside of lf-edge/eve? These aren't eve or even lf-edge specific, but just useful tools for scanning for sources. |
66fb492
to
84bdceb
Compare
84bdceb
to
ddc688b
Compare
@deitch in your example starting with spdx-json and its purl, don't we still need to look at the sources= in the APKBUILD file to be able to fetch all of the Alpine patches in addition to the upstreadm source? (and the sha512sums in the APKBUILD if we want to verify the shas?) |
491c687
to
561c699
Compare
Yes and yes. And there is nothing in the purl which tells you the source; you just need to know that is came from
look here: https://pkg.go.dev/gitlab.alpinelinux.org/alpine/go |
754fa2f
to
649249d
Compare
This looks fine. Did you want any of the stuff I have that does some of this? I have:
|
I went through this again, as I look to compare the total sources to the SBoM. Your alpine fetcher is pulling down Could we modify it so that it can be passed a path? Then I could build it right into the generation pipeline. |
b0f701a
to
4273121
Compare
I like the modifications. |
…rnel. Includes fetching complete source and/or URLs+license information. Signed-off-by: eriknordmark <erik@zededa.com>
Signed-off-by: eriknordmark <erik@zededa.com>
Signed-off-by: eriknordmark <erik@zededa.com>
4273121
to
c9bb2ff
Compare
Three scripts; one for the golang files, one for the alpine build receipies we use, adn one for the kernel sources.
These are now good enough for manual invocation and we can explore using them in the release build pipeline.