Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save detiber/4ed8026f2060d9a70363a25ea6c5c18b to your computer and use it in GitHub Desktop.
Save detiber/4ed8026f2060d9a70363a25ea6c5c18b to your computer and use it in GitHub Desktop.
Cloud - to bare metal.sh
modprobe nbd
qemu-nbd --connect=/dev/nbd0 ./focal-server-cloudimg-amd64.img
partprobe /dev/nbd0
mkdir /mnt/image
mount /dev/nbd0p1 /mnt/image
cd /mnt/image
mount -t proc /proc proc/
mount --rbind /sys sys/
mount --rbind /dev dev/
chroot /mnt/image bash
mv /etc/resolv.conf /etc/resolv.conf.backup
echo nameserver 8.8.8.8 > /etc/resolv.conf
cat >> /etc/initramfs-tools/modules <<EOF
mmc_block
r8169
realtek
sdhci
sdhci_acpi
ahci
libahci
mei
mei_txe
EOF
apt-get update; apt-get install -y linux-modules-extra-5.4.0-64-generic
update-initramfs -u
mv /etc/resolv.conf.backup /etc/resolv.conf
exit
cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment