Skip to content

Commit

Permalink
pyanaconda: payload: split rsync command for /boot/efi to handle FAT …
Browse files Browse the repository at this point in the history
…filesystem limitations

The previous rsync command attempted to preserve attributes (permissions, ownership, symlinks)
that are not supported by FAT. This commit splits the rsync process for `/boot/efi` to avoid
these incompatible options and ensure proper handling of FAT-specific filesystems.

Resolves: rhbz#2329379
  • Loading branch information
KKoukiou committed Nov 29, 2024
1 parent d19089a commit 03a4ab8
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion pyanaconda/modules/payloads/payload/live_image/installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def run(self):
"--exclude", "/run/",
"--exclude", "/boot/*rescue*",
"--exclude", "/boot/loader/",
"--exclude", "/boot/efi/loader/",
"--exclude", "/boot/efi",
"--exclude", "/etc/machine-id",
"--exclude", "/etc/machine-info",
os.path.normpath(self._mount_point) + "/",
Expand All @@ -440,6 +440,27 @@ def run(self):
msg = "Failed to install image: {}".format(e)
raise PayloadInstallationError(msg) from None

# Handle /boot/efi separately due to FAT filesystem limitations
# FAT cannot support permissions, ownership, symlinks, hard links, xattrs, ACLs, or modification times
args = [
"-rx",
"--stats", # show statistics at end of process
"--info=flist2,name,progress2", # show progress after each file
"--no-inc-recursive", # force calculating total work in advance
"--exclude", "/boot/efi/loader/",
os.path.normpath(self._mount_point) + "/boot/efi/",
os.path.join(self._sysroot, "boot/efi")
]

try:
for line in execReadlines(cmd, args):
self._parse_rsync_update(line)

except (OSError, RuntimeError) as e:
msg = "Failed to install /boot/efi from image: {}".format(e)
raise PayloadInstallationError(msg) from None


def _parse_rsync_update(self, line):
"""Try to extract progress from rsync output.
Expand Down

0 comments on commit 03a4ab8

Please sign in to comment.