'-i',
'/tmp/linux-image.deb',
run.Raw('&&'),
+ # and now extract the actual boot image name from the deb
+ 'dpkg-deb',
+ '--fsys-tarfile',
+ '/tmp/linux-image.deb',
+ run.Raw('|'),
+ 'tar',
+ '-t',
+ '-v',
+ '-f', '-',
+ '--wildcards',
+ '--',
+ './boot/vmlinuz-*',
+ run.Raw('|'),
+ # we can only rely on mawk being installed, so just call it explicitly
+ 'mawk',
+ # and use the image name to construct the content of
+ # the grub menu entry, so we can default to it;
+ # hardcoded to assume Ubuntu, English, etc.
+ r'{sub("^\\./boot/vmlinuz-", "", $6); print "cat <<EOF\n" "set default=\"Ubuntu, with Linux " $6 "\"\n" "EOF"}',
+ # make it look like an emacs backup file so
+ # unfortunately timed update-grub runs don't pick it
+ # up yet; use sudo tee so we are able to write to /etc
+ run.Raw('|'),
+ 'sudo',
+ 'tee',
+ '--',
+ '/etc/grub.d/01_ceph_kernel.tmp~',
+ run.Raw('>/dev/null'),
+ run.Raw('&&'),
+ 'sudo',
+ 'chmod',
+ 'a+x',
+ '--',
+ '/etc/grub.d/01_ceph_kernel.tmp~',
+ run.Raw('&&'),
+ 'sudo',
+ 'mv',
+ '--',
+ '/etc/grub.d/01_ceph_kernel.tmp~',
+ '/etc/grub.d/01_ceph_kernel',
+ run.Raw('&&'),
+ 'sudo',
+ 'update-grub',
+ run.Raw('&&'),
'rm',
'/tmp/linux-image.deb',
run.Raw('&&'),