Rsync error with boot/efi

Hello,

I’m working on an Incus Mageia image.
The image build fails due to rsync trying to remove boot/efi while being in use.

time="2023-09-19T08:51:35+02:00" level=info msg="Running generator" generator=dump
time="2023-09-19T08:51:35+02:00" level=info msg="Running generator" generator=dump
time="2023-09-19T08:51:35+02:00" level=info msg="Running generator" generator=fstab
time="2023-09-19T08:51:35+02:00" level=info msg="Running generator" generator=dump
time="2023-09-19T08:51:35+02:00" level=info msg="Running generator" generator=remove
time="2023-09-19T08:51:35+02:00" level=info msg="Running generator" generator=hostname
time="2023-09-19T08:51:35+02:00" level=info msg="Running generator" generator=hosts
time="2023-09-19T08:51:35+02:00" level=info msg="Running generator" generator=dump
time="2023-09-19T08:51:35+02:00" level=info msg="Running generator" generator=incus-agent
Creating new GPT entries in memory.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
GPT data structures destroyed! You may now partition the disk using fdisk or
other utilities.
Creating new GPT entries in memory.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
mke2fs 1.47.0 (5-Feb-2023)
Discarding device blocks:       0/8362747               done                            
Creating filesystem with 8362747 4k blocks and 4182016 inodes
Filesystem UUID: d81460d8-840f-4ea1-be25-1cc7f53f8d68
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624

Allocating group tables:   0/256       done                            
Writing inode tables:   0/256       done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:   0/256       done

mkfs.fat 4.2 (2021-01-31)
rsync: [generator] delete_file: rmdir(boot/efi) failed: Device or resource busy (16)
could not make way for new symlink: boot/efi
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1336) [sender=3.2.7]
Error: Failed to copy rootfs: Failed to copy "/var/cache/distrobuilder.4060385244/overlay/" to "/var/cache/distrobuilder.4060385244/vm": exit status 23
time="2023-09-19T08:52:09+02:00" level=error msg="Failed running distrobuilder" err="Failed to copy rootfs: Failed to copy \"/var/cache/distrobuilder.4060385244/overlay/\" to \"/var/cache/distrobuilder.4060385244/vm\": exit status 23"
time="2023-09-19T08:52:09+02:00" level=info msg="Removing cache directory"
make: *** [Makefile:34: build-incus] Error 1
Error: Process completed with exit code 2.

I tried to find out what’s wrong and while looking at distrobuilder code, found rsync command with a comment about boot/efi (i.e. my build error):
https://github.com/lxc/distrobuilder/blob/4ebc3cbe5d3f74c6b4a6fb0c1b3d79097a90942a/distrobuilder/main_incus.go#L354-L359

Is there any workaround to skip/solve this rsync issue?
Maybe I did something in the wrong way?

Image descriptor: mageia.yaml
Runner: Mageia 9 VM (tested on Fedora 38, the build fails with the same error)

Thank you for your help.

1 Like

Finally solved the problem.

Some packages like grub2-efi have asynchronous post-install steps which make boot/efi busy.
In place, you may be interested in installing grub2-common.

1 Like