forked from pool/afterburn
Accepting request 906250 from devel:kubic:ignition
- 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 OBS-URL: https://build.opensuse.org/request/show/906250 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/afterburn?expand=0&rev=4
This commit is contained in:
commit
2395f76db5
@ -1,3 +1,20 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 13 18:39:31 UTC 2021 - Robert Schweikert <rjschwei@suse.com>
|
||||
|
||||
- Forward port fix-authorized-keys-location.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 12 20:00:43 UTC 2021 - Robert Schweikert <rjschwei@suse.com>
|
||||
|
||||
- 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 <sayali.lunkad@suse.com>
|
||||
|
||||
|
@ -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
|
||||
|
13
fix-authorized-keys-location.patch
Normal file
13
fix-authorized-keys-location.patch
Normal file
@ -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() {
|
15
no-network-args.patch
Normal file
15
no-network-args.patch
Normal file
@ -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"
|
||||
}
|
11
set-default-user.patch
Normal file
11
set-default-user.patch
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user