@@ -206,34 +206,57 @@ $(build)/$(BOARD)/$(LINUX_IMAGE_FILE).bundled: \
206
206
@touch $@ # force a timestamp update
207
207
@sha256sum "$@" | tee -a "$(HASHES)"
208
208
209
- # modifydefconfig target allows us edit current in tree defconfig config
210
- # under linux decompressed+patched directory and put it back in git tree
211
- # to check changes with git difftool
212
- # useful for development cycle of linux kernel version bumps.
213
- linux.modifydefconfig :
209
+ # modify_and_save_defconfig_in_place target allows us edit current in tree defconfig config
210
+ # under linux decompressed+patched directory through menuconfig
211
+ # and put it back in git tree to check changes with git difftool iteratively
212
+ # Useful for development cycle of linux kernel version bumps if stored in defconfig format .
213
+ linux.modify_and_save_defconfig_in_place :
214
214
cp "$(pwd)/$(linux_kconfig)" "$(build)/$(linux_dir)/.config" && \
215
215
$(MAKE) \
216
216
-C "$(build)/$(linux_base_dir)" \
217
217
O="$(build)/$(linux_dir)" \
218
218
ARCH="$(LINUX_ARCH)" \
219
+ CROSS_COMPILE="$(CROSS)" \
219
220
menuconfig && \
220
221
$(MAKE) \
221
222
-C "$(build)/$(linux_base_dir)" \
222
223
O="$(build)/$(linux_dir)" \
223
224
ARCH="$(LINUX_ARCH)" \
224
- savedefconfig && \
225
- mv "$(build)/$(linux_dir)/defconfig" "$(pwd)/$(linux_kconfig)"
225
+ CROSS_COMPILE="$(CROSS)" \
226
+ savedefconfig \
227
+ && mv "$(build)/$(linux_dir)/defconfig" "$(pwd)/$(linux_kconfig)"
228
+
229
+ # modify_and_save_oldconfig_in_place target allows us edit current config in oldconfig format
230
+ # under linux decompressed+patched directory through menuconfig
231
+ # and put it back in git tree to check changes with git difftool iteratively
232
+ # Useful for development cycle of linux kernel version bumps if stored in oldconfig format.
233
+ linux.modify_and_save_oldconfig_in_place:
234
+ mkdir -p "$(build)/$(linux_dir)" \
235
+ && cp "$(pwd)/$(linux_kconfig)" "$(build)/$(linux_dir)/.config" \
236
+ && $(MAKE) -C "$(build)/$(linux_base_dir)" \
237
+ O="$(build)/$(linux_dir)" \
238
+ ARCH="$(LINUX_ARCH)" \
239
+ CROSS_COMPILE="$(CROSS)" \
240
+ menuconfig \
241
+ && $(MAKE) -C "$(build)/$(linux_base_dir)" \
242
+ O="$(build)/$(linux_dir)" \
243
+ ARCH="$(LINUX_ARCH)" \
244
+ CROSS_COMPILE="$(CROSS)" \
245
+ olddefconfig \
246
+ && mv "$(build)/$(linux_dir)/.config" "$(pwd)/$(linux_kconfig)"
226
247
227
- # generateoldconfig target allows us to copy current in git tree defconfig
248
+ # generate_old_config target allows us to copy current in git tree defconfig
228
249
# into decompressed linux directory's .config file. This permits
229
250
# us to edit that .config file and remove unneeded stuff prior
230
- # of calling saveconfig target from heads main directory (cd -)
231
- linux.generateoldconfig:
251
+ # of calling save_defconfig target from heads main directory (cd -)
252
+ # to store it where the board expects it stored and used from.
253
+ linux.generate_old_config:
232
254
mkdir -p "$(build)/$(linux_dir)" \
233
255
&& cp "$(pwd)/$(linux_kconfig)" "$(build)/$(linux_dir)/.config" \
234
256
&& $(MAKE) -C "$(build)/$(linux_base_dir)" \
235
257
O="$(build)/$(linux_dir)" \
236
258
ARCH="$(LINUX_ARCH)" \
259
+ CROSS_COMPILE="$(CROSS)" \
237
260
olddefconfig \
238
261
&& echo "" \
239
262
&& echo "You can now edit $(build)/$(linux_dir)/.config" \
@@ -243,6 +266,15 @@ linux.generateoldconfig:
243
266
&& echo "" \
244
267
&& echo "To save chances in git tree for review, type:" \
245
268
&& echo "make BOARD=XYZ linux.saveconfig"
269
+ linux.generate_and_save-versioned-oldconfig:
270
+ mkdir -p "$(build)/$(linux_dir)" \
271
+ && cp "$(pwd)/$(linux_kconfig)" "$(build)/$(linux_dir)/.config" \
272
+ && $(MAKE) -C "$(build)/$(linux_base_dir)" \
273
+ O="$(build)/$(linux_dir)" \
274
+ ARCH="$(LINUX_ARCH)" \
275
+ CROSS_COMPILE="$(CROSS)" \
276
+ olddefconfig \
277
+ && mv "$(build)/$(linux_dir)/.config" "$(pwd)/$(linux_kconfig)_oldconfig_$(CONFIG_LINUX_VERSION)"
246
278
247
279
# menuconfig target allows us to easily reconfigure this Linux kernel
248
280
# Afterwards make linux.saveconfig to generate a minimal config from it
@@ -251,14 +283,47 @@ linux.menuconfig:
251
283
-C "$(build)/$(linux_base_dir)" \
252
284
O="$(build)/$(linux_dir)" \
253
285
ARCH="$(LINUX_ARCH)" \
286
+ CROSS_COMPILE="$(CROSS)" \
254
287
menuconfig \
255
288
289
+ #Add some tooling to permit us to keep track of what we currently use.
290
+ # regenerate_and_save_defconfig: regenerate a defconfig from current board linux config and overwrites it
291
+ # regenerate_and_save_versioned_defconfig : same as avove but doesn't overwrite: writes it in seperate versioned file
292
+ linux.regenerate_and_save_defconfig:
293
+ mkdir -p "$(build)/$(linux_dir)" \
294
+ && cp "$(pwd)/$(linux_kconfig)" "$(build)/$(linux_dir)/.config" \
295
+ && $(MAKE) -C "$(build)/$(linux_base_dir)" \
296
+ O="$(build)/$(linux_dir)" \
297
+ ARCH="$(LINUX_ARCH)" \
298
+ CROSS_COMPILE="$(CROSS)" \
299
+ savedefconfig \
300
+ && mv "$(build)/$(linux_dir)/defconfig" "$(pwd)/$(linux_kconfig)"
301
+ linux.regenerate_and_save_versioned_defconfig:
302
+ mkdir -p "$(build)/$(linux_dir)" \
303
+ && cp "$(pwd)/$(linux_kconfig)" "$(build)/$(linux_dir)/.config" \
304
+ && $(MAKE) -C "$(build)/$(linux_base_dir)" \
305
+ O="$(build)/$(linux_dir)" \
306
+ ARCH="$(LINUX_ARCH)" \
307
+ savedefconfig \
308
+ && mv "$(build)/$(linux_dir)/defconfig" "$(pwd)/$(linux_kconfig)_defconfig_$(CONFIG_LINUX_VERSION)"
309
+
256
310
# The config file in the repo is stored as a "defconfig" format
257
311
# which only includes the options that have changed from the defaults.
258
- linux.saveconfig:
312
+ # Here dave_defconfig takes .config under extracted linux dir and save it back to where board expects it
313
+ linux.save_defconfig:
314
+ $(MAKE) \
315
+ -C "$(build)/$(linux_base_dir)" \
316
+ O="$(build)/$(linux_dir)" \
317
+ ARCH="$(LINUX_ARCH)" \
318
+ CROSS_COMPILE="$(CROSS)" \
319
+ savedefconfig \
320
+ && mv "$(build)/$(linux_dir)/defconfig" "$(pwd)/$(linux_kconfig)"
321
+ #Same as above, but instead of overwriting the board's expected file, we store it in a file versioned by kernel version
322
+ linux.save_versioned_defconfig:
259
323
$(MAKE) \
260
324
-C "$(build)/$(linux_base_dir)" \
261
325
O="$(build)/$(linux_dir)" \
262
326
ARCH="$(LINUX_ARCH)" \
263
- savedefconfig
264
- mv "$(build)/$(linux_dir)/defconfig" "$(pwd)/$(linux_kconfig)"
327
+ CROSS_COMPILE="$(CROSS)" \
328
+ savedefconfig \
329
+ && mv "$(build)/$(linux_dir)/defconfig" "$(pwd)/$(linux_kconfig)_defconfig_$(CONFIG_LINUX_VERSION)"
0 commit comments