Skip to content

Commit

Permalink
Merge pull request #3727 from sam-berning/kernel-settings-extension
Browse files Browse the repository at this point in the history
settings: add kernel settings extension
  • Loading branch information
sam-berning authored Jan 25, 2024
2 parents 5653daa + f4a4e8c commit 9ed9126
Show file tree
Hide file tree
Showing 28 changed files with 286 additions and 56 deletions.
21 changes: 21 additions & 0 deletions packages/settings-kernel/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "settings-kernel"
version = "0.1.0"
edition = "2021"
publish = false
build = "../build.rs"

[lib]
path = "../packages.rs"

[package.metadata.build-package]
source-groups = [
"settings-extensions/kernel"
]

# RPM BuildRequires
[build-dependencies]
glibc = { path = "../glibc" }

# RPM Requires
[dependencies]
39 changes: 39 additions & 0 deletions packages/settings-kernel/settings-kernel.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
%global _cross_first_party 1
%undefine _debugsource_packages

%global extension_name kernel

Name: %{_cross_os}settings-%{extension_name}
Version: 0.0
Release: 0%{?dist}
Summary: settings-%{extension_name}
License: Apache-2.0 OR MIT
URL: https://github.com/bottlerocket-os/bottlerocket

BuildRequires: %{_cross_os}glibc-devel

%description
%{summary}.

%prep
%setup -T -c
%cargo_prep

%build
%cargo_build --manifest-path %{_builddir}/sources/Cargo.toml \
-p settings-extension-%{extension_name}

%install
install -d %{buildroot}%{_cross_libexecdir}
install -p -m 0755 \
${HOME}/.cache/%{__cargo_target}/release/settings-extension-%{extension_name} \
%{buildroot}%{_cross_libexecdir}

install -d %{buildroot}%{_cross_libexecdir}/settings
ln -sf \
../settings-extension-%{extension_name} \
%{buildroot}%{_cross_libexecdir}/settings/%{extension_name}

