1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 19:19:46 +01:00
build/pkg/linux_modules/build

29 lines
1.1 KiB
Text
Raw Normal View History

# inherit package details from kernel package
source "$SCRIPTDIR/pkg/$LINUXPKG/build"
DEPENDS="toolchain"
build() {
export KBUILD_OUTPUT="$PKGBUILDDIR"
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_LOCALVERSION=.*,CONFIG_LOCALVERSION="-'${OS_NAME}-${OS_RELEASE}'",'
make -C "$1" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" -j $NUMJOBS modules
}
deploy() {
local SOURCE="$1"
local DEPLOY="$2"
mkdir -p "$DEPLOY/lib/modules"
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"
}