mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-23 14:08:31 +00:00
osbuilder: fix default build target in makefile
The .dracut_rootfs.done file is accidentally being picked up as the default target, regardless of BUILD_METHOD. Move the 'all' target definition up, so that it's the default (=first) target in the makefile. Additionally make the .dracut_rootfs.done target conditional on the right BUILD_METHOD being selected, as building it doesn't make sense with BUILD_METHOD=distro. Fixes: #6235 Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
parent
8ae14f6a55
commit
0a21ad78b1
@ -85,6 +85,9 @@ endif
|
|||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: image initrd
|
||||||
|
|
||||||
rootfs-%: $(ROOTFS_BUILD_DEST)/.%$(ROOTFS_MARKER_SUFFIX)
|
rootfs-%: $(ROOTFS_BUILD_DEST)/.%$(ROOTFS_MARKER_SUFFIX)
|
||||||
@ # DONT remove. This is not cancellation rule.
|
@ # DONT remove. This is not cancellation rule.
|
||||||
|
|
||||||
@ -97,11 +100,13 @@ $(ROOTFS_BUILD_DEST)/.%$(ROOTFS_MARKER_SUFFIX):: rootfs-builder/%
|
|||||||
# extract it in a local folder.
|
# extract it in a local folder.
|
||||||
# Notes:
|
# Notes:
|
||||||
# - assuming a not compressed initrd.
|
# - assuming a not compressed initrd.
|
||||||
|
ifeq (dracut,$(BUILD_METHOD))
|
||||||
.PRECIOUS: $(ROOTFS_BUILD_DEST)/.dracut$(ROOTFS_MARKER_SUFFIX)
|
.PRECIOUS: $(ROOTFS_BUILD_DEST)/.dracut$(ROOTFS_MARKER_SUFFIX)
|
||||||
$(ROOTFS_BUILD_DEST)/.dracut$(ROOTFS_MARKER_SUFFIX): $(TARGET_INITRD)
|
$(ROOTFS_BUILD_DEST)/.dracut$(ROOTFS_MARKER_SUFFIX): $(TARGET_INITRD)
|
||||||
mkdir -p $(TARGET_ROOTFS)
|
mkdir -p $(TARGET_ROOTFS)
|
||||||
(cd $(TARGET_ROOTFS); cat $< | cpio --extract --preserve-modification-time --make-directories)
|
(cd $(TARGET_ROOTFS); cat $< | cpio --extract --preserve-modification-time --make-directories)
|
||||||
@touch $@
|
@touch $@
|
||||||
|
endif
|
||||||
|
|
||||||
image-%: $(IMAGES_BUILD_DEST)/kata-containers-image-%.img
|
image-%: $(IMAGES_BUILD_DEST)/kata-containers-image-%.img
|
||||||
@ # DONT remove. This is not cancellation rule.
|
@ # DONT remove. This is not cancellation rule.
|
||||||
@ -117,9 +122,6 @@ initrd-%: $(IMAGES_BUILD_DEST)/kata-containers-initrd-%.img
|
|||||||
$(IMAGES_BUILD_DEST)/kata-containers-initrd-%.img: rootfs-%
|
$(IMAGES_BUILD_DEST)/kata-containers-initrd-%.img: rootfs-%
|
||||||
$(call silent_run,Creating initrd image for $*,$(INITRD_BUILDER) -o $@ $(ROOTFS_BUILD_DEST)/$*_rootfs)
|
$(call silent_run,Creating initrd image for $*,$(INITRD_BUILDER) -o $@ $(ROOTFS_BUILD_DEST)/$*_rootfs)
|
||||||
|
|
||||||
.PHONY: all
|
|
||||||
all: image initrd
|
|
||||||
|
|
||||||
.PHONY: rootfs
|
.PHONY: rootfs
|
||||||
rootfs: $(TARGET_ROOTFS_MARKER)
|
rootfs: $(TARGET_ROOTFS_MARKER)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user