diff --git a/.files b/.files index d669279..85c0e2a 100644 Binary files a/.files and b/.files differ diff --git a/.rev b/.rev index 6a049fe..19854cc 100644 --- a/.rev +++ b/.rev @@ -24,4 +24,20 @@ 899507 + + e368cebe21f70eb61df711ed89a000a3 + 5.0.0 + + dimstar_suse + - Forward port fix-authorized-keys-location.patch +- Add set-default-user.patch + + Set the default user to suse +- Add fix-authorized-keys-location.patch + + Write the ssh keys to the standard location +- Add no-network-args.patch + + Networks arguments on the kernel command line are set during image build + there is no need for another place for a hard coded list. +- Create target dir for afterburn to write configuration file to + 906250 + diff --git a/.servicemark b/.servicemark index 41bab11..c9e59aa 100644 --- a/.servicemark +++ b/.servicemark @@ -1 +1 @@ -bbb7d1da4b5f80f5497c11a7caf43d6b +a344d9467b94c7cdc18139bb308b6e19 diff --git a/afterburn.changes b/afterburn.changes index 4a1ca5e..7f47061 100644 --- a/afterburn.changes +++ b/afterburn.changes @@ -1,4 +1,21 @@ ------------------------------------------------------------------- +Tue Jul 13 18:39:31 UTC 2021 - Robert Schweikert + +- Forward port fix-authorized-keys-location.patch + +------------------------------------------------------------------- +Mon Jul 12 20:00:43 UTC 2021 - Robert Schweikert + +- Add set-default-user.patch + + Set the default user to suse +- Add fix-authorized-keys-location.patch + + Write the ssh keys to the standard location +- Add no-network-args.patch + + Networks arguments on the kernel command line are set during image build + there is no need for another place for a hard coded list. +- Create target dir for afterburn to write configuration file to + +------------------------------------------------------------------- Fri Jun 11 14:02:00 UTC 2021 - Sayali Lunkad - Add dracut modules for afterburn diff --git a/afterburn.spec b/afterburn.spec index b99dfc2..a39bcfc 100644 --- a/afterburn.spec +++ b/afterburn.spec @@ -29,6 +29,9 @@ URL: https://coreos.github.io/afterburn/ Source0: https://github.com/coreos/afterburn/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: https://github.com/coreos/afterburn/releases/download/v%{version}/afterburn-%{version}-vendor.tar.gz Source2: cargo_config +Patch1: fix-authorized-keys-location.patch +Patch2: set-default-user.patch +Patch3: no-network-args.patch ExcludeArch: %ix86 s390x ppc64le armhfp armv7hl @@ -50,7 +53,11 @@ Dracut module that enables afterburn and corresponding services to run in the initramfs on boot. %prep -%autosetup -p1 -a1 +%autosetup -N -a1 +%patch1 -p0 +%patch2 -p0 +%patch3 -p0 + mkdir .cargo cp %{SOURCE2} .cargo/config # Remove exec bits to prevent an issue in fedora shebang checking @@ -63,16 +70,19 @@ cargo build --offline --release %install install -D -d -m 0755 %{buildroot}%{_bindir} install -D -d -m 0755 %{buildroot}%{_unitdir} +install -D -d -m 0755 %{buildroot}%{_sysconfdir}/cmdline.d install -m 0755 %{_builddir}/%{name}-%{version}/target/release/%{name} %{buildroot}%{_bindir}/%{name} install -m 0644 %{_builddir}/%{name}-%{version}/systemd/%{name}.service %{buildroot}%{_unitdir}/%{name}.service install -m 0644 %{_builddir}/%{name}-%{version}/systemd/%{name}-checkin.service %{buildroot}%{_unitdir}/%{name}-checkin.service -install -m 0644 %{_builddir}/%{name}-%{version}/systemd/%{name}-firstboot-checkin.service %{buildroot}%{_unitdir}/%{name}-firstboot-checkin.service -sed -e 's,@DEFAULT_INSTANCE@,'core',' < systemd/%{name}-sshkeys@.service.in > systemd/%{name}-sshkeys@.service.tmp +install -m 0644 %{_builddir}/%{name}-%{version}/systemd/%{name}-firstboot-checkin.service %{buildroot}%{_unitdir}/%{name}-firstboot-checkin.service +install -m 0644 %{_builddir}/%{name}-%{version}/systemd/%{name}-sshkeys.target %{buildroot}%{_unitdir}/%{name}-sshkeys.target +sed -e 's,@DEFAULT_INSTANCE@,'suse',' < systemd/%{name}-sshkeys@.service.in > systemd/%{name}-sshkeys@.service.tmp mv systemd/%{name}-sshkeys@.service.tmp systemd/%{name}-sshkeys@.service install -m 0644 %{_builddir}/%{name}-%{version}/systemd/%{name}-sshkeys@.service %{buildroot}%{_unitdir}/%{name}-sshkeys@.service mkdir -p %{buildroot}%{dracutmodulesdir} cp -a dracut/* %{buildroot}%{dracutmodulesdir} +rm %{buildroot}%{dracutmodulesdir}/30afterburn/afterburn-network-kargs.service %pre %service_add_pre %{name}.service %{name}-checkin.service %{name}-firstboot-checkin.service %{name}-sshkeys@.service @@ -94,8 +104,10 @@ cp -a dracut/* %{buildroot}%{dracutmodulesdir} %{_unitdir}/afterburn-checkin.service %{_unitdir}/afterburn-firstboot-checkin.service %{_unitdir}/afterburn-sshkeys@.service +%{_unitdir}/%{name}-sshkeys.target %files dracut +%dir %{_sysconfdir}/cmdline.d %{dracutmodulesdir}/30afterburn/ %changelog diff --git a/fix-authorized-keys-location.patch b/fix-authorized-keys-location.patch new file mode 100644 index 0000000..3eed5f7 --- /dev/null +++ b/fix-authorized-keys-location.patch @@ -0,0 +1,13 @@ +--- src/providers/mod.rs.orig ++++ src/providers/mod.rs +@@ -87,8 +87,8 @@ fn write_ssh_keys(user: User, ssh_keys: + .context("failed to switch user/group")?; + + // get paths +- let dir_path = user.home_dir().join(".ssh").join("authorized_keys.d"); +- let file_name = "afterburn"; ++ let dir_path = user.home_dir().join(".ssh"); ++ let file_name = "authorized_keys"; + let file_path = &dir_path.join(file_name); + + if !ssh_keys.is_empty() { diff --git a/no-network-args.patch b/no-network-args.patch new file mode 100644 index 0000000..df32713 --- /dev/null +++ b/no-network-args.patch @@ -0,0 +1,15 @@ +--- dracut/30afterburn/module-setup.sh.orig ++++ dracut/30afterburn/module-setup.sh +@@ -16,12 +16,8 @@ install() { + inst_simple "$moddir/afterburn-hostname.service" \ + "$systemdutildir/system/afterburn-hostname.service" + +- inst_simple "$moddir/afterburn-network-kargs.service" \ +- "$systemdutildir/system/afterburn-network-kargs.service" +- + # These services are only run once on first-boot, so they piggyback + # on Ignition completion target. + mkdir -p "$initdir/$systemdsystemunitdir/ignition-complete.target.requires" + ln -s "../afterburn-hostname.service" "$initdir/$systemdsystemunitdir/ignition-complete.target.requires/afterburn-hostname.service" +- ln -s "../afterburn-network-kargs.service" "$initdir/$systemdsystemunitdir/ignition-complete.target.requires/afterburn-network-kargs.service" + } diff --git a/set-default-user.patch b/set-default-user.patch new file mode 100644 index 0000000..eaf6a4e --- /dev/null +++ b/set-default-user.patch @@ -0,0 +1,11 @@ +--- Makefile.orig ++++ Makefile +@@ -1,7 +1,7 @@ + DESTDIR ?= + PREFIX ?= /usr + RELEASE ?= 1 +-DEFAULT_INSTANCE ?= core ++DEFAULT_INSTANCE ?= suse + + ifeq ($(RELEASE),1) + PROFILE ?= release