2.23-0.6: remove floppy from util-linux
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
379232cd95
commit
3fc0e67f32
1
sources
1
sources
@ -1,2 +1 @@
|
||||
a02aac97c74259ca1b24972c89147ca4 floppy-0.18.tar.bz2
|
||||
abf3d68b534237b9c336dd5bfbf058d9 util-linux-2.23-rc2.tar.xz
|
||||
|
@ -1,103 +0,0 @@
|
||||
diff -up util-linux-2.19/floppy-0.18/floppyfloppy.c.kzak util-linux-2.19/floppy-0.18/floppyfloppy.c
|
||||
--- util-linux-2.19/floppy-0.18/floppyfloppy.c.kzak 2009-09-24 03:36:33.000000000 +0200
|
||||
+++ util-linux-2.19/floppy-0.18/floppyfloppy.c 2011-03-07 10:40:42.000000000 +0100
|
||||
@@ -271,6 +271,33 @@ static RETSIGTYPE sighandler(int signum)
|
||||
#endif
|
||||
}
|
||||
|
||||
+/* -1=error, 1=true, 0=false */
|
||||
+static int check_generic(const char *dev, int n)
|
||||
+{
|
||||
+ struct floppy_struct param;
|
||||
+ int fd;
|
||||
+
|
||||
+ if ((fd=open(dev, O_RDONLY)) < 0)
|
||||
+ {
|
||||
+ perror(dev);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (ioctl(fd,FDGETPRM,(long) ¶m) < 0)
|
||||
+ {
|
||||
+ perror(dev);
|
||||
+ close(fd);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ close(fd);
|
||||
+
|
||||
+ if (param.sect==floppy_type[n].sectors &&
|
||||
+ param.head==floppy_type[n].heads &&
|
||||
+ param.track==floppy_type[n].tracks)
|
||||
+ /* generic device uses expected format */
|
||||
+ return 1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
|
||||
static int do_format(const char *dev, int fmtnum,
|
||||
int (*fmt_func)(const char *, int), int flags)
|
||||
@@ -282,6 +309,7 @@ static int do_format(const char *dev, in
|
||||
struct format_descr curtrack;
|
||||
int pct;
|
||||
struct stat stat_buf;
|
||||
+ int gen = 0;
|
||||
|
||||
int i, j;
|
||||
char *devname;
|
||||
@@ -304,23 +332,52 @@ static int do_format(const char *dev, in
|
||||
|
||||
strcat(strcpy(devname, dev), floppy_type[fmtnum].dev);
|
||||
|
||||
+ if (stat(devname, &stat_buf)==-1 && errno==ENOENT)
|
||||
+ {
|
||||
+ /* /dev/fd0xxxxx doesn't exist ...try to use generic device
|
||||
+ *
|
||||
+ * Note: we needn't size specific device if the generic device uses
|
||||
+ * right floppy format (FDGETPRM). -- Karel Zak [30/09/2005]
|
||||
+ */
|
||||
+ if ((gen = check_generic(dev, fmtnum))==1) /* true */
|
||||
+ {
|
||||
+ fprintf(stderr, _("WARNING: size specific device %s doesn't exist, using generic device: %s\n"),
|
||||
+ devname, dev);
|
||||
+ strcpy(devname, dev);
|
||||
+ }
|
||||
+ else if (gen==0) /* false */
|
||||
+ {
|
||||
+ fprintf(stderr, _("ERROR: size specific device %1$s doesn't exist. Use \"MAKEDEV %1$s\" and try it again.\n"), devname);
|
||||
+ return (1);
|
||||
+ }
|
||||
+ else /* error -- no floppy medium or device? */
|
||||
+ return(1);
|
||||
+ }
|
||||
fd=open(devname, O_WRONLY);
|
||||
if (fd < 0)
|
||||
{
|
||||
perror(devname);
|
||||
return (1);
|
||||
}
|
||||
-
|
||||
- if (fstat(fd, &stat_buf) ||
|
||||
- !S_ISBLK(stat_buf.st_mode) ||
|
||||
- MINOR_DEV(stat_buf.st_rdev) != fmtnum)
|
||||
+ if (fstat(fd, &stat_buf) < 0)
|
||||
+ {
|
||||
+ perror(devname);
|
||||
+ close(fd);
|
||||
+ return (1);
|
||||
+ }
|
||||
+ if (!S_ISBLK(stat_buf.st_mode))
|
||||
+ {
|
||||
+ fprintf(stderr,_("%s: not a block device\n"), devname);
|
||||
+ close(fd);
|
||||
+ return (1);
|
||||
+ }
|
||||
+ if (gen==0 && MINOR_DEV(stat_buf.st_rdev) != fmtnum)
|
||||
{
|
||||
errno=EINVAL;
|
||||
perror(devname);
|
||||
close(fd);
|
||||
return (1);
|
||||
}
|
||||
-
|
||||
if (ioctl(fd, FDGETPRM, &geo) < 0)
|
||||
{
|
||||
perror(devname);
|
@ -1,11 +0,0 @@
|
||||
diff -up util-linux-2.19/floppy-0.18/superfloppy.c.kzak util-linux-2.19/floppy-0.18/superfloppy.c
|
||||
--- util-linux-2.19/floppy-0.18/superfloppy.c.kzak 2009-09-23 02:47:26.000000000 +0200
|
||||
+++ util-linux-2.19/floppy-0.18/superfloppy.c 2011-03-07 10:37:20.000000000 +0100
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <popt.h>
|
||||
#include <locale.h>
|
||||
#include <libintl.h>
|
||||
+#include <locale.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
@ -1,25 +0,0 @@
|
||||
diff -up util-linux-2.22.2/disk-utils/fdformat.8.kzak util-linux-2.22.2/disk-utils/fdformat.8
|
||||
--- util-linux-2.22.2/disk-utils/fdformat.8.kzak 2012-06-11 12:06:53.620195844 +0200
|
||||
+++ util-linux-2.22.2/disk-utils/fdformat.8 2013-02-19 16:16:27.130214023 +0100
|
||||
@@ -43,6 +43,11 @@ when a non-standard format is being used
|
||||
autodetected earlier. In this case, use
|
||||
.BR setfdprm (8)
|
||||
to load the disk parameters.
|
||||
+
|
||||
+For ATAPI IDE floppy driver (also known as LS-120 drives or "Superdisk"
|
||||
+drives) you have to use the
|
||||
+.BR floppy (8).
|
||||
+
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
\fB\-n\fR, \fB\-\-no\-verify\fR
|
||||
@@ -57,7 +62,8 @@ Display help and exit.
|
||||
.BR fd (4),
|
||||
.BR setfdprm (8),
|
||||
.BR mkfs (8),
|
||||
-.BR emkfs (8)
|
||||
+.BR emkfs (8),
|
||||
+.BR floppy (8)
|
||||
.SH AUTHOR
|
||||
Werner Almesberger (almesber@nessie.cs.id.ethz.ch)
|
||||
.SH AVAILABILITY
|
Loading…
Reference in New Issue
Block a user