New ufdformat(1) utility
Needs ReviewPublic

Authored by cy on Dec 4 2017, 5:20 AM.

Details

Reviewers
bms
imp
jhb
Group Reviewers
manpages
Summary

This new ufdformat(1) utility (originally written by bms@) performs a low level floppy disk format in a similar manner to fdformat(1) but using a USB floppy drive.

Test Plan

make tinderbox

Tested on a TEAC FD-05PUW 3000: pass.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 13316
cy created this revision.Dec 4 2017, 5:20 AM
lidl added a subscriber: lidl.Dec 4 2017, 2:19 PM

The command is actually 'ufdformat', not 'usbformat'.

cy added a comment.Dec 4 2017, 2:29 PM

Yes. It performs the same function as fdformat(1) except that it only performs a low level format floppy disks using USB floppy drives. To name it usbformat would imply it formats other umass devices, which it does not.

lidl added a comment.Dec 4 2017, 2:34 PM

The point I'm making is the Phabricator review calls it "usbformat", NOT "ufdformat".
Both in the subject of the review, as well as the summary of the review.

cy retitled this revision from New usbformat(1) utility to New ufdformat(1) utility.Dec 4 2017, 2:39 PM
cy edited the summary of this revision. (Show Details)

Thanks for pointing that out (long day yesterday). Fixed.

imp added a comment.Dec 4 2017, 4:21 PM

camcontrol is the traditional location for this functionality, though that obscures things. And there's issues with the integration there, so here might not be bad. Some of the code belongs in libcam, however at the very least.
The manual section should be 8, not 1 (fdformat is bogusly located in section 1). Maybe this is too fine a point.
I tend to agree with the 'move to kernel / libcam comments'

usr.sbin/ufdformat/scsi_util.c
295–297

there should be a libcam function to do this already....

396–400

should be a libcam routine to do this already

cy added a comment.Dec 4 2017, 8:55 PM

We could move the functions and similar ones used by camcontrol(8) to libcam. What if I open a new revision first to do just that?

Re the volume 1 manpage, I was puzzling over why fdformat(1) was in volume 1 too. I will volume 8 and move this man page to volume 8 as well.

wblock added a subscriber: wblock.Dec 8 2017, 7:47 PM
wblock added inline comments.
usr.sbin/ufdformat/ufdformat.1
46
can be given as the full path
48
(like
50
or as an short device name that is located in``
51

Remove this line.

53
(like
56
The options are:
62

Break the sentence here.

.Xr fdcontrol 8 .
63
The default is 1.44MB.
73
Do not ask for confirmation about formatting the floppy disk, but
79
flag has not been specified, ask the user for confirmation
81
To continue, an answer
89
To create
109

s/has been/is/

110

Don't need "finally".

113

s/will be/are/

118

Break the sentence:

1 is returned on any errors during floppy formatting.
An exit status
119
of 2 reflects invalid arguments given to the program, along with
120
appropriate information written to diagnostic output.
138

Ummm.... copy/paste error? ufdformat didn't appear in FreeBSD 6, unless I'm mistaken.