new commit

This commit is contained in:
Manuel 2025-04-26 12:01:44 +00:00
parent 75295eced6
commit 211c1c966c
2 changed files with 16 additions and 13 deletions

View File

@ -30,7 +30,7 @@ sys.path.insert(0, BASE_DIR)
try: try:
from builder.core.command_runner import run_command 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 from builder.core.bootstrap.paths import paths
logger = logger_config.setup_logger('iso_generator') logger = logger_config.setup_logger('iso_generator')
@ -86,10 +86,10 @@ def iso_generator_main(
Returns: Returns:
str: The label of the generated ISO file. str: The label of the generated ISO file.
""" """
logging.info("=> Starting ISO image creation with xorriso...") # Updated log for xorriso 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')}" # Dynamic ISO label 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("-", "_")) # Volume ID volume_id = iso_build_config.get('Volume_ID', iso_name_base.upper().replace("-", "_"))
iso_path = os.path.join(paths['ISO_OUTPUT_DIR'], iso_name) # Full path to ISO iso_path = os.path.join(paths['ISO_OUTPUT_DIR'], iso_name)
isohybrid_mbr_path = os.path.join(paths['PEPTARGETDIR'], "usr/lib/syslinux", "isohdpfx.bin") isohybrid_mbr_path = os.path.join(paths['PEPTARGETDIR'], "usr/lib/syslinux", "isohdpfx.bin")
logging.info(f"=> ISO Label: {iso_label}") logging.info(f"=> ISO Label: {iso_label}")
@ -97,9 +97,11 @@ def iso_generator_main(
logging.info(f"=> Output ISO Path: {iso_path}") logging.info(f"=> Output ISO Path: {iso_path}")
# Generate ISO using xorriso # Generate ISO using xorriso
logging.info("=> Generating ISO image with xorriso...") # Updated log for xorriso logging.info("=> Generating ISO image with xorriso...")
xorriso_command = [ xorriso_command = [
os.path.join(paths['PEPHOSTDIR'], "usr/bin/xorriso"), "xbps-uchroot",
paths['PEPHOSTDIR'],
"/usr/bin/xorriso",
"-as", "mkisofs", "-as", "mkisofs",
"-iso-level", "3", "-iso-level", "3",
"-rock", "-rock",
@ -123,10 +125,10 @@ def iso_generator_main(
"-output", iso_path, "-output", iso_path,
paths['IMAGEDIR'] paths['IMAGEDIR']
] ]
run_command(xorriso_command) # Execute the xorriso command run_command(xorriso_command)
logging.info("=> ISO image generated with xorriso successfully.") # Updated log for xorriso logging.info("=> ISO image generated with xorriso successfully.")
logging.info(f"=> ISO image created successfully: {iso_path}") logging.info(f"=> ISO image created successfully: {iso_path}")
logging.info("=> ISO build process completed.") logging.info("=> ISO build process completed.")
logging.info("=> The ISO is ready at: " + iso_path) logging.info("=> The ISO is ready at: " + iso_path)
return iso_label # Returns the ISO label return iso_label

View File

@ -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) output_dir = os.path.dirname(squashfs_output_file)
os.makedirs(output_dir, exist_ok=True) os.makedirs(output_dir, exist_ok=True)
mksquashfs_path = os.path.join(pep_host_dir, "usr", "bin", "mksquashfs")
mksquashfs_command = [ mksquashfs_command = [
mksquashfs_path, "xbps-uchroot",
pep_host_dir,
"/usr/bin/mksquashfs",
os.path.join(build_dir, "tmp"), os.path.join(build_dir, "tmp"),
squashfs_output_file, squashfs_output_file,
"-comp", "zstd", "-comp", "zstd",
"-e19", "-e19",
] ]
logger.info(f"=> Executing mksquashfs command: {' '.join(mksquashfs_command)}") logger.info(f"=> Executing mksquashfs command: {' '.join(mksquashfs_command)}")
result = run_command(mksquashfs_command) result = run_command(mksquashfs_command)
if result.returncode != 0: if result.returncode != 0: