linux4.4: add ppc64 and ppc support

This commit is contained in:
q66 2020-03-17 04:20:29 +01:00
parent 5a9e97ca76
commit 883f868a69
3 changed files with 13955 additions and 9 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -17,9 +17,13 @@ noverifyrdeps=yes
noshlibprovides=yes
preserve=yes
archs="i686* x86_64* armv7l* aarch64*"
archs="i686* x86_64* armv7l* aarch64* ppc*"
hostmakedepends="bc perl kmod uboot-mkimage libressl-devel"
case "$XBPS_TARGET_MACHINE" in
ppc64le*) broken="No ppc64le support";;
esac
triggers="kernel-hooks"
_kernver="${version}_${revision}"
@ -39,7 +43,7 @@ do_configure() {
# If there's a file called <arch>-dotconfig, use it to
# configure the kernel; otherwise use arch defaults and all stuff
# as modules (defconfig+allmodconfig).
local arch _args
local arch subarch _args
case "$XBPS_TARGET_MACHINE" in
i686*) arch=i386;;
@ -50,19 +54,25 @@ do_configure() {
patch -Np1 -i patch-${version}-armv7-x16.diff
;;
aarch64*) arch=arm64;;
ppc64*) arch=powerpc; subarch=ppc64;;
ppc*) arch=powerpc;;
esac
if [ "$CROSS_BUILD" ]; then
_args="CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-"
fi
if [ -f ${FILESDIR}/${arch}-dotconfig-custom ]; then
if [ -f ${FILESDIR}/${subarch:-$arch}-dotconfig-custom ]; then
msg_normal "Detected a custom .config file for your arch, using it.\n"
cp -f ${FILESDIR}/${arch}-dotconfig-custom .config
cp -f ${FILESDIR}/${subarch:-$arch}-dotconfig-custom .config
make ${makejobs} ARCH=$arch ${_args} oldconfig
elif [ -f ${FILESDIR}/${arch}-dotconfig ]; then
elif [ -f ${FILESDIR}/${subarch:-$arch}-dotconfig ]; then
msg_normal "Detected a .config file for your arch, using it.\n"
cp -f ${FILESDIR}/${arch}-dotconfig .config
cp -f ${FILESDIR}/${subarch:-$arch}-dotconfig .config
make ${makejobs} ARCH=$arch ${_args} oldconfig
elif [ -f ${FILESDIR}/${XBPS_TARGET_MACHINE%%-musl}-dotconfig ]; then
msg_normal "Detected a .config file for your cpu family, using it.\n"
cp -f ${FILESDIR}/${XBPS_TARGET_MACHINE%%-musl}-dotconfig .config
make ${makejobs} ARCH=$arch ${_args} oldconfig
else
msg_normal "Defaulting to 'defconfig and allmodconfig'.\n"
@ -80,6 +90,7 @@ do_build() {
x86_64*) _args="bzImage modules"; arch=x86_64;;
armv7*) _args="zImage modules dtbs"; arch=arm;;
aarch64*) _args="Image modules dtbs"; arch=arm64;;
ppc*) _args="zImage modules"; arch=powerpc;;
esac
if [ "$CROSS_BUILD" ]; then
_cross="CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-"
@ -97,6 +108,7 @@ do_install() {
x86_64*) arch=x86; subarch=x86_64;;
armv7*) arch=arm;;
aarch64*) arch=arm64;;
ppc*) arch=powerpc;;
esac
# Run depmod after compressing modules.
@ -124,6 +136,12 @@ do_install() {
# vmkdir boot/dtbs
# cp arch/arm64/boot/dts/*.dtb ${DESTDIR}/boot/dtbs
;;
powerpc)
# zImage on powerpc is useless as it won't load initramfs
# raw vmlinux is huge, and this is nostrip, so do it manually
vinstall vmlinux 644 boot vmlinux-${_kernver}
/usr/bin/$STRIP ${DESTDIR}/boot/vmlinux-${_kernver}
;;
esac
# Switch to /usr.
@ -237,11 +255,12 @@ do_install() {
# Remove unneeded architectures
case "$arch" in
i386|x86_64) _args="arm*";;
arm|arm64) _args="x86*";;
i386|x86_64) _args="arm* p*";;
arm|arm64) _args="x86* p*";;
powerpc) _args="arm* x86* parisc";;
esac
for arch in alpha avr32 blackfin cris frv h8300 \
ia64 m* p* s* um v850 xtensa ${_args}; do
ia64 m* s* um v850 xtensa ${_args}; do
rm -rf ${hdrdest}/arch/${arch}
done