Merge lp:~dannf/maas-images/lp1702976 into lp:maas-images

Proposed by dann frazier on 2017-07-12
Status: Needs review
Proposed branch: lp:~dannf/maas-images/lp1702976
Merge into: lp:maas-images
Diff against target: 15 lines (+5/-0)
1 file modified
bin/kpack-from-image (+5/-0)
To merge this branch: bzr merge lp:~dannf/maas-images/lp1702976
Reviewer Review Type Date Requested Status
dann frazier (community) Resubmit on 2017-07-12
Lee Trager Needs Information on 2017-07-12
Andres Rodriguez 2017-07-12 Approve on 2017-07-12
Review via email: mp+327308@code.launchpad.net
To post a comment you must log in.
Andres Rodriguez (andreserl) wrote :

lgtm!

review: Approve
dann frazier (dannf) wrote :

dannf@mustang:/tmp/maas-images+lp1702976$ gunzip < ./out.d/xenial/arm64/20170711/xenial/generic/boot-initrd | cpio -t | grep i2c-thunderx
lib/modules/4.4.0-83-generic/kernel/drivers/i2c/busses/i2c-thunderx.ko
205567 blocks

Scott Moser (smoser) wrote :

this looks sane... i'm mostly curious on the size added.
but other than that i think tihs is the only path to a solution.

Lee Trager (ltrager) wrote :

Is there any reason we need all i2c bus drivers on all architectures? I think we may want to do something like this to limit only the i2c-thunderx driver being added on arm64.

=== modified file 'bin/kpack-from-image'
--- bin/kpack-from-image 2017-05-09 14:04:12 +0000
+++ bin/kpack-from-image 2017-07-12 18:08:50 +0000
@@ -187,6 +187,10 @@
 copy_modules_dir kernel/drivers/char/ipmi # LP: #1333271
 copy_modules_dir kernel/drivers/net/usb # LP: #1552378
 manual_add_modules bcache # (LP: #1513176)
+# LP: #1702976
+if [ "$(uname -m)" == "arm64" ]; then
+ manual_add_modules i2c-thunderx
+fi
 EOF
     if [ "$rel" = "precise" ]; then
         echo "manual_add_modules squashfs # (LP: #1501834)" >> "$fname"

review: Needs Information
dann frazier (dannf) wrote :

I fear that if we just pick i2c-thunderx, we'll just run into this problem again and again with new hosts. However, restricting i2c drivers to arm* seems reasonable. I'm unaware of any other archs that use the SSIF interface.

Note that using "uname -m" to figure out the architecture is nearly always a bad idea. Remember that there are all sorts of cases where the host kernel may not match the userspace - e.g. running i386 userspace on an x86_64 box, qemu-user emulation, etc. In this case, since the MAAS images are presumably always built on an x86 box, uname -m will never be "aarch64". I suggest using 'dpkg --print-architecture' instead.

The size increase for arm64 including all i2c/busses modules is 217K.

lp:~dannf/maas-images/lp1702976 updated on 2017-07-12
375. By dann frazier on 2017-07-12

Only include i2c bus drivers on arm architectures

The only known users of the IPMI SSIF interface are ARM servers, so don't
bloat the initramfs of other architectures.

dann frazier (dannf) wrote :

Restricted to only ARM architectures.

review: Resubmit

Unmerged revisions

375. By dann frazier on 2017-07-12

Only include i2c bus drivers on arm architectures

The only known users of the IPMI SSIF interface are ARM servers, so don't
bloat the initramfs of other architectures.

374. By dann frazier on 2017-07-12

bin/kpack-from-image: Add i2c bus drivers to the initramfs

The IPMI SSIF system interface accesses the BMC over an i2c bus.
LP: #1702976.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/kpack-from-image'
2--- bin/kpack-from-image 2017-05-09 14:04:12 +0000
3+++ bin/kpack-from-image 2017-07-12 22:28:13 +0000
4@@ -186,6 +186,11 @@
5
6 copy_modules_dir kernel/drivers/char/ipmi # LP: #1333271
7 copy_modules_dir kernel/drivers/net/usb # LP: #1552378
8+case $(dpkg --print-architecture) in
9+ arm*)
10+ copy_modules_dir kernel/drivers/i2c/busses # LP: #1702976
11+ ;;
12+esac
13 manual_add_modules bcache # (LP: #1513176)
14 EOF
15 if [ "$rel" = "precise" ]; then

Subscribers

People subscribed via source and target branches