mirror of
https://github.com/commaai/agnos-builder.git
synced 2026-09-29 10:53:51 +08:00
ensure comma service always run (#136)
* set time * copy * enable * wait for weston * cleanup --------- Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
@@ -11,18 +11,17 @@ fi
|
||||
|
||||
sudo mount -o rw,remount /
|
||||
|
||||
# symlink /usr/comma/
|
||||
echo "symlink /usr/comma"
|
||||
sudo rm -rf /usr/comma
|
||||
sudo ln -snf $ROOT/userspace/usr/comma/ /usr/comma
|
||||
|
||||
# symlink services
|
||||
echo "symlink systemd services"
|
||||
echo "cp systemd services"
|
||||
for s in $(ls $ROOT/userspace/files/*.service); do
|
||||
service=$(basename $s)
|
||||
echo "- $service"
|
||||
sudo rm -f /lib/systemd/system/$service
|
||||
sudo ln -sf $ROOT/userspace/files/*.service /lib/systemd/system/
|
||||
sudo cp $ROOT/userspace/files/$service /lib/systemd/system/
|
||||
done
|
||||
sudo $ROOT/userspace/services.sh
|
||||
|
||||
sudo mount -o ro,remount /
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
[Unit]
|
||||
After=weston-ready.service gpio.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/local/pyenv/shims/python -u /usr/comma/set_time.py
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -3,6 +3,7 @@ PartOf=weston.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
Restart=no
|
||||
Environment="XDG_RUNTIME_DIR=/var/tmp/weston"
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ systemctl enable ssh-param-watcher.path
|
||||
systemctl enable ssh-param-watcher.service
|
||||
systemctl enable home.mount
|
||||
systemctl enable logrotate-hourly.timer
|
||||
systemctl enable set_time.service
|
||||
|
||||
# Disable some of our services
|
||||
systemctl disable serial-hostname.service
|
||||
|
||||
@@ -8,6 +8,20 @@ CONTINUE="/data/continue.sh"
|
||||
INSTALLER="/tmp/installer"
|
||||
RESET_TRIGGER="/data/__system_reset__"
|
||||
|
||||
echo "waiting for weston"
|
||||
for i in {1..200}; do
|
||||
if systemctl is-active --quiet weston-ready; then
|
||||
break
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
if systemctl is-active --quiet weston-ready; then
|
||||
echo "weston ready after ${SECONDS}s"
|
||||
else
|
||||
echo "timed out waiting for weston, ${SECONDS}s"
|
||||
fi
|
||||
|
||||
sudo chown comma: /data
|
||||
sudo chown comma: /data/media
|
||||
|
||||
@@ -47,10 +61,6 @@ fi
|
||||
mkdir -p /data/tmp/vscode-server
|
||||
ln -s /data/tmp/vscode-server ~/.vscode-server
|
||||
|
||||
# set time from panda
|
||||
# sudo because udev isn't ready yet
|
||||
sudo $(which python3) /usr/comma/set_time.py
|
||||
|
||||
|
||||
while true; do
|
||||
pkill -f "$SETUP"
|
||||
|
||||
Reference in New Issue
Block a user