target_params = $(subst +,$(space),$*)
param_get = $(patsubst $(1)=%,%,$(filter $(1)=%,$(2)))
+param_get_default = $(firstword $(call param_get,$(1),$(2)) $(3))
param_mangle = $(subst $(space),_,$(strip $(1)))
param_unmangle = $(subst _,$(space),$(1))
$(call Image/mkfs/prepare/default,$(1))
endef
-
-define Image/Checksum
- ( cd ${BIN_DIR} ; \
- $(FIND) -maxdepth 1 -type f \! -name 'md5sums' -printf "%P\n" | sort | xargs $1 > $2 \
- )
+define Image/Manifest
+ $(STAGING_DIR_HOST)/bin/opkg \
+ --offline-root $(TARGET_DIR) \
+ --add-arch all:100 \
+ --add-arch $(if $(ARCH_PACKAGES),$(ARCH_PACKAGES),$(BOARD)):200 list-installed > \
+ $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest
endef
ifdef CONFIG_TARGET_ROOTFS_TARGZ
mkfs_packages_remove = $(patsubst -%,%,$(filter -%,$(mkfs_packages)))
mkfs_cur_target_dir = $(call mkfs_target_dir,pkg=$(target_params))
+opkg_target = \
+ $(call opkg,$(mkfs_cur_target_dir)) \
+ -f $(mkfs_cur_target_dir).conf \
+ -l $(mkfs_cur_target_dir).tmp
+
target-dir-%: FORCE
- rm -rf $(mkfs_cur_target_dir)
+ rm -rf $(mkfs_cur_target_dir) $(mkfs_cur_target_dir).opkg
$(CP) $(TARGET_DIR) $(mkfs_cur_target_dir)
- $(if $(mkfs_packages_add), \
- $(call opkg,$(mkfs_cur_target_dir)) install \
+ mv $(mkfs_cur_target_dir)/etc/opkg $(mkfs_cur_target_dir).opkg
+ echo 'src default file://$(PACKAGE_DIR_ALL)' > $(mkfs_cur_target_dir).conf
+ $(if $(call opkg_package_files,$(mkfs_packages_add)), \
+ $(opkg_target) update && \
+ $(opkg_target) install \
$(call opkg_package_files,$(mkfs_packages_add)))
$(if $(mkfs_packages_remove), \
$(call opkg,$(mkfs_cur_target_dir)) remove \
$(mkfs_packages_remove))
$(call Image/mkfs/prepare,$(mkfs_cur_target_dir))
$(call prepare_rootfs,$(mkfs_cur_target_dir))
+ mv $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir)/etc/opkg
+ rm -rf \
+ $(mkfs_cur_target_dir).conf \
+ $(mkfs_cur_target_dir).tmp
$(KDIR)/root.%: kernel_prepare
$(call Image/mkfs/$(word 1,$(target_params)),$(target_params))
PAGESIZE :=
SUBPAGESIZE :=
VID_HDR_OFFSET :=
- UBINIZE_OPTS := -E 5
+ UBINIZE_OPTS :=
+ UBINIZE_PARTS :=
MKUBIFS_OPTS :=
FS_OPTIONS/ubifs = $$(MKUBIFS_OPTS)
DEVICE_DTS_DIR :=
BOARD_NAME :=
+ UIMAGE_NAME :=
FILESYSTEMS := $(TARGET_FILESYSTEMS)
endef
DEFAULT_DEVICE_VARS := \
- DEVICE_NAME KERNEL KERNEL_INITRAMFS KERNEL_INITRAMFS_IMAGE \
- DEVICE_DTS DEVICE_DTS_DIR BOARD_NAME \
+ DEVICE_NAME KERNEL KERNEL_INITRAMFS KERNEL_SIZE KERNEL_INITRAMFS_IMAGE \
+ DEVICE_DTS DEVICE_DTS_DIR BOARD_NAME CMDLINE \
UBOOTENV_IN_UBI KERNEL_IN_UBI \
BLOCKSIZE PAGESIZE SUBPAGESIZE VID_HDR_OFFSET \
- UBINIZE_OPTS
+ UBINIZE_OPTS UIMAGE_NAME UBINIZE_PARTS
define Device/ExportVar
$(1) : $(2):=$$($(2))
endef
endif
-define Device/Build/check_size
- @[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1))))) -ge "$$(stat -c%s $@)" ] || { \
- echo "WARNING: Image file $@ is too big" >&2; \
- rm -f $@; \
- }
-endef
-
define Device/Build/compile
$$(_COMPILE_TARGET): $(KDIR)/$(1)
$(eval $(call Device/Export,$(KDIR)/$(1)))
$$(KDIR_KERNEL_IMAGE): $(KDIR)/$$(KERNEL_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS)
@rm -f $$@
$$(call concat_cmd,$$(KERNEL))
- $$(if $$(KERNEL_SIZE),$$(call Device/Build/check_size,$$(KERNEL_SIZE)))
+ $$(if $$(KERNEL_SIZE),$$(call Build/check-size,$$(KERNEL_SIZE)))
endif
endef
$(MAKE) legacy-images
install: install-images
- $(call Image/Checksum,md5sum --binary,md5sums)
- $(call Image/Checksum,openssl dgst -sha256,sha256sums)
+ $(call Image/Manifest)
endef