From a7f4602e491756cf6efe52eb8f7d4eac4bba27ce Mon Sep 17 00:00:00 2001 From: carbon Date: Sat, 15 Jun 2024 20:23:16 +0800 Subject: [PATCH] build: use genimage tool to create sd image Signed-off-by: carbon --- build/Makefile | 13 +++++++++++++ build/common_functions.sh | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/build/Makefile b/build/Makefile index d67488d03..095df2ce8 100644 --- a/build/Makefile +++ b/build/Makefile @@ -580,6 +580,19 @@ ifneq ($(STORAGE_TYPE), sd) endif endif +sd_image: + $(call print_target) + -${Q}rm $(OUTPUT_DIR)/fs +ifeq ($(CONFIG_BUILDROOT_FS),y) + ${Q}rm -rf $(OUTPUT_DIR)/br-rootfs + ${Q}ln -s $(OUTPUT_DIR)/br-rootfs $(OUTPUT_DIR)/fs + ${Q}mkdir $(OUTPUT_DIR)/br-rootfs + ${Q}tar xvf $(BR_DIR)/output/$(BR_BOARD)/images/rootfs.tar.xz -C $(OUTPUT_DIR)/br-rootfs +else + ${Q}ln -s $(OUTPUT_DIR)/rootfs $(OUTPUT_DIR)/fs +endif + $(TOP_DIR)/device/gen_burn_image_sd.sh $(OUTPUT_DIR) + jffs2: $(call print_target) ifeq ($(STORAGE_TYPE),spinor) diff --git a/build/common_functions.sh b/build/common_functions.sh index 569e68717..fc38dc5c3 100644 --- a/build/common_functions.sh +++ b/build/common_functions.sh @@ -265,6 +265,13 @@ function pack_burn_image popd )} +function pack_sd_image +{( + pushd "$BUILD_PATH" + make sd_image || return "$?" + popd +)} + function pack_prog_img {( local tmp_dir