Update PKGBUILD log messages
This commit is contained in:
parent
ad9b78dcb1
commit
338835c2e8
2 changed files with 92 additions and 68 deletions
68
PKGBUILD
68
PKGBUILD
|
@ -130,16 +130,16 @@ prepare() {
|
||||||
cd ${_srcname}
|
cd ${_srcname}
|
||||||
|
|
||||||
### Add upstream patches
|
### Add upstream patches
|
||||||
echo ":: prepare: Adding upstream patches"
|
echo ":: prepare: adding upstream patches"
|
||||||
patch -Np1 -i ../patch-${pkgver} || true
|
patch -Np1 -i ../patch-${pkgver} || true
|
||||||
|
|
||||||
### Setting version
|
### Setting version
|
||||||
echo ":: prepare: setting version"
|
echo ":: prepare: updating version"
|
||||||
echo "-$pkgrel" > localversion.10-pkgrel
|
echo "-$pkgrel" > localversion.10-pkgrel
|
||||||
echo "${pkgbase#linux}" > localversion.20-pkgname
|
echo "${pkgbase#linux}" > localversion.20-pkgname
|
||||||
|
|
||||||
### Add Clear Linux patches
|
### Add Clear Linux patches
|
||||||
echo ":: prepare: Patching kernel with Clear Linux patches"
|
echo ":: prepare: patching kernel with Clear Linux patches"
|
||||||
for i in $(grep '^Patch' ${srcdir}/cl-linux/linux.spec |\
|
for i in $(grep '^Patch' ${srcdir}/cl-linux/linux.spec |\
|
||||||
grep -Ev '^Patch0132|^Patch0118|^Patch0113|^Patch0138|^Patch0139' | sed -n 's/.*: //p'); do
|
grep -Ev '^Patch0132|^Patch0118|^Patch0113|^Patch0138|^Patch0139' | sed -n 's/.*: //p'); do
|
||||||
if [ -n "$_use_llvm_lto" ]; then
|
if [ -n "$_use_llvm_lto" ]; then
|
||||||
|
@ -147,16 +147,16 @@ prepare() {
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo ":: prepare: Applying patch ${i}..."
|
echo ":: prepare: applying patch ${i}..."
|
||||||
patch -Np1 -i "$srcdir/cl-linux/${i}" || true
|
patch -Np1 -i "$srcdir/cl-linux/${i}" || true
|
||||||
done
|
done
|
||||||
|
|
||||||
### Copy config
|
### Copy config
|
||||||
echo ":: prepare: Copying kernel-optimized kconfig into kernel repository"
|
echo ":: prepare: copying kernel-optimized kconfig into kernel repository"
|
||||||
cp -Tf "${startdir}/kconfig" ./.config
|
cp -Tf "${startdir}/kconfig" ./.config
|
||||||
|
|
||||||
if [ -n "$_use_llvm_lto" ]; then
|
if [ -n "$_use_llvm_lto" ]; then
|
||||||
echo ":: prepare: Enabling LLVM support"
|
echo ":: prepare: enabling LLVM support"
|
||||||
scripts/config -d LTO_NONE \
|
scripts/config -d LTO_NONE \
|
||||||
-e LTO \
|
-e LTO \
|
||||||
-e LTO_CLANG \
|
-e LTO_CLANG \
|
||||||
|
@ -168,14 +168,14 @@ prepare() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$_debug" == "y" ]; then
|
if [ "$_debug" == "y" ]; then
|
||||||
echo ":: prepare: Enabling debugging features"
|
echo ":: prepare: enabling debugging features"
|
||||||
scripts/config -e DEBUG_INFO \
|
scripts/config -e DEBUG_INFO \
|
||||||
-e DEBUG_INFO_BTF \
|
-e DEBUG_INFO_BTF \
|
||||||
-e DEBUG_INFO_DWARF4 \
|
-e DEBUG_INFO_DWARF4 \
|
||||||
-e PAHOLE_HAS_SPLIT_BTF \
|
-e PAHOLE_HAS_SPLIT_BTF \
|
||||||
-e DEBUG_INFO_BTF_MODULES
|
-e DEBUG_INFO_BTF_MODULES
|
||||||
elif [ "$_debug" == "n" ]; then
|
elif [ "$_debug" == "n" ]; then
|
||||||
echo ":: prepare: Disabling debugging features"
|
echo ":: prepare: disabling debugging features"
|
||||||
scripts/config -d DEBUG_INFO \
|
scripts/config -d DEBUG_INFO \
|
||||||
-d DEBUG_INFO_BTF \
|
-d DEBUG_INFO_BTF \
|
||||||
-d DEBUG_INFO_DWARF4 \
|
-d DEBUG_INFO_DWARF4 \
|
||||||
|
@ -183,13 +183,13 @@ prepare() {
|
||||||
-d DEBUG_INFO_BTF_MODULES
|
-d DEBUG_INFO_BTF_MODULES
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ":: prepare: Running olddefconfig"
|
echo ":: prepare: running olddefconfig"
|
||||||
make ${BUILD_FLAGS[*]} olddefconfig
|
make ${BUILD_FLAGS[*]} olddefconfig
|
||||||
diff -u $srcdir/cl-linux/config .config || :
|
diff -u $srcdir/cl-linux/config .config || :
|
||||||
|
|
||||||
# https://github.com/graysky2/kernel_compiler_patch
|
# https://github.com/graysky2/kernel_compiler_patch
|
||||||
# make sure to apply after olddefconfig to allow the next section
|
# make sure to apply after olddefconfig to allow the next section
|
||||||
echo ":: prepare: Patching kernel with kernel_compiler_patch"
|
echo ":: prepare: patching kernel with kernel_compiler_patch"
|
||||||
patch -Np1 -i "$srcdir/kernel_compiler_patch-$_gcc_more_v/more-uarches-for-kernel-6.1.79-6.8-rc3.patch"
|
patch -Np1 -i "$srcdir/kernel_compiler_patch-$_gcc_more_v/more-uarches-for-kernel-6.1.79-6.8-rc3.patch"
|
||||||
|
|
||||||
if [ -n "$_subarch" ]; then
|
if [ -n "$_subarch" ]; then
|
||||||
|
@ -206,30 +206,31 @@ prepare() {
|
||||||
# See https://aur.archlinux.org/packages/modprobed-db
|
# See https://aur.archlinux.org/packages/modprobed-db
|
||||||
if [ -n "$_localmodcfg" ]; then
|
if [ -n "$_localmodcfg" ]; then
|
||||||
if [ -e "$HOME/.config/modprobed.db" ]; then
|
if [ -e "$HOME/.config/modprobed.db" ]; then
|
||||||
echo ":: prepare: Executing localmodconfig"
|
echo ":: prepare: executing localmodconfig"
|
||||||
make ${BUILD_FLAGS[*]} LSMOD=$HOME/.config/modprobed.db localmodconfig
|
make ${BUILD_FLAGS[*]} LSMOD=$HOME/.config/modprobed.db localmodconfig
|
||||||
else
|
else
|
||||||
echo ":: prepare: error: No modprobed.db found at \"${HOME}/.config/modprobed.db\", skipping"
|
echo ":: prepare: error: no modprobed.db found at \"${HOME}/.config/modprobed.db\", skipping"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ":: prepare: Writing version"
|
echo ":: prepare: writing kernel version"
|
||||||
make -s kernelrelease > version
|
make -s kernelrelease > version
|
||||||
|
|
||||||
[[ -z "$_makexconfig" ]] || (
|
[[ -z "$_makexconfig" ]] || (
|
||||||
echo ":: prepare: Executing xconfig"
|
echo ":: prepare: executing xconfig"
|
||||||
make ${BUILD_FLAGS[*]} xconfig
|
make ${BUILD_FLAGS[*]} xconfig
|
||||||
)
|
)
|
||||||
[[ -z "$_makenconfig" ]] || (
|
[[ -z "$_makenconfig" ]] || (
|
||||||
echo ":: prepare: Executing nconfig"
|
echo ":: prepare: executing nconfig"
|
||||||
make ${BUILD_FLAGS[*]} nconfig
|
make ${BUILD_FLAGS[*]} nconfig
|
||||||
)
|
)
|
||||||
|
|
||||||
### Save configuration for later reuse
|
### Save configuration for later reuse
|
||||||
[[ -z "$_copyfinalconfig" ]] || (
|
[[ -z "$_copyfinalconfig" ]] || (
|
||||||
echo ":: prepare: Copying configuration file into kernel-optimized repository"
|
echo ":: prepare: copying configuration file into kernel-optimized repository"
|
||||||
cp -Tf ./.config "${startdir}/finalconfig-${pkgver}-${pkgrel}${pkgbase#linux}"
|
cp -Tf ./.config "${startdir}/finalconfig-${pkgver}-${pkgrel}${pkgbase#linux}"
|
||||||
)
|
)
|
||||||
|
echo ":: prepare: prepare() finished"
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
@ -238,9 +239,12 @@ build() {
|
||||||
cd ${_srcname}
|
cd ${_srcname}
|
||||||
echo ":: build: starting compilation (make ${BUILD_FLAGS[*]} all)"
|
echo ":: build: starting compilation (make ${BUILD_FLAGS[*]} all)"
|
||||||
make ${BUILD_FLAGS[*]} all
|
make ${BUILD_FLAGS[*]} all
|
||||||
|
echo ":: build: build() finished"
|
||||||
}
|
}
|
||||||
|
|
||||||
_package() {
|
_package() {
|
||||||
|
echo ":: _package: _package() called"
|
||||||
|
echo ":: _package: updating package information"
|
||||||
pkgdesc="${pkgdesc} This package includes the kernel and compiled modules."
|
pkgdesc="${pkgdesc} This package includes the kernel and compiled modules."
|
||||||
depends=('coreutils' 'kmod' 'initramfs')
|
depends=('coreutils' 'kmod' 'initramfs')
|
||||||
optdepends=('wireless-regdb: to set the correct wireless channels of your country'
|
optdepends=('wireless-regdb: to set the correct wireless channels of your country'
|
||||||
|
@ -249,11 +253,12 @@ _package() {
|
||||||
provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE KSMBD-MODULE)
|
provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE KSMBD-MODULE)
|
||||||
install=linux.install
|
install=linux.install
|
||||||
|
|
||||||
|
echo ":: _package: cding into \"${_srcname}\""
|
||||||
cd $_srcname
|
cd $_srcname
|
||||||
|
|
||||||
local modulesdir="$pkgdir/usr/lib/modules/$(<version)"
|
local modulesdir="$pkgdir/usr/lib/modules/$(<version)"
|
||||||
|
|
||||||
echo "Installing boot image..."
|
echo ":: _package: installing boot image"
|
||||||
# systemd expects to find the kernel here to allow hibernation
|
# systemd expects to find the kernel here to allow hibernation
|
||||||
# https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
|
# https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
|
||||||
install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz"
|
install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz"
|
||||||
|
@ -261,22 +266,27 @@ _package() {
|
||||||
# Used by mkinitcpio to name the kernel
|
# Used by mkinitcpio to name the kernel
|
||||||
echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
|
echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
|
||||||
|
|
||||||
echo "Installing modules..."
|
echo ":: _package: installing modules"
|
||||||
ZSTD_CLEVEL=19 make ${BUILD_FLAGS[*]} INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 \
|
ZSTD_CLEVEL=19 make ${BUILD_FLAGS[*]} INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 \
|
||||||
DEPMOD=/doesnt/exist modules_install # Suppress depmod
|
DEPMOD=/doesnt/exist modules_install # Suppress depmod
|
||||||
|
|
||||||
# remove build link
|
# remove build link
|
||||||
rm "$modulesdir"/build
|
rm "$modulesdir"/build
|
||||||
|
|
||||||
|
echo ":: _package: _package() finished"
|
||||||
}
|
}
|
||||||
|
|
||||||
_package-headers() {
|
_package-headers() {
|
||||||
|
echo ":: _package-headers: _package-headers() called"
|
||||||
|
echo ":: _package-headers: updating package information"
|
||||||
pkgdesc="${pkgdesc} This package includes various headers and scripts for building modules."
|
pkgdesc="${pkgdesc} This package includes various headers and scripts for building modules."
|
||||||
depends=(pahole)
|
depends=(pahole)
|
||||||
|
|
||||||
|
echo ":: _package-headers: cding into \"${_srcname}\""
|
||||||
cd ${_srcname}
|
cd ${_srcname}
|
||||||
local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
|
local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
|
||||||
|
|
||||||
echo "Installing build files..."
|
echo ":: _package-headers: installing build files"
|
||||||
install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \
|
install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \
|
||||||
localversion.* version vmlinux
|
localversion.* version vmlinux
|
||||||
install -Dt "$builddir/kernel" -m644 kernel/Makefile
|
install -Dt "$builddir/kernel" -m644 kernel/Makefile
|
||||||
|
@ -291,7 +301,7 @@ _package-headers() {
|
||||||
install -Dt "$builddir/tools/bpf/resolve_btfids" tools/bpf/resolve_btfids/resolve_btfids
|
install -Dt "$builddir/tools/bpf/resolve_btfids" tools/bpf/resolve_btfids/resolve_btfids
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installing headers..."
|
echo ":: _package-headers: installing headers"
|
||||||
cp -t "$builddir" -a include
|
cp -t "$builddir" -a include
|
||||||
cp -t "$builddir/arch/x86" -a arch/x86/include
|
cp -t "$builddir/arch/x86" -a arch/x86/include
|
||||||
install -Dt "$builddir/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s
|
install -Dt "$builddir/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s
|
||||||
|
@ -310,10 +320,10 @@ _package-headers() {
|
||||||
# https://bugs.archlinux.org/task/71392
|
# https://bugs.archlinux.org/task/71392
|
||||||
install -Dt "$builddir/drivers/iio/common/hid-sensors" -m644 drivers/iio/common/hid-sensors/*.h
|
install -Dt "$builddir/drivers/iio/common/hid-sensors" -m644 drivers/iio/common/hid-sensors/*.h
|
||||||
|
|
||||||
echo "Installing KConfig files..."
|
echo ":: _package-headers: installing KConfig files"
|
||||||
find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;
|
find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;
|
||||||
|
|
||||||
echo "Removing unneeded architectures..."
|
echo ":: _package-headers: removing unneeded architectures"
|
||||||
local arch
|
local arch
|
||||||
for arch in "$builddir"/arch/*/; do
|
for arch in "$builddir"/arch/*/; do
|
||||||
[[ $arch = */x86/ ]] && continue
|
[[ $arch = */x86/ ]] && continue
|
||||||
|
@ -321,16 +331,16 @@ _package-headers() {
|
||||||
rm -r "$arch"
|
rm -r "$arch"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Removing documentation..."
|
echo ":: _package-headers: removing documentation"
|
||||||
rm -r "$builddir/Documentation"
|
rm -r "$builddir/Documentation"
|
||||||
|
|
||||||
echo "Removing broken symlinks..."
|
echo ":: _package-headers: removing broken symlinks"
|
||||||
find -L "$builddir" -type l -printf 'Removing %P\n' -delete
|
find -L "$builddir" -type l -printf 'Removing %P\n' -delete
|
||||||
|
|
||||||
echo "Removing loose objects..."
|
echo ":: _package-headers: removing loose objects"
|
||||||
find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete
|
find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete
|
||||||
|
|
||||||
echo "Stripping build tools..."
|
echo ":: _package-headers: stripping build tools"
|
||||||
local file
|
local file
|
||||||
while read -rd '' file; do
|
while read -rd '' file; do
|
||||||
case "$(file -Sib "$file")" in
|
case "$(file -Sib "$file")" in
|
||||||
|
@ -345,12 +355,14 @@ _package-headers() {
|
||||||
esac
|
esac
|
||||||
done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0)
|
done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0)
|
||||||
|
|
||||||
echo "Stripping vmlinux..."
|
echo ":: _package-headers: stripping vmlinux"
|
||||||
strip -v $STRIP_STATIC "$builddir/vmlinux"
|
strip -v $STRIP_STATIC "$builddir/vmlinux"
|
||||||
|
|
||||||
echo "Adding symlink..."
|
echo ":: _package-headers: adding symlink"
|
||||||
mkdir -p "$pkgdir/usr/src"
|
mkdir -p "$pkgdir/usr/src"
|
||||||
ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"
|
ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"
|
||||||
|
|
||||||
|
echo ":: _package-headers: _package-headers() finished"
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgname=("$pkgbase" "$pkgbase-headers")
|
pkgname=("$pkgbase" "$pkgbase-headers")
|
||||||
|
|
|
@ -46,16 +46,16 @@ prepare() {
|
||||||
cd ${_srcname}
|
cd ${_srcname}
|
||||||
|
|
||||||
### Add upstream patches
|
### Add upstream patches
|
||||||
echo ":: prepare: Adding upstream patches"
|
echo ":: prepare: adding upstream patches"
|
||||||
patch -Np1 -i ../patch-${pkgver} || true
|
patch -Np1 -i ../patch-${pkgver} || true
|
||||||
|
|
||||||
### Setting version
|
### Setting version
|
||||||
echo ":: prepare: setting version"
|
echo ":: prepare: updating version"
|
||||||
echo "-$pkgrel" > localversion.10-pkgrel
|
echo "-$pkgrel" > localversion.10-pkgrel
|
||||||
echo "${pkgbase#linux}" > localversion.20-pkgname
|
echo "${pkgbase#linux}" > localversion.20-pkgname
|
||||||
|
|
||||||
### Add Clear Linux patches
|
### Add Clear Linux patches
|
||||||
echo ":: prepare: Patching kernel with Clear Linux patches"
|
echo ":: prepare: patching kernel with Clear Linux patches"
|
||||||
for i in $(grep '^Patch' ${srcdir}/cl-linux/linux.spec |\
|
for i in $(grep '^Patch' ${srcdir}/cl-linux/linux.spec |\
|
||||||
grep -Ev '^Patch0132|^Patch0118|^Patch0113|^Patch0138|^Patch0139' | sed -n 's/.*: //p'); do
|
grep -Ev '^Patch0132|^Patch0118|^Patch0113|^Patch0138|^Patch0139' | sed -n 's/.*: //p'); do
|
||||||
if [ -n "$_use_llvm_lto" ]; then
|
if [ -n "$_use_llvm_lto" ]; then
|
||||||
|
@ -63,16 +63,16 @@ prepare() {
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo ":: prepare: Applying patch ${i}..."
|
echo ":: prepare: applying patch ${i}..."
|
||||||
patch -Np1 -i "$srcdir/cl-linux/${i}" || true
|
patch -Np1 -i "$srcdir/cl-linux/${i}" || true
|
||||||
done
|
done
|
||||||
|
|
||||||
### Copy config
|
### Copy config
|
||||||
echo ":: prepare: Copying kernel-optimized kconfig into kernel repository"
|
echo ":: prepare: copying kernel-optimized kconfig into kernel repository"
|
||||||
cp -Tf "${startdir}/kconfig" ./.config
|
cp -Tf "${startdir}/kconfig" ./.config
|
||||||
|
|
||||||
if [ -n "$_use_llvm_lto" ]; then
|
if [ -n "$_use_llvm_lto" ]; then
|
||||||
echo ":: prepare: Enabling LLVM support"
|
echo ":: prepare: enabling LLVM support"
|
||||||
scripts/config -d LTO_NONE \
|
scripts/config -d LTO_NONE \
|
||||||
-e LTO \
|
-e LTO \
|
||||||
-e LTO_CLANG \
|
-e LTO_CLANG \
|
||||||
|
@ -84,14 +84,14 @@ prepare() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$_debug" == "y" ]; then
|
if [ "$_debug" == "y" ]; then
|
||||||
echo ":: prepare: Enabling debugging features"
|
echo ":: prepare: enabling debugging features"
|
||||||
scripts/config -e DEBUG_INFO \
|
scripts/config -e DEBUG_INFO \
|
||||||
-e DEBUG_INFO_BTF \
|
-e DEBUG_INFO_BTF \
|
||||||
-e DEBUG_INFO_DWARF4 \
|
-e DEBUG_INFO_DWARF4 \
|
||||||
-e PAHOLE_HAS_SPLIT_BTF \
|
-e PAHOLE_HAS_SPLIT_BTF \
|
||||||
-e DEBUG_INFO_BTF_MODULES
|
-e DEBUG_INFO_BTF_MODULES
|
||||||
elif [ "$_debug" == "n" ]; then
|
elif [ "$_debug" == "n" ]; then
|
||||||
echo ":: prepare: Disabling debugging features"
|
echo ":: prepare: disabling debugging features"
|
||||||
scripts/config -d DEBUG_INFO \
|
scripts/config -d DEBUG_INFO \
|
||||||
-d DEBUG_INFO_BTF \
|
-d DEBUG_INFO_BTF \
|
||||||
-d DEBUG_INFO_DWARF4 \
|
-d DEBUG_INFO_DWARF4 \
|
||||||
|
@ -99,13 +99,13 @@ prepare() {
|
||||||
-d DEBUG_INFO_BTF_MODULES
|
-d DEBUG_INFO_BTF_MODULES
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ":: prepare: Running olddefconfig"
|
echo ":: prepare: running olddefconfig"
|
||||||
make ${BUILD_FLAGS[*]} olddefconfig
|
make ${BUILD_FLAGS[*]} olddefconfig
|
||||||
diff -u $srcdir/cl-linux/config .config || :
|
diff -u $srcdir/cl-linux/config .config || :
|
||||||
|
|
||||||
# https://github.com/graysky2/kernel_compiler_patch
|
# https://github.com/graysky2/kernel_compiler_patch
|
||||||
# make sure to apply after olddefconfig to allow the next section
|
# make sure to apply after olddefconfig to allow the next section
|
||||||
echo ":: prepare: Patching kernel with kernel_compiler_patch"
|
echo ":: prepare: patching kernel with kernel_compiler_patch"
|
||||||
patch -Np1 -i "$srcdir/kernel_compiler_patch-$_gcc_more_v/more-uarches-for-kernel-6.1.79-6.8-rc3.patch"
|
patch -Np1 -i "$srcdir/kernel_compiler_patch-$_gcc_more_v/more-uarches-for-kernel-6.1.79-6.8-rc3.patch"
|
||||||
|
|
||||||
if [ -n "$_subarch" ]; then
|
if [ -n "$_subarch" ]; then
|
||||||
|
@ -122,30 +122,31 @@ prepare() {
|
||||||
# See https://aur.archlinux.org/packages/modprobed-db
|
# See https://aur.archlinux.org/packages/modprobed-db
|
||||||
if [ -n "$_localmodcfg" ]; then
|
if [ -n "$_localmodcfg" ]; then
|
||||||
if [ -e "$HOME/.config/modprobed.db" ]; then
|
if [ -e "$HOME/.config/modprobed.db" ]; then
|
||||||
echo ":: prepare: Executing localmodconfig"
|
echo ":: prepare: executing localmodconfig"
|
||||||
make ${BUILD_FLAGS[*]} LSMOD=$HOME/.config/modprobed.db localmodconfig
|
make ${BUILD_FLAGS[*]} LSMOD=$HOME/.config/modprobed.db localmodconfig
|
||||||
else
|
else
|
||||||
echo ":: prepare: error: No modprobed.db found at \"${HOME}/.config/modprobed.db\", skipping"
|
echo ":: prepare: error: no modprobed.db found at \"${HOME}/.config/modprobed.db\", skipping"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ":: prepare: Writing version"
|
echo ":: prepare: writing kernel version"
|
||||||
make -s kernelrelease > version
|
make -s kernelrelease > version
|
||||||
|
|
||||||
[[ -z "$_makexconfig" ]] || (
|
[[ -z "$_makexconfig" ]] || (
|
||||||
echo ":: prepare: Executing xconfig"
|
echo ":: prepare: executing xconfig"
|
||||||
make ${BUILD_FLAGS[*]} xconfig
|
make ${BUILD_FLAGS[*]} xconfig
|
||||||
)
|
)
|
||||||
[[ -z "$_makenconfig" ]] || (
|
[[ -z "$_makenconfig" ]] || (
|
||||||
echo ":: prepare: Executing nconfig"
|
echo ":: prepare: executing nconfig"
|
||||||
make ${BUILD_FLAGS[*]} nconfig
|
make ${BUILD_FLAGS[*]} nconfig
|
||||||
)
|
)
|
||||||
|
|
||||||
### Save configuration for later reuse
|
### Save configuration for later reuse
|
||||||
[[ -z "$_copyfinalconfig" ]] || (
|
[[ -z "$_copyfinalconfig" ]] || (
|
||||||
echo ":: prepare: Copying configuration file into kernel-optimized repository"
|
echo ":: prepare: copying configuration file into kernel-optimized repository"
|
||||||
cp -Tf ./.config "${startdir}/finalconfig-${pkgver}-${pkgrel}${pkgbase#linux}"
|
cp -Tf ./.config "${startdir}/finalconfig-${pkgver}-${pkgrel}${pkgbase#linux}"
|
||||||
)
|
)
|
||||||
|
echo ":: prepare: prepare() finished"
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
@ -154,9 +155,12 @@ build() {
|
||||||
cd ${_srcname}
|
cd ${_srcname}
|
||||||
echo ":: build: starting compilation (make ${BUILD_FLAGS[*]} all)"
|
echo ":: build: starting compilation (make ${BUILD_FLAGS[*]} all)"
|
||||||
make ${BUILD_FLAGS[*]} all
|
make ${BUILD_FLAGS[*]} all
|
||||||
|
echo ":: build: build() finished"
|
||||||
}
|
}
|
||||||
|
|
||||||
_package() {
|
_package() {
|
||||||
|
echo ":: _package: _package() called"
|
||||||
|
echo ":: _package: updating package information"
|
||||||
pkgdesc="${pkgdesc} This package includes the kernel and compiled modules."
|
pkgdesc="${pkgdesc} This package includes the kernel and compiled modules."
|
||||||
depends=('coreutils' 'kmod' 'initramfs')
|
depends=('coreutils' 'kmod' 'initramfs')
|
||||||
optdepends=('wireless-regdb: to set the correct wireless channels of your country'
|
optdepends=('wireless-regdb: to set the correct wireless channels of your country'
|
||||||
|
@ -165,11 +169,12 @@ _package() {
|
||||||
provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE KSMBD-MODULE)
|
provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE KSMBD-MODULE)
|
||||||
install=linux.install
|
install=linux.install
|
||||||
|
|
||||||
|
echo ":: _package: cding into \"${_srcname}\""
|
||||||
cd $_srcname
|
cd $_srcname
|
||||||
|
|
||||||
local modulesdir="$pkgdir/usr/lib/modules/$(<version)"
|
local modulesdir="$pkgdir/usr/lib/modules/$(<version)"
|
||||||
|
|
||||||
echo "Installing boot image..."
|
echo ":: _package: installing boot image"
|
||||||
# systemd expects to find the kernel here to allow hibernation
|
# systemd expects to find the kernel here to allow hibernation
|
||||||
# https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
|
# https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
|
||||||
install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz"
|
install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz"
|
||||||
|
@ -177,22 +182,27 @@ _package() {
|
||||||
# Used by mkinitcpio to name the kernel
|
# Used by mkinitcpio to name the kernel
|
||||||
echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
|
echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
|
||||||
|
|
||||||
echo "Installing modules..."
|
echo ":: _package: installing modules"
|
||||||
ZSTD_CLEVEL=19 make ${BUILD_FLAGS[*]} INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 \
|
ZSTD_CLEVEL=19 make ${BUILD_FLAGS[*]} INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 \
|
||||||
DEPMOD=/doesnt/exist modules_install # Suppress depmod
|
DEPMOD=/doesnt/exist modules_install # Suppress depmod
|
||||||
|
|
||||||
# remove build link
|
# remove build link
|
||||||
rm "$modulesdir"/build
|
rm "$modulesdir"/build
|
||||||
|
|
||||||
|
echo ":: _package: _package() finished"
|
||||||
}
|
}
|
||||||
|
|
||||||
_package-headers() {
|
_package-headers() {
|
||||||
|
echo ":: _package-headers: _package-headers() called"
|
||||||
|
echo ":: _package-headers: updating package information"
|
||||||
pkgdesc="${pkgdesc} This package includes various headers and scripts for building modules."
|
pkgdesc="${pkgdesc} This package includes various headers and scripts for building modules."
|
||||||
depends=(pahole)
|
depends=(pahole)
|
||||||
|
|
||||||
|
echo ":: _package-headers: cding into \"${_srcname}\""
|
||||||
cd ${_srcname}
|
cd ${_srcname}
|
||||||
local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
|
local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
|
||||||
|
|
||||||
echo "Installing build files..."
|
echo ":: _package-headers: installing build files"
|
||||||
install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \
|
install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \
|
||||||
localversion.* version vmlinux
|
localversion.* version vmlinux
|
||||||
install -Dt "$builddir/kernel" -m644 kernel/Makefile
|
install -Dt "$builddir/kernel" -m644 kernel/Makefile
|
||||||
|
@ -207,7 +217,7 @@ _package-headers() {
|
||||||
install -Dt "$builddir/tools/bpf/resolve_btfids" tools/bpf/resolve_btfids/resolve_btfids
|
install -Dt "$builddir/tools/bpf/resolve_btfids" tools/bpf/resolve_btfids/resolve_btfids
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installing headers..."
|
echo ":: _package-headers: installing headers"
|
||||||
cp -t "$builddir" -a include
|
cp -t "$builddir" -a include
|
||||||
cp -t "$builddir/arch/x86" -a arch/x86/include
|
cp -t "$builddir/arch/x86" -a arch/x86/include
|
||||||
install -Dt "$builddir/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s
|
install -Dt "$builddir/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s
|
||||||
|
@ -226,10 +236,10 @@ _package-headers() {
|
||||||
# https://bugs.archlinux.org/task/71392
|
# https://bugs.archlinux.org/task/71392
|
||||||
install -Dt "$builddir/drivers/iio/common/hid-sensors" -m644 drivers/iio/common/hid-sensors/*.h
|
install -Dt "$builddir/drivers/iio/common/hid-sensors" -m644 drivers/iio/common/hid-sensors/*.h
|
||||||
|
|
||||||
echo "Installing KConfig files..."
|
echo ":: _package-headers: installing KConfig files"
|
||||||
find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;
|
find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;
|
||||||
|
|
||||||
echo "Removing unneeded architectures..."
|
echo ":: _package-headers: removing unneeded architectures"
|
||||||
local arch
|
local arch
|
||||||
for arch in "$builddir"/arch/*/; do
|
for arch in "$builddir"/arch/*/; do
|
||||||
[[ $arch = */x86/ ]] && continue
|
[[ $arch = */x86/ ]] && continue
|
||||||
|
@ -237,16 +247,16 @@ _package-headers() {
|
||||||
rm -r "$arch"
|
rm -r "$arch"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Removing documentation..."
|
echo ":: _package-headers: removing documentation"
|
||||||
rm -r "$builddir/Documentation"
|
rm -r "$builddir/Documentation"
|
||||||
|
|
||||||
echo "Removing broken symlinks..."
|
echo ":: _package-headers: removing broken symlinks"
|
||||||
find -L "$builddir" -type l -printf 'Removing %P\n' -delete
|
find -L "$builddir" -type l -printf 'Removing %P\n' -delete
|
||||||
|
|
||||||
echo "Removing loose objects..."
|
echo ":: _package-headers: removing loose objects"
|
||||||
find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete
|
find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete
|
||||||
|
|
||||||
echo "Stripping build tools..."
|
echo ":: _package-headers: stripping build tools"
|
||||||
local file
|
local file
|
||||||
while read -rd '' file; do
|
while read -rd '' file; do
|
||||||
case "$(file -Sib "$file")" in
|
case "$(file -Sib "$file")" in
|
||||||
|
@ -261,12 +271,14 @@ _package-headers() {
|
||||||
esac
|
esac
|
||||||
done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0)
|
done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0)
|
||||||
|
|
||||||
echo "Stripping vmlinux..."
|
echo ":: _package-headers: stripping vmlinux"
|
||||||
strip -v $STRIP_STATIC "$builddir/vmlinux"
|
strip -v $STRIP_STATIC "$builddir/vmlinux"
|
||||||
|
|
||||||
echo "Adding symlink..."
|
echo ":: _package-headers: adding symlink"
|
||||||
mkdir -p "$pkgdir/usr/src"
|
mkdir -p "$pkgdir/usr/src"
|
||||||
ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"
|
ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"
|
||||||
|
|
||||||
|
echo ":: _package-headers: _package-headers() finished"
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgname=("$pkgbase" "$pkgbase-headers")
|
pkgname=("$pkgbase" "$pkgbase-headers")
|
||||||
|
|
Reference in a new issue