diff --git a/.github/workflows/compare.yml b/.github/workflows/compare.yml new file mode 100644 index 0000000..06a23e2 --- /dev/null +++ b/.github/workflows/compare.yml @@ -0,0 +1,99 @@ +name: Compare Kernel Config + +on: + pull_request: + types: [opened, reopened, synchronize] + branches: + - 'master' + +jobs: + genconfig: + strategy: + fail-fast: false + matrix: + include: + - arch: x86_64 + karch: x86 + - arch: aarch64 + karch: arm64 + - arch: riscv64 + karch: riscv + - arch: loongarch64 + karch: loongarch + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + path: repo + - uses: actions/checkout@v4 + with: + ref: master + path: repo-old + - uses: actions/checkout@v4 + with: + repository: eweOS/packages + ref: linux + path: pkg + - run: >- + docker run + --rm + -v $(pwd):/${{ github.workspace }} + -w ${{ github.workspace }} + ghcr.io/eweos/docker:buildenv + bash -c " + pushd pkg && + pacman -Syu --noconfirm && makepkg -os --noconfirm && + kdir=pkg/src/\$(source PKGBUILD && echo \$_basename-\$pkgver) && + popd && + repo/scripts/generate-config.sh ${{ matrix.arch }} ${{ matrix.karch }} \$kdir && + cp \$kdir/.config config-new && + repo-old/scripts/generate-config.sh ${{ matrix.arch }} ${{ matrix.karch }} \$kdir && + cp \$kdir/.config config-old && + diff -urN config-old config-new > config.diff || true + " + - uses: actions/upload-artifact@v4 + with: + name: diff-${{ matrix.arch }} + path: config.diff + + compare: + runs-on: ubuntu-latest + needs: [genconfig] + steps: + - uses: peter-evans/find-comment@v3 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: '## Config Compare' + - uses: actions/download-artifact@v4 + with: + name: diff-x86_64 + path: diff-x86_64 + - uses: actions/download-artifact@v4 + with: + name: diff-aarch64 + path: diff-aarch64 + - uses: actions/download-artifact@v4 + with: + name: diff-riscv64 + path: diff-riscv64 + - uses: actions/download-artifact@v4 + with: + name: diff-loongarch64 + path: diff-loongarch64 + - run: >- + echo "## Config Compare" >> diff.output && + for outarch in x86_64 aarch64 riscv64 loongarch64; do + (echo "## $outarch" >> diff.output && + echo '```diff' >> diff.output && + echo "diff for $outarch" >> diff.output && + cat diff-$outarch/config.diff >> diff.output && + echo '```' >> diff.output); + done + - uses: peter-evans/create-or-update-comment@v4 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body-path: diff.output + edit-mode: replace diff --git a/generic.config b/generic.config index 57250c9..3f1d5ad 100644 --- a/generic.config +++ b/generic.config @@ -1,5 +1,5 @@ # branding -CONFIG_LOGO=y +CONFIG_LOGO=n # boot CONFIG_EFI_BOOTLOADER_CONTROL=y diff --git a/scripts/generate-config.sh b/scripts/generate-config.sh index fc471ae..9380e61 100755 --- a/scripts/generate-config.sh +++ b/scripts/generate-config.sh @@ -21,8 +21,10 @@ for _conf in "$config_path"/*.config "$config_path/$carch"/*.config; do cat "$_conf" >> "$mergedconfig" done -cd "$ksrc" +pushd "$ksrc" make LLVM=1 LLVM_IAS=1 ARCH="$karch" defconfig scripts/kconfig/merge_config.sh -m .config "$mergedconfig" make LLVM=1 LLVM_IAS=1 ARCH="$karch" olddefconfig + +popd