Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

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


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

cp -R overlay /buildroot
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
Copy Markdown
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.

mkimage -f flasher.its data/flasher.itb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# rename Renesas S4 main interface tsn0 to eth0 to unify setup
SUBSYSTEM=="net", ACTION=="add", KERNEL=="tsn0", NAME="eth0"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

KVER="5.14.0-587.536.el9iv.aarch64"
KVER="5.14.0-594.543.el9iv.aarch64"
KMOD=(
# R-Car S4 storage
fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ BR2_TARGET_GENERIC_HOSTNAME="flasher"
BR2_TARGET_GENERIC_ISSUE="flasher"
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_TARGET_GENERIC_ROOT_PASSWD=""
BR2_SYSTEM_DHCP="tsn0"
BR2_SYSTEM_DHCP="eth0"
BR2_ROOTFS_OVERLAY="$(CONFIG_DIR)/overlay"
BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_OPENSSL=y
Expand Down
Loading