-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathMakefile
More file actions
250 lines (217 loc) · 8.5 KB
/
Makefile
File metadata and controls
250 lines (217 loc) · 8.5 KB
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# SPDX-License-Identifier: copyleft-next-0.3.1
TREE_URL:=$(subst ",,$(CONFIG_BOOTLINUX_TREE))
TREE_NAME:=$(notdir $(TREE_URL))
TREE_NAME:=$(subst .git,,$(TREE_NAME))
TREE_REF:=$(subst ",,$(CONFIG_BOOTLINUX_TREE_REF))
TREE_KERNELRELEASE:=$(subst ",,$(CONFIG_BOOTLINUX_TREE_KERNELRELEASE))
TREE_LOCALVERSION:=$(subst ",,$(CONFIG_BOOTLINUX_TREE_LOCALVERSION))
TREE_SHALLOW_DEPTH:=$(subst ",,$(CONFIG_BOOTLINUX_SHALLOW_CLONE_DEPTH))
TREE_CONFIG:=config-$(TREE_REF)
ifeq (y,$(CONFIG_BOOTLINUX_PURE_IOMAP))
TREE_CONFIG:=config-$(TREE_REF)-pure-iomap
endif
ifeq (y,$(CONFIG_BOOTLINUX_BUILDER))
endif
# Describes the Linux clone
BOOTLINUX_ARGS += target_linux_git=$(TREE_URL)
# ifeq (y,$(CONFIG_BOOTLINUX_TREE_CUSTOM_NAME))
ifdef CONFIG_BOOTLINUX_TREE_CUSTOM_NAME
BOOTLINUX_ARGS += target_linux_tree=$(CONFIG_BOOTLINUX_TREE_CUSTOM_NAME)
else
BOOTLINUX_ARGS += target_linux_tree=$(TREE_NAME)
endif
BOOTLINUX_ARGS += target_linux_ref=$(TREE_REF)
BOOTLINUX_ARGS += target_linux_config=$(TREE_CONFIG)
BOOTLINUX_ARGS += target_linux_kernelrelease=$(TREE_KERNELRELEASE)
BOOTLINUX_ARGS += target_linux_localversion=$(TREE_LOCALVERSION)
ifeq (y,$(CONFIG_BOOTLINUX_SHALLOW_CLONE))
TREE_SHALLOW_DEPTH:=$(subst ",,$(CONFIG_BOOTLINUX_SHALLOW_CLONE_DEPTH))
BOOTLINUX_ARGS += target_linux_shallow_depth=$(TREE_SHALLOW_DEPTH)
endif
ifeq (y,$(CONFIG_WORKFLOW_MAKE_CMD_OVERRIDE))
BOOTLINUX_ARGS += target_linux_make_cmd='$(WORKFLOW_MAKE_CMD)'
endif
ifeq (y,$(CONFIG_BOOTLINUX_TEST_MESSAGE_ID))
BOOTLINUX_ARGS += target_linux_apply_patch_message_id='$(CONFIG_BOOTLINUX_TEST_MESSAGE_ID_THREAD_ID)'
BOOTLINUX_ARGS += target_linux_install_b4='$(CONFIG_BOOTLINUX_TEST_MESSAGE_ID_INSTALL_B4)'
endif
LINUX_CLONE_DEFAULT_TYPE := linux-clone-clients
ifeq (y,$(CONFIG_BOOTLINUX_9P))
BOOTLINUX_ARGS += bootlinux_9p_host_path='$(subst ",,$(CONFIG_BOOTLINUX_9P_HOST_PATH))'
BOOTLINUX_ARGS += bootlinux_9p_msize='$(subst ",,$(CONFIG_BOOTLINUX_9P_MSIZE))'
BOOTLINUX_ARGS += bootlinux_9p_fsdev='$(subst ",,$(CONFIG_BOOTLINUX_9P_FSDEV))'
BOOTLINUX_ARGS += bootlinux_9p_security_model='$(subst ",,$(CONFIG_BOOTLINUX_9P_SECURITY_MODEL))'
BOOTLINUX_ARGS += bootlinux_9p_driver='$(subst ",,$(CONFIG_BOOTLINUX_9P_DRIVER))'
BOOTLINUX_ARGS += bootlinux_9p_mount_tag='$(subst ",,$(CONFIG_BOOTLINUX_9P_MOUNT_TAG))'
LINUX_CLONE_DEFAULT_TYPE := linux-clone-9p
endif
# XXX: I can't seem to use after this LINUX_DYNAMIC_RUNTIME_VARS += for other
# future dynamic run time variables. So figure how the hell to do that
# so we can enable other dynamic variables for other make targets other
# than uninstall. For now this does it for us.
#
# https://www.gnu.org/software/make/manual/html_node/Overriding.html
#
# We use override as other subsystems may use this too.
ifneq (,$(KVER))
override LINUX_DYNAMIC_RUNTIME_VARS = "uninstall_kernel_ver": "$(KVER)"
endif
BOOTLINUX_ARGS += bootlinux_cxl_test=$(CONFIG_ENABLE_CXL_TEST)
WORKFLOW_ARGS += $(BOOTLINUX_ARGS)
# Default host limit for bootlinux operations
BOOTLINUX_LIMIT := baseline:dev
# When NFS server is enabled, include it in kernel updates so that workflows
# like fstests, gitr, nfstest, and pynfs can test the kernel's NFS server
# implementation (knfsd).
ifeq (y,$(CONFIG_KDEVOPS_SETUP_NFSD))
BOOTLINUX_LIMIT := baseline:dev:nfsd
endif
PHONY += linux-help-menu
linux-help-menu:
@echo "Linux git kernel development options"
@echo "linux - Git clones a linux git tree, build Linux, installs and reboots into it"
@if [[ "$(CONFIG_KDEVOPS_BASELINE_AND_DEV)" == "y" ]]; then \
echo "linux-baseline - Build and install kernel for baseline nodes only" ;\
echo "linux-dev - Build and install kernel for dev nodes only" ;\
fi
@if [[ "$(CONFIG_BOOTLINUX_9P)" == "y" ]]; then \
echo "linux-mount - Mounts 9p path on targets" ;\
fi
@echo "linux-deploy - Builds, installs, updates GRUB and reboots - useful for rapid development"
@echo "linux-build - Builds kernel"
@echo "linux-install - Only builds and installs Linux"
@echo "linux-uninstall - Remove a kernel you can pass arguments for the version such as KVER=6.5.0-rc7-next-20230825"
@echo "linux-clone - Only clones Linux"
@echo "linux-grub-setup - Ensures the appropriate target kernel is set to boot"
@echo "linux-reboot - Reboot guests"
@echo "uname - Prints current running kernel"
PHONY += linux-help-end
linux-help-end:
@echo ""
LINUX_HELP_EXTRA :=
PHONY += linux
ifeq (y,$(CONFIG_KDEVOPS_BASELINE_AND_DEV))
ifeq (y,$(CONFIG_BOOTLINUX_AB_DIFFERENT_REF))
linux: linux-baseline linux-dev
else
linux: $(KDEVOPS_NODES)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
--limit '$(BOOTLINUX_LIMIT)' \
$(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS)
endif
else
linux: $(KDEVOPS_NODES)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
--limit '$(BOOTLINUX_LIMIT)' \
$(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS)
endif
PHONY += linux-baseline
ifeq (y,$(CONFIG_KDEVOPS_BASELINE_AND_DEV))
linux-baseline: $(KDEVOPS_NODES)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
--limit baseline \
$(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--extra-vars="$(BOOTLINUX_ARGS)"
else
linux-baseline:
@echo "linux-baseline requires KDEVOPS_BASELINE_AND_DEV=y"
@exit 1
endif
PHONY += linux-dev
ifeq (y,$(CONFIG_KDEVOPS_BASELINE_AND_DEV))
linux-dev: $(KDEVOPS_NODES)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
--limit dev \
$(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--extra-vars="$(BOOTLINUX_ARGS)"
else
linux-dev:
@echo "linux-dev requires KDEVOPS_BASELINE_AND_DEV=y"
@exit 1
endif
PHONY += linux-mount
linux-mount:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
--limit '$(BOOTLINUX_LIMIT)' \
$(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--tags vars,9p_mount \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS)
PHONY += linux-deploy
linux-deploy:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
--limit '$(BOOTLINUX_LIMIT)' \
$(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--tags vars,build-linux,install-linux,manual-update-grub,saved,vars,reboot \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS)
PHONY += linux-build
linux-build:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
--limit '$(BOOTLINUX_LIMIT)' \
$(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--tags vars,build-linux,saved,vars \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS)
PHONY += linux-install
linux-install:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
--limit '$(BOOTLINUX_LIMIT)' \
$(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--tags vars,build-linux,install-linux \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS)
PHONY += linux-uninstall
linux-uninstall:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
--limit '$(BOOTLINUX_LIMIT)' \
$(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--tags uninstall-linux,vars \
--extra-vars '{ "uninstall_kernel_enable": "True", $(LINUX_DYNAMIC_RUNTIME_VARS) }' \
$(LIMIT_HOSTS)
linux-clone-clients: $(KDEVOPS_NODES)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
--limit '$(BOOTLINUX_LIMIT)' \
$(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS) \
--tags vars,clone
PHONY += linux-clone-9p
linux-clone-9p: $(KDEVOPS_NODES)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
--limit 'localhost' \
$(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--extra-vars="$(BOOTLINUX_ARGS)" \
--tags vars,clone
PHONY += linux-clone
linux-clone: $(KDEVOPS_NODES) $(LINUX_CLONE_DEFAULT_TYPE)
PHONY += linux-grub-setup
linux-grub-setup:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
--limit '$(BOOTLINUX_LIMIT)' \
$(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS) --tags manual-update-grub,saved,vars
PHONY += linux-reboot
linux-reboot:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
--limit '$(BOOTLINUX_LIMIT)' \
$(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS) --tags vars,reboot
PHONY += uname
uname:
$(Q)ansible '$(BOOTLINUX_LIMIT)' -b -m command -a "uname -r" -o \
| awk -F '|' '{gsub(/^ +| +$$/, "", $$2); printf "%-30s %s\n", $$1, $$4}' \
| sed -e 's|(stdout)||'
ifeq (y,$(CONFIG_KDEVOPS_WORKFLOW_ENABLE_CXL))
PHONY += linux-cxl
linux-cxl: $(KDEVOPS_NODES)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
--limit '$(BOOTLINUX_LIMIT)' \
$(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--tags 'vars,cxl-build,cxl-install' \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS)
PHONY += linux-help-cxl
linux-help-cxl:
@echo "linux-cxl - Builds cxl_test only and installs it"
LINUX_HELP_EXTRA += linux-help-cxl
endif
HELP_TARGETS+=linux-help-menu
HELP_TARGETS+=$(LINUX_HELP_EXTRA)
HELP_TARGETS+=linux-help-end