Skip to content

Instantly share code, notes, and snippets.

@dhensen
Created March 24, 2016 22:35
Show Gist options
  • Save dhensen/c5bd1b45c11a69c37b33 to your computer and use it in GitHub Desktop.
Save dhensen/c5bd1b45c11a69c37b33 to your computer and use it in GitHub Desktop.
shell script to make my backup bootable when converted to a virtualbox image
#!/bin/sh
mount /dev/sda1 /mnt
arch-chroot /mnt /usr/bin/rm /etc/vconsole.conf
arch-chroot /mnt /usr/bin/pacman -S --noconfirm syslinux
arch-chroot /mnt /usr/bin/syslinux-install_update -i -a -m
arch-chroot /mnt /usr/bin/sed -i.bak s/sda3/sda1/g /boot/syslinux/syslinux.cfg
rm /mnt/etc/fstab
echo "tmpfs /tmp tmpfs nodev,nosuid 0 0" > /mnt/etc/fstab
echo "/dev/sda1 / ext4 defaults,noatime 0 1" >> /mnt/etc/fstab
arch-chroot /mnt /usr/bin/pacman -R xf86-input-synaptics xf86-video-ati xf86-video-intel intel-ucode
arch-chroot /mnt /usr/bin/pacman -S --noconfirm virtualbox-guest-utils
arch-chroot /mnt /usr/bin/mkinitcpio -p linux
# todo: fix .xinitrc and maybe lower dpi in .Xresources
echo "do not forget to manually fix .xinitrc after boot, before startx"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment