Merged
Conversation
This commit implements a command-line interface (CLI) mode for QEFIEntryManager that is compatible with efibootmgr options, addressing issue #14. Key features: - Automatic CLI/GUI mode detection based on command-line arguments - efibootmgr-compatible options for viewing and modifying boot entries - Support for boot order management, BootNext, timeout, and entry activation/deactivation - Verbose and quiet modes for flexible output - Comprehensive CLI documentation in CLI_README.md Implementation details: - Created cli.h and cli.cpp for CLI handler logic - Modified main.cpp to detect CLI mode and branch to QCoreApplication - Updated CMakeLists.txt to include new CLI source files - Used QCommandLineParser for robust argument parsing Supported efibootmgr options: - Display: -v (verbose), -q (quiet), -V (version) - Boot entry selection: -b (bootnum) - Modifications: -a (active), -A (inactive), -B (delete) - Boot order: -o (set order), -O (delete order) - BootNext: -n (set), -N (delete) - Timeout: -t (set), -T (delete) - Maintenance: -D (remove duplicates) Note: Boot entry creation (-c, -C) is stubbed but not fully implemented yet. Users should use the GUI for creating new boot entries. Closes #14 Signed-off-by: Inoki <veyx.shaw@gmail.com>
This commit adds a dedicated CLI-only executable and efibootmgr alias as suggested in the second comment of issue #14. Changes: - Created qefibootmgr.cpp: Dedicated CLI-only executable - Updated CMakeLists.txt to build qefibootmgr with minimal dependencies (Qt Core only, no GUI widgets) - Added efibootmgr symlink installation on Unix-like systems - Updated CLI_README.md to document the new executables Benefits: - qefibootmgr provides a lightweight CLI tool without GUI dependencies - efibootmgr alias provides drop-in compatibility with standard efibootmgr - Users can integrate into existing scripts that use efibootmgr - Clear separation between GUI app and CLI tool Usage: sudo qefibootmgr -v # Use dedicated CLI tool sudo efibootmgr -v # Use efibootmgr alias sudo QEFIEntryManager -v # Use main app in CLI mode Relates to #14 Signed-off-by: Inoki <veyx.shaw@gmail.com>
Updated the build system to create an efibootmgr executable on Windows using the same source as qefibootmgr, instead of creating a separate source file. Changes: - CMakeLists.txt: Build efibootmgr executable on Windows using qefibootmgr.cpp source - CLI_README.md: Updated documentation to clarify Windows behavior - Removed efibootmgr.cpp (not needed, reuse qefibootmgr.cpp) On Windows, both qefibootmgr.exe and efibootmgr.exe are built from the same source, providing drop-in compatibility without needing symlinks (which require special permissions on Windows). On Unix-like systems, efibootmgr remains as a symlink to qefibootmgr. Relates to #14 Signed-off-by: Inoki <veyx.shaw@gmail.com>
This commit adds proper Windows administrator privilege handling for the CLI executables by embedding UAC manifests. Changes: - CMakeLists.txt: Added UAC manifest for qefibootmgr and efibootmgr on Windows to request administrator elevation - CLI_README.md: Added comprehensive Windows-specific documentation including UAC behavior, elevation requirements, and usage notes Windows-specific improvements: - Both CLI executables now include embedded manifests that trigger UAC elevation prompts automatically - Documentation explains UAC behavior and scripting considerations This ensures the CLI tools work correctly on Windows with proper privilege elevation, matching the behavior of the GUI application. Relates to #14 Signed-off-by: Inoki <veyx.shaw@gmail.com>
Replaced the markdown documentation with a proper Unix man page following
standard man page conventions.
Changes:
- Added qefibootmgr.8: Comprehensive man page for qefibootmgr/efibootmgr
in standard groff format with all sections (NAME, SYNOPSIS, DESCRIPTION,
OPTIONS, EXAMPLES, etc.)
- Removed CLI_README.md: Replaced with traditional man page documentation
- Updated CMakeLists.txt: Install man page to ${CMAKE_INSTALL_MANDIR}/man8
on Unix-like systems
The man page includes:
- Complete option documentation compatible with efibootmgr
- Usage examples for common operations
- Platform-specific notes (Linux, FreeBSD, Windows)
- Exit status codes
- Compatibility notes
- Requirements and limitations
Users can now access documentation via:
man qefibootmgr
man efibootmgr
Relates to #14
Signed-off-by: Inoki <veyx.shaw@gmail.com>
This commit fixes all issues identified in code review that caused
CI build failures and would cause runtime problems.
Critical fixes:
1. Removed unused qefiloadoptioneditorview.h include from cli.cpp
- This header depends on QtWidgets (QWidget base class)
- qefibootmgr only links Qt::Core, not Qt::Widgets
- Including it caused build failures in all CIs
2. Added destructor to CLI class to fix memory leak
- QCoreApplication was allocated with new but never deleted
- Added ~CLI() destructor to properly clean up
3. Fixed handleModifications() return logic
- Was returning false when no modifications made (not an error!)
- Caused exit code 1 on successful operations like "qefibootmgr -D"
when no duplicates found
- Now returns true for success, false only for actual errors
4. Added validation for conflicting options
- Detect when both --active and --inactive are specified
- Return error instead of silently preferring --active
5. Modernized CMake syntax
- Replaced deprecated LINK_FLAGS property
- Use target_link_options() for UAC manifest
All fixes tested and ready for CI re-run.
Fixes build failures in all CI platforms (Linux, Windows, FreeBSD).
Signed-off-by: Inoki <veyx.shaw@gmail.com>
2352528 to
244cc3d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit implements a command-line interface (CLI) mode for QEFIEntryManager that is compatible with efibootmgr options, addressing issue #14.
Key features:
Implementation details:
Supported efibootmgr options:
Note: Boot entry creation (-c, -C) is stubbed but not fully implemented yet. Users should use the GUI for creating new boot entries.
Closes #14