mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-22 15:01:00 +02:00
coreos-kernel: do not cache build directory
Using ccache alone offers almost as much speedup as preserving the build directory and avoids problems caused by skipping `make clean` between major kernel versions as is the case with 4.0 to 4.1.
This commit is contained in:
parent
e43e2ab5d7
commit
cccf38e880
@ -29,8 +29,7 @@ RESTRICT="binchecks strip"
|
|||||||
# Use source installed by coreos-sources
|
# Use source installed by coreos-sources
|
||||||
KERNEL_DIR="${SYSROOT}/usr/src/${COREOS_SOURCE_NAME}"
|
KERNEL_DIR="${SYSROOT}/usr/src/${COREOS_SOURCE_NAME}"
|
||||||
S="${KERNEL_DIR}"
|
S="${KERNEL_DIR}"
|
||||||
# Cache kernel build tree under /var
|
KBUILD_OUTPUT="${WORKDIR}/${P}"
|
||||||
KBUILD_OUTPUT="${SYSROOT}/var/cache/portage/${CATEGORY}/${PN}"
|
|
||||||
|
|
||||||
# Search for an apropriate defconfig in ${FILESDIR}. The config should reflect
|
# Search for an apropriate defconfig in ${FILESDIR}. The config should reflect
|
||||||
# the kernel version but partial matching is allowed if the config is
|
# the kernel version but partial matching is allowed if the config is
|
||||||
@ -108,16 +107,9 @@ shred_keys() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
coreos-kernel_pkg_setup() {
|
coreos-kernel_src_unpack() {
|
||||||
export KBUILD_OUTPUT
|
export KBUILD_OUTPUT
|
||||||
addwrite "${KBUILD_OUTPUT}"
|
mkdir "${KBUILD_OUTPUT}" || die
|
||||||
mkdir -p -m 755 "${KBUILD_OUTPUT}" || die
|
|
||||||
chown ${PORTAGE_USERNAME:-portage}:${PORTAGE_GRPNAME:-portage} \
|
|
||||||
"${KBUILD_OUTPUT}" "${KBUILD_OUTPUT%/*}" || die
|
|
||||||
|
|
||||||
# Let linux-info detect the kernel version,
|
|
||||||
# otherwise tc-arch-kernel outputs lots of warnings.
|
|
||||||
get_version
|
|
||||||
}
|
}
|
||||||
|
|
||||||
coreos-kernel_src_prepare() {
|
coreos-kernel_src_prepare() {
|
||||||
@ -137,16 +129,6 @@ coreos-kernel_src_prepare() {
|
|||||||
# copy the cpio initrd to the output build directory so we can tack it
|
# copy the cpio initrd to the output build directory so we can tack it
|
||||||
# onto the kernel image itself.
|
# onto the kernel image itself.
|
||||||
cp "${ROOT}"/usr/share/bootengine/bootengine.cpio "${KBUILD_OUTPUT}" || die
|
cp "${ROOT}"/usr/share/bootengine/bootengine.cpio "${KBUILD_OUTPUT}" || die
|
||||||
|
|
||||||
# make sure no keys are cached from a previous build
|
|
||||||
shred_keys
|
|
||||||
|
|
||||||
# HACK: generated syscall headers aren't always regenerated when jumping
|
|
||||||
# from 4.0.x to 4.1.x causing errors like this:
|
|
||||||
# arch/x86/built-in.o:(.rodata+0xb40): undefined reference to `stub_iopl'
|
|
||||||
# arch/x86/built-in.o:(.rodata+0x1388): undefined reference to `sys32_vm86_warning'
|
|
||||||
# arch/x86/built-in.o:(.rodata+0x1530): undefined reference to `sys32_vm86_warning'
|
|
||||||
rm -rf "${KBUILD_OUTPUT}/arch/x86/include/generated" || die
|
|
||||||
}
|
}
|
||||||
|
|
||||||
coreos-kernel_src_configure() {
|
coreos-kernel_src_configure() {
|
||||||
@ -222,7 +204,10 @@ coreos-kernel_src_install() {
|
|||||||
shred_keys
|
shred_keys
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# TODO(marineam): remove this function once KBUILD_OUTPUT is removed
|
||||||
|
# from src/scripts/setup_board
|
||||||
coreos-kernel_pkg_postinst() {
|
coreos-kernel_pkg_postinst() {
|
||||||
|
local KBUILD_OUTPUT="${SYSROOT}/var/cache/portage/${CATEGORY}/${PN}"
|
||||||
# linux-info always expects to be able to find the current .config
|
# linux-info always expects to be able to find the current .config
|
||||||
# so copy it into the build tree if it isn't already there.
|
# so copy it into the build tree if it isn't already there.
|
||||||
if ! cmp --quiet "${ROOT}/usr/boot/config" "${KBUILD_OUTPUT}/.config"; then
|
if ! cmp --quiet "${ROOT}/usr/boot/config" "${KBUILD_OUTPUT}/.config"; then
|
||||||
@ -232,4 +217,4 @@ coreos-kernel_pkg_postinst() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile src_install pkg_postinst
|
EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_postinst
|
||||||
|
Loading…
x
Reference in New Issue
Block a user