Skip to content

Commit

Permalink
Merge pull request cimryan#94 from cimryan/feature/upgrade-packages-d…
Browse files Browse the repository at this point in the history
…uring-setup

Feature/upgrade packages during setup
  • Loading branch information
cimryan authored Nov 4, 2018
2 parents c7d6d42 + 749de01 commit 7913c93
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 0 additions & 2 deletions setup/pi/make-root-fs-readonly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ function append_cmdline_txt_param() {
sed -i "s/\'/ ${toAppend}/g" /boot/cmdline.txt >/dev/null
}

echo "Updating package index files..."
apt-get update
echo "Removing unwanted packages..."
apt-get remove -y --force-yes --purge triggerhappy logrotate dphys-swapfile
apt-get -y --force-yes autoremove --purge
Expand Down
20 changes: 20 additions & 0 deletions setup/pi/setup-teslausb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ BRANCH=${BRANCH:-master}
HEADLESS_SETUP=${HEADLESS_SETUP:-false}
USE_LED_FOR_SETUP_PROGRESS=true
CONFIGURE_ARCHIVING=${CONFIGURE_ARCHIVING:-true}
UPGRADE_PACKAGES=${UPGRADE_PACKAGES:-true}

function setup_progress () {
local setup_logfile=/boot/teslausb-headless-setup.log
Expand Down Expand Up @@ -191,9 +192,26 @@ function make_root_fs_readonly () {
/tmp/make-root-fs-readonly.sh
}

function update_package_index () {
setup_progress "Updating package index files..."
apt-get update
}

function upgrade_packages () {
if [ "$UPGRADE_PACKAGES" = true ]
then
setup_progress "Upgrading installed packages..."
apt-get --assume-yes upgrade
else
setup_progress "Skipping package upgrade."
fi
}

export -f setup_progress
export HEADLESS_SETUP

update_package_index

headless_setup_populate_variables

# If USE_LED_FOR_SETUP_PROGRESS = true.
Expand Down Expand Up @@ -238,6 +256,8 @@ fi

make_root_fs_readonly

upgrade_packages

# If USE_LED_FOR_SETUP_PROGRESS = true.
setup_led_on

Expand Down

0 comments on commit 7913c93

Please sign in to comment.