Projecte

General

Perfil

« Anterior | Següent » 

Revisió 2c86914a

Afegit per Roger Pueyo Centelles fa aproximadament 8 anys

[multiprofile] Improve x86 images generation

Visualitza les diferències:

Makefile
BUILD_PATH=$(BUILD_DIR)/$(TBUILD)
#Getting output image paths and names
IMAGE_PATH := $(shell echo bin/targets/$(ARCH)/$(SUBARCH)/$(FACTORY) | awk '{print $$1}')
IM_NAME := $(shell echo $(IMAGE) | awk '{print $$2}')
SIMAGE_PATH := $(shell echo bin/targets/$(ARCH)/$(SUBARCH)/$(SYSUPGRADE) | awk '{print $$1}')
SIM_NAME := $(shell echo $(SYSUPGRADE) | awk '{print $$2}')
EXT4IMAGE_PATH := $(shell echo bin/targets/$(ARCH)/$(SUBARCH)/$(EXT4IMAGE) | awk '{print $$1}')
EXT4IMAGE_NAME := $(shell echo $(EXT4IMAGE) | awk '{print $$2}')
FACTORY_PATH := $(shell echo bin/targets/$(ARCH)/$(SUBARCH)/$(FACTORY) | awk '{print $$1}')
FACTORY_NAME := $(shell echo $(FACTORY) | awk '{print $$2}')
SQUASHIMAGE_PATH := $(shell echo bin/targets/$(ARCH)/$(SUBARCH)/$(SQUASHIMAGE) | awk '{print $$1}')
SQUASHIMAGE_NAME := $(shell echo $(SQUASHIMAGE) | awk '{print $$2}')
SYSUPGRADE_PATH := $(shell echo bin/targets/$(ARCH)/$(SUBARCH)/$(SYSUPGRADE) | awk '{print $$1}')
SYSUPGRADE_NAME := $(shell echo $(SYSUPGRADE) | awk '{print $$2}')
CONFIG = $(BUILD_PATH)/.config
KCONFIG = $(BUILD_PATH)/target/linux/$(ARCH)/config-*
......
endef
define post_build_target
$(if $(QMP_COMMUNITY),$(if $(IM_NAM),,$(eval IM_NAME=$(VERSION_DIST)-$(QMP_COMMUNITY)_$(VERSION_NUMBER)-$(VERSION_NICK)_$(NAME)_factory_$(TIMESTAMP).bin)),$(if $(IM_NAM),,$(eval IM_NAME=$(VERSION_DIST)_$(VERSION_NUMBER)-$(VERSION_NICK)_$(NAME)_factory_$(TIMESTAMP).bin)))
$(if $(QMP_COMMUNITY),$(if $(SIM_NAM),,$(eval SIM_NAME=$(VERSION_DIST)-$(COMMUNITY)_$(VERSION_NUMBER)-$(VERSION_NICK)_$(NAME)_sysupgrade_$(TIMESTAMP).bin)),$(if $(SIM_NAM),,$(eval SIM_NAME=$(VERSION_DIST)_$(VERSION_NUMBER)-$(VERSION_NICK)_$(NAME)_sysupgrade_$(TIMESTAMP).bin)))
$(eval COMP=$(shell ls $(BUILD_PATH)/$(IMAGE_PATH) 2>/dev/null | grep -c \\.gz))
$(if $(QMP_COMMUNITY),$(if $(EXT4IMAGE_NAME),,$(eval EXT4IMAGE_NAME=$(VERSION_DIST)-$(QMP_COMMUNITY)_$(VERSION_NUMBER)-$(VERSION_NICK)_$(NAME)_ext4_$(TIMESTAMP).$(BINEXT))),$(if $(EXT4IMAGE_NAME),,$(eval EXT4IMAGE_NAME=$(VERSION_DIST)_$(VERSION_NUMBER)-$(VERSION_NICK)_$(NAME)_ext4_$(TIMESTAMP).$(BINEXT))))
$(if $(QMP_COMMUNITY),$(if $(FACTORY_NAME),,$(eval FACTORY_NAME=$(VERSION_DIST)-$(QMP_COMMUNITY)_$(VERSION_NUMBER)-$(VERSION_NICK)_$(NAME)_factory_$(TIMESTAMP).$(BINEXT))),$(if $(FACTORY_NAME),,$(eval FACTORY_NAME=$(VERSION_DIST)_$(VERSION_NUMBER)-$(VERSION_NICK)_$(NAME)_factory_$(TIMESTAMP).$(BINEXT))))
$(if $(QMP_COMMUNITY),$(if $(SQUASHIMAGE_NAME),,$(eval SQUASHIMAGE_NAME=$(VERSION_DIST)-$(QMP_COMMUNITY)_$(VERSION_NUMBER)-$(VERSION_NICK)_$(NAME)_squashfs_$(TIMESTAMP).$(BINEXT))),$(if $(SQUASHIMAGE_NAME),,$(eval SQUASHIMAGE_NAME=$(VERSION_DIST)_$(VERSION_NUMBER)-$(VERSION_NICK)_$(NAME)_squashfs_$(TIMESTAMP).$(BINEXT))))
$(if $(QMP_COMMUNITY),$(if $(SYSUPGRADE_NAME),,$(eval SYSUPGRADE_NAME=$(VERSION_DIST)-$(COMMUNITY)_$(VERSION_NUMBER)-$(VERSION_NICK)_$(NAME)_sysupgrade_$(TIMESTAMP).$(BINEXT))),$(if $(SYSUPGRADE_NAME),,$(eval SYSUPGRADE_NAME=$(VERSION_DIST)_$(VERSION_NUMBER)-$(VERSION_NICK)_$(NAME)_sysupgrade_$(TIMESTAMP).$(BINEXT))))
mkdir -p $(IMAGES)
-@[ $(COMP) -eq 1 ] && gunzip $(BUILD_PATH)/$(IMAGE_PATH) -c > $(IMAGES)/$(IM_NAME)
-@[ $(COMP) -ne 1 -a -f $(BUILD_PATH)/$(IMAGE_PATH) ] && cp -f $(BUILD_PATH)/$(IMAGE_PATH) $(IMAGES)/$(IM_NAME)
-@[ $(COMP) -eq 1 -a -n "$(SYSUPGRADE)" ] && gunzip $(BUILD_PATH)/$(SIMAGE_PATH) -c > $(IMAGES)/$(SIM_NAME)
-@[ $(COMP) -ne 1 -a -n "$(SYSUPGRADE)" ] && cp -f $(BUILD_PATH)/$(SIMAGE_PATH) $(IMAGES)/$(SIM_NAME)
@[ -f $(IMAGES)/$(IM_NAME) ] || echo No output image configured in targets.mk
@echo $(IM_NAME)
$(if $(SYSUPGRADE),@echo $(SIM_NAME))
-@[ -f $(BUILD_PATH)/$(EXT4IMAGE_PATH) ] && cp -f $(BUILD_PATH)/$(EXT4IMAGE_PATH) $(IMAGES)/$(EXT4IMAGE_NAME)
-@[ -f $(BUILD_PATH)/$(FACTORY_PATH) ] && cp -f $(BUILD_PATH)/$(FACTORY_PATH) $(IMAGES)/$(FACTORY_NAME)
-@[ -f $(BUILD_PATH)/$(SQUASHIMAGE_PATH) ] && cp -f $(BUILD_PATH)/$(SQUASHIMAGE_PATH) $(IMAGES)/$(SQUASHIMAGE_NAME)
-@[ -f $(BUILD_PATH)/$(SYSUPGRADE_PATH) ] && cp -f $(BUILD_PATH)/$(SYSUPGRADE_PATH) $(IMAGES)/$(SYSUPGRADE_NAME)
@[ -f $(IMAGES)/$(EXT4IMAGE_NAME) -o -f $(IMAGES)/$(FACTORY_NAME) -o -f $(IMAGES)/$(SQUASHIMAGE_NAME) -o -f $(IMAGES)/$(SYSUPGRADE_NAME) ] || echo No output image configured in targets.mk
@echo "Generated images:"
$(if $(EXT4IMAGE),@echo $(EXT4IMAGE_NAME))
$(if $(FACTORY),@echo $(FACTORY_NAME))
$(if $(SQUASHIMAGE),@echo $(SQUASHIMAGE_NAME))
$(if $(SYSUPGRADE),@echo $(SYSUPGRADE_NAME))
@echo "Executing POST_BUILD scripts"
$(foreach SCRIPT, $(wildcard $(SCRIPTS_DIR)/*.script), $(shell $(SCRIPT) POST_BUILD $(TBUILD) $(TARGET) $(EXTRA_PACKAGESS)) )
@echo "qMp firmware compiled, you can find output files in $(IMAGES) directory."
configs/x86-generic-multiprofile
CONFIG_TARGET_x86=y
CONFIG_TARGET_x86_generic=y
CONFIG_TARGET_IMAGES_GZIP=n
CONFIG_TARGET_IMAGES_GZIP=y
CONFIG_TARGET_ROOTFS_EXT4FS=y
CONFIG_TARGET_ROOTFS_SQUASHFS=y
CONFIG_VDI_IMAGES=y
configs/x86-geode-multiprofile
CONFIG_TARGET_x86=y
CONFIG_TARGET_x86_geode=y
CONFIG_TARGET_IMAGES_GZIP=y
CONFIG_PACKAGE_qmp-big-node=y
CONFIG_PACKAGE_kmod-usb2=y
CONFIG_PACKAGE_kmod-usb-ohci=y
targets.mk
# Any option defined in Makefile can be overrided from here, for instance
# override OWRT_SVN = svn://mysvn.com/owrt
COMBINEDEXT4IMG := combined-ext4.img
COMBINEDEXT4IMG := combined-ext4.img.gz
COMBINEDEXT4VDI := combined-ext4.vdi
COMBINEDEXT4VMDK := combined-ext4.vmdk
COMBINEDSQUASH := combined-squashfs.bin
COMBINEDSQUASHIMG := combined-squashfs.img
COMBINEDSQUASHIMG := combined-squashfs.img.gz
COMBINEDSQUASHVDI := combined-squashfs.vdi
COMBINEDSQUASHVMDK := combined-squashfs.vmdk
SDCARDVFATEXT4 := sdcard-vfat-ext4.img
SQUASHFACTORY := squashfs-factory.bin
SQUASHSYSUPGRADE := squashfs-sysupgrade.bin
BINEXT := bin
TINYPKG ?= qmp-tiny-node
SMALLPKG ?= qmp-small-node
BIGPKG ?= qmp-big-node
......
MPNAME:=x86-geode
SQUASHIMAGE:=$(DISTCL)-$(ARCH)-$(SUBARCH)-$(COMBINEDSQUASHIMG)
EXT4IMAGE:=$(DISTCL)-$(ARCH)-$(SUBARCH)-$(COMBINEDEXT4IMG)
BINEXT=img.gz
endif
ifeq ($(T),x86)
......
MPNAME:=x86
SQUASHIMAGE:=$(DISTCL)-$(ARCH)-$(SUBARCH)-$(COMBINEDSQUASHIMG)
EXT4IMAGE:=$(DISTCL)-$(ARCH)-$(SUBARCH)-$(COMBINEDEXT4IMG)
BINEXT=img.gz
endif
ifeq ($(T),soekris45xx)
......
MPNAME:=soekris45xx
SQUASHIMAGE:=$(DISTCL)-$(ARCH)-$(SUBARCH)-$(COMBINEDSQUASHIMG)
EXT4IMAGE:=$(DISTCL)-$(ARCH)-$(SUBARCH)-$(COMBINEDEXT4IMG)
BINEXT=img.gz
endif
ifeq ($(T),bullet)
......
MPNAME:=vbox
SQUASHIMAGE:=$(DISTCL)-$(ARCH)-$(SUBARCH)-$(COMBINEDSQUASHVDI)
EXT4IMAGE:=$(DISTCL)-$(ARCH)-$(SUBARCH)-$(COMBINEDEXT4VDI)
BINEXT=vdi
endif
ifeq ($(T),vmware)
......
MPNAME:=vmware
SQUASHIMAGE:=$(DISTCL)-$(ARCH)-$(SUBARCH)-$(COMBINEDSQUASHVMDK)
EXT4IMAGE:=$(DISTCL)-$(ARCH)-$(SUBARCH)-$(COMBINEDEXT4VMDK)
BINEXT=vmdk
endif
ifeq ($(T),vocore-8M)
......
SUBARCH:=generic
TBUILD:=lede
MPNAME:=kvm
SQUASHIMAGE:=$(DISTCL)-$(ARCH)-$(SUBARCH)-$(COMBINEDSQUASHVDI)
EXT4IMAGE:=$(DISTCL)-$(ARCH)-$(SUBARCH)-$(COMBINEDEXT4VDI)
SQUASHIMAGE:=$(DISTCL)-$(ARCH)-$(SUBARCH)-$(COMBINEDSQUASHIMG)
EXT4IMAGE:=$(DISTCL)-$(ARCH)-$(SUBARCH)-$(COMBINEDEXT4IMG)
BINEXT=img.gz
endif
ifeq ($(T),sunxi-generic-ib)

També disponible a: Unified diff