blob: 0a2f4fb39688af3d208352a3a27132851e2433a3 [file] [log] [blame]
Ed Tanousd5cea142021-09-09 11:42:05 -07001#!/bin/bash -e
2#
3
Ed Tanous7f8954e2021-09-09 11:46:43 -07004script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
5obmc_dir=${script_dir}/../../
6
7# openbmc doesn't control what upstream poky, or any of the other layers do,
8# which do use patches as part of their upstreaming process.
9# meta-phosphor is also included such that patches that the community agrees to
10# hold onto will be allowed in that layer.
11
12patch_files_tmp=$(mktemp)
13allowed_patches_tmp=$(mktemp)
Patrick Williams7bf39c02021-10-26 06:46:48 -050014trap "rm $patch_files_tmp $allowed_patches_tmp" exit
Ed Tanous7f8954e2021-09-09 11:46:43 -070015
16git -C "$obmc_dir" ls-files -- \
17 '*.patch' \
18 ':!:poky/**' \
19 ':!:meta-security/**' \
20 ':!:meta-xilinx/**' \
21 ':!:meta-raspberrypi/**' \
22 ':!:meta-openembedded/**' \
23 ':!:meta-phosphor/**' \
24 | sort > $patch_files_tmp
25
26
27# The following patches were present on master at the time this test was
28# written. Their presence in this list should not be acknowlegement that they
29# are now allowed, but ignoring them is required in the intermediate time
30# between when this test was created, and when the maintainers of these repos
31# clean them up.
32#
33# https://github.com/openbmc/docs/blob/master/meta-layer-guidelines.md
34echo "\
35meta-amd/meta-ethanolx/recipes-x86/chassis/x86-power-control/0001-Amd-power-control-modifications-for-EthanolX.patch
36meta-ampere/meta-common/recipes-devtools/mtd/mtd-utils/0001-flashcp-support-offset-option.patch
37meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0001-aspeed-scu-Switch-PWM-pin-to-GPIO-input-mode.patch
38meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0002-aspeed-Disable-internal-PD-resistors-for-GPIOs.patch
39meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0003-aspeed-support-passing-system-reset-status-to-kernel.patch
Ed Tanous7f8954e2021-09-09 11:46:43 -070040meta-aspeed/recipes-bsp/u-boot/files/default-gcc.patch
41meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/0001-bytedance-g220a-Enable-ipmb.patch
42meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/0003-misc-aspeed-Add-Aspeed-UART-routing-control-driver.patch
43meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/0004-ARM-dts-aspeed-Add-uart-routing-node.patch
44meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/0005-ARM-dts-aspeed-Enable-g220a-uart-route.patch
45meta-bytedance/meta-g220a/recipes-phosphor/ipmi/phosphor-node-manager-proxy/0001-Remove-Total_Power-sensor.patch
46meta-facebook/meta-bletchley/recipes-bsp/u-boot/u-boot-aspeed-sdk/0001-u-boot-ast2600-57600-baudrate-for-bletchley.patch
47meta-facebook/meta-tiogapass/recipes-bsp/u-boot/u-boot-aspeed/0001-configs-ast-common-use-57600-baud-rate-to-match-Tiog.patch
48meta-facebook/meta-yosemitev2/recipes-bsp/u-boot/u-boot-aspeed/0001-board-aspeed-Add-Mux-for-yosemitev2.patch
49meta-facebook/meta-yosemitev2/recipes-bsp/u-boot/u-boot-aspeed/0002-spl-host-console-handle.patch
50meta-google/dynamic-layers/nuvoton-layer/recipes-bsp/images/npcm7xx-igps/0001-Set-FIU0_DRD_CFG-and-FIU_Clk_divider-for-gbmc-hoth.patch
51meta-google/recipes-extended/libconfig/files/0001-conf2struct-Use-the-right-perl.patch
52meta-google/recipes-extended/libconfig/files/0001-makefile-Add-missing-LDFLAGS.patch
53meta-google/recipes-phosphor/initrdscripts/obmc-phosphor-initfs/rwfs-clean-dev.patch
54meta-ingrasys/meta-zaius/recipes-bsp/u-boot/u-boot-aspeed/0001-board-aspeed-Add-reset_phy-for-Zaius.patch
55meta-nuvoton/recipes-bsp/images/npcm7xx-igps/0001-Adjust-paths-for-use-with-Bitbake.patch
56meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0001-Add-system-reset-status-support.patch
57meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0002-config-ast-common-set-fieldmode-to-true.patch
58meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0003-aspeed-add-gpio-support.patch
59meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0004-aspeed-add-bmc-position-support.patch
60meta-yadro/meta-nicole/recipes-kernel/linux/linux-aspeed/0001-Add-NCSI-channel-selector.patch
61meta-yadro/meta-nicole/recipes-phosphor/host/op-proc-control/0001-Stop-and-send-SRESET-for-one-thread-only.patch
62meta-yadro/recipes-phosphor/dbus/phosphor-dbus-interfaces/0001-Add-boot-initiator-mailbox-interface.patch
63meta-yadro/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Add-support-for-persistent-only-settings.patch
64meta-yadro/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Add-support-for-boot-initiator-mailbox.patch
65meta-yadro/recipes-phosphor/ipmi/phosphor-ipmi-host/0003-Fix-version-parsing-update-AUX-revision-info.patch
66" | sort > $allowed_patches_tmp
67
Ed Tanous7f8954e2021-09-09 11:46:43 -070068files_diff=$(comm -23 $patch_files_tmp $allowed_patches_tmp)
Ed Tanous7f8954e2021-09-09 11:46:43 -070069
Ed Tanous4734c222021-09-20 11:11:34 -070070files_count=$(echo -n "$files_diff" | grep -c '^' || true)
Ed Tanous7f8954e2021-09-09 11:46:43 -070071if [[ $files_count -ne 0 ]]; then
72 echo "Patch files found not in allow list"
73 echo "$files_diff"
74 echo "Patches are not allowed on OpenBMC in these layers. Please upstream your changes and see \
75 https://github.com/openbmc/docs/blob/master/meta-layer-guidelines.md"
76 exit 1
77fi
78
Ed Tanousd5cea142021-09-09 11:42:05 -070079echo "Repo test passed"
Ed Tanous7f8954e2021-09-09 11:46:43 -070080