- Add docs/README.md with project overview and current status - Add docs/architecture.md with detailed architecture documentation - Add docs/development.md with development guide for contributors - Update .notes/todo.md to reflect architecture fix completion - Update .notes/plan.md with completed phases and next priorities Architecture fixes (daemon and dbus), bubblewrap integration are now complete. Ready for OCI integration phase.
105 lines
No EOL
3.3 KiB
Bash
105 lines
No EOL
3.3 KiB
Bash
#!/bin/bash
|
|
# apt-ostree Installation Only
|
|
# This script installs the already-built binaries
|
|
|
|
set -e
|
|
|
|
echo "=== apt-ostree Installation ==="
|
|
echo
|
|
|
|
echo "=== PHASE 1: VERIFYING BUILD ==="
|
|
|
|
echo "1. Checking if binaries exist..."
|
|
if [[ ! -f "target/release/apt-ostreed" ]] || [[ ! -f "target/release/apt-ostree" ]]; then
|
|
echo "ERROR: Binaries not found. Please run 'cargo build --release' first."
|
|
exit 1
|
|
fi
|
|
|
|
echo "✓ Binaries found"
|
|
|
|
echo
|
|
echo "=== PHASE 2: INSTALLING AS ROOT ==="
|
|
|
|
echo "2. Checking if running as root..."
|
|
if [[ $EUID -ne 0 ]]; then
|
|
echo "This script must be run as root for installation"
|
|
echo "Please run: sudo ./install-only.sh"
|
|
exit 1
|
|
fi
|
|
|
|
echo "3. Installing binaries..."
|
|
cp target/release/apt-ostreed /usr/libexec/
|
|
cp target/release/apt-ostree /usr/bin/
|
|
chmod +x /usr/libexec/apt-ostreed /usr/bin/apt-ostree
|
|
|
|
echo "4. Installing service files..."
|
|
cp src/daemon/apt-ostreed.service /etc/systemd/system/
|
|
cp src/daemon/apt-ostree-bootstatus.service /etc/systemd/system/
|
|
cp src/daemon/apt-ostree-countme.service /etc/systemd/system/
|
|
cp src/daemon/apt-ostree-countme.timer /etc/systemd/system/
|
|
cp src/daemon/apt-ostreed-automatic.service /etc/systemd/system/
|
|
cp src/daemon/apt-ostreed-automatic.timer /etc/systemd/system/
|
|
|
|
echo "5. Installing D-Bus files..."
|
|
cp src/daemon/org.aptostree.dev.conf /etc/dbus-1/system.d/
|
|
cp src/daemon/org.aptostree.dev.service /usr/share/dbus-1/system-services/
|
|
|
|
echo "6. Installing Polkit policy..."
|
|
cp src/daemon/org.aptostree.dev.policy /usr/share/polkit-1/actions/
|
|
|
|
echo "7. Installing configuration..."
|
|
mkdir -p /etc/apt-ostree
|
|
cp src/daemon/apt-ostreed.conf /etc/apt-ostree/
|
|
|
|
echo "8. Setting correct permissions..."
|
|
chmod 644 /etc/dbus-1/system.d/org.aptostree.dev.conf
|
|
chmod 644 /usr/share/dbus-1/system-services/org.aptostree.dev.service
|
|
chmod 644 /usr/share/polkit-1/actions/org.aptostree.dev.policy
|
|
chmod 644 /etc/apt-ostree/apt-ostreed.conf
|
|
|
|
echo "=== PHASE 3: ENABLING AND STARTING SERVICES ==="
|
|
|
|
echo "9. Reloading systemd and D-Bus..."
|
|
systemctl daemon-reload
|
|
systemctl reload dbus
|
|
|
|
echo "10. Enabling services..."
|
|
systemctl enable apt-ostreed.service
|
|
systemctl enable apt-ostree-bootstatus.service
|
|
systemctl enable apt-ostree-countme.timer
|
|
systemctl enable apt-ostreed-automatic.timer
|
|
|
|
echo "11. Starting main daemon..."
|
|
systemctl start apt-ostreed.service
|
|
|
|
echo "12. Waiting for daemon to start..."
|
|
sleep 3
|
|
|
|
echo "=== PHASE 4: VERIFICATION ==="
|
|
|
|
echo "13. Checking daemon status..."
|
|
if systemctl is-active --quiet apt-ostreed.service; then
|
|
echo "✓ Daemon is running"
|
|
else
|
|
echo "✗ Daemon failed to start"
|
|
systemctl status apt-ostreed.service --no-pager
|
|
exit 1
|
|
fi
|
|
|
|
echo "14. Testing D-Bus communication..."
|
|
echo "Testing introspection:"
|
|
gdbus introspect --system --dest org.aptostree.dev --object-path /org/aptostree/dev/Daemon 2>&1 || echo "Introspection failed"
|
|
|
|
echo "Testing ping:"
|
|
gdbus call --system --dest org.aptostree.dev --object-path /org/aptostree/dev/Daemon --method org.aptostree.dev.Daemon.ping 2>&1 || echo "Ping failed"
|
|
|
|
echo "15. Testing client-daemon communication..."
|
|
echo "Testing client ping:"
|
|
apt-ostree daemon-ping || echo "Client ping failed"
|
|
|
|
echo "Testing client status:"
|
|
apt-ostree daemon-status || echo "Client status failed"
|
|
|
|
echo
|
|
echo "=== INSTALLATION COMPLETE ==="
|
|
echo "apt-ostree has been successfully installed and is ready to use!" |