diff --git a/builder/core/iso_generator.py b/builder/core/iso_generator.py index 049a1fd3..1733faaa 100644 --- a/builder/core/iso_generator.py +++ b/builder/core/iso_generator.py @@ -30,7 +30,7 @@ sys.path.insert(0, BASE_DIR) try: from builder.core.command_runner import run_command - from builder.configs import logger_config # Import the logger_config module + from builder.configs import logger_config from builder.core.bootstrap.paths import paths logger = logger_config.setup_logger('iso_generator') @@ -86,10 +86,10 @@ def iso_generator_main( Returns: str: The label of the generated ISO file. """ - logging.info("=> Starting ISO image creation with xorriso...") # Updated log for xorriso - iso_label = f"{iso_label_prefix}-{arch}-{desktop}-{kernel_type}-{datetime.date.today().strftime('%Y%m%d')}" # Dynamic ISO label - volume_id = iso_build_config.get('Volume_ID', iso_name_base.upper().replace("-", "_")) # Volume ID - iso_path = os.path.join(paths['ISO_OUTPUT_DIR'], iso_name) # Full path to ISO + logging.info("=> Starting ISO image creation with xorriso...") + iso_label = f"{iso_label_prefix}-{arch}-{desktop}-{kernel_type}-{datetime.date.today().strftime('%Y%m%d')}" + volume_id = iso_build_config.get('Volume_ID', iso_name_base.upper().replace("-", "_")) + iso_path = os.path.join(paths['ISO_OUTPUT_DIR'], iso_name) isohybrid_mbr_path = os.path.join(paths['PEPTARGETDIR'], "usr/lib/syslinux", "isohdpfx.bin") logging.info(f"=> ISO Label: {iso_label}") @@ -97,9 +97,11 @@ def iso_generator_main( logging.info(f"=> Output ISO Path: {iso_path}") # Generate ISO using xorriso - logging.info("=> Generating ISO image with xorriso...") # Updated log for xorriso + logging.info("=> Generating ISO image with xorriso...") xorriso_command = [ - os.path.join(paths['PEPHOSTDIR'], "usr/bin/xorriso"), + "xbps-uchroot", + paths['PEPHOSTDIR'], + "/usr/bin/xorriso", "-as", "mkisofs", "-iso-level", "3", "-rock", @@ -123,10 +125,10 @@ def iso_generator_main( "-output", iso_path, paths['IMAGEDIR'] ] - run_command(xorriso_command) # Execute the xorriso command - logging.info("=> ISO image generated with xorriso successfully.") # Updated log for xorriso + run_command(xorriso_command) + logging.info("=> ISO image generated with xorriso successfully.") logging.info(f"=> ISO image created successfully: {iso_path}") logging.info("=> ISO build process completed.") logging.info("=> The ISO is ready at: " + iso_path) - return iso_label # Returns the ISO label \ No newline at end of file + return iso_label \ No newline at end of file diff --git a/builder/core/squashfs.py b/builder/core/squashfs.py index 5e593238..31f5ea18 100644 --- a/builder/core/squashfs.py +++ b/builder/core/squashfs.py @@ -96,15 +96,16 @@ def create_squashfs_image(rootfs_dir, squashfs_output_file, pep_host_dir, logger output_dir = os.path.dirname(squashfs_output_file) os.makedirs(output_dir, exist_ok=True) - - mksquashfs_path = os.path.join(pep_host_dir, "usr", "bin", "mksquashfs") mksquashfs_command = [ - mksquashfs_path, + "xbps-uchroot", + pep_host_dir, + "/usr/bin/mksquashfs", os.path.join(build_dir, "tmp"), squashfs_output_file, "-comp", "zstd", "-e19", ] + logger.info(f"=> Executing mksquashfs command: {' '.join(mksquashfs_command)}") result = run_command(mksquashfs_command) if result.returncode != 0: