coreos/update_engine — pull request #39 by betawaffle (2014-07-15 20:52:09+00:00)
Title: Add a hook for OEMs in coreos-postinst

This will give me the ability to work around Linode's funky pv-grub environment. All I'd have to do is make a simple script `/usr/share/oem/oem-postinst`:

```sh
#!/bin/bash

set -e

SLOT="$1"
INSTALL_MNT="$2"

LINODE_DEV="/dev/xvda"
LINODE_MNT="/linode"

mkdir -p "${LINODE_MNT}"
mount "${LINODE_DEV}" "${LINODE_MNT}"
trap "umount '${LINODE_MNT}' && rmdir '${LINODE_MNT}'" EXIT

cp -v "${INSTALL_MNT}/boot/grub/menu.lst.${SLOT}" \
"${LINODE_MNT}/boot/grub/menu.lst"

sed -i 's/(hd0,0)/(hd1,0)/' "${LINODE_MNT}/boot/grub/menu.lst"
```

Don't judge me too harshly, I'm a bit of a novice with shell scripts.