2013-07-13 17:19:22 +01:00
|
|
|
version=\
|
|
|
|
(
|
2015-12-16 15:55:55 +00:00
|
|
|
'3.14.57'
|
2013-07-13 17:19:22 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
url=\
|
|
|
|
(
|
2014-01-21 00:28:51 +00:00
|
|
|
"https://www.kernel.org/pub/linux/kernel/v3.x/linux-$version.tar.xz"
|
2013-07-13 17:19:22 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
md5=\
|
|
|
|
(
|
2015-12-16 15:55:55 +00:00
|
|
|
'b7e254c83a0324852c8ccc4ed1b5377d'
|
2013-07-13 17:19:22 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
maintainer=\
|
|
|
|
(
|
|
|
|
'Ricardo Martins <rasm@fe.up.pt>'
|
|
|
|
)
|
|
|
|
|
|
|
|
requires=\
|
|
|
|
(
|
2014-06-11 19:33:27 +01:00
|
|
|
'bc/host'
|
2013-07-13 17:19:22 +01:00
|
|
|
'kmod/host'
|
2014-01-21 00:37:37 +00:00
|
|
|
'lz4/host'
|
2013-07-13 17:19:22 +01:00
|
|
|
)
|
2014-08-19 18:26:49 +01:00
|
|
|
|
|
|
|
post_unpack()
|
|
|
|
{
|
|
|
|
patches=$(ls "$pkg_dir/patches/$version/"*.patch\
|
|
|
|
"$cfg_dir_system/patches/linux/$version/"*.patch 2>/dev/null)
|
|
|
|
if [ -n "$patches" ]; then
|
|
|
|
cat $patches | patch -p1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d "$cfg_dir_toolchain/firmware" ]; then
|
|
|
|
tar -C "$cfg_dir_toolchain/firmware" -c -v -f - . | tar -C firmware -x -v -f -
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
refresh()
|
|
|
|
{
|
|
|
|
for rule in configure build target_install; do
|
|
|
|
if [ "$cfg_dir_system/cfg/linux-${version}.cfg" -nt "$cfg_dir_builds/linux/$pkg_var/.$rule" ]; then
|
|
|
|
rm "$cfg_dir_builds/linux/$pkg_var/.$rule"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
configure()
|
|
|
|
{
|
|
|
|
$cmd_make \
|
|
|
|
ARCH=${cfg_target_linux} \
|
|
|
|
mrproper &&
|
|
|
|
|
|
|
|
cp "$cfg_dir_system/cfg/linux-${version}.cfg" .config &&
|
|
|
|
|
2015-06-29 17:23:00 +01:00
|
|
|
if [ -f "$cfg_dir_system/files/initramfs_init.sh" ]; then
|
2015-02-08 18:41:17 +00:00
|
|
|
$cmd_mkdir initramfs &&
|
|
|
|
$cmd_cp "$pkg_dir/files/initramfs.conf" . &&
|
|
|
|
$cmd_cp "$cfg_dir_system/files/initramfs_init.sh" initramfs/init.sh &&
|
|
|
|
$cmd_cp "$cfg_dir_rootfs/bin/busybox" initramfs/busybox
|
|
|
|
fi
|
|
|
|
|
2014-08-19 18:26:49 +01:00
|
|
|
yes '' | $cmd_make \
|
|
|
|
CROSS_COMPILE=${cfg_target_canonical}- \
|
|
|
|
ARCH=${cfg_target_linux} \
|
|
|
|
oldconfig
|
|
|
|
}
|
|
|
|
|
|
|
|
build()
|
|
|
|
{
|
|
|
|
$cmd_make \
|
|
|
|
CROSS_COMPILE=$cfg_target_canonical- \
|
|
|
|
ARCH=$cfg_target_linux &&
|
|
|
|
$cmd_make \
|
|
|
|
CROSS_COMPILE=$cfg_target_canonical- \
|
|
|
|
ARCH=$cfg_target_linux \
|
|
|
|
modules &&
|
|
|
|
|
|
|
|
if [ "$(basename $cfg_target_linux_kernel)" = 'uImage' ]; then
|
|
|
|
$cmd_make \
|
|
|
|
CROSS_COMPILE=$cfg_target_canonical- \
|
|
|
|
ARCH=$cfg_target_linux \
|
|
|
|
uImage
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Compressed image.
|
|
|
|
if [ "$(basename $cfg_target_linux_kernel)" = 'zImage' ]; then
|
|
|
|
$cmd_make \
|
|
|
|
CROSS_COMPILE=$cfg_target_canonical- \
|
|
|
|
ARCH=$cfg_target_linux \
|
|
|
|
zImage
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Device tree blob.
|
|
|
|
if [ -n "$cfg_target_linux_dtb" ]; then
|
|
|
|
$cmd_make \
|
|
|
|
CROSS_COMPILE=$cfg_target_canonical- \
|
|
|
|
ARCH=$cfg_target_linux \
|
|
|
|
dtbs
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${cfg_target_linux_size}" ]; then
|
|
|
|
dd if="$cfg_target_linux_kernel" of="${cfg_target_linux_kernel}.padded" \
|
|
|
|
ibs="${cfg_target_linux_size}" conv=sync &&
|
|
|
|
mv "${cfg_target_linux_kernel}.padded" "${cfg_target_linux_kernel}"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2014-10-24 03:11:08 +01:00
|
|
|
host_install()
|
|
|
|
{
|
|
|
|
# Device tree blobs.
|
|
|
|
if [ -n "$cfg_target_linux_dtb" ]; then
|
|
|
|
$cmd_mkdir "$cfg_dir_toolchain/boot" &&
|
|
|
|
cp -v "$(dirname $cfg_target_linux_dtb)/"*.dtb "$cfg_dir_toolchain/boot"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2014-08-19 18:26:49 +01:00
|
|
|
target_install()
|
|
|
|
{
|
|
|
|
if [ -n "$(file "$cfg_target_linux_kernel" | grep ELF)" ]; then
|
|
|
|
strip="$(echo $cfg_dir_toolchain/bin/*-strip)"
|
|
|
|
$strip -s -R .comment "$cfg_target_linux_kernel"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Kernel image.
|
|
|
|
if [ -n "$cfg_target_linux_kernel" ]; then
|
|
|
|
cp -v "$cfg_target_linux_kernel" "$cfg_dir_rootfs/boot/kernel"
|
2015-12-17 13:52:44 +00:00
|
|
|
else
|
|
|
|
echo "ERROR: failed to find kernel image at '$cfg_target_linux_kernel'"
|
|
|
|
return 1
|
2014-08-19 18:26:49 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
$cmd_make \
|
|
|
|
CROSS_COMPILE="$cfg_target_canonical-" \
|
|
|
|
ARCH="$cfg_target_linux" \
|
|
|
|
INSTALL_MOD_PATH="$cfg_dir_rootfs/usr" \
|
|
|
|
modules_install
|
|
|
|
|
|
|
|
$cmd_make \
|
|
|
|
CROSS_COMPILE="$cfg_target_canonical-" \
|
|
|
|
ARCH="$cfg_target_linux" \
|
|
|
|
INSTALL_MOD_PATH="$cfg_dir_rootfs/usr" \
|
|
|
|
firmware_install
|
|
|
|
}
|