Added mirrorselect switch and mirrorselect large file switch. Closes #3

This commit is contained in:
oddlama 2020-11-26 12:44:59 +01:00
parent 811298eb92
commit b7b3d9c529
No known key found for this signature in database
GPG Key ID: 88EA325D51D53908
2 changed files with 21 additions and 7 deletions

View File

@ -176,6 +176,15 @@ STAGE3_BASENAME="stage3-$GENTOO_ARCH-systemd"
#STAGE3_BASENAME="stage3-$GENTOO_ARCH-hardened+nomultilib"
#STAGE3_BASENAME="stage3-$GENTOO_ARCH-hardened-selinux+nomultilib"
# If set to true, the best best gentoo mirrors will be selected
# automatically by app-portage/mirrorselect
SELECT_MIRRORS=true
# If set to true, mirrorselect will download a large 100kb file
# from each mirror for more accurate test results. This can
# take significantly longer (~5-10min).
SELECT_MIRRORS_LARGE_FILE=false
# Set to true if the tarball is based on systemd. In this case
# we need to use slightly different utilities to setup the base system.
SYSTEMD=true

View File

@ -120,15 +120,20 @@ configure_portage() {
mkdir_or_die 0755 "/etc/portage/package.keywords"
touch_or_die 0644 "/etc/portage/package.keywords/zz-autounmask"
if [[ $SELECT_MIRRORS == "true" ]]; then
einfo "Temporarily installing mirrorselect"
try emerge --verbose --oneshot app-portage/mirrorselect
einfo "Selecting fastest portage mirrors"
try mirrorselect -s 4 -b 10 -D
mirrorselect_params=("-s" "4" "-b" "10")
[[ $SELECT_MIRRORS_LARGE_FILE == "true" ]] \
&& mirrorselect_params+=("-D")
try mirrorselect "${mirrorselect_params[@]}"
einfo "Adding ~$GENTOO_ARCH to ACCEPT_KEYWORDS"
echo "ACCEPT_KEYWORDS=\"~$GENTOO_ARCH\"" >> /etc/portage/make.conf \
|| die "Could not modify /etc/portage/make.conf"
fi
}
install_sshd() {