Switch to Distribution Kernel

by niemeyer
9 deployments · 0 still active · last rev. 5 months ago

Compatible with: Ubuntu 16.04 LTS
						#!/bin/bash
#
# <UDF name="CONFIG_ID" Label="Config ID" default="" />
# <UDF name="GRUB2_ID" Label="GRUB 2 Kernel ID" default="210" />
# <UDF name="API_KEY" Label="Linode API Key" />
#

set -e -x

export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical

apt-get update
apt-get install -y linux-image-virtual grub2

cat <<END >/etc/default/grub
GRUB_DEFAULT=0
GRUB_TIMEOUT=10
GRUB_CMDLINE_LINUX="console=ttyS0,19200n8"
GRUB_DISABLE_LINUX_UUID=true
GRUB_SERIAL_COMMAND="serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1"
GRUB_TERMINAL=serial
GRUB_DISTRIBUTOR=Linux
END

update-grub

curl "https://api.linode.com/?api_key=$API_KEY&api_action=linode.config.update&LinodeID=$LINODE_ID&ConfigID=$CONFIG_ID&KernelID=$GRUB2_ID"

reboot