Added portage tree sync-type configuration options

This commit is contained in:
oddlama 2021-06-02 17:01:16 +02:00
parent 953f5009e9
commit 0c49dab59b
No known key found for this signature in database
GPG Key ID: 14EFE510775FE39A
2 changed files with 74 additions and 11 deletions

60
configure vendored
View File

@ -172,6 +172,9 @@ function define_disk_layout() {
esac esac
} }
INIT_SYSTEMS=("systemd" "OpenRC")
ALL_GENTOO_ARCHS=("x86" "amd64" "arm" "arm64")
ALL_PARTITIONING_SCHEMES=( ALL_PARTITIONING_SCHEMES=(
"classic_single_disk" "Classic single disk layout (boot, swap, root)" "classic_single_disk" "Classic single disk layout (boot, swap, root)"
"zfs_centric" "ZFS centric (optional raid0/1 and encryption via zfs)" "zfs_centric" "ZFS centric (optional raid0/1 and encryption via zfs)"
@ -186,6 +189,8 @@ PARTITIONING_BTRFS_RAID_TYPES=("raid0" "raid1")
PARTITIONING_ZFS_POOL_TYPES=("standard" "custom") PARTITIONING_ZFS_POOL_TYPES=("standard" "custom")
PARTITIONING_ZFS_COMPRESSIONS=("on" "gzip" "lz4" "lzjb" "zle" "zstd" "zstd-fast") PARTITIONING_ZFS_COMPRESSIONS=("on" "gzip" "lz4" "lzjb" "zle" "zstd" "zstd-fast")
PORTAGE_SYNC_TYPES=("git" "rsync")
function create_single_disk_layout() { function create_single_disk_layout() {
create_classic_single_disk_layout "$@" create_classic_single_disk_layout "$@"
} }
@ -277,8 +282,6 @@ function create_btrfs_centric_layout() {
get_all_keymaps get_all_keymaps
get_all_timezones get_all_timezones
INIT_SYSTEMS=("systemd" "OpenRC")
ALL_GENTOO_ARCHS=("x86" "amd64" "arm" "arm64")
readarray -t SUPPORTED_LOCALES < "$(get_supported_locales)" readarray -t SUPPORTED_LOCALES < "$(get_supported_locales)"
readarray -t LOCALE_A < <(locale -a) readarray -t LOCALE_A < <(locale -a)
@ -353,6 +356,10 @@ function load_default_config() {
SYSTEMD=true SYSTEMD=true
PORTAGE_SYNC_TYPE="git"
PORTAGE_GIT_FULL_HISTORY=false
PORTAGE_GIT_MIRROR="https://anongit.gentoo.org/git/repo/sync/gentoo.git"
GENTOO_MIRROR="https://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo" GENTOO_MIRROR="https://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo"
GENTOO_ARCH="amd64" GENTOO_ARCH="amd64"
@ -748,6 +755,9 @@ MENU_ITEMS=(
"LOCALE" "LOCALE"
"--------" "--------"
"INIT_SYSTEM" "INIT_SYSTEM"
"PORTAGE_SYNC_TYPE"
"PORTAGE_GIT_FULL_HISTORY"
"PORTAGE_GIT_MIRROR"
"GENTOO_MIRROR" "GENTOO_MIRROR"
"GENTOO_ARCH" "GENTOO_ARCH"
"SELECT_MIRRORS" "SELECT_MIRRORS"
@ -1138,6 +1148,47 @@ function INIT_SYSTEM_menu() {
fi fi
} }
function PORTAGE_SYNC_TYPE_tag() { echo "Portage tree sync-type"; }
function PORTAGE_SYNC_TYPE_label() { echo "($PORTAGE_SYNC_TYPE)"; }
function PORTAGE_SYNC_TYPE_show() { return 0; }
function PORTAGE_SYNC_TYPE_help() { echo "The portage tree sync-type."; }
function PORTAGE_SYNC_TYPE_menu() {
if menu_radiolist \
"Select sync-type" \
"Select the portage tree sync-type. Git is generally preferred for modern system installations." \
"$PORTAGE_SYNC_TYPE" \
"${PORTAGE_SYNC_TYPES[@]}"
then
# Set arch
PORTAGE_SYNC_TYPE="$dialog_out"
UNSAVED_CHANGES=true
else
# Return to menu
true
fi
}
function PORTAGE_GIT_FULL_HISTORY_tag() { echo " ├ Download full history"; }
function PORTAGE_GIT_FULL_HISTORY_label() { on_off_label "$PORTAGE_GIT_FULL_HISTORY" " ├ "; }
function PORTAGE_GIT_FULL_HISTORY_show() { one_of "$PORTAGE_SYNC_TYPE" "git"; }
function PORTAGE_GIT_FULL_HISTORY_help() { echo "Determines if the full git history of the portage tree will be downloaded. This can easily take up 1-2GB of disk space."; }
function PORTAGE_GIT_FULL_HISTORY_menu() {
on_off_toggle "PORTAGE_GIT_FULL_HISTORY"
UNSAVED_CHANGES=true
}
function PORTAGE_GIT_MIRROR_tag() { echo " └ Git mirror"; }
function PORTAGE_GIT_MIRROR_label() { echo " └ ($(ellipsis 20 "$PORTAGE_GIT_MIRROR"))"; }
function PORTAGE_GIT_MIRROR_show() { one_of "$PORTAGE_SYNC_TYPE" "git"; }
function PORTAGE_GIT_MIRROR_help() { echo "The portage git mirror is the git endpoint that is used to sync the portage tree."; }
function PORTAGE_GIT_MIRROR_menu() {
dialog \
--title "Select portage git mirror" \
--inputbox "Enter the portage git mirror that should be used to sync the portage tree." \
"${INPUTBOX_SIZE[@]}" "$PORTAGE_GIT_MIRROR"
UNSAVED_CHANGES=true
}
function GENTOO_MIRROR_tag() { echo "Gentoo mirror"; } function GENTOO_MIRROR_tag() { echo "Gentoo mirror"; }
function GENTOO_MIRROR_label() { echo "($(ellipsis 20 "$GENTOO_MIRROR"))"; } function GENTOO_MIRROR_label() { echo "($(ellipsis 20 "$GENTOO_MIRROR"))"; }
function GENTOO_MIRROR_show() { return 0; } function GENTOO_MIRROR_show() { return 0; }
@ -1281,12 +1332,15 @@ LOCALE=${LOCALE@Q}
################################################ ################################################
# Gentoo configuration # Gentoo configuration
SYSTEMD=${SYSTEMD@Q}
PORTAGE_SYNC_TYPE=${PORTAGE_SYNC_TYPE@Q}
PORTAGE_GIT_FULL_HISTORY=${PORTAGE_GIT_FULL_HISTORY@Q}
PORTAGE_GIT_MIRROR=${PORTAGE_GIT_MIRROR@Q}
GENTOO_MIRROR=${GENTOO_MIRROR@Q} GENTOO_MIRROR=${GENTOO_MIRROR@Q}
GENTOO_ARCH=${GENTOO_ARCH@Q} GENTOO_ARCH=${GENTOO_ARCH@Q}
STAGE3_BASENAME="stage3-\$GENTOO_ARCH$([[ $SYSTEMD == true ]] && echo -n "-systemd")" STAGE3_BASENAME="stage3-\$GENTOO_ARCH$([[ $SYSTEMD == true ]] && echo -n "-systemd")"
SELECT_MIRRORS=${SELECT_MIRRORS@Q} SELECT_MIRRORS=${SELECT_MIRRORS@Q}
SELECT_MIRRORS_LARGE_FILE=${SELECT_MIRRORS_LARGE_FILE@Q} SELECT_MIRRORS_LARGE_FILE=${SELECT_MIRRORS_LARGE_FILE@Q}
SYSTEMD=${SYSTEMD@Q}
################################################ ################################################

View File

@ -54,10 +54,10 @@ function disk_configuration() {
# swap=<size> Create a swap partition with given size, or no swap # swap=<size> Create a swap partition with given size, or no swap
# at all if set to false # at all if set to false
# type=[efi|bios] Selects the boot type. Defaults to efi if not given. # type=[efi|bios] Selects the boot type. Defaults to efi if not given.
# encrypt=[true|false] Encrypt the zfs pool. Defaults to false if not given. # encrypt=[true|false] Encrypt the zfs datasets. Defaults to false if not given.
# pool_type=[mirror|stripe] Select zfs pool type. Defaults to stripe. # compress=[false|<compression>] Compress the zfs datasets. For valid values visit man zfsprops. Defaults to false if not given.
#create_zfs_centric_layout type=efi swap=8GiB encrypt=true pool_type=raid0 /dev/nvme0n1 # pool_type=[standard|custom] Select zfs pool type. Custom pools allow you to do the pool creation yourself. Defaults to standard.
#create_zfs_centric_layout type=efi swap=8GiB encrypt=true pool_type=raid0 /dev/nvme0n1 /dev/nvme1n1 #create_zfs_centric_layout type=efi swap=8GiB encrypt=true compress=zstd pool_type=standard
# 3. create_raid0_luks_layout # 3. create_raid0_luks_layout
# #
@ -202,6 +202,19 @@ LOCALE="C.utf8"
################################################ ################################################
# Gentoo configuration # Gentoo configuration
# Set to true if the stage3 tarball is based on systemd. In this case
# we need to use slightly different utilities to setup the base system.
SYSTEMD=true
# Choose whether to download the portage tree via git or rsync.
# Git syncing is significantly faster, and generally preferred for new installations.
PORTAGE_SYNC_TYPE="git"
# If you have chosen git, you may select to download the full history of the repository.
# This can easily take up 1-2GB of disk space.
PORTAGE_GIT_FULL_HISTORY=false
# If you have chosen git, you may select the git repository mirror here.
PORTAGE_GIT_MIRROR="https://anongit.gentoo.org/git/repo/sync/gentoo.git"
# The selected gentoo mirror # The selected gentoo mirror
GENTOO_MIRROR="https://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo" GENTOO_MIRROR="https://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo"
#GENTOO_MIRROR="https://distfiles.gentoo.org" #GENTOO_MIRROR="https://distfiles.gentoo.org"
@ -223,10 +236,6 @@ SELECT_MIRRORS=true
# take significantly longer (~5-10min). # take significantly longer (~5-10min).
SELECT_MIRRORS_LARGE_FILE=false SELECT_MIRRORS_LARGE_FILE=false
# Set to true if the stagr3 tarball is based on systemd. In this case
# we need to use slightly different utilities to setup the base system.
SYSTEMD=true
################################################ ################################################
# Additional (optional) configuration # Additional (optional) configuration