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

[INFORMATION] Guidance / Patch to retrieve kernel rpms for Amazon Linux distro #145

Closed
incertum opened this issue Jun 5, 2023 · 5 comments

Comments

@incertum
Copy link

incertum commented Jun 5, 2023

What to document

@FedeDP just leaving a record we can refer to when we intend to retrieve the kernel rpms for the Amazon Linux distros. This is not a feature request.

See falcosecurity/libs#524 (comment)

diff --git a/kernel_crawler/amazonlinux.py b/kernel_crawler/amazonlinux.py
index 975e763..6d98d18 100644
--- a/kernel_crawler/amazonlinux.py
+++ b/kernel_crawler/amazonlinux.py
@@ -40,9 +40,7 @@ class AmazonLinux1Mirror(repo.Distro):
         return [rpm.RpmRepository(url) for url in sorted(repo_urls)]
 
     def to_driverkit_config(self, release, deps):
-        for dep in deps:
-            if dep.find("devel") != -1:
-                return repo.DriverKitConfig(release, "amazonlinux", dep)
+        return [repo.DriverKitConfig(release, "amazonlinux", dep) for dep in deps]
 
 
 class AmazonLinux2Mirror(repo.Distro):
@@ -67,9 +65,7 @@ class AmazonLinux2Mirror(repo.Distro):
         return [rpm.RpmRepository(url) for url in sorted(repo_urls)]
 
     def to_driverkit_config(self, release, deps):
-        for dep in deps:
-            if dep.find("devel") != -1:
-                return repo.DriverKitConfig(release, "amazonlinux2", dep)
+        return [repo.DriverKitConfig(release, "amazonlinux2", dep) for dep in deps]
 
 class AmazonLinux2022Mirror(repo.Distro):
     # This was obtained by running
@@ -95,9 +91,7 @@ class AmazonLinux2022Mirror(repo.Distro):
         return [rpm.RpmRepository(url) for url in sorted(repo_urls)]
 
     def to_driverkit_config(self, release, deps):
-        for dep in deps:
-            if dep.find("devel") != -1:
-                return repo.DriverKitConfig(release, "amazonlinux2022", dep)
+        return [repo.DriverKitConfig(release, "amazonlinux2022", dep) for dep in deps]
 
 class AmazonLinux2023Mirror(repo.Distro):
     AL2023_REPOS = [
@@ -116,6 +110,4 @@ class AmazonLinux2023Mirror(repo.Distro):
         return [rpm.RpmRepository(url) for url in sorted(repo_urls)]
 
     def to_driverkit_config(self, release, deps):
-        for dep in deps:
-            if dep.find("devel") != -1:
-                return repo.DriverKitConfig(release, "amazonlinux2023", dep)
+        return [repo.DriverKitConfig(release, "amazonlinux2023", dep) for dep in deps]

Gives kernel-devel and kernel- RPMS as separate JSON blobs, e.g.

   {
      "kernelversion": 1,
      "kernelrelease": "5.15.73-45.135.amzn2022.x86_64",
      "target": "amazonlinux2022",
      "headers": [
        "https://al2022-repos-us-east-1-9761ab97.s3.dualstack.us-east-1.amazonaws.com/core/guids/f6a398f13616956455e2c88f0ca1d7f5dc957d35d9ee8be18c6e44951dd16404/x86_64/../../../../blobstore/63f124a890af2e4f1fa75bb9dcfe30d2eb89dd157afc7644fad6d6447d6395f7/kernel-5.15.73-45.135.amzn2022.x86_64.rpm"
      ]
    },
    {
      "kernelversion": 1,
      "kernelrelease": "5.15.73-45.135.amzn2022.x86_64",
      "target": "amazonlinux2022",
      "headers": [
        "https://al2022-repos-us-east-1-9761ab97.s3.dualstack.us-east-1.amazonaws.com/core/guids/f6a398f13616956455e2c88f0ca1d7f5dc957d35d9ee8be18c6e44951dd16404/x86_64/../../../../blobstore/e571823a623650af7b3119a2f236e8106ca80d4f3b0b4efd78048a18334fbe1e/kernel-devel-5.15.73-45.135.amzn2022.x86_64.rpm"
      ]
    }
@poiana
Copy link
Contributor

poiana commented Jun 5, 2023

There is not a label identifying the kind of this issue.
Please specify it either using /kind <group> or manually from the side menu.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@poiana
Copy link
Contributor

poiana commented Sep 3, 2023

Issues go stale after 90d of inactivity.

Mark the issue as fresh with /remove-lifecycle stale.

Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Provide feedback via https:/falcosecurity/community.

/lifecycle stale

@poiana
Copy link
Contributor

poiana commented Oct 3, 2023

Stale issues rot after 30d of inactivity.

Mark the issue as fresh with /remove-lifecycle rotten.

Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Provide feedback via https:/falcosecurity/community.

/lifecycle rotten

@poiana
Copy link
Contributor

poiana commented Nov 2, 2023

Rotten issues close after 30d of inactivity.

Reopen the issue with /reopen.

Mark the issue as fresh with /remove-lifecycle rotten.

Provide feedback via https:/falcosecurity/community.
/close

@poiana
Copy link
Contributor

poiana commented Nov 2, 2023

@poiana: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue with /reopen.

Mark the issue as fresh with /remove-lifecycle rotten.

Provide feedback via https:/falcosecurity/community.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@poiana poiana closed this as completed Nov 2, 2023
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