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

fix(kernel_crawler): support debian rpi. #192

Merged
merged 1 commit into from
Dec 15, 2023
Merged

fix(kernel_crawler): support debian rpi. #192

merged 1 commit into from
Dec 15, 2023

Conversation

FedeDP
Copy link
Collaborator

@FedeDP FedeDP commented Dec 15, 2023

What type of PR is this?

/kind bug

Any specific area of the project related to this PR?

/area crawler

What this PR does / why we need it:

Add support for debian rpi kernels.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

@FedeDP
Copy link
Collaborator Author

FedeDP commented Dec 15, 2023

/hold

@FedeDP
Copy link
Collaborator Author

FedeDP commented Dec 15, 2023

We are finding no headers for rpi even if they are there: https://packages.debian.org/bookworm-backports/kernel/

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
print(line)
raise
# Just skip the line if it is malformed
continue
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Malformed lines can happen; in my tests, a line Description: was breaking this. Just skip it.

@@ -31,6 +31,7 @@ def __init__(self, arch):
mirrors = [
deb.DebMirror('http://mirrors.edge.kernel.org/debian/', arch, repo_filter),
deb.DebMirror('http://security.debian.org/', arch, repo_filter),
deb.DebMirror('http://archive.raspberrypi.com/debian/', arch, repo_filter),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debian mirror for raspberrypi.

@@ -58,7 +59,8 @@ def to_driverkit_config(self, release, deps):
headers = []
headers_rt = []
headers_cloud = []
# Magic to obtain `rt`, `cloud` and normal headers:
headers_rpi = []
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic to handle headers for rpi.

return [repo.DriverKitConfig(release + "-" + self.arch, "debian", headers),
repo.DriverKitConfig(release + "-rt-" + self.arch, "debian", headers_rt),
repo.DriverKitConfig(release + "-cloud-" + self.arch, "debian", headers_cloud)]
final = []
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only add headers for which we found at least 3 packages.

content = get_url(url)
# If content is None and we got elements after this one,
# try the next ones.
if content is not None or idx == len(urls) - 1:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If get_url returns None content, try the next one instead of returning None.

@FedeDP
Copy link
Collaborator Author

FedeDP commented Dec 15, 2023

/cc @EXONER4TED

@FedeDP
Copy link
Collaborator Author

FedeDP commented Dec 15, 2023

/cc @leogr

@poiana poiana requested a review from leogr December 15, 2023 16:41
@FedeDP
Copy link
Collaborator Author

FedeDP commented Dec 15, 2023

Crawled rpi kernels:

Building dependency tree  [####################################]  100%
{
  "debian": [
    {
      "kernelversion": "1",
      "kernelrelease": "1:6.1.21-1+rpt1-rpi-arm64",
      "target": "debian",
      "headers": [
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-kbuild-6.1_6.1.63-1+rpt1_arm64.deb",
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-headers-6.1.0-rpi1-rpi-v8_6.1.21-1+rpt1_arm64.deb",
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-headers-6.1.0-rpi1-common-rpi_6.1.21-1+rpt1_all.deb"
      ]
    },
    {
      "kernelversion": "1",
      "kernelrelease": "1:6.1.47-1+rpt2-rpi-arm64",
      "target": "debian",
      "headers": [
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-headers-6.1.0-rpi2-common-rpi_6.1.47-1+rpt2_all.deb",
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-headers-6.1.0-rpi2-rpi-v8_6.1.47-1+rpt2_arm64.deb",
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-kbuild-6.1_6.1.63-1+rpt1_arm64.deb"
      ]
    },
    {
      "kernelversion": "1",
      "kernelrelease": "1:6.1.47-1+rpt4-rpi-arm64",
      "target": "debian",
      "headers": [
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-headers-6.1.0-rpi3-common-rpi_6.1.47-1+rpt4_all.deb",
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-headers-6.1.0-rpi3-rpi-2712_6.1.47-1+rpt4_arm64.deb",
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-headers-6.1.0-rpi3-rpi-v8_6.1.47-1+rpt4_arm64.deb",
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-kbuild-6.1_6.1.63-1+rpt1_arm64.deb"
      ]
    },
    {
      "kernelversion": "1",
      "kernelrelease": "1:6.1.54-1+rpt2-rpi-arm64",
      "target": "debian",
      "headers": [
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-headers-6.1.0-rpi4-rpi-v8_6.1.54-1+rpt2_arm64.deb",
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-headers-6.1.0-rpi4-rpi-2712_6.1.54-1+rpt2_arm64.deb",
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-kbuild-6.1_6.1.63-1+rpt1_arm64.deb",
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-headers-6.1.0-rpi4-common-rpi_6.1.54-1+rpt2_all.deb"
      ]
    },
    {
      "kernelversion": "1",
      "kernelrelease": "1:6.1.58-1+rpt2-rpi-arm64",
      "target": "debian",
      "headers": [
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-headers-6.1.0-rpi6-rpi-2712_6.1.58-1+rpt2_arm64.deb",
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-headers-6.1.0-rpi6-rpi-v8_6.1.58-1+rpt2_arm64.deb",
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-kbuild-6.1_6.1.63-1+rpt1_arm64.deb",
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-headers-6.1.0-rpi6-common-rpi_6.1.58-1+rpt2_all.deb"
      ]
    },
    {
      "kernelversion": "1",
      "kernelrelease": "1:6.1.63-1+rpt1-rpi-arm64",
      "target": "debian",
      "headers": [
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-headers-6.1.0-rpi7-rpi-v8_6.1.63-1+rpt1_arm64.deb",
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-kbuild-6.1_6.1.63-1+rpt1_arm64.deb",
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-headers-6.1.0-rpi7-rpi-2712_6.1.63-1+rpt1_arm64.deb",
        "http://archive.raspberrypi.com/debian/pool/main/l/linux/linux-headers-6.1.0-rpi7-common-rpi_6.1.63-1+rpt1_all.deb"
      ]
    }
  ]
}

@FedeDP
Copy link
Collaborator Author

FedeDP commented Dec 15, 2023

/unhold

@poiana poiana merged commit bf68ff6 into main Dec 15, 2023
5 checks passed
@poiana poiana deleted the fix/debian_rpi branch December 15, 2023 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants