From 56ab8c99fe4ac4b5d186a9fa4264afd577487d8b Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Thu, 22 Mar 2018 23:18:07 +0800 Subject: [PATCH 1/2] initrd-builder: fix ROOTFS_DIR typo It should be just ROOTFS. Signed-off-by: Peng Tao --- initrd-builder/initrd_builder.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/initrd-builder/initrd_builder.sh b/initrd-builder/initrd_builder.sh index a0bbc15d87..3cb25a531a 100755 --- a/initrd-builder/initrd_builder.sh +++ b/initrd-builder/initrd_builder.sh @@ -85,7 +85,7 @@ IMAGE_NAME=$(basename ${INITRD_IMAGE}) # The kata rootfs image expects init to be installed init="${ROOTFS}/sbin/init" -[ -x "${init}" ] || [ -L ${init} ] || die "/sbin/init is not installed in ${ROOTFS_DIR}" +[ -x "${init}" ] || [ -L ${init} ] || die "/sbin/init is not installed in ${ROOTFS}" OK "init is installed" [ "${AGENT_INIT}" == "yes" ] || [ -x "${ROOTFS}/usr/bin/${AGENT_BIN}" ] || \ die "/usr/bin/${AGENT_BIN} is not installed in ${ROOTFS} From 6e1f2e063d2f9371b839a4f9d82844e8d75f67be Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Thu, 22 Mar 2018 23:20:53 +0800 Subject: [PATCH 2/2] Makefile: allow to build image and initrd based on existing rootfs Just so that we do not have to re-build rootfs every time for local build/testing. Fixes: #69 Signed-off-by: Peng Tao --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6f3aaa5963..ccc2ea53e0 100644 --- a/Makefile +++ b/Makefile @@ -10,14 +10,19 @@ DISTRO_ROOTFS := "$(PWD)/$(DISTRO)_rootfs" IMG_SIZE=500 AGENT_INIT ?= no +all: rootfs image initrd rootfs: @echo Creating rootfs based on "$(DISTRO)" "$(MK_DIR)/rootfs-builder/rootfs.sh" -r "$(DISTRO_ROOTFS)" "$(DISTRO)" -image: rootfs +image: rootfs image-only + +image-only: @echo Creating image based on "$(DISTRO_ROOTFS)" "$(MK_DIR)/image-builder/image_builder.sh" -s "$(IMG_SIZE)" "$(DISTRO_ROOTFS)" -initrd: rootfs +initrd: rootfs initrd-only + +initrd-only: @echo Creating initrd image based on "$(DISTRO_ROOTFS)" "$(MK_DIR)/initrd-builder/initrd_builder.sh" "$(DISTRO_ROOTFS)"