On 2021-07-16 at 11:54, Thorsten Glaser wrote: > On Fri, 16 Jul 2021, The Wanderer wrote: > >> On Fri, 16 Jul 2021, Ian Jackson wrote: >> >>> On Fri, 16 Jul 2021, The Wanderer wrote:
>>>> A possible additional complicating factor: on my system >>>> (tracking current testing, which I suspect is likely to turn >>>> into stable fairly > > Roughly 15 more days, AFAIHH. I didn't realize it had actually been scheduled; in my experience, any time someone asks when the release will happen, the only answer is "When it's ready.", and the gap between the ready date becoming known and the release happening tends to be so small there's no room for the question to be asked. >>>> soon), with sysvinit as the active init system, this directory >>>> already exists and is already mounted. > > Then test for existence of a file inside that first. I don’t have > access to an EFI system, can you share an “ls -l > /sys/firmware/efi/efivars”, and probably an “ls -l /sys/firmware/efi” > and “mount” as well? I think in principle relying on any specific file inside there would be potentially fragile, but in practice it might be possible to choose something that would be unlikely to go away in later kernels etc.. The attached file contains the requested output. It's not clear immediately whether the UUIDs are machine-specific or will be consistent across machines; efivarfs.rst.txt points me to /usr/share/doc/linux-doc-5.10/Documentation/ABI/stable/sysfs-firmware-efi-vars.gz - which mentions namespacing via vendor GUID, but also seems to say that the items whose names will contain those GUIDs are directories, so I'm not sure whether it's relevant here. >>> I suggest the following approach in mountkernfs: > > 1. See if /sys/firmware/efi/efivars/somefile exists; > if it does, it’s already mounted, and there’s > nothing to do. > >>> - See if /sys/firmware/efi/efivars exists. >>> >>> - If it does, and nothing is mounted on it yet, try to mount >>> efivarfs with the runes earlier in this bug. > > Is /sys/firmware/efi also a mountpoint, or is it a mere directory? On my system, it is not mentioned separately in the output of 'mount'. I think, but am not positive, that that's sufficient indication that it isn't a mountpoint. > Does it always contain an efivars subdirectory? I can't testify one way or the other, but I suspect from the little I've read about this that it does not. -- The Wanderer The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. -- George Bernard Shaw
/sys/firmware/efi: total 0 -r--r--r-- 1 root root 4096 Jul 16 08:23 config_table drwxr-xr-x 2 root root 0 Jul 15 18:29 efivars drwxr-xr-x 3 root root 0 Jul 16 08:23 esrt -r--r--r-- 1 root root 4096 Jul 16 08:23 fw_platform_size -r--r--r-- 1 root root 4096 Jul 16 08:23 fw_vendor drwxr-xr-x 2 root root 0 Jul 16 08:23 mok-variables -r--r--r-- 1 root root 4096 Jul 16 08:23 runtime drwxr-xr-x 19 root root 0 Jul 16 08:23 runtime-map -r-------- 1 root root 4096 Jul 16 08:23 systab /sys/firmware/efi/efivars: total 0 -rw-r--r-- 1 root root 14 Jul 15 18:29 AmdAcpiVar-79941ecd-ed36-49d0-8124-e4c31ac75cd4 -rw-r--r-- 1 root root 132 Jul 15 18:29 AMD_PBS_SETUP-a339d746-f678-49b3-9fc7-54ce0f9df226 -rw-r--r-- 1 root root 12 Jul 15 18:29 AMD_RAID-fe26a894-d199-47d4-8afa-070e3d54ba86 -rw-r--r-- 1 root root 1557 Jul 15 18:29 AmdSetup-3a997502-647a-4c82-998e-52ef9486a247 -rw-r--r-- 1 root root 8 Jul 15 18:29 AmiHardwareSignatureSetupUpdateCountVar-81c76078-bfde-4368-9790-570914c01a65 -rw-r--r-- 1 root root 28 Jul 15 18:29 AMITCGPPIVAR-a8a2093b-fefa-43c1-8e62-ce526847265e -rw-r--r-- 1 root root 1024 Jul 15 18:29 AOD_SETUP-5ed15dc0-edef-4161-9151-6014c4cc630c -rw-r--r-- 1 root root 8 Jul 15 18:29 ApSyncFlagNv-ad3f6761-f0a3-46c8-a4cb-19b70ffdb305 -rw-r--r-- 1 root root 5 Jul 15 18:29 asusbkpsmmflag-3eb0ceb0-5890-4853-9a13-0942ec712222 -rw-r--r-- 1 root root 20 Jul 15 18:29 AsusRomLayout-2e0585e9-2b5e-4f1e-bbeb-e632c5ef44b8 -rw-r--r-- 1 root root 56 Jul 15 18:29 AutoDetectData-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9 -rw-r--r-- 1 root root 186 Jul 15 18:29 BiosEventLog-4034591c-48ea-4cdc-864f-e7cb61cfd0f2 -rw-r--r-- 1 root root 92 Jul 15 18:29 BiosSettingMappingTable-b57086d5-c2e5-4654-9e3a-0b55830fbb32 -rw-r--r-- 1 root root 122 Jul 15 18:29 Boot0000-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 126 Jul 15 18:29 Boot0001-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 6 Jul 15 18:29 BootCurrent-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 5 Jul 15 18:29 BootFromUSB-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9 -rw-r--r-- 1 root root 8 Jul 15 18:29 BootOptionSupport-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 8 Jul 15 18:29 BootOrder-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 6 Jul 15 18:29 CMOSfailflag-c89dc9c7-5105-472c-a743-b1621e142b41 -rw-r--r-- 1 root root 108 Jul 15 18:29 ConIn-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 108 Jul 15 18:29 ConInDev-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 52 Jul 15 18:29 ConOut-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 52 Jul 15 18:29 ConOutDev-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 5 Jul 15 18:29 CurrentPolicy-77fa9abd-0359-4d32-bd60-28f4e78f784b -rw-r--r-- 1 root root 6326 Jul 15 18:29 db-d719b2cb-3d3a-4596-a3bc-dad00e67656f -rw-r--r-- 1 root root 6326 Jul 15 18:29 dbDefault-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 3728 Jul 15 18:29 dbx-d719b2cb-3d3a-4596-a3bc-dad00e67656f -rw-r--r-- 1 root root 3728 Jul 15 18:29 dbxDefault-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 8 Jul 15 18:29 DefaultBootOrder-45cf35f6-0d6e-4d04-856a-0370a5b16f53 -rw-r--r-- 1 root root 5 Jul 15 18:29 DeploymentModeNv-97e8965f-c761-4f48-b6e4-9ffa9cb2a2d6 -rw-r--r-- 1 root root 5 Jul 15 18:29 DownCoreStatus-29749bad-401b-4f6d-b124-cece8c590c48 -rw-r--r-- 1 root root 5 Jul 15 18:29 EntBootMode-d047ab6d-49eb-4a1f-a0bf-ac949bbea113 -rw-r--r-- 1 root root 68 Jul 15 18:29 EnWpData-cbab171f-f356-4009-baaa-6628353a0a29 -rw-r--r-- 1 root root 52 Jul 15 18:29 ErrOut-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 52 Jul 15 18:29 ErrOutDev-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 5 Jul 15 18:29 EXTFanCard-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9 -rw-r--r-- 1 root root 9 Jul 15 18:29 Fail_FLAG_POST-e9f78597-5151-4a3c-b17a-cad106f334f6 -rw-r--r-- 1 root root 306 Jul 15 18:29 FastBootOption-b540a530-6978-4da7-91cb-7207d764d262 -rw-r--r-- 1 root root 5 Jul 15 18:29 FirstBootFlag-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9 -rw-r--r-- 1 root root 14 Jul 15 18:29 FPLayoutOrder-4db88a62-6721-47a0-9082-280b00323594 -rw-r--r-- 1 root root 5 Jul 15 18:29 FTMActiveFlag-4034591c-48ea-4cdc-864f-e7cb61cfd0f2 -rw-r--r-- 1 root root 26 Jul 15 18:29 FTMEventLog-701d2531-684f-40d1-a1d5-e1466fb38321 -rw-r--r-- 1 root root 12 Jul 15 18:29 HiiDB-1b838190-4625-4ead-abc9-cd5e6af18fe0 -rw-r--r-- 1 root root 6 Jul 15 18:29 HwErrRecSupport-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 3577 Jul 15 18:29 KEK-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 3577 Jul 15 18:29 KEKDefault-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 6 Jul 15 18:29 MaximumTableSize-4b3082a3-80c6-4d7e-9cd0-583917265df1 -rw-r--r-- 1 root root 5 Jul 15 18:29 MemoryOverwriteRequestControl-e20939be-32d4-41be-a150-897f85d49829 -rw-r--r-- 1 root root 5 Jul 15 18:29 MemoryOverwriteRequestControlLock-bb983ccf-151d-40e1-a07b-4a17be168292 -rw-r--r-- 1 root root 978 Jul 15 18:29 MokListRT-605dab50-e046-4300-abb6-3dd810dd8b23 -rw-r--r-- 1 root root 8668 Jul 15 18:29 MokListXRT-605dab50-e046-4300-abb6-3dd810dd8b23 -rw-r--r-- 1 root root 8 Jul 15 18:29 MonotonicCounter-01368881-c4ad-4b1d-b631-d57a8ec8db6b -rw-r--r-- 1 root root 76 Jul 15 18:29 MyFav-4034591c-48ea-4cdc-864f-e7cb61cfd0f2 -rw-r--r-- 1 root root 6 Jul 15 18:29 NVRAM_Verify-15a9dd61-e4f8-4a99-80db-353b13d76490 -rw-r--r-- 1 root root 8 Jul 15 18:29 OfflineUniqueIDEKPubCRC-eaec226f-c9a3-477a-a826-ddc716cdc0e3 -rw-r--r-- 1 root root 260 Jul 15 18:29 OfflineUniqueIDEKPub-eaec226f-c9a3-477a-a826-ddc716cdc0e3 -rw-r--r-- 1 root root 12 Jul 15 18:29 OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 12 Jul 15 18:29 OsIndicationsSupported-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 7 Jul 15 18:29 PasswordMode-2b2a9752-feaa-4f86-a313-4d4c7117cee8 -rw-r--r-- 1 root root 890 Jul 15 18:29 PK-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 890 Jul 15 18:29 PKDefault-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 10 Jul 15 18:29 PlatformLang-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 60 Jul 15 18:29 PlatformLangCodes-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 8 Jul 15 18:29 PreVgaInfo-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9 -rw-r--r-- 1 root root 33 Jul 15 18:29 Record_CMOS_RTC_TIME-b2db8399-b883-46fe-8003-e54a4e60548b -rw-r--r-- 1 root root 12 Jul 15 18:29 RsdpAddr-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9 -rw-r--r-- 1 root root 22 Jul 15 18:29 SbatLevelRT-605dab50-e046-4300-abb6-3dd810dd8b23 -rw-r--r-- 1 root root 5 Jul 15 18:29 SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 6 Jul 15 18:29 SetupAPMFeatures-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9 -rw-r--r-- 1 root root 18 Jul 15 18:29 SetupHWMFeatures-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9 -rw-r--r-- 1 root root 5 Jul 15 18:29 SetupMode-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 5 Jul 15 18:29 SIDSUPPORT-7d3dceee-cbce-4ea7-8709-6e552f1edbde -rw-r--r-- 1 root root 148 Jul 15 18:29 SignatureSupport-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 12 Jul 15 18:29 SmbiosEntryPointTable-4b3082a3-80c6-4d7e-9cd0-583917265df1 -rw-r--r-- 1 root root 12 Jul 15 18:29 SmbiosEntryPointTableF000-4b3082a3-80c6-4d7e-9cd0-583917265df1 -rw-r--r-- 1 root root 12 Jul 15 18:29 SmbiosScratchBuffer-4b3082a3-80c6-4d7e-9cd0-583917265df1 -rw-r--r-- 1 root root 12 Jul 15 18:29 SmbiosV3EntryPointTable-4b3082a3-80c6-4d7e-9cd0-583917265df1 -rw-r--r-- 1 root root 5 Jul 15 18:29 Test_AC_LOSS_FLAG-15965464-28a2-41df-8629-fe26cd257605 -rw-r--r-- 1 root root 6 Jul 15 18:29 Timeout-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 5 Jul 15 18:29 TotalNumberOfRootBridges-fb5703f5-f8a7-f401-18b4-3f108deb2612 -rw-r--r-- 1 root root 10 Jul 15 18:29 TPMPERBIOSFLAGS-7d3dceee-cbce-4ea7-8709-6e552f1edbde -rw-r--r-- 1 root root 12 Jul 15 18:29 TpmServFlags-7d3dceee-cbce-4ea7-8709-6e552f1edbde -rw-r--r-- 1 root root 36 Jul 15 18:29 UnlockIDCopy-eaec226f-c9a3-477a-a826-ddc716cdc0e3 -rw-r--r-- 1 root root 5 Jul 15 18:29 VendorKeys-8be4df61-93ca-11d2-aa0d-00e098032b8c -rw-r--r-- 1 root root 8 Jul 15 18:29 WpBufAddr-cba83c4a-a5fc-48a8-b3a6-d33636166544 -rw-r--r-- 1 root root 68 Jul 15 18:29 WriteOnceStatus-4b3082a3-80c6-4d7e-9cd0-583917265df1
signature.asc
Description: OpenPGP digital signature