Adding a new SUBTARGET

Hi,

Sorry, just came across this - not sure if it's the same, but I am having issues adding a new SUBTARGET to a device => even setting SUBTARGET in the target.mk file, the value is not being taken into use.

Are others seeing this same issue?

Thanks!

Hi,

Let me try to explain. I am trying to add a tiny build to ramips, similar to what is done for ar71xx and ath79 (where I think it works :smile:). I have added a new sub-target to the ramips makefile,
SUBTARGETS:=mt7620 tiny mt7621 mt76x8 rt288x rt305x rt3883

I have added the tiny directory, and inside that I modified target.mk, setting
SUBTARGET:=mt7620

And this new target (tiny, with images as desired) shows up in menuconfig - perfect! But, .config isn't set correctly (as follows),
CONFIG_TARGET_ramips_tiny=y

Instead of the (needed?),
CONFIG_TARGET_ramips_mt7620=y

Given the SUBTARGET setting above, I would expect the second result? And as a consequence, follow on processing (like adding WiFi drivers) is not working as needed.

Thoughts?

Thanks!

OK, a step forward! I found that the specific subtarget name was being used as a check inside the package (kernel) directory. Added the new subtarget, and that builds. Now, the next issue ... :smile:. It seems that for some reason now base-files is not building ... thoughts?

Thanks!

OK, figured that out ... was fixed with make clean. Now I get a full build, all packages seem to be there, manifest too. Just no sysupgrade file. Hmmm - not sure why that wouldn't get generated. Any ideas appreciated!

Yep, definitely narrowed to make target/linux/install - succeeds, and rootfs is built, just not taken from there to an image. I admit, struggling through all the Makefiles to try to figure out where this is all defined.

Thanks!

1 Like

OK, figured it out! Want to report back, hopefully help others out.

So two things you need to do when adding a new SUBTARGET,

  1. Check packages, there may be logic in there based on the subtarget. Make sure to add / include the new target as necessary.
  2. DON'T leave an "old" (incorrect) SUBTARGET in the new target.mk file. While it may be the same platform, it will break the build. Found that out the hard way ... LOL.

Thanks!