From aca9fbb89f2445fa09d283fbd73260ad3f182ece Mon Sep 17 00:00:00 2001 From: Laurent Alfonsi Date: Wed, 20 Apr 2022 17:27:27 +0200 Subject: prepare-board: extend for fx host Change-Id: I2a4a047da07c69655a04d029b0479021a979cf4f --- prepare-board.sh | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'prepare-board.sh') 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() -- cgit v1.2.3