Re: [PATCH] efi: libstub: add support for the apple_set_os protocol

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jun 30, 2024 at 04:42:55AM +0000, Aditya Garg wrote:
> +struct apple_set_os_protocol {
> +	u64 version;
> +	efi_status_t (__efiapi *set_os_version) (const char *);
> +	efi_status_t (__efiapi *set_os_vendor) (const char *);
> +	struct {
> +		u32 version;
> +		u32 set_os_version;
> +		u32 set_os_vendor;
> +	} mixed_mode;
> +};

Only the very first MacBooks that shipped in 2006 used a 32-bit EFI.
We don't need to call apple_set_os on those, so just get rid of the
mixed_mode portion of this struct and then ...

> @@ -321,6 +345,9 @@ static void setup_quirks(struct boot_params *boot_params)
>  	if (IS_ENABLED(CONFIG_APPLE_PROPERTIES) &&
>  	    !memcmp(efistub_fw_vendor(), apple, sizeof(apple)))
>  		retrieve_apple_device_properties(boot_params);
> +
> +	if (efi_apple_set_os)
> +		apple_set_os();
>  }

... make the call to apple_set_os() conditional on:

	if (efi_is_64bit() &&
	    !memcmp(efistub_fw_vendor(), apple, sizeof(apple)))

We don't want to call this on non-Apple hardware if we can help it.

Thanks,

Lukas




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux