Skip to content

Conversation

@marif-nexthop
Copy link
Contributor

Pre-submission checklist

  • I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
  • pre-commit run

Summary

At boot, start a oneshot systemd service that launches a fboss_init.sh script to perform FBOSS distro initialization and setup e.g. copying right config files to /etc/coop etc.

  • Added systemd service launches the script fboss_init.sh
    • The init script does the following steps for now
      • Copy /etc/coop configuration files based on the dmidecode output
      • Generate fruid.json file
  • Added option to add default configs (qsfp_service and wedge_agent) for different platforms
  • Added default configs for montblanc platform as an example

Test Plan

fboss_init systemd service

● fboss_init.service - FBOSS Initialization
     Active: active (exited) since Tue 2026-01-27 12:00:20 PST
     
Jan 27 16:05:34 fboss101 fboss_init[90731]: [fboss_init] Starting FBOSS initialization
Jan 27 16:05:34 fboss101 fboss_init[90732]: [fboss_init] Detected platform: minipack3
Jan 27 16:05:34 fboss101 fboss_init[90732]: [fboss_init] Using platform config directory: /opt/fboss/share/minipack3
Jan 27 16:05:34 fboss101 fboss_init[90731]: [fboss_init] Copied agent.conf: /opt/fboss/share/minipack3/agent.conf -> /etc/coop/agent.conf
Jan 27 16:05:34 fboss101 fboss_init[90731]: [fboss_init] Copied qsfp.conf: /opt/fboss/share/minipack3/qsfp.conf -> /etc/coop/qsfp.conf
Jan 27 16:05:35 fboss101 fboss_init[90731]: [fboss_init] Generated fruid.json: /var/facebook/fboss/fruid.json
Jan 27 16:05:35 fboss101 fboss_init[90731]: [fboss_init] FBOSS initialization complete

when system config files exist (skipped)

Jan 27 16:00:03 fboss101 fboss_init[90579]: [fboss_init] Starting FBOSS initialization
Jan 27 16:00:03 fboss101 fboss_init[90580]: [fboss_init] Detected platform: minipack3
Jan 27 16:00:03 fboss101 fboss_init[90580]: [fboss_init] Using platform config directory: /opt/fboss/share/minipack3
Jan 27 16:00:03 fboss101 fboss_init[90579]: [fboss_init] agent.conf already exists at /etc/coop/agent.conf (skipping)
Jan 27 16:00:03 fboss101 fboss_init[90579]: [fboss_init] qsfp.conf already exists at /etc/coop/qsfp.conf (skipping)
Jan 27 16:00:03 fboss101 fboss_init[90579]: [fboss_init] fruid.json already exists at /var/facebook/fboss/fruid.json (skipping)
Jan 27 16:00:03 fboss101 fboss_init[90579]: [fboss_init] FBOSS initialization complete

marif-nexthop and others added 3 commits January 24, 2026 02:00
[Nexthop] Upgrade FBOSS Distro to support systemd services
<!-- Thanks for submitting a pull request! We appreciate you spending
the time to work on these changes. Please provide enough information so
that others can review your pull request. -->

**Pre-submission checklist**
- [X] I've ran the linters locally and fixed lint errors related to the
files I modified in this PR. You can install the linters by running `pip
install -r requirements-dev.txt && pre-commit install`
- [X] `pre-commit run`

<!-- Explain the motivation for making this change and any other context
that you think would help reviewers of your code. What existing problem
does the pull request solve? -->

package_manager, by default, detects the platform it is running on then
uses a compiled-in config file to install the platform BSP RPM using
dnf.

This requires that we have an RPM repo with those RPMs. In Distro Image
we cannot presume an infrastructure RPM server with the correct BSP and
dependent RPMs. Instead, create a device-local one for that purpose.

The repo metadata is created at boot instead of just install time to
help the development workflows where a new RPM is uploaded to the
device, then the device is restarted for testing.

<!-- Demonstrate the code is solid. Example: The exact commands you ran
and their output, screenshots / videos if the pull request changes the
user interface. How exactly did you verify that your PR solves the issue
you wanted to solve? -->

<!-- If a relevant Github issue exists for this PR, please make sure you
link that issue to this PR -->

Build and load the image on a dut. Manually copy the BSP RPM into
/usr/local/share/local_rpm_repo, run createrepo
/usr/local/share/local_rpm_repo, then dnf search for that RPM:
```
dnf search nexthop
Repository local_rpm_repo is listed more than once in the configuration
Last metadata expiration check: 0:00:15 ago on Sat 17 Jan 2026 12:44:46 AM UTC.
======================= Name & Summary Matched: nexthop ========================
nexthop_bsp_kmods-6.11.1-1.fboss.el9.x86_64-1.el9-1.0.0.x86_64 : Nexthop BSP Kernel Modules
```
@meta-cla meta-cla bot added the CLA Signed label Jan 30, 2026
At boot, start a oneshot systemd service that launches a fboss_init.sh script to perform FBOSS distro initialization and setup e.g. copying right config files to /etc/coop etc.

- Added systemd service launches the script fboss_init.sh
  - The init script does the following steps for now
    - Copy /etc/coop configuration files based on the dmidecode output
    - Generate fruid.json file
- Added option to add default configs (qsfp_service and wedge_agent) for different platforms
- Added default configs for montblanc platform as an example
@marif-nexthop marif-nexthop force-pushed the marif.fboss-distro-init branch from cbe8419 to 0c27eef Compare January 30, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants