Skip to content

Commit 094182f

Browse files
ventureooptr1337
authored andcommitted
Refactor setting of default values
Signed-off-by: Vasiliy Stelmachenok <[email protected]>
1 parent 8dad32c commit 094182f

File tree

10 files changed

+279
-279
lines changed

10 files changed

+279
-279
lines changed

linux-cachyos-bmq/PKGBUILD

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# Set these variables to ANYTHING that is not null or choose proper variable to enable them
1010

1111
### Selecting CachyOS config
12-
_cachy_config=${_cachy_config-y}
12+
: "${_cachy_config:=y}"
1313

1414
### Selecting the CPU scheduler
1515
# ATTENTION - only one of the following values can be selected:
@@ -20,25 +20,25 @@ _cachy_config=${_cachy_config-y}
2020
# 'eevdf' - select 'EEVDF Scheduler'
2121
# 'rt' - select EEVDF, but includes a series of realtime patches
2222
# 'rt-bore' - select Burst-Oriented Response Enhancer, but includes a series of realtime patches
23-
_cpusched=${_cpusched-bmq}
23+
: "${_cpusched:=bmq}"
2424

2525
### Tweak kernel options prior to a build via nconfig
26-
_makenconfig=${_makenconfig-}
26+
: "${_makenconfig:=}"
2727

2828
### Tweak kernel options prior to a build via menuconfig
29-
_makemenuconfig=${_makemenuconfig-}
29+
: "${_makemenuconfig:=}"
3030

3131
### Tweak kernel options prior to a build via xconfig
32-
_makexconfig=${_makexconfig-}
32+
: "${_makexconfig:=}"
3333

3434
### Tweak kernel options prior to a build via gconfig
35-
_makegconfig=${_makegconfig-}
35+
: "${_makegconfig:=}"
3636

3737
# NUMA is optimized for multi-socket motherboards.
3838
# A single multi-core CPU actually runs slower with NUMA enabled.
3939
# See, https://bugs.archlinux.org/task/31187
4040
# It seems that in 2023 this is not really a huge regression anymore
41-
_NUMAdisable=${_NUMAdisable-}
41+
: "${_NUMAdisable:=}"
4242

4343
# Compile ONLY used modules to VASTLYreduce the number of modules built
4444
# and the build time.
@@ -48,44 +48,44 @@ _NUMAdisable=${_NUMAdisable-}
4848
# This PKGBUILD read the database kept if it exists
4949
#
5050
# More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db
51-
_localmodcfg=${_localmodcfg-}
51+
: "${_localmodcfg:=}"
5252

5353
# Path to the list of used modules
54-
_localmodcfg_path=${_localmodcfg_path-"$HOME/.config/modprobed.db"}
54+
: "${_localmodcfg_path:="$HOME/.config/modprobed.db"}"
5555

5656
# Use the current kernel's .config file
5757
# Enabling this option will use the .config of the RUNNING kernel rather than
5858
# the ARCH defaults. Useful when the package gets updated and you already went
5959
# through the trouble of customizing your config options. NOT recommended when
6060
# a new kernel is released, but again, convenient for package bumps.
61-
_use_current=${_use_current-}
61+
: "${_use_current:=}"
6262

6363
### Enable KBUILD_CFLAGS -O3
64-
_cc_harder=${_cc_harder-y}
64+
: "${_cc_harder:=y}"
6565

6666
### Set performance governor as default
67-
_per_gov=${_per_gov-}
67+
: "${_per_gov:=}"
6868

6969
### Enable TCP_CONG_BBR3
70-
_tcp_bbr3=${_tcp_bbr3-}
70+
: "${_tcp_bbr3:=}"
7171

7272
### Running with a 1000HZ, 750Hz, 625Hz, 600 Hz, 500Hz, 300Hz, 250Hz and 100Hz tick rate
73-
_HZ_ticks=${_HZ_ticks-1000}
73+
: "${_HZ_ticks:=1000}"
7474

7575
## Choose between perodic, idle or full
7676
### Full tickless can give higher performances in various cases but, depending on hardware, lower consistency.
77-
_tickrate=${_tickrate-full}
77+
: "${_tickrate:=full}"
7878

7979
## Choose between full(low-latency), voluntary or server
80-
_preempt=${_preempt-full}
80+
: "${_preempt:=full}"
8181

8282
### Transparent Hugepages
8383
# ATTENTION - one of two predefined values should be selected!
8484
# 'always' - always enable THP
8585
# 'madvise' - madvise, prevent applications from allocating more memory resources than necessary
8686
# More infos here:
8787
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/performance_tuning_guide/sect-red_hat_enterprise_linux-performance_tuning_guide-configuring_transparent_huge_pages
88-
_hugepage=${_hugepage-always}
88+
: "${_hugepage:=always}"
8989

9090
# CPU compiler optimizations - Defaults to prompt at kernel config if left empty
9191
# AMD CPUs : "k8" "k8sse3" "k10" "barcelona" "bobcat" "jaguar" "bulldozer" "piledriver" "steamroller" "excavator" "zen" "zen2" "zen3" "zen4"
@@ -95,52 +95,52 @@ _hugepage=${_hugepage-always}
9595
# - "native_intel" (use compiler autodetection and will prompt for P6_NOPS - Selecting your arch manually in the list above is recommended instead of this option)
9696
# - "generic" (kernel's default - to share the package between machines with different CPU µarch as long as they are x86-64)
9797
#
98-
_processor_opt=${_processor_opt-}
98+
: "${_processor_opt:=}"
9999

100100
# This does automatically detect your supported CPU and optimizes for it
101-
_use_auto_optimization=${_use_auto_optimization-y}
101+
: "${_use_auto_optimization:=y}"
102102

103103
# Clang LTO mode, only available with the "llvm" compiler - options are "none", "full" or "thin".
104104
# ATTENTION - one of three predefined values should be selected!
105105
# "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains."
106106
# "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full."
107107
# "none: disable LTO
108-
_use_llvm_lto=${_use_llvm_lto-none}
108+
: "${_use_llvm_lto:=none}"
109109

110110
# Use suffix -lto only when requested by the user
111111
# Enabled by default.
112112
# y - enable -lto suffix
113113
# n - disable -lto suffix
114114
# https://github.com/CachyOS/linux-cachyos/issues/36
115-
_use_lto_suffix=${_use_lto_suffix-y}
115+
: "${_use_lto_suffix:=y}"
116116

117117
# Use suffix -gcc when requested by the user
118118
# This was added to facilitate https://github.com/CachyOS/linux-cachyos/issues/286
119-
_use_gcc_suffix=${_use_gcc_suffix-}
119+
: "${_use_gcc_suffix:=}"
120120

121121
# KCFI is a proposed forward-edge control-flow integrity scheme for
122122
# Clang, which is more suitable for kernel use than the existing CFI
123123
# scheme used by CONFIG_CFI_CLANG. kCFI doesn't require LTO, doesn't
124124
# alter function references to point to a jump table, and won't break
125125
# function address equality.
126-
_use_kcfi=${_use_kcfi-}
126+
: "${_use_kcfi:=}"
127127

128128
# Build the zfs module in to the kernel
129129
# WARNING: The ZFS module doesn't build with selected RT sched due to licensing issues.
130130
# If you use ZFS, refrain from building the RT kernel
131-
_build_zfs=${_build_zfs-}
131+
: "${_build_zfs:=}"
132132

133133
# Builds the nvidia module and package it into a own base
134134
# This does replace the requirement of nvidia-dkms
135-
_build_nvidia=${_build_nvidia-}
135+
: "${_build_nvidia:=}"
136136

137137
# Builds the open nvidia module and package it into a own base
138138
# This does replace the requirement of nvidia-open-dkms
139139
# Use this only if you have Turing+ GPU
140-
_build_nvidia_open=${_build_nvidia_open-}
140+
: "${_build_nvidia_open:=}"
141141

142142
# Build a debug package with non-stripped vmlinux
143-
_build_debug=${_build_debug-}
143+
: "${_build_debug:=}"
144144

