Proposed changes to the _use_current functionality #1
1 changed files with 72 additions and 65 deletions
53
PKGBUILD
53
PKGBUILD
|
@ -152,9 +152,7 @@ export KBUILD_BUILD_HOST=archlinux
|
|||
export KBUILD_BUILD_USER=${pkgbase}
|
||||
export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"
|
||||
|
||||
prepare() {
|
||||
cd "${_src_linux}" || exit 1
|
||||
|
||||
apply_patches() {
|
||||
# Patch with kernel version patches
|
||||
patch -Np1 -i ../patch-${_kernel_major}.${_kernel_minor} || true
|
||||
|
||||
|
@ -172,7 +170,21 @@ prepare() {
|
|||
|
||||
patch -Np1 -i "${srcdir}/cl-linux/${i}" || true
|
||||
done
|
||||
}
|
||||
|
||||
copy_defconfig() {
|
||||
if [[ -s /proc/config.gz ]]; then
|
||||
# modprobe configs
|
||||
zcat /proc/config.gz > ./.config
|
||||
make ${BUILD_FLAGS[*]} olddefconfig
|
||||
else
|
||||
warning "Your kernel was not compiled with IKCONFIG_PROC."
|
||||
warning "Unable to read kernel configuration, aborting."
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
create_defconfig() {
|
||||
# Copy configuration file (if found)
|
||||
if [ -f "${startdir}/kconfig" ]; then
|
||||
echo ":: Using configuration file \"${startdir}/kconfig\""
|
||||
|
@ -270,18 +282,21 @@ prepare() {
|
|||
# Ask for subarch
|
||||
[[ -z "${_subarch}" ]] && make ${BUILD_FLAGS[*]} oldconfig
|
||||
|
||||
# Optionally use the configuration of the running kernel
|
||||
# Written originally by nous, see
|
||||
# https://web.archive.org/web/20110711231356/https://aur.archlinux.org/packages.php?ID=40191 (package doesn't exist anymore)
|
||||
[[ -n "${_use_current}" ]] &&
|
||||
if [[ -s /proc/config.gz ]]; then
|
||||
# modprobe configs
|
||||
zcat /proc/config.gz > ./.config
|
||||
else
|
||||
warning "Your kernel was not compiled with IKCONFIG_PROC."
|
||||
warning "Unable to read kernel configuration, aborting."
|
||||
exit
|
||||
fi
|
||||
# Open configuration editors
|
||||
[[ -n "$_makemenuconfig" ]] && make ${BUILD_FLAGS[*]} menuconfig
|
||||
[[ -n "$_makexconfig" ]] && make ${BUILD_FLAGS[*]} xconfig
|
||||
[[ -n "$_makenconfig" ]] && make ${BUILD_FLAGS[*]} nconfig
|
||||
|
||||
# Save configuration
|
||||
[[ -n "${_copyfinalconfig}" ]] && cp -Tf ./.config "${startdir}/kconfig-new" || true
|
||||
}
|
||||
|
||||
prepare() {
|
||||
cd "${_src_linux}" || exit 1
|
||||
apply_patches
|
||||
|
||||
[[ -n "${_use_current}" ]] && copy_defconfig
|
||||
[[ -z "${_use_current}" ]] && create_defconfig
|
||||
|
||||
# Read and apply modprobed database
|
||||
# See https://aur.archlinux.org/packages/modprobed-db
|
||||
|
@ -294,14 +309,6 @@ prepare() {
|
|||
|
||||
# Write kernel version
|
||||
make -s kernelrelease > version
|
||||
|
||||
# Open configuration editors
|
||||
[[ -n "$_makemenuconfig" ]] && make ${BUILD_FLAGS[*]} menuconfig
|
||||
[[ -n "$_makexconfig" ]] && make ${BUILD_FLAGS[*]} xconfig
|
||||
[[ -n "$_makenconfig" ]] && make ${BUILD_FLAGS[*]} nconfig
|
||||
|
||||
# Save configuration
|
||||
[[ -n "${_copyfinalconfig}" ]] && cp -Tf ./.config "${startdir}/kconfig-new" || true
|
||||
}
|
||||
|
||||
build() {
|
||||
|
|
Loading…
Reference in a new issue