diff --git a/default-package-config.sh b/default-package-config.sh index c30d3ac..e1fd147 100644 --- a/default-package-config.sh +++ b/default-package-config.sh @@ -99,9 +99,14 @@ function kernel_build() { # Canonical's releases and our releases. # local canonical_abinum delphix_abinum kernel_release kernel_version + canonical_abinum=$(fakeroot debian/rules printenv | grep -E '^abinum ' | cut -d= -f2 | tr -d '[:space:]') delphix_abinum="${canonical_abinum}-$(date -u +"dx%Y%m%d%H")-$(git rev-parse --short HEAD)" + kernel_release=$(fakeroot debian/rules printenv | grep -E '^release ' | cut -d= -f2 | tr -d '[:space:]') + if [[ -z "$kernel_release" ]]; then + kernel_release=$(fakeroot debian/rules printenv | grep -E '^DEB_VERSION_UPSTREAM ' | cut -d= -f2 | tr -d '[:space:]') + fi # # We record the kernel version into a file. This field is consumed @@ -272,7 +277,7 @@ function kernel_update_upstream() { local tag_prefix_flavour case "${platform}" in generic) - tag_prefix_flavour="Ubuntu" + tag_prefix_flavour="Ubuntu-hwe" ;; aws | azure | gcp | oracle) tag_prefix_flavour="Ubuntu-${platform}" diff --git a/lib/common.sh b/lib/common.sh index 039bf42..57de1d3 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -1157,10 +1157,17 @@ function get_kernel_version_for_platform_from_apt() { # for kernel version '4.15.0-1027-aws'. We use this dependency to figure # out the default kernel version for a given platform. # + # The "generic" platform is a special case, since we want to use the + # hwe kernel image instead of the regular generic image. + # # Note that while the default kernel is usually also the latest # available, it is not always the case. # - package="linux-image-${platform}" + if [[ "$platform" != generic ]] && [[ "$UBUNTU_DISTRIBUTION" == focal ]]; then + package="linux-image-${platform}" + else + package="linux-image-${platform}-hwe-24.04" + fi if [[ "$(apt-cache show --no-all-versions "$package" \ 2>/dev/null | grep Depends)" =~ linux-image-([^,]*-${platform}) ]]; then