Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
Closed
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
@@ -0,0 +1,11 @@
#!/bin/bash

Comment thread
michalskrivanek marked this conversation as 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 awk
Comment thread
michalskrivanek marked this conversation as resolved.

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

#./replace_kernel.sh
cp -R overlay /buildroot
cp kernel_and_rootfs_defconfig /buildroot/configs/
( cd /buildroot; make kernel_and_rootfs_defconfig && make )
mkimage -f flasher.its data/flasher.itb
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

Ensure output directory exists before running mkimage
mkimage -f flasher.its data/flasher.itb will fail if data/ is absent. Guard against this:

mkdir -p data
mkimage -f flasher.its data/flasher.itb
🤖 Prompt for AI Agents
In
packages/jumpstarter-driver-flashers/oci_bundles/ti_j784s4xevm/build_flasher.sh
at line 11, the command mkimage writes to data/flasher.itb but will fail if the
data directory does not exist. Fix this by adding mkdir -p data before the
mkimage command to ensure the output directory exists.

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/dts-v1/;

/ {
description = "TI flasher FIT Image";
#address-cells = <1>;

images {
kernel {
description = "Kernel";
data = /incbin/("/buildroot/output/images/Image");
type = "kernel";
arch = "arm64";
os = "linux";
compression = "none";
load = <0x80000000>;
entry = <0x80000000>;
hash {
algo = "sha256";
};
};
initrd {
description = "Initrd";
data = /incbin/("/buildroot/output/images/rootfs.cpio.lzo");
type = "ramdisk";
arch = "arm64";
os = "linux";
compression = "none";
hash {
algo = "sha256";
};
};
fdt-j784s4 {
description = "DTB J784S4EVM";
data = /incbin/("/buildroot/output/images/k3-j784s4-evm.dtb");
type = "flat_dt";
arch = "arm64";
compression = "none";
load = <0x88000000>;
hash {
algo = "sha256";
};
};
fdt-am69 {
description = "DTB SK-AM69";
data = /incbin/("/buildroot/output/images/k3-am69-sk.dtb");
type = "flat_dt";
arch = "arm64";
compression = "none";
load = <0x88000000>;
hash {
algo = "sha256";
};
};
};

configurations {
default = "j784s4";
j784s4 {
description = "Boot J784S4";
kernel = "kernel";
fdt = "fdt-j784s4";
ramdisk = "initrd";
hash {
algo = "sha256";
};
};
am69 {
description = "Boot AM69";
kernel = "kernel";
fdt = "fdt-am69";
ramdisk = "initrd";
hash {
algo = "sha256";
};
};
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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="eth0"
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
#
# include initramfs within the kernel Image
# on J784S4 the size exceeds uboot's CONFIG_SYS_BOOTM_LEN
# BR2_TARGET_ROOTFS_INITRAMFS=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
BR2_LINUX_KERNEL_LZO=y
BR2_LINUX_KERNEL_IMAGE=y
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="ti/k3-j784s4-evm ti/k3-am69-sk"

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ metadata:
spec:
manufacturer: Texas Instruments
link: "https://www.ti.com/tool/PROCESSOR-SDK-J784S4"
bootcmd: "booti 0x82000000 - 0x84000000"
# boot using the default configuration built-in flasher.itb, j784s4
# you can boot included alternative configurations, e.g. for SK-AM69 use "bootm 0x90000000#am69"
bootcmd: "bootm 0x90000000"
shelltype: "busybox"
login:
login_prompt: "login:"
Expand All @@ -24,11 +26,12 @@ spec:
# preflash_commands:
# - "dd if=/dev/zero of=/dev/mmcblk0 bs=512 count=34"
# - "dd if=/dev/zero of=/dev/mmcblk1 bs=512 count=34"
#
# supply custom DTB by loading your own re-using the included kernel and initrd by e.g:
# bootcmd: "bootm 0x90000000:kernel 0x90000000:initrd 0x88000000"
# dtb:
# file: my.dtb
# address: "0x88000000"
kernel:
file: data/J784S4XEVM.flasher.img
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

https://github.com/jumpstarter-dev/jumpstarter/actions/runs/15352215504/job/43202958209?pr=510#step:8:400

Ok, so there is a problem with itb images.

We stop declaring the dtb section, which tells the flasher what the expected address is,
also I suspect that the current code does not support dtb to be empty.

The reason why we at least want that info and a separate dtb, is that we want to let customers switch the DTB
in realtime, for example, when they have a derivative of the board that they have evolved into product.

i.e. j flasher flash image.raw --dtb my-dtb.dtb

The flasher needs to know the address where to put the dtb provided by customer in that case.
Also we may want to let customers derive the OCI images and put their dtb in they want.

Can we provide an image with just the kernel + initrd , and then two separate .dtbs, one for
J784S4EVM and another for SK-AM69?

The other option is that we rewire the reflasher to fully understand fit, but it would still miss the ability to change the bundled dtb, kernel or ramdisk in "realtime".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

empty dtb has been added by jumpstarter-dev/jumpstarter@f44dfec

I think it is quite flexible this way, the bundling allows us to "ship" dtbs that we anyway ship in kernel-automotive, but it also allows anything else to be loaded. each FIT component is extractable by imxtract and swapped with anything else

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No file dtb could be ok, but, if we want to let customers pushing a custom dtb, we will need the loading address at least.

With FIT is it possible to know where the .dtb address will land?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah I see, yes 0x88000000 in this case.

Can we keep the dtb structure, with just the address? we may need to verify that the client/driver are fine with empty file, just address.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added example of custom dtb

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it may work with am69 as well, supposedly it should try to load a compatible configuration. I havent' tried that. If it doesn't work the only change is to boot the right config with bootm 0x90000000#am69 or to supply another DTB externally

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

>           v = cls.model_validate(yaml.safe_load(f))
E           pydantic_core._pydantic_core.ValidationError: 1 validation error for FlasherBundleManifestV1Alpha1
E           spec.dtb
E             Field required [type=missing, input_value={'manufacturer': 'Texas I...address': '0x90000000'}}, input_type=dict]
E               For further information visit https://errors.pydantic.dev/2.11/v/missing

It's failing the unit tests there because it's looking for the .dtb field,

I will propose some changes on top to make it compatible with embedded dtb, and also allow dtb injection in runtime (note this is not supported yet on the CLI, only planned and the drivers have a notion about it..)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add for now the dtb section of the yaml with the two variants for now? (just add a comment saying that it's redundant)

I know it's redundant with the embedded itb?, but I would like to merge it now, and then later on we can add to the code the ability to understand embedded itb dtbs, externally provided, in the yaml, etc.. to make it flexible.

But currently the code will fail if the dtb section is missing, and if we don't add it the later injection won't be possible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't see a test failure. did benny fix that in his rcars4 mr?

address: "0x82000000"
dtb:
default: k3-j784s4-evm
address: "0x84000000"
variants:
k3-j784s4-evm: data/dtbs/k3-j784s4-evm.dtb
file: data/flasher.itb
address: "0x90000000"
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

IF_WAIT_DELAY=30

Comment thread
michalskrivanek marked this conversation as resolved.
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