--- util-linux-2.12q/mount/guessfstype.c +++ util-linux-2.12q/mount/guessfstype.c @@ -0,0 +1,22 @@ +#include +#include "mount_guess_fstype.h" + +int verbose = 0; +int mount_quiet=0; +int sloppy = 0; + +char *progname; + +int main(int argc, char *argv[]) { + char *device, *type; + + if(argc != 2) return 1; + + progname = argv[0]; + device = argv[1]; + + type = do_guess_fstype(device); + printf("%s *appears* to be: %s\n", device, type); + + return 0; +} --- util-linux-2.12q/mount/Makefile +++ util-linux-2.12q/mount/Makefile @@ -11,7 +11,7 @@ LINK = $(CC) $(LDFLAGS) SUID_PROGS = mount umount -NOSUID_PROGS = swapon losetup +NOSUID_PROGS = swapon losetup guessfstype MAN5 = fstab.5 nfs.5 MAN8 = mount.8 swapoff.8 swapon.8 umount.8 losetup.8 @@ -57,6 +57,11 @@ version.o $(LIB)/env.o loumount.o $(LINK) $^ -o $@ $(BLKID_LIB) +guessfstype: guessfstype.o mount_guess_fstype.o sundries.o realpath.o \ + fstab.o mntent.o get_label_uuid.o mount_blkid.o mount_by_label.o \ + xmalloc.o + $(LINK) $^ -o $@ + swapon: swapon.o version.o xmalloc.o \ get_label_uuid.o mount_by_label.o mount_blkid.o loop.o sha512.o $(LIB)/xstrncpy.o $(LINK) $^ -o $@ $(BLKID_LIB)