Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azldev-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0256227f5434d9e00d7c8501b16848efa400a72b
35d8fae562980db7bda057d79322cc51ddad8d62
38 changes: 0 additions & 38 deletions base/comps/apache-sshd/apache-sshd.comp.toml
Original file line number Diff line number Diff line change
@@ -1,40 +1,2 @@
[components.apache-sshd]

[[components.apache-sshd.overlays]]
description = "Remove maven-remote-resources-plugin (Xpp3Dom classloading clash with plexus-xml/maven4)"
type = "spec-append-lines"
section = "%prep"
lines = ["%pom_remove_plugin :maven-remote-resources-plugin"]

[[components.apache-sshd.overlays]]
description = "Add patch for maven.compiler.release POM property (xmvn javadoc fix)"
type = "patch-add"
file = "add-maven-compiler-release.patch"
source = "add-maven-compiler-release.patch"

[[components.apache-sshd.overlays]]
description = "Use %autosetup to auto-apply all patches"
type = "spec-search-replace"
regex = '%setup -q'
replacement = '%autosetup -p1'

[[components.apache-sshd.overlays]]
description = "Remove explicit %patch call now handled by %autosetup"
type = "spec-search-replace"
regex = '%patch -P0 -p1'
replacement = ''

# AZL ships only java-25-openjdk; there is no java-21-openjdk, so the
# upstream BuildRequires on maven-local-openjdk21 is unsatisfiable.
# Retarget to the openjdk25 variant.
[[components.apache-sshd.overlays]]
description = "Remove BuildRequires on maven-local-openjdk21 — AZL does not ship java-21-openjdk"
type = "spec-remove-tag"
tag = "BuildRequires"
value = "maven-local-openjdk21"

[[components.apache-sshd.overlays]]
description = "Add BuildRequires on maven-local-openjdk25 in place of maven-local-openjdk21"
type = "spec-add-tag"
tag = "BuildRequires"
value = "maven-local-openjdk25"
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[metadata]
category = "azl-compatibility"
Comment thread
liunan-ms marked this conversation as resolved.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Do we have any indication of what these changes were actually doing?


[[overlays]]
description = "Remove maven-remote-resources-plugin (Xpp3Dom classloading clash with plexus-xml/maven4)"
type = "spec-append-lines"
section = "%prep"
lines = ["%pom_remove_plugin :maven-remote-resources-plugin"]

[[overlays]]
description = "Add patch for maven.compiler.release POM property (xmvn javadoc fix)"
type = "patch-add"
file = "add-maven-compiler-release.patch"
source = "../add-maven-compiler-release.patch"

[[overlays]]
description = "Use %autosetup to auto-apply all patches"
type = "spec-search-replace"
regex = "%setup -q"
replacement = "%autosetup -p1"

[[overlays]]
description = "Remove explicit %patch call now handled by %autosetup"
type = "spec-search-replace"
regex = "%patch -P0 -p1"
replacement = ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# AZL ships only java-25-openjdk; there is no java-21-openjdk, so the
# upstream BuildRequires on maven-local-openjdk21 is unsatisfiable.
# Retarget to the openjdk25 variant.

[metadata]
category = "azl-pruning"
upstreamable = false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth considering upstreamability here. Fedora will also need to move to 25 as the default at some point.


[[overlays]]
description = "Remove BuildRequires on maven-local-openjdk21 — AZL does not ship java-21-openjdk"
type = "spec-remove-tag"
tag = "BuildRequires"
value = "maven-local-openjdk21"

[[overlays]]
description = "Add BuildRequires on maven-local-openjdk25 in place of maven-local-openjdk21"
type = "spec-add-tag"
tag = "BuildRequires"
value = "maven-local-openjdk25"
26 changes: 0 additions & 26 deletions base/comps/dnf5/dnf5.comp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,3 @@
without = [
"plugin_rhsm"
]

# Upstream packaging of dnf5 includes compatibility symlinks
# for microdnf and other earlier versions of dnf. We provide the
# same for tdnf, for the benefit of earlier customers of Azure
# Linux.
[[components.dnf5.overlays]]
description = "Report that the dnf5 package provides tdnf for compatibility"
type = "spec-add-tag"
tag = "Provides"
value = "tdnf = %{version}-%{release}"

