From cd74a06f6819fa7ae2985f35811f92eb487b834b Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sun, 13 Sep 2026 12:36:53 -0700 Subject: [PATCH] Skip apt hooks outside a running system Port 4c9b44b0 from master, adapted to the stable layout. --- userspace/usr/comma/apt_setup.sh | 5 +++++ userspace/usr/comma/apt_teardown.sh | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/userspace/usr/comma/apt_setup.sh b/userspace/usr/comma/apt_setup.sh index 75e3b60..21bacde 100755 --- a/userspace/usr/comma/apt_setup.sh +++ b/userspace/usr/comma/apt_setup.sh @@ -1,5 +1,10 @@ #!/bin/bash -e +# Skip unless this is a booted systemd system. +if [ ! -d /run/systemd/system ]; then + exit 0 +fi + sudo mount -o rw,remount / sudo resize2fs $(findmnt -n -o SOURCE /) &>/dev/null || sudo resize2fs $(findmnt -n -o SOURCE /) sudo mount -o remount,size=1500M /var diff --git a/userspace/usr/comma/apt_teardown.sh b/userspace/usr/comma/apt_teardown.sh index 76cf4fe..57f3128 100755 --- a/userspace/usr/comma/apt_teardown.sh +++ b/userspace/usr/comma/apt_teardown.sh @@ -1,3 +1,8 @@ #!/bin/bash +# Skip unless this is a booted systemd system. +if [ ! -d /run/systemd/system ]; then + exit 0 +fi + sudo mount -o ro,remount / || true