Skip to content

Commit bff823e

Browse files
committed
Merge branch 'master' into deploy
2 parents c9a65a8 + 263242c commit bff823e

25 files changed

Lines changed: 276 additions & 103 deletions

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Clone this repo.
2020
```
2121
$ cd ci-scripts
2222
$ cd build
23-
$ make pull-image@ppc64le@ubuntu@21.04
24-
$ make SRC=~/src/linux kernel@ppc64le@ubuntu@21.04 JFACTOR=$(nproc)
23+
$ make pull-image@ppc64le@ubuntu@21.10
24+
$ make SRC=~/src/linux kernel@ppc64le@ubuntu@21.10 JFACTOR=$(nproc)
2525
```
2626

27-
This will build you a `ppc64le_defconfig` using the Ubuntu 21.04 toolchain.
27+
This will build you a `ppc64le_defconfig` using the Ubuntu 21.10 toolchain.
2828

29-
The kernel will be in `output/ppc64le@ubuntu@21.04/ppc64le_defconfig/vmlinux`.
29+
The kernel will be in `output/ppc64le@ubuntu@21.10/ppc64le_defconfig/vmlinux`.
3030

3131
For more help try `make help`.
3232

@@ -36,14 +36,14 @@ Building different defconfigs
3636
You can specify a defconfig with `DEFCONFIG`.
3737

3838
```
39-
$ make SRC=~/src/linux kernel@ppc64le@ubuntu@21.04 DEFCONFIG=powernv_defconfig JFACTOR=$(nproc)
39+
$ make SRC=~/src/linux kernel@ppc64le@ubuntu@21.10 DEFCONFIG=powernv_defconfig JFACTOR=$(nproc)
4040
```
4141

4242
Note that the subarch (eg. `ppc64le`) needs to match the defconfig, so to build
4343
`ppc64_defconfig`, use `ppc64`.
4444

4545
```
46-
$ make SRC=~/src/linux kernel@ppc64@ubuntu@21.04 DEFCONFIG=ppc64_defconfig JFACTOR=$(nproc)
46+
$ make SRC=~/src/linux kernel@ppc64@ubuntu@21.10 DEFCONFIG=ppc64_defconfig JFACTOR=$(nproc)
4747
```
4848

4949
Different toolchains
@@ -56,6 +56,7 @@ There are images for various toolchains, they are encoded in the distro name/ver
5656
- kernel.org gcc 9.3.0 `korg@9.3.0`
5757
- kernel.org gcc 8.1.0 `korg@8.1.0`
5858
- kernel.org gcc 5.5.0 `korg@5.5.0`
59+
- Ubuntu 21.10 `ubuntu@21.10`
5960
- Ubuntu 21.04 `ubuntu@21.04`
6061
- Ubuntu 20.10 `ubuntu@20.10`
6162
- Ubuntu 20.04 `ubuntu@20.04`
@@ -74,13 +75,13 @@ Building selftests
7475
To build the kernel selftests:
7576

7677
```
77-
$ make SRC=~/src/linux selftests@ppc64le@ubuntu@21.04 JFACTOR=$(nproc)
78+
$ make SRC=~/src/linux selftests@ppc64le@ubuntu@21.10 JFACTOR=$(nproc)
7879
```
7980

8081
Or just the powerpc selftests:
8182

8283
```
83-
$ make SRC=~/src/linux ppctests@ppc64le@ubuntu@21.04 JFACTOR=$(nproc)
84+
$ make SRC=~/src/linux ppctests@ppc64le@ubuntu@21.10 JFACTOR=$(nproc)
8485
```
8586

8687
You can also build the powerpc selftests with all available toolchains using:
@@ -94,17 +95,17 @@ Other options
9495

9596
As mentioned above you pass the make -j factor with `JFACTOR=n`.
9697

97-
To run sparse use the `ubuntu@21.04` image and pass `SPARSE=1`.
98+
To run sparse use the `ubuntu@21.10` image and pass `SPARSE=1`.
9899

