Fix rsync /boot failure on UEFI by using FAT-safe sync flags
This commit is contained in:
@@ -131,6 +131,8 @@ def install_minimal_os(mount_root, releasever="43"):
|
|||||||
logger.info(f"Installing Iridium OS to {mount_root} via rsync...")
|
logger.info(f"Installing Iridium OS to {mount_root} via rsync...")
|
||||||
log_os_install("INSTALL", "start", f"Target: {mount_root}")
|
log_os_install("INSTALL", "start", f"Target: {mount_root}")
|
||||||
|
|
||||||
|
uefi = is_uefi()
|
||||||
|
|
||||||
# Exclude list for rsync to avoid copying pseudo-filesystems and temporary data
|
# Exclude list for rsync to avoid copying pseudo-filesystems and temporary data
|
||||||
excludes = [
|
excludes = [
|
||||||
"/dev/*",
|
"/dev/*",
|
||||||
@@ -148,19 +150,37 @@ def install_minimal_os(mount_root, releasever="43"):
|
|||||||
"/var/cache/dnf/*",
|
"/var/cache/dnf/*",
|
||||||
"/etc/fstab",
|
"/etc/fstab",
|
||||||
"/etc/hostname",
|
"/etc/hostname",
|
||||||
|
"/boot/*", # We handle boot separately
|
||||||
# Avoid copying the installer data itself if it's in home
|
# Avoid copying the installer data itself if it's in home
|
||||||
"domek_na_skale",
|
"domek_na_skale",
|
||||||
]
|
]
|
||||||
|
|
||||||
exclude_args = [f"--exclude={ex}" for ex in excludes]
|
exclude_args = [f"--exclude={ex}" for ex in excludes]
|
||||||
|
|
||||||
|
# 1. Main Root Sync
|
||||||
# We use -a (archive), -H (hard links), -A (acls), -X (xattrs), -v (verbose), -x (one file system)
|
# We use -a (archive), -H (hard links), -A (acls), -X (xattrs), -v (verbose), -x (one file system)
|
||||||
# --info=progress2 gives a nice summary for logging
|
# --info=progress2 gives a nice summary for logging
|
||||||
cmd = ["rsync", "-aHAXvx", "--info=progress2"] + exclude_args + ["/", mount_root]
|
cmd = ["rsync", "-aHAXvx", "--info=progress2"] + exclude_args + ["/", mount_root]
|
||||||
|
|
||||||
logger.info("Starting rsync operation...")
|
logger.info("Starting main rsync operation...")
|
||||||
run_command(cmd)
|
run_command(cmd)
|
||||||
|
|
||||||
|
# 2. Boot Sync
|
||||||
|
# If UEFI, /boot is likely FAT32 which doesn't support symlinks or xattrs
|
||||||
|
logger.info(f"Syncing /boot (UEFI: {uefi})...")
|
||||||
|
boot_dst = os.path.join(mount_root, "boot/")
|
||||||
|
os.makedirs(boot_dst, exist_ok=True)
|
||||||
|
|
||||||
|
if uefi:
|
||||||
|
# FAT32 friendly: follow links (-L), recursive (-r), preserve times (-t)
|
||||||
|
# We skip ACLs, xattrs, and hardlinks as they are not supported
|
||||||
|
boot_cmd = ["rsync", "-rtvL", "--info=progress2", "/boot/", boot_dst]
|
||||||
|
else:
|
||||||
|
# BIOS (ext4): standard archive is fine
|
||||||
|
boot_cmd = ["rsync", "-aHAXvx", "--info=progress2", "/boot/", boot_dst]
|
||||||
|
|
||||||
|
run_command(boot_cmd)
|
||||||
|
|
||||||
# Ensure essential directories exist
|
# Ensure essential directories exist
|
||||||
for d in ["dev", "proc", "sys", "run", "mnt", "tmp"]:
|
for d in ["dev", "proc", "sys", "run", "mnt", "tmp"]:
|
||||||
os.makedirs(os.path.join(mount_root, d), exist_ok=True)
|
os.makedirs(os.path.join(mount_root, d), exist_ok=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user