Created attachment 410110 [details, diff] fixes wrong signed min device number efibootmgr -c -d /dev/sdj -p 1 -L … -l … -u … fails when trying to create boot entry for device with min number > 127. strace efibootmgr -c -d /dev/sdj -p 1 -L … -l … -u … : open("/dev/sdj", O_RDONLY) = 3 fstat(3, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 144), ...}) = 0 readlink("/sys/dev/block/8:-112", 0x7ffd5a0f9080, 4096) = -1 ENOENT # lsblk | grep sdj sdj 8:144 1 29.8G 0 disk ├─sdj1 8:145 1 1G 0 part /boot └─sdj2 8:146 1 28.8G 0 part / The bug is here: 8:144 turned into 8:-112. Trying to dig into a problem, I found in linux.c:62: set_disk_and_part_name(struct disk_info *info) … rc = sysfs_readlink(&linkbuf, "/sys/dev/block/%"PRIu64":%hhd", info->major, info->minor); (%hhd prints unsigned info->minor as signed, which causes wrong device path if info->minor is greater than 127) This bug was reported upstream: https://github.com/rhinstaller/efivar/issues/33 Patch attached.
Why are you submitting the patch here? Send it upstream.
Already done, but how long it will take for upstream to notice/merge patch and release new version? As for me, it is more appropriate to update sys-libs/efivar to -r1 with suggested patch (sorry I was wrong in header, affected package is sys-libs/efivar.
Oh, you included the patch in a github comment; I was expecting to see a pull request, so I missed it.
upstream applied a patch: https://github.com/rhinstaller/efivar/commit/7d4b71fe88ecd647020118da9152741f553b54db