create_floppy_devices.c revision 6997e3b2dc0095985071e2f7496342a850cdb5ad
/*
* Create all possible floppy device based on the CMOS type.
*
* Copyright(C) 2005, SUSE Linux Products GmbH
*
* Author: Hannes Reinecke <hare@suse.de>
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <pwd.h>
#include <grp.h>
#include "libudev.h"
#include "libudev-private.h"
static char *table[] = {
"", "d360", "h1200", "u360", "u720", "h360", "h720",
"u1440", "u2880", "CompaQ", "h1440", "u1680", "h410",
"u820", "h1476", "u1722", "h420", "u830", "h1494", "u1743",
"h880", "u1040", "u1120", "h1600", "u1760", "u1920",
"u3200", "u3520", "u3840", "u1840", "u800", "u1600",
};
static int t360[] = { 1, 0 };
static int t3in[] = { 8, 9, 26, 27, 28, 7, 11, 15, 19, 24, 25, 29, 31, 3, 4, 13, 17, 21, 22, 30, 0 };
{
}
{
char *dev;
char *devname;
char node[64];
int create_nodes = 0;
int print_nodes = 0;
int is_err = 0;
goto exit;
udev_log_init("create_floppy_devices");
switch (c) {
case 'c':
create_nodes = 1;
break;
case 'd':
print_nodes = 1;
break;
case 'U':
break;
case 'G':
break;
case 'M':
break;
case 'm':
break;
case 't':
break;
default:
is_err++;
break;
}
}
printf("Usage: %s [OPTION] device\n"
" -c create\n"
" -d debug\n"
" -m Major number\n"
" -t floppy type number\n"
" -U device node user ownership\n"
" -G device node group owner\n"
" -M device node mode\n"
"\n", argv[0]);
return 1;
}
else
return 1;
}
return 1;
}
if (fdnum > 3)
fdnum += 124;
if (major < 1) {
return 1;
}
return 1;
}
if (type == 0)
return 0;
i = 0;
if (print_nodes)
if (create_nodes) {
}
i++;
}
exit:
return 0;
}