TianoCore EDK2 master
Loading...
Searching...
No Matches
CapsuleOnDisk.c File Reference
#include "CapsuleApp.h"

Go to the source code of this file.

Functions

CHAR16 * GetFileNameFromPath (CHAR16 *FilePath)
 
BOOLEAN IsEfiSysPartitionDevicePath (EFI_DEVICE_PATH_PROTOCOL *DevicePath)
 
VOID DumpAllEfiSysPartition (VOID)
 
BOOLEAN IsCapsuleProvisioned (VOID)
 
EFI_STATUS GetEfiSysPartition (OUT EFI_DEVICE_PATH_PROTOCOL **FsDevicePath, OUT EFI_SIMPLE_FILE_SYSTEM_PROTOCOL **Fs)
 
EFI_STATUS GetEfiSysPartitionFromDevPath (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT EFI_DEVICE_PATH_PROTOCOL **FsDevicePath, OUT EFI_SIMPLE_FILE_SYSTEM_PROTOCOL **Fs)
 
EFI_STATUS GetEfiSysPartitionFromBootOptionFilePath (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT EFI_DEVICE_PATH_PROTOCOL **FullPath, OUT EFI_SIMPLE_FILE_SYSTEM_PROTOCOL **Fs)
 
EFI_STATUS GetUpdateFileSystem (IN CHAR16 *Map, OUT UINT16 *BootNext, OUT EFI_SIMPLE_FILE_SYSTEM_PROTOCOL **Fs, OUT BOOLEAN *UpdateBootNext)
 
EFI_STATUS WriteUpdateFile (IN VOID **Buffer, IN UINTN *BufferSize, IN CHAR16 **FileName, IN UINTN BufferNum, IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *Fs)
 
EFI_STATUS SetCapsuleStatusVariable (BOOLEAN SetCap)
 
BOOLEAN IsCapsuleOnDiskSupported (VOID)
 
EFI_STATUS ProcessCapsuleOnDisk (IN VOID **CapsuleBuffer, IN UINTN *CapsuleBufferSize, IN CHAR16 **FilePath, IN CHAR16 *Map, IN UINTN CapsuleNum)
 

Variables

EFI_GUID mCapsuleOnDiskBootOptionGuid
 

Detailed Description

Process Capsule On Disk.

Copyright (c) 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file CapsuleOnDisk.c.

Function Documentation

◆ DumpAllEfiSysPartition()

VOID DumpAllEfiSysPartition ( VOID  )

Dump all EFI System Partition.

Definition at line 115 of file CapsuleOnDisk.c.

◆ GetEfiSysPartition()

EFI_STATUS GetEfiSysPartition ( OUT EFI_DEVICE_PATH_PROTOCOL **  FsDevicePath,
OUT EFI_SIMPLE_FILE_SYSTEM_PROTOCOL **  Fs 
)

Get one active Efi System Partition.

Parameters
[out]FsDevicePathThe device path of Fs
[out]FsThe file system within EfiSysPartition
Return values
EFI_SUCCESSGet file system successfully
EFI_NOT_FOUNDNo valid file system found

Definition at line 202 of file CapsuleOnDisk.c.

◆ GetEfiSysPartitionFromBootOptionFilePath()

EFI_STATUS GetEfiSysPartitionFromBootOptionFilePath ( IN EFI_DEVICE_PATH_PROTOCOL DevicePath,
OUT EFI_DEVICE_PATH_PROTOCOL **  FullPath,
OUT EFI_SIMPLE_FILE_SYSTEM_PROTOCOL **  Fs 
)

Get SimpleFileSystem from boot option file path.

Parameters
[in]DevicePathThe file path of boot option
[out]FullPathThe full device path of boot device
[out]FsThe file system within EfiSysPartition
Return values
EFI_SUCCESSGet file system successfully
EFI_NOT_FOUNDNo valid file system found
othersGet file system failed

Definition at line 314 of file CapsuleOnDisk.c.

◆ GetEfiSysPartitionFromDevPath()

EFI_STATUS GetEfiSysPartitionFromDevPath ( IN EFI_DEVICE_PATH_PROTOCOL DevicePath,
OUT EFI_DEVICE_PATH_PROTOCOL **  FsDevicePath,
OUT EFI_SIMPLE_FILE_SYSTEM_PROTOCOL **  Fs 
)

Check if Active Efi System Partition within GPT is in the device path.

Parameters
[in]DevicePathThe device path
[out]FsDevicePathThe device path of Fs
[out]FsThe file system within EfiSysPartition
Return values
EFI_SUCCESSGet file system successfully
EFI_NOT_FOUNDNo valid file system found
othersGet file system failed

