From 5411decb00775743a1e6deb7d5dadab67bb278d4 Mon Sep 17 00:00:00 2001
From: Ayush Singh <ayush@beagleboard.org>
Date: Thu, 16 Jan 2025 13:09:38 +0530
Subject: [PATCH] docs: Add documentation regarding bb-imager-service

- Just packaging and basic readme.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
---
 PACKAGING.md                | 16 +++++++++++++++-
 README.md                   |  2 +-
 bb-imager-service/README.md | 14 ++++++++++++++
 3 files changed, 30 insertions(+), 2 deletions(-)
 create mode 100644 bb-imager-service/README.md

diff --git a/PACKAGING.md b/PACKAGING.md
index 5982b71..0a92715 100644
--- a/PACKAGING.md
+++ b/PACKAGING.md
@@ -49,6 +49,12 @@ make package-cli-linux-deb-{target}
 make package-gui-linux-deb-{target}
 ```
 
+- Service
+
+```
+make package-service-linux-deb-{target}
+```
+
 Where `target` is the platform you are building for. Currently, the following targets have been tested:
 - x86_64-unknown-linux-gnu
 - aarch64-unknown-linux-gnu
@@ -73,12 +79,20 @@ For different host/target pair, see [Cross Compilation](#cross-compilation)
 
 ## Linux Generic
 
-Just a tarball of everything. Useful for creating packages that need to be maintained out of tree. Only supported for CLI for now.
+Just a tarball of everything. Useful for creating packages that need to be maintained out of tree.
+
+- CLI
 
 ```
 make package-cli-linux-xz-{target}
 ```
 
+- Service
+
+```
+make package-service-linux-xz-{target}
+```
+
 Where `target` is the platform you are building for. Currently, the following targets have been tested:
 - x86_64-unknown-linux-gnu
 - aarch64-unknown-linux-gnu
diff --git a/README.md b/README.md
index 87025b3..98852fd 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ A Rust rewrite of [bb-imager](https://openbeagle.org/beagleboard/bb-imager) with
 # Run
 
 ```shell
-cargo run --package gui --release
+cargo run --package bb-imager-gui --release
 ```
 
 # Configuration
diff --git a/bb-imager-service/README.md b/bb-imager-service/README.md
new file mode 100644
index 0000000..ba33b21
--- /dev/null
+++ b/bb-imager-service/README.md
@@ -0,0 +1,14 @@
+# Introduction
+
+A D-BUS service that allows to perform firmware upgrade for BeagleBoard devices (specifically Pocketbeagle2 MSPM0), from userspace applications (GUI).
+
+This is needed because there is no existing D-BUS service (like UDisk2) to open root sysfs entries as a non root user/application. Additionally, it seems most distributions heavily discourage use of `pkexec` since [CVE-2021-4034](https://blog.qualys.com/vulnerabilities-threat-research/2022/01/25/pwnkit-local-privilege-escalation-vulnerability-discovered-in-polkits-pkexec-cve-2021-4034).
+
+It uses polkit to verify if the application has necessary permissions to perform firmware upgrade.
+
+## Dependencies
+
+- polkit
+- systemd
+
+It is possible to make things work without systemd, but it is not officially supported right now.
-- 
GitLab