Skip to content

Latest commit

Β 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Firmware Update Automation - Firefox Extension

This Firefox extension provides a user-friendly interface to automate IBM server firmware updates for Everest and Rainier systems. The extension features automatic WebSocket server startup and works seamlessly on both Mac and Windows.

✨ Key Features

  • πŸš€ Automatic Server Startup - No manual server management needed
  • ⚑ Fast Build Autocomplete - Persistent SSH connection for instant suggestions (1-2s vs 10-15s)
  • 🟒 Connection Status Indicator - Visual feedback for gateway connection status
  • 🎯 Smart Build Autocomplete - Dynamic suggestions for build paths with keyboard navigation
  • πŸ” Secure credential input with password fields
  • πŸ’Ύ Save non-sensitive credentials for reuse
  • πŸ“Š Real-time progress tracking with toast notifications
  • πŸ“ Live log streaming from the update process
  • 🎨 Modern, intuitive user interface
  • πŸ”„ Automatic LUCI password handling
  • πŸ–₯️ Cross-Platform - Works on Mac and Windows

Quick Start (Git Repository)

Mac Installation

git clone https://github.com/tiwari-nishant/Build-Update-Automation-tool.git
cd Build-Update-Automation-tool

Run the installer

  • chmod +x install.sh
  • ./install.sh

Install extension in Firefox

  1. Open Firefox
  2. Go to about:debugging#/runtime/this-firefox
  3. Click "Load Temporary Add-on"
  4. Select firefox_extension/manifest.json

Windows Installation

git clone https://github.com/tiwari-nishant/Build-Update-Automation-tool.git
cd Build-Update-Automation-tool

Run the installer

  • install.bat(Double click on the file to run it)

Install extension in Firefox

  1. Open Firefox
  2. Go to about:debugging#/runtime/this-firefox
  3. Click "Load Temporary Add-on"
  4. Select firefox_extension\manifest.json

That's it! The installer handles everything automatically:

  • Creates Python virtual environment
  • Installs dependencies (paramiko, websockets, requests)
  • Sets up native messaging for automatic server startup
  • Makes scripts executable
  • Creates extension package

πŸ“– Documentation

Prerequisites

Mac

  • macOS 10.14 or later
  • Python 3.7+ (pre-installed on macOS)
  • Firefox browser
  • Git (pre-installed on macOS)

Windows

Architecture

The solution consists of five main components:

  1. Firefox Extension - User interface for input collection
  2. WebSocket Server - Real-time communication with extension
  3. Server Launcher - Automatic server startup via native messaging
  4. SSH Session Manager - Persistent SSH connection for fast autocomplete
  5. Firmware Update Script - Core automation logic

Usage

Starting a Firmware Update

  1. Click the extension icon in Firefox toolbar

  2. Fill in the required fields:

    • GSA ID: Your IBM GSA identification
    • GSA Password: Your GSA password
    • Use same password for LUCI: Check if LUCI password is same as GSA
    • Build Path: Path to firmware build directory
      • πŸ’‘ Pro Tip: Use the autocomplete feature!
        1. Type at least 4 characters (e.g., "1200.26")
        2. Click "Load Suggestions" button
        3. Select from up to 5 most recent matching builds
        4. Full path is automatically filled
      • See BUILD_AUTOCOMPLETE_GUIDE.md for details
    • Machine Address: Target machine IP address
    • Lab Password: Password for the lab machine
  3. Optional: Save credentials

    • Check "Save credentials" to store non-sensitive information
  4. Click "Start Update"

    • Server starts automatically (no manual steps!)
    • Real-time progress appears in toast notifications
    • Logs stream in the popup
    • Progress bar updates automatically
  5. Monitor the process

    • Watch toast notifications for phase updates:
      • Initializing (0-15%)
      • Copying build to BMC (15-40%)
      • Performing update (40-50%)
      • Verifying update (50-100%)

Loading Saved Credentials

  1. Click "Load Saved" button
  2. Previously saved fields will be populated
  3. Enter passwords (never saved for security)

Updating from Git

When updates are available:

Mac

cd /path/to/repository
git pull
./install.sh
# Reload extension in Firefox (about:debugging)

Windows

cd C:\path\to\repository
git pull
install.bat
Reload extension in Firefox (about:debugging)

File Structure

repository/
β”œβ”€β”€ README.md                           # This file
β”œβ”€β”€ GIT_INSTALLATION_GUIDE.md          # Git installation guide
β”œβ”€β”€ CROSS_PLATFORM_DISTRIBUTION.md     # Distribution guide
β”œβ”€β”€ AUTOSTART_TROUBLESHOOTING.md       # Troubleshooting
β”œβ”€β”€ .gitignore                         # Git ignore rules
β”œβ”€β”€ install.sh                         # Mac installer
β”œβ”€β”€ install.bat                        # Windows installer
β”œβ”€β”€ firmware_update_automation.py      # Main automation script
β”œβ”€β”€ firmware_verification.py           # Verification script
β”œβ”€β”€ firmware_websocket_server.py       # WebSocket server
β”œβ”€β”€ server_launcher.py                 # Server launcher
β”œβ”€β”€ test_server_launcher.py            # Test script
β”œβ”€β”€ start_websocket_server.sh          # Manual server start (Mac)
β”œβ”€β”€ firefox_extension/                 # Extension files
β”‚   β”œβ”€β”€ manifest.json
β”‚   β”œβ”€β”€ background.js
β”‚   β”œβ”€β”€ content_script.js
β”‚   β”œβ”€β”€ progress_toast.js
β”‚   β”œβ”€β”€ progress_toast.css
β”‚   β”œβ”€β”€ popup/
β”‚   β”‚   β”œβ”€β”€ popup.html
β”‚   β”‚   β”œβ”€β”€ popup.css
β”‚   β”‚   └── popup.js
β”‚   β”œβ”€β”€ icons/
β”‚   β”‚   β”œβ”€β”€ icon-48.png
β”‚   β”‚   └── icon-96.png
β”‚   └── native-messaging-hosts/
β”‚       └── server_launcher.json
└── my_venv/                           # Created by installer (not in git)

Troubleshooting

Mac Issues

Extension won't load:

# Reinstall
./install.sh

# Check native messaging
ls -la ~/.mozilla/native-messaging-hosts/server_launcher.json

# Test server launcher
python3 test_server_launcher.py

Server won't start:

# Check logs
tail -f /tmp/server_launcher_debug.log

# Check if server is running
lsof -i :8765

Windows Issues

Extension won't load:

Reinstall
install.bat

Check native messaging
dir %APPDATA%\Mozilla\NativeMessagingHosts\server_launcher.json

Test server launcher
my_venv\Scripts\python.exe test_server_launcher.py

Server won't start:

Check logs
type websocket_server_autostart.log

Check if server is running
netstat -ano | findstr :8765

Python not found:

  • Install Python from python.org
  • ⚠️ Check "Add Python to PATH" during installation
  • Restart Command Prompt

Common Issues

"Server not running, attempting to start..." but nothing happens:

  1. Reload the extension in Firefox (about:debugging β†’ Reload)
  2. Check Browser Console (Cmd+Shift+J / Ctrl+Shift+J) for errors
  3. See AUTOSTART_TROUBLESHOOTING.md for detailed help

Button stays at "Cancel Update" after error:

  • This is now fixed! The button automatically resets to "Start Update" after any error

For detailed troubleshooting, see AUTOSTART_TROUBLESHOOTING.md.

Security Considerations

  • βœ… Passwords never stored - Only non-sensitive information is saved
  • βœ… Local communication only - WebSocket server only accepts localhost connections
  • βœ… Secure transmission - All credentials transmitted over SSH/HTTPS
  • βœ… No external dependencies - Except IBM firmware servers
  • βœ… Minimal permissions - Extension only requests necessary permissions

Development

Making Changes

  1. Create a branch:

    git checkout -b feature/my-feature
  2. Make your changes

  3. Test thoroughly:

    # Mac
    ./install.sh
    python3 test_server_launcher.py
    
    # Windows
    install.bat
    my_venv\Scripts\python.exe test_server_launcher.py
  4. Reload extension in Firefox:

    • Go to about:debugging#/runtime/this-firefox
    • Click "Reload" next to the extension
  5. Commit and push:

    git add .
    git commit -m "Description of changes"
    git push origin feature/my-feature

Debugging

  • Extension popup: Right-click popup β†’ Inspect
  • Background script: about:debugging β†’ Inspect
  • Server logs:
    • Mac: tail -f /tmp/server_launcher_debug.log
    • Windows: type websocket_server_autostart.log
  • Browser Console: Cmd+Shift+J / Ctrl+Shift+J

Testing

Test Server Launcher

# Mac
python3 test_server_launcher.py

# Windows
my_venv\Scripts\python.exe test_server_launcher.py

Expected output:

Testing server_launcher.py...
Response: {
  "type": "status",
  "running": true,
  "message": "Server started successfully"
}

Check Server Status

# Mac
lsof -i :8765 | grep LISTEN

# Windows
netstat -ano | findstr :8765

Known Limitations

  • Extension must be reloaded as temporary add-on after Firefox restart
    • For permanent installation, package and sign through Mozilla Add-on store
  • Large firmware files may take time to transfer
  • Native messaging requires proper host configuration

Version History

Version 1.0.0

  • Initial release with automatic server startup
  • Cross-platform support (Mac and Windows)
  • Real-time progress notifications
  • Automatic button state management
  • Comprehensive error handling

Support

For issues or questions:

  1. Check AUTOSTART_TROUBLESHOOTING.md
  2. Check GIT_INSTALLATION_GUIDE.md
  3. Review log files for detailed errors
  4. Check Browser Console for JavaScript errors
  5. Open an issue in the repository

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test on both Mac and Windows (if possible)
  5. Submit a pull request

License

This tool is provided as-is for IBM internal use.


About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages