mirror of
https://github.com/pygos/build.git
synced 2024-11-22 19:19:46 +01:00
a71c45aec0
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
52 lines
1.8 KiB
Text
Executable file
52 lines
1.8 KiB
Text
Executable file
MAJOR="4"
|
|
MINOR="14"
|
|
RELEASE="73"
|
|
|
|
VERSION="$MAJOR.$MINOR.$RELEASE"
|
|
SRCDIR="linux-$VERSION"
|
|
TARBALL="linux-$VERSION.tar.xz"
|
|
URL="https://www.kernel.org/pub/linux/kernel/v$MAJOR.x"
|
|
SHA256SUM="999e38141ccc447df7bf7ce10b8803c12b32274b76d3d5400bf3fd88eee0e31e"
|
|
DEPENDS="initrd"
|
|
|
|
prepare() {
|
|
return
|
|
}
|
|
|
|
build() {
|
|
local INITRDLIST="$PKGDEPLOYDIR/initrd/initrd.list"
|
|
|
|
export KBUILD_OUTPUT="$PKGBUILDDIR"
|
|
|
|
make -C "$1" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" mrproper
|
|
cat_file_override "linux.config" > "$PKGBUILDDIR/.config"
|
|
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
|
|
}
|
|
|
|
deploy() {
|
|
local SOURCE="$1"
|
|
local DEPLOY="$2"
|
|
|
|
mkdir -p "$DEPLOY/boot" "$DEPLOY/lib/modules"
|
|
cp arch/${LINUX_CPU}/boot/*Image "$DEPLOY/boot/vmlinuz"
|
|
echo "boot/vmlinuz m 555 0 0" > "$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() {
|
|
curl --silent -L https://www.kernel.org/feeds/kdist.xml | \
|
|
grep -o "[0-9.]*: longterm" | grep -o "[0-9.]*" | \
|
|
verson_find_greatest "$VERSION"
|
|
}
|