|
From: <ls...@us...> - 2011-08-16 20:52:19
|
Revision: 5849
http://jnode.svn.sourceforge.net/jnode/?rev=5849&view=rev
Author: lsantha
Date: 2011-08-16 20:52:13 +0000 (Tue, 16 Aug 2011)
Log Message:
-----------
Improvements 'fdisk' command to output and device parameter.
Modified Paths:
--------------
trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java
Modified: trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java 2011-08-16 20:49:41 UTC (rev 5848)
+++ trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java 2011-08-16 20:52:13 UTC (rev 5849)
@@ -32,6 +32,7 @@
import org.jnode.driver.block.BlockDeviceAPI;
import org.jnode.driver.bus.ide.IDEConstants;
import org.jnode.driver.bus.ide.IDEDevice;
+import org.jnode.driver.bus.ide.IDEDeviceAPI;
import org.jnode.driver.bus.ide.IDEDriveDescriptor;
import org.jnode.naming.InitialNaming;
import org.jnode.partitions.ibm.IBMPartitionTable;
@@ -83,8 +84,9 @@
private final IBMPartitionTypeArgument ARG_TYPE =
new IBMPartitionTypeArgument("type", Argument.OPTIONAL, "IBM partition type code");
+ //todo add support for more BlockDeviceAPI types
private final DeviceArgument ARG_DEVICE =
- new DeviceArgument("deviceId", Argument.OPTIONAL, "Target device", BlockDeviceAPI.class);
+ new DeviceArgument("deviceId", Argument.OPTIONAL, "Target device", IDEDeviceAPI.class);
public FdiskCommand() {
super("perform disk partition management tasks");
@@ -200,14 +202,13 @@
private void listAvailableDevices(DeviceManager dm, PrintWriter out) {
final Collection<Device> allDevices = dm.getDevicesByAPI(BlockDeviceAPI.class);
for (Device dev : allDevices) {
- out.println("Found device : " + dev.getId() + "[" + dev.getClass() + "]");
+ //out.println("Found device : " + dev.getId() + "[" + dev.getClass() + "]");
if (dev instanceof IDEDevice) {
IDEDevice ideDevice = (IDEDevice) dev;
IDEDriveDescriptor desc = ideDevice.getDescriptor();
if (desc.isDisk()) {
- out.println(" IDE Disk : " + ideDevice.getId() + "(" + desc.getModel() +
- " " + desc.getSectorsAddressable() * IDEConstants.SECTOR_SIZE +
- ")");
+ out.println("IDE Disk: " + ideDevice.getId() + "('" + desc.getModel() + "' " +
+ desc.getSectorsAddressable() * IDEConstants.SECTOR_SIZE + " bytes)");
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|