Fix buildtool.sh and introduce $BUILDTOOL_DEBUG

This commit is contained in:
JeremyStar™ 2024-03-10 21:14:12 +01:00
parent 2737464478
commit 24c1065ab7

View file

@ -14,7 +14,7 @@ echo ""
export "BUILDTOOL_REPOSITORY=https://git.staropensource.de/JeremyStarTM/kernel-optimized.git"
export "BUILDTOOL_PACKAGES=base-devel git rustup"
export "BUILDTOOL_CLONEDIR=jstm-kernel-optimized"
export "BUILDTOOL_BUILDCMDLINE=nice -20 env MAKEFLAGS=\"-j$(nproc)\""
export "BUILDTOOL_BUILDCMDLINE=nice -20 env MAKEFLAGS=-j$(nproc)"
# Checks
## Check for Arch Linux
@ -52,7 +52,7 @@ function ask_mold() {
case "${BUILDTOOL_MOLD}" in
"y"|"Y"|"")
export "BUILDTOOL_PACKAGES=${BUILDTOOL_PACKAGES} mold"
export "BUILDTOOL_BUILDCMDLINE=${BUILDTOOL_BUILDCMDLINE} LDFLAGS=\"-fuse-ld=mold\" RUSTFLAGS=\"-C link-arg=-fuse-ld=mold\""
export "BUILDTOOL_BUILDCMDLINE=${BUILDTOOL_BUILDCMDLINE} LDFLAGS=-fuse-ld=mold RUSTFLAGS=\"-C link-arg=-fuse-ld=mold\""
;;
"n"|"N") ;;
*)
@ -283,6 +283,15 @@ echo ":: Cloning repository"
git clone "${BUILDTOOL_REPOSITORY}" "${BUILDTOOL_CLONEDIR}"
cd "${BUILDTOOL_CLONEDIR}"
# Print debug information
if [ "${BUILDTOOL_DEBUG}" == "true" ]; then
echo ":: Printing debug information"
echo "++ env ++"
env|grep "BUILDTOOL_"|sort
echo "++ env ++"
echo "build cmdline: ${BUILDTOOL_BUILDCMDLINE} "${BUILDTOOL_PKGBUILD_XCONFIG}" "${BUILDTOOL_PKGBUILD_NCONFIG}" "${BUILDTOOL_PKGBUILD_CPFINALCONFIG}" "${BUILDTOOL_PKGBUILD_MODPROBEDDB}" "${BUILDTOOL_PKGBUILD_SUBARCHITECTURE}" "${BUILDTOOL_PKGBUILD_DEBUG}" makepkg --syncdeps -p PKGBUILD.buildtool"
fi
# Build kernel
echo ":: Building kernel"
${BUILDTOOL_BUILDCMDLINE} "${BUILDTOOL_PKGBUILD_XCONFIG}" "${BUILDTOOL_PKGBUILD_NCONFIG}" "${BUILDTOOL_PKGBUILD_CPFINALCONFIG}" "${BUILDTOOL_PKGBUILD_MODPROBEDDB}" "${BUILDTOOL_PKGBUILD_SUBARCHITECTURE}" "${BUILDTOOL_PKGBUILD_DEBUG}" makepkg --syncdeps -p PKGBUILD.buildtool
${BUILDTOOL_BUILDCMDLINE} "${BUILDTOOL_PKGBUILD_XCONFIG}" "${BUILDTOOL_PKGBUILD_NCONFIG}" "${BUILDTOOL_PKGBUILD_CPFINALCONFIG}" "${BUILDTOOL_PKGBUILD_MODPROBEDDB}" "${BUILDTOOL_PKGBUILD_SUBARCHITECTURE}" "${BUILDTOOL_PKGBUILD_DEBUG}" makepkg --syncdeps -p PKGBUILD.buildtool