Subtarget doesn't create build img

I'm trying to create SUBTARGETS, and while the build compiles without error, no build image actually gets created. I'm sure I'm missing something simple, but I've not been able to figure out what it is :slight_smile:

Any help would be appreciated!

The build finishes and the output directory contains everything but the image files..

bin/targets/octeon/itus/

-rw-r--r-- 1 grommish grommish   98 Jun 28 05:17 config.buildinfo
-rw-r--r-- 1 grommish grommish  341 Jun 28 05:17 feeds.buildinfo
-rw-r--r-- 1 grommish grommish 2010 Jun 28 05:19 openwrt-octeon-itus-itusgateway.manifest
drwxr-xr-x 2 grommish grommish 4096 Jun 28 05:18 packages
-rw-r--r-- 1 grommish grommish  356 Jun 28 05:19 sha256sums
-rw-r--r-- 1 grommish grommish   20 Jun 28 05:17 version.buildinfo

When I compile out generic, it builds the image.

bin/targets/octeon/generic/

    4 -rw-r--r-- 1 grommish grommish      100 Jun 28 06:26 config.buildinfo
    4 -rw-r--r-- 1 grommish grommish      341 Jun 28 06:26 feeds.buildinfo
    4 -rw-r--r-- 1 grommish grommish     2010 Jun 28 05:15 openwrt-octeon-generic-default.manifest
14036 -rwxr-xr-x 1 grommish grommish 14369608 Jun 28 06:29 openwrt-octeon-generic-generic-initramfs-kernel.bin
    4 -rw-r--r-- 1 grommish grommish     2010 Jun 28 06:29 openwrt-octeon-generic-generic.manifest
    4 drwxr-xr-x 2 grommish grommish     4096 Jun 28 06:27 packages
    4 -rw-r--r-- 1 grommish grommish      579 Jun 28 06:29 sha256sums
    4 -rw-r--r-- 1 grommish grommish       20 Jun 28 06:26 version.buildinfo

I have created the directories for itus and generic in the target/linux/octeon/ directory to hold the patches-*/, base-files/ and config-* files.

Below are the various Makefile and other *.mk

target/linux/octeon/Makefile

#
# Copyright (C) 2013 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk

ARCH:=mips64
BOARD:=octeon
BOARDNAME:=Cavium Networks Octeon
FEATURES:=squashfs ramdisk pci usb
CPU_TYPE:=octeon3
MAINTAINER:=John Crispin <john@phrozen.org>

KERNEL_PATCHVER:=4.19
KERNEL_TESTING_PATCHVER:=5.4

SUBTARGETS:=generic itus ubiq

define Target/Description
	Build firmware images for Cavium Networks Octeon-based boards.
endef

include $(INCLUDE_DIR)/target.mk

DEFAULT_PACKAGES += mkf2fs e2fsprogs

$(eval $(call BuildTarget))

target/linux/octeon/image/Makefile

#
# Copyright (C) 2009-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk

define Build/strip-kernel
	# Workaround pre-SDK-1.9.0 u-boot versions not handling the .notes section
	$(TARGET_CROSS)strip -R .notes $@ -o $@.stripped && mv $@.stripped $@
endef

define Device/Default
  PROFILES = Default $$(DEVICE_NAME)
  KERNEL_NAME := vmlinux.elf
  KERNEL_INITRAMFS_NAME := vmlinux-initramfs.elf
  KERNEL := kernel-bin | strip-kernel | patch-cmdline
  IMAGES := sysupgrade.tar
  IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-extra 128k | sysupgrade-tar rootfs=$$$$@
  IMAGE/sysupgrade.tar := sysupgrade-tar
endef

include $(SUBTARGET).mk
$(eval $(call BuildImage))

target/linux/octeon/image/generic.mk

define Device/generic
  DEVICE_VENDOR := Generic
  DEVICE_MODEL := Octeon
  FILESYSTEMS := ext4
endef
TARGET_DEVICES += generic

target/linux/octeon/image/itus.mk

#
# Itus Network Shield Profiles
#

ITUSROUTER_CMDLINE:=console=ttyS0,115200, rootfstype=ext4 root=/dev/mmcblk1p2 rootwait
define Device/itusrouter
  BOARD := itus
  DEVICE_VENDOR := Itus Networks Shield
  DEVICE_MODEL := Router
  CMDLINE := $(ITUSROUTER_CMDLINE)
endef
TARGET_DEVICES += itusrouter

ITUSROUTER_CMDLINE:=console=ttyS0,115200, rootfstype=ext4 root=/dev/mmcblk1p3 rootwait
define Device/itusgateway
  BOARD := itus
  DEVICE_VENDOR := Itus Networks Shield
  DEVICE_MODEL := Gateway
  CMDLINE := $(ITUSROUTER_CMDLINE)
  $(Device/Default)
