Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions fboss-image/image_builder/bin/build_image_in_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ cp /etc/resolv.conf "${DESCRIPTION_DIR}/root/etc/"
# Add build timestamp to the image
echo "Built on: $(date -u)" >"$DESCRIPTION_DIR/root/etc/build-info"

# Copy systemd service files to overlay
if [ -d "${DESCRIPTION_DIR}/services" ]; then
dprint "Copying systemd service files to overlay..."
rm -rf ${DESCRIPTION_DIR}/root/usr/lib/systemd/system
mkdir -p ${DESCRIPTION_DIR}/root/usr/lib/systemd/system
cp ${DESCRIPTION_DIR}/services/*.service ${DESCRIPTION_DIR}/root/usr/lib/systemd/system/
fi

# Generate the images
dprint "Generating PXE and USB bootable image, this will take few minutes..."
kiwi-ng-3 \
Expand Down
4 changes: 4 additions & 0 deletions fboss-image/image_builder/templates/centos-09.0/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ env -i \
PATH="/usr/bin:/usr/sbin:/bin:/sbin" \
kernel-install add "${KERNEL_VERSION}" "${VMLINUZ_PATH}" --initrd-file "${INITRD_PATH}"

# 5. Enable systemd services
echo "Enabling FBOSS systemd services..."
systemctl enable platform_manager.service

# 6. Done! Cleanup, remember that we are chrooted on the rootfs
echo "Removing kernel rpms from rootfs..."
rm -f /repos/*.rpm
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# /usr/lib/systemd/system/platform_manager.service
[Unit]
Description=FBOSS Platform Manager
Before=sensor_service.service
Before=fan_service.service
Before=data_corral_service.service
Before=led_service.service
Before=qsfp_service.service
Before=fruid.service
After=rc-local.service

[Service]
Type=notify
LimitNOFILE=10000000
LimitCORE=32G

Environment="PATH=/opt/fboss/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
Environment="LD_LIBRARY_PATH=/opt/fboss/lib"
WorkingDirectory=/opt/fboss
ExecStart=/bin/bash -c 'source /opt/fboss/bin/setup_fboss_env && exec /opt/fboss/bin/platform_manager --run_once=false'

Restart=on-failure
RestartSec=30
TimeoutStartSec=180s

# Logging to journald
StandardOutput=journal
StandardError=journal
SyslogIdentifier=platform_manager

[Install]
WantedBy=multi-user.target
Loading