linux4.0: added support for a ARMv7 multiplatform kernel.
Hopefully this should work for bbb, cubie and odroid (of our supported platforms).
This commit is contained in:
parent
44fdbbbea5
commit
5640db985b
6914
srcpkgs/linux4.0/files/arm-dotconfig
Normal file
6914
srcpkgs/linux4.0/files/arm-dotconfig
Normal file
File diff suppressed because it is too large
Load Diff
@ -17,8 +17,8 @@ noverifyrdeps=yes
|
|||||||
noshlibprovides=yes
|
noshlibprovides=yes
|
||||||
preserve=yes
|
preserve=yes
|
||||||
|
|
||||||
only_for_archs="i686 i686-musl x86_64 x86_64-musl"
|
only_for_archs="i686 i686-musl x86_64 x86_64-musl armv7l armv7l-musl"
|
||||||
makedepends="bc perl kmod libressl-openssl"
|
hostmakedepends="bc perl kmod libressl-openssl uboot-mkimage"
|
||||||
triggers="kernel-hooks"
|
triggers="kernel-hooks"
|
||||||
|
|
||||||
_kernver="${version}_${revision}"
|
_kernver="${version}_${revision}"
|
||||||
@ -38,40 +38,60 @@ do_configure() {
|
|||||||
# If there's a file called <arch>-dotconfig, use it to
|
# If there's a file called <arch>-dotconfig, use it to
|
||||||
# configure the kernel; otherwise use arch defaults and all stuff
|
# configure the kernel; otherwise use arch defaults and all stuff
|
||||||
# as modules (defconfig+allmodconfig).
|
# as modules (defconfig+allmodconfig).
|
||||||
local arch
|
local arch _args
|
||||||
|
|
||||||
case "$XBPS_TARGET_MACHINE" in
|
case "$XBPS_TARGET_MACHINE" in
|
||||||
i686*) arch=i386;;
|
i686*) arch=i386;;
|
||||||
x86_64*) arch=x86_64;;
|
x86_64*) arch=x86_64;;
|
||||||
|
armv7*) arch=arm
|
||||||
|
$XBPS_FETCH_CMD http://rcn-ee.com/deb/sid-armhf/v${version}-armv7-x2/patch-${version}-armv7-x2.diff.gz
|
||||||
|
gunzip patch-${version}-armv7-x2.diff.gz
|
||||||
|
patch -Np1 -i patch-${version}-armv7-x2.diff
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if [ "$CROSS_BUILD" ]; then
|
||||||
|
_args="CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f ${FILESDIR}/${arch}-dotconfig-custom ]; then
|
if [ -f ${FILESDIR}/${arch}-dotconfig-custom ]; then
|
||||||
msg_normal "Detected a custom .config file for your arch, using it.\n"
|
msg_normal "Detected a custom .config file for your arch, using it.\n"
|
||||||
cp -f ${FILESDIR}/${arch}-dotconfig-custom .config
|
cp -f ${FILESDIR}/${arch}-dotconfig-custom .config
|
||||||
make ${makejobs} oldconfig
|
make ${makejobs} ARCH=$arch ${_args} oldconfig
|
||||||
elif [ -f ${FILESDIR}/${arch}-dotconfig ]; then
|
elif [ -f ${FILESDIR}/${arch}-dotconfig ]; then
|
||||||
msg_normal "Detected a .config file for your arch, using it.\n"
|
msg_normal "Detected a .config file for your arch, using it.\n"
|
||||||
cp -f ${FILESDIR}/${arch}-dotconfig .config
|
cp -f ${FILESDIR}/${arch}-dotconfig .config
|
||||||
make ${makejobs} oldconfig
|
make ${makejobs} ARCH=$arch ${_args} oldconfig
|
||||||
else
|
else
|
||||||
msg_normal "Defaulting to 'defconfig and allmodconfig'.\n"
|
msg_normal "Defaulting to 'defconfig and allmodconfig'.\n"
|
||||||
make ${makejobs} defconfig
|
make ${makejobs} ARCH=$arch ${_args} defconfig
|
||||||
make ${makejobs} allmodconfig
|
make ${makejobs} ARCH=$arch ${_args} allmodconfig
|
||||||
fi
|
fi
|
||||||
# Always use our revision to CONFIG_LOCALVERSION to match our pkg version.
|
# Always use our revision to CONFIG_LOCALVERSION to match our pkg version.
|
||||||
sed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config
|
sed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config
|
||||||
}
|
}
|
||||||
do_build() {
|
do_build() {
|
||||||
# Override EXTRAVERSION because we can't have dashes in kernel name
|
local arch _cross _args
|
||||||
make EXTRAVERSION=${_patchver} ${makejobs} prepare
|
|
||||||
make EXTRAVERSION=${_patchver} ${makejobs} bzImage modules
|
case "$XBPS_TARGET_MACHINE" in
|
||||||
|
i686*) _args="bzImage modules"; arch=i386;;
|
||||||
|
x86_64*) _args="bzImage modules"; arch=x86_64;;
|
||||||
|
armv7*) _args="zImage modules dtbs"; arch=arm;;
|
||||||
|
esac
|
||||||
|
if [ "$CROSS_BUILD" ]; then
|
||||||
|
_cross="CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-"
|
||||||
|
fi
|
||||||
|
|
||||||
|
make ARCH=$arch ${_cross} ${makejobs} prepare
|
||||||
|
make ARCH=$arch ${_cross} ${makejobs} ${_args}
|
||||||
}
|
}
|
||||||
do_install() {
|
do_install() {
|
||||||
local arch hdrdest
|
local arch _args hdrdest
|
||||||
|
|
||||||
case "$XBPS_TARGET_MACHINE" in
|
case "$XBPS_TARGET_MACHINE" in
|
||||||
i686*) arch=i386;;
|
i686*) arch=i386;;
|
||||||
x86_64*) arch=x86_64;;
|
x86_64*) arch=x86_64;;
|
||||||
|
armv7*) arch=arm;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Run depmod after compressing modules.
|
# Run depmod after compressing modules.
|
||||||
@ -82,11 +102,19 @@ do_install() {
|
|||||||
|
|
||||||
hdrdest=${DESTDIR}/usr/src/kernel-headers-${_kernver}
|
hdrdest=${DESTDIR}/usr/src/kernel-headers-${_kernver}
|
||||||
|
|
||||||
install -Dm644 .config ${DESTDIR}/boot/config-${_kernver}
|
vinstall .config 644 boot config-${_kernver}
|
||||||
install -Dm644 arch/x86/boot/bzImage \
|
vinstall System.map 644 boot System.map-${_kernver}
|
||||||
${DESTDIR}/boot/vmlinuz-${_kernver}
|
|
||||||
install -Dm644 System.map \
|
case "$arch" in
|
||||||
${DESTDIR}/boot/System.map-${_kernver}
|
i386|x86_64)
|
||||||
|
vinstall arch/x86/boot/bzImage 644 boot vmlinuz-${_kernver}
|
||||||
|
;;
|
||||||
|
arm)
|
||||||
|
vinstall arch/arm/boot/zImage 644 boot
|
||||||
|
vmkdir boot/dtbs
|
||||||
|
cp arch/arm/boot/dts/*.dtb ${DESTDIR}/boot/dtbs
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Switch to /usr.
|
# Switch to /usr.
|
||||||
vmkdir usr
|
vmkdir usr
|
||||||
@ -113,19 +141,21 @@ do_install() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
cd ${wrksrc}
|
cd ${wrksrc}
|
||||||
mkdir -p ${hdrdest}/arch/x86
|
mkdir -p ${hdrdest}/arch/${arch}
|
||||||
cp -a arch/x86/include ${hdrdest}/arch/x86
|
cp -a arch/x86/include ${hdrdest}/arch/${arch}
|
||||||
|
|
||||||
# Copy files necessary for later builds, like nvidia and vmware
|
# Copy files necessary for later builds, like nvidia and vmware
|
||||||
cp Module.symvers ${hdrdest}
|
cp Module.symvers ${hdrdest}
|
||||||
cp -a scripts ${hdrdest}
|
cp -a scripts ${hdrdest}
|
||||||
|
|
||||||
mkdir -p ${hdrdest}/arch/x86/kernel
|
mkdir -p ${hdrdest}/arch/${arch}/kernel
|
||||||
cp arch/x86/Makefile ${hdrdest}/arch/x86
|
cp arch/x86/Makefile ${hdrdest}/arch/${arch}
|
||||||
if [ "$arch" = "i386" ]; then
|
if [ "$arch" = "i386" ]; then
|
||||||
cp arch/x86/Makefile_32.cpu ${hdrdest}/arch/x86
|
cp arch/x86/Makefile_32.cpu ${hdrdest}/arch/x86
|
||||||
fi
|
fi
|
||||||
cp arch/x86/kernel/asm-offsets.s ${hdrdest}/arch/x86/kernel
|
if [ "$arch" = "i386" -o "$arch" = "x86_64" ]; then
|
||||||
|
cp arch/x86/kernel/asm-offsets.s ${hdrdest}/arch/x86/kernel
|
||||||
|
fi
|
||||||
|
|
||||||
# add headers for lirc package
|
# add headers for lirc package
|
||||||
# pci
|
# pci
|
||||||
@ -194,8 +224,12 @@ do_install() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Remove unneeded architectures
|
# Remove unneeded architectures
|
||||||
for arch in alpha arm* avr32 blackfin cris frv h8300 \
|
case "$arch" in
|
||||||
ia64 m* p* s* um v850 xtensa; do
|
i386|x86_64) _args="arm*";;
|
||||||
|
arm) _args="x86*";;
|
||||||
|
esac
|
||||||
|
for arch in alpha avr32 blackfin cris frv h8300 \
|
||||||
|
ia64 m* p* s* um v850 xtensa ${_args}; do
|
||||||
rm -rf ${hdrdest}/arch/${arch}
|
rm -rf ${hdrdest}/arch/${arch}
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user