Merge ~smoser/cirros:feature/support-kernel-4.15 into cirros:master

Proposed by Scott Moser on 2018-06-27
Status: Needs review
Proposed branch: ~smoser/cirros:feature/support-kernel-4.15
Merge into: cirros:master
Diff against target: 57 lines (+24/-6)
1 file modified
bin/grab-kernels (+24/-6)
Reviewer Review Type Date Requested Status
Murilo Opsfelder Araújo (community) Approve on 2018-06-29
cirros developers 2018-06-27 Pending
Review via email: mp+348612@code.launchpad.net

Commit message

bin/grab-kernels: Support kernel 4.15.

This adds support to grab-kernels for 4.15 kernels (from Ubuntu 18.04).

Ubuntu 18.04 dropped support for big endian power. That means that
we cannot build a cirros for those arch with a 4.15 kernel.
Currently the code here just warns when it sees that, so a 'build-release'
is probably going to fail if you don't trim the arches to build.

Description of the change

see commit message

To post a comment you must log in.

Hi, Scott.

Do we also need to remove lines 91 and 98, which sets 'xarch=powerpc flav=powerpc64-smp'?

Scott Moser (smoser) wrote :

@Murilo,

I intended to leave support in if the kernel was < 4.15.
3.2 or 4.4.* should still work and get us a powerpc and ppc64 kernel.

Got it. Thanks.

review: Approve

Unmerged commits

a73f9d7... by Scott Moser on 2018-06-27

bin/grab-kernels: Support kernel 4.15.

This adds support to grab-kernels for 4.15 kernels (from Ubuntu 18.04).

Ubuntu 18.04 dropped support for big endian power. That means that
we cannot build a cirros for those arch with a 4.15 kernel.
Currently the code here just warns when it sees that, so a 'build-release'
is probably going to fail if you don't trim the arches to build.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/grab-kernels b/bin/grab-kernels
2index 055a83d..6d99470 100755
3--- a/bin/grab-kernels
4+++ b/bin/grab-kernels
5@@ -17,7 +17,7 @@
6
7 source "${0%/*}/common-functions.sh"
8
9-burl="https://launchpad.net/ubuntu/+archive/primary/+files/linux-image"
10+burl="https://launchpad.net/ubuntu/+archive/primary/+files/linux"
11 outdir="./download"
12 def_arches="i386 x86_64 arm powerpc ppc64 ppc64le aarch64"
13
14@@ -77,7 +77,7 @@ kminor=${kpart#*.}; kminor=${kminor%.*}
15 kmicro=${kpart#*.*.}
16
17 case "$kmajor.$kminor" in
18- 3.2|3.13|3.19|4.4) :;;
19+ 3.2|3.13|3.19|4.4|4.15) :;;
20 *) error "WARN: possibly unknown kernel version $kmajor.$kminor.";;
21 esac
22
23@@ -101,12 +101,30 @@ for arch in "$@"; do
24 *) fail "unknown kernel:arch for $kver:$arch"
25 esac
26 fi
27- case $xarch in
28- amd64|i386|ppc64el|s390x) extra="-extra";;
29- *) extra="";
30+ if [ "$xarch" = "powerpc" ]; then
31+ case "$kmajor.$kminor" in
32+ 3.*|4.4) :;;
33+ *)
34+ error "WARNING: $arch is not supported with $kmajor.$kminor." \
35+ " Just skipping."
36+ continue;;
37+ esac
38+ fi
39+ extra=""
40+ case "$kmajor.$kminor" in
41+ 3.*|4.4)
42+ case $xarch in
43+ amd64|i386|ppc64el|s390x) extra="-image-extra";;
44+ esac
45+ ;;
46+ *)
47+ # 4.15 changed image-extra to modules-extra and added arm64
48+ case $xarch in
49+ amd64|arm64|i386|ppc64el|s390x) extra="-modules-extra";;
50+ esac
51 esac
52 debs=""
53- for epkg in "" $extra; do
54+ for epkg in "-image" $extra; do
55 url="$burl${epkg}-${kmajor}.${kminor}.${kmicro}-${abi}-${flav}_${kver}_${xarch}.deb"
56 dl "$url" "$outdir/${url##*/}" || fail "failed dl $url"
57 ln -sf ${url##*/} "$outdir/kernel-${arch}${epkg}.deb" ||

Subscribers

People subscribed via source and target branches