weston init cleanup (#117)

* weston: remove display re-init

* test

* init both

* increase

* another try

* move that

* test service

* little more

* bump kernel

* fix that
This commit is contained in:
Adeeb Shihadeh
2023-02-25 22:24:49 -08:00
committed by GitHub
parent b167fe3748
commit 2ffb16f7b8
10 changed files with 101 additions and 32 deletions
-9
View File
@@ -8,18 +8,9 @@ CONTINUE="/data/continue.sh"
INSTALLER="/tmp/installer"
RESET_TRIGGER="/data/__system_reset__"
echo "Waiting for wayland"
while [ ! -e "$XDG_RUNTIME_DIR/wayland-0" ]; do sleep 0.1; done
sleep 0.5 # weston's still starting after the socket's created
echo "wayland ready"
sudo chmod -R 770 $XDG_RUNTIME_DIR
sudo chown comma: /data
sudo chown comma: /data/media
sudo su -c "echo 500 > /sys/devices/platform/soc/ae00000.qcom,mdss_mdp/backlight/panel0-backlight/brightness"
handle_setup_keys () {
# install default SSH key while still in setup
if [[ ! -e /data/params/d/GithubSshKeys && ! -e /data/continue.sh ]]; then
-1
View File
@@ -1,7 +1,6 @@
#!/usr/bin/env python3
import json
import time
import pytest
import subprocess
def run(cmd):
+40
View File
@@ -0,0 +1,40 @@
#!/usr/bin/env python3
import os
import time
import hashlib
import subprocess
if __name__ == "__main__":
socket_exists = os.path.exists("/var/tmp/weston/wayland-0")
is_active = subprocess.check_output("systemctl is-active weston", shell=True, encoding='utf8').strip()
d = b""
for fn in ('/lib/systemd/system/weston.service', '/lib/systemd/system/weston-ready.service'):
with open(fn, 'rb') as f:
d += f.read()
h = hashlib.sha1(d).hexdigest()
# weston should be ready to go at this point
proc = subprocess.Popen('/usr/comma/setup', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for i in range(10):
r = proc.poll()
if r is not None:
break
time.sleep(1)
rc = proc.returncode
proc.kill()
out, err = proc.stdout.read(), proc.stderr.read()
with open('/data/weston_log', 'a') as f:
f.write(f"{is_active=}, {socket_exists=}, app={rc} / {h}\n")
if rc is not None:
f.write(f" stdout: {out}\n")
f.write(f" stderr: {err}\n")
os.sync()
os.system("sudo su -c 'tail /data/weston_log > /dev/console'")
os.system("sudo su -c 'wc -l /data/weston_log > /dev/console'")
time.sleep(2)
os.system("sudo reboot")