This repository was archived by the owner on Jan 23, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
use FIT image for rcar_s4 flasher #507
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/add_kernel.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,72 @@ | ||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||
|
|
||||||||||||||||||
| KVER="5.14.0-587.536.el9iv.aarch64" | ||||||||||||||||||
| KMOD=( | ||||||||||||||||||
| # R-Car S4 storage | ||||||||||||||||||
| fixed | ||||||||||||||||||
| renesas_sdhi_internal_dmac | ||||||||||||||||||
| mmc_block | ||||||||||||||||||
| # R-Car S4 networking | ||||||||||||||||||
| gpio-rcar | ||||||||||||||||||
| r8a779f0-ether-serdes | ||||||||||||||||||
| marvell10g | ||||||||||||||||||
| rswitch | ||||||||||||||||||
| ) | ||||||||||||||||||
| ODIR="overlay" | ||||||||||||||||||
|
|
||||||||||||||||||
| cd "$(dirname "$(readlink -f "$0")")" | ||||||||||||||||||
| BASE=$PWD | ||||||||||||||||||
michalskrivanek marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
|
|
||||||||||||||||||
mangelajo marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
| url="https://cbs.centos.org/kojifiles/packages/kernel-automotive" | ||||||||||||||||||
| url="$url/$(echo $KVER | sed -r 's|-|/|; s|\.([^.]*)$|/\1|')" | ||||||||||||||||||
| pkgs=( | ||||||||||||||||||
| kernel-automotive-core-$KVER.rpm | ||||||||||||||||||
| kernel-automotive-modules-$KVER.rpm | ||||||||||||||||||
| kernel-automotive-modules-core-$KVER.rpm | ||||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
| mkdir -p kernel | ||||||||||||||||||
| cd kernel | ||||||||||||||||||
|
|
||||||||||||||||||
| # fetch kernel rpm packages | ||||||||||||||||||
| for pkg in ${pkgs[@]}; do | ||||||||||||||||||
| [[ -f $pkg ]] || wget "$url/$pkg" || exit 1 | ||||||||||||||||||
| done | ||||||||||||||||||
michalskrivanek marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
|
|
||||||||||||||||||
| # extract kernel rpm packages | ||||||||||||||||||
| if ! [[ -d lib ]]; then | ||||||||||||||||||
| for pkg in ${pkgs[@]}; do | ||||||||||||||||||
| echo -n "extracting $pkg ... " | ||||||||||||||||||
| rpm2cpio $pkg | cpio -id | ||||||||||||||||||
| done | ||||||||||||||||||
|
Comment on lines
+38
to
+41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Quote array expansions in the extraction loop -for pkg in ${pkgs[@]}; do
+for pkg in "${pkgs[@]}"; do
echo -n "extracting $pkg ... "
rpm2cpio "$pkg" | cpio -id
done📝 Committable suggestion
Suggested change
🧰 Tools🪛 Shellcheck (0.10.0)[error] 38-38: Double quote array expansions to avoid re-splitting elements. (SC2068) 🤖 Prompt for AI Agents |
||||||||||||||||||
| echo "extracting kernel ..." | ||||||||||||||||||
| unzboot lib/modules/$KVER/vmlinuz vmlinuz | ||||||||||||||||||
| ln -sfn lib/modules/$KVER/dtb dtb | ||||||||||||||||||
| echo "updating module deps ..." | ||||||||||||||||||
| depmod --errsyms --filesyms lib/modules/$KVER/System.map --basedir $PWD $KVER | ||||||||||||||||||
| echo "building required modules list ..." | ||||||||||||||||||
| for mod in ${KMOD[@]}; do | ||||||||||||||||||
| modprobe -d $PWD -S $KVER --show-depends $mod | ||||||||||||||||||
| done | sed "s|$PWD||; s|^builtin|# builtin|; s|\\.ko\\.zst|.ko|" > modlist | ||||||||||||||||||
michalskrivanek marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| cd $OLDPWD | ||||||||||||||||||
|
|
||||||||||||||||||
| mkdir -p $ODIR/lib/modules $ODIR/etc/init.d || exit 1 | ||||||||||||||||||
| echo "installing modules into overlay dir ..." | ||||||||||||||||||
| sed -nr 's|^insmod ||p' < kernel/modlist | while read mod; do | ||||||||||||||||||
| mkdir -p "$ODIR$(dirname $mod)" | ||||||||||||||||||
| zstd -d "kernel$mod.zst" -o "$ODIR$mod" | ||||||||||||||||||
| done | ||||||||||||||||||
|
|
||||||||||||||||||
| echo "adding modules start-up script to overlay ..." | ||||||||||||||||||
| script=$ODIR/etc/init.d/S01modules | ||||||||||||||||||
| cat >$script <<EOF | ||||||||||||||||||
| #!/bin/sh | ||||||||||||||||||
|
|
||||||||||||||||||
| if [ "\$1" = "start" ]; then | ||||||||||||||||||
| $(cat kernel/modlist) | ||||||||||||||||||
| fi | ||||||||||||||||||
| EOF | ||||||||||||||||||
| chmod +x $script | ||||||||||||||||||
|
|
||||||||||||||||||
11 changes: 11 additions & 0 deletions
11
packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/build_flasher.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #!/bin/bash | ||
|
|
||
michalskrivanek marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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 | ||
|
|
||
| git clone --depth 1 --branch 2025.05-rc2 https://github.com/buildroot/buildroot /buildroot | ||
|
|
||
| ./add_kernel.sh | ||
| cp -R overlay /buildroot | ||
| cp renesas_s4_defconfig /buildroot/configs/ | ||
| ( cd /buildroot; make renesas_s4_defconfig && make ) | ||
| mkimage -f flasher.its data/flasher.itb | ||
3 changes: 0 additions & 3 deletions
3
packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/data/flasher.itb
This file was deleted.
Oops, something went wrong.
78 changes: 78 additions & 0 deletions
78
packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/flasher.its
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| /dts-v1/; | ||
|
|
||
| / { | ||
| description = "R-Car S4 flasher FIT Image"; | ||
| #address-cells = <1>; | ||
|
|
||
| images { | ||
| kernel { | ||
| description = "Kernel"; | ||
| data = /incbin/("kernel/vmlinuz"); | ||
| type = "kernel"; | ||
| arch = "arm64"; | ||
| os = "linux"; | ||
| compression = "none"; | ||
| load = <0x48080000>; | ||
| entry = <0x48080000>; | ||
| hash { | ||
| algo = "sha256"; | ||
| }; | ||
| }; | ||
| fdt-spider { | ||
| description = "DTB 8779f0-spider"; | ||
| data = /incbin/("kernel/dtb/renesas/r8a779f0-spider.dtb"); | ||
| type = "flat_dt"; | ||
| arch = "arm64"; | ||
| compression = "none"; | ||
| load = <0x48000000>; | ||
| entry = <0x48000000>; | ||
| hash { | ||
| algo = "sha256"; | ||
| }; | ||
| }; | ||
| fdt-s4sk { | ||
| description = "DTB r8a779f4-s4sk"; | ||
| data = /incbin/("kernel/dtb/renesas/r8a779f4-s4sk.dtb"); | ||
| type = "flat_dt"; | ||
| arch = "arm64"; | ||
| compression = "none"; | ||
| load = <0x48000000>; | ||
| entry = <0x48000000>; | ||
| hash { | ||
| algo = "sha256"; | ||
| }; | ||
| }; | ||
| initrd { | ||
| description = "Initrd"; | ||
| data = /incbin/("/buildroot/output/images/rootfs.cpio.lzo"); | ||
| type = "ramdisk"; | ||
| arch = "arm64"; | ||
| os = "linux"; | ||
| hash { | ||
| algo = "sha256"; | ||
| }; | ||
| }; | ||
| }; | ||
|
|
||
| configurations { | ||
| default = "spider"; | ||
| spider { | ||
| description = "Boot R-Car S4 Spider"; | ||
| kernel = "kernel"; | ||
| fdt = "fdt-spider"; | ||
| ramdisk = "initrd"; | ||
| hash { | ||
| algo = "sha256"; | ||
| }; | ||
| }; | ||
| s4sk { | ||
| description = "Boot R-Car S4 SK"; | ||
| kernel = "kernel"; | ||
| fdt = "fdt-s4sk"; | ||
| ramdisk = "initrd"; | ||
| hash { | ||
| algo = "sha256"; | ||
| }; | ||
| }; | ||
| }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...arter-driver-flashers/oci_bundles/rcar_s4/overlay/etc/network/if-pre-up.d/wait-carrier.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/bin/sh | ||
|
|
||
| IF_WAIT_DELAY=30 | ||
|
|
||
| if [ "${IFACE}" != "lo" ]; then | ||
| ip link set ${IFACE} up | ||
| printf "Waiting for interface %s carrier" "${IFACE}" | ||
| while [ ${IF_WAIT_DELAY} -gt 0 ]; do | ||
| if [ "$(cat /sys/class/net/${IFACE}/carrier)" = "1" ]; then | ||
| printf "\n" | ||
| exit 0 | ||
| fi | ||
| sleep 1 | ||
| printf "." | ||
| : $((IF_WAIT_DELAY -= 1)) | ||
| done | ||
| printf " timeout!\n" | ||
| exit 1 | ||
| fi |
19 changes: 19 additions & 0 deletions
19
packages/jumpstarter-driver-flashers/oci_bundles/rcar_s4/renesas_s4_defconfig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| BR2_aarch64=y | ||
| BR2_TOOLCHAIN_EXTERNAL=y | ||
| 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_ROOTFS_OVERLAY="$(CONFIG_DIR)/overlay" | ||
| BR2_PACKAGE_CA_CERTIFICATES=y | ||
| BR2_PACKAGE_OPENSSL=y | ||
| BR2_PACKAGE_LIBCURL=y | ||
| BR2_PACKAGE_LIBCURL_CURL=y | ||
| BR2_PACKAGE_NTP=y | ||
| BR2_PACKAGE_NTP_SNTP=y | ||
| BR2_PACKAGE_NTP_NTPDATE=y | ||
| BR2_TARGET_ROOTFS_CPIO=y | ||
| BR2_TARGET_ROOTFS_CPIO_LZO=y | ||
| BR2_PACKAGE_DROPBEAR=n | ||
| # BR2_TARGET_ROOTFS_TAR is not set |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.