99100
```
100-
$ make SRC=~/src/linux kernel@ppc64le@ubuntu@21.04 SPARSE=1 JFACTOR=$(nproc)
101+
$ make SRC=~/src/linux kernel@ppc64le@ubuntu@21.10 SPARSE=1 JFACTOR=$(nproc)
101102
```
102103

103-
The log will be in eg. `output/ppc64le@ubuntu@21.04/ppc64le_defconfig/sparse.log`.
104+
The log will be in eg. `output/ppc64le@ubuntu@21.10/ppc64le_defconfig/sparse.log`.
104105

105106
To build modules pass `MODULES=1`
106107

107-
To build with clang pass `CLANG=1`, only works using the Ubuntu `21.04` images.
108+
To build with clang pass `CLANG=1`, only works using the Ubuntu `21.10` images.
108109

109110
For a quiet build pass `QUIET=1`, for verbose pass `VERBOSE=1`.
110111

@@ -126,7 +127,7 @@ Building your own image
126127
If you don't want to pull an untrusted image, you can build it yourself with:
127128

128129
```
129-
$ make rebuild-image@ppc64le@ubuntu@21.04
130+
$ make rebuild-image@ppc64le@ubuntu@21.10
130131
```
131132

132133
Note that the build mounts the source tree read-only, so nothing it does can

build/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ DOCS += docs@${1}@${2}
5858
endef
5959

6060
FEDORA_DISTROS := fedora@34 fedora@33 fedora@32 fedora@31
61-
UBUNTU_DISTROS := ubuntu@21.04 ubuntu@20.10 ubuntu@20.04 ubuntu@18.04 ubuntu@16.04
61+
UBUNTU_DISTROS := ubuntu@21.10 ubuntu@21.04 ubuntu@20.10 ubuntu@20.04 ubuntu@18.04 ubuntu@16.04
6262
KORG_DISTROS := korg@11.1.0 korg@10.3.0 korg@9.3.0 korg@8.1.0 korg@5.5.0
6363
ALL_DISTROS := ${UBUNTU_DISTROS} ${KORG_DISTROS} ${FEDORA_DISTROS}
64-
DOCS_DISTRO := docs@21.04
65-
X86_DISTRO := ubuntu@21.04
64+
DOCS_DISTRO := docs@21.10
65+
X86_DISTRO := ubuntu@21.10
6666
SUBARCHES := ppc64le ppc64
6767

6868
$(eval $(call MAIN_TEMPLATE,ppc64le,${DOCS_DISTRO}))

build/ubuntu/packages.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@ machine=$(uname -m)
66

77
. /etc/os-release
88

9-
if [[ "$VERSION_ID" == "21.04" ]]; then
9+
if [[ "$VERSION_ID" == "21.10" ]]; then
1010
if [[ "$machine" != "x86_64" ]]; then
1111
PACKAGES+=" crossbuild-essential-amd64"
1212
fi
13-
fi
1413

15-
major="${VERSION_ID%%.*}"
16-
if [[ $major -ge 18 ]]; then
1714
PACKAGES+=" clang llvm"
1815
fi
1916

lib/pexpect_utils.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(self):
2323
self.bug_patterns = self.default_bug_patterns
2424

2525
def spawn(self, *args, **kwargs):
26-
logging.debug("Spawning '%s'" % args)
26+
logging.info("Spawning '%s'" % args)
2727
self.child = pexpect.spawn(*args, timeout=60, encoding='utf-8', echo=False, **kwargs)
2828
if '--quiet' not in sys.argv:
2929
self.log_to(sys.stdout)
@@ -83,8 +83,8 @@ def pop_prompt(self):
8383
self.prompt_stack.pop()
8484
self.prompt = self.prompt_stack[-1]
8585

86-
def expect_prompt(self):
87-
self.expect(self.prompt)
86+
def expect_prompt(self, timeout=-1):
87+
self.expect(self.prompt, timeout=timeout)
8888

8989
def send_no_newline(self, data):
9090
self.child.send(data)
@@ -98,27 +98,34 @@ def cmd(self, cmd):
9898
self.expect_prompt()
9999

100100

101-
def standard_boot(p, login=False, user='root'):
102-
p.push_prompt(p.DEFAULT_PROMPT)
101+
def standard_boot(p, login=False, user='root', password=None, timeout=-1, prompt=None):
102+
if prompt is None:
103+
prompt = p.DEFAULT_PROMPT
104+
105+
p.push_prompt(prompt)
103106

104107
logging.info("Waiting for kernel to boot")
105-
p.expect("Freeing unused kernel ")
108+
p.expect("Freeing unused kernel ", timeout=timeout)
106109

107110
if login:
108111
logging.info("Kernel came up, waiting for login ...")
109-
p.expect("login:")
112+
p.expect("login:", timeout=timeout)
110113
p.send(user)
114+
if password is not None:
115+
p.expect("Password:", timeout=timeout)
116+
p.send(password)
111117
else:
112118
logging.info("Kernel came up, waiting for prompt ...")
113119

114-
p.expect_prompt()
120+
p.expect_prompt(timeout=timeout)
115121
logging.info("Booted to shell prompt")
116122

117123

118124
def ping_test(p, ip='10.0.2.2', check=True):
119-
p.send(f'ping -c 3 {ip}')
125+
p.send(f'ping -W 10 -c 3 {ip}')
120126
if check:
121-
p.expect('3 packets transmitted, 3 packets received')
127+
# busybox ping prints "packets received", iputils-ping does not
128+
p.expect('3 packets transmitted, 3( packets)? received')
122129
p.expect_prompt()
123130

124131

lib/qemu.py

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import sys
23
import logging
34
from utils import get_env_var, get_endian
45
from pexpect_utils import PexpectHelper
@@ -14,10 +15,22 @@ def get_qemu(name='qemu-system-ppc64'):
1415
return qemu
1516

1617

17-
def get_rootfs(fname):
18-
path = get_env_var('ROOT_DISK_PATH', '')
19-
val = os.path.join(path, fname)
18+
def get_root_disk_path():
19+
path = get_env_var('ROOT_DISK_PATH', None)
20+
if path is not None:
21+
return path
2022

23+
base = os.path.dirname(sys.argv[0])
24+
# Assumes we're called from scripts/boot/qemu-xxx
25+
path = f'{base}/../../root-disks'
26+
if os.path.isdir(path):
27+
return path
28+
29+
return ''
30+
31+
32+
def get_root_disk(fname):
33+
val = os.path.join(get_root_disk_path(), fname)
2134
logging.debug(f'Using rootfs {val}')
2235
return val
2336

@@ -31,7 +44,7 @@ def get_qemu_version(emulator):
3144

3245

3346
def qemu_command(qemu='qemu-system-ppc64', machine='pseries,cap-htm=off', cpu=None,
34-
mem='1G', smp=1, vmlinux=None, rootfs=None,
47+
mem='1G', smp=1, vmlinux=None, initrd=None, drive=None,
3548
cmdline='', accel='tcg', net='-nic user'):
3649

3750
qemu_path = get_qemu(qemu)
@@ -40,16 +53,6 @@ def qemu_command(qemu='qemu-system-ppc64', machine='pseries,cap-htm=off', cpu=No
4053
if vmlinux is None:
4154
vmlinux = get_vmlinux()
4255

43-
if rootfs is None:
44-
if qemu == 'qemu-system-ppc':
45-
subarch = 'ppc'
46-
elif get_endian(vmlinux) == 'little':
47-
subarch = 'ppc64le'
48-
else:
49-
subarch = 'ppc64'
50-
51-
rootfs = f'{subarch}-rootfs.cpio.gz'
52-
5356
l = [
5457
get_qemu(qemu),
5558
'-nographic',
@@ -59,10 +62,26 @@ def qemu_command(qemu='qemu-system-ppc64', machine='pseries,cap-htm=off', cpu=No
5962
'-m', mem,
6063
'-accel', accel,
6164
'-kernel', vmlinux,
62-
'-initrd', get_rootfs(rootfs),
6365
net,
6466
]
6567

68+
if initrd is None and drive is None:
69+
if qemu == 'qemu-system-ppc':
70+
subarch = 'ppc'
71+
elif get_endian(vmlinux) == 'little':
72+
subarch = 'ppc64le'
73+
else:
74+
subarch = 'ppc64'
75+
76+
initrd = f'{subarch}-rootfs.cpio.gz'
77+
78+
if initrd:
79+
l.append('-initrd')
80+
l.append(get_root_disk(initrd))
81+
82+
if drive:
83+
l.append(drive)
84+
6685
if cpu is not None:
6786
l.append('-cpu')
6887
l.append(cpu)

root-disks/.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
11
*.gz
2+
cloud-init-user-data.img
3+
ubuntu16.04-cloudimg-powerpc.qcow2
4+
ubuntu16.04-cloudimg-powerpc.qcow2.sum
5+
ubuntu16.04-cloudimg-ppc64el.qcow2
6+
ubuntu16.04-cloudimg-ppc64el.qcow2.sum
7+
ubuntu21.04-cloudimg-ppc64el.qcow2
8+
ubuntu21.04-cloudimg-ppc64el.qcow2.sum
9+
ubuntu21.10-cloudimg-ppc64el.qcow2
10+
ubuntu21.10-cloudimg-ppc64el.qcow2.sum
11+
fedora34-cloudimg-ppc64le.qcow2
12+
fedora34-cloudimg-ppc64le.qcow2.sum

root-disks/Makefile

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,61 @@
1-
IMAGES += ppc64-rootfs.cpio.gz ppc64-novsx-rootfs.cpio.gz ppc64le-rootfs.cpio.gz ppc-rootfs.cpio.gz
1+
IMAGES += ppc64-rootfs.cpio.gz ppc64-novsx-rootfs.cpio.gz ppc64le-rootfs.cpio.gz
2+
IMAGES += ppc-rootfs.cpio.gz
3+
IMAGES += cloud-init-user-data.img
4+
IMAGES += ubuntu16.04-cloudimg-powerpc.qcow2
5+
IMAGES += ubuntu16.04-cloudimg-ppc64el.qcow2
6+
IMAGES += ubuntu21.04-cloudimg-ppc64el.qcow2
7+
IMAGES += ubuntu21.10-cloudimg-ppc64el.qcow2
8+
IMAGES += fedora34-cloudimg-ppc64le.qcow2
29

310
all: $(IMAGES)
411

512
ppc64-rootfs.cpio.gz: ppc64-novsx-rootfs.cpio.gz
613
ln -s $< $@
714

815
ppc64-novsx-rootfs.cpio.gz:
9-
wget -O $@ "https://github.com/groeck/linux-build-test/blob/4e693ba1cfc17ff4c551626855d2982c492be1c2/rootfs/ppc64/rootfs.cpio.gz?raw=true"
16+
wget -O $@.tmp "https://github.com/groeck/linux-build-test/blob/4e693ba1cfc17ff4c551626855d2982c492be1c2/rootfs/ppc64/rootfs.cpio.gz?raw=true"
17+
mv $@.tmp $@
1018

1119
ppc64le-rootfs.cpio.gz:
12-
wget -O $@ "https://github.com/groeck/linux-build-test/blob/4e693ba1cfc17ff4c551626855d2982c492be1c2/rootfs/ppc64/rootfs-el.cpio.gz?raw=true"
20+
wget -O $@.tmp "https://github.com/groeck/linux-build-test/blob/4e693ba1cfc17ff4c551626855d2982c492be1c2/rootfs/ppc64/rootfs-el.cpio.gz?raw=true"
21+
mv $@.tmp $@
1322

1423
ppc-rootfs.cpio.gz:
15-
wget -O $@ "https://github.com/groeck/linux-build-test/blob/65335f1a683166c7b83d61a3eeaf400ebcfa20dd/rootfs/ppc/rootfs.cpio.gz?raw=true"
24+
wget -O $@.tmp "https://github.com/groeck/linux-build-test/blob/65335f1a683166c7b83d61a3eeaf400ebcfa20dd/rootfs/ppc/rootfs.cpio.gz?raw=true"
25+
mv $@.tmp $@
26+
27+
ubuntu16.04-cloudimg-powerpc.qcow2:
28+
wget -O $@.tmp "https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-powerpc-disk1.img"
29+
mv $@.tmp $@
30+
chmod a-w $@
31+
sha256sum $@ > $@.sum
32+
33+
ubuntu16.04-cloudimg-ppc64el.qcow2:
34+
wget -O $@.tmp "https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-ppc64el-disk1.img"
35+
mv $@.tmp $@
36+
chmod a-w $@
37+
sha256sum $@ > $@.sum
38+
39+
ubuntu21.04-cloudimg-ppc64el.qcow2:
40+
wget -O $@.tmp "https://cloud-images.ubuntu.com/hirsute/current/hirsute-server-cloudimg-ppc64el.img"
41+
mv $@.tmp $@
42+
chmod a-w $@
43+
sha256sum $@ > $@.sum
44+
45+
ubuntu21.10-cloudimg-ppc64el.qcow2:
46+
wget -O $@.tmp "https://cloud-images.ubuntu.com/impish/current/impish-server-cloudimg-ppc64el.img"
47+
mv $@.tmp $@
48+
chmod a-w $@
49+
sha256sum $@ > $@.sum
50+
51+
fedora34-cloudimg-ppc64le.qcow2:
52+
wget -O $@.tmp "https://download.fedoraproject.org/pub/fedora-secondary/releases/34/Cloud/ppc64le/images/Fedora-Cloud-Base-34-1.2.ppc64le.qcow2"
53+
mv $@.tmp $@
54+
chmod a-w $@
55+
sha256sum $@ > $@.sum
56+
57+
cloud-init-user-data.img: cloud-init-user-data.txt
58+
cloud-localds $@ $<
1659

1760
clean:
1861
@echo "Use distclean to remove rootfs images"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#cloud-config
2+
users:
3+
- name: user
4+
lock_passwd: false
5+
plain_text_passwd: linuxppc
6+
- name: root
7+
lock_passwd: false
8+
plain_text_passwd: linuxppc
9+
10+
# don't regenerate ssh keys, it takes time for no benefit
11+
ssh_deletekeys: false

scripts/boot/qemu-44x

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/usr/bin/python3
22
#
3-
# $ export ROOT_DISK_PATH=~/root-disks/
4-
# Expects ppc-rootfs.cpio.gz in ROOT_DISK_PATH
5-
#
63
# $ cd ~/src/linux
74
# $ make
85
# $ ~/src/ci-scripts/scripts/boot/qemu-44x
@@ -14,6 +11,8 @@
1411
#
1512
# Optional:
1613
# export QEMU_SYSTEM_PPC=~/src/qemu/ppc-softmmu/qemu-system-ppc
14+
# export ROOT_DISK_PATH=~/some/directory
15+
# Expects ppc-rootfs.cpio.gz in ROOT_DISK_PATH
1716

1817
import logging
1918
import os, sys
@@ -28,9 +27,6 @@ def main():
2827
setup_logging()
2928
setup_timeout(60)
3029

31-
if not check_env_vars(['ROOT_DISK_PATH']):
32-
return 1
33-
3430
expected_release = get_expected_release()
3531
if expected_release is None:
3632
return False

0 commit comments

Comments
 (0)