Device-specific Tweaks Management Service (Tweakster)
GSoC 2025 Project Proposal
Name and Contact Information
- Name: Mohammed Eldegwi
Email: mohammedeldegwi@gmail.com
- Matrix: @mrdigo:matrix.org
- Time_Zone: UTC+2
About Me
I am a computer engineering student with a strong passion for low-level and systems programming. My technical interests focus on operating systems, embedded systems, and the Linux ecosystem.
Project Title
Device-specific Tweaks Management Service (Tweakster)
Synopsis
Problem Description
As the number of non-x86 Linux-capable devices grows rapidly (especially ARM64 laptops, phones, and tablets), the current approach of providing device-specific Debian packages for configuration tweaks doesn't scale efficiently. This project aims to develop a flexible tweaks management service called "Tweakster" that will identify the device it's running on, select the appropriate tweaks based on configuration files, and dynamically install them to the system. This solution will unify device detection, streamline configuration deployment, and ultimately ease support for new devices in Debian.
Problem Analysis
The current state of device-specific tweaks in Debian follows a static packaging model that presents some challenges:
Scalability Issues: Each new device requires a new Debian package, leading to an unhandleable number of packages as more devices are supported.
Maintenance Burden: Updates need to be propagated across multiple packages, increasing maintenance workload.
Generic Image Limitations: The previous two issues are slowdowning creating a universally deployable system image for all devices.
Project Impact and Benefits to Debian
Short-term Benefits
More Device Support: New devices can be supported with just configuration changes rather than new packages.
Reduced Package Duplication: Common tweaks can be shared across devices.
Long-term Benefits
Scalability: Support for hundreds of devices without package explosion.
Generic Image Viability: A single system image can adapt to multiple devices(good step towards Debian universal system philosophy).
Upstream Integration: Potential for upstream developers to Debian's device handling infrastructure.
Note:
- I am committed to completing this project from its current state until it make to testing (eventually stable!), even if certain aspects extend beyond the GSoC timeline.
Detailed Technical Approach
Proposed Architecture
Tweakster will follow a service-based approach with these key components:
Device Identification
- Hardware detection using device tree
- Mapping detected hardware to device profiles
Tweaks Selection
- Checking the config and internally lists all needed tweaks
- Coping those tweaks to temporary file.
- Arrange those tweaks in an approperiate order
- Conflict resolution for overlapping tweaks
Package Generation
- Dynamicly creating debian/ directory
- Taking benifit of debhelper functionality for near automatic service management
- Proper handling of various tweak types (udev rules, systemd services, gsettings, etc.)
- Handeling corner cases that debhelper cannot handle yet.
Installation and Verification
- Package building via dpkg-buildpackage
- Safe installation of generated package
Implementation Strategy
The service will be developed in Rust, building upon the existing Tweakster prototype. The implementation will follow these phases:
Device Detection
Relying on current detection routine as it works well enough for ?DeviceTree-based devices
Configuration System Improvement
- Extend the existing TOML configuration format to support inheritance and overrides
- Implement validation for configuration files
Package Generation
- Create a temporary directory, coping prepared tweaks in this folder, create debian/ directory
- Integrate with debhelper tools programmatically and benifit form its automation for different tweak types (systemd, udev, gsettings, etc.)
- Write domain-specific code for more specialized tweaks that out of debhelper scope
System Integration
- Design it as a systemd service that runs on first boot (as for now, this could be changed)
- Secure package installation process to make sure successful installation
Technical Challenges and Solutions
Challenge : Dynamic Package Generation (Critical Part) Creating proper Debian package at runtime requires careful handling of packaging conventions.
Solution:
- Use debhelper to handle tweaks within its functionality automatically (e.g. udev, uboot, initramfs, etc.)
- Write a domian-specific code for debian/ directory to handle corner cases
Current State and Related Work
Existing Implementations
I've analyzed several repositories that currently manage device-specific tweaks:
DebianOnMobile/mobile-tweaks: Contains general mobile-oriented tweaks.
Mobian/mobian-tweaks: Base mobile adaptations for the Mobian distribution.
Mobian/devices/*: Device-specific packages for ?PinePhone, ?PineTab, and Librem 5.
These repositories follow different approaches but share common patterns:
GSettings Overrides: Modifying application behavior for mobile form factors
Systemd Configuration: Adjusting power management and service behavior
Udev Rules: Providing hardware access and configuration
Environment Variables: Setting up proper graphics support
Prototype Analysis
I've also analyzed the existing Tweakster prototype and found it provides a solid foundation:
- Written in Rust with a modular architecture
- Supports Device-tree based device detection and configuration parsing
- Includes modules for handling different types of tweaks (systemd, udev, etc.)
- Uses a TOML-based configuration system
However, it currently lacks:
- Dynamic package generation capabilities
- Integration with the Debian packaging system
Deliverables
Tweakster Service
- Dynamic package generation and installation
- Wide error handling and logging
Documentation
- Technical design document
- Manual for how Tweakster work(If needed)
Initial Tweaks Repository
- Refactored existing tweaks for compatibility with the new service at least for one device
Project Timeline & Workflow
Phase 1: Research and Design (Weeks 1-2)
- Deep dive into existing tweaks packages structure (already done)
- Experiment with debhelper, dpkg-buildpackage, lintian, dch, ...etc tools and package generation (done)
- Discuss possible designs that fits the vision, the architecture, and data structures (done)
- Discuss detailed technical specifications (done)
- Set up development environment (done)
Phase 2: Core Implementation (Weeks 3-6)
- Create tweaks management framwork (continue the work form its current phase where tweaks are parsed, in right format, and ready)
- Develop package generation system
Phase 3: Integration and Testing (Weeks 7-9)
- Integrate components into a cohesive service
- Set up logging and error handling
- Write test cases
Phase 4: Refinement, Documentation & Final Submission (Weeks 10-12)
- Enhance error handling (if needed)
- Optimize Performance (if needed)
- Write documentation
- Package Tweakster for mobian (make it meet debian standards as possible)
- Packaging of this service and tweaks data/configuration for at least one device
Communication Plan
- Regular updates via Matrix
- Biweekly public progress reports
Why Debian
I've always wondered how things work internally inside my computer, how each component communicate with other components and alot other questions. Those questions by time got answered one by one when first time I interacted with my first Debian based ditro (Ubuntu). i got fascinated with how brilliant with how each single unit i learned of align perfectly with the entire system. so decided i want to contribute to the source itself, contributing to Debian means: answering my remain question, deepen my graps of how the system interacts both as units and whole, and helping improving debian would help improve debian user experience and my experince itself, since i become a debian user. The project's commitment to free software, and technical excellence aligns perfectly with my values as a developer.
This project specifically interests me because it addresses real challenges in adapting software for diverse hardware, connecting alot of areas such as hardware and system level software an area where my interest in systems programming can be meaningfully improve.
My Skills and Relevant Experience
Technical Skills
Languages: C/C++, Shell scripting, Rust (Willing to learn)
Systems Programming: Familiar with Linux kernel interfaces, system services
Package Management: Familiar with Debian packaging system and tools (as learned as part of preparation to this project)
Learning Experience
I've prepared for this project by:
- Analyzing the current tweaks packages in Mobian and Debian
- Setting up a development environment with LXC container on Debian Bookworm
- Experimenting with Debian packaging tools and debhelper (need more deep study to understand its current limitations)
- Reviewing the existing Tweakster prototype codebase
Other Commitments
During the period 20 May - 3 June, I will have my final exams, so my productivity will be reduced during that period. However, I plan to cover that shortage before and after the exams. After the academic semester is finished, I will be able to dedicate 35-40 hours per week to this project. I have no other major commitments (as of the time I write this proposal; if there are any changes, I will present it)
I recognize that open-source development requires consistent effort and communication, and I am fully prepared to maintain this level of engagement throughout the entire process.
