Skip to content

Instantly share code, notes, and snippets.

@marineam
Created March 11, 2014 19:19
Show Gist options
  • Save marineam/9493021 to your computer and use it in GitHub Desktop.
Save marineam/9493021 to your computer and use it in GitHub Desktop.
CoreOS postinst
# replacement psudocode for src/platform/installer
EFIPART=/dev/sda1
NEWROOT=/dev/sda4
mount -o ro $NEWROOT /media/newroot
mount $EFIPART /media/efi
# Normal boot
cp /media/newroot/boot/vmlinuz /media/efi/syslinux/vmlinuz.B
cp /media/newroot/boot/syslinux/root.B.cfg /media/efi/syslinux/root.B.cfg
# Xen boot via pvbrub
cp /media/newroot/boot/grub/menu.lst.B /media/efi/boot/grub/menu.lst
# Xen boot via HVM
if [[ $(systemd-detect-virt) == xen ]]; then
cp /media/newroot/boot/syslinux/default.cfg.B /media/efi/syslinux/default.cfg
fi
# Update gptprio flags, success=1, tries=1
cgpt add -i4 -S0 -T1 /dev/sda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment