Skip to content

Commit

Permalink
env: Make building Arch Linux packages like other distributions
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <[email protected]>
  • Loading branch information
nathanchance committed Mar 4, 2024
1 parent 8878233 commit e276c0c
Show file tree
Hide file tree
Showing 22 changed files with 474 additions and 903 deletions.
1 change: 1 addition & 0 deletions configs/kernel/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.old
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 6.8.0-rc7 Kernel Configuration
# Linux/x86_64 6.8.0-rc7 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="ClangBuiltLinux clang version 19.0.0git (https://github.com/llvm/llvm-project e6e53ca8470d719882539359ebe3ad8b442a8cb0)"
CONFIG_GCC_VERSION=0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 6.8.0-rc6 Kernel Configuration
# Linux/x86_64 6.8.0-rc7 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="ClangBuiltLinux clang version 19.0.0git (https://github.com/llvm/llvm-project 1a2960bab6381f2b288328e2371829b460ac020c)"
CONFIG_CC_VERSION_TEXT="ClangBuiltLinux clang version 19.0.0git (https://github.com/llvm/llvm-project e6e53ca8470d719882539359ebe3ad8b442a8cb0)"
CONFIG_GCC_VERSION=0
CONFIG_CC_IS_CLANG=y
CONFIG_CLANG_VERSION=190000
Expand All @@ -18,7 +18,7 @@ CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT=y
CONFIG_TOOLS_SUPPORT_RELR=y
CONFIG_CC_HAS_ASM_INLINE=y
CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
CONFIG_PAHOLE_VERSION=125
CONFIG_PAHOLE_VERSION=126
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_TABLE_SORT=y
CONFIG_THREAD_INFO_IN_TASK=y
Expand Down Expand Up @@ -11091,7 +11091,6 @@ CONFIG_CRYPTO_USER_API_RNG=m
# CONFIG_CRYPTO_USER_API_RNG_CAVP is not set
CONFIG_CRYPTO_USER_API_AEAD=m
# CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE is not set
CONFIG_CRYPTO_STATS=y
# end of Userspace interface

CONFIG_CRYPTO_HASH_INFO=y
Expand Down Expand Up @@ -11749,6 +11748,8 @@ CONFIG_RUNTIME_TESTING_MENU=y
# CONFIG_ATOMIC64_SELFTEST is not set
CONFIG_ASYNC_RAID6_TEST=m
# CONFIG_TEST_HEXDUMP is not set
# CONFIG_STRING_SELFTEST is not set
# CONFIG_TEST_STRING_HELPERS is not set
# CONFIG_TEST_KSTRTOX is not set
# CONFIG_TEST_PRINTF is not set
# CONFIG_TEST_SCANF is not set
Expand Down
2 changes: 1 addition & 1 deletion configs/tmux/next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ windows:
panes:
- shell: dbxe
shell_command: cbl_upd_krnl next-llvm
start_directory: $ENV_FOLDER/pkgbuilds/linux-next-llvm
start_directory: $CBL_SRC_P/linux-next-llvm
enter: false
focus: true
- shell: dbxe
Expand Down
44 changes: 3 additions & 41 deletions fish/functions/cbl_bld_krnl_pkg.fish
Original file line number Diff line number Diff line change
@@ -1,45 +1,7 @@
#!/usr/bin/env fish
# SPDX-License-Identifier: MIT
# Copyright (C) 2021-2023 Nathan Chancellor
# Copyright (C) 2024 Nathan Chancellor

function cbl_bld_krnl_pkg -d "Build ClangBuiltLinux Arch Linux kernel package"
in_container_msg -c; or return

for arg in $argv
switch $arg
case --cfi --cfi-permissive -f --full -l --local --lto -m --menuconfig -u --ubsan-bounds
set -a config_args $arg
case -p --permissive
set -a config_args --cfi-permissive
case '*'debug '*'mainline'*' '*'next'*'
set pkg linux-(string replace 'linux-' '' $arg)
end
end
if not set -q pkg
set pkg linux-mainline-llvm
end

set pkgroot $ENV_FOLDER/pkgbuilds/$pkg

pushd $pkgroot; or return

# Prerequisite: Clean up old kernels
rm -- *.tar.zst

# Generate .config
cbl_gen_archconfig $config_args $pkg; or return

# Update the pkgver if using a local tree
if grep -q "file://" PKGBUILD
cbl_upd_krnl_pkgver (basename $PWD)
end

# Build the kernel
makepkg -C; or return

echo Run
printf '\n\t$ sudo fish -c "pacman -U %s; and bootctl set-oneshot %s.conf; and reboot"\n\n' (realpath -- *.tar.zst | string replace $ENV_FOLDER \$ENV_FOLDER) $pkg
echo "to install and use new kernel."

popd
function cbl_bld_krnl_pkg -d "Wrapper for cbl_bld_krnl_pkg.py"
$PYTHON_SCRIPTS_FOLDER/cbl_bld_krnl_pkg.py $argv
end
115 changes: 0 additions & 115 deletions fish/functions/cbl_bld_lnx_dbg.fish

This file was deleted.

101 changes: 0 additions & 101 deletions fish/functions/cbl_gen_archconfig.fish

This file was deleted.

51 changes: 3 additions & 48 deletions fish/functions/cbl_rb_fd.fish
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,11 @@ function cbl_rb_fd -d "Rebase generic Fedora kernel on latest linux-next"
in_container_msg -c
or return

set fd_src $CBL_SRC_P/fedora
pushd $fd_src
or return

# Update kernel
git ru --prune origin
or return
git rh origin/master

# Patching
for revert in $reverts
git revert --mainline 1 --no-edit $revert
or return
end
set -a b4_patches https://lore.kernel.org/all/20240301-pci-imx6-fix-clang-implicit-fallthrough-v1-1-db78c7cbb384@kernel.org/ # PCI: imx6: Fix clang -Wimplicit-fallthrough in imx6_pcie_probe()
for patch in $b4_patches
b4 shazam -l -P _ -s $patch
or begin
set ret $status
git ama
return $ret
end
end
for patch in $crl_patches
crl $patch | git am -3
or begin
set ret $status
git ama
return $ret
end
end
for hash in $ln_commits
git -C $CBL_SRC_P/linux-next fp -1 --stdout $hash | git am
or begin
set ret $status
git ama
return $ret
end
end
for patch in $am_patches
git am -3 $patch
or begin
set ret $status
git ama
return $ret
end
end
# Prepare kernel source
PYTHONPATH=$PYTHON_FOLDER/lib python3 -c "import kernel; kernel.prepare_source('fedora')"

# Build kernel
cbl_bld_krnl_rpm --cfi --lto arm64
fish -c "cd $CBL_SRC_P/fedora; and cbl_bld_krnl_rpm --cfi --lto arm64"
or return

popd
Expand Down
Loading

0 comments on commit e276c0c

Please sign in to comment.