[Bug 623609] Re: grub-pc needs some help in uec instances
Launchpad Bug Tracker
623609 at bugs.launchpad.net
Fri Jan 20 14:41:22 UTC 2012
** Branch linked: lp:ubuntu/lucid-proposed/grub2
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/623609
Title:
grub-pc needs some help in uec instances
Status in “cloud-init” package in Ubuntu:
Fix Released
Status in “grub2” package in Ubuntu:
Fix Released
Status in “cloud-init” source package in Lucid:
Fix Released
Status in “grub2” source package in Lucid:
Fix Committed
Status in “cloud-init” source package in Maverick:
Fix Released
Status in “grub2” source package in Maverick:
Fix Released
Bug description:
Binary package hint: grub2
The uec images are intended to "just work" in 6 different
environments:
A.) ec2 with xen disk root device (/dev/sda1)
B.) UEC with scsi root device (/dev/sda1)
1.) Booted via floppy that multiboots to (hd0,1)/boot/grub/core.img
2.) Booted via '-kernel <linux_kernel>'
C.) UEC with virtio root device (/dev/vda1)
1.) Booted via floppy that multiboots to (hd0,1)/boot/grub/core.img
2.) Booted via '-kernel <linux_kernel>'
D.) nocloud, with virtio or scsi root device as /dev/sda or /dev/vda
Ie, this is booting the partition image as if it were a disk.
Booted via grub boot floppy that just finds root and /vmlinuz,
/initrd.img and boots them
Currently, during our build process we trick grub-pc into installing as
if it were writing to /dev/sda (which is correct for 'B' above). That
is done by providing a psuedo grub-probe and running [1]
grub-install --grub-setup=/bin/true /dev/sda && /usr/sbin/update-grub
By tricking grub-install into working, we get core.img and associated
files in /boot/grub that allow the bootloader to multiboot load and
boot the system. All of the A,B,C,D above boot first time correctly.
In A, B.2, and C.2 I'd like for grub-pc to generally just not
get in the way. B.2 and C.2 work just as well as B.1 and C.1 do, so
thats not too difficult.
In B.1, C.1 above, we want grub-pc to actually maintain
/boot/grub/core.img and other files. The installation to the MBR is
not necessary, It will be the floppy disk that multiboot loads
(hd0)/boot/grub/core.img rather than grub installed on the MBR.
My problems right now are:
1.) Currently update-grub is not set to run in /etc/kernel-img.conf
because if it is, kernel installation will fail in 'A' (bug 610554)
2.) in C.1 and C2.2 above, on the first grub-pc upgrade, the user is
prompted where to install grub to. I'd like to seed the answer with
/dev/vda.
I'm fine with determining in cloud-init which of the situations is
present, and on the first boot making it so everything appears to "just
work". I'm just need to figure out what correct set of actions to take
is.
Notes:
- upgrade/install as mentioned above can be done with:
'apt-get install --reinstall grub-pc'
- On EC2, grub-pc is not needed. grub-legacy-ec2 (from the cloud-init
package) maintains /boot/grub/menu.lst, which is read by EC2's
pv-grub. grub-pc is not needed, but is present to keep a single
image.
- on EC2, there is no /dev/sda, only /dev/sdaX, and grub's searching
for bios drives in grub-probe won't work, as there isn't really a bios.
$ grep . /proc/partitions
major minor #blocks name
202 1 10485760 sda1
202 2 156352512 sda2
202 3 917504 sda3
$ ls /dev/sda*
/dev/sda1 /dev/sda2 /dev/sda3
$ df / | grep -v Filesystem
/dev/sda1 10321208 722144 9074788 8% /
$ sudo grub-probe --device /dev/sda1
grub-probe: error: cannot find a GRUB drive for /dev/sda1. Check your
device.map.
- 'D' is by far the lowest concern, but it seems if I can get a fix
for the others, I can probably manage something.
--
[1] http://bazaar.launchpad.net/~ubuntu-on-ec2/vmbuilder/automated-ec2-builds/annotate/head%3A/vmbuilder-uec-ec2-fixes
ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: grub-pc 1.98+20100804-4ubuntu1
ProcVersionSignature: User Name 2.6.35-17.23-virtual 2.6.35.2
Uname: Linux 2.6.35-17-virtual i686
Architecture: i386
Date: Tue Aug 24 18:12:05 2010
Ec2AMI: ami-a2d339cb
Ec2AMIManifest: ubuntu-images-testing-us/ubuntu-maverick-daily-i386-server-20100824.manifest.xml
Ec2AvailabilityZone: us-east-1b
Ec2InstanceType: m1.small
Ec2Kernel: aki-407d9529
Ec2Ramdisk: unavailable
ProcEnviron:
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: grub2
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/623609/+subscriptions
More information about the foundations-bugs
mailing list