diff --git a/dracut-ignition-not-in-path.patch b/dracut-ignition-not-in-path.patch new file mode 100644 index 0000000..b336f28 --- /dev/null +++ b/dracut-ignition-not-in-path.patch @@ -0,0 +1,24 @@ +diff --git a/dracut/30ignition/module-setup.sh b/dracut/30ignition/module-setup.sh +index 4b1c1aa..211da77 100755 +--- a/dracut/30ignition/module-setup.sh ++++ b/dracut/30ignition/module-setup.sh +@@ -11,7 +11,6 @@ install() { + chroot \ + groupadd \ + id \ +- ignition \ + mkfs.ext4 \ + mkfs.vfat \ + mkfs.xfs \ +@@ -32,6 +31,11 @@ install() { + # inst_script "$moddir/retry-umount.sh" \ + # "/usr/sbin/retry-umount" + ++ # Distro packaging is expected to install the ignition binary into the ++ # module directory. ++ inst_simple "$moddir/ignition" \ ++ "/usr/bin/ignition" ++ + inst_simple "$moddir/ignition-generator" \ + "$systemdutildir/system-generators/ignition-generator" + diff --git a/ignition.spec b/ignition.spec index a9eabf3..2436a8e 100644 --- a/ignition.spec +++ b/ignition.spec @@ -82,6 +82,8 @@ Source1: https://%{dracutprovider_prefix}/archive/%{dracutcommit}/%{dracu Patch0: 0001-grub-find-boot-partition-and-use-it-directly.patch Patch1: 0001-02_ignition_firstboot-Enable-networking-if-Ignition-.patch +# https://github.com/coreos/ignition-dracut/pull/56 +Patch2: dracut-ignition-not-in-path.patch # For RHEL7 we'll want to specify gopath and list of arches since there is no # gopath or go_arches macro. We'll also want to make sure we pull in golang @@ -343,6 +345,7 @@ This package contains a tool for validating Ignition configurations. cd %{dracutrepo}-%{dracutcommit} %patch0 -p1 %patch1 -p1 +%patch2 -p1 mv LICENSE ../LICENSE.dracut @@ -372,11 +375,6 @@ echo "Building ignition-validate..." %install -# ignition -install -d -p %{buildroot}%{_bindir} -install -p -m 0755 ./ignition %{buildroot}%{_bindir} -install -p -m 0755 ./ignition-validate %{buildroot}%{_bindir} - # ignition-dracut install -d -p %{buildroot}/%{dracutlibdir}/modules.d install -d -p %{buildroot}/%{_prefix}/lib/systemd/system @@ -388,6 +386,13 @@ install -m 0644 -t %{buildroot}/%{_prefix}/lib/systemd/system/ systemd/* install -m 0755 -t %{buildroot}/%{_sysconfdir}/grub.d/ grub/* popd >/dev/null +# ignition +install -d -p %{buildroot}%{_bindir} +install -p -m 0755 ./ignition-validate %{buildroot}%{_bindir} +# The ignition binary is only for dracut, and is dangerous to run from +# the command line. Install directly into the dracut module dir. +install -p -m 0755 ./ignition %{buildroot}/%{dracutlibdir}/modules.d/30ignition + # source codes for building projects %if 0%{?with_devel} install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ @@ -472,7 +477,6 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath} %files %license LICENSE LICENSE.dracut %doc README.md doc/ -%{_bindir}/%{name} %{dracutlibdir}/modules.d/30ignition %{dracutlibdir}/modules.d/99journald-conf %{_sysconfdir}/grub.d/* @@ -499,6 +503,7 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath} %changelog * Mon Mar 18 2019 Benjamin Gilbert - 0.31.0-4.gitf59a653 - Move dracut modules into main ignition package +- Move ignition binary out of the PATH - Move ignition-validate into a subpackage - Include ignition-dracut license file - Drop developer docs from base package diff --git a/tests/tests.yml b/tests/tests.yml index dde4b80..2745b45 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -9,7 +9,7 @@ tests: - ignition-run-version: dir: ./ - run: /usr/bin/ignition --version + run: /usr/lib/dracut/modules.d/30ignition/ignition --version - ignition-rpm-installed: dir: ./ run: /usr/bin/rpm -q ignition