[Ovirt-devel] [PATCH] Moves building ovirt-node-image.iso into the ovirt-node repo.

Mike Burns mburns at redhat.com
Mon Mar 29 15:35:34 UTC 2010


On Fri, 2010-03-26 at 17:31 -0400, Darryl L. Pierce wrote:
> The ISO can now be built by going into the recipe directory and building
> the ovirt-node-image.iso target.
> 
> Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
> ---
>  recipe/Makefile.am |   68 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 68 insertions(+), 0 deletions(-)
> 
> diff --git a/recipe/Makefile.am b/recipe/Makefile.am
> index c8a7b94..a925f01 100644
> --- a/recipe/Makefile.am
> +++ b/recipe/Makefile.am
> @@ -7,6 +7,14 @@ OVIRT_REPO_URL    = http://ovirt.org/repos/ovirt/$(FEDORA)/$(ARCH)
>  
>  FEDORA            = $(shell rpm --eval '%{fedora}')
>  ARCH              = $(shell rpm --eval '%{_arch}')
More of a convenience consistent with the top level Makefile.  We should
default ovirt-cache
  +OVIRT_CACHE_DIR   ?= $(HOME)/ovirt-cache
> +OVIRT_NODE_RECIPE = ovirt-node-recipe.ks
> +PKG_FMT           = iso
> +PACKAGE           = ovirt-node-image
> +NODE_TMP          = $(OVIRT_CACHE_DIR)/$(PACKAGE)-$(ARCH)-tmp
> +OVIRT_LOCAL_REPO  ?= file://$(OVIRT_CACHE_DIR)/ovirt
> +NODE_KS           = $(NODE_TMP)/node.ks
> +NVR               = $(PACKAGE)-$(VERSION)-$(ARCH)
> +SUM               ?= sha1sum
ovirt-node-image makefile defaulted this variable also for dev builds.
  +AUTH_KEYS         ?= $(HOME)/.ssh/authorized_keys
>  
>  OVIRT_NODE_TOOLSdir = $(datadir)/ovirt-node-tools
>  OVIRT_NODE_TOOLS_DATA = 	\
> @@ -51,4 +59,64 @@ ovirt-node-recipe.ks:
>  # XXX broken ksflatten leaves %include
>  	sed -i 's/^%include /#&/' $@
>  
> +keys:
> +	if [ "$(_ovirt_dev)" = 1 -a -f $(AUTH_KEYS) ]; then \
> +	    cp -va $(AUTH_KEYS) ovirt-authorized_keys ;\
> +	fi
> +
> +no_nscd:
> +	if pgrep -xl nscd; then \
> +	    echo "Please stop nscd" ;\
> +	    exit 1 ;\
> +	fi
> +
> +# For Release: 0..., set _ovirt_dev=1 so that we get extra_release.GIT-
> +# annotated rpm version strings.
> +_ovirt_dev = \
> + $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \
> +   $(srcdir)/*.spec.in && echo 1 || :)
I think this should be top_srcdir since there is no spec file in the
recipe directory.  It needs to look at ovirt-node.spec.in in the top
level directory.
  +   $(top_srcdir)/*.spec.in && echo 1 || :)
> +
> +SELINUX_ENFORCING=$(shell /usr/sbin/getenforce)
> +$(NVR).$(PKG_FMT): no_nscd keys
> +	mkdir -p $(NODE_TMP)
> +	mkdir -p $(OVIRT_CACHE_DIR)/yum-$(ARCH)
> +	( \
> +	    case $(SELINUX_ENFORCING) in \
> +		Enforcing) sudo /usr/sbin/setenforce Permissive ;; \
> +		Permissive) ;; \
> +		*) if grep -q '^selinux --disabled' $(OVIRT_NODE_RECIPE); \
> +		   then \
> +		       echo WARNING: SELinux disabled in kickstart ;\
> +		   else \
> +		       echo ERROR: SELinux enabled in kickstart, \
> +		       but disabled on the build machine ;\
> +		       exit 1 ;\
> +		   fi ;; \
> +	    esac ;\
> +	)
> +	rm -f $(NODE_KS)
> +	if [ "$(_ovirt_dev)" = 1 ]; then \
> +	    echo "repo --name=ovirt-local --baseurl=$(OVIRT_LOCAL_REPO)" > $(NODE_KS) ;\
> +	fi
> +	cat $(OVIRT_NODE_RECIPE) >> $(NODE_KS)
> +	sudo livecd-creator --skip-minimize -c  $(NODE_KS)\
> +	    -f $(PACKAGE) \
> +	    --tmpdir='$(NODE_TMP)' \
> +	    --cache='$(OVIRT_CACHE_DIR)/yum-$(ARCH)'
> +	sudo chown $${USER} $(PACKAGE).$(PKG_FMT)
> +	( \
> +	    if [ $(SELINUX_ENFORCING) = Enforcing ]; then \
> +		sudo /usr/sbin/setenforce Enforcing || exit 1 ;\
> +	    fi \
> +	)
> +
> +	ln -nf $(PACKAGE).$(PKG_FMT) $(NVR).$(PKG_FMT)
> +
> +$(NVR).$(PKG_FMT).$(SUM): $(NVR).$(PKG_FMT)
> +	$(SUM) $(NVR).$(PKG_FMT) > $(NVR).$(PKG_FMT).$(SUM)
> +
> +$(PACKAGE).$(PKG_FMT) node: ovirt-node-recipe.ks $(NVR).$(PKG_FMT).$(SUM)
> +
> +PUNGI = $(NODE_TMP)/tree/pungi
> +
>  .PHONY: ovirt-node-recipe.ks repos.ks


Other than the above things, I saw one other thing that I'm not sure if
we should change or not.  I had done a cleanup of my ovirt-cache
directory before trying this build.  I didn't rebuild the ovirt-node
packages and the build failed because the default ovirt-local repo
didn't exist.  We could change the condition that determines whether to
add the ovirt-local repo to check that it exists.  If someone were to
override the OVIRT_LOCAL_REPO environment variable with something other
than a local file:// repo, it won't work.  

Thoughts?

Mike




More information about the ovirt-devel mailing list