blob: 5f83383a9fecadc78bf69052f8a2cf47df1ca272 [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/**' \
Ed Tanous7f8954e2021-09-09 11:46:43 -070020 ':!:meta-raspberrypi/**' \
21 ':!:meta-openembedded/**' \
22 ':!:meta-phosphor/**' \
23 | sort > $patch_files_tmp
24
25
26# The following patches were present on master at the time this test was
27# written. Their presence in this list should not be acknowlegement that they
28# are now allowed, but ignoring them is required in the intermediate time
29# between when this test was created, and when the maintainers of these repos
30# clean them up.
31#
32# https://github.com/openbmc/docs/blob/master/meta-layer-guidelines.md
33echo "\
34meta-amd/meta-ethanolx/recipes-x86/chassis/x86-power-control/0001-Amd-power-control-modifications-for-EthanolX.patch
35meta-ampere/meta-common/recipes-devtools/mtd/mtd-utils/0001-flashcp-support-offset-option.patch
36meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0001-aspeed-scu-Switch-PWM-pin-to-GPIO-input-mode.patch
37meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0002-aspeed-Disable-internal-PD-resistors-for-GPIOs.patch
38meta-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 -070039meta-aspeed/recipes-bsp/u-boot/files/default-gcc.patch
40meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/0001-bytedance-g220a-Enable-ipmb.patch
41meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/0003-misc-aspeed-Add-Aspeed-UART-routing-control-driver.patch
42meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/0004-ARM-dts-aspeed-Add-uart-routing-node.patch
43meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/0005-ARM-dts-aspeed-Enable-g220a-uart-route.patch
44meta-bytedance/meta-g220a/recipes-phosphor/ipmi/phosphor-node-manager-proxy/0001-Remove-Total_Power-sensor.patch
45meta-facebook/meta-bletchley/recipes-bsp/u-boot/u-boot-aspeed-sdk/0001-u-boot-ast2600-57600-baudrate-for-bletchley.patch
46meta-facebook/meta-tiogapass/recipes-bsp/u-boot/u-boot-aspeed/0001-configs-ast-common-use-57600-baud-rate-to-match-Tiog.patch
47meta-facebook/meta-yosemitev2/recipes-bsp/u-boot/u-boot-aspeed/0001-board-aspeed-Add-Mux-for-yosemitev2.patch
48meta-facebook/meta-yosemitev2/recipes-bsp/u-boot/u-boot-aspeed/0002-spl-host-console-handle.patch
49meta-google/dynamic-layers/nuvoton-layer/recipes-bsp/images/npcm7xx-igps/0001-Set-FIU0_DRD_CFG-and-FIU_Clk_divider-for-gbmc-hoth.patch
50meta-google/recipes-extended/libconfig/files/0001-conf2struct-Use-the-right-perl.patch
51meta-google/recipes-extended/libconfig/files/0001-makefile-Add-missing-LDFLAGS.patch
52meta-google/recipes-phosphor/initrdscripts/obmc-phosphor-initfs/rwfs-clean-dev.patch
53meta-ingrasys/meta-zaius/recipes-bsp/u-boot/u-boot-aspeed/0001-board-aspeed-Add-reset_phy-for-Zaius.patch
54meta-nuvoton/recipes-bsp/images/npcm7xx-igps/0001-Adjust-paths-for-use-with-Bitbake.patch
55meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0001-Add-system-reset-status-support.patch
56meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0002-config-ast-common-set-fieldmode-to-true.patch
57meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0003-aspeed-add-gpio-support.patch
58meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0004-aspeed-add-bmc-position-support.patch
59meta-yadro/meta-nicole/recipes-kernel/linux/linux-aspeed/0001-Add-NCSI-channel-selector.patch
60meta-yadro/meta-nicole/recipes-phosphor/host/op-proc-control/0001-Stop-and-send-SRESET-for-one-thread-only.patch
61meta-yadro/recipes-phosphor/dbus/phosphor-dbus-interfaces/0001-Add-boot-initiator-mailbox-interface.patch
62meta-yadro/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Add-support-for-persistent-only-settings.patch
63meta-yadro/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Add-support-for-boot-initiator-mailbox.patch
64meta-yadro/recipes-phosphor/ipmi/phosphor-ipmi-host/0003-Fix-version-parsing-update-AUX-revision-info.patch
65" | sort > $allowed_patches_tmp
66
Ed Tanous7f8954e2021-09-09 11:46:43 -070067files_diff=$(comm -23 $patch_files_tmp $allowed_patches_tmp)
Ed Tanous7f8954e2021-09-09 11:46:43 -070068
Ed Tanous4734c222021-09-20 11:11:34 -070069files_count=$(echo -n "$files_diff" | grep -c '^' || true)
Ed Tanous7f8954e2021-09-09 11:46:43 -070070if [[ $files_count -ne 0 ]]; then
71 echo "Patch files found not in allow list"
72 echo "$files_diff"
73 echo "Patches are not allowed on OpenBMC in these layers. Please upstream your changes and see \
74 https://github.com/openbmc/docs/blob/master/meta-layer-guidelines.md"
75 exit 1
76fi
77
Ed Tanousd5cea142021-09-09 11:42:05 -070078echo "Repo test passed"
Ed Tanous7f8954e2021-09-09 11:46:43 -070079