145145
# ATTENTION: Do not modify after this line
146146
_is_lto_kernel() {

linux-cachyos-bore/PKGBUILD

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# Set these variables to ANYTHING that is not null or choose proper variable to enable them
1010

1111
### Selecting CachyOS config
12-
_cachy_config=${_cachy_config-y}
12+
: "${_cachy_config:=y}"
1313

1414
### Selecting the CPU scheduler
1515
# ATTENTION - only one of the following values can be selected:
@@ -20,25 +20,25 @@ _cachy_config=${_cachy_config-y}
2020
# 'eevdf' - select 'EEVDF Scheduler'
2121
# 'rt' - select EEVDF, but includes a series of realtime patches
2222
# 'rt-bore' - select Burst-Oriented Response Enhancer, but includes a series of realtime patches
23-
_cpusched=${_cpusched-bore}
23+
: "${_cpusched:=bore}"
2424

2525
### Tweak kernel options prior to a build via nconfig
26-
_makenconfig=${_makenconfig-}
26+
: "${_makenconfig:=}"
2727

2828
### Tweak kernel options prior to a build via menuconfig
29-
_makemenuconfig=${_makemenuconfig-}
29+
: "${_makemenuconfig:=}"
3030

3131
### Tweak kernel options prior to a build via xconfig
32-
_makexconfig=${_makexconfig-}
32+
: "${_makexconfig:=}"
3333

3434
### Tweak kernel options prior to a build via gconfig
35-
_makegconfig=${_makegconfig-}
35+
: "${_makegconfig:=}"
3636

3737
# NUMA is optimized for multi-socket motherboards.
3838
# A single multi-core CPU actually runs slower with NUMA enabled.
3939
# See, https://bugs.archlinux.org/task/31187
4040
# It seems that in 2023 this is not really a huge regression anymore
41-
_NUMAdisable=${_NUMAdisable-}
41+
: "${_NUMAdisable:=}"
4242

4343
# Compile ONLY used modules to VASTLYreduce the number of modules built
4444
# and the build time.
@@ -48,44 +48,44 @@ _NUMAdisable=${_NUMAdisable-}
4848
# This PKGBUILD read the database kept if it exists
4949
#
5050
# More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db
51-
_localmodcfg=${_localmodcfg-}
51+
: "${_localmodcfg:=}"
5252

5353
# Path to the list of used modules
54-
_localmodcfg_path=${_localmodcfg_path-"$HOME/.config/modprobed.db"}
54+
: "${_localmodcfg_path:="$HOME/.config/modprobed.db"}"
5555

5656
# Use the current kernel's .config file
5757
# Enabling this option will use the .config of the RUNNING kernel rather than
5858
# the ARCH defaults. Useful when the package gets updated and you already went
5959
# through the trouble of customizing your config options. NOT recommended when
6060
# a new kernel is released, but again, convenient for package bumps.
61-
_use_current=${_use_current-}
61+
: "${_use_current:=}"
6262

6363
### Enable KBUILD_CFLAGS -O3
64-
_cc_harder=${_cc_harder-y}
64+
: "${_cc_harder:=y}"
6565

6666
### Set performance governor as default
67-
_per_gov=${_per_gov-}
67+
: "${_per_gov:=}"
6868

6969
### Enable TCP_CONG_BBR3
70-
_tcp_bbr3=${_tcp_bbr3-}
70+
: "${_tcp_bbr3:=}"
7171

7272
### Running with a 1000HZ, 750Hz, 625Hz, 600 Hz, 500Hz, 300Hz, 250Hz and 100Hz tick rate
73-
_HZ_ticks=${_HZ_ticks-1000}
73+
: "${_HZ_ticks:=1000}"
7474

7575
## Choose between perodic, idle or full
7676
### Full tickless can give higher performances in various cases but, depending on hardware, lower consistency.
77-
_tickrate=${_tickrate-full}
77+
: "${_tickrate:=full}"
7878

7979
## Choose between full(low-latency), voluntary or server
80-
_preempt=${_preempt-full}
80+
: "${_preempt:=full}"
8181

8282
### Transparent Hugepages
8383
# ATTENTION - one of two predefined values should be selected!
8484
# 'always' - always enable THP
8585
# 'madvise' - madvise, prevent applications from allocating more memory resources than necessary
8686
# More infos here:
8787
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/performance_tuning_guide/sect-red_hat_enterprise_linux-performance_tuning_guide-configuring_transparent_huge_pages
88-
_hugepage=${_hugepage-always}
88+
: "${_hugepage:=always}"
8989

9090
# CPU compiler optimizations - Defaults to prompt at kernel config if left empty
9191
# AMD CPUs : "k8" "k8sse3" "k10" "barcelona" "bobcat" "jaguar" "bulldozer" "piledriver" "steamroller" "excavator" "zen" "zen2" "zen3" "zen4"
@@ -95,52 +95,52 @@ _hugepage=${_hugepage-always}
9595
# - "native_intel" (use compiler autodetection and will prompt for P6_NOPS - Selecting your arch manually in the list above is recommended instead of this option)
9696
# - "generic" (kernel's default - to share the package between machines with different CPU µarch as long as they are x86-64)
9797
#
98-
_processor_opt=${_processor_opt-}
98+
: "${_processor_opt:=}"
9999

100100
# This does automatically detect your supported CPU and optimizes for it
101-
_use_auto_optimization=${_use_auto_optimization-y}
101+
: "${_use_auto_optimization:=y}"
102102

103103
# Clang LTO mode, only available with the "llvm" compiler - options are "none", "full" or "thin".
104104
# ATTENTION - one of three predefined values should be selected!
105105
# "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains."
106106
# "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full."
107107
# "none: disable LTO
108-
_use_llvm_lto=${_use_llvm_lto-none}
108+
: "${_use_llvm_lto:=none}"
109109

110110
# Use suffix -lto only when requested by the user
111111
# Enabled by default.
112112
# y - enable -lto suffix
113113
# n - disable -lto suffix
114114
# https://github.com/CachyOS/linux-cachyos/issues/36
115-
_use_lto_suffix=${_use_lto_suffix-y}
115+
: "${_use_lto_suffix:=y}"
116116

117117
# Use suffix -gcc when requested by the user
118118
# This was added to facilitate https://github.com/CachyOS/linux-cachyos/issues/286
119-
_use_gcc_suffix=${_use_gcc_suffix-}
119+
: "${_use_gcc_suffix:=}"
120120

121121
# KCFI is a proposed forward-edge control-flow integrity scheme for
122122
# Clang, which is more suitable for kernel use than the existing CFI
123123
# scheme used by CONFIG_CFI_CLANG. kCFI doesn't require LTO, doesn't
124124
# alter function references to point to a jump table, and won't break
125125
# function address equality.
126-
_use_kcfi=${_use_kcfi-}
126+
: "${_use_kcfi:=}"
127127

128128
# Build the zfs module in to the kernel
129129
# WARNING: The ZFS module doesn't build with selected RT sched due to licensing issues.
130130
# If you use ZFS, refrain from building the RT kernel
131-
_build_zfs=${_build_zfs-}
131+
: "${_build_zfs:=}"
132132

133133
# Builds the nvidia module and package it into a own base
134134
# This does replace the requirement of nvidia-dkms
135-
_build_nvidia=${_build_nvidia-}
135+
: "${_build_nvidia:=}"
136136

137137
# Builds the open nvidia module and package it into a own base
138138
# This does replace the requirement of nvidia-open-dkms
139139
# Use this only if you have Turing+ GPU
140-
_build_nvidia_open=${_build_nvidia_open-}
140+
: "${_build_nvidia_open:=}"
141141

142142
# Build a debug package with non-stripped vmlinux
143-
_build_debug=${_build_debug-}
143+
: "${_build_debug:=}"
144144

145145
# ATTENTION: Do not modify after this line
146146
_is_lto_kernel() {

0 commit comments

Comments
 (0)