deb-bootupd/debian/postinst
robojerk 73b43239e9
Some checks failed
Build deb-bootupd Artifacts / build (push) Failing after 6m14s
Simple Build and Upload / build (push) Failing after 2m0s
Add Debian packaging and update Forgejo workflow
- Add complete Debian packaging configuration (debian/ directory)
- Create build-deb.sh script for building packages
- Update Forgejo workflow to build and upload .deb artifacts
- Add comprehensive version naming for both binary and Debian artifacts
- Update .gitignore to exclude build artifacts and packaging files
- Add PACKAGING.md documentation
- Add test-deb.sh for testing package installation
2025-08-10 11:30:19 -07:00

34 lines
1 KiB
Bash
Executable file

#!/bin/sh
set -e
# Post-installation script for deb-bootupd
# This script runs after the package is installed
# Reload systemd to pick up new service files
if command -v systemctl >/dev/null 2>&1; then
deb-systemd-invoke daemon-reload >/dev/null 2>&1 || true
fi
# Note: bootloader-update.service is NOT a daemon - it's a oneshot service
# that runs bootupctl update when triggered, then exits
# The service is enabled by default but only runs when explicitly triggered
# Create initial bootupd state directory if it doesn't exist
if [ ! -d /boot ]; then
mkdir -p /boot
fi
# Set proper permissions for the binary
if [ -f /usr/libexec/bootupd ]; then
chmod 755 /usr/libexec/bootupd
fi
# Verify symlink was created correctly
if [ ! -L /usr/bin/bootupctl ]; then
ln -sf ../libexec/bootupd /usr/bin/bootupctl
fi
echo "deb-bootupd installed successfully!"
echo "Use 'bootupctl status' to check system status"
echo "Use 'bootupctl update' to update bootloaders"
echo "Note: bootupd is a CLI tool, not a daemon - it runs when called and exits"