0

While trying to run Ubuntu 18.04 LTS (Bionic) on an AWS EC2 instance, my user data initialization script includes the step to do an upgrade (executing apt-get -y upgrade after executing apt-get update). During this upgrade, there is a new kernel which requires that the boot loader (grub2) be reinstalled. The big problem is the grub2 package setup apparently has lost configuration information and is running an interactive dialog using a tool called whiptail. This means everything comes to a stop while this dialog waits for human response, though no human is present at the instance virtual console. I have tried this with AMIs ami-0c55b159cbfafe1f0 (the same as the console uses) and ami-0e04554247365d806 (a more recent build from the Canonical account) in region us-east-2 (Ohio) with instance type t3a.small (2GB RAM).

I would like to know if (and how) there is a way to have package grub2 do the necessary boot-loader setup/install w/o doing any interactive dialog.

My user data script does download a tarball of my add-on files, in advance, so adding large or many files to this is practical. Running similar AMIs for the arm64 architecture (on instance type a1.medium) works just fine (of course, grub is not being used for this architecture). i am submitting this via a Python3 script over the AWS API with botocore, so I can repeat this with changes, easily.

Skaperen
  • 435
  • It looks like the first 3 answers are iptables specific (the package involved in that question). Answer #4 may be the right approach but it looks more like what the packaging developers should be doing. They are building these images for EC2 use (where this issue can be common) and should carry out a wider scope of testing, such as doing the upgrade. In the mean time I am using the arm64 build on the new arm64 instances since I don't have the time for the suggested extra work. – Skaperen May 10 '19 at 01:25
  • I suggested it as related because it shows how to use debconf-set-selections to pre-seed the configuration answers for a package - in the case of the linked question, the package happens to be iptables whereas you likely need to pre-seed the answers for package grub-pc – steeldriver May 10 '19 at 01:33
  • Right, grub would be the target for preseeding. That is the obvious direction to go. But under my time constraints, just using the arm64 architecture seems to be more practical. IMHO, this is something the AMI builders should include. And maybe they have in some way I am unaware of. I just can't imagine someone building an AMI and not testing upgrade on it. – Skaperen May 10 '19 at 01:49

0 Answers0