1
0
mirror of https://github.com/lxc/distrobuilder.git synced 2026-02-05 06:45:19 +01:00

367 Commits

Author SHA1 Message Date
Chaosoffire
e46de2b967 sources: Fix portage snapshot GPG verification
Pass both portage-latest.tar.xz and its detached signature
(.gpgsig) to VerifyFile for proper GPG verification.

Signed-off-by: Chaosoffire <81634128+chaosoffire@users.noreply.github.com>
2026-01-12 20:49:19 +08:00
Chaosoffire
1015a5ac06 sources/centos-http: Support CentOS Stream 10 checksum file
CentOS Stream 10, similar to Stream 9, uses a `SHA256SUM` file for checksums rather than the `sha256sum.txt.asc` pattern used by older releases.

This commit updates the logic to correctly identify and use `SHA256SUM` for CentOS Stream 10, resolving build failures where the downloader would incorrectly return a 404 for the non-existent `.asc` file.

Signed-off-by: Chaosoffire <81634128+chaosoffire@users.noreply.github.com>
2026-01-10 22:34:13 +08:00
Chaosoffire
6b6c3dd48f sources/rocky: implement version-specific GPG verification
Rocky 8/9 only provides plain CHECKSUM files without GPG signatures,
so verification must be skipped.
Rocky 10 provides a detached CHECKSUM.asc signature. This is now
downloaded separately to perform verification against the CHECKSUM file.

Signed-off-by: Chaosoffire <81634128+chaosoffire@users.noreply.github.com>
2026-01-10 17:08:44 +08:00
Chaosoffire
2bd631eb1b sources/gentoo: download .DIGESTS separately for GPG verification
Since .DIGESTS is a clearsigned file that needs GPG verification,
download it separately to persist on disk.

Signed-off-by: Chaosoffire <81634128+chaosoffire@users.noreply.github.com>
2026-01-10 15:23:28 +08:00
Chaosoffire
6628e5de55 sources/centos: fix GPG verification for plain checksum files
Only verify files ending with .asc, which are clearsigned.

This reverts centos-http.go verify logic from commit 64b60db9.

Signed-off-by: Chaosoffire <81634128+chaosoffire@users.noreply.github.com>
2026-01-10 15:16:39 +08:00
Chaosoffire
1cafa6a5a1 sources/voidlinux: revert GPG validation changes
VoidLinux uses signify signatures (.sig files), not GPG.
This reverts voidlinux-http.go changes from commit 64b60db9.

Signed-off-by: Chaosoffire <81634128+chaosoffire@users.noreply.github.com>
2026-01-10 15:08:03 +08:00
Chaosoffire
64b60db96c sources: enforce GPG verification across multiple distros
This commit introduces a centralized GPG verification requirement logic
in `sources/common.go` via the `validateGPGRequirements` method.
It ensures consistent security constraints across multiple supported distributions.

Specific security fixes included:
- Rocky Linux: Fixed an issue where the `CHECKSUM` file was downloaded but not GPG verified.
- CentOS: Fixed an issue where 'SHA256SUM' and 'CHECKSUM' files were downloaded but not GPG verified.
- Gentoo: Added GPG requirement validation for the portage snapshot download URL.

Fixes: https://github.com/lxc/distrobuilder/issues/963
Signed-off-by: Chaosoffire <81634128+chaosoffire@users.noreply.github.com>
2026-01-07 16:42:12 +08:00
Chaosoffire
a24601ebfd sources: refactor AlmaLinux version check to use switch statement
Replace chained `strings.HasPrefix` calls with a `switch` statement on the existing `majorVersion` variable for improved readability and maintainability.

Signed-off-by: Chaosoffire <81634128+chaosoffire@users.noreply.github.com>
2026-01-06 15:56:32 +08:00
Chaosoffire
3c4b82e6be sources: support AlmaLinux 9 and 10 with HTTP sources
AlmaLinux 9 and 10 use a `CHECKSUM` file similar to version 8, rather than `sha256sum.txt.asc`.
This change updates the logic to use the correct checksum file for versions 9 and 10.

It also fixes a security issue where `CHECKSUM` files were not being GPG verified because the check was restricted to files ending in `.asc`.

Signed-off-by: Chaosoffire <81634128+chaosoffire@users.noreply.github.com>
2026-01-06 15:39:46 +08:00
Thomas Winkler
194b0f40af Update OpenWRT config to build also release candidates
Signed-off-by: Thomas Winkler <tewinkler86@gmail.com>
2025-12-22 14:47:39 +01:00
Thomas Winkler
de6955faf5 Remove deprecated 22.03 architecture path and filename logic
Signed-off-by: Thomas Winkler <tewinkler86@gmail.com>
2025-12-17 07:35:39 +01:00
Stéphane Graber
deed503946 sources: Update the tests for HTTP client
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-11-29 23:14:46 -05:00
Stéphane Graber
27e9ba9b4e sources: Tweak HTTP client to be more compatible
This is needed to avoid being flagged as a crawler by some servers.

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-11-29 22:35:25 -05:00
Stéphane Graber
bf526f359e sources: Always use custom HTTP client
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-11-29 21:46:52 -05:00
Stéphane Graber
26121f5ebf sources/fedora: Remove legacy releases
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-11-29 21:09:51 -05:00
timbretimber
cab50c0662 docker: use umoci library and podman image library
* fixes issues with extracting to wrong directory
* allows pulling from other oci registries (will still pull from docker if unspecified)
* allows to specify digest (can't specify both digest and tag at the same time)

Signed-off-by: timbretimber <105982513+timbretimber@users.noreply.github.com>
2025-11-15 17:08:39 -05:00
Max Asnaashari
608b70e6f1 distrobuilder: Make linter happy
Signed-off-by: Max Asnaashari <max.asna@futurfusion.io>
2025-09-26 18:33:05 -07:00
Diego Herrera
d8d161bdc8 centos: Fix GPGKey and mirror for Centos Stream 9 onwards
Signed-off-by: Diego Herrera <dherrera@redhat.com>
2025-09-10 19:35:36 -03:00
Diego Herrera
7f7abc7e68 centos: Add support for CentOS Stream 10
Signed-off-by: Diego Herrera <dherrera@redhat.com>
2025-09-09 18:05:55 -03:00
Stéphane Graber
78def3425f fedora-http: Use RsyncLocal
closes #939

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-08-25 12:32:54 -04:00
Stéphane Graber
fc5060aa0d almalinux: Fix install script
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-08-08 00:28:38 -04:00
Stéphane Graber
be3ac30e61 almalinux: Align nogpgcheck with Rocky
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-08-06 02:21:39 -04:00
Stéphane Graber
f2c14b5965 Revert "almalinux: Add support for AlmaLinux 10"
This reverts commit 8a6088f94a.

The Alma Linux 10 support came with forcing a change of package manager
which then broke all existing image builds.

Instead the approach taken for Rocky is much simpler and should avoid
regressions coming from the switch from yum to dnf for all existing
images.

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-08-06 02:21:38 -04:00
conorlennon1
3fe2a28754 rockylinux: Add RockyLinux 10 support
Signed-off-by: conorlennon1 <70489786+conorlennon1@users.noreply.github.com>
2025-08-03 15:16:39 -04:00
MichaelStauber
8a6088f94a almalinux: Add support for AlmaLinux 10
Signed-off-by: MichaelStauber <102580320+MichaelStauber@users.noreply.github.com>
2025-08-03 15:07:40 -04:00
Maarten Aertsen
28c898412e openwrt: verify checksum and signature by default
Signed-off-by: Maarten Aertsen <spam+github@rtsn.nl>
2025-07-13 20:19:29 -04:00
Stéphane Graber
5fcd59e683 sources/docker: Port to skopeo+umoci
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-06-17 16:13:12 -04:00
Valery Ushakov
cdab568f5b utils_test.go: TestRecvGPGKeys add missing cleanup
Need to remove `gpgDir` after the test so that no gpg-agent processes
are left behind loitering.

Signed-off-by: Valery Ushakov <valery.ushakov@bell-sw.com>
2025-05-17 01:10:08 +00:00
Stéphane Graber
eab39d5c80 archlinux: Fix typo
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-04-13 16:01:51 -04:00
Stéphane Graber
454b1cf9b2 sources/archlinux: Add riscv64 support
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-04-12 19:52:23 -04:00
Valery Ushakov
b13c4d5924 sources: Alpaquita - use source.variant not image.variant
The image.variant is an arbitrary user choice (e.g. an image that
includes cloud-init), while possible source.variant values are
predefined by the distro (e.g. libc, as is the case with Alpaquita).

Unfortunately parts of distrobuilder code base are confused about
this, so I followed the wrong example when I first wrote this code.

Signed-off-by: Valery Ushakov <valery.ushakov@bell-sw.com>
2025-04-02 15:51:59 -04:00
Stéphane Graber
57091a0e63 Fix golang-ci reported issues
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-04-02 14:37:13 -04:00
Colin Watson
298e7c927f Fix spelling errors found by codespell
Signed-off-by: Colin Watson <cjwatson@debian.org>
2025-03-16 17:52:23 +00:00
Valery Ushakov
b8a93a357c sources: Add Alpaquita downloader
Signed-off-by: Valery Ushakov <valery.ushakov@bell-sw.com>
2025-02-28 05:10:06 +03:00
Thomas Winkler
0053864347 Update openwrt-http.go to support v24.10 (and drop v21.x)
Signed-off-by: Thomas Winkler <tewinkler86@gmail.com>
2025-02-08 10:03:59 +01:00
Thomas Winkler
8abb164d32 Update openwrt-http_test.go to support v24.10 (and drop v21.x)
Signed-off-by: Thomas Winkler <tewinkler86@gmail.com>
2025-02-08 09:48:59 +01:00
Adam C. Stephens
5848227b6d remove nixos 24.05
Signed-off-by: Adam C. Stephens <adam@valkor.net>
2025-01-29 10:24:18 -05:00
Alexandre Vicenzi
ecccb1a050 imports: replace gopkg.in/antchfx/htmlquery.v1
replace gopkg.in/antchfx/htmlquery.v1 with github.com/antchfx/htmlquery

Signed-off-by: Alexandre Vicenzi <alexandre.vicenzi@suse.com>
2025-01-09 11:09:32 -05:00
Adam Stephens
e2a2567a5b nixos: correctly handle 24.11
Signed-off-by: Adam Stephens <adam@valkor.net>
2024-11-29 23:09:12 -05:00
Danny Lin
1fb71ab782 opensuse: Temporarily switch to mirrorcache-eu to fix downloads
According to https://status.opensuse.org, mirrorcache-us.opensuse.org has been down for maintenance for 15 days. mirrorcache-eu.opensuse.org is still up, so switch temporarily to fix distrobuilder downloads.

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
2024-11-22 19:26:58 -08:00
Stéphane Graber
034cd08eec fedora: Add support for OCI images
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2024-11-04 16:10:02 -05:00
Stéphane Graber
3636a40e81 sources: Remove dead code
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2024-10-23 11:59:52 -04:00
Adam Stephens
536b37d4db nixos-http: use incus-specific image for unstable
Signed-off-by: Adam Stephens <adam@valkor.net>
2024-09-03 23:49:34 -04:00
Ainur Shakirov
6247ec9ac0 sources: Fix openEuler tests
Signed-off-by: Ainur Shakirov <ainur.shakirov.tt@gmail.com>
2024-07-27 13:40:27 +03:00
Stéphane Graber
bea1106019 debootstrap: Add workaround for devuan
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2024-06-28 00:06:30 -04:00
Stéphane Graber
ab6c95f027 debootstrap: Remove no-merged-usr/merged-usr logic
This logic is confusing/outdated and newer debootstrap should be able to
cope out of the box. So let's remove it for now and we'll add back
specific exceptions if needed.

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2024-06-26 23:41:04 -04:00
JUN JIE NAN
907806e43c Refactor import gpg public keys
Signed-off-by: JUN JIE NAN <nanjunjie@gmail.com>
2024-05-28 19:45:14 +08:00
JUN JIE NAN
092eab7aa1 Support http-proxy keyserver options for gpg recv-keys
So ditrobuiler can be used to build the images with gpg fingerprint setting behind a firewall.

Signed-off-by: JUN JIE NAN <nanjunjie@gmail.com>
2024-05-27 17:04:24 +08:00
Stéphane Graber
b8bfb11164 archlinux: Move to zst
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2024-05-03 09:24:16 -04:00
Stéphane Graber
9a10fde741 sources/funtoo: Use symlinks
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2024-04-30 11:08:14 -04:00