blob: 7328baed09821aba9a37037a6749f49d163ee147 [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
Patrick Williams12a27b22021-10-26 16:07:31 -05007cd "$obmc_dir"
8
Ed Tanous7f8954e2021-09-09 11:46:43 -07009# openbmc doesn't control what upstream poky, or any of the other layers do,
10# which do use patches as part of their upstreaming process.
11# meta-phosphor is also included such that patches that the community agrees to
12# hold onto will be allowed in that layer.
13
14patch_files_tmp=$(mktemp)
15allowed_patches_tmp=$(mktemp)
Patrick Williams7bf39c02021-10-26 06:46:48 -050016trap "rm $patch_files_tmp $allowed_patches_tmp" exit
Ed Tanous7f8954e2021-09-09 11:46:43 -070017
Patrick Williams12a27b22021-10-26 16:07:31 -050018git ls-files -- \
Ed Tanous7f8954e2021-09-09 11:46:43 -070019 '*.patch' \
20 ':!:poky/**' \
21 ':!:meta-security/**' \
Ed Tanous7f8954e2021-09-09 11:46:43 -070022 ':!:meta-raspberrypi/**' \
23 ':!:meta-openembedded/**' \
24 ':!:meta-phosphor/**' \
25 | sort > $patch_files_tmp
26
27
28# The following patches were present on master at the time this test was
29# written. Their presence in this list should not be acknowlegement that they
30# are now allowed, but ignoring them is required in the intermediate time
31# between when this test was created, and when the maintainers of these repos
32# clean them up.
33#
34# https://github.com/openbmc/docs/blob/master/meta-layer-guidelines.md
35echo "\
36meta-amd/meta-ethanolx/recipes-x86/chassis/x86-power-control/0001-Amd-power-control-modifications-for-EthanolX.patch
37meta-ampere/meta-common/recipes-devtools/mtd/mtd-utils/0001-flashcp-support-offset-option.patch
38meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0001-aspeed-scu-Switch-PWM-pin-to-GPIO-input-mode.patch
39meta-ampere/meta-jade/recipes-bsp/u-boot/u-boot-aspeed/0002-aspeed-Disable-internal-PD-resistors-for-GPIOs.patch
40meta-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 -070041meta-aspeed/recipes-bsp/u-boot/files/default-gcc.patch
42meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/0001-bytedance-g220a-Enable-ipmb.patch
43meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/0003-misc-aspeed-Add-Aspeed-UART-routing-control-driver.patch
44meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/0004-ARM-dts-aspeed-Add-uart-routing-node.patch
45meta-bytedance/meta-g220a/recipes-kernel/linux/linux-aspeed/0005-ARM-dts-aspeed-Enable-g220a-uart-route.patch
46meta-bytedance/meta-g220a/recipes-phosphor/ipmi/phosphor-node-manager-proxy/0001-Remove-Total_Power-sensor.patch
47meta-facebook/meta-bletchley/recipes-bsp/u-boot/u-boot-aspeed-sdk/0001-u-boot-ast2600-57600-baudrate-for-bletchley.patch
48meta-facebook/meta-tiogapass/recipes-bsp/u-boot/u-boot-aspeed/0001-configs-ast-common-use-57600-baud-rate-to-match-Tiog.patch
49meta-facebook/meta-yosemitev2/recipes-bsp/u-boot/u-boot-aspeed/0001-board-aspeed-Add-Mux-for-yosemitev2.patch
50meta-facebook/meta-yosemitev2/recipes-bsp/u-boot/u-boot-aspeed/0002-spl-host-console-handle.patch
51meta-google/dynamic-layers/nuvoton-layer/recipes-bsp/images/npcm7xx-igps/0001-Set-FIU0_DRD_CFG-and-FIU_Clk_divider-for-gbmc-hoth.patch
52meta-google/recipes-extended/libconfig/files/0001-conf2struct-Use-the-right-perl.patch
53meta-google/recipes-extended/libconfig/files/0001-makefile-Add-missing-LDFLAGS.patch
54meta-google/recipes-phosphor/initrdscripts/obmc-phosphor-initfs/rwfs-clean-dev.patch
55meta-ingrasys/meta-zaius/recipes-bsp/u-boot/u-boot-aspeed/0001-board-aspeed-Add-reset_phy-for-Zaius.patch
56meta-nuvoton/recipes-bsp/images/npcm7xx-igps/0001-Adjust-paths-for-use-with-Bitbake.patch
57meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0001-Add-system-reset-status-support.patch
58meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0002-config-ast-common-set-fieldmode-to-true.patch
59meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0003-aspeed-add-gpio-support.patch
60meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0004-aspeed-add-bmc-position-support.patch
61meta-yadro/meta-nicole/recipes-kernel/linux/linux-aspeed/0001-Add-NCSI-channel-selector.patch
62meta-yadro/meta-nicole/recipes-phosphor/host/op-proc-control/0001-Stop-and-send-SRESET-for-one-thread-only.patch
63meta-yadro/recipes-phosphor/dbus/phosphor-dbus-interfaces/0001-Add-boot-initiator-mailbox-interface.patch
64meta-yadro/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Add-support-for-persistent-only-settings.patch
65meta-yadro/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Add-support-for-boot-initiator-mailbox.patch
66meta-yadro/recipes-phosphor/ipmi/phosphor-ipmi-host/0003-Fix-version-parsing-update-AUX-revision-info.patch
67" | sort > $allowed_patches_tmp
68
Ed Tanous7f8954e2021-09-09 11:46:43 -070069files_diff=$(comm -23 $patch_files_tmp $allowed_patches_tmp)
Ed Tanous7f8954e2021-09-09 11:46:43 -070070
Ed Tanous4734c222021-09-20 11:11:34 -070071files_count=$(echo -n "$files_diff" | grep -c '^' || true)
Ed Tanous7f8954e2021-09-09 11:46:43 -070072if [[ $files_count -ne 0 ]]; then
73 echo "Patch files found not in allow list"
74 echo "$files_diff"
75 echo "Patches are not allowed on OpenBMC in these layers. Please upstream your changes and see \
76 https://github.com/openbmc/docs/blob/master/meta-layer-guidelines.md"
77 exit 1
78fi
79
Patrick Williams12a27b22021-10-26 16:07:31 -050080lint_exempt="\
81meta-amd/recipes-amd/amd-fpga/files/ethanolx/fpgardu.sh
82meta-ampere/meta-common/recipes-ac01/usbnet/ampere-usbnet/ampere_add_usbnet_gadget.sh
83meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager/firmware_update.sh
84meta-ampere/meta-jade/recipes-ampere/flash/ampere-flash-utils/ampere_flash_bios.sh
85meta-ampere/meta-jade/recipes-ampere/platform/ampere-mac-update/ampere_update_mac.sh
86meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/ampere_platform_init.sh
87meta-ampere/meta-jade/recipes-ampere/platform/mtjade-gpio-config/ampere_gpio_utils.sh
88meta-ampere/meta-jade/recipes-ampere/platform/mtjade-utils/ampere_host_check.sh
89meta-ampere/meta-jade/recipes-ampere/platform/mtjade-utils/ampere_power_util.sh
90meta-ampere/meta-jade/recipes-ampere/platform/mtjade-utils/gpio-lib.sh
91meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/ampere_uartmux_ctrl.sh
92meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-server-setup.sh
93meta-ampere/meta-jade/recipes-phosphor/gpio/fault-monitor/toggle_fault_led.sh
94meta-ampere/meta-jade/recipes-phosphor/gpio/id-button/toggle_identify_led.sh
95meta-ampere/meta-jade/recipes-phosphor/gpio/psu-hotswap-reset/ampere_psu_reset_hotswap.sh
96meta-bytedance/meta-g220a/recipes-network/network/static-mac-addr/mac-check
97meta-bytedance/meta-g220a/recipes-phosphor/datetime/me-time-sync/me-time-sync.sh
98meta-facebook/recipes-fb/fb-powerctrl/files/power-util
99meta-facebook/recipes-fb/fb-powerctrl/files/setup_gpio.sh
100meta-facebook/recipes-phosphor/flash/phosphor-software-manager/bios-update.sh
101meta-fii/meta-kudo/recipes-kudo/host/files/ampere_power_util.sh
102meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw-ver.sh
103meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw.sh
104meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-lib.sh
105meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-boot/init_once.sh
106meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-cmd/kudo-ras.sh
107meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-cmd/kudo.sh
108meta-fii/meta-kudo/recipes-kudo/network/usb-network/usb_network.sh
109meta-fii/meta-kudo/recipes-phosphor/console/obmc-console/kudo_uart_mux_ctrl.sh
110meta-google/recipes-google/gpio/gpio-ctrl/lib.sh
111meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_isoff.sh
112meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_powercycle.sh
113meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_poweroff.sh
114meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_poweron.sh
115meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/host_reset.sh
116meta-google/recipes-google/host-power-ctrl/gpio-host-pwr/lib.sh
117meta-google/recipes-google/ipmi/ipmi-fru-sh/lib.sh
118meta-google/recipes-google/ncsi/files/gbmc-ncsi-ip-from-ra.sh.in
119meta-google/recipes-google/networking/files/gbmc-ip-monitor-test.sh
120meta-google/recipes-google/networking/files/gbmc-ip-monitor.sh
121meta-google/recipes-google/networking/files/gbmc-mac-config.sh.in
122meta-google/recipes-google/networking/google-usb-network/usb_network.sh
123meta-google/recipes-google/networking/google-usb-network/usb_network_test.sh
124meta-google/recipes-google/networking/network-sh/lib.sh
125meta-google/recipes-google/networking/network-sh/test.sh
126meta-google/recipes-google/nftables/files/nft-configure.sh
127meta-google/recipes-google/ssh/authorized-keys-comp/authorized-keys-comp.sh
128meta-google/recipes-google/test/test-sh/test.sh
129meta-google/recipes-phosphor/flash/google-key/verify-bmc-image.sh
130meta-google/recipes-phosphor/flash/inplace-gbmc-update/inplace-gbmc-verify.sh
131meta-hpe/meta-common/recipes-hpe/host/host-boot-enable/host-boot-enable.sh
132meta-hpe/meta-common/recipes-phosphor/initrdscripts/files/gxp-obmc-init.sh
133meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable/host-boot-enable.sh
134meta-ibm/meta-romulus/recipes-phosphor/chassis/vrm-control/vrm-control.sh
135meta-ibm/meta-romulus/recipes-phosphor/gpio/id-button/toggle_identify_led.sh
136meta-ibm/recipes-phosphor/chassis/power-workarounds/witherspoon/power-workarounds.sh
137meta-ibm/recipes-phosphor/chassis/vrm-control/ibm-ac-server/ir35221-unbind-bind.sh
138meta-ibm/recipes-phosphor/chassis/vrm-control/mihawk/ir35221-unbind-bind.sh
139meta-ibm/recipes-phosphor/chassis/vrm-control/vrm-control.sh
140meta-ibm/recipes-phosphor/dump/phosphor-debug-collector/plugins.d/ibm_elogall
141meta-ibm/recipes-phosphor/dump/phosphor-debug-collector/plugins.d/pels
142meta-ibm/recipes-phosphor/gpio/id-button/toggle_identify_led.sh
143meta-ibm/recipes-phosphor/mboxd/mboxd/check_pnor_format.sh
144meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/zaius_avsbus.sh
145meta-ingrasys/meta-zaius/recipes-phosphor/chassis/vcs-control/zaius_vcs.sh
146meta-inventec/meta-transformers/recipes-phosphor/init/transformers-init/transformers-init.sh
147meta-openpower/recipes-phosphor/dump/phosphor-debug-collector/plugins.d/guard
148meta-openpower/recipes-phosphor/network/first-boot-set-hostname/first-boot-set-hostname.sh
149meta-openpower/recipes-phosphor/network/first-boot-set-mac/first-boot-set-mac.sh
150meta-openpower/recipes-phosphor/occ/openpower-occ-control/occ-active.sh
151meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-init.sh
152meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-shutdown.sh
153meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-update.sh
154meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh
155meta-phosphor/recipes-phosphor/interfaces/bmcweb/run-ptest
156meta-phosphor/recipes-phosphor/preinit-mounts/preinit-mounts/init
157meta-phosphor/recipes-support/nss-pam-ldapd/files/nslcd.init
158meta-phosphor/scripts/run-repotest
159meta-quanta/meta-common/recipes-quanta/network/usb-network/usb-network.sh
160meta-quanta/meta-gbs/recipes-gbs/gbs-bios-update/files/bios-update.sh
161meta-quanta/meta-gbs/recipes-gbs/gbs-bios-update/files/bios-verify.sh
162meta-quanta/meta-gbs/recipes-gbs/gbs-bmc-update/files/bmc-verify.sh
163meta-quanta/meta-gbs/recipes-gbs/gbs-detect-gpio-present/files/detect-gpio-present.sh
164meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.sh
165meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/tray_powercycle.sh
166meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-check-host-state.sh
167meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-set-failsafe.sh
168meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-table-init.sh
169meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-nvme/nvme_json_rewrite.sh
170meta-quanta/meta-gsj/recipes-gsj/detect-fan-fail/files/detect-fan-fail.sh
171meta-quanta/meta-gsj/recipes-gsj/gsj-hotswap-change-setting/files/gsj-hotswap-change-setting.sh
172meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/init_once.sh
173meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/nvme_powerctrl_library.sh
174meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/nvme_powermanager.sh
175meta-quanta/meta-gsj/recipes-gsj/usb-network/files/usb_network.sh
176meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/fan-control.sh
177meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/power/first-boot-set-psu/first-boot-set-psu.sh
178meta-quanta/meta-q71l/recipes-phosphor/quanta-powerctrl/files/init_once.sh
179meta-quanta/meta-q71l/recipes-phosphor/quanta-powerctrl/files/poweroff.sh
180meta-quanta/meta-q71l/recipes-phosphor/quanta-powerctrl/files/poweron.sh
181meta-yadro/meta-nicole/recipes-phosphor/chassis/avsbus-control/avsbus-control.sh
182setup
183"
184
185non_bbfiles=$(git ls-files -- \
186 ':!:poky/**' \
187 ':!:meta-security/**' \
188 ':!:meta-raspberrypi/**' \
189 ':!:meta-openembedded/**' \
190 | grep -v -e "\.patch$" -e "\.bb$" -e "\.bbappend$")
191
192for f in $non_bbfiles; do
193 file_type=$(file $f)
194 case $file_type in
195 *shell\ script*)
196 if ! shellcheck -x $f; then
197 if [[ $lint_exempt == *$f* ]]; then
198 echo "EXEMPT: $f"
199 else
200 echo "FAILED: $f"
201 false
202 fi
203 fi
204 ;;
205
206 *)
207 ;;
208 esac
209done
210
Ed Tanousd5cea142021-09-09 11:42:05 -0700211echo "Repo test passed"
Ed Tanous7f8954e2021-09-09 11:46:43 -0700212