Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge common options #10

Merged
merged 1 commit into from
Jan 19, 2024
Merged
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
16 changes: 2 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,7 @@ git push origin v3.1
The CI jobs will then build your release and make it available at `https://github.com/panda-re/linux_builder/releases/download/<TAG-NAME>/kernels-latest.tar.gz`

## Modifying configs
If you'd like to add a given option or set of options to all configs, you can do something like:

```sh
# Write your config options into delta.txt

# Apply delta
for cfg in config.*; do cat delta.txt >> $cfg; done

# Run linter as shown below

# Commit changes
git commit -a
```
If you'd like to add a given option or set of options to all configs, you can add it to [configs/all-common.inc](configs/all-common.inc).

## Linting configs
Before commiting any config update you MUST lint your change by running `./build.sh --config-only`. You can specify architectures to lint with the `--targets` flag, e.g., `./build.sh --config-only --targets "armel mipel"`.
Before commiting any config update you MUST lint your change by running `./build.sh --config-only`. You can specify architectures to lint with the `--targets` flag, e.g., `./build.sh --config-only --targets "armel mipel"`. If the lint fails, build.sh will exit with non-zero status and print a diff containing the problems.
14 changes: 6 additions & 8 deletions _in_container_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -eu

# We want to build linux for each of our targets and versions using the config files. Linux is in /app/linux/[version]
# while our configs are at config.[arch]. We need to set the ARCH and CROSS_COMPILE variables
# while our configs are at configs/[arch]. We need to set the ARCH and CROSS_COMPILE variables
# and put the binaries in /app/binaries

# Get options from build.sh
Expand Down Expand Up @@ -51,24 +51,22 @@ for TARGET in $TARGETS; do

echo "Building $BUILD_TARGETS for $TARGET"

if [ ! -f "/app/config.${TARGET}" ]; then
if [ ! -f "/app/configs/${TARGET}" ]; then
echo "No config for $TARGET"
exit 1
fi
mkdir -p "/tmp/build/${VERSION}/${TARGET}"
cp "/app/config.${TARGET}" "/tmp/build/${VERSION}/${TARGET}/.config"
cpp -P -undef "/app/configs/${TARGET}" -o "/tmp/build/${VERSION}/${TARGET}/.config"

# Actually build
echo "Building kernel for $TARGET"
make -C /app/linux/$VERSION ARCH=${short_arch} CROSS_COMPILE=$(get_cc $TARGET) O=/tmp/build/${VERSION}/${TARGET}/ olddefconfig

# If updating configs, lint them with kernel first! This sorts, removes default options and duplicates.
# If updating configs, lint them with kernel first! This removes default options and duplicates.
if $CONFIG_ONLY; then
echo "Updating $TARGET config in place"
make -C /app/linux/$VERSION ARCH=${short_arch} CROSS_COMPILE=$(get_cc $TARGET) O=/tmp/build/${VERSION}/${TARGET}/ savedefconfig
cp /tmp/build/${VERSION}/${TARGET}/defconfig /app/config.${TARGET}
echo "Finished update for config.${TARGET}"
diff -u <(sort /tmp/build/${VERSION}/${TARGET}/.config) <(sort /tmp/build/${VERSION}/${TARGET}/defconfig | sed '/^[ #]/d')
else
make -C /app/linux/$VERSION ARCH=${short_arch} CROSS_COMPILE=$(get_cc $TARGET) O=/tmp/build/${VERSION}/${TARGET}/ olddefconfig
make -C /app/linux/$VERSION ARCH=${short_arch} CROSS_COMPILE=$(get_cc $TARGET) O=/tmp/build/${VERSION}/${TARGET}/ $BUILD_TARGETS -j$(nproc)

mkdir -p /kernels/$VERSION
Expand Down
Loading