This one incorporates feedback from mburns to default certain values.
Darryl L. Pierce
2010-Mar-29 19:53 UTC
[Ovirt-devel] [PATCH] Moves building ovirt-node-image.iso into the ovirt-node repo.
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 | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 89 insertions(+), 2 deletions(-) diff --git a/recipe/Makefile.am b/recipe/Makefile.am index c8a7b94..fb34437 100644 --- a/recipe/Makefile.am +++ b/recipe/Makefile.am @@ -1,12 +1,39 @@ +# Copyright (C) 2010, Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + FEDORA_MIRROR = http://mirrors.fedoraproject.org/mirrorlist CUR_RAWHIDE = 14 CUR_DEVEL = 13 CUR_PREVIEW = 12 -PREVIEW_URL ?= http://jforbes.fedorapeople.org/virt-preview/f$(CUR_PREVIEW)/$(ARCH) -OVIRT_REPO_URL = http://ovirt.org/repos/ovirt/$(FEDORA)/$(ARCH) +PREVIEW_URL ?= http://jforbes.fedorapeople.org/virt-preview/f$(CUR_PREVIEW)/$(ARCH) +OVIRT_REPO_URL ?= http://ovirt.org/repos/ovirt/$(FEDORA)/$(ARCH) FEDORA = $(shell rpm --eval '%{fedora}') ARCH = $(shell rpm --eval '%{_arch}') +OVIRT_NODE_RECIPE = ovirt-node-recipe.ks +PKG_FMT = iso +PACKAGE = ovirt-node-image +OVIRT_CACHE_DIR ? =$(HOME)/ovirt-cache +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 +AUTH_KEYS ?= $(HOME)/.ssh/authorized_keys OVIRT_NODE_TOOLSdir = $(datadir)/ovirt-node-tools OVIRT_NODE_TOOLS_DATA = \ @@ -51,4 +78,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' \ + $(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 -- 1.6.6.1