From 6ced6fc9485e3b6444b3bdb498eedf9cb5517de8 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 28 Sep 2018 17:09:57 +0200 Subject: [PATCH] Minor fixes for main line Linux LTS build - Patch the config first, don't touch it after running make oldconfig - Add modules target to toolchain config, don't directly call it - Only try to install modules if we actually have support for loadable modules Signed-off-by: David Oberhollenzer --- layer/bsp-alix/TOOLCHAIN | 2 +- pkg/linux/build | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/layer/bsp-alix/TOOLCHAIN b/layer/bsp-alix/TOOLCHAIN index 698e0a3..253d7a8 100644 --- a/layer/bsp-alix/TOOLCHAIN +++ b/layer/bsp-alix/TOOLCHAIN @@ -7,5 +7,5 @@ GCC_EXTRACFG="--disable-libmpx --disable-libssp" LINUXPKG="linux" LINUX_CPU="x86" -LINUX_TGT="bzImage" +LINUX_TGT="bzImage modules" OPENSSL_TARGET="linux-generic32 386" diff --git a/pkg/linux/build b/pkg/linux/build index c6fdeb6..73e3a01 100755 --- a/pkg/linux/build +++ b/pkg/linux/build @@ -20,13 +20,11 @@ build() { make -C "$1" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" mrproper cat_file_override "linux.config" > "$PKGBUILDDIR/.config" - - make -C "$1" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" oldconfig sed -i "$PKGBUILDDIR/.config" -e 's,^CONFIG_CROSS_COMPILE=.*,CONFIG_CROSS_COMPILE="'$TARGET'-",' sed -i "$PKGBUILDDIR/.config" -e 's,^CONFIG_INITRAMFS_SOURCE=.*,CONFIG_INITRAMFS_SOURCE="'$INITRDLIST'",' sed -i "$PKGBUILDDIR/.config" -e 's,^CONFIG_LOCALVERSION=.*,CONFIG_LOCALVERSION="-'${OS_NAME}-${OS_RELEASE}'",' + make -C "$1" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" oldconfig make -C "$1" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" -j $NUMJOBS $LINUX_TGT - make -C "$1" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" -j $NUMJOBS modules } deploy() { @@ -35,15 +33,16 @@ deploy() { mkdir -p "$DEPLOY/boot" "$DEPLOY/lib/modules" cp "arch/$LINUX_CPU/boot/$LINUX_TGT" "$DEPLOY/boot/vmlinuz" - - export KBUILD_OUTPUT="$PKGBUILDDIR" - make -C "$SOURCE" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" INSTALL_MOD_PATH="$DEPLOY" modules_install - echo "boot/vmlinuz m 555 0 0" > "$DEPLOY/rootfs_files.txt" - find "$DEPLOY/lib" -exec stat {} --printf="%n m %a 0 0\\n" \; | \ - sed "s#^$DEPLOY/##g" | sed "s/644/444/g" | \ - sed "s/755/555/g" >> "$DEPLOY/rootfs_files.txt" + if grep -q "^CONFIG_MODULES=" ".config"; then + export KBUILD_OUTPUT="$PKGBUILDDIR" + make -C "$SOURCE" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" INSTALL_MOD_PATH="$DEPLOY" modules_install + + find "$DEPLOY/lib" -exec stat {} --printf="%n m %a 0 0\\n" \; | \ + sed "s#^$DEPLOY/##g" | sed "s/644/444/g" | \ + sed "s/755/555/g" >> "$DEPLOY/rootfs_files.txt" + fi } check_update() {