mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 09:21:18 +02:00
hdd_menu: allow hdd format if rootfs is on USB stick
This commit is contained in:
@@ -155,8 +155,12 @@ int CHDDMenuHandler::doMenu ()
|
|||||||
hddmenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_HDD_MANAGE));
|
hddmenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_HDD_MANAGE));
|
||||||
|
|
||||||
ret = stat("/", &s);
|
ret = stat("/", &s);
|
||||||
if (ret != -1)
|
int drive_mask = 0xfff0;
|
||||||
root_dev = (s.st_dev & 0x0ffc0); /* hda = 0x0300, hdb = 0x0340 */
|
if (ret != -1) {
|
||||||
|
if ((s.st_dev & drive_mask) == 0x0300) /* hda, hdb,... has max 63 partitions */
|
||||||
|
drive_mask = 0xffc0; /* hda: 0x0300, hdb: 0x0340, sda: 0x0800, sdb: 0x0810 */
|
||||||
|
root_dev = (s.st_dev & drive_mask);
|
||||||
|
}
|
||||||
printf("HDD: root_dev: 0x%04x\n", root_dev);
|
printf("HDD: root_dev: 0x%04x\n", root_dev);
|
||||||
std::string tmp_str[n];
|
std::string tmp_str[n];
|
||||||
CMenuWidget * tempMenu[n];
|
CMenuWidget * tempMenu[n];
|
||||||
@@ -182,9 +186,9 @@ int CHDDMenuHandler::doMenu ()
|
|||||||
|
|
||||||
ret = fstat(fd, &s);
|
ret = fstat(fd, &s);
|
||||||
if (ret != -1) {
|
if (ret != -1) {
|
||||||
if ((int)(s.st_rdev & 0x0ffc0) == root_dev) {
|
if ((int)(s.st_rdev & drive_mask) == root_dev) {
|
||||||
isroot = true;
|
isroot = true;
|
||||||
printf("-> root device is on this disk, skipping\n");
|
printf("-> root device is on this disk 0x%04" PRIx64 ", skipping\n", s.st_rdev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
close(fd);
|
close(fd);
|
||||||
|
Reference in New Issue
Block a user