Skip to content

Instantly share code, notes, and snippets.

@tegila
Last active March 11, 2023 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tegila/9e016c5516a11b7f92503526951632cb to your computer and use it in GitHub Desktop.
Save tegila/9e016c5516a11b7f92503526951632cb to your computer and use it in GitHub Desktop.
#!/bin/bash
mkdir -p /mnt/linux
mount /dev/local/linux /mnt/linux
mount /dev/sda1 /mnt/linux/boot
mount -t proc none /mnt/linux/proc
mount -o bind /dev /mnt/linux/dev
mount -o bind /sys /mnt/linux/sys
mount -t devpts devpts /mnt/linux/dev/pts
mount --bind /sys/firmware/efi/efivars /mnt/gentoo/sys/firmware/efi/efivars
chroot /mnt/linux /bin/bash
source /etc/profile
export PS1="(chroot) ${PS1}"
passwd
useradd -m -G users tegila
usermod -a -G wheel tegila
passwd tegila
grub-install --target=x86_64-efi --efi-directory=/boot
grub-mkconfig -o /boot/grub/grub.cfg
emerge --ask sys-boot/efibootmgr
mkdir -p /boot/efi/boot
cp /boot/vmlinuz-* /boot/efi/boot/bootx64.efi
efibootmgr --create --disk /dev/sda --part 2 --label "Gentoo" --loader "\efi\boot\bootx64.efi"
dbus-uuidgen > /etc/machine-id
rlpkg -a -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment