aboutsummaryrefslogtreecommitdiff
path: root/prepare-board.sh
diff options
context:
space:
mode:
authorLaurent Alfonsi <laurent.alfonsi@linaro.org>2022-04-20 17:27:27 +0200
committerLaurent Alfonsi <laurent.alfonsi@linaro.org>2022-04-21 10:52:21 +0200
commitaca9fbb89f2445fa09d283fbd73260ad3f182ece (patch)
tree786f418c51f4af37d6d98613393802b7ccf47d52 /prepare-board.sh
parent6c5cfdd3068c2e906f787b718605253f7ce8c12a (diff)
prepare-board: extend for fx host
Change-Id: I2a4a047da07c69655a04d029b0479021a979cf4f
Diffstat (limited to 'prepare-board.sh')
-rwxr-xr-xprepare-board.sh39
1 files changed, 20 insertions, 19 deletions
diff --git a/prepare-board.sh b/prepare-board.sh
index 414c7bf..08a5eb8 100755
--- a/prepare-board.sh
+++ b/prepare-board.sh
@@ -35,7 +35,18 @@ TOP=$(dirname "$(readlink -f "$0")")
CONFS=$TOP/prepare-board
RESTORE_LOC=/run/prepare-board
# FIXME: put this in a board-specific conf file
-SERVICE_LIST=("ntp")
+SERVICE_LIST=(
+ "ntp"
+ "alsa-utils" "apport" "atd" "cron"
+ # "dbus" : keep
+ "irqbalance" "kmod" "multipath-tools"
+ # "networking" : keep for the moment
+ "procps" "rsyslog"
+ # "ssh" : keep
+ "udev"
+ # "ufw" : keep for the moment
+ "unattended-upgrades"
+ )
############################################################
# usage/help
@@ -89,6 +100,7 @@ hw_tag2board_type()
sq*) echo "sq" ;;
tk1*) echo "tk1" ;;
tx1*) echo "tx1" ;;
+ fx*) echo "fx" ;;
*) error "Unknown hw_tag $hw_tag" ;;
esac
}
@@ -215,6 +227,7 @@ configure_sysctls()
# do_service starts or stops a named service
# assumes that the system is using systemd
+
do_service()
{
local op=$1
@@ -415,19 +428,7 @@ configure_ntp()
local op=$1
if [ "$op" = "start_board" ]; then
- local retry
- # shellcheck disable=SC2034 # Intentionally unused
- for retry in 5 4 3 2 1; do
- if ntpd -gq; then
- break
- fi
-
- # Occasionally systemctl fails to properly kill ntp and
- # we get stuck ntpd process that doesn't respond to SIGTERM.
- # Kill it with SIGKILL.
- pkill -9 ntpd || true
- sleep 60
- done
+ timedatectl set-ntp false
fi
}
@@ -488,23 +489,23 @@ configure_docker()
fi
fi
- host_cnt=$(docker ps --filter name=host -q)
+ verbose "Stopping all docker containers except host container"
+ host_cnt=$(docker ps --filter name='host$' -q)
for cnt in $(docker ps -q); do
[ "$cnt" = "$host_cnt" ] && continue
- docker stop $cnt
- echo $cnt >> "$restore_file"
+ docker stop "$cnt"
+ echo "$cnt" >> "$restore_file"
done
elif [ "$op" = "stop_board" ]; then
for cnt in $(docker ps -q -f status=exited); do
if grep -q "^$cnt\$" "$restore_file"; then
- docker start $cnt
+ docker start "$cnt"
fi
done
rm -f "$restore_file"
fi
}
-
############################################################
# perform the configuration
configure_common()