mirror of
https://github.com/commaai/agnos-builder.git
synced 2026-10-01 03:43:49 +08:00
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
After=local-fs.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=comma
|
||||
ExecStart=/usr/comma/debug.py
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -10,6 +10,7 @@ systemctl enable cdsprpcd
|
||||
systemctl enable fs_setup.service
|
||||
systemctl enable serial-hostname.service
|
||||
systemctl enable comma.service
|
||||
systemctl enable agnos-debug.service
|
||||
systemctl enable gpio.service
|
||||
systemctl enable lte.service
|
||||
systemctl enable sound.service
|
||||
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path("/cache/debug/")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
boots = sorted(list(ROOT.iterdir()), key=lambda p: int(p.stem, 16), reverse=True)
|
||||
|
||||
# limit to 100 boots
|
||||
for d in boots[100:]:
|
||||
print("cleaning up", d)
|
||||
shutil.rmtree(d)
|
||||
|
||||
# make a directory for this boot
|
||||
n = 0
|
||||
if len(boots):
|
||||
n = int(boots[0].stem, 16) + 1
|
||||
boot_dir = ROOT / f"{n:08x}"
|
||||
boot_dir.mkdir(parents=True)
|
||||
|
||||
# log some stuff
|
||||
pstore = boot_dir / "pstore"
|
||||
pstore.mkdir()
|
||||
os.system(f"cp /sys/fs/pstore/* {pstore} 2>/dev/null")
|
||||
|
||||
os.system(f"uname -a > {boot_dir / 'uname'}")
|
||||
shutil.copyfile("/VERSION", boot_dir / "VERSION")
|
||||
|
||||
@@ -24,6 +24,9 @@ touch /data/etc/localtime
|
||||
mkdir -p /data/etc/netplan
|
||||
mkdir -p /data/etc/NetworkManager/system-connections
|
||||
|
||||
# /cache
|
||||
chown -R comma:comma /cache/
|
||||
|
||||
# /data/ssh
|
||||
mkdir -p /data/ssh
|
||||
chown comma: /data/ssh
|
||||
|
||||
Reference in New Issue
Block a user