[[components.dnf5.overlays]]
description = "Include the tdnf compat symlink in the package"
type = "spec-append-lines"
section = "%files"
lines = [
"%{_bindir}/tdnf"
]

[[components.dnf5.overlays]]
description = "Provide /usr/bin/tdnf as a compat symlink to dnf5"
type = "spec-append-lines"
section = "%install"
lines = [
"ln -sr %{buildroot}%{_bindir}/dnf5 %{buildroot}%{_bindir}/tdnf"
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Upstream packaging of dnf5 includes compatibility symlinks
# for microdnf and other earlier versions of dnf. We provide the
# same for tdnf, for the benefit of earlier customers of Azure
# Linux.

[metadata]
category = "azl-compatibility"
upstreamable = false

[[overlays]]
description = "Report that the dnf5 package provides tdnf for compatibility"
type = "spec-add-tag"
tag = "Provides"
value = "tdnf = %{version}-%{release}"

[[overlays]]
description = "Include the tdnf compat symlink in the package"
type = "spec-append-lines"
section = "%files"
lines = ["%{_bindir}/tdnf"]

[[overlays]]
description = "Provide /usr/bin/tdnf as a compat symlink to dnf5"
type = "spec-append-lines"
section = "%install"
lines = ["ln -sr %{buildroot}%{_bindir}/dnf5 %{buildroot}%{_bindir}/tdnf"]
13 changes: 0 additions & 13 deletions base/comps/fcode-utils/fcode-utils.comp.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
[components.fcode-utils]

# GCC 15 defaults to C23 where `bool` is a keyword, conflicting with the
# project's `typedef enum boolean { FALSE = 0, TRUE = -1 } bool;` in
# shared/types.h. Force C17 (with GNU extensions) as a conservative workaround
# until a new upstream release includes the fix.
# Upstream fix: https://github.com/openbios/fcode-utils/issues/20
# TODO: Remove this overlay once a new upstream release (> 1.0.3) is available.
[[components.fcode-utils.overlays]]
description = "Force -std=gnu17 to work around GCC 15 C23 bool keyword conflict (openbios/fcode-utils#20)"
type = "spec-search-replace"
section = "%build"
regex = 'CFLAGS="%\{optflags\}"'
replacement = 'CFLAGS="%{optflags} -std=gnu17"'
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# GCC 15 defaults to C23 where `bool` is a keyword, conflicting with the
# project's `typedef enum boolean { FALSE = 0, TRUE = -1 } bool;` in
# shared/types.h. Force C17 (with GNU extensions) as a conservative workaround
# until a new upstream release includes the fix.
# Upstream fix: https://github.com/openbios/fcode-utils/issues/20
# TODO: Remove this overlay once a new upstream release (> 1.0.3) is available.

[metadata]
category = "azl-compatibility"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worry that azl-compatibility is being more widely used than expected. I see it used for tdnf compat symlinks, which is for compat with previous AZL versions, but this isn't really the same sort of change.

upstreamable = true

[[overlays]]
description = "Force -std=gnu17 to work around GCC 15 C23 bool keyword conflict (openbios/fcode-utils#20)"
type = "spec-search-replace"
section = "%build"
regex = "CFLAGS=\"%\\{optflags\\}\""
replacement = "CFLAGS=\"%{optflags} -std=gnu17\""
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
[components.iscsi-initiator-utils]
# Release: 0.git%{shortcommit0}%{?dist}.2
release = { calculation = "manual" }

# Fedora's 0104-libiscsi-build-fixes.patch hardcodes -L../redhat-linux-build in the libiscsi
# Makefile, assuming the meson build directory is named redhat-linux-build (from Fedora's
# %{_vpath_builddir} = %{_vendor}-%{_target_os}-build where _vendor=redhat). On AZL,
# _vendor=azurelinux, so the directory is azurelinux-linux-build and the linker can't find
# libopeniscsiusr.so. Fix by parameterizing the path via a MESON_BUILDDIR make variable,
# passed from the spec using the standard %{_vpath_builddir} RPM macro.

[[components.iscsi-initiator-utils.overlays]]
description = "Replace hardcoded redhat-linux-build with $(MESON_BUILDDIR) make variable in libiscsi Makefile patch"
type = "file-search-replace"
file = "0104-libiscsi-build-fixes.patch"
regex = 'redhat-linux-build'
replacement = '$(MESON_BUILDDIR)'

[[components.iscsi-initiator-utils.overlays]]
description = "Pass MESON_BUILDDIR=%{_vpath_builddir} to make so libiscsi finds libopeniscsiusr.so in the correct meson build dir"
type = "spec-search-replace"
section = "%build"
regex = '%make_build LDFLAGS'
replacement = '%make_build MESON_BUILDDIR=%{_vpath_builddir} LDFLAGS'
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Fedora's 0104-libiscsi-build-fixes.patch hardcodes -L../redhat-linux-build in the libiscsi
# Makefile, assuming the meson build directory is named redhat-linux-build (from Fedora's
# %{_vpath_builddir} = %{_vendor}-%{_target_os}-build where _vendor=redhat). On AZL,
# _vendor=azurelinux, so the directory is azurelinux-linux-build and the linker can't find
# libopeniscsiusr.so. Fix by parameterizing the path via a MESON_BUILDDIR make variable,
# passed from the spec using the standard %{_vpath_builddir} RPM macro.

[metadata]
category = "azl-compatibility"
upstreamable = true

[[overlays]]
description = "Replace hardcoded redhat-linux-build with $(MESON_BUILDDIR) make variable in libiscsi Makefile patch"
type = "file-search-replace"
file = "0104-libiscsi-build-fixes.patch"
regex = "redhat-linux-build"
replacement = "$(MESON_BUILDDIR)"

[[overlays]]
description = "Pass MESON_BUILDDIR=%{_vpath_builddir} to make so libiscsi finds libopeniscsiusr.so in the correct meson build dir"
type = "spec-search-replace"
section = "%build"
regex = "%make_build LDFLAGS"
replacement = "%make_build MESON_BUILDDIR=%{_vpath_builddir} LDFLAGS"
92 changes: 0 additions & 92 deletions base/comps/kernel-headers/kernel-headers.comp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,102 +16,10 @@ azl_pkgrelease = "1"
# 4th version component from the AZL kernel source (6.18.31.1).
kextraversion = "1"

[[components.kernel-headers.overlays]]
type = "spec-search-replace"
description = "Set specversion to 3-part version matching kernel's specrpmversion"
regex = "%define specversion .+"
replacement = "%define specversion 6.18.31"

[[components.kernel-headers.overlays]]
type = "spec-search-replace"
description = "Set tarfile_release to 3-part version (tarball name uses specversion.kextraversion)"
regex = "%define tarfile_release .+"
replacement = "%define tarfile_release 6.18.31"

[[components.kernel-headers.overlays]]
type = "spec-search-replace"
description = "Set specrelease to kextraversion.azl_pkgrelease.dist so the 4th version component and package release are explicit"
regex = "%define specrelease .+"
replacement = "%define specrelease %{kextraversion}.%{azl_pkgrelease}%{?dist}"

# Build deps (Fedora's spec has none since it uses pre-built headers).
[[components.kernel-headers.overlays]]
type = "spec-add-tag"
description = "Add make as a build dependency for generating headers from source"
tag = "BuildRequires"
value = "make"

[[components.kernel-headers.overlays]]
type = "spec-add-tag"
description = "Add gcc as a build dependency for generating headers from source"
tag = "BuildRequires"
value = "gcc"

[[components.kernel-headers.overlays]]
type = "spec-add-tag"
description = "Add perl as a build dependency for kernel header sanitization scripts"
tag = "BuildRequires"
value = "perl"

[[components.kernel-headers.overlays]]
type = "spec-add-tag"
description = "Add rsync as a build dependency for kernel headers_install"
tag = "BuildRequires"
value = "rsync"

# Source: use full Azure Linux kernel tarball instead of pre-built headers.
[[components.kernel-headers.overlays]]
type = "spec-update-tag"
description = "Use the Azure Linux 6.18.31.1 kernel source tarball instead of Fedora's pre-built headers tarball"
tag = "Source0"
value = "kernel-%{specversion}.%{kextraversion}.tar.gz"

[[components.kernel-headers.source-files]]
filename = "kernel-6.18.31.1.tar.gz"
hash = "1bf684812ff3fc38974dc99b3e2309cb46dc5af93ac794e79a4a4f3dd17debfadb14510aeaaa7fa2d4c6254876a9f8bc67b900a1951c8dda5d94e5f5028a7557"
hash-type = "SHA512"
origin = { type = "download", uri = "https://github.com/microsoft/CBL-Mariner-Linux-Kernel/archive/rolling-lts/azl4/6.18.31.1.tar.gz" }

# Prep: extract Azure Linux tarball.
[[components.kernel-headers.overlays]]
type = "spec-search-replace"
description = "Extract the Azure Linux 6.18.31.1 kernel source archive layout"
regex = "%setup -q -c"
replacement = "%setup -q -n CBL-Mariner-Linux-Kernel-rolling-lts-azl4-%{specversion}.%{kextraversion}"

# Build: generate native + cross headers from Azure Linux kernel source.
# Uses make headers_install which produces properly sanitized userspace headers.
# Detects native arch and cross-compiles for the other (x86_64 <-> arm64).
[[components.kernel-headers.overlays]]
type = "spec-append-lines"
section = "%build"
lines = ["""
make mrproper
make headers_install INSTALL_HDR_PATH=headers-native

# Determine native kernel arch and cross-compile for the other
native_karch=$(uname -m | sed 's/x86_64/x86/;s/aarch64/arm64/')
for cross_arch in arm64 x86; do
[ "$cross_arch" = "$native_karch" ] && continue
make ARCH=$cross_arch headers_install INSTALL_HDR_PATH=headers-$cross_arch
done"""]

# Install: copy headers_install output into RPM buildroot, replacing Fedora's copy logic.
# The exit 0 at the end short-circuits the original Fedora install logic.
[[components.kernel-headers.overlays]]
type = "spec-prepend-lines"
section = "%install"
lines = ["""
native_karch=$(uname -m | sed 's/x86_64/x86/;s/aarch64/arm64/')

mkdir -p $RPM_BUILD_ROOT%{_includedir}
cp -rv headers-native/include/* $RPM_BUILD_ROOT%{_includedir}

for cross_arch in arm64 x86; do
[ "$cross_arch" = "$native_karch" ] && continue
cross_arch_includedir=$RPM_BUILD_ROOT%{_prefix}/${cross_arch}-linux-gnu/include
mkdir -p $cross_arch_includedir
cp -rv headers-$cross_arch/include/* $cross_arch_includedir
done

exit 0"""]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[metadata]
category = "azl-platform-adaptation"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The azldev docs call out this category for "architecture-specific" adaptation. Is this architectural?

upstreamable = false

[[overlays]]
type = "spec-search-replace"
description = "Set specversion to 3-part version matching kernel's specrpmversion"
regex = "%define specversion .+"
replacement = "%define specversion 6.18.31"

[[overlays]]
type = "spec-search-replace"
description = "Set tarfile_release to 3-part version (tarball name uses specversion.kextraversion)"
regex = "%define tarfile_release .+"
replacement = "%define tarfile_release 6.18.31"
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[metadata]
category = "azl-release-management"
upstreamable = false

[[overlays]]
type = "spec-search-replace"
description = "Set specrelease to kextraversion.azl_pkgrelease.dist so the 4th version component and package release are explicit"
regex = "%define specrelease .+"
replacement = "%define specrelease %{kextraversion}.%{azl_pkgrelease}%{?dist}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Build deps (Fedora's spec has none since it uses pre-built headers).

[metadata]
category = "azl-compatibility"
upstreamable = false

[[overlays]]
type = "spec-add-tag"
description = "Add make as a build dependency for generating headers from source"
tag = "BuildRequires"
value = "make"

[[overlays]]
type = "spec-add-tag"
description = "Add gcc as a build dependency for generating headers from source"
tag = "BuildRequires"
value = "gcc"

[[overlays]]
type = "spec-add-tag"
description = "Add perl as a build dependency for kernel header sanitization scripts"
tag = "BuildRequires"
value = "perl"

[[overlays]]
type = "spec-add-tag"
description = "Add rsync as a build dependency for kernel headers_install"
tag = "BuildRequires"
value = "rsync"
Loading
Loading