2020-01-08 16:21:01 -01:00
|
|
|
source "$GENTOO_INSTALL_REPO_DIR/scripts/protection.sh" || exit 1
|
|
|
|
source "$GENTOO_INSTALL_REPO_DIR/scripts/internal_config.sh" || exit 1
|
2019-12-31 14:28:42 -01:00
|
|
|
|
|
|
|
|
|
|
|
################################################
|
|
|
|
# Disk configuration
|
|
|
|
|
2020-04-19 19:34:36 +00:00
|
|
|
# Example 1: Single disk, 3 partitions (efi, swap, root)
|
|
|
|
create_default_disk_layout() {
|
|
|
|
local device="$1"
|
|
|
|
|
|
|
|
create_partition new_id=part_efi device="$device" size=128MiB type=efi
|
|
|
|
create_partition new_id=part_swap device="$device" size=8GiB type=raid
|
|
|
|
create_partition new_id=part_root device="$device" size=auto type=raid
|
|
|
|
|
|
|
|
format id=part_efi type=efi label=efi
|
|
|
|
format id=part_swap type=swap label=swap
|
|
|
|
format id=part_root type=ext4 label=ext4
|
|
|
|
|
|
|
|
set_efi id=part_efi
|
|
|
|
set_swap id=part_swap
|
|
|
|
set_root id=part_root
|
|
|
|
}
|
|
|
|
|
|
|
|
create_default_disk_layout
|
|
|
|
|
|
|
|
|
|
|
|
# Example 2: Multiple disks, with raid 0 and luks
|
|
|
|
# - efi: partition on all disks, but only first disk used
|
|
|
|
# - swap: raid 0 → fs
|
|
|
|
# - root: raid 0 → luks → fs
|
|
|
|
devices=(/dev/sd{X,Y})
|
|
|
|
for i in "${!devices[@]}"; do
|
|
|
|
device="${devices[$i]}"
|
|
|
|
create_partition new_id="part_efi_dev${i}" device="$device" size=128MiB type=efi
|
|
|
|
create_partition new_id="part_swap_dev${i}" device="$device" size=8GiB type=raid
|
|
|
|
create_partition new_id="part_root_dev${i}" device="$device" size=auto type=raid
|
|
|
|
done
|
|
|
|
|
|
|
|
create_raid new_id=part_raid_swap level=0 ids="${part_swap_dev*}"
|
|
|
|
create_raid new_id=part_raid_root level=0 ids="${part_root_dev*}"
|
|
|
|
create_luks new_id=part_luks_root id=part_raid_root
|
|
|
|
|
|
|
|
format id=part_efi_dev0 type=efi label=efi
|
|
|
|
format id=part_raid_swap type=swap label=swap
|
|
|
|
format id=part_luks_root type=ext4 label=ext4
|
|
|
|
|
|
|
|
set_efi id=part_efi_dev0
|
|
|
|
set_swap id=part_raid_swap
|
|
|
|
set_root id=part_luks_root
|
2019-12-31 14:28:42 -01:00
|
|
|
|
|
|
|
|
|
|
|
################################################
|
2020-01-04 19:55:42 -01:00
|
|
|
# System configuration
|
2020-01-03 21:48:49 -01:00
|
|
|
|
2020-01-06 14:13:42 -01:00
|
|
|
# Enter the desired system hostname here
|
|
|
|
HOSTNAME="gentoo"
|
|
|
|
|
2020-01-03 21:48:49 -01:00
|
|
|
# The timezone for the new system
|
|
|
|
TIMEZONE="Europe/Berlin"
|
|
|
|
|
2020-01-06 14:13:42 -01:00
|
|
|
# The default keymap for the system
|
|
|
|
KEYMAP="de-latin1-nodeadkeys"
|
|
|
|
#KEYMAP="us"
|
|
|
|
|
2020-01-03 21:48:49 -01:00
|
|
|
# A list of additional locales to generate. You should only
|
|
|
|
# add locales here if you really need them and want to localize
|
|
|
|
# your system. Otherwise, leave this list empty, and use C.utf8.
|
|
|
|
LOCALES=""
|
2020-04-19 19:34:36 +00:00
|
|
|
# The locale to set for the system. Be careful, this setting differs from the LOCALES
|
|
|
|
# list entries (e.g. .UTF-8 vs .utf8). Use the name as shown in `eselect locale`
|
2020-01-03 21:48:49 -01:00
|
|
|
LOCALE="C.utf8"
|
|
|
|
# For a german system you could use:
|
|
|
|
# LOCALES="
|
|
|
|
# de_DE.UTF-8 UTF-8
|
|
|
|
# de_DE ISO-8859-1
|
|
|
|
# de_DE@euro ISO-8859-15
|
|
|
|
# " # End of LOCALES
|
|
|
|
# LOCALE="de_DE.utf8"
|
|
|
|
|
2020-01-04 19:55:42 -01:00
|
|
|
|
|
|
|
################################################
|
|
|
|
# Gentoo configuration
|
|
|
|
|
|
|
|
# The selected gentoo mirror
|
|
|
|
GENTOO_MIRROR="https://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo"
|
|
|
|
#GENTOO_MIRROR="https://distfiles.gentoo.org"
|
|
|
|
|
2020-01-06 16:20:47 -01:00
|
|
|
# The architecture of the target system (only tested with amd64)
|
|
|
|
GENTOO_ARCH="amd64"
|
|
|
|
|
2020-01-04 19:55:42 -01:00
|
|
|
# The stage3 tarball to install
|
2020-01-06 16:20:47 -01:00
|
|
|
STAGE3_BASENAME="stage3-$GENTOO_ARCH-hardened+nomultilib"
|
|
|
|
#STAGE3_BASENAME="stage3-$GENTOO_ARCH-hardened-selinux+nomultilib"
|
2020-01-04 19:55:42 -01:00
|
|
|
|
2020-01-05 22:35:15 -01:00
|
|
|
|
|
|
|
################################################
|
|
|
|
# Additional (optional) configuration
|
2020-01-04 19:55:42 -01:00
|
|
|
|
|
|
|
# List of additional packages to install (will be directly passed to emerge)
|
|
|
|
ADDITIONAL_PACKAGES="app-editors/neovim"
|
2020-01-06 19:34:44 -01:00
|
|
|
# Install and enable dhcpcd
|
|
|
|
INSTALL_DHCPCD=true
|
2020-01-06 14:13:42 -01:00
|
|
|
# Install and configure sshd (a reasonably secure config is provided, which
|
|
|
|
# only allows the use of ed25519 keys, and requires pubkey authentication)
|
2020-01-05 22:35:15 -01:00
|
|
|
INSTALL_SSHD=true
|
2020-01-06 19:34:44 -01:00
|
|
|
# Install ansible, and add a user for it. This requires INSTALL_SSHD=true
|
2020-01-05 22:35:15 -01:00
|
|
|
INSTALL_ANSIBLE=true
|
|
|
|
# The home directory for the ansible user
|
|
|
|
ANSIBLE_HOME="/var/lib/ansible"
|
2020-01-06 14:13:42 -01:00
|
|
|
# An ssh key to add to the .authorized_keys file for the ansible user.
|
|
|
|
# This variable will become the content of the .authorized_keys file,
|
|
|
|
# so you may specify one key per line.
|
|
|
|
ANSIBLE_SSH_AUTHORIZED_KEYS=""
|
2020-01-05 22:35:15 -01:00
|
|
|
|
|
|
|
|
|
|
|
################################################
|
|
|
|
# Prove that you have read the config
|
|
|
|
|
|
|
|
# To prove that you have read and edited the config
|
|
|
|
# properly, set the following value to true.
|
|
|
|
I_HAVE_READ_AND_EDITED_THE_CONFIG_PROPERLY=false
|