forked from bottlerocket-os/bottlerocket
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request bottlerocket-os#3700 from jmt-lab/jmt/netdog/condi…
…tional-removal Jmt/netdog/conditional removal
- Loading branch information
Showing
232 changed files
with
360 additions
and
331 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[package] | ||
name = "netdog" | ||
version = "0.1.0" | ||
edition = "2021" | ||
publish = false | ||
build = "../build.rs" | ||
|
||
[lib] | ||
path = "../packages.rs" | ||
|
||
[package.metadata.build-packages] | ||
source-groups = [ | ||
"netdog", | ||
"dogtag", | ||
] | ||
|
||
# RPM BuildRequires | ||
[build-dependencies] | ||
glibc = { path = "../glibc" } | ||
|
||
[dependencies] | ||
wicked = { path = "../wicked" } | ||
systemd = { path = "../systemd" } |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
%global _cross_first_party 1 | ||
%undefine _debugsource_packages | ||
|
||
Name: %{_cross_os}netdog | ||
Version: 0.1.1 | ||
Release: 0%{?dist} | ||
Summary: Bottlerocket network configuration helper | ||
License: Apache-2.0 OR MIT | ||
URL: https://github.com/bottlerocket-os/bottlerocket | ||
|
||
Source0: netdog-tmpfiles.conf | ||
|
||
Source10: run-netdog.mount | ||
Source11: write-network-status.service | ||
Source12: generate-network-config.service | ||
Source13: disable-udp-offload.service | ||
|
||
Source20: 00-resolved.conf | ||
|
||
BuildRequires: %{_cross_os}glibc-devel | ||
Requires: %{_cross_os}hostname-reverse-dns | ||
Requires: (%{_cross_os}hostname-imds if %{_cross_os}variant-platform(aws)) | ||
Requires: (%{_cross_os}netdog-systemd-networkd if %{_cross_os}image-feature(systemd-networkd)) | ||
Requires: (%{_cross_os}netdog-wicked if %{_cross_os}image-feature(no-systemd-networkd)) | ||
|
||
%description | ||
%{summary}. | ||
|
||
%package systemd-networkd | ||
Summary: Bottlerocket network configuration helper | ||
Requires: %{name} | ||
Requires: %{_cross_os}systemd-networkd | ||
Requires: %{_cross_os}systemd-resolved | ||
Conflicts: (%{_cross_os}netdog-wicked or %{_cross_os}image-feature(no-systemd-networkd)) | ||
%description -n %{_cross_os}netdog-systemd-networkd | ||
%{summary}. | ||
|
||
%package wicked | ||
Summary: Bottlerocket network configuration helper | ||
Requires: %{name} | ||
Requires: %{_cross_os}wicked | ||
Conflicts: (%{_cross_os}netdog-systemd-networkd or %{_cross_os}image-feature(systemd-networkd)) | ||
%description -n %{_cross_os}netdog-wicked | ||
%{summary}. | ||
|
||
%package -n %{_cross_os}hostname-reverse-dns | ||
Summary: Reverse DNS Hostname detector | ||
%description -n %{_cross_os}hostname-reverse-dns | ||
%{summary} | ||
|
||
%package -n %{_cross_os}hostname-imds | ||
Summary: IMDS Hostname detector | ||
%description -n %{_cross_os}hostname-imds | ||
%{summary} | ||
|
||
%prep | ||
%setup -T -c | ||
%cargo_prep | ||
|
||
%build | ||
mkdir bin | ||
|
||
echo "** Build Dogtag Hostname Detectors" | ||
%cargo_build --manifest-path %{_builddir}/sources/Cargo.toml \ | ||
-p dogtag \ | ||
--bins \ | ||
--target-dir=${HOME}/.cache/dogtag | ||
|
||
echo "** Build Netdog Binaries" | ||
%cargo_build --manifest-path %{_builddir}/sources/Cargo.toml \ | ||
-p netdog \ | ||
--features default \ | ||
--target-dir=${HOME}/.cache/networkd | ||
%cargo_build --manifest-path %{_builddir}/sources/Cargo.toml \ | ||
-p netdog \ | ||
--features wicked \ | ||
--target-dir=${HOME}/.cache/wicked | ||
|
||
%install | ||
install -d %{buildroot}%{_cross_libexecdir}/hostname-detectors | ||
install -p -m 0755 ${HOME}/.cache/dogtag/%{__cargo_target}/release/20-imds %{buildroot}%{_cross_libexecdir}/hostname-detectors/20-imds | ||
install -p -m 0755 ${HOME}/.cache/dogtag/%{__cargo_target}/release/10-reverse-dns %{buildroot}%{_cross_libexecdir}/hostname-detectors/10-reverse-dns | ||
|
||
install -d %{buildroot}%{_cross_bindir} | ||
install -p -m 0755 ${HOME}/.cache/networkd/%{__cargo_target}/release/netdog %{buildroot}%{_cross_bindir}/netdog-systemd-networkd | ||
install -p -m 0755 ${HOME}/.cache/wicked/%{__cargo_target}/release/netdog %{buildroot}%{_cross_bindir}/netdog-wicked | ||
|
||
install -d %{buildroot}%{_cross_tmpfilesdir} | ||
install -p -m 0644 %{S:0} %{buildroot}%{_cross_tmpfilesdir}/netdog.conf | ||
|
||
install -d %{buildroot}%{_cross_unitdir} | ||
install -p -m 0644 %{S:10} %{S:11} %{S:12} %{S:13} %{buildroot}%{_cross_unitdir} | ||
|
||
install -d %{buildroot}%{_cross_libdir} | ||
install -d %{buildroot}%{_cross_libdir}/systemd/resolved.conf.d | ||
install -p -m 0644 %{S:20} %{buildroot}%{_cross_libdir}/systemd/resolved.conf.d | ||
|
||
%post wicked -p <lua> | ||
posix.symlink("netdog-wicked", "%{_cross_bindir}/netdog") | ||
|
||
%post systemd-networkd -p <lua> | ||
posix.symlink("netdog-systemd-networkd", "%{_cross_bindir}/netdog") | ||
|
||
%files | ||
%{_cross_tmpfilesdir}/netdog.conf | ||
%{_cross_unitdir}/generate-network-config.service | ||
%{_cross_unitdir}/disable-udp-offload.service | ||
%{_cross_unitdir}/run-netdog.mount | ||
|
||
%files -n %{_cross_os}hostname-reverse-dns | ||
%{_cross_libexecdir}/hostname-detectors/10-reverse-dns | ||
|
||
%files -n %{_cross_os}hostname-imds | ||
%{_cross_libexecdir}/hostname-detectors/20-imds | ||
|
||
%files systemd-networkd | ||
%{_cross_bindir}/netdog-systemd-networkd | ||
%{_cross_unitdir}/write-network-status.service | ||
%dir %{_cross_libdir}/systemd/resolved.conf.d | ||
%{_cross_libdir}/systemd/resolved.conf.d/00-resolved.conf | ||
|
||
%files wicked | ||
%{_cross_bindir}/netdog-wicked |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,6 @@ Source8: oci-default-hooks-json | |
Source9: cfsignal-toml | ||
Source10: warm-pool-wait-toml | ||
Source11: bottlerocket-cis-checks-metadata-json | ||
Source12: 00-resolved.conf | ||
Source13: kubernetes-cis-checks-metadata-json | ||
Source14: certdog-toml | ||
Source15: prairiedog-toml | ||
|
@@ -52,20 +51,15 @@ Source114: [email protected] | |
Source115: link-kernel-modules.service.in | ||
Source116: load-kernel-modules.service.in | ||
Source117: cfsignal.service | ||
Source118: generate-network-config.service | ||
Source119: reboot-if-required.service | ||
Source120: warm-pool-wait.service | ||
Source121: disable-udp-offload.service | ||
Source122: has-boot-ever-succeeded.service | ||
Source123: run-netdog.mount | ||
Source124: write-network-status.service | ||
|
||
# 2xx sources: tmpfilesd configs | ||
Source200: migration-tmpfiles.conf | ||
Source201: host-containers-tmpfiles.conf | ||
Source202: thar-be-updates-tmpfiles.conf | ||
Source203: bootstrap-containers-tmpfiles.conf | ||
Source204: netdog-tmpfiles.conf | ||
|
||
# 3xx sources: udev rules | ||
Source300: ephemeral-storage.rules | ||
|
@@ -90,7 +84,6 @@ Requires: %{_cross_os}host-containers | |
Requires: %{_cross_os}logdog | ||
Requires: %{_cross_os}metricdog | ||
Requires: %{_cross_os}migration | ||
Requires: %{_cross_os}netdog | ||
Requires: %{_cross_os}prairiedog | ||
Requires: %{_cross_os}schnauzer | ||
Requires: %{_cross_os}settings-committer | ||
|
@@ -129,17 +122,6 @@ Summary: Bottlerocket API client | |
%description -n %{_cross_os}apiclient | ||
%{summary}. | ||
|
||
%package -n %{_cross_os}netdog | ||
Summary: Bottlerocket network configuration helper | ||
%if %{with systemd_networkd} | ||
Requires: %{_cross_os}systemd-networkd | ||
Requires: %{_cross_os}systemd-resolved | ||
%else | ||
Requires: %{_cross_os}wicked | ||
%endif | ||
%description -n %{_cross_os}netdog | ||
%{summary}. | ||
|
||
%package -n %{_cross_os}sundog | ||
Summary: Updates settings dynamically based on user-specified generators | ||
%description -n %{_cross_os}sundog | ||
|
@@ -363,7 +345,6 @@ exec 1>&3 2>&4 | |
echo "** Output from non-static builds:" | ||
%cargo_build --manifest-path %{_builddir}/sources/Cargo.toml \ | ||
-p apiserver \ | ||
-p netdog \ | ||
-p sundog \ | ||
-p schnauzer \ | ||
-p bork \ | ||
|
@@ -411,7 +392,7 @@ fi | |
install -d %{buildroot}%{_cross_bindir} | ||
for p in \ | ||
apiserver \ | ||
netdog sundog schnauzer schnauzer-v2 bork \ | ||
sundog schnauzer schnauzer-v2 bork \ | ||
corndog thar-be-settings thar-be-updates host-containers \ | ||
storewolf settings-committer \ | ||
migrator prairiedog certdog \ | ||
|
@@ -522,17 +503,10 @@ install -p -m 0644 %{S:5} %{S:6} %{S:7} %{S:8} %{S:14} %{S:15} %{S:16} %{S:17} % | |
install -d %{buildroot}%{_cross_unitdir} | ||
install -p -m 0644 \ | ||
%{S:100} %{S:102} %{S:103} %{S:105} \ | ||
%{S:106} %{S:107} %{S:110} %{S:111} \ | ||
%{S:112} %{S:113} %{S:114} %{S:118} \ | ||
%{S:119} %{S:122} %{S:123} \ | ||
%{S:106} %{S:107} %{S:110} %{S:111} %{S:112} \ | ||
%{S:113} %{S:114} %{S:119} %{S:122} \ | ||
%{buildroot}%{_cross_unitdir} | ||
|
||
%if %{with systemd_networkd} | ||
install -p -m 0644 %{S:124} %{buildroot}%{_cross_unitdir} | ||
install -d %{buildroot}%{_cross_libdir}/systemd/resolved.conf.d | ||
install -p -m 0644 %{S:12} %{buildroot}%{_cross_libdir}/systemd/resolved.conf.d | ||
%endif | ||
|
||
%if %{with nvidia_flavor} | ||
sed -e 's|PREFIX|%{_cross_prefix}|g' %{S:115} > link-kernel-modules.service | ||
sed -e 's|PREFIX|%{_cross_prefix}|g' %{S:116} > load-kernel-modules.service | ||
|
@@ -556,17 +530,12 @@ install -p -m 0644 %{S:200} %{buildroot}%{_cross_tmpfilesdir}/migration.conf | |
install -p -m 0644 %{S:201} %{buildroot}%{_cross_tmpfilesdir}/host-containers.conf | ||
install -p -m 0644 %{S:202} %{buildroot}%{_cross_tmpfilesdir}/thar-be-updates.conf | ||
install -p -m 0644 %{S:203} %{buildroot}%{_cross_tmpfilesdir}/bootstrap-containers.conf | ||
install -p -m 0644 %{S:204} %{buildroot}%{_cross_tmpfilesdir}/netdog.conf | ||
|
||
install -d %{buildroot}%{_cross_udevrulesdir} | ||
install -p -m 0644 %{S:300} %{buildroot}%{_cross_udevrulesdir}/80-ephemeral-storage.rules | ||
install -p -m 0644 %{S:301} %{buildroot}%{_cross_udevrulesdir}/81-ebs-volumes.rules | ||
install -p -m 0644 %{S:302} %{buildroot}%{_cross_udevrulesdir}/82-supplemental-storage.rules | ||
|
||
%if %{with vmware_platform} | ||
install -p -m 0644 %{S:121} %{buildroot}%{_cross_unitdir} | ||
%endif | ||
|
||
%cross_scan_attribution --clarify %{_builddir}/sources/clarify.toml \ | ||
cargo --offline --locked %{_builddir}/sources/Cargo.toml | ||
|
||
|
@@ -589,20 +558,6 @@ install -p -m 0644 %{S:400} %{S:401} %{S:402} %{buildroot}%{_cross_licensedir} | |
%files -n %{_cross_os}apiclient | ||
%{_cross_bindir}/apiclient | ||
|
||
%files -n %{_cross_os}netdog | ||
%{_cross_bindir}/netdog | ||
%{_cross_tmpfilesdir}/netdog.conf | ||
%{_cross_unitdir}/generate-network-config.service | ||
%{_cross_unitdir}/run-netdog.mount | ||
%if %{with vmware_platform} | ||
%{_cross_unitdir}/disable-udp-offload.service | ||
%endif | ||
%if %{with systemd_networkd} | ||
%{_cross_unitdir}/write-network-status.service | ||
%dir %{_cross_libdir}/systemd/resolved.conf.d | ||
%{_cross_libdir}/systemd/resolved.conf.d/00-resolved.conf | ||
%endif | ||
|
||
%files -n %{_cross_os}corndog | ||
%{_cross_bindir}/corndog | ||
%{_cross_templatedir}/corndog-toml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.