Options on where to run and how to build for (Ubuntu) Linux on s390x

  1. Use your ‘own’ IBM Z or LinuxONE (aka s390x) system

In the ideal case that you have your own IBM or LinuxONE system things are obvious and straight-forward. Just compile, e.g. the kernel (from git), on your s390x system (LPAR, z/VM guest, KVM virtual machine or (LXD) container).
The following URL is recommended for cloning the Ubuntu git tree (here bionic):
SRC-URL=”https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/bionic”
(alternatively: SRC-URL=“git://kernel.ubuntu.com/ubuntu/ubuntu-bionic”)
Now clone the ‘master’ branch:
$ git clone $SRC-URL
Or even better ‘master-next’ - since it incl. everything that’s already accepted and applied:
$ git clone $SRC-URL --branch master-next --single-branch
$ cd ubuntu-bionic
$ sudo apt -q -y update
$ sudo apt -y -q install software-properties-common
$ sudo add-apt-repository -s “deb http://us.ports.ubuntu.com/ubuntu-ports/ $(lsb_release -sc) main”
$ sudo add-apt-repository -s “deb http://us.ports.ubuntu.com/ubuntu-ports/ $(lsb_release -sc)-updates main”
$ sudo apt -q -y update
$ sudo apt -q -y --no-install-recommends install libncurses-dev flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf fakeroot
$ sudo apt -q -y --no-install-recommends build-dep linux linux-image-$(uname -r)
Get rid of potential perl warnings about missing locales:
$ sudo apt -q -y install locales-all
$ sudo update-locale
Compile:
$ fakeroot debian/rules clean
Quick build:
$ DEB_BUILD_OPTIONS=parallel=8 AUTOBUILD=1 NOEXTRAS=1 fakeroot debian/rules binary-headers binary-generic binary-perarch
or just:
$ DEB_BUILD_OPTIONS=parallel=$(lscpu | grep ^CPU(s): | awk ‘{ print $2 }’) AUTOBUILD=1 NOEXTRAS=1 fakeroot debian/rules binary-headers binary-generic binary-perarch
$ ls -a …/*.deb
…/linux-buildinfo-4.15.0-71-generic_4.15.0-71.80_s390x.deb
…/linux-headers-4.15.0-71_4.15.0-71.80_all.deb
…/linux-headers-4.15.0-71-generic_4.15.0-71.80_s390x.deb
…/linux-image-4.15.0-71-generic_4.15.0-71.80_s390x.deb
…/linux-modules-4.15.0-71-generic_4.15.0-71.80_s390x.deb
…/linux-modules-extra-4.15.0-71-generic_4.15.0-71.80_s390x.deb
…/linux-tools-4.15.0-71_4.15.0-71.80_s390x.deb
…/linux-tools-4.15.0-71-generic_4.15.0-71.80_s390x.deb

Further references:










1 Like