mirror of https://github.com/ventoy/Ventoy.git
parent
2090c6fa97
commit
05a1b863a6
@ -0,0 +1,30 @@
|
||||
Build a static linked, small dmsetup tool
|
||||
|
||||
======== Source Code ========
|
||||
use an old version of dmsetup
|
||||
xxx/centos-vault/5.3/os/SRPMS/device-mapper-1.02.28-2.el5.src.rpm
|
||||
|
||||
======== Build Envrioment ========
|
||||
build for 32bit, static linked with dietlibc
|
||||
1. install centos 6.10 i386 with CentOS-6.10-i386-bin-DVD1.iso
|
||||
2. yum install gcc kernel-devel package
|
||||
3. install dietc libc (just make && make install)
|
||||
4. export PATH=$PATH:/opt/diet/bin
|
||||
|
||||
======== Build Step ========
|
||||
1. extract device mapper source code
|
||||
2. CC="diet gcc" ./configure --disable-nls --disable-selinux --disable-shared
|
||||
3. modify include/configure.h file
|
||||
--- delete the line with "#define malloc rpl_malloc"
|
||||
--- add 2 defines as follow:
|
||||
#ifndef UINT32_MAX
|
||||
#define UINT32_MAX (4294967295U)
|
||||
#endif
|
||||
|
||||
#ifndef UINT64_C
|
||||
#define UINT64_C(c) c ## ULL
|
||||
#endif
|
||||
|
||||
4. make
|
||||
5. strip dmsetup/dmsetup
|
||||
5. get dmsetup/dmsetup as the binary file
|
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
|
||||
========== About Source Code =============
|
||||
Ventoy add an UEFI application module in MdeModulePkg, so I only put the module's source code here.
|
||||
You can download the EDK2 code from https://github.com/tianocore/edk2 and merge the code together.
|
||||
|
||||
|
||||
========== Build =============
|
||||
Follow the EDK2's build instructions
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,233 @@
|
||||
/******************************************************************************
|
||||
* Ventoy.h
|
||||
*
|
||||
* Copyright (c) 2020, longpanda <admin@ventoy.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __VENTOY_H__
|
||||
#define __VENTOY_H__
|
||||
|
||||
#define COMPILE_ASSERT(expr) extern char __compile_assert[(expr) ? 1 : -1]
|
||||
|
||||
#define VENTOY_GUID { 0x77772020, 0x2e77, 0x6576, { 0x6e, 0x74, 0x6f, 0x79, 0x2e, 0x6e, 0x65, 0x74 }}
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
typedef struct ventoy_guid
|
||||
{
|
||||
UINT32 data1;
|
||||
UINT16 data2;
|
||||
UINT16 data3;
|
||||
UINT8 data4[8];
|
||||
}ventoy_guid;
|
||||
|
||||
typedef struct ventoy_image_disk_region
|
||||
{
|
||||
UINT32 image_sector_count; /* image sectors contained in this region */
|
||||
UINT32 image_start_sector; /* image sector start */
|
||||
UINT64 disk_start_sector; /* disk sector start */
|
||||
}ventoy_image_disk_region;
|
||||
|
||||
typedef struct ventoy_image_location
|
||||
{
|
||||
ventoy_guid guid;
|
||||
|
||||
/* image sector size, currently this value is always 2048 */
|
||||
UINT32 image_sector_size;
|
||||
|
||||
/* disk sector size, normally the value is 512 */
|
||||
UINT32 disk_sector_size;
|
||||
|
||||
UINT32 region_count;
|
||||
|
||||
/*
|
||||
* disk region data
|
||||
* If the image file has more than one fragments in disk,
|
||||
* there will be more than one region data here.
|
||||
*
|
||||
*/
|
||||
ventoy_image_disk_region regions[1];
|
||||
|
||||
/* ventoy_image_disk_region regions[2~region_count-1] */
|
||||
}ventoy_image_location;
|
||||
|
||||
typedef struct ventoy_os_param
|
||||
{
|
||||
ventoy_guid guid; // VENTOY_GUID
|
||||
UINT8 chksum; // checksum
|
||||
|
||||
UINT8 vtoy_disk_guid[16];
|
||||
UINT64 vtoy_disk_size; // disk size in bytes
|
||||
UINT16 vtoy_disk_part_id; // begin with 1
|
||||
UINT16 vtoy_disk_part_type; // 0:exfat 1:ntfs other: reserved
|
||||
char vtoy_img_path[384]; // It seems to be enough, utf-8 format
|
||||
UINT64 vtoy_img_size; // image file size in bytes
|
||||
|
||||
/*
|
||||
* Ventoy will write a copy of ventoy_image_location data into runtime memory
|
||||
* this is the physically address and length of that memory.
|
||||
* Address 0 means no such data exist.
|
||||
* Address will be aligned by 4KB.
|
||||
*
|
||||
*/
|
||||
UINT64 vtoy_img_location_addr;
|
||||
UINT32 vtoy_img_location_len;
|
||||
|
||||
UINT64 vtoy_reserved[4]; // Internal use by ventoy
|
||||
|
||||
UINT8 reserved[31];
|
||||
}ventoy_os_param;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
// compile assert to check that size of ventoy_os_param must be 512
|
||||
COMPILE_ASSERT(sizeof(ventoy_os_param) == 512);
|
||||
|
||||
|
||||
|
||||
#pragma pack(4)
|
||||
|
||||
typedef struct ventoy_chain_head
|
||||
{
|
||||
ventoy_os_param os_param;
|
||||
|
||||
UINT32 disk_drive;
|
||||
UINT32 drive_map;
|
||||
UINT32 disk_sector_size;
|
||||
|
||||
UINT64 real_img_size_in_bytes;
|
||||
UINT64 virt_img_size_in_bytes;
|
||||
UINT32 boot_catalog;
|
||||
UINT8 boot_catalog_sector[2048];
|
||||
|
||||
UINT32 img_chunk_offset;
|
||||
UINT32 img_chunk_num;
|
||||
|
||||
UINT32 override_chunk_offset;
|
||||
UINT32 override_chunk_num;
|
||||
|
||||
UINT32 virt_chunk_offset;
|
||||
UINT32 virt_chunk_num;
|
||||
}ventoy_chain_head;
|
||||
|
||||
|
||||
typedef struct ventoy_img_chunk
|
||||
{
|
||||
UINT32 img_start_sector; //2KB
|
||||
UINT32 img_end_sector;
|
||||
|
||||
UINT64 disk_start_sector; // in disk_sector_size
|
||||
UINT64 disk_end_sector;
|
||||
}ventoy_img_chunk;
|
||||
|
||||
|
||||
typedef struct ventoy_override_chunk
|
||||
{
|
||||
UINT64 img_offset;
|
||||
UINT32 override_size;
|
||||
UINT8 override_data[512];
|
||||
}ventoy_override_chunk;
|
||||
|
||||
typedef struct ventoy_virt_chunk
|
||||
{
|
||||
UINT32 mem_sector_start;
|
||||
UINT32 mem_sector_end;
|
||||
UINT32 mem_sector_offset;
|
||||
UINT32 remap_sector_start;
|
||||
UINT32 remap_sector_end;
|
||||
UINT32 org_sector_start;
|
||||
}ventoy_virt_chunk;
|
||||
|
||||
|
||||
#pragma pack()
|
||||
|
||||
|
||||
#define VTOY_BLOCK_DEVICE_PATH_GUID \
|
||||
{ 0x37b87ac6, 0xc180, 0x4583, { 0xa7, 0x05, 0x41, 0x4d, 0xa8, 0xf7, 0x7e, 0xd2 }}
|
||||
|
||||
#define VTOY_BLOCK_DEVICE_PATH_NAME L"ventoy"
|
||||
|
||||
#if defined (MDE_CPU_IA32)
|
||||
#define VENTOY_UEFI_DESC L"IA32 UEFI"
|
||||
#elif defined (MDE_CPU_X64)
|
||||
#define VENTOY_UEFI_DESC L"X64 UEFI"
|
||||
#elif defined (MDE_CPU_EBC)
|
||||
#elif defined (MDE_CPU_ARM)
|
||||
#define VENTOY_UEFI_DESC L"ARM UEFI"
|
||||
#elif defined (MDE_CPU_AARCH64)
|
||||
#define VENTOY_UEFI_DESC L"ARM64 UEFI"
|
||||
#else
|
||||
#error Unknown Processor Type
|
||||
#endif
|
||||
|
||||
typedef struct ventoy_sector_flag
|
||||
{
|
||||
UINT8 flag; // 0:init 1:mem 2:remap
|
||||
UINT64 remap_lba;
|
||||
}ventoy_sector_flag;
|
||||
|
||||
|
||||
typedef struct vtoy_block_data
|
||||
{
|
||||
EFI_HANDLE Handle;
|
||||
EFI_BLOCK_IO_MEDIA Media; /* Media descriptor */
|
||||
EFI_BLOCK_IO_PROTOCOL BlockIo; /* Block I/O protocol */
|
||||
|
||||
UINTN DevicePathCompareLen;
|
||||
EFI_DEVICE_PATH_PROTOCOL *Path; /* Device path protocol */
|
||||
|
||||
EFI_HANDLE RawBlockIoHandle;
|
||||
EFI_BLOCK_IO_PROTOCOL *pRawBlockIo;
|
||||
EFI_DEVICE_PATH_PROTOCOL *pDiskDevPath;
|
||||
|
||||
/* ventoy disk part2 ESP */
|
||||
EFI_HANDLE DiskFsHandle;
|
||||
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *pDiskFs;
|
||||
EFI_DEVICE_PATH_PROTOCOL *pDiskFsDevPath;
|
||||
|
||||
EFI_HANDLE IsoDriverImage;
|
||||
}vtoy_block_data;
|
||||
|
||||
#define ISO9660_EFI_DRIVER_PATH L"\\ventoy\\iso9660_x64.efi"
|
||||
|
||||
#define debug(expr, ...) if (gDebugPrint) VtoyDebug("[VTOY] "expr"\r\n", ##__VA_ARGS__)
|
||||
#define sleep(sec) gBS->Stall(1000000 * (sec))
|
||||
|
||||
#define ventoy_debug_pause() \
|
||||
if (gDebugPrint) \
|
||||
{ \
|
||||
UINTN __Index = 0; \
|
||||
gST->ConOut->OutputString(gST->ConOut, L"[VTOY] ###### Press Enter to continue... ######\r\n");\
|
||||
gST->ConIn->Reset(gST->ConIn, FALSE); \
|
||||
gBS->WaitForEvent(1, &gST->ConIn->WaitForKey, &__Index);\
|
||||
}
|
||||
|
||||
typedef const char * (*grub_env_get_pf)(const char *name);
|
||||
|
||||
#pragma pack(1)
|
||||
typedef struct ventoy_grub_param
|
||||
{
|
||||
grub_env_get_pf grub_env_get;
|
||||
}ventoy_grub_param;
|
||||
#pragma pack()
|
||||
|
||||
|
||||
extern BOOLEAN gDebugPrint;
|
||||
VOID EFIAPI VtoyDebug(IN CONST CHAR8 *Format, ...);
|
||||
|
||||
#endif
|
||||
|
@ -0,0 +1,49 @@
|
||||
#************************************************************************************
|
||||
# Copyright (c) 2020, longpanda <admin@ventoy.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#************************************************************************************
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = Ventoy
|
||||
FILE_GUID = 1c3a0915-09dc-49c2-873d-0aaaa7733299
|
||||
MODULE_TYPE = UEFI_APPLICATION
|
||||
VERSION_STRING = 1.0
|
||||
ENTRY_POINT = VentoyEfiMain
|
||||
|
||||
|
||||
[Sources]
|
||||
Ventoy.h
|
||||
Ventoy.c
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
ShellPkg/ShellPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
UefiApplicationEntryPoint
|
||||
UefiLib
|
||||
DebugLib
|
||||
|
||||
[Guids]
|
||||
gShellVariableGuid
|
||||
|
||||
[Protocols]
|
||||
gEfiLoadedImageProtocolGuid
|
||||
gEfiBlockIoProtocolGuid
|
||||
gEfiDevicePathProtocolGuid
|
||||
gEfiSimpleFileSystemProtocolGuid
|
@ -0,0 +1,496 @@
|
||||
## @file
|
||||
# EFI/PI Reference Module Package for All Architectures
|
||||
#
|
||||
# (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
|
||||
# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
##
|
||||
|
||||
[Defines]
|
||||
PLATFORM_NAME = MdeModule
|
||||
PLATFORM_GUID = 587CE499-6CBE-43cd-94E2-186218569478
|
||||
PLATFORM_VERSION = 0.98
|
||||
DSC_SPECIFICATION = 0x00010005
|
||||
OUTPUT_DIRECTORY = Build/MdeModule
|
||||
SUPPORTED_ARCHITECTURES = IA32|X64|EBC|ARM|AARCH64
|
||||
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
|
||||
SKUID_IDENTIFIER = DEFAULT
|
||||
|
||||
[LibraryClasses]
|
||||
#
|
||||
# Entry point
|
||||
#
|
||||
PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf
|
||||
PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
|
||||
DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
|
||||
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
|
||||
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
|
||||
#
|
||||
# Basic
|
||||
#
|
||||
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
|
||||
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
|
||||
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
|
||||
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
|
||||
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
|
||||
PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf
|
||||
PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf
|
||||
PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
|
||||
CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
|
||||
PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
|
||||
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
|
||||
SortLib|MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
|
||||
#
|
||||
# UEFI & PI
|
||||
#
|
||||
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
|
||||
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
|
||||
UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
|
||||
UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
|
||||
UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
|
||||
HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
|
||||
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
|
||||
UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
|
||||
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
|
||||
PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
|
||||
DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
|
||||
DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
|
||||
UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
|
||||
#
|
||||
# Generic Modules
|
||||
#
|
||||
UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
|
||||
UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
|
||||
SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
|
||||
TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
|
||||
SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
|
||||
CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
|
||||
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
|
||||
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
|
||||
FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
|
||||
#
|
||||
# Misc
|
||||
#
|
||||
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
|
||||
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
|
||||
ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
|
||||
PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
|
||||
PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
|
||||
DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf
|
||||
PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf
|
||||
ResetSystemLib|MdeModulePkg/Library/BaseResetSystemLibNull/BaseResetSystemLibNull.inf
|
||||
SmbusLib|MdePkg/Library/DxeSmbusLib/DxeSmbusLib.inf
|
||||
S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf
|
||||
CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf
|
||||
PlatformBootManagerLib|MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManagerLibNull.inf
|
||||
PciHostBridgeLib|MdeModulePkg/Library/PciHostBridgeLibNull/PciHostBridgeLibNull.inf
|
||||
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
|
||||
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
|
||||
VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
|
||||
FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
|
||||
NonDiscoverableDeviceRegistrationLib|MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.inf
|
||||
|
||||
FmpAuthenticationLib|MdeModulePkg/Library/FmpAuthenticationLibNull/FmpAuthenticationLibNull.inf
|
||||
CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
|
||||
BmpSupportLib|MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf
|
||||
SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
|
||||
DisplayUpdateProgressLib|MdeModulePkg/Library/DisplayUpdateProgressLibGraphics/DisplayUpdateProgressLibGraphics.inf
|
||||
|
||||
[LibraryClasses.EBC.PEIM]
|
||||
IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf
|
||||
|
||||
[LibraryClasses.common.PEI_CORE]
|
||||
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
|
||||
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
|
||||
|
||||
[LibraryClasses.common.PEIM]
|
||||
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
|
||||
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
|
||||
ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
|
||||
LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf
|
||||
|
||||
[LibraryClasses.common.DXE_CORE]
|
||||
HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
|
||||
MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf
|
||||
ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
|
||||
|
||||
[LibraryClasses.common.DXE_DRIVER]
|
||||
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
|
||||
LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.inf
|
||||
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
|
||||
ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
|
||||
CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.inf
|
||||
|
||||
[LibraryClasses.common.DXE_RUNTIME_DRIVER]
|
||||
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
|
||||
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
|
||||
DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
|
||||
LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.inf
|
||||
CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf
|
||||
|
||||
[LibraryClasses.common.SMM_CORE]
|
||||
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
|
||||
MemoryAllocationLib|MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationLib.inf
|
||||
SmmServicesTableLib|MdeModulePkg/Library/PiSmmCoreSmmServicesTableLib/PiSmmCoreSmmServicesTableLib.inf
|
||||
SmmCorePlatformHookLib|MdeModulePkg/Library/SmmCorePlatformHookLibNull/SmmCorePlatformHookLibNull.inf
|
||||
SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf
|
||||
|
||||
[LibraryClasses.common.DXE_SMM_DRIVER]
|
||||
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
|
||||
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
|
||||
MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
|
||||
MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf
|
||||
SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
|
||||
LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxSmmLib.inf
|
||||
SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf
|
||||
|
||||
[LibraryClasses.common.UEFI_DRIVER]
|
||||
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
|
||||
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
|
||||
DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
|
||||
LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.inf
|
||||
|
||||
[LibraryClasses.common.UEFI_APPLICATION]
|
||||
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
|
||||
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
|
||||
DebugLib|MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
|
||||
FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
|
||||
|
||||
[LibraryClasses.common.MM_STANDALONE]
|
||||
HobLib|MdeModulePkg/Library/BaseHobLibNull/BaseHobLibNull.inf
|
||||
MemoryAllocationLib|MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.inf
|
||||
StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf
|
||||
MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
|
||||
|
||||
[LibraryClasses.ARM, LibraryClasses.AARCH64]
|
||||
ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
|
||||
ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
|
||||
LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf
|
||||
|
||||
#
|
||||
# It is not possible to prevent ARM compiler calls to generic intrinsic functions.
|
||||
# This library provides the instrinsic functions generated by a given compiler.
|
||||
# [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
|
||||
#
|
||||
NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
|
||||
|
||||
#
|
||||
# Since software stack checking may be heuristically enabled by the compiler
|
||||
# include BaseStackCheckLib unconditionally.
|
||||
#
|
||||
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
|
||||
|
||||
[LibraryClasses.EBC]
|
||||
LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf
|
||||
|
||||
[PcdsFeatureFlag]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE
|
||||
gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdDevicePathSupportDevicePathFromText|FALSE
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdDevicePathSupportDevicePathToText|FALSE
|
||||
|
||||
[PcdsFixedAtBuild]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f
|
||||
gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x06
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule|0x0
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule|0x0
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|28
|
||||
|
||||
[PcdsDynamicExDefault]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdRecoveryFileName|L"FVMAIN.FV"
|
||||
|
||||
[Components]
|
||||
MdeModulePkg/Application/Ventoy/Ventoy.inf
|
||||
MdeModulePkg/Application/HelloWorld/HelloWorld.inf
|
||||
MdeModulePkg/Application/DumpDynPcd/DumpDynPcd.inf
|
||||
MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.inf
|
||||
|
||||
MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
|
||||
MdeModulePkg/Logo/Logo.inf
|
||||
MdeModulePkg/Logo/LogoDxe.inf
|
||||
MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
|
||||
MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf
|
||||
MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf
|
||||
MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
|
||||
MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf
|
||||
MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf
|
||||
MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf
|
||||
MdeModulePkg/Library/PciHostBridgeLibNull/PciHostBridgeLibNull.inf
|
||||
MdeModulePkg/Library/PiSmmCoreSmmServicesTableLib/PiSmmCoreSmmServicesTableLib.inf
|
||||
MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
|
||||
MdeModulePkg/Library/BaseHobLibNull/BaseHobLibNull.inf
|
||||
MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.inf
|
||||
|
||||
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
|
||||
MdeModulePkg/Bus/Pci/PciSioSerialDxe/PciSioSerialDxe.inf
|
||||
MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
|
||||
MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupportDxe.inf
|
||||
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
|
||||
MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.inf
|
||||
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.inf
|
||||
MdeModulePkg/Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.inf
|
||||
MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPei.inf
|
||||
MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.inf
|
||||
MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.inf
|
||||
MdeModulePkg/Bus/Sd/SdDxe/SdDxe.inf
|
||||
MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.inf
|
||||
MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruDxe.inf
|
||||
MdeModulePkg/Bus/Pci/UfsPciHcPei/UfsPciHcPei.inf
|
||||
MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.inf
|
||||
MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
|
||||
MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf
|
||||
MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf
|
||||
MdeModulePkg/Bus/Pci/UhciPei/UhciPei.inf
|
||||
MdeModulePkg/Bus/Pci/EhciPei/EhciPei.inf
|
||||
MdeModulePkg/Bus/Pci/XhciPei/XhciPei.inf
|
||||
MdeModulePkg/Bus/Pci/IdeBusPei/IdeBusPei.inf
|
||||
MdeModulePkg/Bus/Usb/UsbBusPei/UsbBusPei.inf
|
||||
MdeModulePkg/Bus/Usb/UsbBotPei/UsbBotPei.inf
|
||||
MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
|
||||
MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
|
||||
MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
|
||||
MdeModulePkg/Bus/Ata/AhciPei/AhciPei.inf
|
||||
MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
|
||||
MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
|
||||
MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
|
||||
MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
|
||||
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
|
||||
MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointerDxe.inf
|
||||
MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
|
||||
MdeModulePkg/Bus/I2c/I2cDxe/I2cBusDxe.inf
|
||||
MdeModulePkg/Bus/I2c/I2cDxe/I2cHostDxe.inf
|
||||
MdeModulePkg/Bus/I2c/I2cDxe/I2cDxe.inf
|
||||
MdeModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.inf
|
||||
MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
|
||||
MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf
|
||||
MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.inf
|
||||
|
||||
MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
|
||||
MdeModulePkg/Core/Pei/PeiMain.inf
|
||||
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
|
||||
|
||||
MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
|
||||
MdeModulePkg/Library/UefiMemoryAllocationProfileLib/UefiMemoryAllocationProfileLib.inf
|
||||
MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf
|
||||
MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationProfileLib.inf
|
||||
MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf
|
||||
MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
|
||||
MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
|
||||
MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
|
||||
MdeModulePkg/Library/DxePrintLibPrint2Protocol/DxePrintLibPrint2Protocol.inf
|
||||
MdeModulePkg/Library/PeiCrc32GuidedSectionExtractLib/PeiCrc32GuidedSectionExtractLib.inf
|
||||
MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
|
||||
MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.inf
|
||||
MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
|
||||
MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
|
||||
MdeModulePkg/Library/BaseResetSystemLibNull/BaseResetSystemLibNull.inf
|
||||
MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
|
||||
MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
|
||||
MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
|
||||
MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
|
||||
MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf
|
||||
MdeModulePkg/Library/RuntimeResetSystemLib/RuntimeResetSystemLib.inf
|
||||
MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
|
||||
MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf
|
||||
MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.inf
|
||||
MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf
|
||||
MdeModulePkg/Library/PeiDebugPrintHobLib/PeiDebugPrintHobLib.inf
|
||||
MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf
|
||||
MdeModulePkg/Library/PlatformHookLibSerialPortPpi/PlatformHookLibSerialPortPpi.inf
|
||||
MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
|
||||
MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
|
||||
MdeModulePkg/Library/PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf
|
||||
MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
|
||||
MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManagerLibNull.inf
|
||||
MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
|
||||
MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
|
||||
MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
|
||||
MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
|
||||
MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf
|
||||
MdeModulePkg/Library/VarCheckPcdLib/VarCheckPcdLib.inf
|
||||
MdeModulePkg/Library/PlatformVarCleanupLib/PlatformVarCleanupLib.inf
|
||||
MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
|
||||
MdeModulePkg/Library/DxeFileExplorerProtocol/DxeFileExplorerProtocol.inf
|
||||
MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
|
||||
MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
|
||||
MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
|
||||
MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf
|
||||
MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
|
||||
MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.inf
|
||||
MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf
|
||||
MdeModulePkg/Library/DisplayUpdateProgressLibGraphics/DisplayUpdateProgressLibGraphics.inf
|
||||
MdeModulePkg/Library/DisplayUpdateProgressLibText/DisplayUpdateProgressLibText.inf
|
||||
|
||||
MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
|
||||
MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
|
||||
MdeModulePkg/Application/UiApp/UiApp.inf{
|
||||
<LibraryClasses>
|
||||
NULL|MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf
|
||||
NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf
|
||||
NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf
|
||||
}
|
||||
MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf
|
||||
MdeModulePkg/Universal/BootManagerPolicyDxe/BootManagerPolicyDxe.inf
|
||||
MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
|
||||
MdeModulePkg/Universal/CapsuleOnDiskLoadPei/CapsuleOnDiskLoadPei.inf
|
||||
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
|
||||
MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
|
||||
MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
|
||||
MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
|
||||
MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
|
||||
MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
|
||||
MdeModulePkg/Universal/DebugPortDxe/DebugPortDxe.inf
|
||||
MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
|
||||
MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
|
||||
MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
|
||||
MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
|
||||
MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
|
||||
MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
|
||||
MdeModulePkg/Universal/Disk/CdExpressPei/CdExpressPei.inf
|
||||
MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf
|
||||
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
|
||||
MdeModulePkg/Universal/MemoryTest/GenericMemoryTestDxe/GenericMemoryTestDxe.inf
|
||||
MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf
|
||||
MdeModulePkg/Universal/Metronome/Metronome.inf
|
||||
MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
|
||||
MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf {
|
||||
<LibraryClasses>
|
||||
ResetSystemLib|MdeModulePkg/Library/BaseResetSystemLibNull/BaseResetSystemLibNull.inf
|
||||
}
|
||||
MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf {
|
||||
<LibraryClasses>
|
||||
ResetSystemLib|MdeModulePkg/Library/BaseResetSystemLibNull/BaseResetSystemLibNull.inf
|
||||
}
|
||||
MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
|
||||
MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.inf
|
||||
|
||||
MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PcatSingleSegmentPciCfg2Pei.inf
|
||||
MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
|
||||
MdeModulePkg/Universal/PCD/Pei/Pcd.inf
|
||||
MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf
|
||||
|
||||
MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.inf
|
||||
MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf
|
||||
|
||||
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
|
||||
MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
|
||||
MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
|
||||
MdeModulePkg/Application/VariableInfo/VariableInfo.inf
|
||||
MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf
|
||||
MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
|
||||
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
|
||||
MdeModulePkg/Universal/TimestampDxe/TimestampDxe.inf
|
||||
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
|
||||
|
||||
MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
|
||||
MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
|
||||
MdeModulePkg/Universal/HiiResourcesSampleDxe/HiiResourcesSampleDxe.inf
|
||||
MdeModulePkg/Universal/LegacyRegion2Dxe/LegacyRegion2Dxe.inf
|
||||
|
||||
MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf
|
||||
MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf
|
||||
|
||||
MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.inf {
|
||||
<LibraryClasses>
|
||||
LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf
|
||||
}
|
||||
MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
|
||||
MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
|
||||
MdeModulePkg/Universal/SectionExtractionDxe/SectionExtractionDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
|
||||
}
|
||||
MdeModulePkg/Universal/SectionExtractionPei/SectionExtractionPei.inf {
|
||||
<LibraryClasses>
|
||||
NULL|MdeModulePkg/Library/PeiCrc32GuidedSectionExtractLib/PeiCrc32GuidedSectionExtractLib.inf
|
||||
}
|
||||
|
||||
MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
|
||||
MdeModulePkg/Universal/EsrtDxe/EsrtDxe.inf
|
||||
MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmpDxe.inf
|
||||
|
||||
MdeModulePkg/Universal/FileExplorerDxe/FileExplorerDxe.inf {
|
||||
<LibraryClasses>
|
||||
FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
|
||||
}
|
||||
|
||||
MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
|
||||
MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.inf
|
||||
|
||||
MdeModulePkg/Universal/DebugServicePei/DebugServicePei.inf
|
||||
|
||||
MdeModulePkg/Application/CapsuleApp/CapsuleApp.inf
|
||||
MdeModulePkg/Library/FmpAuthenticationLibNull/FmpAuthenticationLibNull.inf
|
||||
MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.inf
|
||||
MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf
|
||||
|
||||
[Components.IA32, Components.X64, Components.AARCH64]
|
||||
MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
|
||||
MdeModulePkg/Universal/EbcDxe/EbcDebugger.inf
|
||||
MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
|
||||
|
||||
[Components.IA32, Components.X64, Components.ARM, Components.AARCH64]
|
||||
MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomDecompressLib.inf
|
||||
MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
|
||||
MdeModulePkg/Core/Dxe/DxeMain.inf {
|
||||
<LibraryClasses>
|
||||
NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
|
||||
}
|
||||
|
||||
!if $(TOOL_CHAIN_TAG) != "XCODE5"
|
||||
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf
|
||||
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
|
||||
!endif
|
||||
|
||||
[Components.IA32, Components.X64]
|
||||
MdeModulePkg/Universal/DebugSupportDxe/DebugSupportDxe.inf
|
||||
MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.inf
|
||||
MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
|
||||
MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
|
||||
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf {
|
||||
<LibraryClasses>
|
||||
NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
|
||||
NULL|MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf
|
||||
NULL|MdeModulePkg/Library/VarCheckPcdLib/VarCheckPcdLib.inf
|
||||
}
|
||||
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
|
||||
NULL|MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf
|
||||
NULL|MdeModulePkg/Library/VarCheckPcdLib/VarCheckPcdLib.inf
|
||||
}
|
||||
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf
|
||||
MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf
|
||||
MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf
|
||||
MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.inf
|
||||
MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf
|
||||
MdeModulePkg/Library/SmmMemoryAllocationProfileLib/SmmMemoryAllocationProfileLib.inf
|
||||
MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationProfileLib.inf
|
||||
MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationLib.inf
|
||||
MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.inf
|
||||
MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.inf
|
||||
MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf
|
||||
MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.inf
|
||||
MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxSmmLib.inf
|
||||
MdeModulePkg/Library/SmmCorePlatformHookLibNull/SmmCorePlatformHookLibNull.inf
|
||||
MdeModulePkg/Library/SmmSmiHandlerProfileLib/SmmSmiHandlerProfileLib.inf
|
||||
MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaArchCustomDecompressLib.inf
|
||||
MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf
|
||||
MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf
|
||||
MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.inf
|
||||
MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.inf
|
||||
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf
|
||||
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.inf
|
||||
MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
|
||||
MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.inf
|
||||
MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
|
||||
|
||||
[Components.X64]
|
||||
MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf
|
||||
|
||||
[BuildOptions]
|
||||
*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
|
||||
|
@ -0,0 +1,8 @@
|
||||
Please download exfat-1.3.0.zip and mirrors-libfuse-fuse-2.9.9.zip first.
|
||||
|
||||
exfat-1.3.0.zip:
|
||||
https://codeload.github.com/relan/exfat/zip/v1.3.0
|
||||
|
||||
mirrors-libfuse-fuse-2.9.9.zip:
|
||||
https://gitee.com/mirrors/libfuse/repository/archive/fuse-2.9.9.zip
|
||||
|
@ -0,0 +1,62 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# For 32bit, for example CentOS 6.10 i386
|
||||
# automake 1.11.1 must update to automake 1.11.2
|
||||
# pkg-config must be installed
|
||||
#
|
||||
#
|
||||
|
||||
if uname -a | egrep -q 'x86_64|amd64'; then
|
||||
opt=
|
||||
else
|
||||
opt=-lrt
|
||||
fi
|
||||
|
||||
CUR="$PWD"
|
||||
|
||||
if ! [ -e LIBFUSE ]; then
|
||||
./buidlibfuse.sh
|
||||
fi
|
||||
|
||||
|
||||
rm -f EXFAT/shared/*
|
||||
rm -f EXFAT/static/*
|
||||
|
||||
|
||||
rm -rf exfat-1.3.0
|
||||
unzip exfat-1.3.0.zip
|
||||
|
||||
|
||||
cd exfat-1.3.0
|
||||
autoreconf --install
|
||||
./configure --prefix="$CUR" CFLAGS='-static -O2 -D_FILE_OFFSET_BITS=64' FUSE_CFLAGS="-I$CUR/LIBFUSE/include/" FUSE_LIBS="$CUR/LIBFUSE/lib/libfuse.a -pthread $opt -ldl"
|
||||
make
|
||||
|
||||
strip --strip-all fuse/mount.exfat-fuse
|
||||
strip --strip-all mkfs/mkexfatfs
|
||||
|
||||
cp fuse/mount.exfat-fuse ../EXFAT/static/mount.exfat-fuse
|
||||
cp mkfs/mkexfatfs ../EXFAT/static/mkexfatfs
|
||||
|
||||
cd ..
|
||||
rm -rf exfat-1.3.0
|
||||
|
||||
unzip exfat-1.3.0.zip
|
||||
|
||||
cd exfat-1.3.0
|
||||
autoreconf --install
|
||||
./configure --prefix="$CUR" CFLAGS='-O2 -D_FILE_OFFSET_BITS=64' FUSE_CFLAGS="-I$CUR/LIBFUSE/include/" FUSE_LIBS="$CUR/LIBFUSE/lib/libfuse.a -lpthread -ldl $opt"
|
||||
make
|
||||
|
||||
strip --strip-all fuse/mount.exfat-fuse
|
||||
strip --strip-all mkfs/mkexfatfs
|
||||
|
||||
cp fuse/mount.exfat-fuse ../EXFAT/shared/mount.exfat-fuse
|
||||
cp mkfs/mkexfatfs ../EXFAT/shared/mkexfatfs
|
||||
|
||||
cd ..
|
||||
rm -rf exfat-1.3.0
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
CUR="$PWD"
|
||||
|
||||
rm -rf libfuse
|
||||
rm -rf LIBFUSE
|
||||
|
||||
unzip mirrors-libfuse-fuse-2.9.9.zip
|
||||
|
||||
|
||||
cd libfuse
|
||||
./makeconf.sh
|
||||
|
||||
./configure --prefix="$CUR/LIBFUSE"
|
||||
make -j 16
|
||||
make install
|
||||
cd ..
|
||||
rm -rf libfuse
|
@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
CUR="$PWD"
|
||||
|
||||
#LIBFUSE_DIR=$CUR/LIBFUSE
|
||||
LIBFUSE_DIR=../ExFAT/LIBFUSE
|
||||
|
||||
if uname -a | egrep -q 'x86_64|amd64'; then
|
||||
name=vtoy_fuse_iso_64
|
||||
else
|
||||
name=vtoy_fuse_iso_32
|
||||
opt=-lrt
|
||||
fi
|
||||
|
||||
export C_INCLUDE_PATH=$LIBFUSE_DIR/include
|
||||
|
||||
rm -f $name
|
||||
gcc -O2 -D_FILE_OFFSET_BITS=64 vtoy_fuse_iso.c -o $name $LIBFUSE_DIR/lib/libfuse.a -lpthread -ldl $opt
|
||||
|
||||
if [ -e $name ]; then
|
||||
echo -e "\n############### SUCCESS $name ##################\n"
|
||||
else
|
||||
echo -e "\n############### FAILED $name ##################\n"
|
||||
fi
|
||||
|
||||
strip --strip-all $name
|
||||
|
@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
#
|
||||
# Package Dependency:
|
||||
# gcc automake autoconf gettext gettext-devel libtool unzip
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
CUR="$PWD"
|
||||
LIBFUSE_DIR=$CUR/LIBFUSE
|
||||
|
||||
rm -rf libfuse
|
||||
rm -rf $LIBFUSE_DIR
|
||||
|
||||
# please download https://gitee.com/mirrors/libfuse/repository/archive/fuse-2.9.9.zip
|
||||
if ! [ -e mirrors-libfuse-fuse-2.9.9.zip ]; then
|
||||
echo "Please download mirrors-libfuse-fuse-2.9.9.zip first"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
unzip mirrors-libfuse-fuse-2.9.9.zip
|
||||
|
||||
|
||||
cd libfuse
|
||||
./makeconf.sh
|
||||
|
||||
./configure --prefix="$LIBFUSE_DIR"
|
||||
make -j 16
|
||||
make install
|
||||
cd ..
|
||||
rm -rf libfuse
|
@ -0,0 +1,346 @@
|
||||
/******************************************************************************
|
||||
* vtoy_fuse_iso.c
|
||||
*
|
||||
* Copyright (c) 2020, longpanda <admin@ventoy.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#define FUSE_USE_VERSION 26
|
||||
|
||||
#include <fuse.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
typedef unsigned int uint32_t;
|
||||
|
||||
typedef struct dmtable_entry
|
||||
{
|
||||
uint32_t isoSector;
|
||||
uint32_t sectorNum;
|
||||
unsigned long long diskSector;
|
||||
}dmtable_entry;
|
||||
|
||||
#define MAX_ENTRY_NUM (1024 * 1024 / sizeof(dmtable_entry))
|
||||
|
||||
static int verbose = 0;
|
||||
#define debug(fmt, ...) if(verbose) printf(fmt, ##__VA_ARGS__)
|
||||
|
||||
static int g_disk_fd = -1;
|
||||
static uint64_t g_iso_file_size;
|
||||
static char g_mnt_point[512];
|
||||
static char g_iso_file_name[512];
|
||||
static dmtable_entry *g_disk_entry_list = NULL;
|
||||
static int g_disk_entry_num = 0;
|
||||
|
||||
static int ventoy_iso_getattr(const char *path, struct stat *statinfo)
|
||||
{
|
||||
int ret = -ENOENT;
|
||||
|
||||
if (path && statinfo)
|
||||
{
|
||||
memset(statinfo, 0, sizeof(struct stat));
|
||||
|
||||
if (path[0] == '/' && path[1] == 0)
|
||||
{
|
||||
statinfo->st_mode = S_IFDIR | 0755;
|
||||
statinfo->st_nlink = 2;
|
||||
ret = 0;
|
||||
}
|
||||
else if (strcmp(path, g_iso_file_name) == 0)
|
||||
{
|
||||
statinfo->st_mode = S_IFREG | 0444;
|
||||
statinfo->st_nlink = 1;
|
||||
statinfo->st_size = g_iso_file_size;
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ventoy_iso_readdir
|
||||
(
|
||||
const char *path,
|
||||
void *buf,
|
||||
fuse_fill_dir_t filler,
|
||||
off_t offset,
|
||||
struct fuse_file_info *file
|
||||
)
|
||||
{
|
||||
(void)offset;
|
||||
(void)file;
|
||||
|
||||
if (path[0] != '/' || path[1] != 0)
|
||||
{
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
filler(buf, ".", NULL, 0);
|
||||
filler(buf, "..", NULL, 0);
|
||||
filler(buf, g_iso_file_name + 1, NULL, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ventoy_iso_open(const char *path, struct fuse_file_info *file)
|
||||
{
|
||||
if (strcmp(path, g_iso_file_name) != 0)
|
||||
{
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
if ((file->flags & 3) != O_RDONLY)
|
||||
{
|
||||
return -EACCES;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ventoy_read_iso_sector(uint32_t sector, uint32_t num, void *buf)
|
||||
{
|
||||
uint32_t i = 0;
|
||||
uint32_t leftSec = 0;
|
||||
uint32_t readSec = 0;
|
||||
dmtable_entry *entry = NULL;
|
||||
|
||||
for (i = 0; i < g_disk_entry_num && num > 0; i++)
|
||||
{
|
||||
entry = g_disk_entry_list + i;
|
||||
|
||||
if (sector >= entry->isoSector && sector < entry->isoSector + entry->sectorNum)
|
||||
{
|
||||
lseek(g_disk_fd, (entry->diskSector + (sector - entry->isoSector)) * 512, SEEK_SET);
|
||||
|
||||
leftSec = entry->sectorNum - (sector - entry->isoSector);
|
||||
readSec = (leftSec > num) ? num : leftSec;
|
||||
|
||||
read(g_disk_fd, buf, readSec * 512);
|
||||
|
||||
sector += readSec;
|
||||
num -= readSec;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ventoy_iso_read
|
||||
(
|
||||
const char *path, char *buf,
|
||||
size_t size, off_t offset,
|
||||
struct fuse_file_info *file
|
||||
)
|
||||
{
|
||||
uint32_t mod = 0;
|
||||
uint32_t align = 0;
|
||||
uint32_t sector = 0;
|
||||
uint32_t number = 0;
|
||||
size_t leftsize = 0;
|
||||
char secbuf[512];
|
||||
|
||||
(void)file;
|
||||
|
||||
if(strcmp(path, g_iso_file_name) != 0)
|
||||
{
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
if (offset >= g_iso_file_size)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (offset + size > g_iso_file_size)
|
||||
{
|
||||
size = g_iso_file_size - offset;
|
||||
}
|
||||
|
||||
leftsize = size;
|
||||
sector = offset / 512;
|
||||
|
||||
mod = offset % 512;
|
||||
if (mod > 0)
|
||||
{
|
||||
align = 512 - mod;
|
||||
ventoy_read_iso_sector(sector, 1, secbuf);
|
||||
|
||||
if (leftsize > align)
|
||||
{
|
||||
memcpy(buf, secbuf + mod, align);
|
||||
buf += align;
|
||||
offset += align;
|
||||
sector++;
|
||||
leftsize -= align;
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(buf, secbuf + mod, leftsize);
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
number = leftsize / 512;
|
||||
ventoy_read_iso_sector(sector, number, buf);
|
||||
buf += number * 512;
|
||||
|
||||
mod = leftsize % 512;
|
||||
if (mod > 0)
|
||||
{
|
||||
ventoy_read_iso_sector(sector + number, 1, secbuf);
|
||||
memcpy(buf, secbuf, mod);
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
static struct fuse_operations ventoy_op =
|
||||
{
|
||||
.getattr = ventoy_iso_getattr,
|
||||
.readdir = ventoy_iso_readdir,
|
||||
.open = ventoy_iso_open,
|
||||
.read = ventoy_iso_read,
|
||||
};
|
||||
|
||||
static int ventoy_parse_dmtable(const char *filename)
|
||||
{
|
||||
FILE *fp = NULL;
|
||||
char diskname[128] = {0};
|
||||
char line[256] = {0};
|
||||
dmtable_entry *entry= g_disk_entry_list;
|
||||
|
||||
fp = fopen(filename, "r");
|
||||
if (NULL == fp)
|
||||
{
|
||||
printf("Failed to open file %s\n", filename);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* read untill the last line */
|
||||
while (fgets(line, sizeof(line), fp) && g_disk_entry_num < MAX_ENTRY_NUM)
|
||||
{
|
||||
sscanf(line, "%u %u linear %s %llu",
|
||||
&entry->isoSector, &entry->sectorNum,
|
||||
diskname, &entry->diskSector);
|
||||
|
||||
g_iso_file_size += (uint64_t)entry->sectorNum * 512ULL;
|
||||
g_disk_entry_num++;
|
||||
entry++;
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
if (g_disk_entry_num >= MAX_ENTRY_NUM)
|
||||
{
|
||||
fprintf(stderr, "ISO file has too many fragments ( more than %u )\n", MAX_ENTRY_NUM);
|
||||
return 1;
|
||||
}
|
||||
|
||||
debug("iso file size: %llu disk name %s\n", g_iso_file_size, diskname);
|
||||
|
||||
g_disk_fd = open(diskname, O_RDONLY);
|
||||
if (g_disk_fd < 0)
|
||||
{
|
||||
debug("Failed to open %s\n", diskname);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int rc;
|
||||
int ch;
|
||||
char filename[512] = {0};
|
||||
|
||||
/* Avoid to be killed by systemd */
|
||||
if (access("/etc/initrd-release", F_OK) >= 0)
|
||||
{
|
||||
argv[0][0] = '@';
|
||||
}
|
||||
|
||||
g_iso_file_name[0] = '/';
|
||||
|
||||
while ((ch = getopt(argc, argv, "f:s:m:v::t::")) != -1)
|
||||
{
|
||||
if (ch == 'f')
|
||||
{
|
||||
strncpy(filename, optarg, sizeof(filename) - 1);
|
||||
}
|
||||
else if (ch == 'm')
|
||||
{
|
||||
strncpy(g_mnt_point, optarg, sizeof(g_mnt_point) - 1);
|
||||
}
|
||||
else if (ch == 's')
|
||||
{
|
||||
strncpy(g_iso_file_name + 1, optarg, sizeof(g_iso_file_name) - 2);
|
||||
}
|
||||
else if (ch == 'v')
|
||||
{
|
||||
verbose = 1;
|
||||
}
|
||||
else if (ch == 't') // for test
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (filename[0] == 0)
|
||||
{
|
||||
fprintf(stderr, "Must input dmsetup table file with -f\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (g_mnt_point[0] == 0)
|
||||
{
|
||||
fprintf(stderr, "Must input mount point with -m\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (g_iso_file_name[1] == 0)
|
||||
{
|
||||
strncpy(g_iso_file_name + 1, "ventoy.iso", sizeof(g_iso_file_name) - 2);
|
||||
}
|
||||
|
||||
debug("ventoy fuse iso: %s %s %s\n", filename, g_iso_file_name, g_mnt_point);
|
||||
|
||||
g_disk_entry_list = malloc(MAX_ENTRY_NUM * sizeof(dmtable_entry));
|
||||
if (NULL == g_disk_entry_list)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
rc = ventoy_parse_dmtable(filename);
|
||||
if (rc)
|
||||
{
|
||||
free(g_disk_entry_list);
|
||||
return rc;
|
||||
}
|
||||
|
||||
argv[1] = g_mnt_point;
|
||||
argv[2] = NULL;
|
||||
rc = fuse_main(2, argv, &ventoy_op, NULL);
|
||||
|
||||
close(g_disk_fd);
|
||||
|
||||
free(g_disk_entry_list);
|
||||
return rc;
|
||||
}
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
========== About Source Code =============
|
||||
Ventoy use grub-2.04, so I only put the added and modified source code here.
|
||||
|
||||
You can download grub-2.04 source code from this site:
|
||||
https://ftp.gnu.org/gnu/grub/
|
||||
|
||||
Just merge the code here with the original code of grub-2.04
|
||||
|
||||
|
||||
========== Build =============
|
||||
./autogen.sh
|
||||
./configure
|
||||
make
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,545 @@
|
||||
/* -*-Asm-*- */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 1999,2000,2001,2002,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/machine/boot.h>
|
||||
|
||||
/*
|
||||
* defines for the code go here
|
||||
*/
|
||||
|
||||
/* Print message string */
|
||||
#define MSG(x) movw $x, %si; call LOCAL(message)
|
||||
#define ERR(x) movw $x, %si; jmp LOCAL(error_message)
|
||||
|
||||
.macro floppy
|
||||
part_start:
|
||||
|
||||
LOCAL(probe_values):
|
||||
.byte 36, 18, 15, 9, 0
|
||||
|
||||
LOCAL(floppy_probe):
|
||||
pushw %dx
|
||||
/*
|
||||
* Perform floppy probe.
|
||||
*/
|
||||
#ifdef __APPLE__
|
||||
LOCAL(probe_values_minus_one) = LOCAL(probe_values) - 1
|
||||
movw MACRO_DOLLAR(LOCAL(probe_values_minus_one)), %si
|
||||
#else
|
||||
movw MACRO_DOLLAR(LOCAL(probe_values)) - 1, %si
|
||||
#endif
|
||||
|
||||
LOCAL(probe_loop):
|
||||
/* reset floppy controller INT 13h AH=0 */
|
||||
xorw %ax, %ax
|
||||
int MACRO_DOLLAR(0x13)
|
||||
|
||||
incw %si
|
||||
movb (%si), %cl
|
||||
|
||||
/* if number of sectors is 0, display error and die */
|
||||
testb %cl, %cl
|
||||
jnz 1f
|
||||
|
||||
/*
|
||||
* Floppy disk probe failure.
|
||||
*/
|
||||
MSG(fd_probe_error_string)
|
||||
jmp LOCAL(general_error)
|
||||
|
||||
/* "Floppy" */
|
||||
fd_probe_error_string: .asciz "Floppy"
|
||||
|
||||
1:
|
||||
/* perform read */
|
||||
movw MACRO_DOLLAR(GRUB_BOOT_MACHINE_BUFFER_SEG), %bx
|
||||
movw %bx, %es
|
||||
xorw %bx, %bx
|
||||
movw MACRO_DOLLAR(0x201), %ax
|
||||
movb MACRO_DOLLAR(0), %ch
|
||||
movb MACRO_DOLLAR(0), %dh
|
||||
int MACRO_DOLLAR(0x13)
|
||||
|
||||
/* if error, jump to "LOCAL(probe_loop)" */
|
||||
jc LOCAL(probe_loop)
|
||||
|
||||
/* %cl is already the correct value! */
|
||||
movb MACRO_DOLLAR(1), %dh
|
||||
movb MACRO_DOLLAR(79), %ch
|
||||
|
||||
jmp LOCAL(final_init)
|
||||
.endm
|
||||
|
||||
.macro scratch
|
||||
|
||||
/* scratch space */
|
||||
mode:
|
||||
.byte 0
|
||||
disk_address_packet:
|
||||
sectors:
|
||||
.long 0
|
||||
heads:
|
||||
.long 0
|
||||
cylinders:
|
||||
.word 0
|
||||
sector_start:
|
||||
.byte 0
|
||||
head_start:
|
||||
.byte 0
|
||||
cylinder_start:
|
||||
.word 0
|
||||
/* more space... */
|
||||
.endm
|
||||
|
||||
.file "boot.S"
|
||||
|
||||
.text
|
||||
|
||||
/* Tell GAS to generate 16-bit instructions so that this code works
|
||||
in real mode. */
|
||||
.code16
|
||||
|
||||
.globl _start, start;
|
||||
_start:
|
||||
start:
|
||||
/*
|
||||
* _start is loaded at 0x7c00 and is jumped to with CS:IP 0:0x7c00
|
||||
*/
|
||||
|
||||
/*
|
||||
* Beginning of the sector is compatible with the FAT/HPFS BIOS
|
||||
* parameter block.
|
||||
*/
|
||||
|
||||
jmp LOCAL(after_BPB)
|
||||
nop /* do I care about this ??? */
|
||||
|
||||
#ifdef HYBRID_BOOT
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
nop
|
||||
nop
|
||||
jmp LOCAL(after_BPB)
|
||||
#else
|
||||
/*
|
||||
* This space is for the BIOS parameter block!!!! Don't change
|
||||
* the first jump, nor start the code anywhere but right after
|
||||
* this area.
|
||||
*/
|
||||
|
||||
.org GRUB_BOOT_MACHINE_BPB_START
|
||||
.org 4
|
||||
#endif
|
||||
#ifdef HYBRID_BOOT
|
||||
floppy
|
||||
#else
|
||||
scratch
|
||||
#endif
|
||||
|
||||
.org GRUB_BOOT_MACHINE_BPB_END
|
||||
/*
|
||||
* End of BIOS parameter block.
|
||||
*/
|
||||
|
||||
LOCAL(kernel_address):
|
||||
.word GRUB_BOOT_MACHINE_KERNEL_ADDR
|
||||
|
||||
#ifndef HYBRID_BOOT
|
||||
.org GRUB_BOOT_MACHINE_KERNEL_SECTOR
|
||||
LOCAL(kernel_sector):
|
||||
.long 1
|
||||
LOCAL(kernel_sector_high):
|
||||
.long 0
|
||||
#endif
|
||||
|
||||
.org GRUB_BOOT_MACHINE_BOOT_DRIVE
|
||||
boot_drive:
|
||||
.byte 0xff /* the disk to load kernel from */
|
||||
/* 0xff means use the boot drive */
|
||||
|
||||
LOCAL(after_BPB):
|
||||
|
||||
/* general setup */
|
||||
cli /* we're not safe here! */
|
||||
|
||||
/*
|
||||
* This is a workaround for buggy BIOSes which don't pass boot
|
||||
* drive correctly. If GRUB is installed into a HDD, check if
|
||||
* DL is masked correctly. If not, assume that the BIOS passed
|
||||
* a bogus value and set DL to 0x80, since this is the only
|
||||
* possible boot drive. If GRUB is installed into a floppy,
|
||||
* this does nothing (only jump).
|
||||
*/
|
||||
.org GRUB_BOOT_MACHINE_DRIVE_CHECK
|
||||
boot_drive_check:
|
||||
jmp 3f /* grub-setup may overwrite this jump */
|
||||
testb $0x80, %dl
|
||||
jz 2f
|
||||
3:
|
||||
/* Ignore %dl different from 0-0x0f and 0x80-0x8f. */
|
||||
testb $0x70, %dl
|
||||
jz 1f
|
||||
2:
|
||||
movb $0x80, %dl
|
||||
1:
|
||||
/*
|
||||
* ljmp to the next instruction because some bogus BIOSes
|
||||
* jump to 07C0:0000 instead of 0000:7C00.
|
||||
*/
|
||||