Skip to content
Snippets Groups Projects
Commit c97ef6bc authored by Denis Pynkin's avatar Denis Pynkin
Browse files

Add automatic mount of USB devices for minimal images


Minimal images have no automatic mounts of mass storage devices.
Allow to mount USB storage devices automatically in R/O mode to
prevent accidental corruption of filesystem on device.

This feature is needed for mass storage upgrades.

Signed-off-by: default avatarDenis Pynkin <denis.pynkin@collabora.com>
parent d3be0f88
No related branches found
No related tags found
1 merge request!69Add automatic mount of USB devices for minimal images
This commit is part of merge request !91. Comments created here will be created in the context of that merge request.
......@@ -37,6 +37,7 @@ actions:
- apt-transport-https
- apertis-customizations
- initramfs-tools
- udisks2
- action: apt
description: "Base packages"
......@@ -100,6 +101,9 @@ actions:
- action: overlay
source: overlays/minimal-ribchester-polkit-rules
- action: overlay
source: overlays/minimal-automount-rules
- action: run
chroot: true
script: scripts/add-xdg-user-metadata.sh
......
ENV{ID_FS_USAGE}=="filesystem", ENV{UDISKS_FILESYSTEM_SHARED}="1"
KERNEL=="sd*", SUBSYSTEMS=="usb", ACTION=="add", ATTR{partition}=="1", PROGRAM="/bin/systemd-escape -p --template=usbmount@.service $env{DEVNAME}", ENV{SYSTEMD_WANTS}+="%c"
KERNEL=="sd*", SUBSYSTEMS=="usb", ACTION=="remove", RUN+="/usr/bin/udisksctl unmount -f -b $env{DEVNAME}"
../usbmount@.service
\ No newline at end of file
[Unit]
BindTo=%i.device
After=%i.device
[Service]
Type=oneshot
TimeoutStartSec=0
ExecStart=/usr/bin/udisksctl mount -o ro -b /%I
RemainAfterExit=yes
StandardOutput=syslog
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment