-
-
Save PaulFurtado/cd94b7292137c265eead to your computer and use it in GitHub Desktop.
Script to run arch with any kernel version in DigitalOcean
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Digital Ocean stores the arch kernel outside of the VM's disk and the hypervisor boots the | |
# kernel directly. This hack allows you to boot any arch kernel version by using kexec to | |
# basically turn the DO-provided kernel into a bootloader. | |
# | |
# By default, the DO kernel is started with /sbin/init as its command line and /sbin/init | |
# is a symlink to /usr/lib/systemd/systemd. By replacing /sbin/init with this shell script | |
# which calls kexec, we can boot a kernel on the VM's disk. | |
kexec --load /boot/vmlinuz-linux --initrd=/boot/initramfs-linux.img --append="root=LABEL=DOROOT init=/usr/lib/systemd/systemd" && | |
mount -o ro,remount / && | |
kexec -e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment