An automated installation script for Gentoo Linux that streamlines the setup process from disk partitioning through to a bootable system.
Autotoo is a bash script that automates the Gentoo Linux installation process. It handles disk partitioning, filesystem creation, stage3 extraction, system configuration, and bootloader installation with minimal user interaction.
- Automated disk partitioning with GPT layout (512MB EFI partition + Linux root)
- Filesystem setup using XFS for root and FAT32 for EFI
- Stage3 installation with automatic download and extraction
- Optimized compiler flags using native CPU detection
- Kernel installation via gentoo-kernel-bin for faster setup
- Essential system packages including network management, logging, and scheduling
- GRUB bootloader configuration with EFI support
- Service initialization with OpenRC
- Boot from a Gentoo LiveCD/LiveUSB or similar Linux environment
- Active internet connection
- Target disk for installation (all data will be erased)
- Root privileges
- Boot into a live Linux environment
- Download the script:
git clone https://github.com/soccera1/autotoo.git cd autotoo chmod +x autotoo.sh - Run the script:
./autotoo.sh
- When prompted, enter the disk device (e.g.,
/dev/sdaor/dev/nvme0n1) - Confirm the disk selection
- Set a root password when prompted
- Wait for the installation to complete (the system will reboot automatically)
- Locale: en_US.UTF-8 and C.UTF-8
- Hostname: tux
- Profile: Default/linux/amd64/23.0 (profile 1)
- Kernel: sys-kernel/gentoo-kernel-bin (binary kernel for faster installation)
- Bootloader: sys-boot/grub (EFI mode)
- Networking: net-misc/dhcpcd
- Time sync: net-misc/chrony
- Logging: app-admin/sysklogd
- Scheduling: sys-process/cronie
- File indexing: sys-apps/mlocate
- Filesystem tools: sys-fs/xfsprogs, sys-fs/dosfstools
- Shell utilities: app-shells/bash-completion
- dhcpcd (network management)
- sshd (SSH server)
- sysklogd (system logging)
- cronie (cron daemon)
- chronyd (time synchronization)
| Partition | Size | Type | Filesystem | Mount Point |
|---|---|---|---|---|
| 1 | 512 MB | EFI System | FAT32 | /efi |
| 2 | Remaining | Linux | XFS | / |
- This script will erase all data on the selected disk - ensure you select the correct device
- The script downloads a specific stage3 tarball (dated 20251019T170404Z) - you may want to update this URL to the latest version
- Root password must be set manually during installation
- The system will automatically reboot after installation completes (10 second countdown)
- No swap partition is created by default
You can modify the script to customize:
- Compiler optimization flags in
make.conf - USE flags
- Additional packages to install
- Partition sizes
- Hostname (default: "tux")
- System locale settings
After the system reboots:
- Log in as root with the password you set
- Create a regular user account
- Configure any additional services
- Update the system:
emerge --sync && emerge -uDN @world - Customize your Gentoo installation as needed
- Script fails at disk partitioning: Verify the disk device path is correct and the disk is not mounted
- Network issues in chroot: Check that
/etc/resolv.confwas copied correctly - GRUB installation fails: Ensure the EFI partition is properly mounted at
/efi - System won't boot: Boot from live media and check GRUB configuration and EFI variables
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
Contributions are welcome! Please ensure any modifications maintain compatibility with current Gentoo installation procedures.
This script is provided as-is for educational and convenience purposes. Always review scripts that perform system-level operations before running them. The authors are not responsible for data loss or system damage resulting from the use of this script.