<div dir="ltr"><span>Hello,<br><br>I am creating an update system using systemd (repart + sysupdate) and systemd-boot on an embedded target (beaglebone black).<br><br>Everything seems to works except the bootcounting of systemd-boot. "Failed to rename '\loader\entries\entry+3-0.conf' to 'entry+2-1.conf', ignoring: Access denied". This happens when the function handle->SetInfo(handle, MAKE_GUID_PTR(EFI_FILE_INFO), file_info_size, file_info) is called (src/boot/efi/boot.c line 1385). Then the system is able to boot but I need to get this bootcouting system working to be able of doing fallback if the update goes wrong.<br><br>According to the UEFI Specification we get Access denied after the call of this function in these cases:<br><ul><li>An attempt is made to change the name of a file to a file that is already present.<br></li><li>An attempt is being made to change the EFI_FILE_DIRECTORY Attribute.<br></li><li>An attempt is being made to change the size of a directory.<br></li><li>InformationType is EFI_FILE_INFO_ID and the file was opened read-only and an attempt is being made to modify a field other than Attribute.<br></li></ul>However, none of these cases seem to happen because only the field FileName is modified, the file is opened read/write before and the new name of the file is not taken by an other file.<br><br>I tried first to find the implementation of SetInfo function to see in more details what is going wrong, but I didn't find it. Then, I tried to identify the problem by printing the Attributes field of the EFI_FILE \loader\entries\entry+3-0.conf. I found that this field is set to 0 and it correspond to nothing :<br><ul><li>#define EFI_FILE_READ_ONLY  0x01U<br></li><li>#define EFI_FILE_HIDDEN     0x02U<br></li><li>#define EFI_FILE_SYSTEM     0x04U<br></li><li>#define EFI_FILE_RESERVED   0x08U<br></li><li>#define EFI_FILE_DIRECTORY  0x10U<br></li><li>#define EFI_FILE_ARCHIVE    0x20U<br></li><li>#define EFI_FILE_VALID_ATTR 0x37U<br></li></ul><br>I built the image with Yocto and here are the different partitions in the image :<br># u-boot partition<br>part --source uboot-part --ondisk mmcblk0 --fstype=vfat --label uboot --active --align 1024 --fixed-size 32 --mbr<br># esp partition<br>part --source esp-part --ondisk mmcblk0 --fstype=vfat --label esp --align 1024 --part-type C12A7328-F81F-11D2-BA4B-00A0C93EC93B<br># recovery partition<br>part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label recovery --align 1024<br># create gpt layout with mbr<br>bootloader --ptable=gpt-hybrid<br><br>systemd-boot was started by u-boot using the bootefi command :<br>fatload mmc 0:2 ${loadaddr} EFI/BOOT/bootarm.efi ; bootefi ${loadaddr}<br><br>So, my question is why I get Access denied when I activate the systemd-boot bootcounting ? Is it because the Attributes field of the file entry+3-0.conf is set to 0 ? If yes, how can I set it correctly ?</span></div>