Skip to content

extension: add ksrc packaging #8211

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

Draft
wants to merge 141 commits into
base: main
Choose a base branch
from

Conversation

EvilOlaf
Copy link
Member

Description

A (very poorly made) attempt to address #8161

It spits out some sort of kernel source package, but I think {version} is still missing since I couldn't get it to work and probably needs more fixes until production-ready. I probably won't go further here due to lacking expertise in framework and bash foo.

Maybe someone want to pick it up from here.

Also to do: Re-enable BUILD_KSRC switch to enable the extension.

How Has This Been Tested?

  • enable extension
  • see some sort of kernel package being created
  • ???
  • Profit!

Checklist:

  • My code follows the style guidelines of this project - Well...kind of?
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@EvilOlaf EvilOlaf added the Help needed We need your involvement label May 21, 2025
Copy link
Contributor

coderabbitai bot commented May 21, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

A new shell script extension has been added to facilitate packaging the Linux kernel source into a Debian package. The script introduces three primary functions: one to set configuration variables for building the kernel source package, another to add the fakeroot utility to the host dependencies, and a third to handle the actual packaging process. The packaging function checks for the presence of a kernel configuration file, prepares the necessary directory structure, compresses the kernel source, includes documentation and license files, generates Debian package metadata, and builds the package using fakeroot. The script also manages temporary files and provides progress notifications.

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch extension-kernel-source
  • Post Copyable Unit Tests in Comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added 05 Milestone: Second quarter release size/medium PR with more then 50 and less then 250 lines Needs review Seeking for review Framework Framework components labels May 21, 2025
@EvilOlaf
Copy link
Member Author

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented May 21, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (3)
extensions/linux-source-package.sh (3)

1-1: Add a shebang or shell directive
Specify the interpreter to satisfy ShellCheck (SC2148) and ensure consistent execution. For example, add at the top:

+#!/usr/bin/env bash
🧰 Tools
🪛 Shellcheck (0.10.0)

[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

(SC2148)


19-21: Scope variables locally and quote values
Use local for function-scoped variables and quote interpolations for safety:

-declare kernel_work_dir="${SRC}/cache/sources/${LINUXSOURCEDIR}"
-declare CHOSEN_KSRC=linux-source-${BRANCH}-${LINUXFAMILY}
+local kernel_work_dir="${SRC}/cache/sources/${LINUXSOURCEDIR}"
+local CHOSEN_KSRC="linux-source-${BRANCH}-${LINUXFAMILY}"

31-33: Quote paths and handle failures when compressing config
Ensure file paths are quoted and errors are propagated:

-cp "${SRC}/config/kernel/${LINUXCONFIG}.config" "default_${LINUXCONFIG}.config"
-xz < ${kernel_work_dir}/.config > "${sources_pkg_dir}/usr/src/${LINUXCONFIG}_${version}_${REVISION}_config.xz"
+cp "${SRC}/config/kernel/${LINUXCONFIG}.config" "default_${LINUXCONFIG}.config" || exit 1
+xz < "${kernel_work_dir}/.config" > "${sources_pkg_dir}/usr/src/${LINUXCONFIG}_${version}_${REVISION}_config.xz" || exit 1
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d0f708d and 00b9ae4.

📒 Files selected for processing (1)
  • extensions/linux-source-package.sh (1 hunks)
🧰 Additional context used
🪛 Shellcheck (0.10.0)
extensions/linux-source-package.sh

[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

(SC2148)


[warning] 3-3: ARTIFACT_IGNORE_CACHE appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 4-4: KERNEL_GIT appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 16-16: kernel_version_family is referenced but not assigned.

(SC2154)


[warning] 25-25: ret is referenced but not assigned.

(SC2154)


[warning] 25-25: Use single quotes, otherwise this expands now rather than when signalled.

(SC2064)


[warning] 28-28: version is referenced but not assigned.

(SC2154)

🔇 Additional comments (2)
extensions/linux-source-package.sh (2)

3-4: Verify global variables are used by the build system
ShellCheck flags ARTIFACT_IGNORE_CACHE and KERNEL_GIT as unused (SC2034). Confirm these globals are consumed downstream or export/remove them accordingly.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 3-3: ARTIFACT_IGNORE_CACHE appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 4-4: KERNEL_GIT appears unused. Verify use (or export if used externally).

(SC2034)


53-58: Verify DEB_STORAGE and enforce error propagation
Ensure that ${DEB_STORAGE} is defined and writable so rsync doesn't fail silently. Also, make sure fakeroot dpkg-deb errors halt the build (e.g., via set -e or || exit 1).

Comment on lines +23 to +24
local sources_pkg_dir tmp_src_dir
tmp_src_dir=$(mktemp -d)
trap "ret=\$?; rm -rf \"${tmp_src_dir}\" ; exit \$ret" 0 1 2 3 15
sources_pkg_dir=${tmp_src_dir}/${CHOSEN_KSRC}_${REVISION}_all
mkdir -p "${sources_pkg_dir}"/usr/src/ \
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve trap quoting and exit handling
The trap uses double quotes causing premature expansion and references ret before assignment (SC2064, SC2154). A more robust pattern is:

-trap "ret=\$?; rm -rf \"${tmp_src_dir}\" ; exit \$ret" 0 1 2 3 15
+trap 'rc=$?; rm -rf "'"${tmp_src_dir}"'"; exit $rc' 0 1 2 3 15

Alternatively, simplify to:

trap 'rm -rf "${tmp_src_dir}"' EXIT INT TERM
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 25-25: ret is referenced but not assigned.

(SC2154)


[warning] 25-25: Use single quotes, otherwise this expands now rather than when signalled.

(SC2064)

🤖 Prompt for AI Agents
In extensions/linux-source-package.sh around lines 23 to 27, the trap command
uses double quotes causing premature variable expansion and references the
variable ret before it is assigned. To fix this, replace the double quotes with
single quotes in the trap command to delay expansion, or simplify the trap to
just remove the temporary directory on EXIT, INT, and TERM signals without
capturing the exit code. For example, use trap 'rm -rf "${tmp_src_dir}"' EXIT
INT TERM to ensure proper cleanup without premature expansion or undefined
variable usage.

@The-going
Copy link
Contributor

It spits out some sort of kernel source package, but I think {version} is still missing since I couldn't get it to work and probably needs more fixes until production-ready. I probably won't go further here due to lacking expertise in framework and bash foo.

Maybe someone want to pick it up from here.

Also to do: Re-enable BUILD_KSRC switch to enable the extension.

In the previous branch, the package contained only the archive and additional actions were required locally on the system to make it work.

I'll see what I can do about it.

efectn and others added 20 commits May 25, 2025 17:31
Add the configuration file for the wifi 8821cu module
…hock 4 updated driver

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 480f49412651059a414a6a5c96887abb1877de8a to c6634ca281a9fc05b03bee224ba00910cb78ab6e.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](tj-actions/changed-files@480f494...c6634ca)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-version: c6634ca281a9fc05b03bee224ba00910cb78ab6e
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [setuptools](https://github.com/pypa/setuptools) from 80.4.0 to 80.8.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](pypa/setuptools@v80.4.0...v80.8.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-version: 80.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Currently `current` picks 6.6.y kernel baseline, and `edge` picks
upstream's 6.12.y tree.

Make `current` pick the current SDK release (which, at the moment, is at
11.00.09 baseline), and make `edge` pick the latest un-released RC's
from TI's tree.

`current` is what most people will use, therefore it should be the same
as our official and tested release. `edge` can be either cutting-edge
(latest RC) or bleeding-edge (latest commit on cicd branch). For now,
keep it cutting-edge.

Signed-off-by: Suhaas Joshi <s-joshi@ti.com>
Presently, in k3 devices, we are setting TEE=bl31.bin. However TEE
should be set to OPTEE, not ATF.

Therefore, do the following:
    * clone and compile OPTEE
    * add variables for OPTEE platform and `make` arguments in all k3
      board configs
    * use the compiled binary as TEE to compile U-Boot

Signed-off-by: Suhaas Joshi <s-joshi@ti.com>
ATF is currently built in Debug mode for K3 family of devices. This is
due to the fact that K3 Armbian images have been experimental so far.

However, there is work underway to make Armbian a production-capable
environment. Therefore, drop the DEBUG=1 flag from the ATF build
command.

Signed-off-by: Suhaas Joshi <s-joshi@ti.com>
On v2025.01 and v2025.04 I get the following error

starting USB...
Bus usb@ff500000: dwc3_meson_gxl_get_phys: usb2 ports: 1
probe failed, error -114
No USB controllers found

So revert back to v2024.10 until sorted.

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
The-going and others added 20 commits June 11, 2025 19:40
Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>
* correct system patch used for aliasing on Allwinner A10, A13 and A20 to ensure consistent allocation of device IDs

* Re-introduce spi overlays for each bus so that when used in conjuction with a device driver overlay, the pins are correctly muxed into SPI mode

* Ensure SPI overlay patches are applied

* Fix typo in patch name

* Move alias patches further down series.conf to ensure they are only called after the intial overlay creation

* Rephrase subject heading to improve clarity

* Fix interface aliases on Allwinner A10 for I2C, SPI and UART

* Fix interface aliases on Allwinner A13 for I2C and UART

* Fix interface aliases on Allwinner A20 for I2C, SPI and UART

* Fix SPI 2 pin names in line with latest revision of the Allwinner A10 device tree

* Fix SPI 2 pin names in line with latest revision of the Allwinner A20 device tree

* Create overlays for each bus on the Allwinner A20 so that the corresponding pins can be set into spi mode

* Create overlays for each bus on the Allwinner A10 so that the corresponding pins can be set into spi mode

* Condense alias path corrections into the intial overlay creation patch instead of applying a further patch on topof it to enact these corrections

* Remove references to our no longer needed addtional overlays

* rename to include 'arm-dts..' for consistency with other dts related patches

* Fix mistake in SPI overlay patches naming which leads to build failure

* Fix typo in application of spi2 overlay that was leading to compilation failure

* Amend the assigned aliases in overlay creation so that the kernel correctly maps the bus/port number to match the physical hardware numbering

* Update pin labels for SPI 2 to use current names as defined in sun4i-a10.dtsi and sun7i-a20.dtsi. fixed typo in sun5i-a13-spi-spidev as compatibility field should be sun5i-a13

* Re-introduce compilation of spi bus overlays on Allwinner A10 and A20 SOCs which are necessary to ensure that the pins are correctly muxed into spi mode
imb3588 board info link:
https://www.sunshine-tek.com/productinfo/1989232.html

Signed-off-by: Jack Huang <jackhuang021@gmail.com>
Signed-off-by: Jack Huang <jackhuang021@gmail.com>
Signed-off-by: Jack Huang <jackhuang021@gmail.com>
imb3588 dts has been added to linux-rockchip repo

Signed-off-by: Jack Huang <jackhuang021@gmail.com>
* always use http for apt repos

* pass possible proxy arguments to docker

* populate lower-case env variables with upper-case ones if not set otherwise
…nts and move to supported (armbian#8295)

Enables kernel options that are important for making armbian viable for use on PocketBeagle 2.

Can now run all examples present in the beagle examples repo: https://github.com/beagleboard/vsx-examples

Signed-off-by: Ayush Singh <ayush@beagleboard.org> Andrei Aldea <andrei@beagleboard.org>
* AE for cloud, add description for vendor

* fixes
The LTS variant has an HDMI port.

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Change from "y" to "m"

Before
[    2.423992] rtc-hym8563 1-0051: no valid clock/calendar values available
[    2.424718] rtc-hym8563 1-0051: registered as rtc0
[    2.425770] rtc-hym8563 1-0051: no valid clock/calendar values available
[    2.425789] rtc-hym8563 1-0051: hctosys: unable to read the hardware clock
[    3.817166] rk808-rtc rk808-rtc.5.auto: registered as rtc1

After
[    3.790107] rk808-rtc rk808-rtc.5.auto: registered as rtc0
[    3.801742] rk808-rtc rk808-rtc.5.auto: setting system clock to 2017-08-05T09:48:13 UTC (1501926493)
[    3.919628] rtc-hym8563 1-0051: registered as rtc1

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@The-going
Copy link
Contributor

The-going commented Jun 16, 2025

I apologize. I will not take part in this development.

@github-actions github-actions bot added size/large PR with 250 lines or more Desktop Graphical user interface Needs review Seeking for review GitHub Actions GitHub Actions code Patches Patches related to kernel, U-Boot, ... Documentation Documentation changes or additions BSP Board Support Packages GitHub GitHub-related changes like labels, templates, ... and removed size/medium PR with more then 50 and less then 250 lines labels Jun 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
05 Milestone: Second quarter release BSP Board Support Packages Desktop Graphical user interface Documentation Documentation changes or additions Framework Framework components GitHub Actions GitHub Actions code GitHub GitHub-related changes like labels, templates, ... Help needed We need your involvement Needs review Seeking for review Patches Patches related to kernel, U-Boot, ... size/large PR with 250 lines or more Work in progress Unfinished / work in progress
Development

Successfully merging this pull request may close these issues.