Compile error: /toolchain/kernel-headers - Download/default is missing the VERSION field

Help, my dear.
Now I am going to compile openwrt in ubuntu 22.
I got the problem, this is my compiled log.

Thank you

  1 make[1]: Entering directory '/home/james_bui/workspace/build/T234/openwrt'
  2 make[2]: Entering directory '/home/james_bui/workspace/build/T234/openwrt'
  3 mkdir -p /home/james_bui/workspace/build/T234/openwrt/build_dir/target-mips_24kc_musl/stamp
  4 touch /home/james_bui/workspace/build/T234/openwrt/staging_dir/target-mips_24kc_musl/.prepared
  5 make[3]: Entering directory '/home/james_bui/workspace/build/T234/openwrt/toolchain/gdb'
  6 make[3]: Nothing to be done for 'compile'.
  7 make[3]: Leaving directory '/home/james_bui/workspace/build/T234/openwrt/toolchain/gdb'
  8 time: toolchain/gdb/compile#0.00#0.00#0.00
  9 make[3]: Entering directory '/home/james_bui/workspace/build/T234/openwrt/toolchain/binutils'
 10 make[3]: Nothing to be done for 'compile'.
 11 make[3]: Leaving directory '/home/james_bui/workspace/build/T234/openwrt/toolchain/binutils'
 12 time: toolchain/binutils/compile#0.00#0.00#0.00
 13 make[3]: Entering directory '/home/james_bui/workspace/build/T234/openwrt/toolchain/gcc/initial'
 14 make[3]: Nothing to be done for 'compile'.
 15 make[3]: Leaving directory '/home/james_bui/workspace/build/T234/openwrt/toolchain/gcc/initial'
 16 time: toolchain/gcc/initial/compile#0.00#0.00#0.00
 17 make[3]: Entering directory '/home/james_bui/workspace/build/T234/openwrt/toolchain/kernel-headers'
 18 ====== debug ====
 19 PKG_SOURCE_VERSION = []
 20 PKG_SOURCE_URL = [/home/james_bui/workspace/build/T234/openwrt/../source/linux]
 21 PKG_VERSION = [4.9.276]
 22 ====== debug end ====
 23 Makefile:117: *** Download/default is missing the VERSION field..  Stop.
 24 make[3]: Leaving directory '/home/james_bui/workspace/build/T234/openwrt/toolchain/kernel-headers'
 25 time: toolchain/kernel-headers/compile#0.00#0.00#0.01
 26 make[2]: Leaving directory '/home/james_bui/workspace/build/T234/openwrt'
 27 make[1]: Leaving directory '/home/james_bui/workspace/build/T234/openwrt'


