A complete NixOS module for automating Lenovo BIOS boot logo customization on supported devices.
This project provides comprehensive BIOS boot logo customization for Lenovo devices, supporting both modern UEFI-based methods and legacy BIOS tool approaches:
- UEFI Direct Method: Uses built-in
BootX64.efilogo commands (safer, no BIOS modification) - Legacy BIOS Method: Uses
compress.efiandchgLogo.efitools (for older devices)
- ThinkPad X1 Yoga 4th (Product Name: 20QGS4AE00) - UEFI Direct Method
- ThinkCentre M720q (Product Name: 10TAS0FT00) - Legacy BIOS Method
- ThinkCentre M720t/M720s - Legacy BIOS Method
- ThinkCentre M920t/M920s/M920q - Legacy BIOS Method
- ThinkStation P330 Tiny - Legacy BIOS Method
- Dual Method Support: Automatic selection between UEFI Direct and Legacy BIOS methods
- UEFI Shell Automation: Automated script execution for logo updates
- Device Detection: Automatic identification of Lenovo device types and appropriate method
- ESP Integration: Proper deployment to EFI System Partition with safety features
- Legacy BIOS Tools: Python reimplementation of
compress.efiandchgLogo.efi
- Automatic Logo Processing: Converts Stylix wallpapers for BIOS use
- Real-time Updates: Automatically updates BIOS logo when wallpaper changes
- Image Optimization: Resizes and compresses for BIOS constraints
- Fallback Support: Handles processing failures gracefully
- EFI Tools Extractor: Extracts
compress.efiandchgLogo.efifrom Lenovo BIOS packages - Deployment Script: Automates ESP partition setup and BootNext configuration
- Device Detection: Identifies hardware using DMI information
# Download the BIOS Update (Bootable CD) ISO from Lenovo support
# Extract the required tools
./tools/extract-efi-tools.sh extract lenovo-bios.iso thinkpad-x1-yoga-4th# Download the BIOS Update ISO for your device from Lenovo support
# Extract compress.efi and chgLogo.efi tools
./tools/extract-efi-tools.sh extract lenovo-bios.iso thinkcentre-m720qNote: You must download the BIOS update package for your specific device model from Lenovo's official support website. The extraction tool will pull required EFI tools from the official package.
Note: You must download the BIOS update package for your specific device model from Lenovo's official support website. The extraction tool will pull the required EFI tools from the official package.
# Download the BIOS Update ISO for your device from Lenovo support
# Extract compress.efi and chgLogo.efi tools
./tools/extract-efi-tools.sh extract lenovo-bios.iso thinkcentre-m720q# configuration.nix
{
services.lenovo-bios-logo = {
enable = true;
model = "ThinkPad X1 Yoga 4th"; # or "ThinkCentre M720q" or "ThinkPad X250"
logoFile = ./my-logo.jpg;
autoUpdate = true;
# Method selection (optional, auto-detects by default)
method = "legacy"; # or "uefi" or "auto"
};
}
# With Stylix integration (optional)
{
services.lenovo-bios-logo = {
enable = true;
model = "ThinkPad X1 Yoga 4th";
# logoFile will be automatically derived from Stylix wallpaper
};
stylix = {
enable = true;
image = ./my-wallpaper.jpg;
};
}
### 3. Apply Logo Update
```bash
# Process and deploy the logo
sudo lenovo-logo-process
# Reboot to apply (for UEFI methods)
sudo systemctl reboot
# For X250 Windows method, follow the on-screen instructions in WineIf you prefer manual control over the process:
- Boot to UEFI Shell: The module creates a boot entry automatically
- Automatic Execution: Script runs once and cleans up after itself
- Reboot: System reboots with new logo
- Boot to UEFI Shell: Use the created boot entry
- Run Commands:
compress.efi logo.jpg chgLogo.efi compress.bin - Reboot: System reboots with new logo
- Boot to UEFI Shell: Use the created boot entry
- Run Commands:
compress.efi logo.jpg chgLogo.efi compress.bin - Reboot: System reboots with new logo
/boot/efi/EFI/lenovo-logo/
├── lenovo-boot-tool.efi # Renamed BootX64.efi (UEFI method)
├── compress.efi # Logo compression tool (Legacy method)
├── chgLogo.efi # Logo injection tool (Legacy method)
├── logo-startup.nsh # EFI startup script
├── logo.nsh # Logo replacement script
├── logo.efi # Processed custom logo
└── pending-logo.flag # Auto-apply trigger
/var/lib/lenovo-bios-logo/
└── uefi-package/ # Generated update package
- Formats: JPG, BMP, GIF
- Size: ≤60KB after compression
- Dimensions: ≤40% of LCD resolution (≤768x432 for 1920x1080)
- Formats: JPG, BMP, GIF
- Size: <20KB recommended (compresses to ~60KB max)
- Dimensions: Recommended 1024x768 or smaller
- Formats: JPG, BMP, GIF
- Size: <20KB recommended (compresses to ~60KB max)
- Dimensions: Recommended 1024x768 or smaller
- Location: Must be on FAT32-formatted ESP partition
- Processing: Automatic resizing and optimization provided
- Backup: Have BIOS recovery method available
- Power: Use stable power during update
- Compatibility: Use tools extracted for your specific device model
- Testing: Test in non-production environment first
"compress.efi not found":
- Extract tools from your device's specific BIOS update package
- Ensure files are in
EFI/LenovoLogo/on ESP
"Compression failed":
- Check logo file size (< 20KB)
- Verify logo format (JPG/BMP/GIF)
- Ensure logo file is not corrupted
"Logo injection failed":
- Verify
compress.binwas created successfully - Check BIOS supports logo modification
- Ensure sufficient BIOS space available
Boot entry not created":
- Check ESP mount point in deployment script
- Verify efibootmgr permissions
- Ensure disk/partition detection is correct
If BIOS update fails:
- Reboot: System should revert to previous state
- BIOS Recovery: Use Lenovo's BIOS recovery method
- Re-extract: Get fresh EFI tools from BIOS package
- Retry: Attempt logo update with smaller/simpler logo
modules/
└── lenovo-bios-logo.nix # Main NixOS module
tools/
├── lenovo-bios-logo.py # Main CLI interface
├── hardware-detector.py # Device detection
├── logo-processor.py # Logo processing
├── uefi-script-generator.py # UEFI script generation
├── extract-efi-tools.sh # EFI tools extraction
└── identify-device.py # Device identification
docs/
├── uefi-direct-logo-method.md # UEFI method documentation
├── legacy-logo-method.md # Legacy method documentation
└── uefi-direct-safe-implementation.md # Safety analysis
fetchers/
└── lenovo-api.nix # Lenovo API fetcher
# Detect your device
lenovo-logo-detect
# Process a logo manually
lenovo-logo-process ./my-logo.jpg
# Extract EFI tools from BIOS package
./tools/extract-efi-tools.sh extract bios-update.iso thinkpad-x1-yoga-4th
# Test device detection
python3 tools/identify-device.py identify
# With Nix flakes
nix run .#lenovo-bios-logo -- detect
nix run .#lenovo-bios-logo -- process ./logo.jpg -m "ThinkPad X1 Yoga 4th"We welcome contributions! Please:
- Device Support: Add new device signatures to
tools/identify-device.py - Testing: Test on actual hardware before submitting PRs
- Documentation: Update documentation for new features
- Security: Review BIOS modification safety carefully
- Issues: Report bugs with device model and error details
- Add device signature to
tools/identify-device.py - Test logo customization on the actual device
- Update documentation with method requirements
- Submit PR with device details and testing results
MIT License - See LICENSE file for details.
- Backup: Have BIOS recovery method available
- Power: Use stable power during update
- Compatibility: Use tools extracted for your specific device model
- Testing: Test in non-production environment first
Note: This implementation supports both modern UEFI-based methods and legacy BIOS modification approaches. The module automatically selects the appropriate method based on your device type.