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

Proposed by dann frazier
Status: Merged
Merged at revision: 375
Proposed branch: lp://staging/~dannf/maas-images/lp1702976
Merge into: lp://staging/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://staging/~dannf/maas-images/lp1702976
Reviewer Review Type Date Requested Status
dann frazier (community) Needs Resubmitting
Lee Trager (community) Needs Information
Andres Rodriguez (community) Approve
Review via email: mp+327308@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Andres Rodriguez (andreserl) wrote :

lgtm!

review: Approve
Revision history for this message
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

Revision history for this message
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.

Revision history for this message
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
Revision history for this message
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.

375. By dann frazier

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.

Revision history for this message
dann frazier (dannf) wrote :

Restricted to only ARM architectures.

review: Needs Resubmitting
Revision history for this message
Scott Moser (smoser) wrote :

fwiw, the code that landed here is weird.

config_addl_modules writes a file using 'cat <<EOF'
since 'EOF' is not quoted, we get shell expansion of '$' when writing

so.. what ends up getting written is:

case arm64 in
  arm*) copy_modules_dir ....
esac

which really I suspect we wanted to either
a.) only *write* the 'copy_modules_dir' into the file if the arch was arm*
b.) evaluate the arch at execution time (of mkinitramfs-tools).

Revision history for this message
dann frazier (dannf) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches