Skip to content

Create DOS/EFI images with mtools - #1535

Merged
brlane-rht merged 3 commits into
weldr:masterfrom
lzap:noroot-efi1
Nov 3, 2026
Merged

brlane-rht merged 3 commits into
weldr:masterfrom
lzap:noroot-efi1

Conversation

@lzap

@lzap lzap commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Hello,

for PQC we would like to extend Satellite capabilities with mkksiso workflow. Unfortunately, the tool requires root because it uses mount to do the EFI image. However, this is not needed as RHEL already contains the user-space mtools utilities.

This change modifies the behavior to use it for both image types. This cannot be used for other types (e.g. Apple) so root is still needed for some use cases. There is a separate commit that aligns documentation a bit as it was a bit unclear when root is really needed.

What are my chances to get this into RHEL 10?

@brlane-rht brlane-rht left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks pretty nice, thanks!

test-packages needs to have mtools and dosfstools added to it. The way to run tests locally is make test-in-podman which also reveals that now test_MakeKickstartISO tries to run the mkefiboot script directly, but it isn't installed in the container. So we need to add src/bin to the path first before running those tests.

import os, tempfile, argparse
from subprocess import check_call, PIPE
from pylorax.imgutils import mkdosimg, round_to_blocks, LoopDev, DMDev, dm_detach
from pylorax.imgutils import mkhfsimg, Mount, estimate_size

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

estimate_size needs to stay, used by mkmacboot :)

lzap added 3 commits November 3, 2026 10:56
Replace the mounted mkfsimage path with mkfs.fat and mtools for DOS images. Populate root directories and grafts directly in the image, and test the writer without root.
Use the mtools-backed DOS image writer when rebuilding embedded EFI boot images and remove the unconditional root check. Keep root requirements for Apple and full EFI disk modes, and cover direct image creation and the mkksiso rebuild path.
Keep the version 38.4 root requirement as historical context, document the current mtools-based EFI update and checksum tools, and add mtools to package requirements. Regenerate the HTML and man pages.
Comment thread Makefile
test-in-copy:
rsync -a --no-perms --exclude=.git /lorax-ro/ /lorax/
make -C /lorax/ $(RUN_TESTS)
PATH=/lorax/src/bin:$$PATH make -C /lorax/ $(RUN_TESTS)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Had issues with running tests locally, had to do this.

@lzap

lzap commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Fixed tests, green locally.

@brlane-rht brlane-rht left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 41615142126

Coverage increased (+1.8%) to 43.99%

Details

  • Coverage increased (+1.8%) from the base build.
  • Patch coverage: 10 uncovered changes across 2 files (27 of 37 lines covered, 72.97%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
src/pylorax/imgutils.py 32 26 81.25%
src/pylorax/cmdline/mkefiboot.py 5 1 20.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 3977
Covered Lines: 1762
Line Coverage: 44.3%
Relevant Branches: 2179
Covered Branches: 946
Branch Coverage: 43.41%
Branches in Coverage %: Yes
Coverage Strength: 0.44 hits per line

💛 - Coveralls

@brlane-rht
brlane-rht merged commit 8688cde into weldr:master Nov 3, 2026
2 checks passed
@lzap
lzap deleted the noroot-efi1 branch November 4, 2026 12:38
@lzap

lzap commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Can I assume this will get to the next RHEL10 release?

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.

3 participants