Skip to content

Instantly share code, notes, and snippets.

@astery
Created March 12, 2016 21:41
Show Gist options
  • Save astery/08cc91e12b873337413f to your computer and use it in GitHub Desktop.
Save astery/08cc91e12b873337413f to your computer and use it in GitHub Desktop.
Chroot sequence from gentoo handbook
#!/bin/bash
mkdir -p /mnt/gentoo
mount -t proc proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --make-rslave /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
mount --make-rslave /mnt/gentoo/dev
rm /dev/shm && mkdir /dev/shm
mount -t tmpfs -o nosuid,nodev,noexec shm /dev/shm
chmod 1777 /dev/shm
chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) $PS1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment