How to customize a new target as like x86?

In OpenWrt 23.05, I need to customize/create a new target NEW_TGT similar to x86 architecture. I want the new target name as NEW_TGT to be displayed in menuconfig and it should take the default config options meant for x86.

For this, I created a new target named NEW_TGT under target/linux and copied all the files and folders from x86 folder to my "NEW_TGT".

After this when I tried compiling "make world", some of the packages are not compiling for NEW_TGT as it has depends on @TARGET_x86. How can I remove the tight coupling of these packages with x86 ? For customizing my new target as like x86, what should I do ? Please help.

Under target/linux/NEW_TGT, I created a Makefile with the following content:

include $(TOPDIR)/rules.mk
ARCH:=x86
BOARD:=generic
KERNEL_PATCHVER:=5.15
DEFAULT_PACKAGES:=base-files libc
$(eval $(call BuildTarget))

You can't, you'd have to adapt all the places referencing x86. So if it's x86_64, just don't.

--
Even a x86 subtarget would cause you serious effort.

1 Like

Shall I try creating a profile for my device under x86_64 as below ?


define Device/myDevice
  DEVICE_VENDOR := XXXXXX
  DEVICE_MODEL := x86_64/My Device
  DEVICE_PACKAGES += \
        kmod-amazon-ena kmod-amd-xgbe kmod-bnx2 kmod-e1000e kmod-e1000 \
        kmod-forcedeth kmod-fs-vfat kmod-igb kmod-igc kmod-ixgbe kmod-r8169 \
        kmod-tg3 base-files helloworld
  GRUB2_VARIANT := generic
endef

TARGET_DEVICES += myDevice

I need to add custom kernel configuration to my device. Is it possible to add the same under device profile similar to the config file added in target/subtarget ?

Can you please elaborate on this a bit ?