1
0
mirror of https://github.com/CTCaer/hekate.git synced 2024-12-24 12:14:11 +00:00

nyx: Force 4MiB eMMC boot0/1 on backup/restore

Simplify ops on big eMMC replacements.
This commit is contained in:
CTCaer 2022-12-19 05:09:37 +02:00
parent f16159542c
commit 4da1d10553
2 changed files with 14 additions and 6 deletions

View File

@ -789,11 +789,15 @@ void dump_emmc_selected(emmcPartType_t dumpType, emmc_tool_gui_t *gui)
if (dumpType & PART_BOOT)
{
const u32 BOOT_PART_SIZE = emmc_storage.ext_csd.boot_mult << 17;
const u32 BOOT_PART_SECTORS = 0x2000; // Force 4 MiB for emuMMC.
emmc_part_t bootPart;
memset(&bootPart, 0, sizeof(bootPart));
bootPart.lba_start = 0;
bootPart.lba_end = (BOOT_PART_SIZE / EMMC_BLOCKSIZE) - 1;
if (!gui->raw_emummc)
bootPart.lba_end = (BOOT_PART_SIZE / EMMC_BLOCKSIZE) - 1;
else
bootPart.lba_end = BOOT_PART_SECTORS - 1;
for (i = 0; i < 2; i++)
{
strcpy(bootPart.name, "BOOT");
@ -1436,11 +1440,15 @@ void restore_emmc_selected(emmcPartType_t restoreType, emmc_tool_gui_t *gui)
if (restoreType & PART_BOOT)
{
const u32 BOOT_PART_SIZE = emmc_storage.ext_csd.boot_mult << 17;
const u32 BOOT_PART_SECTORS = 0x2000; // Force 4 MiB for emuMMC.
emmc_part_t bootPart;
memset(&bootPart, 0, sizeof(bootPart));
bootPart.lba_start = 0;
bootPart.lba_end = (BOOT_PART_SIZE / EMMC_BLOCKSIZE) - 1;
if (!gui->raw_emummc)
bootPart.lba_end = (BOOT_PART_SIZE / EMMC_BLOCKSIZE) - 1;
else
bootPart.lba_end = BOOT_PART_SECTORS - 1;
for (i = 0; i < 2; i++)
{
strcpy(bootPart.name, "BOOT");

View File

@ -410,12 +410,12 @@ void dump_emummc_file(emmc_tool_gui_t *gui)
strcpy(gui->base_path, sdPath);
timer = get_tmr_s();
const u32 BOOT_PART_SIZE = emmc_storage.ext_csd.boot_mult << 17;
const u32 BOOT_PART_SECTORS = 0x2000; // Force 4 MiB.
emmc_part_t bootPart;
memset(&bootPart, 0, sizeof(bootPart));
bootPart.lba_start = 0;
bootPart.lba_end = (BOOT_PART_SIZE / EMMC_BLOCKSIZE) - 1;
bootPart.lba_end = BOOT_PART_SECTORS - 1;
for (i = 0; i < 2; i++)
{
@ -884,12 +884,12 @@ void dump_emummc_raw(emmc_tool_gui_t *gui, int part_idx, u32 sector_start, u32 r
strcpy(gui->base_path, sdPath);
timer = get_tmr_s();
const u32 BOOT_PART_SIZE = emmc_storage.ext_csd.boot_mult << 17;
const u32 BOOT_PART_SECTORS = 0x2000; // Force 4 MiB.
emmc_part_t bootPart;
memset(&bootPart, 0, sizeof(bootPart));
bootPart.lba_start = 0;
bootPart.lba_end = (BOOT_PART_SIZE / EMMC_BLOCKSIZE) - 1;
bootPart.lba_end = BOOT_PART_SECTORS - 1;
// Clear partition start.
memset((u8 *)MIXD_BUF_ALIGNED, 0, SZ_16M);