Jump to content
miliuco

ScanPolicy: choose device types and operating systems to be scanned by OpenCore

1 post in this topic

Recommended Posts

ScanPolicy key (integer) goes within Misc / Security in config.plist.

It defines device type and operating system detection policy. In accordance with this value, we can define different file systems and devices that OC scans and can boot. It is calculated by adding hexadecimal values of systems and devices, chosen in the list of the OC configuration PDF, and converting the total sum to their decimal value, which must be noted in config.plist.

 

From OC configuration PDF, failsafe value is 0x10F0103 corresponding to:

OC_SCAN_FILE_SYSTEM_LOCK - 1
OC_SCAN_DEVICE_LOCK - 2
OC_SCAN_ALLOW_FS_APFS - 100
OC_SCAN_ALLOW_DEVICE_SATA - 10000
OC_SCAN_ALLOW_DEVICE_SASEX - 20000
OC_SCAN_ALLOW_DEVICE_SCSI - 40000
OC_SCAN_ALLOW_DEVICE_NVME - 80000
OC_SCAN_ALLOW_DEVICE_PCI - 1000000

1 + 2 + 100 + 1000 + 2000 + 4000 + 8000 + 1000000 = 0x10F0103 (17760515 in decimal).

 

Setting to 0 will allow all sources present to be bootable.

 

But we may want to customize this. For example, I want to select this items:

0x00000001 — OC_SCAN_FILE_SYSTEM_LOCK, restricts scanning to only known file systems defined as a part of this policy.
0x00000002 — OC_SCAN_DEVICE_LOCK, restricts scanning to only known device types defined as a part of this policy.
0x00000100 — OC_SCAN_ALLOW_FS_APFS, allows scanning of APFS file system.
0x00000200 — OC_SCAN_ALLOW_FS_HFS, allows scanning of HFS file system.
0x00000800 — OC_SCAN_ALLOW_FS_NTFS, allows scanning of NTFS (Msft Basic Data) file system.
0x00010000 — OC_SCAN_ALLOW_DEVICE_SATA, allow scanning SATA devices.
0x00080000 — OC_SCAN_ALLOW_DEVICE_NVME, allow scanning NVMe devices.
0x00200000 — OC_SCAN_ALLOW_DEVICE_USB, allow scanning USB devices

Corresponding to 0x290B03, that's 2689795 in decimal. This is the value I write in config.plist.

 

Note: if you check 0x00000400 — OC_SCAN_ALLOW_FS_ESP, allows scanning of EFI System Partition file system all EFI partitions will be visible which may not be desirable.

 

As always, in Dortania there is an excellent text about this.

Edited by miliuco
Info added.
Share this post

×