Merge pull request #111 from kasperfm/develop

Add option to enable binary packages in make.conf
This commit is contained in:
oddlama 2024-02-04 17:17:07 +01:00 committed by GitHub
commit 93e1aa3a9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 0 deletions

13
configure vendored
View File

@ -437,7 +437,9 @@ function load_default_config() {
ADDITIONAL_PACKAGES=() ADDITIONAL_PACKAGES=()
ENABLE_SSHD=true ENABLE_SSHD=true
ENABLE_BINPKG=false
ROOT_SSH_AUTHORIZED_KEYS="" ROOT_SSH_AUTHORIZED_KEYS=""
# All settings are unsaved. # All settings are unsaved.
UNSAVED_CHANGES=true UNSAVED_CHANGES=true
@ -894,6 +896,7 @@ MENU_ITEMS=(
"SELECT_MIRRORS_LARGE_FILE" "SELECT_MIRRORS_LARGE_FILE"
"--------" "--------"
"ENABLE_SSHD" "ENABLE_SSHD"
"ENABLE_BINPKG"
"ROOT_SSH_AUTHORIZED_KEYS" "ROOT_SSH_AUTHORIZED_KEYS"
"ADDITIONAL_PACKAGES" "ADDITIONAL_PACKAGES"
) )
@ -1517,6 +1520,15 @@ function ENABLE_SSHD_menu() {
UNSAVED_CHANGES=true UNSAVED_CHANGES=true
} }
function ENABLE_BINPKG_tag() { echo "Enable binary packages"; }
function ENABLE_BINPKG_label() { on_off_label "$ENABLE_BINPKG"; }
function ENABLE_BINPKG_show() { return 0; }
function ENABLE_BINPKG_help() { echo "Use binary packages if available."; }
function ENABLE_BINPKG_menu() {
on_off_toggle "ENABLE_BINPKG"
UNSAVED_CHANGES=true
}
function ROOT_SSH_AUTHORIZED_KEYS_tag() { echo "Authorized keys (root)"; } function ROOT_SSH_AUTHORIZED_KEYS_tag() { echo "Authorized keys (root)"; }
function ROOT_SSH_AUTHORIZED_KEYS_label() { echo "$(sed '/^\s*#/d;/^\s*$/d' <<< "$ROOT_SSH_AUTHORIZED_KEYS" | wc -l) keys"; } function ROOT_SSH_AUTHORIZED_KEYS_label() { echo "$(sed '/^\s*#/d;/^\s*$/d' <<< "$ROOT_SSH_AUTHORIZED_KEYS" | wc -l) keys"; }
function ROOT_SSH_AUTHORIZED_KEYS_show() { return 0; } function ROOT_SSH_AUTHORIZED_KEYS_show() { return 0; }
@ -1621,6 +1633,7 @@ MUSL=\$([[ \$STAGE3_VARIANT == *musl* ]] && echo "true" || echo "false")
ADDITIONAL_PACKAGES=(${ADDITIONAL_PACKAGES[@]@Q}) ADDITIONAL_PACKAGES=(${ADDITIONAL_PACKAGES[@]@Q})
ENABLE_SSHD=${ENABLE_SSHD@Q} ENABLE_SSHD=${ENABLE_SSHD@Q}
ENABLE_BINPKG=${ENABLE_BINPKG@Q}
ROOT_SSH_AUTHORIZED_KEYS=${ROOT_SSH_AUTHORIZED_KEYS@Q} ROOT_SSH_AUTHORIZED_KEYS=${ROOT_SSH_AUTHORIZED_KEYS@Q}

View File

@ -294,6 +294,9 @@ ADDITIONAL_PACKAGES=()
# only allows the use of ed25519 keys, and requires pubkey authentication) # only allows the use of ed25519 keys, and requires pubkey authentication)
ENABLE_SSHD=true ENABLE_SSHD=true
# Enable binary portage packages where available
ENABLE_BINPKG=false
# An ssh key to add to the authorized_keys file for the root user. # An ssh key to add to the authorized_keys file for the root user.
# This variable will become the content of the authorized_keys file, # This variable will become the content of the authorized_keys file,
# so you may specify one key per line (include the newlines in the variable). # so you may specify one key per line (include the newlines in the variable).

View File

@ -104,6 +104,12 @@ function configure_portage() {
try mirrorselect "${mirrorselect_params[@]}" try mirrorselect "${mirrorselect_params[@]}"
fi fi
if [[ $ENABLE_BINPKG == "true" ]]; then
echo 'FEATURES="getbinpkg"' >> /etc/portage/make.conf
getuto
chmod 644 /etc/portage/gnupg/pubring.kbx
fi
chmod 644 /etc/portage/make.conf \ chmod 644 /etc/portage/make.conf \
|| die "Could not chmod 644 /etc/portage/make.conf" || die "Could not chmod 644 /etc/portage/make.conf"
} }