Adding a profile to imagebuilder?

Hi,

I am trying to make a build for the Wink Hub v1, which is imx.28-based, like the duckbill et al. Rather than building everything from scratch, I thought I would try update the imagebuilder to build the images appropriately for the Wink 1, with a chosen device tree, etc. I created an 04-wink-hub-1.mk as a copy of 01-duckbill.mk in target/linux/mxs/profiles/, but cannot get e.g. make .profiles.mk to include it. Clearly I am missing where scripts/target-metadata.pl is pulling the data from, but my Perl is VERY rusty.

Can anyone point me in the right direction? Thanks!

I figured out that it needs to go into .targetinfo, so I added a stanza like:

Target-Profile: wink1
Target-Profile-Name: Wink Hub v1
Target-Profile-Packages:   -dnsmasq -firewall -ppp -ip6tables -iptables -6relayd uboot-envtools kmod-leds-gpio -kmon-ipt-nathelper
Target-Profile-Description:
        Wink Hub v1

modeled on the duckbill.

I also modified target/linux/mxs/image/Makefile, adding imx28-wink1 to BOARDS, and I get all the way to creating the uImage, where it dies trying to find imx28-wink1.dts. The Wink 1 is apparently based on the imx28-evk, so I plan to copy the imx28-evk.dts and modify to suit. Since the .dts has already been compiled to .dtb in the ImageBuilder download, I'm happy for that to be a manual step before invoking make.

I then added a stanza for wink1 to target/linux/mxs/image/Makefile:

define Image/Build/Profile/wink1
        $(call Image/Build/SDCard-ext4-ext4,$(1),$(2),imx28-wink1,wink1)
endef

And this is where I think I am stuck. Due to the REALLY old u-boot installed on the Wink Hub 1, I need to create a uImage that has the dtb appended to the kernel zImage. I'd also like to create a ubifs filesystem instead of an SDCard image, since that is what is already in place. I guess I could always reformat, and tar cPf / | tar -C /mnt xvPf - to copy everything from one filesystem to another, but it would simplify things, I think, if I could just create it appropriately.

Any suggestions would be greatly appreciated!

This appears to work to create a combined kernel zImage + dtb uImage:

 mkimage -T kernel -A arm -O linux -a 0x40008000 -e 0x40008000 -C none -d ./build_dir/target-arm_arm926ej-s_musl_eabi/linux-mxs/zImage -d ./build_dir/target-arm_arm926ej-s_musl_eabi/linux-mxs/linux-5.10.176/arch/arm/boot/dts/imx28-wink1.dtb ./build_dir/target-arm_arm926ej-s_musl_eabi/linux-mxs/uImage_with_dtb

And the root filesystem appears to be in ./build_dir/target-arm_arm926ej-s_musl_eabi/root-mxs/, as long as I exclude ./boot, which would unnecessarily blow up the size with zImage and uImage files. Fortunately, since u-boot actually supports ubifs, I could combine the app-kernel and gpmi-nfc-general-use (rootfs) nand partitions. Of course, since the app-kernel partition is 8MB, there is no real need to do that either, as there is plenty of space for a modern kernel there too.

I concluded that I need to build a custom version of the kernel anyway to support the SDIO wifi adapter, so going too far down the imagebuilder route was counterproductive.

You can try my software, it's still in development but should work. It allows some basic functionality for building from source, adding kernel arguments, etc beyond the imagebuilder.

Interesting. How would I define my own profiles?

You can look in the profiles file for some existing profiles as a guide, it's "bashy" so you store the profile in an associative array with the same name as the profile. Commit-ish should work in --source mode if you want to pick specific builds. Source mode implements git worktree to create multiple build targets from a single cloned repo. Next step is to add patching and better documentation.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.