From 23f062083480f5f9af1caa9c2d1398601f4e9454 Mon Sep 17 00:00:00 2001 From: Ethan Dye Date: Mon, 3 Feb 2025 10:40:51 -0700 Subject: [PATCH] Remove unrelated changes Signed-off-by: Ethan Dye --- build-image/first-boot.bash | 4 ++-- functions/openhab.bash | 2 +- tests/test.bash | 20 +------------------- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/build-image/first-boot.bash b/build-image/first-boot.bash index cc7df0fb1..027f0922f 100755 --- a/build-image/first-boot.bash +++ b/build-image/first-boot.bash @@ -40,7 +40,7 @@ if ! is_bookworm; then rfkill unblock wifi # Wi-Fi is blocked by Raspi OS default since bullseye(?) fi webserver=/boot/webserver.bash -[[ -f /boot/firmware/webserver.bash ]] && ln -sfn /boot/firmware/webserver.bash "$webserver" +[[ -f /boot/firmware/webserver.bash ]] && ln -s /boot/firmware/webserver.bash "$webserver" if [[ "${debugmode:-on}" == "on" ]]; then unset SILENT @@ -91,7 +91,7 @@ hotSpot=${hotspot:-enable} wifiSSID="$wifi_ssid" # shellcheck source=/etc/openhabian.conf disable=SC2154 wifiPassword="$wifi_password" -if ! running_in_docker && is_bookworm; then +if is_pi && is_bookworm; then echo -n "$(timestamp) [openHABian] Setting up NetworkManager and Wi-Fi connection... " systemctl enable --now NetworkManager nmcli r wifi on diff --git a/functions/openhab.bash b/functions/openhab.bash index 167b1dd9e..46662c5f8 100644 --- a/functions/openhab.bash +++ b/functions/openhab.bash @@ -131,7 +131,7 @@ openhab_setup() { echo -n "$(timestamp) [openHABian] Setting up openHAB service... " if ! cond_redirect zram_dependency install ${ohPkgName}; then return 1; fi if ! cond_redirect systemctl -q daemon-reload; then echo "FAILED (reload)"; return 1; fi - if cond_redirect systemctl enable --now ${ohPkgName}.service; then echo "OK"; else echo "FAILED (enable service)"; journalctl -xeu openhab.service; systemctl status openhab.service; return 1; fi + if cond_redirect systemctl enable --now ${ohPkgName}.service; then echo "OK"; else echo "FAILED (enable service)"; return 1; fi openhab_misc create_systemd_dependencies diff --git a/tests/test.bash b/tests/test.bash index 6a96f0577..f01b90ddd 100755 --- a/tests/test.bash +++ b/tests/test.bash @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -e ## This function formats log messages ## @@ -18,25 +19,6 @@ if [[ $1 == "shellcheck" ]]; then shellcheck -x -s bash functions/*.bash shellcheck -x -s bash build-image/*.bash shellcheck -x -s bash build.bash tests/ci-setup.bash -elif [[ $1 == "docker-install" ]]; then - if [[ -n $2 ]]; then - saved_java_opt="$(ggrep -oP 'java_opt=\K.*' build-image/openhabian.conf)" - gsed -i 's|java_opt=.*$|java_opt='"${2}"'|' build-image/openhabian.conf - fi - if [[ -n $3 ]]; then - saved_debugmode="$(ggrep -oP 'debugmode=\K.*' build-image/openhabian.conf)" - gsed -i 's|debugmode=.*$|debugmode='"${3}"'|' build-image/openhabian.conf - fi - docker buildx build --tag openhabian/install-openhabian -f tests/Dockerfile.rpi5-installation --platform linux/arm64 . - docker run --privileged --rm --platform linux/arm64 --name openhabian -d openhabian/install-openhabian:latest - docker exec -i "openhabian" bash -c './build.bash local-test && /boot/first-boot.bash' - docker stop openhabian - if [[ -n $2 ]]; then - gsed -i 's|java_opt=.*$|java_opt='"${saved_java_opt}"'|' build-image/openhabian.conf - fi - if [[ -n $3 ]]; then - gsed -i 's|debugmode=.*$|debugmode='"${saved_debugmode}"'|' build-image/openhabian.conf - fi else echo_process "Please provide a valid test profile, \"shellcheck\". Exiting" exit 0