summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2022-12-25 21:10:39 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2022-12-26 08:53:58 +0100
commit192281ae3038a57d98c8e0a06bcab0bd8efa2fc7 (patch)
tree6e722088ac5182b9c1952fb3886a5402e478250c /mk
parent6605e98ef31bab3d073cc2e2b95ccb8eb41e33d1 (diff)
implement dual-boot for rockpi4-plus device
Diffstat (limited to 'mk')
-rw-r--r--mk/image.mk27
1 files changed, 25 insertions, 2 deletions
diff --git a/mk/image.mk b/mk/image.mk
index f17d2cb09..34822895c 100644
--- a/mk/image.mk
+++ b/mk/image.mk
@@ -354,18 +354,41 @@ ifeq ($(ADK_RUNTIME_FIX_PERMISSION),y)
PATH='$(HOST_PATH)' $(FAKEROOT) $(ADK_TOPDIR)/scripts/fakeroot.sh
rm $(ADK_TOPDIR)/scripts/fakeroot.sh $(STAGING_TARGET_DIR)/scripts/permissions.sh
endif
+ifeq ($(ADK_TARGET_DUAL_BOOT),y)
+ $(CP) $(FW_DIR)/kernel $(TARGET_DIR)
+ $(CP) $(FW_DIR)/*.dtb $(TARGET_DIR)
+ mkdir $(TARGET_DIR)/extlinux
+ $(CP) $(EXTLINUX) $(TARGET_DIR)/extlinux
+ $(SED) "s#root=.*#root=/dev/$(ADK_TARGET_ROOTDEV)p1#" $(TARGET_DIR)/extlinux/extlinux.conf
+ PATH='${HOST_PATH}' $(FAKEROOT) mkfs.ext2 \
+ -d "$(TARGET_DIR)" \
+ -r 1 -N 0 -m 5 -L "rootfs1" \
+ $(FW_DIR)/rootfs1.ext "64M" $(MAKE_TRACE)
+ $(SED) "s#root=.*#root=/dev/$(ADK_TARGET_ROOTDEV)p2#" $(TARGET_DIR)/extlinux/extlinux.conf
+ PATH='${HOST_PATH}' $(FAKEROOT) mkfs.ext2 \
+ -d "$(TARGET_DIR)" \
+ -r 1 -N 0 -m 5 -L "rootfs2" \
+ $(FW_DIR)/rootfs2.ext "64M" $(MAKE_TRACE)
+ PATH='${HOST_PATH}' genimage \
+ --config "$(GENCFG)" \
+ --tmppath "${FW_DIR}/temp" \
+ --rootpath "$(TARGET_DIR)" \
+ --inputpath "$(FW_DIR)" \
+ --outputpath "$(FW_DIR)" $(MAKE_TRACE)
+else
PATH='${HOST_PATH}' $(FAKEROOT) mkfs.ext2 \
-d "$(TARGET_DIR)" \
-r 1 -N 0 -m 5 -L "rootfs" \
- $(FW_DIR)/rootfs.ext "48M" $(MAKE_TRACE)
+ $(FW_DIR)/rootfs.ext "64M" $(MAKE_TRACE)
PATH='${HOST_PATH}' genimage \
--config "$(GENCFG)" \
--tmppath "${FW_DIR}/temp" \
--rootpath "$(TARGET_DIR)" \
--inputpath "$(FW_DIR)" \
--outputpath "$(FW_DIR)" $(MAKE_TRACE)
+endif
ifeq ($(ADK_TARGET_DUAL_BOOT),y)
- (cd ${TARGET_DIR}; find . | grep -v ./boot/ | sed -n '/^\.\//s///p' | sort | \
+ (cd ${TARGET_DIR}; find . | sed -n '/^\.\//s///p' | sort | \
PATH='${HOST_PATH}' $(CPIO) -o --quiet -Hustar --owner=0:0 | \
${XZ} -c > ${FW_DIR}/openadk.tar.xz)
(cd ${FW_DIR}; PATH='${HOST_PATH}' sha256sum openadk.tar.xz \