build-vm: standalone build is a must, too
The problem was spotted by Alexander Bandura: bin/tar2vm wasn't present in the generated profile. I considered extending features.in/Makefile to include bin/ alongside lib/ but that would make the helper's location unpredictable (unless BUILDDIR is specified explicitly) so restricting sudoers would be harder; worse yet, the copied file would come with write access for the user building an image. The implications in restricted case are complex enough anyways so the recommended implementation would only include a fixed readonly location like /usr/share/mkimage-profiles/bin/tar2vm as laid out in doc/vm.txt, and that means it's in the metaprofile not a generated profile.
This commit is contained in:
parent
5f479eb80f
commit
cb764516eb
4
features.in/build-vm/generate.mk
Normal file
4
features.in/build-vm/generate.mk
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# copy tar2vm helper into generated profile to enable standalone builds
|
||||||
|
|
||||||
|
all:
|
||||||
|
@install -pD $(MKIMAGE_PROFILES)/bin/tar2vm $(BUILDDIR)/bin/tar2vm
|
@ -26,7 +26,6 @@ endif
|
|||||||
# 01defaults.cfg is included indefinitely
|
# 01defaults.cfg is included indefinitely
|
||||||
SYSLINUX_CFG := $(SYSLINUX_CFG) $(notdir $(SUBPROFILES)) defaults
|
SYSLINUX_CFG := $(SYSLINUX_CFG) $(notdir $(SUBPROFILES)) defaults
|
||||||
|
|
||||||
### have to operate BUILDDIR, not pretty...
|
|
||||||
DSTDIR := $(BUILDDIR)/stage1/files/syslinux/.in
|
DSTDIR := $(BUILDDIR)/stage1/files/syslinux/.in
|
||||||
|
|
||||||
# we can do SYSLINUX_{CFG,MODULES,FILES}
|
# we can do SYSLINUX_{CFG,MODULES,FILES}
|
||||||
|
4
main.mk
4
main.mk
@ -6,8 +6,6 @@
|
|||||||
# --- in BUILDDIR
|
# --- in BUILDDIR
|
||||||
# 4. build subprofiles and subsequently an image
|
# 4. build subprofiles and subsequently an image
|
||||||
|
|
||||||
MKIMAGE_PROFILES := $(dir $(lastword $(MAKEFILE_LIST)))
|
|
||||||
|
|
||||||
# deal with one target at a time
|
# deal with one target at a time
|
||||||
IMAGE_TARGET := $(firstword $(MAKECMDGOALS))# ve/generic.tar.gz
|
IMAGE_TARGET := $(firstword $(MAKECMDGOALS))# ve/generic.tar.gz
|
||||||
ifeq (./,$(dir $(IMAGE_TARGET)))# convenience fallback
|
ifeq (./,$(dir $(IMAGE_TARGET)))# convenience fallback
|
||||||
@ -26,6 +24,8 @@ else
|
|||||||
BUILDDIR_PREFIX ?= mkimage-profiles.build/$(IMAGE_CONF).$(ARCH)
|
BUILDDIR_PREFIX ?= mkimage-profiles.build/$(IMAGE_CONF).$(ARCH)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
export MKIMAGE_PROFILES := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
|
||||||
|
|
||||||
# preferences
|
# preferences
|
||||||
-include $(HOME)/.mkimage/profiles.mk
|
-include $(HOME)/.mkimage/profiles.mk
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user