Skip to content

Commit

Permalink
add: ultramarine-system-configs (#37)
Browse files Browse the repository at this point in the history
* add: ultramarine-system-configs

* split package into 2 subpackages

* move tmpfiles cleanup to desktop package

* move MTU probing into separate config

* remove tcp fastopen, filter tcp reverse paths

* logging tweaks

* actually, use the default qdisc for now

* leave journald configs to default

* Update comps.xml

Co-authored-by: lea <[email protected]>

* Remove default rp_filter since all is good enough

* Remove unnecessary lines from tmpfiles-cleanup.conf

* remove confusing comment

* cake???

* Revert "cake???"

This reverts commit c8363d9.

* Reapply "cake???"

This reverts commit b61af9a.

---------

Co-authored-by: lea <[email protected]>
  • Loading branch information
korewaChino and lleyton authored Oct 7, 2024
1 parent 8f27fa6 commit 4414f6f
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 3 deletions.
2 changes: 2 additions & 0 deletions comps.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<packagereq type="default">ultramarine-shell-config</packagereq>
<packagereq type="default">ultramarine-release</packagereq>
<packagereq type="default">ultramarine-fun</packagereq>
<packagereq type="default">ultramarine-system-configs-core</packagereq>
<packagereq type="default">ultramarine-phony-bookmarks</packagereq>
<packagereq type="default">git</packagereq>
<packagereq type="default">golang-github-ultramarine-linux-um</packagereq>
Expand All @@ -50,6 +51,7 @@
<packagereq type="mandatory">ultramarine-repos-extras</packagereq>
<packagereq type="default">ultramarine-backgrounds-common</packagereq>
<packagereq type="default">ultramarine-backgrounds-compat</packagereq>
<packagereq type="default">ultramarine-system-configs-desktop</packagereq>
<packagereq type="default">system76-scheduler</packagereq>
<packagereq type="default">orca</packagereq>
<packagereq type="default">speech-dispatcher-espeak-ng</packagereq>
Expand Down
3 changes: 0 additions & 3 deletions ultramarine/release/ultramarine-release.spec
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ Source28: longer-default-shutdown-timeout.conf

Source31: enable-kwin-system76-scheduler-integration.service
Source32: org.projectatomic.rpmostree1.rules
Source33: 50-ultramarine-networking.conf
Source34: ultramarine.urls

Source40: https://github.com/Ultramarine-Linux/xfce-config/archive/%{xfce_conf_commit}.tar.gz
Expand Down Expand Up @@ -769,7 +768,6 @@ cp -pr %{SOURCE54} %{buildroot}%{_sysconfdir}/anaconda/profile.d/ultramarine-xfc

# sysctls
mkdir -p %{buildroot}%{_prefix}/lib/sysctl.d/
cp -pr %{SOURCE33} %{buildroot}%{_prefix}/lib/sysctl.d/50-ultramarine-networking.conf


#########################
Expand Down Expand Up @@ -897,7 +895,6 @@ install -Dm0644 %{SOURCE32} -t %{buildroot}%{_datadir}/polkit-1/rules.d/
%{_sysconfdir}/anaconda/profile.d/ultramarine-gnome.conf
%{_sysconfdir}/anaconda/profile.d/ultramarine-plasma.conf
%{_sysconfdir}/anaconda/profile.d/ultramarine-xfce.conf
%{_prefix}/lib/sysctl.d/50-ultramarine-networking.conf
%license licenses/LICENSE licenses/README.license
%{_prefix}/lib/ultramarine-release
%{_prefix}/lib/systemd/user.conf.d/*
Expand Down
7 changes: 7 additions & 0 deletions ultramarine/ultramarine-system-configs/50-mtu-probing.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Enables MTU Probing for IPv4
# Fixes a quirk with some home network setups and
# some applications/games that have QoS issues with large packets
# e.g. Minecraft, Ubisoft Connect, etc.
# https://blog.cloudflare.com/path-mtu-discovery-in-practice/
# https://www.reddit.com/r/linux_gaming/comments/10oc0dq/comment/j6e0ds2
net.ipv4.tcp_mtu_probing=1
6 changes: 6 additions & 0 deletions ultramarine/ultramarine-system-configs/anda.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
project "pkg" {
rpm {
spec = "ultramarine-system-configs.spec"
sources = "."
}
}
4 changes: 4 additions & 0 deletions ultramarine/ultramarine-system-configs/bbr.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Enables the tcp_bbr kernel module
# to enable the BBR congestion control algorithm by Google
# https://cloud.google.com/blog/products/gcp/tcp-bbr-congestion-control-comes-to-gcp-your-internet-just-got-faster
tcp_bbr
9 changes: 9 additions & 0 deletions ultramarine/ultramarine-system-configs/networking-tweaks.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Enable BBR Congestion Control
# Requires the tcp_bbr module to be loaded, defined in /etc/modules-load.d/bbr.conf
net.core.default_qdisc = cake
net.ipv4.tcp_congestion_control = bbr


# Filter TCP reverse paths
# Validate the source address of the packets, this will prevent some spoofing attacks
net.ipv4.conf.all.rp_filter = 1
2 changes: 2 additions & 0 deletions ultramarine/ultramarine-system-configs/tmpfiles-cleanup.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# remove files in /var/tmp older than 10 days
D /var/tmp 1777 root root 10d
21 changes: 21 additions & 0 deletions ultramarine/ultramarine-system-configs/ultramarine-logrotate.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# /etc/logrotate.d/ultramarine-logrotate.conf

# see "man logrotate" for details

# global options do not affect preceding include directives

# rotate log files daily
daily

# keep 3 weeks worth of backlogs
rotate 3

# create new (empty) log files after rotating old ones
create

# use date as a suffix of the rotated file
dateext

compress

# system-specific logs may also be configured here.
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Name: ultramarine-system-configs
Version: 1
Release: 1%{?dist}
Summary: Various configuration files for a more comfortable Ultramarine desktop experience
BuildArch: noarch
License: MIT
URL: https://ultramarine-linux.org
Source1: tmpfiles-cleanup.conf
Source2: ultramarine-logrotate.conf
Source3: networking-tweaks.conf
Source4: bbr.conf
Source5: 50-mtu-probing.conf

BuildRequires: /usr/bin/install

%package core
Summary: Core system tweaks for Ultramarine Linux

%description core
This package provides various systemd configurations that improve system performance
and resource usage on Ultramarine Linux.

%package desktop
Summary: Desktop-specific tweaks for Ultramarine Linux

%description desktop
This package provides various systemd configurations that optimize desktop resource usage
and performance on Ultramarine Linux.


%description
This package provides various systemd configurations
to optimize desktop resource usage and performance on Ultramarine Linux.

The configs attempt to reduce disk usage for journaling and logging, and
cleaning up of unused temporary files periodically.

%prep

%build



%install
install -Dm644 %{SOURCE1} %{buildroot}/etc/tmpfiles.d/tmpfiles-cleanup.conf
install -Dm644 %{SOURCE2} %{buildroot}/etc/logrotate.d/ultramarine-logrotate.conf
install -Dm644 %{SOURCE3} %{buildroot}/etc/sysctl.d/50-networking-tweaks.conf
install -Dm644 %{SOURCE4} %{buildroot}/etc/modules-load.d/bbr.conf
install -Dm644 %{SOURCE5} %{buildroot}/etc/sysctl.d/50-mtu-probing.conf

%files


%files core
%defattr(-,root,root,-)
%config /etc/sysctl.d/50-networking-tweaks.conf
%config /etc/modules-load.d/bbr.conf

%files desktop
%defattr(-,root,root,-)
%config /etc/tmpfiles.d/tmpfiles-cleanup.conf
%config /etc/logrotate.d/ultramarine-logrotate.conf
%config /etc/sysctl.d/50-mtu-probing.conf

%changelog
* Sat Aug 03 2024 Cappy Ishihara <[email protected]>
- Initial release

0 comments on commit 4414f6f

Please sign in to comment.