#!/bin/bash set -e set -x # disable blanking so we can look for problems on the VM console setterm -blank 0 -powersave off # This will have been written out by the typed boot command export CONFIG_SERVER_URI=`cat /root/config_server_uri` # Pipe some commands into fdisk to partition # Works better than sfdisk as the size of the final partition is flexible echo "Partitioning SDA" fdisk /dev/sda < /dev/null && echo "j" || echo "-J") if [ "x$DECOMPRESS_FLAG" == "x-J" ]; then DECOMPRESS_FLAG=' -J' fi curl -SsLl "http://vagrant.widgit.com/gentoo.php?file=stage3" | tar xp$DECOMPRESS_FLAG -C /mnt/gentoo --xattrs --numeric-owner && break sleep 30 done # modify the chroot with some custom settings echo "Setting up chroot configuration" # configure portage cat >> /mnt/gentoo/etc/portage/make.conf <> /mnt/gentoo/etc/portage/make.conf # package-specific configuration and unmasks mkdir -p /mnt/gentoo/etc/portage/package.accept_keywords mkdir -p /mnt/gentoo/etc/portage/package.use touch /mnt/gentoo/etc/portage/package.accept_keywords/zzz-autounmask touch /mnt/gentoo/etc/portage/package.use/zzz-autounmask echo "sys-kernel/gentoo-sources" > /mnt/gentoo/etc/portage/package.accept_keywords/kernel echo "sys-kernel/gentoo-sources symlink experimental" > /mnt/gentoo/etc/portage/package.use/kernel echo "sys-boot/grub efiemu -fonts -nls -themes" > /mnt/gentoo/etc/portage/package.use/grub echo "sys-apps/systemd nat" > /mnt/gentoo/etc/portage/package.use/systemd # Locale and time echo "Etc/UTC" > /mnt/gentoo/etc/timezone cat > /mnt/gentoo/etc/locale.gen < /mnt/gentoo/etc/fstab <