8000 generalize rcar_s4 bundle by michalskrivanek · Pull Request #534 · jumpstarter-dev/jumpstarter-python · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

generalize rcar_s4 bundle#534

Merged
mangelajo merged 1 commit intojumpstarter-dev:mainfrom
michalskrivanek:s4_eth0
Jun 25, 2025
Merged

generalize rcar_s4 bundle#534
mangelajo merged 1 commit intojumpstarter-dev:mainfrom
michalskrivanek:s4_eth0

Conversation

@michalskrivanek
Copy link
Contributor
@michalskrivanek michalskrivanek commented Jun 25, 2025

it still supports Renesas S4 only, but it now renames the default interface to eth0 so that the same bundle cn be reused with other kernel-automotive supported boards
Also updated buildroot and kernel-automotive to latest.

Summary by CodeRabbit

  • New Features

    • Added a rule to automatically rename the "tsn0" network interface to "eth0" for consistent network interface naming.
  • Updates

    • Updated the kernel version used in the system.
    • Changed the default Buildroot configuration and build process to use a new configuration targeting root filesystem only.
    • Updated system configuration to use "eth0" as the default DHCP interface instead of "tsn0".

@netlify
Copy link
netlify bot commented Jun 25, 2025

Deploy Preview for jumpstarter-docs ready!

Name Link
🔨 Latest commit 9515dfb
🔍 Latest deploy log https://app.netlify.com/projects/jumpstarter-docs/deploys/685bc1453733370008ac429e
😎 Deploy Preview https://deploy-preview-534--jumpstarter-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor
coderabbitai bot commented Jun 25, 2025

Walkthrough

The changes update the Buildroot branch and configuration for the Renesas S4 flasher build, switch from the add_kernel.sh to replace_kernel.sh script, and update the kernel version. Additionally, a udev rule is added to rename the network interface from "tsn0" to "eth0", and configuration files are adjusted to reflect this change.

Changes

File(s) Change Summary
.../rcar_s4/build_flasher.sh, .../rcar_s4/replace_kernel.sh Updated Buildroot branch, switched kernel script, updated kernel version, changed config target.
.../rcar_s4/rootfs_only_defconfig Changed DHCP interface from "tsn0" to "eth0".
.../rcar_s4/overlay/etc/udev/rules.d/10-rename-tsn0.rules Added udev rule to rename "tsn0" interface to "eth0".

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant build_flasher.sh
    participant Buildroot
    participant replace_kernel.sh
    participant udev

    User->>build_flasher.sh: Run build script
    build_flasher.sh->>Buildroot: Clone repo (branch 2025.05), apply rootfs_only_defconfig
    build_flasher.sh->>replace_kernel.sh: Replace kernel (version 5.14.0-594.543.el9iv.aarch64)
    Buildroot->>udev: Install udev rule (rename tsn0 to eth0)
    udev->>System: On tsn0 detected, rename to eth0
Loading

Possibly related PRs

  • jumpstarter-dev/jumpstarter#507: Introduces the add_kernel.sh script, which is now replaced by replace_kernel.sh in the current PR.

Suggested reviewers

  • mangelajo

Poem

A kernel hops to version new,
Buildroot’s branch gets a freshened hue.
“tsn0” now wears “eth0”’s coat,
Thanks to a rule, it gets my vote!
Scripts replaced, configs aligned—
Another leap for S4, well-designed!
🐰✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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 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.

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: 0

🧹 Nitpick comments (3)
packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/replace_kernel.sh (1)

3-3: Kernel version hard-coded again – make future bumps cheaper

Good to see the bump to 5.14.0-594.543. Re-touching the script for every minor bump is easy to forget; consider accepting a KVER env-var override or parsing the latest tag from Koji instead, e.g.:

-KVER="5.14.0-594.543.el9iv.aarch64"
+KVER="${KVER:-5.14.0-594.5
6880
43.el9iv.aarch64}"

That keeps the default while allowing KVER=… ./replace_kernel.sh on demand.

packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/overlay/etc/udev/rules.d/10-rename-tsn0.rules (1)

1-2: Rule works, but guard against name collision

NAME="eth0" will fail silently if an eth0 already exists (e.g. USB NIC).
To keep the rule harmless on boards that already expose eth0, prepend , NAME!="eth0":

-SUBSYSTEM=="net", ACTION=="add", KERNEL=="tsn0", NAME="eth0"
+SUBSYSTEM=="net", ACTION=="add", KERNEL=="tsn0", NAME!="eth0", NAME="eth0"

Also double-check that udev is built with net_ifnames=0 or predictable-names disabled; otherwise the kernel might emit enP… and this rule won’t match.

packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/build_flasher.sh (1)

5-10: Minor robustness & speed enhancements to the build script

Consider the following quick wins:

-#!/bin/bash
+#!/usr/bin/env bash
+set -euo pipefail     # abort on any failure

-git clone --depth 1 --branch 2025.05  https://github.com/buildroot/buildroot /buildroot
+git clone --depth 1 --branch 2025.05 https://github.com/buildroot/buildroot /buildroot

-( cd /buildroot; make rootfs_only_defconfig && make )
+( cd /buildroot || exit 1; \
+    make rootfs_only_defconfig && \
+    make -j"$(nproc)" )

set -euo pipefail catches silent errors (shellcheck SC2164 flagged the cd).
-j$(nproc) reduces build time dramatically.
• Using /usr/bin/env bash improves portability across distros.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5b3d266 and 5f2b978.

📒 Files selected for processing (4)
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/build_flasher.sh (1 hunks)
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/overlay/etc/udev/rules.d/10-rename-tsn0.rules (1 hunks)
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/replace_kernel.sh (1 hunks)
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/rootfs_only_defconfig (1 hunks)
🧰 Additional context used
🪛 Shellcheck (0.10.0)
packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/build_flasher.sh

[warning] 10-10: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: Redirect rules - jumpstarter-docs
  • GitHub Check: Header rules - jumpstarter-docs
  • GitHub Check: Pages changed - jumpstarter-docs
  • GitHub Check: pytest-matrix (macos-15, 3.11)
  • GitHub Check: pytest-matrix (macos-15, 3.12)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.12)
  • GitHub Check: pytest-matrix (macos-15, 3.13)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.13)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.11)
  • GitHub Check: build
  • GitHub Check: e2e
🔇 Additional comments (1)
packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/rootfs_only_defconfig (1)

7-7: DHCP interface rename may race with udev rule – verify boot timing

BR2_SYSTEM_DHCP="eth0" assumes the rename from tsn0 → eth0 has already completed when udhcpc starts. If udhcpc is launched before udev processes 10-rename-tsn0.rules, DHCP will fail and networking never comes up.

Please test a cold-boot scenario on the S4 board (and any other boards that keep the original eth0) to confirm:

  1. ifconfig -a shows eth0 only (no lingering tsn0).
  2. DHCP lease is obtained automatically.

If the race is observable, consider:

  • Adding udevsettle/udevadm settle in your init scripts before networking.
  • Leaving BR2_SYSTEM_DHCP empty and starting udhcpc from an init-script that waits for the renamed interface.

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: 2

🧹 Nitpick comments (1)
packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/build_flasher.sh (1)

5-5: Parameterise the Buildroot branch instead of hard-coding it

Hard-coding 2025.05 makes forward/back-porting harder. Export the branch name as an env variable (or accept it as an argument) so CI can bump it centrally.

-BRANCH=2025.05
-git clone --depth 1 --branch $BRANCH https://github.com/buildroot/buildroot /buildroot
+BRANCH="${BUILDROOT_BRANCH:-2025.05}"
+git clone --depth 1 --branch "${BRANCH}" https://github.com/buildroot/buildroot /buildroot
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5f2b978 and fe2e10a.

📒 Files selected for processing (4)
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/build_flasher.sh (1 hunks)
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/overlay/etc/udev/rules.d/10-rename-tsn0.rules (1 hunks)
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/replace_kernel.sh (1 hunks)
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/rootfs_only_defconfig (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/overlay/etc/udev/rules.d/10-rename-tsn0.rules
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/replace_kernel.sh
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/rootfs_only_defconfig
🧰 Additional context used
🪛 Shellcheck (0.10.0)
packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/build_flasher.sh

[warning] 10-10: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: Redirect rules - jumpstarter-docs
  • GitHub Check: Header rules - jumpstarter-docs
  • GitHub Check: Pages changed - jumpstarter-docs
  • GitHub Check: e2e
  • GitHub Check: build
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.12)
  • GitHub Check: pytest-matrix (macos-15, 3.13)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.11)
  • GitHub Check: pytest-matrix (macos-15, 3.12)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.13)

cp renesas_s4_defconfig /buildroot/configs/
( cd /buildroot; make renesas_s4_defconfig && make )
cp rootfs_only_defconfig /buildroot/configs/
( cd /buildroot; make rootfs_only_defconfig && make )
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

Address ShellCheck SC2164: check cd success

If /buildroot does not exist the subshell keeps going and hides the error. Guard the cd, or use pushd/popd, and split the two make invocations for better debuggability.

-( cd /buildroot; make rootfs_only_defconfig && make )
+(
+  cd /buildroot || { echo "ERROR: /buildroot not found"; exit 1; }
+  make rootfs_only_defconfig
+  make                      # consider: make -j"$(nproc)" for speed
+)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
( cd /buildroot; make rootfs_only_defconfig && make )
(
cd /buildroot || { echo "ERROR: /buildroot not found"; exit 1; }
make rootfs_only_defconfig
make # consider: make -j"$(nproc)" for speed
)
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 10-10: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

🤖 Prompt for AI Agents
In packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/build_flasher.sh at
line 10, the subshell changes directory to /buildroot without checking if the cd
command succeeds, which can hide errors if /buildroot does not exist. Modify the
script to verify the cd command's success before running the make commands, or
replace cd with pushd/popd for safer directory changes. Also, split the combined
make commands into separate lines to improve error visibility and debugging.

git clone --depth 1 --branch 2025.05 https://github.com/buildroot/buildroot /buildroot

./add_kernel.sh
./replace_kernel.sh
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

