Files
build/lib/functions/main/default-build.sh
Ricardo Pardini d890b418c7 kernel/uboot/atf: introduce kernel-patch, uboot-patch, atf-patch, uboot-config, kernel-config CLI commands; enhanced manual patching; block deprecated ways
- all interactive commands now **don't build the artifact** anymore; just patches/.configs are produced and then build ends
  - user is required to put the produced patches in the right place and build again, for full consistency
- split ATF and U-BOOT manual patching process; use CLI command `atf-patch` to patch ATF, and `uboot-patch` to patch u-boot
- non-interactive artifact builds are now 100% sans-stdin
- introduce `uboot-config` CLI command; still experimental, only produces a defconfig and not a patch
- reworked `userpatch_create()` to be (hopefully) more useful:
  - detects a previous patch and offers to apply it before continuing
  - enters a loop showing the diff, and only proceeds when user indicates he's happy with the patch
  - produces `mbox`-formatted patches via `format-patch` and standard Armbian parameters
  - uses MAINTAINER and MAINTAINERMAIL instead of git configuration (so it works in containers)
- don't allow image builds with any patching or configuring _at all_ (it has been deprecated with a warning for months already, and results are inconsistent)
2023-05-01 22:46:55 +02:00

46 lines
2.4 KiB
Bash

#!/usr/bin/env bash
#
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2013-2023 Igor Pecovnik, igor@armbian.com
#
# This file is a part of the Armbian Build Framework
# https://github.com/armbian/build/
# This does NOT run under the logging manager.
function full_build_packages_rootfs_and_image() {
error_if_kernel_only_set
# Detour, stop if KERNEL_CONFIGURE=yes
if [[ "${KERNEL_CONFIGURE}" == "yes" ]]; then
display_alert "KERNEL_CONFIGURE=yes during image build is not supported anymore." "First, run './compile.sh BOARD=${BOARD} BRANCH=${BRANCH} kernel-config'; then commit your changes; then build the image as normal. This workflow ensures consistent hashing results." "wrn"
exit_with_error "KERNEL_CONFIGURE=yes during image build is not supported anymore. Please use the new 'kernel-config' CLI command."
fi
# Detour, stop if UBOOT_CONFIGURE=yes
if [[ "${UBOOT_CONFIGURE}" == "yes" ]]; then
display_alert "UBOOT_CONFIGURE=yes during image build is not supported anymore." "First, run './compile.sh BOARD=${BOARD} BRANCH=${BRANCH} uboot-config'; then commit your changes; then build the image as normal. This workflow ensures consistent hashing results." "wrn"
exit_with_error "UBOOT_CONFIGURE=yes during image build is not supported anymore. Please use the new 'uboot-config' CLI command."
fi
# Detour, stop if CREATE_PATCHES=yes.
if [[ "${CREATE_PATCHES}" == "yes" || "${CREATE_PATCHES_ATF}" == "yes" ]]; then
display_alert "CREATE_PATCHES=yes during image build is not supported anymore." "First, run './compile.sh BOARD=${BOARD} BRANCH=${BRANCH} kernel-patch'; then move the patch to the correct place and commit your changes; then build the image as normal. This workflow ensures consistent hashing results." "wrn"
exit_with_error "CREATE_PATCHES=yes during image build is not supported anymore. Please use the new 'kernel-patch' / 'uboot-patch' / 'atf-patch' CLI commands."
fi
main_default_build_packages # has its own logging sections # requires aggregation
# build rootfs and image
display_alert "Building image" "${BOARD}" "target-started"
assert_requires_aggregation # Bombs if aggregation has not run
build_rootfs_and_image # old "debootstrap-ng"; has its own logging sections.
display_alert "Done building image" "${BOARD}" "target-reached"
}
function do_with_default_build() {
main_default_start_build # Has its own logging, prepares workdir, does prepare_host, aggregation, and
"${@}"
main_default_end_build
}