Skip to content

Commit

Permalink
Merge pull request #288 from ventureoo/fix-ci-3
Browse files Browse the repository at this point in the history
Use modprobed-db for CI builds to fix the lack of space
  • Loading branch information
ptr1337 authored Sep 27, 2024
2 parents 8a10d0f + b8ef12b commit fcd8e63
Show file tree
Hide file tree
Showing 13 changed files with 899 additions and 123 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- 'linux-cachyos/PKGBUILD'
- '.github/workflows/lint.yml'
workflow_dispatch:

jobs:
linux-cachyos-zfs-gcc:
runs-on: ubuntu-latest
Expand All @@ -15,7 +16,7 @@ jobs:
id: makepkg
uses: CachyOS/pkgbuild-action@master
with:
envvars: "_build_zfs=y _use_auto_optimization= _processor_opt=generic _cc_size=y _cc_harder="
envvars: "_build_zfs=y _use_auto_optimization= _cc_harder= _localmodcfg=y _localmodcfg_path=/github/workspace/modprobed.db"
pkgdir: "linux-cachyos"
namcapExcludeRules: "invalidstartdir"
makepkgArgs: "--skipchecksums --skippgpcheck --noconfirm -s"
Expand All @@ -28,7 +29,7 @@ jobs:
id: makepkg
uses: CachyOS/pkgbuild-action@master
with:
envvars: "_build_zfs=y _use_llvm_lto=thin _use_auto_optimization= _processor_opt=generic _cc_size=y _cc_harder="
envvars: "CI=1 _build_zfs=y _use_llvm_lto=thin _use_auto_optimization= _cc_harder= _localmodcfg=y _localmodcfg_path=/github/workspace/modprobed.db"
pkgdir: "linux-cachyos"
namcapExcludeRules: "invalidstartdir"
makepkgArgs: "--skipchecksums --skippgpcheck --noconfirm -s"
30 changes: 19 additions & 11 deletions linux-cachyos-bmq/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ _NUMAdisable=${_NUMAdisable-}
# More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db
_localmodcfg=${_localmodcfg-}

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

# Use the current kernel's .config file
# Enabling this option will use the .config of the RUNNING kernel rather than
# the ARCH defaults. Useful when the package gets updated and you already went
Expand All @@ -61,10 +64,6 @@ _use_current=${_use_current-}
### Enable KBUILD_CFLAGS -O3
_cc_harder=${_cc_harder-y}

### Enable KBUILD_CFLAGS -Os
## DO NOT SET, THIS IS FOR INTERNAL CI USE ONLY.
_cc_size=${_cc_size-}

### Set this to your number of threads you have in your machine otherwise it will default to 320
_nr_cpus=${_nr_cpus-}

Expand Down Expand Up @@ -259,7 +258,7 @@ export KBUILD_BUILD_HOST=cachyos
export KBUILD_BUILD_USER="$pkgbase"
export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"

_die() { error "$@" ; exit; }
_die() { error "$@" ; exit 1; }

