Skip to content
Open
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: 1 addition & 1 deletion lorax.spec
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Requires: gzip
Requires: isomd5sum
Requires: module-init-tools
Requires: parted
Requires: squashfs-tools >= 4.2
Recommends: squashfs-tools >= 4.2
Requires: erofs-utils >= 1.8.2
Requires: util-linux
Requires: xz-lzma-compat
Expand Down
13 changes: 13 additions & 0 deletions src/pylorax/cmdline/livemedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,19 @@ def main():
list(log.error(e) for e in errors)
sys.exit(1)

# When making an iso check for required mksquashfs or mkfs.erofs tools
# If mksquashfs is missing fall back to erofs
if opts.make_iso:
if opts.rootfs_type.startswith("squashfs"):
if not shutil.which("mksquashfs"):
log.warning("mksquashfs not installed, falling back to --rootfs-type=erofs")
opts.rootfs_type = "erofs"

if opts.rootfs_type.startswith("erofs"):
if not shutil.which("mkfs.erofs"):
log.error("mkfs.erofs not installed, exiting")
sys.exit(1)

if not os.path.exists(opts.result_dir):
os.makedirs(opts.result_dir)

Expand Down
12 changes: 12 additions & 0 deletions src/pylorax/cmdline/lorax.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ def main():

log_selinux_state()

# Check for required mksquashfs or mkfs.erofs tools
# If mksquashfs is missing fall back to erofs
if opts.rootfs_type.startswith("squashfs"):
if not shutil.which("mksquashfs"):
log.warning("mksquashfs not installed, falling back to --rootfs-type=erofs")
opts.rootfs_type = "erofs"

if opts.rootfs_type.startswith("erofs"):
if not shutil.which("mkfs.erofs"):
log.error("mkfs.erofs not installed, exiting")
sys.exit(1)

if not opts.workdir:
if not os.path.exists(opts.tmp):
os.makedirs(opts.tmp)
Expand Down
Loading