interplane.Get Omega
Read in your language

omega-gpu-driver

aien-dev/omega-gpu-driver

Brought by drakestapleton

branch main Branches Tags History

omega-gpu-driver / window / d2-boot.sh

22 lines · 999 bytes Raw Blame History
1#!/bin/sh
2# window/d2-boot.sh -- run once per boot by aien-owndriver-window.service. Status: NOT_RUN.
3# state "run D2" / "run D3": the reboot from W1 has happened; run window/d2-run.sh --go STAGE.
4# state "restore": the reboot from W7 (or a fallback) has happened; run window/d2-restore.sh --go.
5# no state: nothing pending: remove the unit (a leftover unit must never act twice).
6set -eu
7R=$(CDPATH= cd -- "$(dirname "$0")/.." && pwd)
8. "$R/window/common.sh"
9LOG=$LOGDIR/d2-$(date -u +%Y%m%dT%H%M%SZ)-boot.log
10s=$(cat "$STATE" 2>/dev/null || true)
11log "boot unit: state '$s'"
12case $s in
13"run W0" | "run D2" | "run D3") exec sh "$R/window/d2-run.sh" --go "${s#run }" ;;
14"restore W0") exec sh "$R/window/d2-restore.sh" --go W0 ;;
15restore) exec sh "$R/window/d2-restore.sh" --go ;;
16*)
17 sudo -n systemctl disable aien-owndriver-window.service >/dev/null 2>&1 || true
18 sudo -n rm -f "$UNIT"
19 sudo -n systemctl daemon-reload
20 log "no pending step: unit removed"
21 ;;
22esac