prepare() {
cd "$_srcname"
Expand Down Expand Up @@ -428,11 +427,20 @@ prepare() {
-e CC_OPTIMIZE_FOR_PERFORMANCE_O3
fi

### Enable Os
if [ -n "$_cc_size" ] && [ -z "$_cc_harder" ]; then
echo "Enabling KBUILD_CFLAGS -Os..."
### CI-only stuff
if [[ -n "$CI" || -n "$GITHUB_RUN_ID" ]]; then
echo "Detected build inside CI"
scripts/config -d CC_OPTIMIZE_FOR_PERFORMANCE \
-e CONFIG_CC_OPTIMIZE_FOR_SIZE
-d CC_OPTIMIZE_FOR_PERFORMANCE_O3 \
-e CONFIG_CC_OPTIMIZE_FOR_SIZE \
-d SLUB_DEBUG \
-d PM_DEBUG \
-d PM_ADVANCED_DEBUG \
-d PM_SLEEP_DEBUG \
-d ACPI_DEBUG \
-d LATENCYTOP \
-d SCHED_DEBUG \
-d DEBUG_PREEMPT
fi

### Enable bbr3
Expand Down Expand Up @@ -478,9 +486,9 @@ prepare() {
### Optionally load needed modules for the make localmodconfig
# See https://aur.archlinux.org/packages/modprobed-db
if [ -n "$_localmodcfg" ]; then
if [ -e "$HOME/.config/modprobed.db" ]; then
if [ -e "$_localmodcfg_path" ]; then
echo "Running Steven Rostedt's make localmodconfig now"
make "${BUILD_FLAGS[@]}" LSMOD="$HOME/.config/modprobed.db" localmodconfig
make "${BUILD_FLAGS[@]}" LSMOD="${_localmodcfg_path}" localmodconfig
else
_die "No modprobed.db data found"
fi
Expand Down
30 changes: 19 additions & 11 deletions linux-cachyos-bore/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ _NUMAdisable=${_NUMAdisable-}
# More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db
_localmodcfg=${_localmodcfg-}

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

# Use the current kernel's .config file
# Enabling this option will use the .config of the RUNNING kernel rather than
# the ARCH defaults. Useful when the package gets updated and you already went
Expand All @@ -61,10 +64,6 @@ _use_current=${_use_current-}
### Enable KBUILD_CFLAGS -O3
_cc_harder=${_cc_harder-y}

### Enable KBUILD_CFLAGS -Os
## DO NOT SET, THIS IS FOR INTERNAL CI USE ONLY.
_cc_size=${_cc_size-}

### Set this to your number of threads you have in your machine otherwise it will default to 320
_nr_cpus=${_nr_cpus-}

Expand Down Expand Up @@ -260,7 +259,7 @@ export KBUILD_BUILD_HOST=cachyos
export KBUILD_BUILD_USER="$pkgbase"
export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"

_die() { error "$@" ; exit; }
_die() { error "$@" ; exit 1; }

prepare() {
cd "$_srcname"
Expand Down Expand Up @@ -429,11 +428,20 @@ prepare() {
-e CC_OPTIMIZE_FOR_PERFORMANCE_O3
fi

### Enable Os
if [ -n "$_cc_size" ] && [ -z "$_cc_harder" ]; then
echo "Enabling KBUILD_CFLAGS -Os..."
### CI-only stuff
if [[ -n "$CI" || -n "$GITHUB_RUN_ID" ]]; then
echo "Detected build inside CI"
scripts/config -d CC_OPTIMIZE_FOR_PERFORMANCE \
-e CONFIG_CC_OPTIMIZE_FOR_SIZE
-d CC_OPTIMIZE_FOR_PERFORMANCE_O3 \
-e CONFIG_CC_OPTIMIZE_FOR_SIZE \
-d SLUB_DEBUG \
-d PM_DEBUG \
-d PM_ADVANCED_DEBUG \
-d PM_SLEEP_DEBUG \
-d ACPI_DEBUG \
-d LATENCYTOP \
-d SCHED_DEBUG \
-d DEBUG_PREEMPT
fi

### Enable bbr3
Expand Down Expand Up @@ -479,9 +487,9 @@ prepare() {
### Optionally load needed modules for the make localmodconfig
# See https://aur.archlinux.org/packages/modprobed-db
if [ -n "$_localmodcfg" ]; then
if [ -e "$HOME/.config/modprobed.db" ]; then
if [ -e "$_localmodcfg_path" ]; then
echo "Running Steven Rostedt's make localmodconfig now"
make "${BUILD_FLAGS[@]}" LSMOD="$HOME/.config/modprobed.db" localmodconfig
make "${BUILD_FLAGS[@]}" LSMOD="${_localmodcfg_path}" localmodconfig
else
_die "No modprobed.db data found"
fi
Expand Down
30 changes: 19 additions & 11 deletions linux-cachyos-deckify/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ _NUMAdisable=${_NUMAdisable-}
# More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db
_localmodcfg=${_localmodcfg-}

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

# Use the current kernel's .config file
# Enabling this option will use the .config of the RUNNING kernel rather than
# the ARCH defaults. Useful when the package gets updated and you already went
Expand All @@ -62,10 +65,6 @@ _use_current=${_use_current-}
### Enable KBUILD_CFLAGS -O3
_cc_harder=${_cc_harder-y}

### Enable KBUILD_CFLAGS -Os
## DO NOT SET, THIS IS FOR INTERNAL CI USE ONLY.
_cc_size=${_cc_size-}

### Set this to your number of threads you have in your machine otherwise it will default to 320
_nr_cpus=${_nr_cpus-}

Expand Down Expand Up @@ -264,7 +263,7 @@ export KBUILD_BUILD_HOST=cachyos
export KBUILD_BUILD_USER="$pkgbase"
export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"

_die() { error "$@" ; exit; }
_die() { error "$@" ; exit 1; }

prepare() {
cd "$_srcname"
Expand Down Expand Up @@ -433,11 +432,20 @@ prepare() {
-e CC_OPTIMIZE_FOR_PERFORMANCE_O3
fi

### Enable Os
if [ -n "$_cc_size" ] && [ -z "$_cc_harder" ]; then
echo "Enabling KBUILD_CFLAGS -Os..."
### CI-only stuff
if [[ -n "$CI" || -n "$GITHUB_RUN_ID" ]]; then
echo "Detected build inside CI"
scripts/config -d CC_OPTIMIZE_FOR_PERFORMANCE \
-e CONFIG_CC_OPTIMIZE_FOR_SIZE
-d CC_OPTIMIZE_FOR_PERFORMANCE_O3 \
-e CONFIG_CC_OPTIMIZE_FOR_SIZE \
-d SLUB_DEBUG \
-d PM_DEBUG \
-d PM_ADVANCED_DEBUG \
-d PM_SLEEP_DEBUG \
-d ACPI_DEBUG \
-d LATENCYTOP \
-d SCHED_DEBUG \
-d DEBUG_PREEMPT
fi

### Enable bbr3
Expand Down Expand Up @@ -483,9 +491,9 @@ prepare() {
### Optionally load needed modules for the make localmodconfig
# See https://aur.archlinux.org/packages/modprobed-db
if [ -n "$_localmodcfg" ]; then
if [ -e "$HOME/.config/modprobed.db" ]; then
if [ -e "$_localmodcfg_path" ]; then
echo "Running Steven Rostedt's make localmodconfig now"
make "${BUILD_FLAGS[@]}" LSMOD="$HOME/.config/modprobed.db" localmodconfig
make "${BUILD_FLAGS[@]}" LSMOD="${_localmodcfg_path}" localmodconfig
else
_die "No modprobed.db data found"
fi
Expand Down
30 changes: 19 additions & 11 deletions linux-cachyos-eevdf/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ _NUMAdisable=${_NUMAdisable-}
# More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db
_localmodcfg=${_localmodcfg-}

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

# Use the current kernel's .config file
# Enabling this option will use the .config of the RUNNING kernel rather than
# the ARCH defaults. Useful when the package gets updated and you already went
Expand All @@ -61,10 +64,6 @@ _use_current=${_use_current-}
### Enable KBUILD_CFLAGS -O3
_cc_harder=${_cc_harder-y}

### Enable KBUILD_CFLAGS -Os
## DO NOT SET, THIS IS FOR INTERNAL CI USE ONLY.
_cc_size=${_cc_size-}

### Set this to your number of threads you have in your machine otherwise it will default to 320
_nr_cpus=${_nr_cpus-}

Expand Down Expand Up @@ -260,7 +259,7 @@ export KBUILD_BUILD_HOST=cachyos
export KBUILD_BUILD_USER="$pkgbase"
export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"

_die() { error "$@" ; exit; }
_die() { error "$@" ; exit 1; }

prepare() {
cd "$_srcname"
Expand Down Expand Up @@ -429,11 +428,20 @@ prepare() {
-e CC_OPTIMIZE_FOR_PERFORMANCE_O3
fi

### Enable Os
if [ -n "$_cc_size" ] && [ -z "$_cc_harder" ]; then
echo "Enabling KBUILD_CFLAGS -Os..."
### CI-only stuff
if [[ -n "$CI" || -n "$GITHUB_RUN_ID" ]]; then
echo "Detected build inside CI"
scripts/config -d CC_OPTIMIZE_FOR_PERFORMANCE \
-e CONFIG_CC_OPTIMIZE_FOR_SIZE
-d CC_OPTIMIZE_FOR_PERFORMANCE_O3 \
-e CONFIG_CC_OPTIMIZE_FOR_SIZE \
-d SLUB_DEBUG \
-d PM_DEBUG \
-d PM_ADVANCED_DEBUG \
-d PM_SLEEP_DEBUG \
-d ACPI_DEBUG \
-d LATENCYTOP \
-d SCHED_DEBUG \
-d DEBUG_PREEMPT
fi

### Enable bbr3
Expand Down Expand Up @@ -479,9 +487,9 @@ prepare() {
### Optionally load needed modules for the make localmodconfig
# See https://aur.archlinux.org/packages/modprobed-db
if [ -n "$_localmodcfg" ]; then
if [ -e "$HOME/.config/modprobed.db" ]; then
if [ -e "$_localmodcfg_path" ]; then
echo "Running Steven Rostedt's make localmodconfig now"
make "${BUILD_FLAGS[@]}" LSMOD="$HOME/.config/modprobed.db" localmodconfig
make "${BUILD_FLAGS[@]}" LSMOD="${_localmodcfg_path}" localmodconfig
else
_die "No modprobed.db data found"
fi
Expand Down
30 changes: 19 additions & 11 deletions linux-cachyos-hardened/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ _NUMAdisable=${_NUMAdisable-}
# More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db
_localmodcfg=${_localmodcfg-}

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

# Use the current kernel's .config file
# Enabling this option will use the .config of the RUNNING kernel rather than
# the ARCH defaults. Useful when the package gets updated and you already went
Expand All @@ -61,10 +64,6 @@ _use_current=${_use_current-}
### Enable KBUILD_CFLAGS -O3
_cc_harder=${_cc_harder-y}

### Enable KBUILD_CFLAGS -Os
## DO NOT SET, THIS IS FOR INTERNAL CI USE ONLY.
_cc_size=${_cc_size-}

### Set this to your number of threads you have in your machine otherwise it will default to 320
_nr_cpus=${_nr_cpus-}

Expand Down Expand Up @@ -258,7 +257,7 @@ export KBUILD_BUILD_HOST=cachyos
export KBUILD_BUILD_USER="$pkgbase"
export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"

_die() { error "$@" ; exit; }
_die() { error "$@" ; exit 1; }

prepare() {
cd "$_srcname"
Expand Down Expand Up @@ -428,11 +427,20 @@ prepare() {
-e CC_OPTIMIZE_FOR_PERFORMANCE_O3
fi

### Enable Os
if [ -n "$_cc_size" ] && [ -z "$_cc_harder" ]; then
echo "Enabling KBUILD_CFLAGS -Os..."
### CI-only stuff
if [[ -n "$CI" || -n "$GITHUB_RUN_ID" ]]; then
echo "Detected build inside CI"
scripts/config -d CC_OPTIMIZE_FOR_PERFORMANCE \
-e CONFIG_CC_OPTIMIZE_FOR_SIZE
-d CC_OPTIMIZE_FOR_PERFORMANCE_O3 \
-e CONFIG_CC_OPTIMIZE_FOR_SIZE \
-d SLUB_DEBUG \
-d PM_DEBUG \
-d PM_ADVANCED_DEBUG \
-d PM_SLEEP_DEBUG \
-d ACPI_DEBUG \
-d LATENCYTOP \
-d SCHED_DEBUG \
-d DEBUG_PREEMPT
fi

### Enable bbr3
Expand Down Expand Up @@ -478,9 +486,9 @@ prepare() {
### Optionally load needed modules for the make localmodconfig
# See https://aur.archlinux.org/packages/modprobed-db
if [ -n "$_localmodcfg" ]; then
if [ -e "$HOME/.config/modprobed.db" ]; then
if [ -e "$_localmodcfg_path" ]; then
echo "Running Steven Rostedt's make localmodconfig now"
make "${BUILD_FLAGS[@]}" LSMOD="$HOME/.config/modprobed.db" localmodconfig
make "${BUILD_FLAGS[@]}" LSMOD="${_localmodcfg_path}" localmodconfig
else
_die "No modprobed.db data found"
fi
Expand Down
Loading

0 comments on commit fcd8e63

Please sign in to comment.