Skip to content
Open
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
7 changes: 4 additions & 3 deletions fboss-image/kernel/scripts/build_kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ bash "$CONTAINER_SCRIPTS_DIR/setup_kernel_build_deps.sh"
# Use a separate build directory to avoid cluttering dist/
BUILD_DIR="$CONTAINER_DIST_DIR/build-$KERNEL_VERSION"

rm -rf "$BUILD_DIR"
mkdir -p "$BUILD_DIR/SOURCES"
cd "$BUILD_DIR"

# Download kernel source (spectool is part of rpmdevtools)
spectool -g -C SOURCES "$CONTAINER_SPECS_DIR/kernel.spec" \
--define "kernel_version $KERNEL_VERSION"
if [ ! -f "$BUILD_DIR/SOURCES/linux-$KERNEL_VERSION.tar.xz" ]; then
spectool -g -C SOURCES "$CONTAINER_SPECS_DIR/kernel.spec" \
--define "kernel_version $KERNEL_VERSION"
fi

# Ensure FBOSS config sources are present for rpmbuild
cp "$CONTAINER_CONFIGS_DIR/fboss-reference.config" "$BUILD_DIR/SOURCES/"
Expand Down
Loading