Merge pull request #70 from bergwolf/build

allow to build image and initrd based on existing rootfs
This commit is contained in:
James O. D. Hunt 2018-03-22 16:39:16 +00:00 committed by GitHub
commit d0b3cf6d36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -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)"

View File

@ -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}