op-build instructions ===================== Use 'op-build' to build skiboot/skiroot/Petitboot, all that. There are instructions in the github project's README: https://github.com/open-power/op-build/ You can build on x86_64 computer (automatic cross-build) or on a powerpc64(le) server (baremetal w/ smt8 is fast). 0) build deps (rhel-alt-7.5) $ sudo yum -y install gcc-c++ flex bison git ctags cscope expat-devel patch \ zlib-devel zlib-static texinfo perl-bignum "perl(XML::Simple)" \ "perl(YAML)" "perl(XML::SAX)" "perl(Fatal)" "perl(Thread::Queue)" \ "perl(Env)" "perl(XML::LibXML)" "perl(Digest::SHA1)" libxml2-devel \ which wget unzip tar cpio python bzip2 bc findutils ncurses-devel lzo-devel 1) git clone/setup $ git clone https://github.com/open-power/op-build.git $ cd op-build $ . op-build-env that should do it, but it tells to run this and retry: $ git submodule init && git submodule update $ . op-build-env 2) find op-build release with desired kernel version (v4.15.14) The default build config for boston (p9dsu platform) config is p9dsu_defconfig. $ git log --oneline origin/master openpower/configs/p9dsu_defconfig | head ... 6453c89 kernel: Move to Linux v4.15.14-openpower1 ... Check which release contains that commit. $ git describe --contains 6453c89 v1.22~5^2 And checkout it into a branch: $ git checkout -b bz166588 v1.22 The skiroot's kernel version string is the combination of the linux stable kernel version in the config: $ grep BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE openpower/configs/p9dsu_defconfig BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.15.14" with the 'Release' patch: $ grep EXTRAVERSION openpower/linux/000*-Release*.patch -EXTRAVERSION = +EXTRAVERSION = -openpower1 This is the patch dir, put additional patches here: $ ls -1 openpower/linux/ 0001-xhci-Reset-controller-on-xhci-shutdown.patch 0002-tg3-APE-heartbeat-changes.patch 0003-powerpc-eeh-Fix-race-with-driver-un-bind.patch 0004-Release-OpenPower-kernel.patch $ cp ~/tlbie-p9-workaround.patch openpower/linux/0005-Fixup-tlbie-vs-store-ordering-on-POWER9.patch (BACKPORT PATCHES BEGIN) You can make the backports on top of v4.15.14 in linux-stable or https://github.com/open-power/linux/ e.g., [~/git/linux]$ git checkout -b bz166588 v4.15.14 loop: $ git format-patch -1 --start-number= $ patch -p1 -F0 --dry-run -i <000N-*.patch> $ vim -O 000N*-.patch # fix/backport/apply dependency commits/repeat $ git am 000N*-.patch And I ended up with 8 patches: $ git log --oneline | head f1b17fd scsi: qla2xxx: Fix double free bug after firmware timeout 6d88b15 scsi: qla2xxx: Prevent relogin trigger from sending too many commands d101db7 scsi: qla2xxx: Fix warning in qla2x00_async_iocb_timeout() e5a54a1 scsi: qla2xxx: Don't call dma_free_coherent with IRQ disabled. d908d0c scsi: qla2xxx: Serialize session free in qlt_free_session_done cdea9a7 scsi: qla2xxx: Serialize session deletion by using work_lock 86ac6a0 scsi: qla2xxx: Remove unused argument from qlt_schedule_sess_for_deletion() 1600bd6 scsi: qla2xxx: Fix session cleanup for N2N 0ba3b3a Linux 4.15.14 9c5ee99 bpf, x64: increase number of passes $ mkdir bz166588 $ git format-patch -8 --start-number 10 -o bz166588 # some number space between op-builds existing patches and this series. $ scp -r bz166588 hab4-73:~/ (BACKPORT PATCHES END) And back to the power system to apply patches/build: $ cp ~/bz166588/*.patch openpower/linux/ $ ls -1 openpower/linux/ 0001-xhci-Reset-controller-on-xhci-shutdown.patch 0002-tg3-APE-heartbeat-changes.patch 0003-powerpc-eeh-Fix-race-with-driver-un-bind.patch 0004-Release-OpenPower-kernel.patch 0005-Fixup-tlbie-vs-store-ordering-on-POWER9.patch 0010-scsi-qla2xxx-Fix-session-cleanup-for-N2N.patch 0011-scsi-qla2xxx-Remove-unused-argument-from-qlt_schedul.patch 0012-scsi-qla2xxx-Serialize-session-deletion-by-using-wor.patch 0013-scsi-qla2xxx-Serialize-session-free-in-qlt_free_sess.patch 0014-scsi-qla2xxx-Don-t-call-dma_free_coherent-with-IRQ-d.patch 0015-scsi-qla2xxx-Fix-warning-in-qla2x00_async_iocb_timeo.patch 0016-scsi-qla2xxx-Prevent-relogin-trigger-from-sending-to.patch 0017-scsi-qla2xxx-Fix-double-free-bug-after-firmware-time.patch Modify localversion in Release patch $ grep EXTRAVERSION openpower/linux/*-Release*.patch -EXTRAVERSION = +EXTRAVERSION = -openpower1.bz166588c195 Build: $ op-build p9dsu_defconfig $ op-build menuconfig # enable ccache in Build Options -> Enable Compiler Cache $ op-build ... # Copy the kernel image(s) to its(their) final destination /usr/bin/install -m 0644 -D /home/user/op-build/output/build/linux-4.15.14/arch/powerpc/boot/zImage.epapr /home/user/op-build/output/images/zImage.epapr ... make[1]: *** [/home/user/op-build/output/build/openpower-pnor-dafcab48658b4de48e70c929b036985dac7ef7b8/.stamp_images_installed] Error 2 So it build the kernel successfully (zImage.epapr). Later it failed on PNOR generation, but that's fine, we don't need it. Checking the kernel version string: $ objdump -h output/images/zImage.epapr | grep vmlinux 10 .kernel:vmlinux.strip 0181023c 000000002000c000 000000002000c000 0001c000 2**0 $ dd if=output/images/zImage.epapr of=vmlinux.xz bs=1 skip=$(echo 'ibase=16; 0001C000' | bc) count=$(echo 'ibase=16; 0181023C' | bc) 25231932+0 records in 25231932+0 records out 25231932 bytes (25 MB) copied, 118.849 s, 212 kB/s $ xz -dc vmlinux.xz > vmlinux $ grep -a 'Linux version' vmlinux Linux version 4.15.14-openpower1.bz166588c132 (user@rhel-alt-75.localdomain) (gcc version 6.4.0 (Buildroot 2017.11.2-00008-g4b6188e)) #3 SMP Thu Apr 26 12:26:37 CDT 2018 And you can flash it as described in bug 167103 comment 22 on systems with secure-boot _disabled_ (bug bug 167103 comment 30), i.e., there is no 'secure-enabled' property in device tree: # ls /proc/device-tree/ibm,secureboot/secure-enabled ls: cannot access '/proc/device-tree/ibm,secureboot/secure-enabled': No such file or directory # lsprop /proc/device-tree/ibm,secureboot/ compatible "ibm,secureboot-v2" hw-key-hash-size 00000040 (64) hw-key-hash 40d487ff 7380ed6a d54775d5 795fea0d e2f541fe a9db06b8 466a42a3 20e65f75 b4866546 0017d907 515dc2a5 f9fc5095 4d6ee0c9 b67d219d fb708535 1d01d6d1 phandle 00000086 (134) name "ibm,secureboot" On Petitboot: / # uname -r 4.13.16-openpower1 / # wget -O zImage.epapr http://dorno.rch.stglabs.ibm.com/~mauricfo/kernel/skiroot/bz166588/zImage.epapr_4.15.14-openpower1.bz166588c132 / # pflash -e -p zImage.epapr -P BOOTKERNEL About to erase 0x017e1000..0x02ca5478 ! WARNING ! This will modify your HOST flash chip content ! Enter "yes" to confirm:yes <...> / # reboot <...> EXPECTED: / # uname -r 4.15.14-openpower1.bz166588c132