From 065ddfb24dcf69b8ab8398f846eb7d7701389533 Mon Sep 17 00:00:00 2001 From: Richard Goodwin Date: Fri, 26 Oct 2018 07:59:12 -0500 Subject: [PATCH] Better naming of headless_setup functions --- setup/pi/setup-teslausb | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/setup/pi/setup-teslausb b/setup/pi/setup-teslausb index 5eadefd..e51addb 100644 --- a/setup/pi/setup-teslausb +++ b/setup/pi/setup-teslausb @@ -21,7 +21,7 @@ function setup_progress () { echo $1 } -function headless_populate_variables () { +function headless_setup_populate_variables () { # Pull in the conf file variables to make avail to this script and subscripts if [ -e /boot/teslausb_setup_variables.conf ] && [ $HEADLESS_SETUP = "true" ] then @@ -29,22 +29,30 @@ function headless_populate_variables () { fi } -function headless_mark_setup_failed () { - setup_log "ERROR: Setup Failed." - touch /boot/TESLAUSB_SETUP_FAILED -} - -function headless_mark_setup_success () { - if [ -e /boot/TESLAUSB_SETUP_FAILED ] +function headless_setup_mark_setup_failed () { + if [ $HEADLESS_SETUP = "true" ] then - rm /boot/TESLAUSB_SETUP_FAILED + setup_log "ERROR: Setup Failed." + touch /boot/TESLAUSB_SETUP_FAILED fi - rm /boot/TESLAUSB_SETUP_STARTED - touch /boot/TESLAUSB_SETUP_FINISHED - setup_log "Main setup completed. Remounting file systems read only." } -function headless_progress_flash () { +function headless_setup_mark_setup_success () { + if [ $HEADLESS_SETUP = "true" ] + then + + if [ -e /boot/TESLAUSB_SETUP_FAILED ] + then + rm /boot/TESLAUSB_SETUP_FAILED + fi + + rm /boot/TESLAUSB_SETUP_STARTED + touch /boot/TESLAUSB_SETUP_FINISHED + setup_log "Main setup completed. Remounting file systems read only." + fi +} + +function headless_setup_progress_flash () { if [ $HEADLESS_SETUP = "true" ] then /etc/stage_flash $1 @@ -220,6 +228,8 @@ function make_root_fs_readonly () { /tmp/make-root-fs-readonly.sh } +headless_setup_populate_variables + setup_progress "Verifying environment variables..." RSYNC_ENABLE="${RSYNC_ENABLE:-false}" @@ -283,7 +293,9 @@ create_usb_drive_backing_files configure_rc_local configure_hostname -headless_mark_setup_success + +headless_setup_mark_setup_success + make_root_fs_readonly echo "All done."