forked from len0rd/rockbox
storage: Support a default virtual sector size
Normally, we figure out the virual sector size from the filesystem info. However, if there's no filesystem, we fall back to the hardware's logical sector size. Some device firmware (eg ipod5g/6g) need their partition tables set up with larger-than-logical sector sizes; this way we can present the "correct" sector size to maintain interoperability with the stock firmware and make it so that the drive can still be properly partitioned from within rockbox. This patch adds support for DEFAULT_VIRT_SECTOR_SIZE. Nothing uses it yet. Change-Id: Iae746a50ffc37c51abb2c9b82d3c4596f1fa7559
This commit is contained in:
parent
c61ad40812
commit
1516c48a37
3 changed files with 24 additions and 0 deletions
|
@ -634,6 +634,13 @@ static void init(void)
|
|||
lcd_puts(0, 4, rbversion);
|
||||
lcd_update();
|
||||
|
||||
#if defined(MAX_VIRT_SECTOR_SIZE) && defined(DEFAULT_VIRT_SECTOR_SIZE)
|
||||
#ifdef HAVE_MULTIDRIVE
|
||||
for (int i = 0 ; i < NUM_DRIVES ; i++)
|
||||
#endif
|
||||
disk_set_sector_multiplier(IF_MD(i,) DEFAULT_VIRT_SECTOR_SIZE);
|
||||
#endif
|
||||
|
||||
#ifndef USB_NONE
|
||||
usb_start_monitoring();
|
||||
while(button_get(true) != SYS_USB_CONNECTED) {};
|
||||
|
@ -650,6 +657,7 @@ static void init(void)
|
|||
lcd_putsf(0, 4, "Error mounting: %08x", rc);
|
||||
lcd_update();
|
||||
sleep(HZ*5);
|
||||
system_reboot();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue