BTC.sh 0.4.2
This commit is contained in:
parent
d2989812dd
commit
626b967c43
|
|
@ -541,8 +541,17 @@ function f_exec_log() {
|
|||
pv -t -r -b -N "${log_base}" | \
|
||||
tee -a "${log_file}" > /dev/null; then
|
||||
echo ">> [FAILED] ${log_base} exited non-zero." >&2
|
||||
echo ">> [FAILED] Last 40 lines of ${log_file}:" >&2
|
||||
tail -n 40 "${log_file}" >&2 2>/dev/null || true
|
||||
echo ">> [FAILED] Last 80 lines of ${log_file}:" >&2
|
||||
tail -n 80 "${log_file}" >&2 2>/dev/null || true
|
||||
echo "" >&2
|
||||
echo ">> [FAILED] Lines matching error patterns (case-insensitive):" >&2
|
||||
# Surface lines containing common error markers so the actual root
|
||||
# cause is visible even if it's far from the tail (e.g. a linker
|
||||
# error mid-log that triggered a cascade of later failures).
|
||||
# "exceeds" catches the kernel's UTS_RELEASE length limit;
|
||||
# "Error [0-9]" catches make's "*** [target] Error N" lines.
|
||||
grep -iE 'error:|error [0-9]|cannot find|undefined reference|no such file|not found|failed|fatal|exceeds|too (long|short|large)' \
|
||||
"${log_file}" 2>/dev/null | tail -n 30 >&2 || true
|
||||
echo ">> [FAILED] Full log: ${log_file}" >&2
|
||||
return 1
|
||||
fi
|
||||
|
|
@ -1352,7 +1361,16 @@ function f_kernel_binary() {
|
|||
fi
|
||||
|
||||
# Inject Custom Enterprise Swarm Labels & Architecture Parameters
|
||||
sed -i "s/CONFIG_LOCALVERSION=\"\"/CONFIG_LOCALVERSION=\"-dcosnet-${SYS_LABEL}\"/" .config
|
||||
#
|
||||
# NOTE: the LOCALVERSION tag (-dcosnet-${SYS_LABEL}) is passed on the
|
||||
# `make` command line below, NOT written into CONFIG_LOCALVERSION here.
|
||||
# Writing it to .config AND passing it on the make command line would
|
||||
# concatenate the two, producing a version string like
|
||||
# "7.1.7-dcosnet-DCOSNET-BROADWELL-AVX2-LTO-dcosnet-DCOSNET-BROADWELL-AVX2-LTO"
|
||||
# which exceeds the kernel's 64-byte UTS_RELEASE limit and aborts the
|
||||
# build at utsrelease.h generation with "exceeds 64 characters".
|
||||
# Pick ONE source of truth — the make command line is the LFS convention.
|
||||
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"\"|" .config || true
|
||||
|
||||
# Modern Hardening Optimization Suite Injection
|
||||
sed -i "s/# CONFIG_MODULES is not set/CONFIG_MODULES=n/" .config || true
|
||||
|
|
@ -1360,6 +1378,22 @@ function f_kernel_binary() {
|
|||
echo "CONFIG_KALLSYMS=n" >> .config
|
||||
echo "CONFIG_DEBUG_FS=n" >> .config
|
||||
|
||||
# Disable objtool (CONFIG_STACK_VALIDATION) and switch to the
|
||||
# frame-pointer unwinder. objtool is a HOST tool that links against
|
||||
# libelf; if the host lacks libelf-dev (the -dev package that provides
|
||||
# the libelf.so symlink, not just the runtime libelf.so.1), the LINK
|
||||
# step for tools/objtool/objtool fails with "cannot find -lelf" and
|
||||
# the whole kernel build aborts. Installing libelf-dev on the host
|
||||
# would fix it at the source, but we don't want to impose that
|
||||
# dependency — the frame-pointer unwinder is functionally equivalent
|
||||
# for a toolchain build (slightly larger kernel binary, marginally
|
||||
# slower stack traces in production, but no functional regression).
|
||||
# The olddefconfig step below will clean up any resulting conflicts.
|
||||
echo "CONFIG_STACK_VALIDATION=n" >> .config
|
||||
echo "CONFIG_UNWINDER_ORC=n" >> .config
|
||||
echo "CONFIG_UNWINDER_FRAME_POINTER=y" >> .config
|
||||
echo "CONFIG_OBJTOOL=n" >> .config 2>/dev/null || true
|
||||
|
||||
# Cross-compile kernel using the canonical ARCH= name and the
|
||||
# Stage 2 cross-compiler (now on PATH after f_gcc_p2()).
|
||||
#
|
||||
|
|
|
|||
Loading…
Reference in New Issue