summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2018-11-30 16:19:21 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2018-11-30 20:49:34 +0100
commitbe63594a264239bc99438ea4cce91c94e2d485cb (patch)
tree5626a1ee42a159d33517cbe8f640ef70f85ea588
parent5993b355cbd25c45897eab3a9dbe099fccebcb41 (diff)
downloaddrakx-be63594a264239bc99438ea4cce91c94e2d485cb.tar
drakx-be63594a264239bc99438ea4cce91c94e2d485cb.tar.gz
drakx-be63594a264239bc99438ea4cce91c94e2d485cb.tar.bz2
drakx-be63594a264239bc99438ea4cce91c94e2d485cb.tar.xz
drakx-be63594a264239bc99438ea4cce91c94e2d485cb.zip
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
-rw-r--r--mdk-stage1/NEWS2
-rw-r--r--mdk-stage1/tools.c11
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;
}