Re: Bug#761815: installation adds entries for USB media to /etc/fstab which confuse udisks
On Sun, Jan 25, 2015 at 11:21:08PM +0000, Steve McIntyre wrote:
>On Sun, Jan 25, 2015 at 11:45:40PM +0100, Cyril Brulebois wrote:
>>Steve McIntyre <steve@einval.com> (2015-01-17):
>>> I'm thinking the best way to go with this is to simply drop this misc
>>> USB device support altogether from partman-target. Any objections?
>>
>>Not from me.
>
>OK, cool. Committing shortly. :-)
Right, it seems that was too conservative and still left hd-media
devices listed. We probably don't want those either. Let's try this:
don't add *any* USB devices to /etc/fstab:
diff --git a/debian/changelog b/debian/changelog
index c619533..df293e6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+partman-target (95) unstable; urgency=medium
+
+ [ Steve McIntyre ]
+ * Further extend the fix for #761815 - don't add *any* USB devices
+ to /etc/fstab.
+
+ -- Steve McIntyre <93sam@debian.org> Mon, 30 Mar 2015 18:10:31 +0100
+
partman-target (94) unstable; urgency=medium
[ Steve McIntyre ]
diff --git a/finish.d/fstab_removable_media_entries b/finish.d/fstab_removable_media_entries
index 7db9e34..f132200 100755
--- a/finish.d/fstab_removable_media_entries
+++ b/finish.d/fstab_removable_media_entries
@@ -105,70 +105,3 @@ case `udpkg --print-os` in
;;
esac
-# See if a usb storage device is plugged in right now. If so, assume it is
-# removable media unless the disk is already listed in the fstab.
-HD_MEDIA=$(grep /hd-media /proc/mounts | cut -d ' ' -f 1)
-if [ -n "$HD_MEDIA" ]; then
- HD_MEDIA="$(mapdevfs $HD_MEDIA)"
-fi
-founddevs=
-if [ -d /sys/block ]; then
- if type udevadm >/dev/null 2>&1; then
- device_info () {
- udevadm info "$@"
- }
- elif type udevinfo >/dev/null 2>&1; then
- device_info () {
- udevinfo "$@"
- }
- fi
-fi
-if type device_info >/dev/null 2>&1; then
- disk_containing () {
- dirname "$(device_info -q path -n "$1")"
- }
- partitions="$(list-devices partition)"
- for dev in $partitions; do
- if ! device_info -q env -n "$dev" | grep -q '^ID_BUS=usb$'; then
- continue
- fi
- disk="$(disk_containing "$dev")"
- for otherdev in $partitions; do
- if [ "$(disk_containing "$otherdev")" = "$disk" ] && \
- grep -q "^$otherdev " /target/etc/fstab; then
- continue 2
- fi
- done
- mapdev="$(mapdevfs $dev)"
- founddevs="${founddevs:+$founddevs }$mapdev"
- done
-fi
-USBDEVICES=
-for dev in $founddevs; do
- if [ -z "$USBDEVICES" ]; then
- USBDEVICES="$dev"
- else
- if [ "$dev" = "$HD_MEDIA" ]; then
- # If installing from usb, list that device first
- USBDEVICES="$dev $USBDEVICES"
-
- # But explicitly don't add entries for other
- # random USB devices that are neither
- # installation sources nor partitions we've
- # added into fstab already. They're not
- # useful
- fi
- fi
-done
-
-case `udpkg --print-os` in
- linux)
- populate_media usb auto rw,user,noauto $USBDEVICES
- ;;
- kfreebsd)
- populate_media usb auto rw,noauto $USBDEVICES
- ;;
- hurd)
- populate_media usb auto rw,noauto $USBDEVICES
- ;;
-esac
--
Steve McIntyre, Cambridge, UK. steve@einval.com
"I've only once written 'SQL is my bitch' in a comment. But that code
is in use on a military site..." -- Simon Booth
Reply to: