From f38f5cc168cba8cbc883c471fe71cb894debca2b Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Wed, 27 Jun 2018 15:58:27 -0700 Subject: [PATCH] Include example blueprints in the rpm This also sets ownership of /var/lib/lorax/composer/ to root:weldr to allow missing directories to be created at runtime. --- lorax.spec | 8 ++++++++ systemd/lorax-composer.service | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lorax.spec b/lorax.spec index 5ab12678..b8a30f43 100644 --- a/lorax.spec +++ b/lorax.spec @@ -163,6 +163,11 @@ build images, etc. from the command line. rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install +# Install example blueprints from the test suite. +# This path MUST match the lorax-composer.service blueprint path. +mkdir -p $RPM_BUILD_ROOT/var/lib/lorax/composer/blueprints/ +cp ./tests/pylorax/blueprints/*toml $RPM_BUILD_ROOT/var/lib/lorax/composer/blueprints/ + %pre composer getent group weldr >/dev/null 2>&1 || groupadd -r weldr >/dev/null 2>&1 || : getent passwd weldr >/dev/null 2>&1 || useradd -r -g weldr -d / -s /sbin/nologin -c "User for lorax-composer" weldr >/dev/null 2>&1 || : @@ -213,6 +218,9 @@ getent passwd weldr >/dev/null 2>&1 || useradd -r -g weldr -d / -s /sbin/nologin %dir %{_datadir}/lorax/composer %{_datadir}/lorax/composer/* %{_tmpfilesdir}/lorax-composer.conf +%dir %attr(0771, root, weldr) %{_sharedstatedir}/lorax/composer/ +%dir %attr(0771, root, weldr) %{_sharedstatedir}/lorax/composer/blueprints/ +%attr(0771, weldr, weldr) %{_sharedstatedir}/lorax/composer/blueprints/* %files -n composer-cli %{_bindir}/composer-cli diff --git a/systemd/lorax-composer.service b/systemd/lorax-composer.service index 3ef53cdd..2c6a3428 100644 --- a/systemd/lorax-composer.service +++ b/systemd/lorax-composer.service @@ -7,7 +7,7 @@ Wants=network-online.target User=root Type=simple ExecStartPre=/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/lorax-composer.conf -ExecStart=/usr/sbin/lorax-composer /var/lib/lorax/composer/recipes/ +ExecStart=/usr/sbin/lorax-composer /var/lib/lorax/composer/blueprints/ [Install] WantedBy=multi-user.target