1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00

Merge pull request #682 from georgejhunt/usb-exfat

automount USB exFAT sticks (& possibly portable NTFS disks too)
This commit is contained in:
A Holt 2018-02-15 11:11:55 -05:00 committed by GitHub
commit 2e6a72d7d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 0 deletions

View file

@ -15,6 +15,20 @@
mode: 0751
when: usb_lib_enabled
- name: Install udev to systemd link -> usbmount
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
with_items:
- { src: 'usbmount@.service.j2' , dest: '/etc/systemd/system/usbmount@.service' }
- { src: 'usbmount.rules.j2' , dest: '/etc/udev/rules.d/usbmount.rules' }
- name: Enable exfat and ntfs
lineinfile:
regexp: '^FILESYSTEMS.*'
line: 'FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus exfat fuseblk ntfs"'
dest: /etc/usbmount/usbmount.conf
- name: Copy umount file to usbmount when enabled
template:
src: umount.d/70-usb-library

View file

@ -0,0 +1,5 @@
KERNEL=="sd*", DRIVERS=="sbp2", ACTION=="add", PROGRAM="/bin/systemd-escape -p --template=usbmount@.service $env{DEVNAME}", ENV{SYSTEMD_WANTS}+="%c"
KERNEL=="sd*", SUBSYSTEMS=="usb", ACTION=="add", PROGRAM="/bin/systemd-escape -p --template=usbmount@.service $env{DEVNAME}", ENV{SYSTEMD_WANTS}+="%c"
KERNEL=="ub*", SUBSYSTEMS=="usb", ACTION=="add", PROGRAM="/bin/systemd-escape -p --template=usbmount@.service $env{DEVNAME}", ENV{SYSTEMD_WANTS}+="%c"
KERNEL=="sd*", ACTION=="remove", RUN+="/usr/share/usbmount/usbmount remove"

View file

@ -0,0 +1,11 @@
[Unit]
BindTo=%i.device
After=%i.device
[Service]
Type=oneshot
TimeoutStartSec=0
Environment=DEVNAME=%I
ExecStart=/usr/share/usbmount/usbmount add
RemainAfterExit=yes