Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toltec-base: Disable [email protected] #806

Merged
merged 10 commits into from
Jan 13, 2024
29 changes: 21 additions & 8 deletions package/toltec-base/package
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
# Copyright (c) 2021 The Toltec Contributors
# Copyright (c) 2023 The Toltec Contributors
# SPDX-License-Identifier: MIT

archs=(rm1 rm2)
pkgnames=(toltec-base)
pkgdesc="Metapackage defining the base set of packages in a Toltec install"
url=https://toltec-dev.org/
pkgver=1.2-3
timestamp=2023-05-08T19:31Z
pkgver=1.3-1
timestamp=2023-12-27T08:30Z
section="utils"
maintainer="Eeems <[email protected]>"
license=MIT
Expand All @@ -31,20 +31,33 @@ configure() {
/opt/etc/profile
echo "Disabling automatic update"
disable-unit update-engine.service
if [[ "$arch" == "rm1" ]] && ! is-masked sys-subsystem-net-devices-usb1.device; then
if [[ "$arch" == "rm1" ]]; then
echo "Disabling usb1 network device to avoid long boots"
systemctl mask sys-subsystem-net-devices-usb1.device
elif [[ "$arch" == "rm2" ]] && is-masked sys-subsystem-net-devices-usb1.device; then
if ! is-masked sys-subsystem-net-devices-usb1.device; then
systemctl mask sys-subsystem-net-devices-usb1.device
fi
if ! is-masked [email protected]; then
systemctl mask [email protected]
fi
elif [[ "$arch" == "rm2" ]]; then
echo "Enabling usb1 network device to ensure usb SSH works"
systemctl unmask sys-subsystem-net-devices-usb1.device
if is-masked sys-subsystem-net-devices-usb1.device; then
systemctl unmask sys-subsystem-net-devices-usb1.device
fi
if is-masked [email protected]; then
systemctl unmask [email protected]
fi
fi
}

postremove() {
if is-masked sys-subsystem-net-devices-usb1.device; then
systemctl unmask sys-subsystem-net-devices-usb1.device
fi
if ! is-enabled "update-engine.service"; then
if is-masked [email protected]; then
systemctl unmask [email protected]
fi
if ! is-enabled update-engine.service; then
systemctl enable update-engine
fi
}