Remove failing HDIO_GETGEO ioctl.
This was copied across from the toolbox code, but it's outlived its
usefulness: the ioctl is failing all the time now because we're acting
on a partition rather than the underlying block device.
Bug: http://b/29899852
Test: adb shell sm set-virtual-disk true
Change-Id: I7f77e342e226b40ded1155f3e320b2604b4c0404
diff --git a/mkfs_msdos.c b/mkfs_msdos.c
index 350b782..04afc84 100644
--- a/mkfs_msdos.c
+++ b/mkfs_msdos.c
@@ -852,27 +852,10 @@
bpb->bpbHugeSectors = (u_int)block_size;
- struct hd_geometry geom;
- if (ioctl(fd, HDIO_GETGEO, &geom)) {
- warn("ioctl(HDIO_GETGEO) failed, but will use sane values");
- geom.heads = 64;
- geom.sectors = 63;
- }
-
- if (!geom.heads) {
- warnx("Bogus heads from kernel - setting sane value");
- geom.heads = 64;
- }
-
- if (!geom.sectors) {
- warnx("Bogus sectors from kernel - setting sane value");
- geom.sectors = 63;
- }
-
- bpb->bpbSecPerTrack = geom.sectors;
+ bpb->bpbSecPerTrack = 63;
if (ckgeom(fname, bpb->bpbSecPerTrack, "sectors/track") == -1) return -1;
- bpb->bpbHeads = geom.heads;
+ bpb->bpbHeads = 64;
if (ckgeom(fname, bpb->bpbHeads, "drive heads") == -1) return -1;
return 0;