Definition at line 252 of file CapsuleOnDisk.c.

◆ GetFileNameFromPath()

CHAR16 * GetFileNameFromPath ( CHAR16 *  FilePath)

Get file name from file path.

Parameters
FilePathFile path.
Returns
Pointer to file name.

Definition at line 24 of file CapsuleOnDisk.c.

◆ GetUpdateFileSystem()

EFI_STATUS GetUpdateFileSystem ( IN CHAR16 *  Map,
OUT UINT16 *  BootNext,
OUT EFI_SIMPLE_FILE_SYSTEM_PROTOCOL **  Fs,
OUT BOOLEAN *  UpdateBootNext 
)

Get a valid SimpleFileSystem within EFI system partition.

Parameters
[in]MapThe FS mapping capsule write to
[out]BootNextThe value of BootNext Variable
[out]FsThe file system within EfiSysPartition
[out]UpdateBootNextThe flag to indicate whether update BootNext Variable
Return values
EFI_SUCCESSGet FS successfully
EFI_NOT_FOUNDNo valid FS found
othersGet FS failed

Definition at line 382 of file CapsuleOnDisk.c.

◆ IsCapsuleOnDiskSupported()

BOOLEAN IsCapsuleOnDiskSupported ( VOID  )

Check if Capsule On Disk is supported.

Return values
TRUECapsule On Disk is supported.
FALSECapsule On Disk is not supported.

Definition at line 742 of file CapsuleOnDisk.c.

◆ IsCapsuleProvisioned()

BOOLEAN IsCapsuleProvisioned ( VOID  )

Check if capsule is provisioned.

Return values
TRUECapsule is provisioned previously.
FALSENo capsule is provisioned.

Definition at line 165 of file CapsuleOnDisk.c.

◆ IsEfiSysPartitionDevicePath()

BOOLEAN IsEfiSysPartitionDevicePath ( EFI_DEVICE_PATH_PROTOCOL DevicePath)

Check if the device path is EFI system Partition.

Parameters
DevicePathThe ESP device path.
Return values
TRUEDevicePath is a device path for ESP.
FALSEDevicePath is not a device path for ESP.

Definition at line 72 of file CapsuleOnDisk.c.

◆ ProcessCapsuleOnDisk()

EFI_STATUS ProcessCapsuleOnDisk ( IN VOID **  CapsuleBuffer,
IN UINTN CapsuleBufferSize,
IN CHAR16 **  FilePath,
IN CHAR16 *  Map,
IN UINTN  CapsuleNum 
)

Process Capsule On Disk.

Parameters
[in]CapsuleBufferAn array of pointer to capsule images
[in]CapsuleBufferSizeAn array of UINTN to capsule images size
[in]FilePathAn array of capsule images file path
[in]MapFile system mapping string
[in]CapsuleNumThe count of capsule images
Return values
EFI_SUCCESSCapsule on disk success.
othersCapsule on disk fail.

Definition at line 783 of file CapsuleOnDisk.c.

◆ SetCapsuleStatusVariable()

EFI_STATUS SetCapsuleStatusVariable ( BOOLEAN  SetCap)

Set capsule status variable.

Parameters
[in]SetCapSet or clear the capsule flag.
Return values
EFI_SUCCESSSucceed to set SetCap variable.
othersFail to set the variable.

Definition at line 696 of file CapsuleOnDisk.c.

◆ WriteUpdateFile()

EFI_STATUS WriteUpdateFile ( IN VOID **  Buffer,
IN UINTN BufferSize,
IN CHAR16 **  FileName,
IN UINTN  BufferNum,
IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL Fs 
)

Write files to a given SimpleFileSystem.

Parameters
[in]BufferThe buffer array
[in]BufferSizeThe buffer size array
[in]FileNameThe file name array
[in]BufferNumThe buffer number
[in]FsThe SimpleFileSystem handle to be written
Return values
EFI_SUCCESSWrite file successfully
EFI_NOT_FOUNDSFS protocol not found
othersWrite file failed

Definition at line 579 of file CapsuleOnDisk.c.

Variable Documentation

◆ mCapsuleOnDiskBootOptionGuid

EFI_GUID mCapsuleOnDiskBootOptionGuid
Initial value:
= {
0x4CC29BB7, 0x2413, 0x40A2, { 0xB0, 0x6D, 0x25, 0x3E, 0x37, 0x10, 0xF5, 0x32 }
}

Definition at line 11 of file CapsuleOnDisk.c.