various improvements and fixes

This commit is contained in:
2026-10-27 06:30:58 -06:00
parent 72a33d7320
commit 44c67c980f
10 changed files with 83 additions and 45 deletions
+30 -20
View File
@@ -24,13 +24,13 @@ cd
# Exit on any error
set -e
# Ask for sudo password upfront so subsequent sudo calls don't prompt mid-install
# Ask for the password once, then keep sudo's cached credentials fresh until
# the install exits, so long builds don't stop for a password again. Unlike a
# passwordless sudoers entry, nothing is left behind if the install is killed.
sudo -v
# Grant passwordless sudo for the duration of the install, revoke on exit
echo "$USER ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/99-hampack-install > /dev/null
sudo chmod 440 /etc/sudoers.d/99-hampack-install
trap "sudo rm -f /etc/sudoers.d/99-hampack-install" EXIT
while kill -0 $$ 2> /dev/null; do sudo -n -v; sleep 60; done 2> /dev/null &
SUDO_KEEPALIVE_PID=$!
trap 'kill "$SUDO_KEEPALIVE_PID" 2> /dev/null' EXIT
# Ensure git is available before attempting to clone anything
if ! command -v git &> /dev/null; then
@@ -45,7 +45,7 @@ echo "Getting the latest version of CoreDesktop..."
if [ -d "$HOME/.local/share/coredesktop/.git" ]; then
git -C ~/.local/share/coredesktop pull
else
git clone https://gitea.federated.computer/david/coredesktop.git ~/.local/share/coredesktop
git clone https://gitea.federated.computer/Federated_Computer/coredesktop.git ~/.local/share/coredesktop
fi
cd ~/.local/share/coredesktop
@@ -155,11 +155,6 @@ bash claude.sh
echo "Setting up sandboxed AI agents..."
bash ~/.local/share/coredesktop/sandbox/setup.sh
# Install Migrate Backup System
curl -L -o migrate https://github.com/CyphrRiot/Migrate/raw/main/bin/migrate
chmod +x migrate
mv migrate ~/.local/bin/
# Configure Bitwarden SSH agent
echo "Configuring Bitwarden SSH agent..."
. bitwarden.sh
@@ -216,12 +211,27 @@ fi
echo "Running migrations..."
run_migrations
# Check whether the running kernel matches the installed modules — if not, a
# newer kernel was installed during this run and a reboot is required
if ! ls /usr/lib/modules/$(uname -r) > /dev/null 2>&1; then
echo "A newer kernel has been installed. Please reboot when convenient."
else
echo "Kernel is up to date, no reboot needed. You may want to consider a reboot if other significant software was updated or installed."
fi
CONFIGURE_HINT="configure connects to your Federated Computer Core, sets up backups and signs you in to the AI agents."
echo "To connect to your Federated Computer Core and sign in to the AI agents, run: configure"
# If the running kernel's modules are gone, a newer kernel was installed during
# this run. configure waits for the reboot: until then, modules it needs, such
# as Tailscale's tun and davfs2's fuse, can't be loaded.
if [ ! -d "/usr/lib/modules/$(uname -r)" ]; then
echo "A newer kernel has been installed. Reboot, then run: configure"
echo "$CONFIGURE_HINT"
exit 0
fi
echo "Kernel is up to date, no reboot needed. You may want to consider a reboot if other significant software was updated or installed."
# Offer configure only if something is still to do, as refresh runs this too.
# This script is usually piped into bash, so ask on the terminal, not stdin.
if ~/.local/bin/configure --list | grep -q '^to do'; then
echo
echo "$CONFIGURE_HINT"
if { : < /dev/tty; } 2> /dev/null && read -rp "Run configure now? [Y/n] " answer < /dev/tty \
&& [[ "$answer" != [nN]* ]]; then
~/.local/bin/configure < /dev/tty || true
else
echo "To do it later, run: configure"
fi
fi