Harden the script and fail fast around replace_kernel.sh

./replace_kernel.sh is executed with no safety net—if it exits non-zero the build continues and produces a broken image.
Add set -euo pipefail to the top of the script (just after the she-bang) and ensure replace_kernel.sh is executable before calling it.

 #!/bin/bash
+set -euo pipefail
+
+if [[ ! -x ./replace_kernel.sh ]]; then
+  echo "replace_kernel.sh is missing or not executable"; exit 1
+fi
 ./replace_kernel.sh
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
./replace_kernel.sh
#!/bin/bash
set -euo pipefail
if [[ ! -x ./replace_kernel.sh ]]; then
echo "replace_kernel.sh is missing or not executable"
exit 1
fi
./replace_kernel.sh
🤖 Prompt for AI Agents
In packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/build_flasher.sh at
line 7, the script runs ./replace_kernel.sh without error handling, allowing
failures to pass silently. Add "set -euo pipefail" immediately after the shebang
line to enable strict error checking and fail fast on errors. Also, before
executing replace_kernel.sh, add a check to ensure it is executable, and if not,
set the executable permission to prevent permission errors.

it still supports Renesas S4 only, but it now renames the default
interface to eth0 so that the same bundle can be reused with other
kernel-automotive supported boards.
Also updated buildroot and kernel-automotive to latest.
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: 1

♻️ Duplicate comments (3)
packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/build_flasher.sh (3)

1-2: Add set -euo pipefail for safer scripting (still missing).
The script still runs without strict-mode; silent failures will propagate. See the previous review – please add the guard immediately after the she-bang.


7-7: replace_kernel.sh still executed without checks.
Previous feedback about ensur 10BC0 ing executability and checking the exit status hasn’t been addressed. Add explicit checks or enable strict-mode.


10-10: Still vulnerable to SC2164 & hidden make failures.
The subshell ignores a failed cd, and combining the two make calls masks which one fails. Please split and guard, as previously suggested.

🧹 Nitpick comments (1)
packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/build_flasher.sh (1)

3-3: Package list keeps growing — move it to a variable or install file.
Long, in-line dnf install … lists are error-prone and hard to diff (e.g., today only awk was added). Consider:

DEPS=(
  git make gcc gcc-c++ which file diffutils wget cpio rsync bc lzop zip
  patch perl tar qemu-system-aarch64 qemu-img unzboot uboot-tools kmod awk
)
dnf install --setopt=install_weak_deps=false -y "${DEPS[@]}"

This improves readability and future maintenance.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fe2e10a and 9515dfb.

📒 Files selected for processing (4)
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/build_flasher.sh (1 hunks)
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/overlay/etc/udev/rules.d/10-rename-tsn0.rules (1 hunks)
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/replace_kernel.sh (1 hunks)
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/rootfs_only_defconfig (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/rootfs_only_defconfig
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/replace_kernel.sh
  • packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/overlay/etc/udev/rules.d/10-rename-tsn0.rules
🧰 Additional context used
🪛 Shellcheck (0.10.0)
packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/build_flasher.sh

[warning] 10-10: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Redirect rules - jumpstarter-docs
  • GitHub Check: Header rules - jumpstarter-docs
  • GitHub Check: build
  • GitHub Check: e2e
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.13)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.12)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.11)
  • GitHub Check: pytest-matrix (macos-15, 3.13)
  • GitHub Check: Pages changed - jumpstarter-docs

dnf install --setopt=install_weak_deps=false -y git make gcc gcc-c++ which file diffutils wget cpio rsync bc lzop zip patch perl tar qemu-system-aarch64 qemu-img unzboot uboot-tools kmod awk

git clone --depth 1 --branch 2025.05-rc2 https://github.com/buildroot/buildroot /buildroot
git clone --depth 1 --branch 2025.05 https://github.com/buildroot/buildroot /buildroot
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

Pin Buildroot to a tag/commit for reproducible builds.
Cloning the moving 2025.05 branch with --depth 1 risks non-deterministic results when the branch head moves. Prefer a fixed tag or commit SHA and document it.

🤖 Prompt for AI Agents
In packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/build_flasher.sh at
line 5, the git clone command uses a moving branch reference '2025.05' which can
cause non-reproducible builds. Replace the branch name with a specific tag or
commit SHA to pin the Buildroot version. Update the clone command to use this
fixed reference and add a comment explaining the choice for reproducibility.

@michalskrivanek
Copy link
Contributor Author

it works!

...
Running sysctl: OK
Populating /dev using udev: [    1.255784] udevd[287]: starting version 3.2.14
[    8.899844] random: crng init done
[    8.909282] udevd[288]: starting eudev-3.2.14
[    9.040182] renesas_eth_sw e6880000.ethernet eth0: renamed from tsn0
done
Starting network: Waiting for interface eth0 carrier.[   11.360599] platform ufs30-clk: deferred probe pending
..................[   29.120452] renesas_eth_sw e6880000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
.
udhcpc: started, v1.37.0
...

@mangelajo mangelajo merged commit 629e3e1 into jumpstarter-dev:main Jun 25, 2025
18 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0