mirror of
https://github.com/pygos/build.git
synced 2024-11-22 11:09:46 +01:00
cleanup: derive LINUX_CPU from TARGET, merge linux packages
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
parent
b5d4ece03d
commit
7dd6306b30
6 changed files with 28 additions and 45 deletions
|
@ -7,7 +7,6 @@ CPU_IS_64BIT="no"
|
||||||
GCC_EXTRACFG="--enable-libmpx"
|
GCC_EXTRACFG="--enable-libmpx"
|
||||||
|
|
||||||
LINUXPKG="linux"
|
LINUXPKG="linux"
|
||||||
LINUX_CPU="x86"
|
|
||||||
LINUX_TGT="bzImage modules"
|
LINUX_TGT="bzImage modules"
|
||||||
|
|
||||||
TC_HARDENING="no"
|
TC_HARDENING="no"
|
||||||
|
|
|
@ -7,7 +7,6 @@ CPU_IS_64BIT="yes"
|
||||||
GCC_EXTRACFG="--enable-libmpx"
|
GCC_EXTRACFG="--enable-libmpx"
|
||||||
|
|
||||||
LINUXPKG="linux"
|
LINUXPKG="linux"
|
||||||
LINUX_CPU="x86_64"
|
|
||||||
LINUX_TGT="bzImage"
|
LINUX_TGT="bzImage"
|
||||||
|
|
||||||
TC_HARDENING="no"
|
TC_HARDENING="no"
|
||||||
|
|
|
@ -7,7 +7,6 @@ CPU_IS_64BIT="no"
|
||||||
GCC_EXTRACFG="--with-float=hard --with-fpu=neon-vfpv3"
|
GCC_EXTRACFG="--with-float=hard --with-fpu=neon-vfpv3"
|
||||||
|
|
||||||
LINUXPKG="linux-rpi3"
|
LINUXPKG="linux-rpi3"
|
||||||
LINUX_CPU="arm"
|
LINUX_TGT="zImage dtbs modules"
|
||||||
LINUX_TGT="zImage"
|
|
||||||
|
|
||||||
TC_HARDENING="no"
|
TC_HARDENING="no"
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
# inherit functions from generic kernel package
|
||||||
|
source "$SCRIPTDIR/pkg/linux/build"
|
||||||
|
|
||||||
VERSION="1.20180919-1"
|
VERSION="1.20180919-1"
|
||||||
SRCDIR="linux-raspberrypi-kernel_${VERSION}"
|
SRCDIR="linux-raspberrypi-kernel_${VERSION}"
|
||||||
TARBALL="raspberrypi-kernel_${VERSION}.tar.gz"
|
TARBALL="raspberrypi-kernel_${VERSION}.tar.gz"
|
||||||
|
@ -5,44 +8,6 @@ URL="https://github.com/raspberrypi/linux/archive"
|
||||||
SHA256SUM="b58a7a786b94957674ce3f64307ea7e7883ae2d1d871ea6ed5a5ce1b6846bdf4"
|
SHA256SUM="b58a7a786b94957674ce3f64307ea7e7883ae2d1d871ea6ed5a5ce1b6846bdf4"
|
||||||
DEPENDS="initrd"
|
DEPENDS="initrd"
|
||||||
|
|
||||||
prepare() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
build() {
|
|
||||||
local INITRDLIST="$PKGDEPLOYDIR/initrd/initrd.list"
|
|
||||||
|
|
||||||
export KBUILD_OUTPUT="$PKGBUILDDIR"
|
|
||||||
make -C "$1" O="$PKGBUILDDIR" ARCH="arm" 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'",'
|
|
||||||
make -C "$1" O="$PKGBUILDDIR" ARCH="arm" 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="arm" CROSS_COMPILE="${TARGET}-" -j $NUMJOBS zImage dtbs modules
|
|
||||||
}
|
|
||||||
|
|
||||||
deploy() {
|
|
||||||
local SOURCE="$1"
|
|
||||||
local DEPLOY="$2"
|
|
||||||
|
|
||||||
mkdir -p "$DEPLOY/boot" "$DEPLOY/lib/modules"
|
|
||||||
cp "arch/arm/boot/zImage" "$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"
|
|
||||||
}
|
|
||||||
|
|
||||||
check_update() {
|
check_update() {
|
||||||
local version=$(echo $VERSION | sed 's/-/./g')
|
local version=$(echo $VERSION | sed 's/-/./g')
|
||||||
|
|
||||||
|
|
|
@ -9,12 +9,31 @@ URL="https://www.kernel.org/pub/linux/kernel/v$MAJOR.x"
|
||||||
SHA256SUM="70e69189fd7b2f96fa33833735c7bcf3281dc0172c3734e2c5819e9d57015c72"
|
SHA256SUM="70e69189fd7b2f96fa33833735c7bcf3281dc0172c3734e2c5819e9d57015c72"
|
||||||
DEPENDS="initrd"
|
DEPENDS="initrd"
|
||||||
|
|
||||||
|
get_linux_cpu() {
|
||||||
|
case "$TARGET" in
|
||||||
|
i*86-*)
|
||||||
|
echo "x86"
|
||||||
|
;;
|
||||||
|
x86_64-*)
|
||||||
|
echo "x86_64"
|
||||||
|
;;
|
||||||
|
arm-*)
|
||||||
|
echo "arm"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "don't know how to map $TARGET to Linux arch" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
local INITRDLIST="$PKGDEPLOYDIR/initrd/initrd.list"
|
local INITRDLIST="$PKGDEPLOYDIR/initrd/initrd.list"
|
||||||
|
local LINUX_CPU=$(get_linux_cpu)
|
||||||
|
|
||||||
export KBUILD_OUTPUT="$PKGBUILDDIR"
|
export KBUILD_OUTPUT="$PKGBUILDDIR"
|
||||||
|
|
||||||
|
@ -30,6 +49,7 @@ build() {
|
||||||
deploy() {
|
deploy() {
|
||||||
local SOURCE="$1"
|
local SOURCE="$1"
|
||||||
local DEPLOY="$2"
|
local DEPLOY="$2"
|
||||||
|
local LINUX_CPU=$(get_linux_cpu)
|
||||||
|
|
||||||
mkdir -p "$DEPLOY/boot" "$DEPLOY/lib/modules"
|
mkdir -p "$DEPLOY/boot" "$DEPLOY/lib/modules"
|
||||||
cp arch/${LINUX_CPU}/boot/*Image "$DEPLOY/boot/vmlinuz"
|
cp arch/${LINUX_CPU}/boot/*Image "$DEPLOY/boot/vmlinuz"
|
||||||
|
|
|
@ -3,14 +3,15 @@ source "$SCRIPTDIR/pkg/$LINUXPKG/build"
|
||||||
DEPENDS=""
|
DEPENDS=""
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
local LINUX_CPU=$(get_linux_cpu)
|
||||||
|
|
||||||
make -C "$1" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" mrproper
|
make -C "$1" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" mrproper
|
||||||
make -C "$1" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" headers_check
|
make -C "$1" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" headers_check
|
||||||
}
|
}
|
||||||
|
|
||||||
deploy() {
|
deploy() {
|
||||||
local INPUT="$1"
|
local LINUX_CPU=$(get_linux_cpu)
|
||||||
local DEPLOY="$2"
|
|
||||||
|
|
||||||
export KBUILD_OUTPUT="$PKGBUILDDIR"
|
export KBUILD_OUTPUT="$PKGBUILDDIR"
|
||||||
make -C "$INPUT" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" INSTALL_HDR_PATH="$DEPLOY" headers_install
|
make -C "$1" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" INSTALL_HDR_PATH="$2" headers_install
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue