Skip to content

fix(docker): make the fde image able to convert alinux4 guests - #147

Merged
imlk0 merged 1 commit into
masterfrom
fix-doc
Oct 9, 2026
Merged

imlk0 merged 1 commit into
masterfrom
fix-doc

Conversation

@imlk0

@imlk0 imlk0 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Problem

The published ghcr.io/openanolis/cryptpilot-fde image cannot convert an alinux4 guest image end-to-end, and cryptpilot-enhance silently does nothing inside it:

  1. e2fsprogs too old. The image is alinux3-based and ships e2fsprogs 1.46.0. alinux4 guest rootfs uses the ext4 casefold feature (FEATURE_C12), which 1.46.0's e2fsck rejects, so cryptpilot-convert fails at the rootfs check/shrink step with "Get a newer version of e2fsck!". alinux4's packaged e2fsprogs 1.47 needs glibc >= 2.33 and cannot be installed on alinux3 (glibc 2.28), so it must be built from source.
  2. virt-customize missing. dnf resolves the spec's boolean Requires: (libguestfs-tools-c or libguestfs) on alinux3 to the dependency-cheaper libguestfs meta package, which does not contain virt-customize, so cryptpilot-enhance skips hardening (with only a warning) and still exits 0.
  3. libvirt backend unusable. No libvirtd runs inside the container, so libguestfs' default libvirt backend cannot connect.

Changes

  • Dockerfile.fde: new e2fsprogs-builder stage compiles e2fsprogs 1.47.0 from source (kernel.org tarball, sha256-pinned) against the alinux3 glibc. The statically linked sbin binaries (e2fsck, fsck.ext2-4, resize2fs, tune2fs, mke2fs, mkfs.ext2-4, dumpe2fs) are copied into release-fde via an allowlist, which deliberately excludes e2fsprogs' unmaintained 2003-era blkid and its fsck/findfs so the util-linux versions keep working. Also sets ENV LIBGUESTFS_BACKEND=direct.
  • cryptpilot.spec: adds Recommends: libguestfs-tools-c next to the existing boolean dependency — installed by default where available (alinux3), silently skipped on alinux4, so the RPM stays installable on both distros.

Validation

  • e2fsprogs-builder stage built locally; staged binary set and static linking verified (ldd e2fsck → libc only).
  • Dependency resolution verified with a mini RPM replicating the exact dep structure: on a clean alinux3 container yum install pulls in libguestfs + libguestfs-tools-c (virt-customize present); on alinux4 the install stays green with only libguestfs.
  • End-to-end in a locally assembled image (0.9.2 + these fixes): cryptpilot-enhance --mode partial and cryptpilot-convert --uki --uki-stub-version 258 against the alinux4 nocloud alibase image both succeed with no manual in-container steps.

No Rust code is touched; the per-PR docker build here will exercise the full image build.

@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,您的请求已接收,请耐心等待结果。

@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。

The ghcr.io cryptpilot-fde image is alinux3-based and ships e2fsprogs
1.46.0, whose e2fsck rejects the casefold ext4 feature (FEATURE_C12) used
by alinux4 guest images, so cryptpilot-convert fails at the rootfs
check/shrink step ("Get a newer version of e2fsck!"). alinux4's packaged
e2fsprogs needs glibc >= 2.33 and cannot be installed on alinux3
(glibc 2.28), so build 1.47.0 from source (sha256-pinned) in a dedicated
Dockerfile.fde stage and copy the statically linked sbin binaries into
the release stage via an allowlist - e2fsprogs' make install also stages
an unmaintained 2003-era blkid plus fsck/findfs, which must not shadow
the util-linux versions the image relies on.

Also fix virt-customize availability: dnf resolves the
"(libguestfs-tools-c or libguestfs)" boolean on alinux3 to the
dependency-cheaper "libguestfs" meta package, which does not contain
virt-customize, so cryptpilot-enhance silently skipped hardening. Add
"Recommends: libguestfs-tools-c" so the tools are pulled in where
available (alinux3) and silently skipped on alinux4, keeping the RPM
installable there. Set LIBGUESTFS_BACKEND=direct in the image, as no
libvirtd runs inside containers.

Validated end-to-end in a locally assembled image: cryptpilot-enhance
and cryptpilot-convert --uki --uki-stub-version 258 against the alinux4
nocloud alibase image both succeed with no manual in-container steps.

Assisted-by: Claude:glm-5.3
Signed-off-by: Kun Lai <laikun@linux.alibaba.com>
@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,您的请求已接收,请耐心等待结果。

@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。

@imlk0
imlk0 merged commit edb77bc into master Oct 9, 2026
43 of 46 checks passed
@imlk0
imlk0 deleted the fix-doc branch October 9, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants