blob: dee4439664c033bfbc8b165657f5bb689aa7cdf0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
#!/bin/bash -e
#
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
obmc_dir=${script_dir}/../../
cd "$obmc_dir"
# openbmc doesn't control what upstream poky, or any of the other layers do,
# which do use patches as part of their upstreaming process.
# meta-phosphor is also included such that patches that the community agrees to
# hold onto will be allowed in that layer.
patch_files_tmp=$(mktemp)
allowed_patches_tmp=$(mktemp)
trap 'rm $patch_files_tmp $allowed_patches_tmp' exit
git ls-files -- \
'*.patch' '*.dts' \
':!:poky/**' \
':!:meta-arm/**' \
':!:meta-security/**' \
':!:meta-raspberrypi/**' \
':!:meta-openembedded/**' \
':!:meta-phosphor/**' \
| sort > "$patch_files_tmp"
# The following patches were present on master at the time this test was
# written. Their presence in this list should not be acknowlegement that they
# are now allowed, but ignoring them is required in the intermediate time
# between when this test was created, and when the maintainers of these repos
# clean them up.
#
# https://github.com/openbmc/docs/blob/master/meta-layer-guidelines.md
echo "\
meta-aspeed/recipes-aspeed/python/socsec/0001-otptool-Define-value_start-in-rev_id-path.patch
meta-aspeed/recipes-bsp/u-boot/files/default-gcc.patch
meta-facebook/meta-yosemitev2/recipes-bsp/u-boot/u-boot-aspeed-sdk/0001-board-aspeed-Add-Mux-for-yosemitev2.patch
meta-facebook/meta-yosemitev2/recipes-bsp/u-boot/u-boot-aspeed-sdk/0002-spl-host-console-handle.patch
meta-google/dynamic-layers/nuvoton-layer/recipes-bsp/images/npcm7xx-igps/0001-Set-FIU0_DRD_CFG-and-FIU_Clk_divider-for-gbmc-hoth.patch
meta-google/recipes-extended/libconfig/files/0001-conf2struct-Use-the-right-perl.patch
meta-google/recipes-extended/libconfig/files/0001-makefile-Add-missing-LDFLAGS.patch
meta-google/recipes-phosphor/initrdscripts/obmc-phosphor-initfs/rwfs-clean-dev.patch
meta-hpe/meta-dl360poc/recipes-kernel/linux/linux-obmc/gxp.dts
meta-ingrasys/meta-zaius/recipes-bsp/u-boot/u-boot-aspeed/0001-board-aspeed-Add-reset_phy-for-Zaius.patch
meta-nuvoton/recipes-bsp/images/npcm7xx-igps/0001-Adjust-paths-for-use-with-Bitbake.patch
meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0001-Add-system-reset-status-support.patch
meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0002-config-ast-common-set-fieldmode-to-true.patch
meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0003-aspeed-add-gpio-support.patch
meta-yadro/meta-nicole/recipes-bsp/u-boot/files/0004-aspeed-add-bmc-position-support.patch
meta-yadro/meta-nicole/recipes-kernel/linux/linux-aspeed/0001-Add-NCSI-channel-selector.patch
meta-yadro/meta-nicole/recipes-phosphor/host/op-proc-control/0001-Stop-and-send-SRESET-for-one-thread-only.patch
meta-yadro/recipes-phosphor/dbus/phosphor-dbus-interfaces/0001-Add-boot-initiator-mailbox-interface.patch
meta-yadro/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Add-support-for-persistent-only-settings.patch
meta-yadro/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Add-support-for-boot-initiator-mailbox.patch
meta-yadro/recipes-phosphor/ipmi/phosphor-ipmi-host/0003-Fix-version-parsing-update-AUX-revision-info.patch
" | sort > "$allowed_patches_tmp"
files_diff=$(comm -23 "$patch_files_tmp" "$allowed_patches_tmp")
files_count=$(echo -n "$files_diff" | grep -c '^' || true)
if [[ $files_count -ne 0 ]]; then
echo "Patch or DTS files found not in allow list"
echo "$files_diff"
echo "Patches are not allowed on OpenBMC in these layers. Please upstream your changes and see \
https://github.com/openbmc/docs/blob/master/meta-layer-guidelines.md"
exit 1
fi
# Now verify there are no kernel dts files being added in a patch
# All dts files should be sent upstream and can be carried in the openbmc/linux
# tree until they are accepted upstream
dts_files_tmp=$(mktemp)
allowed_dts_tmp=$(mktemp)
trap 'rm $dts_files_tmp $allowed_dts_tmp' exit
git ls-files -- \
'*.dts' \
':!:poky/**' \
':!:meta-arm/**' \
':!:meta-security/**' \
':!:meta-raspberrypi/**' \
':!:meta-openembedded/**' \
| sort > "$dts_files_tmp"
# There is a single dts currently in the tree that we will exempt for now
echo "\
meta-hpe/meta-dl360poc/recipes-kernel/linux/linux-obmc/gxp.dts
" | sort > "$allowed_dts_tmp"
files_diff=$(comm -23 "$dts_files_tmp" "$allowed_dts_tmp")
files_count=$(echo -n "$files_diff" | grep -c '^' || true)
if [[ $files_count -ne 0 ]]; then
echo "Dts files found not in allow list"
echo "$files_diff"
echo "Dts files are not allowed on OpenBMC in these layers. Please upstream your changes and see \
https://github.com/openbmc/docs/blob/master/kernel-development.md"
exit 1
fi
lint_exempt="\
meta-phosphor/recipes-support/nss-pam-ldapd/files/nslcd.init
"
types=(json shell)
# shellcheck disable=SC2034
check_json="eslint --resolve-plugins-relative-to /usr/local/lib/node_modules"
# shellcheck disable=SC2034
check_shell="shellcheck -x"
for t in "${types[@]}"; do
check_cmd="check_${t}"
if ! which "${!check_cmd%% *}" > /dev/null 2>&1; then
eval "${check_cmd}=\"echo WARNING: Skipping $t due to missing command:\""
echo "${!check_cmd}"
fi
done
non_bbfiles=$(git ls-files -- \
':!:poky/**' \
':!:meta-arm/**' \
':!:meta-security/**' \
':!:meta-raspberrypi/**' \
':!:meta-openembedded/**' \
| grep -v -e "\.patch$" -e "\.bb$" -e "\.bbappend$")
for f in $non_bbfiles; do
unset file_type
file_info=$(file "$f")
case $file_info in
*shell\ script*)
file_type="shell"
;;
*JSON\ data*)
file_type="json"
;;
*)
case $f in
*.sh)
file_type="shell"
;;
*.json)
file_type="json"
;;
esac
esac
if [ -n "$file_type" ]; then
check_cmd="check_${file_type}"
if ! eval "${!check_cmd} $f"; then
if [[ $lint_exempt == *$f* ]]; then
echo "EXEMPT: $f"
else
echo "FAILED: $f"
false
fi
fi
fi
done
echo "Repo test passed"
|