%files
%{_cross_libexecdir}/settings-extension-%{extension_name}
%{_cross_libexecdir}/settings/%{extension_name}
14 changes: 14 additions & 0 deletions sources/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sources/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ members = [

"models",

"settings-extensions/kernel",
"settings-extensions/motd",
"settings-extensions/ntp",
"settings-extensions/container-registry",
Expand Down
1 change: 1 addition & 0 deletions sources/models/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ serde = { version = "1", features = ["derive"] }
toml = "0.5"

# settings extensions
settings-extension-kernel = { path = "../settings-extensions/kernel", version = "0.1" }
settings-extension-motd = { path = "../settings-extensions/motd", version = "0.1" }
settings-extension-ntp = { path = "../settings-extensions/ntp", version = "0.1" }
settings-extension-container-registry = { path = "../settings-extensions/container-registry", version = "0.1" }
Expand Down
4 changes: 2 additions & 2 deletions sources/models/src/aws-dev/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::collections::HashMap;

use crate::{
AwsSettings, BootSettings, BootstrapContainer, CloudFormationSettings, DnsSettings,
HostContainer, KernelSettings, MetricsSettings, NetworkSettings, OciHooks, PemCertificate,
HostContainer, MetricsSettings, NetworkSettings, OciHooks, PemCertificate,
};
use modeled_types::Identifier;

Expand All @@ -17,7 +17,7 @@ struct Settings {
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
kernel: KernelSettings,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: AwsSettings,
metrics: MetricsSettings,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-ecs-1-nvidia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::collections::HashMap;

use crate::{
AutoScalingSettings, AwsSettings, BootstrapContainer, CloudFormationSettings, DnsSettings,
ECSSettings, HostContainer, KernelSettings, MetricsSettings, NetworkSettings, OciDefaults,
OciHooks, PemCertificate,
ECSSettings, HostContainer, MetricsSettings, NetworkSettings, OciDefaults, OciHooks,
PemCertificate,
};
use modeled_types::Identifier;

Expand All @@ -18,7 +18,7 @@ struct Settings {
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
kernel: KernelSettings,
kernel: settings_extension_kernel::KernelSettingsV1,
aws: AwsSettings,
ecs: ECSSettings,
metrics: MetricsSettings,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-ecs-1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::collections::HashMap;

use crate::{
AutoScalingSettings, AwsSettings, BootstrapContainer, CloudFormationSettings, DnsSettings,
ECSSettings, HostContainer, KernelSettings, MetricsSettings, NetworkSettings, OciDefaults,
OciHooks, PemCertificate,
ECSSettings, HostContainer, MetricsSettings, NetworkSettings, OciDefaults, OciHooks,
PemCertificate,
};
use modeled_types::Identifier;

Expand All @@ -18,7 +18,7 @@ struct Settings {
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
kernel: KernelSettings,
kernel: settings_extension_kernel::KernelSettingsV1,
aws: AwsSettings,
ecs: ECSSettings,
metrics: MetricsSettings,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-ecs-2-nvidia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::collections::HashMap;

use crate::{
AutoScalingSettings, AwsSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
DnsSettings, ECSSettings, HostContainer, KernelSettings, MetricsSettings, NetworkSettings,
OciDefaults, OciHooks, PemCertificate,
DnsSettings, ECSSettings, HostContainer, MetricsSettings, NetworkSettings, OciDefaults,
OciHooks, PemCertificate,
};
use modeled_types::Identifier;

Expand All @@ -18,7 +18,7 @@ struct Settings {
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
kernel: KernelSettings,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: AwsSettings,
ecs: ECSSettings,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-ecs-2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::collections::HashMap;

use crate::{
AutoScalingSettings, AwsSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
DnsSettings, ECSSettings, HostContainer, KernelSettings, MetricsSettings, NetworkSettings,
OciDefaults, OciHooks, PemCertificate,
DnsSettings, ECSSettings, HostContainer, MetricsSettings, NetworkSettings, OciDefaults,
OciHooks, PemCertificate,
};
use modeled_types::Identifier;

Expand All @@ -18,7 +18,7 @@ struct Settings {
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
kernel: KernelSettings,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: AwsSettings,
ecs: ECSSettings,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.24-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
AutoScalingSettings, AwsSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
DnsSettings, HostContainer, KernelSettings, KubernetesSettings, MetricsSettings,
NetworkSettings, OciDefaults, OciHooks, PemCertificate,
DnsSettings, HostContainer, KubernetesSettings, MetricsSettings, NetworkSettings, OciDefaults,
OciHooks, PemCertificate,
};
use modeled_types::Identifier;

Expand All @@ -19,7 +19,7 @@ struct Settings {
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
kernel: KernelSettings,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: AwsSettings,
metrics: MetricsSettings,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.24/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
AutoScalingSettings, AwsSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KernelSettings, KubernetesSettings,
MetricsSettings, NetworkSettings, OciDefaults, OciHooks, PemCertificate,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, MetricsSettings,
NetworkSettings, OciDefaults, OciHooks, PemCertificate,
};
use modeled_types::Identifier;

Expand All @@ -19,7 +19,7 @@ struct Settings {
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
kernel: KernelSettings,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: AwsSettings,
metrics: MetricsSettings,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.25-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
AutoScalingSettings, AwsSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
DnsSettings, HostContainer, KernelSettings, KubernetesSettings, MetricsSettings,
NetworkSettings, OciDefaults, OciHooks, PemCertificate,
DnsSettings, HostContainer, KubernetesSettings, MetricsSettings, NetworkSettings, OciDefaults,
OciHooks, PemCertificate,
};
use modeled_types::Identifier;

Expand All @@ -19,7 +19,7 @@ struct Settings {
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
kernel: KernelSettings,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: AwsSettings,
metrics: MetricsSettings,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.25/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
AutoScalingSettings, AwsSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KernelSettings, KubernetesSettings,
MetricsSettings, NetworkSettings, OciDefaults, OciHooks, PemCertificate,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, MetricsSettings,
NetworkSettings, OciDefaults, OciHooks, PemCertificate,
};
use modeled_types::Identifier;

Expand All @@ -19,7 +19,7 @@ struct Settings {
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
kernel: KernelSettings,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: AwsSettings,
metrics: MetricsSettings,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.26-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
AutoScalingSettings, AwsSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
DnsSettings, HostContainer, KernelSettings, KubernetesSettings, MetricsSettings,
NetworkSettings, OciDefaults, OciHooks, PemCertificate,
DnsSettings, HostContainer, KubernetesSettings, MetricsSettings, NetworkSettings, OciDefaults,
OciHooks, PemCertificate,
};
use modeled_types::Identifier;

Expand All @@ -19,7 +19,7 @@ struct Settings {
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
kernel: KernelSettings,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: AwsSettings,
metrics: MetricsSettings,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.26/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
AutoScalingSettings, AwsSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KernelSettings, KubernetesSettings,
MetricsSettings, NetworkSettings, OciDefaults, OciHooks, PemCertificate,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, MetricsSettings,
NetworkSettings, OciDefaults, OciHooks, PemCertificate,
};
use modeled_types::Identifier;

Expand All @@ -19,7 +19,7 @@ struct Settings {
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
kernel: KernelSettings,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: AwsSettings,
metrics: MetricsSettings,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.29-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
AutoScalingSettings, AwsSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
DnsSettings, HostContainer, KernelSettings, KubernetesSettings, MetricsSettings,
NetworkSettings, OciDefaults, OciHooks, PemCertificate,
DnsSettings, HostContainer, KubernetesSettings, MetricsSettings, NetworkSettings, OciDefaults,
OciHooks, PemCertificate,
};
use modeled_types::Identifier;

Expand All @@ -19,7 +19,7 @@ struct Settings {
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
kernel: KernelSettings,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: AwsSettings,
metrics: MetricsSettings,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.29/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
AutoScalingSettings, AwsSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KernelSettings, KubernetesSettings,
MetricsSettings, NetworkSettings, OciDefaults, OciHooks, PemCertificate,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, MetricsSettings,
NetworkSettings, OciDefaults, OciHooks, PemCertificate,
};
use modeled_types::Identifier;

Expand All @@ -19,7 +19,7 @@ struct Settings {
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
kernel: KernelSettings,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: AwsSettings,
metrics: MetricsSettings,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/metal-dev/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use model_derive::model;
use std::collections::HashMap;

use crate::{
BootSettings, BootstrapContainer, DnsSettings, HostContainer, KernelSettings, MetricsSettings,
NetworkSettings, OciHooks, PemCertificate,
BootSettings, BootstrapContainer, DnsSettings, HostContainer, MetricsSettings, NetworkSettings,
OciHooks, PemCertificate,
};
use modeled_types::Identifier;

Expand All @@ -17,7 +17,7 @@ struct Settings {
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
kernel: KernelSettings,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
metrics: MetricsSettings,
pki: HashMap<Identifier, PemCertificate>,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/metal-k8s-1.24/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::collections::HashMap;

use crate::{
AwsSettings, BootSettings, BootstrapContainer, ContainerRuntimeSettings, DnsSettings,
HostContainer, KernelSettings, KubernetesSettings, MetricsSettings, NetworkSettings,
OciDefaults, OciHooks, PemCertificate,
HostContainer, KubernetesSettings, MetricsSettings, NetworkSettings, OciDefaults, OciHooks,
PemCertificate,
};
use modeled_types::Identifier;

Expand All @@ -19,7 +19,7 @@ struct Settings {
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
kernel: KernelSettings,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: AwsSettings,
metrics: MetricsSettings,
Expand Down
Loading

0 comments on commit 9ed9126

Please sign in to comment.