1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-05 03:27:10 +01:00
build/pkg/linux/build
David Oberhollenzer 297b0a3254 Cleanup release packages
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-01-30 14:02:09 +01:00

47 lines
1.4 KiB
Text
Executable file

MAJOR="4"
MINOR="14"
RELEASE="1"
VERSION="$MAJOR.$MINOR.$RELEASE"
SRCDIR="linux-$VERSION"
TARBALL="linux-$VERSION.tar.xz"
URL="https://www.kernel.org/pub/linux/kernel/v$MAJOR.x"
SHA256SUM="6fb9f67002f986ce3905b35466e35c394e0fa3eb7c32df508514717955cb4de7"
prepare() {
return
}
build() {
local INPUT="$1"
local OUTPUT="$2"
local CFGFILE="$SCRIPTDIR/cfg/$CFG/linux.config"
local LINUX_CPU=$(head -1 "$CFGFILE" | cut -b 3-)
local LINUX_TGT=$(head -2 "$CFGFILE" | tail -1 | cut -b 3-)
local INITRDLIST="$PKGDEPLOYDIR/initrd/initrd.list"
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'-",'
sed -i "$OUTPUT/.config" -e 's,^CONFIG_INITRAMFS_SOURCE=.*,CONFIG_INITRAMFS_SOURCE="'$INITRDLIST'",'
make -C "$INPUT" O="$OUTPUT" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" -j $NUMJOBS $LINUX_TGT
}
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-)
local LINUX_TGT=$(head -2 "$CFGFILE" | tail -1 | cut -b 3-)
pushd $BUILD
install -m 755 "arch/$LINUX_CPU/boot/$LINUX_TGT" "$DEPLOY/vmlinuz-$VERSION"
popd
}