From 92a01baf6d8cd0908ba562fa9bbfbe75f37a8b86 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 29 Nov 2011 00:04:21 +0000 Subject: [PATCH] Allow removable drives to be scanned for partition tables. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@42642 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- rom/dosboot/bootscan.c | 38 ++------------------------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/rom/dosboot/bootscan.c b/rom/dosboot/bootscan.c index 1796ddf53e..03f04620a7 100644 --- a/rom/dosboot/bootscan.c +++ b/rom/dosboot/bootscan.c @@ -311,38 +311,6 @@ static BOOL CheckTables(struct ExpansionBase *ExpansionBase, struct Library *Par return retval; } -static BOOL IsRemovable(struct ExecBase *SysBase, struct IOExtTD *ioreq) -{ - struct DriveGeometry dg; - - /* - * On AROS m68k, CF cards are removable, but are - * bootable. Also, we should support CDROMs that - * have RDB blocks. So, in all cases, allow the - * RDB support. - * UPD: this is not so easy. If you remove one disk with RDB on it - * and insert another one, number of partitions and their parameters - * will change. This means that we actually have to dismount all DeviceNodes - * for old disk and mount new ones. - * This is technically possible, however rather complex (we need to track down - * which DeviceNodes are currently in use, and be able to reuse them when the - * disk is inserted again in a response to "Insert disk XXX in any drive". - * MorphOS has this mechanism implemented in mount.library. - * An alternative is to bind mounted DeviceNodes to a particular disk and mount - * a new set for every new one. Perhaps it's simpler, but anyway, needs to be - * handled in some special way. - */ - if (!strcmp(ioreq->iotd_Req.io_Device->dd_Library.lib_Node.ln_Name, "carddisk.device")) - return FALSE; - - ioreq->iotd_Req.io_Command = TD_GETGEOMETRY; - ioreq->iotd_Req.io_Data = &dg; - ioreq->iotd_Req.io_Length = sizeof(struct DriveGeometry); - DoIO((struct IORequest *)ioreq); - - return (dg.dg_Flags & DGF_REMOVABLE) ? TRUE : FALSE; -} - static VOID CheckPartitions(struct ExpansionBase *ExpansionBase, struct Library *PartitionBase, struct ExecBase *SysBase, struct BootNode *bn) { struct DeviceNode *dn = bn->bn_DeviceNode; @@ -361,9 +329,7 @@ static VOID CheckPartitions(struct ExpansionBase *ExpansionBase, struct Library if (pt) { - /* don't check removable devices for partition tables */ - if (!IsRemovable(SysBase, pt->bd->ioreq)) - res = CheckTables(ExpansionBase, PartitionBase, fssm, pt, SysBase); + res = CheckTables(ExpansionBase, PartitionBase, fssm, pt, SysBase); CloseRootPartition(pt); } @@ -387,7 +353,7 @@ void dosboot_BootScan(LIBBASETYPEPTR LIBBASE) /* * Remove the whole chain of BootNodes from the list and re-initialize it. * We will insert new nodes into it, based on old ones. - * What is done here is safe as long is we don't move the list itself. + * What is done here is safe as long as we don't move the list itself. * ln_Succ of the last node in chain points to the lh_Tail of our list * which always contains NULL. */ -- 2.11.4.GIT