Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scripts/dappnode_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,9 @@ main() {
# Run test in interactive terminal (first boot only)
if [ -f "${DAPPNODE_DIR}/.firstboot" ]; then
apt-get update
apt-get install -y kbd
# A package upgrade may leave console-setup pending configuration.
# Never let debconf open a hidden prompt while rc.local owns tty1.
DEBIAN_FRONTEND=noninteractive apt-get install -y kbd
openvt -s -w -- sudo -u root "${DAPPNODE_DIR}/scripts/dappnode_test_install.sh"
exit 0
fi
Expand Down
15 changes: 12 additions & 3 deletions scripts/dappnode_install_pre.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# Execute script with flag UPDATE to update the host: ./dappnode_install_pre.sh UPDATE

# This script also runs from unattended ISO late-commands, where debconf has no
# terminal on which it can safely ask package-configuration questions.
export DEBIAN_FRONTEND=noninteractive

DAPPNODE_DIR="/usr/src/dappnode"
LOGS_DIR="$DAPPNODE_DIR/logs"
lsb_dist="$(. /etc/os-release && echo "$ID")"
Expand Down Expand Up @@ -105,8 +109,10 @@ install_iptables() {

# HOST UPDATE
host_update() {
apt-get update 2>&1 | tee -a $LOG_FILE
apt-get -y upgrade 2>&1 | tee -a $LOG_FILE
# Process substitution keeps apt-get's exit status while still logging its
# output. A regular pipeline would return tee's status and hide dpkg errors.
apt-get update > >(tee -a "$LOG_FILE") 2>&1 || return $?
apt-get -y upgrade > >(tee -a "$LOG_FILE") 2>&1
}

check_ubuntu_connectivity() {
Expand Down Expand Up @@ -152,7 +158,10 @@ touch $LOG_FILE
# Only update && upgrade host if needed
if [ "$1" == "UPDATE" ]; then
echo -e "\e[32m \n\n Updating && upgrading host \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
host_update 2>&1 | tee -a $LOG_FILE
if ! host_update; then
echo -e "\e[31m \n\n ERROR: host update failed \n\n \e[0m" 2>&1 | tee -a "$LOG_FILE"
exit 1
fi
fi

if find /etc/apt/ -name "*.list" -print0 | xargs --null cat | grep -q "https://download.docker.com/linux/$lsb_dist"; then
Expand Down
Loading