mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
udisks: automount internally partitions via udev
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
17d209e8ac
commit
74d4582b05
@ -1,6 +1,6 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
# Copyright (C) 2009-2010 OpenELEC.tv
|
# This file is part of OpenELEC - http://www.openelec.tv
|
||||||
# http://www.openelec.tv
|
# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
|
||||||
#
|
#
|
||||||
# This Program is free software; you can redistribute it and/or modify
|
# This Program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -18,30 +18,13 @@
|
|||||||
# http://www.gnu.org/copyleft/gpl.html
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
#
|
ACTION!="add|change", GOTO="end"
|
||||||
# automount internal disks
|
SUBSYSTEM!="block", GOTO="end"
|
||||||
#
|
|
||||||
# runlevels: openelec, textmode
|
|
||||||
|
|
||||||
(
|
# mount the partition on add/change, if its a filesystem and on a ata drive
|
||||||
progress "automount internal disks"
|
KERNEL=="sd[a-z][0-9]*", \
|
||||||
|
ENV{ID_BUS}=="ata", \
|
||||||
|
ENV{ID_FS_USAGE}=="filesystem", \
|
||||||
|
RUN+="/usr/bin/udisks --mount /dev/%k"
|
||||||
|
|
||||||
drive_dump () {
|
LABEL="end"
|
||||||
udisks --dump | tr -d ' ' | grep 'device-file:' | cut -d ':' -f2
|
|
||||||
}
|
|
||||||
|
|
||||||
show_info () {
|
|
||||||
udisks --show-info $2 | grep "$1:" | tr -d ' ' | cut -d ":" -f2
|
|
||||||
}
|
|
||||||
|
|
||||||
for DEVICE in `drive_dump`; do
|
|
||||||
REMOVABLE="`show_info "removable" $DEVICE`"
|
|
||||||
MOUNTED="`show_info "is mounted" $DEVICE`"
|
|
||||||
USAGE="`show_info "usage" $DEVICE`"
|
|
||||||
|
|
||||||
if [ "$REMOVABLE" = "0" -a "$MOUNTED" = "0" -a "$USAGE" = "filesystem" ]; then
|
|
||||||
udisks --mount "$DEVICE" >/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
done
|
|
||||||
)&
|
|
Loading…
x
Reference in New Issue
Block a user