Skip to content
Draft
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: 2 additions & 0 deletions base/comps/components.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,7 @@ includes = ["**/*.comp.toml", "component-check-disablement.toml", "component-min
[components.hipsparse]
[components.hipsparselt]
[components.hiredis]
[components.hivex]
[components.hostname]
[components.hspell]
[components.httpcomponents-client]
Expand Down Expand Up @@ -1739,6 +1740,7 @@ includes = ["**/*.comp.toml", "component-check-disablement.toml", "component-min
[components.libgee]
[components.libgeotiff]
[components.libgexiv2]
[components.libguestfs]
[components.libgit2]
[components.libglade2]
[components.libglib-testing]
Expand Down
8 changes: 0 additions & 8 deletions base/comps/hivex/hivex.comp.toml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From: Azure Linux <azurelinux@microsoft.com>
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.

Is the code in question just detecting a Fedora-like distro? Would looking at ID_LIKE be a viable approach rather than adding yet another distro to the list?

Copy link
Copy Markdown
Collaborator Author

@christopherco christopherco Jun 5, 2026

Choose a reason for hiding this comment

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

Good callout. Right now, the supermin os_release.ml parser only extracts ID today, so there's no ID_LIKE accessor yet.

https://github.com/libguestfs/supermin/blob/master/src/os_release.ml#L30-L32
https://github.com/libguestfs/supermin/blob/master/src/ph_rpm.ml#L35

Adding ID_LIKE properly means extending the parser + new accessor + reworking fedora_detect() to match on the ID_LIKE field, which is the kind of change that should be for upstream discussion.

For now, I propose we keep this minimal list-add as a downstream patch to unblock libguestfs on AZL4 so we can run static vm image testing through azldev in the AZL4 dev environment, and I can also raise the ID_LIKE generalization in the upstream discussion for supermin as a real architectural fix.

Date: Thu, 4 Jun 2026 00:00:00 +0000
Subject: [PATCH] Recognize Azure Linux as an rpm/dnf distro

Azure Linux sets ID=azurelinux (with ID_LIKE=fedora) in
/etc/os-release and does not ship an /etc/redhat-release or
/etc/fedora-release marker file. supermin's os-release parser only
inspects the ID field, so fedora_detect() fails to recognize Azure
Linux and supermin aborts with "could not detect package manager used
by this system or distro".

Add "azurelinux" to the list of recognized rpm/dnf distro IDs so that
supermin (and libguestfs, which uses supermin to build its appliance)
works on Azure Linux.

This should be submitted upstream:
https://github.com/libguestfs/supermin
---
src/ph_rpm.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml
index 5061d32..db82819 100644
--- a/src/ph_rpm.ml
+++ b/src/ph_rpm.ml
@@ -32,7 +32,7 @@ let stringset_of_list pkgs =
let fedora_detect () =
Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () &&
(Config.yumdownloader <> "no" || Config.dnf <> "no") &&
- (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler"; "anolis"; "KylinSecOS" ] ||
+ (List.mem (Os_release.get_id ()) [ "azurelinux"; "fedora"; "rhel"; "centos"; "openEuler"; "anolis"; "KylinSecOS" ] ||
try
(stat "/etc/redhat-release").st_kind = S_REG ||
(stat "/etc/fedora-release").st_kind = S_REG ||
14 changes: 14 additions & 0 deletions base/comps/supermin/supermin.comp.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[components.supermin]

# supermin's package-manager auto-detection (src/ph_rpm.ml) only inspects the
# os-release ID field against a hard-coded allow-list and does not consider
# ID_LIKE. Azure Linux sets ID=azurelinux (ID_LIKE=fedora) and ships no
# /etc/redhat-release marker, so without this patch supermin aborts with
# "could not detect package manager used by this system or distro" — which
# also breaks the libguestfs appliance build. The patch adds "azurelinux" to
# the recognized rpm/dnf distro list. Should be submitted upstream:
# https://github.com/libguestfs/supermin
[[components.supermin.overlays]]
description = "Teach supermin to recognize Azure Linux (ID=azurelinux) as an rpm/dnf distro so the package-manager detection used by --build/--prepare and the libguestfs appliance works."
type = "patch-add"
source = "0001-Recognize-Azure-Linux-as-an-rpm-dnf-distro.patch"
2 changes: 1 addition & 1 deletion locks/hivex.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
version = 1
import-commit = 'f3ef8b3c8adeb35ddddd03deb8a3091e64294953'
upstream-commit = 'f3ef8b3c8adeb35ddddd03deb8a3091e64294953'
input-fingerprint = 'sha256:682cbdde917f423c701c9d2d912c864ec8de5c6427c1c93a95bfd9c93a376e98'
input-fingerprint = 'sha256:141c5c62e7b4b1d87653b5da7643147d5385732141ff55810425fd861eafbe1a'
resolution-input-hash = 'sha256:466421704711c4fd3c71f0b2ed715a0e61d49e3e26f3a2637fee755795849c8e'
6 changes: 6 additions & 0 deletions locks/libguestfs.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Managed by azldev component update. Do not edit manually.
version = 1
import-commit = '18dc2aa8b85ed23a60567fd0295f16ebd462db32'
upstream-commit = '18dc2aa8b85ed23a60567fd0295f16ebd462db32'
input-fingerprint = 'sha256:131350ed3666e40f286e94bd9189590bbb032db4a8d8e8d452d7e4eabc4a4c5f'
resolution-input-hash = 'sha256:466421704711c4fd3c71f0b2ed715a0e61d49e3e26f3a2637fee755795849c8e'
6 changes: 6 additions & 0 deletions locks/supermin.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Managed by azldev component update. Do not edit manually.
version = 1
import-commit = 'dbb5a2fe0e36ccacdf586f2c846094f20d7d5a88'
upstream-commit = 'dbb5a2fe0e36ccacdf586f2c846094f20d7d5a88'
input-fingerprint = 'sha256:279d005ea057bc3934bc8d22924f310986829fd2b28f62b4dc3cc0473d838b81'
resolution-input-hash = 'sha256:466421704711c4fd3c71f0b2ed715a0e61d49e3e26f3a2637fee755795849c8e'
3 changes: 0 additions & 3 deletions specs/h/hivex/hivex.azl.macros

This file was deleted.

6 changes: 1 addition & 5 deletions specs/h/hivex/hivex.spec
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# This spec file has been modified by azldev to include build configuration overlays.
# Do not edit manually; changes may be overwritten.

# All Azure Linux specs with overlays include this macro file, irrespective of whether new macros have been added.
%{load:%{_sourcedir}/hivex.azl.macros}

# Conditionalize Ocaml support. This looks ass-backwards, but it's not.
%ifarch %{ix86}
%bcond_with ocaml
Expand All @@ -16,7 +13,7 @@

Name: hivex
Version: 1.3.24
Release: 11%{?dist}
Release: 12%{?dist}
Summary: Read and write Windows Registry binary hive files

License: LGPL-2.1-only AND LGPL-2.0-or-later AND GPL-2.0-or-later
Expand All @@ -31,7 +28,6 @@ Source1: http://libguestfs.org/download/hivex/%{name}-%{version}.tar.gz.s
%if 0%{verify_tarball_signature}
Source2: libguestfs.keyring
%endif
Source9999: hivex.azl.macros

BuildRequires: make
BuildRequires: autoconf, automake, libtool, gettext-devel
Expand Down
37 changes: 37 additions & 0 deletions specs/l/libguestfs/README-replacement.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Libguestfs is a set of tools and a library for accessing and modifying
guest disk images. For more information see the home page:

http://libguestfs.org/

For discussion, development, patches, etc. please use the mailing
list:

http://www.redhat.com/mailman/listinfo/libguestfs

This package comes with a lot of help and examples to get you started.

The first place to start are the manual pages. Type:

man guestfs
man guestfs-faq
man guestfs-release-notes
man guestfish
man virt-cat # and other virt-* tools

If you install the libguestfs-devel package, then in the
/usr/share/doc/libguestfs-devel/ directory you will find other
documentation including:

- BUGS: list of open bugs in this version

- ChangeLog.gz: the detailed list of changes in this version

- HACKING: how to extend libguestfs

- TODO: ideas for extending libguestfs

- *.c: example C programs using the API

- *.xml.gz: example virt-inspector output (compressed)

- virt-inspector.rng: virt-inspector RelaxNG schema
56 changes: 56 additions & 0 deletions specs/l/libguestfs/copy-patches.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash -

set -e

# Maintainer script to copy patches from the git repo to the current
# directory. It's normally only used downstream (ie. in RHEL). Use
# it like this:
# ./copy-patches.sh

rhel_version=9.0.0

# Check we're in the right directory.
if [ ! -f libguestfs.spec ]; then
echo "$0: run this from the directory containing 'libguestfs.spec'"
exit 1
fi

git_checkout=$HOME/d/libguestfs-rhel-$rhel_version
if [ ! -d $git_checkout ]; then
echo "$0: $git_checkout does not exist"
echo "This script is only for use by the maintainer when preparing a"
echo "libguestfs release on RHEL."
exit 1
fi

# Get the base version of libguestfs.
version=`grep '^Version:' libguestfs.spec | awk '{print $2}'`
tag="v$version"

# Remove any existing patches.
git rm -f [0-9]*.patch ||:
rm -f [0-9]*.patch

# Get the patches.
(cd $git_checkout; rm -f [0-9]*.patch; git format-patch -N --submodule=diff $tag)
mv $git_checkout/[0-9]*.patch .

# Remove any not to be applied.
rm -f *NOT-FOR-RPM*.patch

# Add the patches.
git add [0-9]*.patch

# Print out the patch lines.
echo
echo "--- Copy the following text into libguestfs.spec file"
echo

echo "# Patches."
for f in [0-9]*.patch; do
n=`echo $f | awk -F- '{print $1}'`
echo "Patch$n: $f"
done

echo
echo "--- End of text"
6 changes: 6 additions & 0 deletions specs/l/libguestfs/guestfish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Guestfish colour prompts. See PROMPT in guestfish(1).
GUESTFISH_PS1='\[\e[1;32m\]><fs>\[\e[0;31m\] '
GUESTFISH_OUTPUT='\e[0m'
GUESTFISH_RESTORE="$GUESTFISH_OUTPUT"
GUESTFISH_INIT='\e[1;34m'
export GUESTFISH_PS1 GUESTFISH_OUTPUT GUESTFISH_RESTORE GUESTFISH_INIT
Binary file added specs/l/libguestfs/libguestfs.keyring
Binary file not shown.
Loading
Loading