taliesins / packer-baseboxes

Templates for packer to build base boxes
224 stars 93 forks source link

Bug in Ubuntu network.sh script causes kernel upgrades to fail for Ubuntu 16.04 #4

Closed evancox10 closed 7 years ago

evancox10 commented 7 years ago

Hello, the part of your network.sh script for ubuntu that tries to disable udev persistent net rules causes some undesirable side effects. If you make /etc/udev/rules.d/70-persistent-net.rules a directory, then some very low-level scripts used by the kernel update process for the linux-firmware and update-initramfs will fail.

(The script that fails is /usr/share/initramfs-tools/hooks/udev. It performs a cp on files in the /etc/udev/rules.d/ folder. Since there is now a directory here, that copy will fail, causing the script to break.)

I'm not sure what the "right" way is to disable persistent net rules, this method may work but has a big downside!

evancox10 commented 7 years ago

FYI: https://github.com/chef/bento/issues/592

evancox10 commented 7 years ago

This only applies to Ubuntu 15.10 or later VMs; which for this repo means the 16.04 image. For these releases, Ubuntu has moved to "Predictable Network Interface Names". Therefore, persistent net rules is no longer used and we don't even need to hack around it in the first place. The "fix" implemented by the chef/bento team in the issue linked to below is to just not perform the empty directory hack in the first place. Note that this doesn't mean you automatically go back to the good ol' eth0/eth1/etc. network interface names! If you want these old names, you will have to implement a fix like described here. (Warning, fix untested, use at your own risk!)

P.S. Thanks for the work on this repo and the Packer + Hyper-V code. I am up and running with this now, and obviously playing around with it now trying to get a feel for things. I really appreciate your contributions that have allowed this to happen!

taliesins commented 7 years ago

Thanks for the kind words.

Send me a pull request for the fix, if it sorted you out ;)

taliesins commented 7 years ago

@evancox10 went the Bento route