[Virtio-fs] [PATCH 3/5] build-linux: Add support for ppc64le

Fabiano Rosas farosas at linux.ibm.com
Tue Dec 10 14:51:17 UTC 2019


Allow running the script on a ppc64le machine to build a ppc64le
kernel.

The kernel config is generated based on the pseries defconfig +
virtio-fs config.

Note: We need to use the vmlinux kernel image for now while QEMU
upstream has not rebased on the latest SLOF which has support for the
zImage [1].

1 - https://github.com/aik/SLOF/commit/f9661a257028e49f8fcae77b7cc59d41f4983195

Signed-off-by: Fabiano Rosas <farosas at linux.ibm.com>
---
 build-linux.sh                                | 26 ++++++++++++++++---
 ...-virtio-fs => x86_64-monolithic-virtio-fs} |  0
 2 files changed, 23 insertions(+), 3 deletions(-)
 rename configs/{config-monolithic-virtio-fs => x86_64-monolithic-virtio-fs} (100%)

diff --git a/build-linux.sh b/build-linux.sh
index 472bbe1..5a7e5a7 100755
--- a/build-linux.sh
+++ b/build-linux.sh
@@ -7,13 +7,33 @@
 
 set -e
 
+arch=$(uname -m)
+
 if [ ! -d include/uapi/linux ]; then
 	echo 'This script must be run from a Linux source tree.'
 	exit 1
 fi
 
+case ${arch} in
+    x86_64)
+	kernel_image=bzImage
+	;;
+    ppc64le)
+	kernel_image=vmlinux
+	defconfig=pseries_le_defconfig
+	;;
+esac
+
 scriptdir=$(dirname "$0")
-cp "$scriptdir/configs/config-monolithic-virtio-fs" .config
+arch_config="$scriptdir/configs/${arch}-monolithic-virtio-fs"
+
+if [ -f "$arch_config" ]; then
+    cp "$arch_config" .config
+    make oldconfig
+else
+    make $defconfig
+    ./scripts/kconfig/merge_config.sh .config "$scriptdir/configs/virtio-fs"
+    make LSMOD=$(mktemp) localyesconfig
+fi
 
-make -j$(nproc) oldconfig
-make -j$(nproc) bzImage
+make -j$(nproc) $kernel_image
diff --git a/configs/config-monolithic-virtio-fs b/configs/x86_64-monolithic-virtio-fs
similarity index 100%
rename from configs/config-monolithic-virtio-fs
rename to configs/x86_64-monolithic-virtio-fs
-- 
2.23.0





More information about the Virtio-fs mailing list