armbian-next: artifacts: introduce kernel/u-boot artifacts; git ref2info; "memoizer"; some hashing

- artifacts: u-boot/kernel - pt7 - adapt legacy/artifact versions; use common `capture_rename_legacy_debs_into_artifacts()`
- artifacts: u-boot - pt6: add artifact for u-boot
  - use artifact version / reason in actual u-boot .deb if present
- artifacts: kernel - pt5: tune kernel version, refactor
- artifacts: kernel - pt4: squash unrelated bugs that show up; move `prepare_compilation_vars()` to default build
- artifacts: kernel - pt3: drivers+patches+.config hashing
  - split file hashing function from drivers-harness; fix it so filenames are relative and sorted; sort from ${SRC}, always
  - aplit prepare_kernel_config_core_or_userpatches() from `kernel_config_initialize()`
- artifacts: kernel - pt2:  memoizing git ref2info
- artifacts: kernel - pt1:  versioning
This commit is contained in:
Ricardo Pardini
2023-01-29 12:47:40 +01:00
parent 19aa7e95cf
commit bef7f8fee4
20 changed files with 791 additions and 43 deletions

View File

@@ -41,7 +41,18 @@ function prepare_kernel_packaging_debs() {
# Some variables and settings used throughout the script
declare kernel_version_family="${kernel_version}-${LINUXFAMILY}"
declare package_version="${REVISION}"
# Package version. Affects users upgrading from repo!
declare package_version="${REVISION}" # default, "classic" Armbian non-version.
# If we're building an artifact, use the pre-determined artifact version.
if [[ "${artifact_version:-""}" != "" ]]; then
if [[ "${artifact_version}" == "undetermined" ]]; then
exit_with_error "Undetermined artifact version during kernel deb packaging. This is a bug, report it."
fi
display_alert "Using artifact version for kernel package version" "${artifact_version}" "info"
package_version="${artifact_version}"
fi
display_alert "Kernel .deb package version" "${package_version}" "info"
# show incoming tree
#display_alert "Kernel install dir" "incoming from KBUILD make" "debug"
@@ -140,7 +151,9 @@ function create_kernel_deb() {
#display_alert "Package dir" "for package ${package_name}" "debug"
#run_host_command_logged tree -C -h -d --du "${package_directory}"
run_host_command_logged dpkg-deb ${DEB_COMPRESS:+-Z$DEB_COMPRESS} --build "${package_directory}" "${deb_output_dir}" # not KDEB compress, we're not under a Makefile
# @TODO: hmm, why doesn't this use fakeroot_dpkg_deb_build() ?
declare final_deb_filename="${deb_output_dir}/${package_name}_${REVISION}_${ARCH}.deb" # for compatibility with non-artifacts
run_host_command_logged dpkg-deb ${DEB_COMPRESS:+-Z$DEB_COMPRESS} --build "${package_directory}" "${final_deb_filename}" # not KDEB compress, we're not under a Makefile
done_with_temp_dir "${cleanup_id}" # changes cwd to "${SRC}" and fires the cleanup function early
}
@@ -210,7 +223,7 @@ function kernel_package_callback_linux_image() {
Maintainer: ${MAINTAINER} <${MAINTAINERMAIL}>
Section: kernel
Provides: linux-image, linux-image-armbian, armbian-$BRANCH
Description: Linux kernel, armbian version $kernel_version_family $BRANCH
Description: Armbian Linux $BRANCH kernel image ${artifact_version_reason:-"${kernel_version_family}"}
This package contains the Linux kernel, modules and corresponding other
files, kernel_version_family: $kernel_version_family.
CONTROL_FILE
@@ -263,7 +276,7 @@ function kernel_package_callback_linux_dtb() {
Package: ${package_name}
Architecture: ${ARCH}
Provides: linux-dtb, linux-dtb-armbian, armbian-$BRANCH
Description: Armbian Linux DTB, version ${kernel_version_family} $BRANCH
Description: Armbian Linux $BRANCH DTBs ${artifact_version_reason:-"${kernel_version_family}"}
This package contains device blobs from the Linux kernel, version ${kernel_version_family}
CONTROL_FILE
@@ -379,7 +392,7 @@ function kernel_package_callback_linux_headers() {
Architecture: ${ARCH}
Provides: linux-headers, linux-headers-armbian, armbian-$BRANCH
Depends: make, gcc, libc6-dev, bison, flex, libssl-dev, libelf-dev
Description: Linux kernel headers for ${kernel_version_family}
Description: Armbian Linux $BRANCH headers ${artifact_version_reason:-"${kernel_version_family}"}
This package provides kernel header files for ${kernel_version_family}
.
This is useful for DKMS and building of external modules.
@@ -454,7 +467,7 @@ function kernel_package_callback_linux_headers_full_source() {
Architecture: ${ARCH}
Provides: linux-headers, linux-headers-armbian, armbian-$BRANCH
Depends: make, gcc, libc6-dev, bison, flex, libssl-dev, libelf-dev
Description: Linux kernel headers for ${kernel_version_family} - based on full source
Description: Armbian Linux $BRANCH full-source headers ${artifact_version_reason:-"${kernel_version_family}"}
This package provides kernel header files for ${kernel_version_family}
.
This is useful for DKMS and building of external modules.