1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 11:09:46 +01:00
build/pkg/linux_modules/build
David Oberhollenzer 5c8effa301 Remove unneccessarry prepare() hooks
- Packages that don't download anything don't need a prepare() hook
 - Packages that inherit the source from other packages should leave
   it untouched. If they get downloaded first, they should use the
   hook from the original package.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-01-30 14:02:09 +01:00

32 lines
1,017 B
Text
Executable file

# inherit package details from kernel package
source "$SCRIPTDIR/pkg/$LINUXPKG/build"
build() {
local INPUT="$1"
local OUTPUT="$2"
local CFGFILE="$SCRIPTDIR/cfg/$CFG/linux.config"
local LINUX_CPU=$(head -1 "$CFGFILE" | cut -b 3-)
export KBUILD_OUTPUT="$OUTPUT"
make -C "$INPUT" O="$OUTPUT" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" mrproper
cp "$CFGFILE" "$OUTPUT/.config"
make -C "$INPUT" O="$OUTPUT" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" oldconfig
sed -i "$OUTPUT/.config" -e 's,^CONFIG_CROSS_COMPILE=.*,CONFIG_CROSS_COMPILE="'$TARGET'-",'
make -C "$INPUT" O="$OUTPUT" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" -j $NUMJOBS modules
}
deploy() {
local SOURCE="$1"
local BUILD="$2"
local DEPLOY="$3"
local CFGFILE="$SCRIPTDIR/cfg/$CFG/linux.config"
local LINUX_CPU=$(head -1 "$CFGFILE" | cut -b 3-)
mkdir -p "$DEPLOY/lib/modules"
export KBUILD_OUTPUT="$BUILD"
make -C "$SOURCE" O="$BUILD" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" INSTALL_MOD_PATH="$DEPLOY" modules_install
}