From be63594a264239bc99438ea4cce91c94e2d485cb Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 30 Nov 2018 16:19:21 +0100 Subject: simplify now that we use standalone mount Let mount uses the blkid library for guessing the filesystem type That's quite a lot better than manually trying a long list of potential fses --- mdk-stage1/NEWS | 2 ++ mdk-stage1/tools.c | 11 +---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/mdk-stage1/NEWS b/mdk-stage1/NEWS index 2899d7a9c..ef99b30f0 100644 --- a/mdk-stage1/NEWS +++ b/mdk-stage1/NEWS @@ -1,4 +1,6 @@ - mounting: + o let libblk guess the right fs type rather than manually trying a long list + of potential fses o use regular mount tool rather than manual system calls 2.33 diff --git a/mdk-stage1/tools.c b/mdk-stage1/tools.c index 78108d6a9..2e27688ea 100644 --- a/mdk-stage1/tools.c +++ b/mdk-stage1/tools.c @@ -208,21 +208,12 @@ enum return_type load_compressed_fd(int fd, int size) return preload_mount_compressed_fd(fd, size, COMPRESSED_NAME(""), STAGE2_LOCATION); } -// FIXME: guess right module from partition type (using libblkid?) int try_mount(char * dev, char * location) { char device_fullname[50]; snprintf(device_fullname, sizeof(device_fullname), "/dev/%s", dev); - if (my_mount(device_fullname, location, "ext4", 0) == -1 && - my_mount(device_fullname, location, "btrfs", 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 && - my_mount(device_fullname, location, "reiser4", 0) == -1 && - my_mount(device_fullname, location, "jfs", 0) == -1 && - my_mount(device_fullname, location, "xfs", 0) == -1 && - my_mount(device_fullname, location, "iso9660", 0) == -1) { + if (my_mount(device_fullname, location, "auto", 0) == -1) { return 1; } -- cgit v1.2.1