2017-02-20 12:06:06 +01:00
|
|
|
Index: os-prober/os-probes/common/50mounted-tests
|
|
|
|
===================================================================
|
|
|
|
--- os-prober.orig/os-probes/common/50mounted-tests
|
|
|
|
+++ os-prober/os-probes/common/50mounted-tests
|
|
|
|
@@ -57,19 +57,13 @@ elif [ -z "$types" ]; then
|
2013-12-10 10:48:05 +01:00
|
|
|
debug "$1 is a LUKS partition; skipping"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
- for type in $(grep -v nodev /proc/filesystems); do
|
|
|
|
- # hfsplus filesystems are mountable as hfs. Try hfs last so
|
|
|
|
- # that we can tell the difference.
|
|
|
|
- if [ "$type" = hfs ]; then
|
|
|
|
- delaytypes="${delaytypes:+$delaytypes }$type"
|
|
|
|
- elif [ "$type" = fuseblk ]; then
|
|
|
|
- if type ntfs-3g >/dev/null 2>&1; then
|
|
|
|
- types="${types:+$types }ntfs-3g"
|
|
|
|
- fi
|
|
|
|
- else
|
|
|
|
- types="${types:+$types }$type"
|
|
|
|
- fi
|
|
|
|
- done
|
|
|
|
+
|
|
|
|
+ # Simply skip such partition is better than trying to detect
|
|
|
|
+ # it by blinded test mounts with all kinds of kernel file system,
|
|
|
|
+ # that would lead to unwanted consequence like kernel oops and
|
|
|
|
+ # risk to corrupt your system and data.
|
|
|
|
+ debug "$1 is a partition without file system; skipping"
|
|
|
|
+ exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
tmpmnt=/var/lib/os-prober/mount
|
2017-02-20 12:06:06 +01:00
|
|
|
@@ -161,7 +155,7 @@ if type grub2-mount >/dev/null 2>&1 && \
|
2013-12-10 10:48:05 +01:00
|
|
|
fi
|
2017-02-20 12:06:06 +01:00
|
|
|
elif dm_device="$(do_dmsetup osprober "$partition")" && \
|
|
|
|
[ "$dm_device" ]; then
|
2013-12-10 10:48:05 +01:00
|
|
|
- for type in $types $delaytypes; do
|
|
|
|
+ for type in $types; do
|
2017-02-20 12:06:06 +01:00
|
|
|
if mountinfo=`mount -o ro -t "$type" "$dm_device" "$tmpmnt" 2>&1`; then
|
2013-12-10 10:48:05 +01:00
|
|
|
debug "mounted as $type filesystem"
|
|
|
|
mounted=1
|
2017-02-20 12:06:06 +01:00
|
|
|
Index: os-prober/os-probes/init/common/10filesystems
|
|
|
|
===================================================================
|
|
|
|
--- os-prober.orig/os-probes/init/common/10filesystems
|
|
|
|
+++ os-prober/os-probes/init/common/10filesystems
|
2014-12-18 15:15:54 +01:00
|
|
|
@@ -1,39 +1,19 @@
|
2013-12-10 10:48:05 +01:00
|
|
|
#!/bin/sh
|
|
|
|
# Make sure filesystems are available.
|
|
|
|
-set +e # ignore errors from modprobe
|
2014-12-18 15:15:54 +01:00
|
|
|
-
|
|
|
|
-FILESYSTEMS='ext2 ext3 ext4 xfs jfs msdos vfat ntfs minix hfs hfsplus qnx4 ufs btrfs'
|
2013-12-10 10:48:05 +01:00
|
|
|
-# fuse is needed to make grub2-mount work.
|
|
|
|
-FILESYSTEMS="$FILESYSTEMS fuse"
|
|
|
|
-# The Ubuntu kernel udebs put a number of filesystem modules in
|
|
|
|
-# fs-{core,secondary}-modules. It's fairly cheap to check for these too.
|
|
|
|
-FILESYSTEMS="$FILESYSTEMS fs-core fs-secondary"
|
|
|
|
-
|
|
|
|
-if [ ! -e /var/lib/os-prober/modules ]; then
|
|
|
|
- # Check for anna-install to make it easier to use os-prober outside
|
|
|
|
- # d-i.
|
|
|
|
- if type anna-install >/dev/null 2>&1 && [ -d /lib/debian-installer ]; then
|
|
|
|
- for fs in $FILESYSTEMS; do
|
|
|
|
- ANNA_QUIET=1 DEBIAN_FRONTEND=none \
|
|
|
|
- log-output -t os-prober \
|
|
|
|
- anna-install "$fs-modules" || true
|
|
|
|
- done
|
|
|
|
- depmod -a >/dev/null 2>&1 || true
|
|
|
|
- fi
|
2014-12-18 15:15:54 +01:00
|
|
|
-
|
2013-12-10 10:48:05 +01:00
|
|
|
- for fs in $FILESYSTEMS; do
|
|
|
|
- case "$fs" in
|
|
|
|
- fs-*)
|
|
|
|
- ;;
|
|
|
|
- *)
|
|
|
|
- modprobe "$fs" 2>/dev/null | logger -t os-prober
|
|
|
|
- ;;
|
|
|
|
- esac
|
|
|
|
- done
|
2014-12-18 15:15:54 +01:00
|
|
|
-
|
2013-12-10 10:48:05 +01:00
|
|
|
- # We only want to keep this state inside d-i, so this is as good a
|
|
|
|
- # check as any.
|
|
|
|
- if type anna-install >/dev/null 2>&1 && [ -d /lib/debian-installer ]; then
|
|
|
|
- touch /var/lib/os-prober/modules
|
|
|
|
- fi
|
|
|
|
-fi
|
2014-12-18 15:15:54 +01:00
|
|
|
+set -e
|
|
|
|
+
|
|
|
|
+# Make sure fuse is available for grub2-mount
|
|
|
|
+# As long as we use grub2-mount, we use grub2's own file system modules
|
|
|
|
+# to mount the partitiion and the operation don't require kernel support
|
|
|
|
+# other than fuse.
|
|
|
|
+if ! cat /proc/filesystems | grep nodev | cut -f2 | grep -qw fuse; then
|
|
|
|
+ modprobe fuse 2>&1 | logger -t os-prober
|
|
|
|
+fi
|
|
|
|
+# Regarding file systems not supported by grub2, or systems simply don't
|
|
|
|
+# have grub2-mount, will use linux 'mount' utility. This will require
|
|
|
|
+# kernel file system module to work, but still we don't need to modprobe
|
|
|
|
+# all of them before mount, because mount() syscall will take care of it
|
|
|
|
+# by __request_module the needed kernel module and we should leave it do
|
|
|
|
+# that for us in order to have only needed modules get loaded.
|
|
|
|
+#
|
|
|
|
+# Still if you want any kernel module loaded, add them here.
|