Platform

The main Radix cross Linux repository contains build scripts of the GNU/Linux distribution.

809 Commits   5 Branches   3 Tags   |
   581         kx 
   581         kx COMPONENT_TARGETS  = $(HARDWARE_BT1)
   581         kx 
   581         kx NEED_ABS_PATH      = true
   581         kx 
   581         kx COMPONENT_IS_3PP   = true
   581         kx 
   581         kx 
   581         kx include ../../../../build-system/constants.mk
   581         kx 
   581         kx 
   581         kx SOURCE_REQUIRES    = sources/Linux/Baikal/BFK
   581         kx 
   581         kx REQUIRES           = base/pkgtool
   581         kx 
   581         kx # ======= __END_OF_REQUIRES__ =======
   581         kx 
   581         kx 
   581         kx version            = 4.4.24-4.08.84
   581         kx subversion         =
   581         kx modules_version    = 4.4.24
   581         kx full_version       = $(version)
   581         kx tar_xz_archive     = $(SRC_PACKAGE_PATH)/Linux/Baikal/BFK/linux-baikal-$(full_version).tar.xz
   581         kx SRC_ARCHIVE        = $(tar_xz_archive)
   581         kx SRC_DIR            = $(TARGET_BUILD_DIR)/usr/src/linux-baikal-$(full_version)
   581         kx src_done           = $(TARGET_BUILD_DIR)/.source_done
   581         kx 
   581         kx config             = configs/$(HARDWARE).config
   581         kx build_dir          = $(SRC_DIR)
   581         kx modules_dir        = $(CURDIR)/$(TARGET_BUILD_DIR)
   581         kx 
   581         kx build_config       = $(SRC_DIR)/.config
   581         kx oldconfig_done     = $(TARGET_BUILD_DIR)/.oldconfig_done
   581         kx modules_done       = $(TARGET_BUILD_DIR)/.modules_done
   581         kx device_dtbs_done   = $(TARGET_BUILD_DIR)/.device_dtbs_done
   581         kx 
   581         kx devel_sources      = $(TARGET_DEST_DIR)/usr/src/linux-baikal-$(full_version)
   581         kx devel_sources_done = $(TARGET_BUILD_DIR)/.devel_sources_done
   581         kx boot_filesystem    = $(TARGET_DEST_DIR)/bootfs
   581         kx boot_fs_dir_done   = $(TARGET_BUILD_DIR)/.bootfs_done
   581         kx 
   581         kx 
   581         kx PATCHES = PATCHES
   581         kx 
   581         kx 
   581         kx ifneq ($(filter $(TOOLCHAIN),$(TOOLCHAIN_P5600_GLIBC)),)
   581         kx ARCH = mips
   581         kx endif
   581         kx 
   581         kx USE_TARGET_DEST_DIR_SYSROOT = no
   581         kx 
   581         kx 
   581         kx ifeq ($(HARDWARE),$(HARDWARE_BT1))
   581         kx device_tree_names  = baikal_bfk.dtb
   581         kx endif
   581         kx 
   581         kx 
   581         kx ####### Targets
   581         kx 
   582         kx linux_kernel         = $(TARGET_BUILD_DIR)/vmlinux.bin-$(full_version)
   582         kx linux_kernel_gz      = $(TARGET_BUILD_DIR)/vmlinux.bin.gz-$(full_version)
   582         kx linux_uImage         = $(TARGET_BUILD_DIR)/uImage-$(full_version)
   582         kx linux_config         = $(TARGET_BUILD_DIR)/config-$(full_version)
   582         kx linux_systemmap      = $(TARGET_BUILD_DIR)/System.map-$(full_version)
   582         kx device_tree_compiler = $(TARGET_BUILD_DIR)/$(TARGET)-dtc
   582         kx board_dtbs_path      = $(CURDIR)/$(TARGET_BUILD_DIR)
   581         kx 
   582         kx 
   581         kx #
   581         kx # gen_init_cpio - is built with kernel for HOST machine (not used here now)
   581         kx #
   581         kx # can be installed into ROOTFS_DEST_DIR for HOST target
   581         kx # i.e. TOOLCHAIN=build HARDWARE=host (see build-system/targets.mk)
   581         kx #
   581         kx # in the future we can create package for HOST machine to provide these utils
   581         kx #
   581         kx gen_init_cpio_src     = $(SRC_DIR)/usr/gen_init_cpio.c
   581         kx gen_init_cpio         = $(TARGET_BUILD_DIR)/usr/gen_init_cpio
   581         kx gen_initramfs_list_sh = $(SRC_DIR)/scripts/gen_initramfs_list.sh
   581         kx 
   581         kx 
   581         kx PKG_GROUP = boot
   581         kx 
   581         kx 
   581         kx KERNEL_BIN_PKG_NAME                = kernel
   581         kx KERNEL_BIN_PKG_VERSION             = 4.4.24
   581         kx KERNEL_BIN_PKG_ARCH                = $(TOOLCHAIN)
   581         kx KERNEL_BIN_PKG_DISTRO_NAME         = $(DISTRO_NAME)
   581         kx KERNEL_BIN_PKG_DISTRO_VERSION      = $(DISTRO_VERSION)
   581         kx KERNEL_BIN_PKG_GROUP               = $(PKG_GROUP)
   581         kx ###                                 |---handy-ruler-------------------------------|
   581         kx KERNEL_BIN_PKG_SHORT_DESCRIPTION   = Baikal T1 Linux Kernel
   581         kx KERNEL_BIN_PKG_URL                 = $(BUG_URL)
   581         kx KERNEL_BIN_PKG_LICENSE             = GPLv2
   581         kx KERNEL_BIN_PKG_DESCRIPTION_FILE    = $(TARGET_BUILD_DIR)/$(KERNEL_BIN_PKG_NAME)-pkg-description
   581         kx KERNEL_BIN_PKG_DESCRIPTION_FILE_IN = $(KERNEL_BIN_PKG_NAME)-pkg-description.in
   581         kx KERNEL_BIN_PKG_INSTALL_SCRIPT      = $(KERNEL_BIN_PKG_NAME)-pkg-install.sh
   581         kx 
   581         kx KERNEL_BIN_PKG     = $(CURDIR)/$(TARGET_BUILD_DIR)/$(KERNEL_BIN_PKG_NAME)-package
   581         kx 
   581         kx build_kernel_pkg   = $(TARGET_BUILD_DIR)/.kernel_pkg_done
   581         kx 
   581         kx pkg_basename       = $(KERNEL_BIN_PKG_NAME)-$(KERNEL_BIN_PKG_VERSION)-$(KERNEL_BIN_PKG_ARCH)-$(KERNEL_BIN_PKG_DISTRO_NAME)-$(KERNEL_BIN_PKG_DISTRO_VERSION)
   581         kx 
   581         kx pkg_archive        = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
   581         kx pkg_signature      = $(call sign-name,$(pkg_archive))
   581         kx pkg_description    = $(call desc-name,$(pkg_archive))
   581         kx products           = $(call pkg-files,$(pkg_archive))
   581         kx 
   581         kx BUILD_TARGETS      = $(build_config)
   581         kx BUILD_TARGETS     += $(oldconfig_done)
   581         kx BUILD_TARGETS     += $(linux_uImage)
   581         kx BUILD_TARGETS     += $(linux_kernel)
   581         kx BUILD_TARGETS     += $(linux_kernel_gz)
   581         kx BUILD_TARGETS     += $(linux_systemmap)
   581         kx BUILD_TARGETS     += $(linux_config)
   582         kx BUILD_TARGETS     += $(device_tree_compiler)
   581         kx BUILD_TARGETS     += $(modules_done)
   581         kx BUILD_TARGETS     += $(device_dtbs_done)
   581         kx BUILD_TARGETS     += $(devel_sources_done)
   581         kx BUILD_TARGETS     += $(boot_fs_dir_done)
   581         kx BUILD_TARGETS     += $(build_kernel_pkg)
   581         kx 
   581         kx PRODUCT_TARGETS    = $(products)
   581         kx 
   581         kx ROOTFS_TARGETS     = $(pkg_archive)
   581         kx 
   581         kx 
   581         kx include ../../../../build-system/core.mk
   581         kx 
   581         kx 
   581         kx OPTIMIZATION_FLAGS = -O2
   581         kx 
   581         kx ####### Dependencies
   581         kx 
   581         kx $(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
   581         kx 	$(UNPACK_SRC_ARCHIVE)
   581         kx 	$(APPLY_PATCHES)
   581         kx 	@touch $@
   581         kx 
   581         kx LMAKE := $(BUILD_ENVIRONMENT) $(MAKE) -C $(SRC_DIR) ARCH=$(ARCH) CROSS_COMPILE="$(CROSS_PREFIX)" V=$(if $(VERBOSE),1,0)
   581         kx 
   581         kx # add to LMAKE: CONFIG_DEBUG_SECTION_MISMATCH=y for more detailed log.
   581         kx 
   581         kx $(build_config): $(src_done) $(config)
   581         kx 	@mkdir -p $(build_dir)
   581         kx 	@cp $(config) $@
   581         kx 
   581         kx $(oldconfig_done): $(build_config)
   581         kx 	$(LMAKE) oldconfig
   581         kx 	@touch $@
   581         kx 
   581         kx $(linux_uImage): $(oldconfig_done)
   581         kx 	$(LMAKE) uImage
   581         kx 	cp $(build_dir)/arch/$(ARCH)/boot/uImage $@
   581         kx 
   581         kx $(linux_kernel): $(linux_uImage)
   581         kx 	cp $(build_dir)/arch/$(ARCH)/boot/vmlinux.bin $@
   581         kx 
   581         kx $(linux_kernel_gz): $(linux_uImage)
   581         kx 	cp $(build_dir)/arch/$(ARCH)/boot/vmlinux.bin.gz $@
   581         kx 
   581         kx $(linux_systemmap): $(linux_kernel)
   581         kx 	cp $(build_dir)/System.map $@
   581         kx 
   581         kx $(linux_config): $(linux_kernel)
   581         kx 	cp $(build_dir)/.config $@
   581         kx 
   582         kx $(device_tree_compiler): $(linux_kernel)
   582         kx 	cp $(build_dir)/scripts/dtc/dtc $@
   582         kx 
   582         kx $(modules_done): $(linux_kernel) $(linux_kernel_gz) $(linux_systemmap) $(linux_config) $(device_tree_compiler)
   581         kx 	$(LMAKE) modules
   581         kx 	@rm -rf $(TARGET_BUILD_DIR)/lib
   581         kx 	$(LMAKE) modules_install DEPMOD=true INSTALL_MOD_PATH=$(modules_dir)
   581         kx 	@cd $(TARGET_BUILD_DIR) && \
   581         kx 	  CWD=$(CURDIR) $(BUILDSYSTEM)/install_targets \
   581         kx 	      --preserve-source-dir=true               \
   581         kx 	      --destination=$(TARGET_DEST_DIR)         \
   581         kx 	      --toolchain=$(TOOLCHAIN) --hardware=$(HARDWARE) --flavour=$(FLAVOUR) \
   581         kx 	      $$(find * -path 'lib*' -type f -print)
   581         kx 	@touch $@
   581         kx 
   581         kx $(device_dtbs_done): $(modules_done)
   581         kx 	@$(LMAKE) dtbs
   581         kx 	@( cd $(build_dir)/arch/$(ARCH)/boot/dts/baikal ; \
   581         kx 	   cp -a $(device_tree_names) $(board_dtbs_path) ; \
   581         kx 	 )
   581         kx 	@touch $@
   581         kx 
   581         kx $(devel_sources_done): $(device_dtbs_done)
   581         kx 	@echo "Creating '$(devel_sources)' for building external modules"
   581         kx 	@rm -rf $(devel_sources)
   581         kx 	@( cd $(TARGET_DEST_DIR)/lib/modules/$(modules_version) ; \
   581         kx 	   if [ -L  build ] ; then rm -f  build ; fi            ; \
   581         kx 	   if [ -L source ] ; then rm -f source ; fi            ; \
   581         kx 	 )
   581         kx 	@mkdir -p $(TARGET_DEST_DIR)/usr/src
   581         kx 	# ======= Install kernel sources =======
   581         kx 	@echo "" > $(TARGET_DEST_DIR)/usr/src/.CONTENT
   581         kx 	@echo "Configured '$(HARDWARE)' Linux sources for building external modules." >> $(TARGET_DEST_DIR)/usr/src/.CONTENT
   581         kx 	@echo "" >> $(TARGET_DEST_DIR)/usr/src/.CONTENT
   581         kx 	@cp -a $(build_dir) $(TARGET_DEST_DIR)/usr/src
   581         kx 	@( cd $(TARGET_DEST_DIR)/lib/modules/$(modules_version)       ; \
   581         kx 	   ln -sf ../../../usr/src/linux-baikal-$(full_version) build  ; \
   581         kx 	   ln -sf ../../../usr/src/linux-baikal-$(full_version) source ; \
   581         kx 	 )
   582         kx 	@mkdir -p $(TARGET_DEST_DIR)/usr/bin
   582         kx 	# ======= Install Device Tree Compiler =======
   582         kx 	@cp -a $(device_tree_compiler) $(TARGET_DEST_DIR)/usr/bin
   581         kx 	@touch $@
   581         kx 
   581         kx $(boot_fs_dir_done): $(devel_sources_done)
   581         kx 	@echo "Creating '$(boot_filesystem)' directory for collecting boot file system objects"
   581         kx 	@rm -rf $(boot_filesystem)
   581         kx 	@mkdir -p $(boot_filesystem)
   581         kx 	@echo "" > $(boot_filesystem)/.CONTENT
   581         kx 	@echo "Collection '$(HARDWARE)' images for building BOOT filesystem." >> $(boot_filesystem)/.CONTENT
   581         kx 	@echo "" >> $(boot_filesystem)/.CONTENT
   581         kx 	@cp -a $(linux_uImage)    $(boot_filesystem)/uImage
   581         kx 	@cp -a $(linux_kernel)    $(boot_filesystem)/vmlinux.bin
   581         kx 	@cp -a $(linux_kernel_gz) $(boot_filesystem)/vmlinux.bin.gz
   581         kx 	@( cd $(board_dtbs_path) ; \
   581         kx 	   cp -a $(device_tree_names) $(boot_filesystem) ; \
   581         kx 	 )
   581         kx 	@touch $@
   581         kx 
   581         kx $(build_kernel_pkg): $(boot_fs_dir_done)
   581         kx 	@mkdir -p $(KERNEL_BIN_PKG)/boot
   581         kx 	@mkdir -p $(KERNEL_BIN_PKG)/lib/modules/$(modules_version)
   581         kx 	# ======= Copy modules and firmware (without links to sources): =======
   581         kx 	@cd $(modules_dir)/lib/modules/$(modules_version) && \
   581         kx 	  cp -rf kernel $(KERNEL_BIN_PKG)/lib/modules/$(modules_version) && \
   581         kx 	  cp -a modules.* $(KERNEL_BIN_PKG)/lib/modules/$(modules_version)
   581         kx 	@if [ -d $(modules_dir)/lib/firmware ] ; then \
   581         kx 	  cd $(modules_dir)/lib && \
   581         kx 	  cp -rf firmware $(KERNEL_BIN_PKG)/lib ; \
   581         kx 	fi
   581         kx 	@cp -a $(linux_kernel)    $(KERNEL_BIN_PKG)/boot/vmlinux.bin-$(full_version)
   581         kx 	@cp -a $(linux_kernel_gz) $(KERNEL_BIN_PKG)/boot/vmlinux.bin.gz-$(full_version)
   581         kx 	@cp -a $(linux_uImage)    $(KERNEL_BIN_PKG)/boot/uImage-$(full_version)
   581         kx 	@cp -a $(linux_config)    $(KERNEL_BIN_PKG)/boot/config-$(full_version)
   581         kx 	@cp -a $(linux_systemmap) $(KERNEL_BIN_PKG)/boot/System.map-$(full_version)
   581         kx 	@( cd $(board_dtbs_path) ; \
   581         kx 	   cp -a $(device_tree_names) $(KERNEL_BIN_PKG)/boot ; \
   581         kx 	 )
   581         kx 	@cd $(KERNEL_BIN_PKG)/boot && $(LN_S)f vmlinux.bin-$(full_version)    vmlinux.bin
   581         kx 	@cd $(KERNEL_BIN_PKG)/boot && $(LN_S)f vmlinux.bin.gz-$(full_version) vmlinux.bin.gz
   581         kx 	@cd $(KERNEL_BIN_PKG)/boot && $(LN_S)f uImage-$(full_version)         uImage
   581         kx 	@cd $(KERNEL_BIN_PKG)/boot && $(LN_S)f config-$(full_version)         config
   581         kx 	@cd $(KERNEL_BIN_PKG)/boot && $(LN_S)f System.map-$(full_version)     System.map
   581         kx 	@mkdir -p $(KERNEL_BIN_PKG)/usr/doc/kernel-$(full_version)
   581         kx 	@cp -a $(SRC_DIR)/COPYING $(SRC_DIR)/CREDITS $(SRC_DIR)/MAI* \
   581         kx 	       $(SRC_DIR)/README* $(SRC_DIR)/REPORTING-BUGS \
   581         kx 	       $(KERNEL_BIN_PKG)/usr/doc/kernel-$(full_version)
   581         kx 	@touch $@
   581         kx 
   581         kx $(KERNEL_BIN_PKG_DESCRIPTION_FILE): $(KERNEL_BIN_PKG_DESCRIPTION_FILE_IN)
   581         kx 	@cat $< | $(SED) -e "s/@VERSION@/$(version)/g" > $@
   581         kx 
   581         kx $(pkg_signature)   : $(pkg_archive) ;
   581         kx $(pkg_description) : $(pkg_archive) ;
   581         kx 
   581         kx $(pkg_archive): $(build_kernel_pkg) $(KERNEL_BIN_PKG_DESCRIPTION_FILE) $(KERNEL_BIN_PKG_INSTALL_SCRIPT)
   581         kx 	@cp $(KERNEL_BIN_PKG_DESCRIPTION_FILE) $(KERNEL_BIN_PKG)/.DESCRIPTION
   581         kx 	@cp $(KERNEL_BIN_PKG_INSTALL_SCRIPT) $(KERNEL_BIN_PKG)/.INSTALL
   581         kx 	@$(BUILD_PKG_REQUIRES) $(KERNEL_BIN_PKG)/.REQUIRES
   581         kx 	@echo "pkgname=$(KERNEL_BIN_PKG_NAME)"                            >  $(KERNEL_BIN_PKG)/.PKGINFO ; \
   581         kx 	 echo "pkgver=$(KERNEL_BIN_PKG_VERSION)"                          >> $(KERNEL_BIN_PKG)/.PKGINFO ; \
   581         kx 	 echo "arch=$(KERNEL_BIN_PKG_ARCH)"                               >> $(KERNEL_BIN_PKG)/.PKGINFO ; \
   581         kx 	 echo "distroname=$(KERNEL_BIN_PKG_DISTRO_NAME)"                  >> $(KERNEL_BIN_PKG)/.PKGINFO ; \
   581         kx 	 echo "distrover=$(KERNEL_BIN_PKG_DISTRO_VERSION)"                >> $(KERNEL_BIN_PKG)/.PKGINFO ; \
   581         kx 	 echo "group=$(KERNEL_BIN_PKG_GROUP)"                             >> $(KERNEL_BIN_PKG)/.PKGINFO ; \
   581         kx 	 echo "short_description=\"$(KERNEL_BIN_PKG_SHORT_DESCRIPTION)\"" >> $(KERNEL_BIN_PKG)/.PKGINFO ; \
   581         kx 	 echo "url=$(KERNEL_BIN_PKG_URL)"                                 >> $(KERNEL_BIN_PKG)/.PKGINFO ; \
   581         kx 	 echo "license=$(KERNEL_BIN_PKG_LICENSE)"                         >> $(KERNEL_BIN_PKG)/.PKGINFO
   586         kx 	@$(PSEUDO) sh -c "cd $(KERNEL_BIN_PKG) && chown -R root:root . && $(MAKE_PACKAGE) --linkadd yes .."