endef
TARGET_DEVICES += itusgateway

ITUSBRIDGE_CMDLINE:=console=ttyS0,115200, rootfstype=ext4 root=/dev/mmcblk1p4 rootwait
define Device/itusbridge
  BOARD := itus
  DEVICE_VENDOR := Itus Networks Shield
  DEVICE_MODEL := Bridge
  CMDLINE := $(ITUSBRIDGE_CMDLINE)
endef
TARGET_DEVICES += itusbridge

target/linux/octeon/generic/target.mk

#
# Copyright (C) 2009 OpenWrt.org
#

SUBTARGET:=generic
BOARDNAME:=generic octeon
CPU_TYPE:=octeonplus
KERNEL_PATCHVER:=4.19
KERNEL_TESTING_PATCHVER:=5.4

define Target/Description
	Build firmware images for Itus Networks Shield (Octeon 3)
endef

target/linux/octeon/itus/target.mk

#
# Copyright (C) 2009 OpenWrt.org
#

SUBTARGET:=itus
BOARDNAME:=Itus Networks Shield
CPU_TYPE:=octeon3
KERNEL_PATCHVER:=4.19
KERNEL_TESTING_PATCHVER:=5.4
SUPPORTED_DEVICES:=itusrouter,itusbridge,itusgateway


define Target/Description
	Build firmware images for Itus Networks Shield (Octeon 3)
endef

When I check e.g. ath79 (which has a few subtargets), I see this at the bottom of target/linux/ath79/image/Makefile:

ifeq ($(SUBTARGET),generic)
include ./generic.mk
include ./generic-tp-link.mk
include ./generic-ubnt.mk
endif
ifeq ($(SUBTARGET),nand)
include ./nand.mk
endif
ifeq ($(SUBTARGET),tiny)
include ./tiny.mk
include ./tiny-netgear.mk
include ./tiny-tp-link.mk
endif
$(eval $(call BuildImage))

Maybe that's (part of) what's missing?

Thanks @Borromini! However, that is saying that if the SUBTARGET is xxxxxx, then include the specialized, target-related included.. The existing SUBTARGET examples (like ath79 or ramips) have helped me understand what is going on, build wise, but somewhere, I'm missing the part that tells the system to actually create the file I think :slight_smile:

I'm must not sure where that is..

The image/Makefile is the same as it was, with the exception that I pulled the generic device out (and the Ubiquiti defines) and split them up. Then, I added the

include $(SUBTARGET).mk

So that it would pull the generic.mk and itus.mk

I'm missing something, probably a single line, but I'm not sure what it is :blush:

Bump..

If I build out the Generic subtarget I made, it works ;x I did a diff on the .config file between the two and there is nothing different that stands out

@@ -44,22 +44,20 @@
 # CONFIG_TARGET_uml is not set
 # CONFIG_TARGET_zynq is not set
 # CONFIG_TARGET_x86 is not set
-# CONFIG_TARGET_octeon_generic is not set
-CONFIG_TARGET_octeon_itus=y
+CONFIG_TARGET_octeon_generic=y
+# CONFIG_TARGET_octeon_itus is not set
 # CONFIG_TARGET_octeon_ubiq is not set
 # CONFIG_TARGET_MULTI_PROFILE is not set
-# CONFIG_TARGET_octeon_itus_Default is not set
-# CONFIG_TARGET_octeon_itus_DEVICE_itusbridge is not set
-CONFIG_TARGET_octeon_itus_DEVICE_itusgateway=y
-# CONFIG_TARGET_octeon_itus_DEVICE_itusrouter is not set
+# CONFIG_TARGET_octeon_generic_Default is not set
+CONFIG_TARGET_octeon_generic_DEVICE_generic=y
 CONFIG_HAS_SUBTARGETS=y
 CONFIG_HAS_DEVICES=y
 CONFIG_TARGET_BOARD="octeon"
-CONFIG_TARGET_SUBTARGET="itus"
-CONFIG_TARGET_PROFILE="DEVICE_itusgateway"
-CONFIG_TARGET_ARCH_PACKAGES="mips64_octeon3"
-CONFIG_DEFAULT_TARGET_OPTIMIZATION="-Os -pipe -mno-branch-likely -march=octeon3 -mabi=64"
-CONFIG_CPU_TYPE="octeon3"
+CONFIG_TARGET_SUBTARGET="generic"
+CONFIG_TARGET_PROFILE="DEVICE_generic"
+CONFIG_TARGET_ARCH_PACKAGES="mips64_octeonplus"
+CONFIG_DEFAULT_TARGET_OPTIMIZATION="-Os -pipe -mno-branch-likely -march=octeon+ -mabi=64"
+CONFIG_CPU_TYPE="octeonplus"
 CONFIG_LINUX_4_19=y
 CONFIG_DEFAULT_base-files=y
 CONFIG_DEFAULT_busybox=y