vi toolchain/kernel-headers/Makefile

 #
  2 # Copyright (C) 2006-2009 OpenWrt.org
  3 #
  4 # This is free software, licensed under the GNU General Public License v2.
  5 # See /LICENSE for more information.
  6 #
  7 include $(TOPDIR)/rules.mk
  8
  9 KERNEL_BUILD_DIR := $(BUILD_DIR_TOOLCHAIN)
 10 BUILD_DIR := $(KERNEL_BUILD_DIR)
 11
 12 override QUILT:=
 13 override HOST_QUILT:=
 14
 15 include $(INCLUDE_DIR)/kernel.mk
 16
 17 PKG_NAME:=linux
 18 PKG_VERSION:=$(LINUX_VERSION)
 19 PKG_SOURCE:=$(LINUX_SOURCE)
 20 ifneq ($(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
 21   PKG_SOURCE_PROTO:=git
 22   PKG_SOURCE_URL:=$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI))
 23   PKG_SOURCE_VERSION:=$(call qstrip,$(CONFIG_KERNEL_GIT_REF))
 24   PKG_MIRROR_HASH:=$(call qstrip,$(CONFIG_KERNEL_GIT_MIRROR_HASH))
 25 ifdef CHECK
 26   include $(INCLUDE_DIR)/kernel-version.mk
 27   PKG_VERSION:=$(LINUX_VERSION)
 28 else
 29   PKG_SOURCE:=$(LINUX_SOURCE)
 30 endif
 31 else
 32   PKG_SOURCE:=$(LINUX_SOURCE)
 33   PKG_SOURCE_URL:=$(LINUX_SITE)
 34 endif
 35 HOST_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
 36 PKG_HASH:=$(LINUX_KERNEL_HASH)
 37 LINUX_DIR := $(HOST_BUILD_DIR)
 38 FILES_DIR :=
 39 PATCH_DIR := ./patches$(if $(wildcard ./patches-$(LINUX_VERSION)),-$(LINUX_VERSION))
 40
 41 include $(INCLUDE_DIR)/toolchain-build.mk
 42 include $(INCLUDE_DIR)/kernel-defaults.mk
 43
 44 ifeq ($(strip $(BOARD)),uml)
 45   LINUX_KARCH:=$(subst x86_64,x86,$(subst i386,x86,$(ARCH)))
 46 endif
 47
 48 HOST_EXTRACFLAGS=
 49
 50 LINUX_HAS_HEADERS_INSTALL:=y
 51
 52 KMAKE := $(MAKE) -C $(HOST_BUILD_DIR) \
 53         $(KERNEL_MAKE_FLAGS) \
 54         CC="$(KERNEL_CC)" \
 55         CFLAGS="$(TARGET_CFLAGS)"
 56
 57 define Host/Configure/all
 58         mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev
 59         $(KMAKE) \
 60                 INSTALL_HDR_PATH="$(BUILD_DIR_TOOLCHAIN)/linux-dev/" \
 61                 headers_install
 62 endef
 63
 64 # XXX: the following is needed to build lzma-loader
 65 ifneq ($(CONFIG_mips)$(CONFIG_mipsel),)
 66   define Host/Configure/lzma
 67         $(CP) \
 68                 $(HOST_BUILD_DIR)/arch/mips/include/asm/asm.h \
 69                 $(HOST_BUILD_DIR)/arch/mips/include/asm/regdef.h \
 70                 $(HOST_BUILD_DIR)/arch/mips/include/asm/asm-eva.h \
 71                 $(BUILD_DIR_TOOLCHAIN)/linux-dev/include/asm/
 72   endef
 73 endif
 74
 75 define Host/Configure/post/mips
 76         $(call Host/Configure/lzma)
 77 endef
 78
 79 define Host/Configure/post/mipsel
 80         $(call Host/Configure/lzma)
 81 endef
 82
 83 define Host/Prepare
 84         rm -rf $(BUILD_DIR_TOOLCHAIN)/linux-*
 85         $(call Kernel/Prepare/Default)
 86         rm -f $(BUILD_DIR_TOOLCHAIN)/linux
 87         ln -s linux-$(LINUX_VERSION) $(BUILD_DIR_TOOLCHAIN)/linux
 88         $(SED) 's/@expr length/@-expr length/' $(HOST_BUILD_DIR)/Makefile
 89 endef
 90
 91 define Host/Configure
 92         env
 93         yes '' | $(KMAKE) oldconfig
 94         $(call Host/Configure/all)
 95         $(call Host/Configure/post/$(ARCH))
 96 endef
 97
 98 define Host/Compile
 99 endef
100
101 define Host/Install
102         $(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(TOOLCHAIN_DIR)/
103 endef
104
105 define Host/Clean
106         rm -rf \
107                 $(HOST_BUILD_DIR) \
108                 $(BUILD_DIR_TOOLCHAIN)/linux \
109                 $(BUILD_DIR_TOOLCHAIN)/linux-dev
110 endef
111
112 $(info ====== debug ==== )
113 $(info PKG_SOURCE_VERSION = [${PKG_SOURCE_VERSION}])
114 $(info PKG_SOURCE_URL = [${PKG_SOURCE_URL}])
115 $(info PKG_VERSION = [${PKG_VERSION}])
116 $(info ====== debug end ==== )
117 $(eval $(call HostBuild))


The issue was fixed. I corrected the git config and after that it worked. Thanks

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