From 241bb704efc5c64fb373e3d6caefb44dd7c2d112 Mon Sep 17 00:00:00 2001 From: klemek Date: Fri, 28 Aug 2026 17:44:04 +0200 Subject: [PATCH] use bashrc for start --- Makefile | 9 ++++++--- line_in_file.sh | 15 +++++++++++++++ system/weston.service | 23 ----------------------- system/weston.socket | 5 ----- 4 files changed, 21 insertions(+), 31 deletions(-) create mode 100755 line_in_file.sh delete mode 100644 system/weston.service delete mode 100644 system/weston.socket diff --git a/Makefile b/Makefile index f66b975..6055be5 100644 --- a/Makefile +++ b/Makefile @@ -47,9 +47,9 @@ setup-weston: .PHONY: setup-rasp-config setup-rasp-config: - if [ -z $(shell grep "include forge-invar.txt" "/boot/firmware/config.txt") ]; then sudo sh -c 'echo "include forge-invar.txt" >> /boot/firmware/config.txt'; fi + sudo $(PROJECT_DIR)/line_in_file.sh "include forge-invar.txt" "/boot/firmware/config.txt" + sudo $(PROJECT_DIR)/line_in_file.sh "vc4.tv_norm=PAL" "/boot/firmware/config.txt" "vc4.tv_norm" sudo cp -f $(PROJECT_DIR)/system/config.ini /boot/firmware/forge-invar.txt - if [ -z $(shell grep "vc4.tv_norm" "/boot/firmware/cmdline.txt") ]; then sudo sh -c 'echo "vc4.tv_norm=PAL" >> /boot/firmware/cmdline.txt'; fi .PHONY: setup-services setup-services: @@ -64,9 +64,12 @@ setup-user-services: systemctl --user daemon-reload systemctl --user enable weston +.PHONY: setup-bashrc +setup-bashrc: + $(PROJECT_DIR)/line_in_file.sh "make -C $(PROJECT_DIR) start-weston" "$(HOME)/.bashrc" .PHONY: install -install: remove-passwd setup-rasp-config apt-install setup-weston setup-rasp-config setup-services setup-user-services +install: remove-passwd setup-rasp-config apt-install setup-weston setup-rasp-config setup-services setup-bashrc .PHONY: clean clean: diff --git a/line_in_file.sh b/line_in_file.sh new file mode 100755 index 0000000..cf7ad32 --- /dev/null +++ b/line_in_file.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -v +set -e + +LINE=$1 +FILE=$2 +DETECT=${3:-$LINE} + +if [[ -z $(grep "$DETECT" "$FILE") ]]; then + echo "Line not found in $FILE" + echo "$LINE" >> "$FILE" +else + echo "Line already exists in $FILE" +fi diff --git a/system/weston.service b/system/weston.service deleted file mode 100644 index 30c58e7..0000000 --- a/system/weston.service +++ /dev/null @@ -1,23 +0,0 @@ -[Unit] -Description=Weston, a Wayland compositor, as a user service - -# Activate using a systemd socket -Requires=weston.socket -After=weston.socket - -# Since we are part of the graphical session, make sure we are started before -Before=graphical-session.target - -[Service] -Type=notify -TimeoutStartSec=60 -WatchdogSec=20 -# Defaults to journal -#StandardOutput=journal -StandardError=journal - -# add a ~/.config/weston.ini and weston will pick-it up -ExecStart=/usr/bin/weston --modules=systemd-notify.so --shell=kiosk-shell.so --xwayland -- kitty --hold make -C /opt/forge-invar run - -[Install] -WantedBy=graphical-session.target diff --git a/system/weston.socket b/system/weston.socket deleted file mode 100644 index 826bcb1..0000000 --- a/system/weston.socket +++ /dev/null @@ -1,5 +0,0 @@ -[Unit] -Description=Weston, a Wayland compositor - -[Socket] -ListenStream=%t/wayland-0