mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
udisks: add systemd support
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
6a9f6f2d9a
commit
cbc02056b5
@ -48,5 +48,11 @@ PKG_CONFIGURE_OPTS_TARGET="--datadir=/usr/share \
|
||||
|
||||
post_makeinstall_target() {
|
||||
rm -rf $INSTALL/etc/profile.d
|
||||
rm -rf $INSTALL/lib/udev/rules.d
|
||||
|
||||
mkdir -p $INSTALL/lib/systemd
|
||||
cp -P $PKG_DIR/scripts/udisks-mount-disks $INSTALL/lib/systemd
|
||||
}
|
||||
|
||||
post_install() {
|
||||
enable_service udisks-mount-disks.service
|
||||
}
|
||||
|
43
packages/sysutils/udisks/init.d/31_mount-disks → packages/sysutils/udisks/scripts/udisks-mount-disks
Normal file → Executable file
43
packages/sysutils/udisks/init.d/31_mount-disks → packages/sysutils/udisks/scripts/udisks-mount-disks
Normal file → Executable file
@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
################################################################################
|
||||
# Copyright (C) 2009-2010 OpenELEC.tv
|
||||
# http://www.openelec.tv
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# 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
|
||||
@ -18,32 +19,22 @@
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
#
|
||||
# automount internal disks
|
||||
#
|
||||
# runlevels: openelec, textmode
|
||||
|
||||
(
|
||||
progress "automount internal disks"
|
||||
drive_dump () {
|
||||
udisks --dump | tr -d ' ' | grep 'device-file:' | cut -d ':' -f2
|
||||
}
|
||||
|
||||
wait_for_dbus
|
||||
show_info () {
|
||||
udisks --show-info $2 | grep "$1:" | tr -d ' ' | cut -d ":" -f2
|
||||
}
|
||||
|
||||
drive_dump () {
|
||||
udisks --dump | tr -d ' ' | grep 'device-file:' | 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`"
|
||||
|
||||
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
|
||||
)&
|
||||
if [ "$REMOVABLE" = "0" -a "$MOUNTED" = "0" -a "$USAGE" = "filesystem" ]; then
|
||||
udisks --mount "$DEVICE" >/dev/null
|
||||
fi
|
||||
done
|
@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Mount internal disks
|
||||
|
||||
[Service]
|
||||
ExecStart=/lib/systemd/udisks-mount-disks
|
||||
Type=oneshot
|
||||
|
||||
[Install]
|
||||
WantedBy=remote-fs.target
|
8
packages/sysutils/udisks/system.d/udisks.service
Normal file
8
packages/sysutils/udisks/system.d/udisks.service
Normal file
@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Disk Manager
|
||||
Documentation=man:udisks(8)
|
||||
|
||||
[Service]
|
||||
Type=dbus
|
||||
BusName=org.freedesktop.UDisks
|
||||
ExecStart=/usr/lib/udisks/udisks-daemon
|
Loading…
x
Reference in New Issue
Block a user