Skip to content

Instantly share code, notes, and snippets.

@metatoaster
Last active January 26, 2018 12:41
Show Gist options
  • Select an option

  • Save metatoaster/ad31fbcc474f1d5cefdf4c541e8fd64b to your computer and use it in GitHub Desktop.

Select an option

Save metatoaster/ad31fbcc474f1d5cefdf4c541e8fd64b to your computer and use it in GitHub Desktop.
Install Gentoo with these three easy commands after booting the live CD
mkdir /root/.ssh && cat > /root/.ssh/authorized_keys # type your ssh keys here, finish by hitting enter and ctrl-d; alternatively replace it with a less interactive command
parted --script /dev/sda mklabel gpt mkpart primary 0 1MB mkpart primary 1MB 100% set 1 bios_grub on && mkfs.ext4 /dev/sda2 && mount /dev/sda2 /mnt/gentoo && curl -s http://distfiles.gentoo.org/releases/amd64/autobuilds/`curl -s http://distfiles.gentoo.org/releases/amd64/autobuilds/latest-stage3-amd64.txt | tail -n1 |cut -f1 -d\ ` | tar xpJf - --xattrs-include='*.*' --numeric-owner -C /mnt/gentoo && mount -t proc proc /mnt/gentoo/proc && mount -R /dev /mnt/gentoo/dev && mount -R /sys /mnt/gentoo/sys && cp -L /etc/resolv.conf /mnt/gentoo/etc/ && cp -a /root/.ssh /mnt/gentoo/root/ && chroot /mnt/gentoo /bin/bash -c 'source /etc/profile && emerge-webrsync && emerge --update --deep --newuse @world && emerge app-admin/syslog-ng net-misc/dhcpcd sys-apps/mlocate sys-boot/grub:2 sys-kernel/genkernel-next sys-kernel/gentoo-sources sys-process/cronie && echo en_US.UTF-8 UTF-8 >> /etc/locale.gen && locale-gen && eselect locale set en_US.utf8 && echo UTC >> /etc/timezone && emerge --config sys-libs/timezone-data && source /etc/profile && genkernel --oldconfig --no-zfs --no-btrfs all && echo -e "$(blkid | grep sda2 | cut -f2 -d\ )\t\t/\t\text4\trw,noatime\t0 1" >> /etc/fstab && ln -s net.lo /etc/init.d/net.eth0 && rc-update add net.eth0 default && rc-update add syslog-ng default && rc-update add cronie default && rc-update add sshd default && echo PermitRootLogin prohibit-password >> /etc/ssh/sshd_config && echo GRUB_TIMEOUT=2 >> /etc/default/grub && echo GRUB_CMDLINE_LINUX=\"net.ifnames=0\" >> /etc/default/grub && grub-install /dev/sda && grub-mkconfig -o /boot/grub/grub.cfg'
reboot # remember to eject the iso media
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment