Make clean-clone OS rebuilds autonomous
A fresh clone can now bootstrap a complete armv7 rootfs, apply the Bananarchy overlay, regenerate boot artifacts, and produce a flashable image without local build artifacts. - Add a shared package list and Docker-based rootfs bootstrap, wired into rebuild-image.sh and chroot-shell.sh. - Add offline rebuild preflight checks and prebuilt-to-overlay artifact synchronization. - Vendor the patched EDL client and provision host flashing dependencies. - Remove the hardcoded credential from the power menu helper. - Refresh documentation and changelog for the autonomous workflow.
This commit is contained in:
1 parent
a9b72700ac
commit
0ab9367e28
31 files changed
+3809
-181
No files matched your search
@@ -13,64 +13,16 @@ usage() {
|
||||
|
||||
run_polkit_login1() {
|
||||
method="$1"
|
||||
python3 - "$method" <<'PYEOF' >/dev/null 2>&1
|
||||
import os, pty, select, sys, time
|
||||
method = sys.argv[1]
|
||||
ppid = os.getpid()
|
||||
if method == "Reboot":
|
||||
acts = [
|
||||
"org.freedesktop.login1.reboot",
|
||||
"org.freedesktop.login1.reboot-multiple-sessions",
|
||||
"org.freedesktop.login1.reboot-ignore-inhibit",
|
||||
]
|
||||
else:
|
||||
acts = [
|
||||
"org.freedesktop.login1.power-off",
|
||||
"org.freedesktop.login1.power-off-multiple-sessions",
|
||||
"org.freedesktop.login1.power-off-ignore-inhibit",
|
||||
]
|
||||
for act in acts:
|
||||
cmd = (
|
||||
f"pkttyagent --process {ppid} & AG=$!; sleep 0.25; "
|
||||
f"pkcheck --action-id {act} --process {ppid} -u >/dev/null 2>&1; "
|
||||
f"RC=$?; kill $AG 2>/dev/null || true; exit $RC"
|
||||
)
|
||||
pid, fd = pty.fork()
|
||||
if pid == 0:
|
||||
os.execlp("sh", "sh", "-c", cmd)
|
||||
t0 = time.time()
|
||||
buf = b""
|
||||
while time.time() - t0 < 5.0:
|
||||
r, _, _ = select.select([fd], [], [], 0.2)
|
||||
if r:
|
||||
try:
|
||||
d = os.read(fd, 1024)
|
||||
if not d:
|
||||
break
|
||||
buf += d
|
||||
if b"assword:" in buf or b"password:" in buf.lower():
|
||||
buf = b""
|
||||
os.write(fd, b"147147\n")
|
||||
except OSError:
|
||||
break
|
||||
try:
|
||||
os.close(fd)
|
||||
except OSError:
|
||||
pass
|
||||
os.waitpid(pid, 0)
|
||||
os.execlp(
|
||||
"busctl",
|
||||
"busctl",
|
||||
"call",
|
||||
"--allow-interactive-authorization=true",
|
||||
"org.freedesktop.login1",
|
||||
"/org/freedesktop/login1",
|
||||
"org.freedesktop.login1.Manager",
|
||||
method,
|
||||
"b",
|
||||
"true",
|
||||
)
|
||||
PYEOF
|
||||
# Let the session's own polkit agent handle authorization. Never feed a
|
||||
# hardcoded password: the doas/sudo rules above cover unattended power
|
||||
# actions, and a real agent prompt is used when interactive auth is needed.
|
||||
busctl call \
|
||||
--allow-interactive-authorization=true \
|
||||
org.freedesktop.login1 \
|
||||
/org/freedesktop/login1 \
|
||||
org.freedesktop.login1.Manager \
|
||||
"$method" \
|
||||
b true >/dev/null 2>&1
|
||||
}
|
||||
|
||||
run_priv_power() {
|
||||
|
||||
Reference in new issue
Block a user