Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Automounter #360

Merged
merged 6 commits into from
Sep 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions etc/automount.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# configure mount directory
MNT_PREFIX='/Volumes'
# use nice names by default
NICENAMES='YES'
# disable automatic opening of file manager
FM=''
Comment on lines +5 to +6
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may eventually be configured to automatically open up Filer if desired.

43 changes: 43 additions & 0 deletions etc/devd/automount_devd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# PENDRIVE/PHONE/SDCARD insert
notify 100 {
match "system" "DEVFS";
match "type" "CREATE";
match "cdev" "(da|mmcsd|ugen)[0-9]+.*";
action "/usr/sbin/automount $cdev attach &";
};

# PENDRIVE/PHONE/SDCARD remove
notify 100 {
match "system" "DEVFS";
match "type" "DESTROY";
match "cdev" "(da|mmcsd|ugen)[0-9]+.*";
action "/usr/sbin/automount $cdev detach &";
};

# CD-ROM media inject
notify 100 {
match "system" "DEVFS";
match "type" "CREATE|MEDIACHANGE";
match "cdev" "(cd)[0-9]+.*";
action "/usr/sbin/automount $cdev attach &";
};

# CD-ROM media eject
notify 100 {
match "system" "DEVFS";
match "type" "DESTROY";
match "cdev" "(cd)[0-9]+.*";
action "/usr/sbin/automount $cdev detach &";
};

# CD-ROM no media
notify 100 {
match "system" "CAM";
match "subsystem" "periph";
match "type" "error";
match "cam_status" "0xcc";
match "scsi_status" "2";
match "scsi_sense" "70 02 3a 02";
match "device" "(cd)[0-9]+.*";
action "/usr/sbin/automount $device detach &";
};
Comment on lines +1 to +43
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

devd-specific configuration

1 change: 1 addition & 0 deletions targets/pseudo/userland/Makefile.depend
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ DIRDEPS+= \
usr.sbin/auditreduce \
usr.sbin/authpf \
usr.sbin/autofs \
usr.sbin/automount \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include the appropriate makefile for automount

usr.sbin/binmiscctl \
usr.sbin/bluetooth/ath3kfw \
usr.sbin/bluetooth/bcmfw \
Expand Down
5 changes: 5 additions & 0 deletions usr.sbin/automount/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# $FreeBSD$

SCRIPTS=automount.sh

.include <bsd.prog.mk>
11 changes: 11 additions & 0 deletions usr.sbin/automount/Makefile.depend
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# $FreeBSD$
# Autogenerated - do NOT edit!

DIRDEPS = \


.include <dirdeps.mk>

.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
.endif
Loading