Git Product home page Git Product logo

sysfs_fw_loader's Introduction

sysfs_fw_loader

Small tool to load firmwares using the Linux sysfs interface.

It's useful when you don't want to use initramfs and kernel modules, but your drivers need to load firmwares.

You need Linux 5.19+ and CONFIG_FW_LOADER_USER_HELPER enabled.

Usage

Create directory at /etc/sysfs_fw_loader/ and put json files inside:

[
        {
                "name": "brcmfmac43430-sdio.sudomaker,cle.bin",
                "file": "/lib/firmware/brcm/brcmfmac43430-sdio.bin"
        },
        {
                "name": "brcmfmac43430-sdio.sudomaker,cle.txt",
                "file": "/lib/firmware/brcm/brcmfmac43430-sdio.txt"
        },
        {
                "name": "BCM43430A1.sudomaker,cle.hcd",
                "file": "/lib/firmware/brcm/BCM43430A1.hcd"
        },
        {
                "name": "brcmfmac43430-sdio.sudomaker,cle.clm_blob",
                "file": ""
        },
        {
                "name": "brcmfmac43430-sdio.clm_blob",
                "file": ""
        }
]

The name field is the directory names in /sys/class/firmware/. It's partially matched.

Use an empty file field to indicate you want to instruct the kernel to skip loading this firmware.

You can use the environment variable SYSFS_FW_LOADER_CONFIG_DIR to specify an alternative config directory.

This program will exit when all specified firmware files are loaded. You can use the environment variable SYSFS_FW_LOADER_TIMEOUT to specify a timeout in seconds. It's 10 by default.

Build

Requirements

  • CMake
  • C++17 compatible compiler with std::filesystem
  • json-c library
mkdir build
cd build
cmake ..
make

Or if you're in a hurry:

g++ -std=c++17 main.cpp -o sysfs_fw_loader -l json-c

License

AGPLv3

sysfs_fw_loader's People

Contributors

reimunotmoe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.