-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Azure Linux looks a lot like Fedora Linux so we opt to share configuration between Azure and Fedora/CentOS and inherit the Azure definition from Fedora.
- Loading branch information
1 parent
b7b5405
commit 2aa4870
Showing
19 changed files
with
151 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,6 +102,7 @@ jobs: | |
- fedora | ||
- opensuse | ||
- ubuntu | ||
- azure | ||
tools: | ||
- arch | ||
- debian | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# SPDX-License-Identifier: LGPL-2.1-or-later | ||
|
||
[Match] | ||
Distribution=azure | ||
|
||
[Distribution] | ||
Release=3.0 | ||
|
||
[Content] | ||
# The unsigned-shim package tries to install to the same location as the signed shim package so we can't install and | ||
# test unsigned shim. | ||
ShimBootloader=none | ||
Packages= | ||
kernel | ||
systemd-networkd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ Release=rawhide | |
|
||
[Content] | ||
Packages= | ||
kernel-core | ||
qemu-user-static | ||
rpmautospec | ||
systemd-networkd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ Architecture=x86-64 | |
[Content] | ||
Packages= | ||
amd-ucode-firmware | ||
kernel-uki-virt | ||
shim-unsigned-x64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,4 @@ Architecture=x86-64 | |
Packages= | ||
grub2-efi-x64-modules | ||
grub2-pc | ||
kernel-uki-virt | ||
microcode_ctl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# SPDX-License-Identifier: LGPL-2.1+ | ||
|
||
from collections.abc import Iterable | ||
|
||
from mkosi.config import Architecture | ||
from mkosi.context import Context | ||
from mkosi.distributions import ( | ||
fedora, | ||
join_mirror, | ||
) | ||
from mkosi.installer.dnf import Dnf | ||
from mkosi.installer.rpm import RpmRepository, find_rpm_gpgkey, setup_rpm | ||
from mkosi.log import die | ||
from mkosi.util import listify | ||
|
||
|
||
class Installer(fedora.Installer): | ||
@classmethod | ||
def pretty_name(cls) -> str: | ||
return "Azure Linux" | ||
|
||
@classmethod | ||
def default_release(cls) -> str: | ||
return "3.0" | ||
|
||
@classmethod | ||
def filesystem(cls) -> str: | ||
return "ext4" | ||
|
||
@classmethod | ||
def setup(cls, context: Context) -> None: | ||
Dnf.setup(context, cls.repositories(context), filelists=False) | ||
setup_rpm(context, dbpath="/var/lib/rpm") | ||
|
||
@classmethod | ||
def install(cls, context: Context) -> None: | ||
cls.install_packages(context, ["filesystem", "azurelinux-release"], apivfs=False) | ||
|
||
@classmethod | ||
@listify | ||
def repositories(cls, context: Context) -> Iterable[RpmRepository]: | ||
gpgkey = find_rpm_gpgkey(context, "MICROSOFT-RPM-GPG-KEY") | ||
if not gpgkey: | ||
die("MICROSOFT-RPM-GPG-KEY GPG key not found in /usr/share/distribution-gpg-keys/azure-linux", | ||
hint="Make sure the distribution-gpg-keys package is installed") | ||
|
||
gpgurls = (gpgkey,) | ||
|
||
if context.config.local_mirror: | ||
yield RpmRepository("base", f"baseurl={context.config.local_mirror}", gpgurls) | ||
return | ||
|
||
mirror = context.config.mirror or "https://packages.microsoft.com/azurelinux" | ||
url = join_mirror(mirror, f"{context.config.release}/preview") | ||
|
||
for repo in ("base", "extended", "ms-oss", "ms-non-oss", "cloud-native", "NVIDIA"): | ||
yield RpmRepository( | ||
repo, | ||
f"baseurl={url}/{repo}/$basearch", | ||
gpgurls, | ||
) | ||
|
||
for repo in ("base", "cloud-native", "extended"): | ||
yield RpmRepository( | ||
f"{repo}-debuginfo", | ||
f"baseurl={url}/{repo}/debuginfo/$basearch", | ||
gpgurls, | ||
enabled=False, | ||
) | ||
|
||
for repo in ("base", "cloud-native", "extended", "ms-oss"): | ||
yield RpmRepository( | ||
f"{repo}-source", | ||
f"baseurl={url}/{repo}/srpms", | ||
gpgurls, | ||
enabled=False, | ||
) | ||
|
||
@classmethod | ||
def architecture(cls, arch: Architecture) -> str: | ||
a = { | ||
Architecture.arm64 : "aarch64", | ||
Architecture.x86_64 : "x86_64", | ||
}.get(arch) | ||
|
||
if not a: | ||
die(f"Architecture {a} is not supported by {cls.pretty_name()}") | ||
|
||
return a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# SPDX-License-Identifier: LGPL-2.1-or-later | ||
|
||
[Match] | ||
Distribution=azure | ||
|
||
[Content] | ||
Packages= | ||
util-linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# SPDX-License-Identifier: LGPL-2.1-or-later | ||
|
||
[Match] | ||
Distribution=azure | ||
|
||
[Content] | ||
Packages= | ||
btrfs-progs | ||
distribution-gpg-keys | ||
dnf5 | ||
dnf5-plugins | ||
erofs-utils | ||
qemu-system-aarch64-core | ||
qemu-system-s390x-core | ||
systemd-ukify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters