diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-03-09 14:49:35 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-03-09 14:49:35 +0000 |
commit | 38a2c24e6e576edb089ae74e48529015260e4dd8 (patch) | |
tree | a86513865493ca80b1f4b8b8c3788fd2bd6ea655 /mdk-stage1/tools.c | |
parent | 4ab4217cad713d92578079af72594d8f1876bf0a (diff) | |
download | drakx-38a2c24e6e576edb089ae74e48529015260e4dd8.tar drakx-38a2c24e6e576edb089ae74e48529015260e4dd8.tar.gz drakx-38a2c24e6e576edb089ae74e48529015260e4dd8.tar.bz2 drakx-38a2c24e6e576edb089ae74e48529015260e4dd8.tar.xz drakx-38a2c24e6e576edb089ae74e48529015260e4dd8.zip |
move partition stuff in partition.c and common disk stuff in tools.c
Diffstat (limited to 'mdk-stage1/tools.c')
-rw-r--r-- | mdk-stage1/tools.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/mdk-stage1/tools.c b/mdk-stage1/tools.c index be050376b..8798b48ac 100644 --- a/mdk-stage1/tools.c +++ b/mdk-stage1/tools.c @@ -446,6 +446,40 @@ int kernel_version(void) return charstar_to_int(val.release + 2); } +int try_mount(char * dev, char * location) +{ + char device_fullname[50]; + strcpy(device_fullname, "/dev/"); + strcat(device_fullname, dev); + + if (my_mount(device_fullname, location, "ext2", 0) == -1 && + my_mount(device_fullname, location, "vfat", 0) == -1 && + my_mount(device_fullname, location, "ntfs", 0) == -1 && + my_mount(device_fullname, location, "reiserfs", 0) == -1) { + return 1; + } + + return 0; +} + +int get_disks(char *** names, char *** models) +{ + char ** ptr; + int count = 0; + + my_insmod("sd_mod", ANY_DRIVER_TYPE, NULL, 0); + + get_medias(DISK, names, models, BUS_ANY); + + ptr = *names; + while (ptr && *ptr) { + count++; + ptr++; + } + + return count; +} + char * floppy_device(void) { char ** names, ** models; |