blob: bd82176d3b8a283770f3dae79cc7b04a6a932962 [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)
14
15git -C "$obmc_dir" ls-files -- \
16 '*.patch' \
17 ':!:poky/**' \
18 ':!:meta-security/**' \
19 ':!:meta-xilinx/**' \
20 ':!: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
39meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0004-aspeed-add-gpio-support.patch
40meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0005-aspeed-Enable-SPI-master-mode.patch
41meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0006-aspeed-support-Mt.Jade-platform-init.patch
42meta-aspeed/recipes-bsp/u-boot/files/default-gcc.patch
43meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/0001-bytedance-g220a-Enable-ipmb.patch
44meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/0003-misc-aspeed-Add-Aspeed-UART-routing-control-driver.patch
45meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/0004-ARM-dts-aspeed-Add-uart-routing-node.patch
46meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/0005-ARM-dts-aspeed-Enable-g220a-uart-route.patch
47meta-bytedance/meta-g220a/recipes-phosphor/ipmi/phosphor-node-manager-proxy/0001-Remove-Total_Power-sensor.patch
48meta-facebook/meta-bletchley/recipes-bsp/u-boot/u-boot-aspeed-sdk/0001-u-boot-ast2600-57600-baudrate-for-bletchley.patch
49meta-facebook/meta-tiogapass/recipes-bsp/u-boot/u-boot-aspeed/0001-configs-ast-common-use-57600-baud-rate-to-match-Tiog.patch
50meta-facebook/meta-yosemitev2/recipes-bsp/u-boot/u-boot-aspeed/0001-board-aspeed-Add-Mux-for-yosemitev2.patch
51meta-facebook/meta-yosemitev2/recipes-bsp/u-boot/u-boot-aspeed/0002-spl-host-console-handle.patch
52meta-google/dynamic-layers/nuvoton-layer/recipes-bsp/images/npcm7xx-igps/0001-Set-FIU0_DRD_CFG-and-FIU_Clk_divider-for-gbmc-hoth.patch
53meta-google/recipes-extended/libconfig/files/0001-conf2struct-Use-the-right-perl.patch
54meta-google/recipes-extended/libconfig/files/0001-makefile-Add-missing-LDFLAGS.patch
55meta-google/recipes-phosphor/initrdscripts/obmc-phosphor-initfs/rwfs-clean-dev.patch
56meta-ingrasys/meta-zaius/recipes-bsp/u-boot/u-boot-aspeed/0001-board-aspeed-Add-reset_phy-for-Zaius.patch
57meta-nuvoton/recipes-bsp/images/npcm7xx-igps/0001-Adjust-paths-for-use-with-Bitbake.patch
58meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0001-Add-system-reset-status-support.patch
59meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0002-config-ast-common-set-fieldmode-to-true.patch
60meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0003-aspeed-add-gpio-support.patch
61meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0004-aspeed-add-bmc-position-support.patch
62meta-yadro/meta-nicole/recipes-kernel/linux/linux-aspeed/0001-Add-NCSI-channel-selector.patch
63meta-yadro/meta-nicole/recipes-phosphor/host/op-proc-control/0001-Stop-and-send-SRESET-for-one-thread-only.patch
64meta-yadro/recipes-phosphor/dbus/phosphor-dbus-interfaces/0001-Add-boot-initiator-mailbox-interface.patch
65meta-yadro/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Add-support-for-persistent-only-settings.patch
66meta-yadro/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Add-support-for-boot-initiator-mailbox.patch
67meta-yadro/recipes-phosphor/ipmi/phosphor-ipmi-host/0003-Fix-version-parsing-update-AUX-revision-info.patch
68" | sort > $allowed_patches_tmp
69
70
71
72files_diff=$(comm -23 $patch_files_tmp $allowed_patches_tmp)
73rm $allowed_patches_tmp
74rm $patch_files_tmp
75
Ed Tanous4734c222021-09-20 11:11:34 -070076files_count=$(echo -n "$files_diff" | grep -c '^' || true)
Ed Tanous7f8954e2021-09-09 11:46:43 -070077if [[ $files_count -ne 0 ]]; then
78 echo "Patch files found not in allow list"
79 echo "$files_diff"
80 echo "Patches are not allowed on OpenBMC in these layers. Please upstream your changes and see \
81 https://github.com/openbmc/docs/blob/master/meta-layer-guidelines.md"
82 exit 1
83fi
84
Ed Tanousd5cea142021-09-09 11:42:05 -070085echo "Repo test passed"
Ed Tanous7f8954e2021-09-09 11:46:43 -070086