aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-10-14 15:33:40 -0400
committerB. Stack <bgstack15@gmail.com>2023-10-14 15:33:40 -0400
commit021a4b5a438960b25ea644984895ce672a9756f4 (patch)
tree2840b448f01b84fd3c416e91a1a128596c6c4be7
parentadd _service to scm (diff)
downloadmyautomount-021a4b5a438960b25ea644984895ce672a9756f4.tar.gz
myautomount-021a4b5a438960b25ea644984895ce672a9756f4.tar.bz2
myautomount-021a4b5a438960b25ea644984895ce672a9756f4.zip
v0.0.4 add floppy icon, reenable /browse/sdc1 format
-rw-r--r--debian/changelog9
-rw-r--r--debian/myautomount.dsc2
-rw-r--r--myautomount.spec5
-rw-r--r--src/Makefile2
-rwxr-xr-xsrc/usr/bin/myautomountd27
-rw-r--r--src/usr/libexec/myautomount/myautomount-initialize.sh8
6 files changed, 38 insertions, 15 deletions
diff --git a/debian/changelog b/debian/changelog
index 4ad2a3f..6df12f4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+myautomount (0.0.4-1) obs; urgency=low
+
+ * Add floppy drive icon.
+ * Reenable generic "/browse/sdc1" support primarily for CDs.
+
+ -- B. Stack <bgstack15@gmail.com> Sat, 14 Oct 2023 15:32:12 -0400
+
myautomount (0.0.3-1) obs; urgency=low
* Add filesystem type to automount destination so autofs can
@@ -16,4 +23,4 @@ myautomount (0.0.1-1) obs; urgency=low
* Initial release. Closes: packages-want#9999
- -- Ben Stack <bgstack15@gmail.com> Thu, 01 Oct 2020 20:55:28 -0400
+ -- B. Stack <bgstack15@gmail.com> Thu, 01 Oct 2020 20:55:28 -0400
diff --git a/debian/myautomount.dsc b/debian/myautomount.dsc
index 59390a2..9cb2949 100644
--- a/debian/myautomount.dsc
+++ b/debian/myautomount.dsc
@@ -2,7 +2,7 @@ Format: 3.0 (quilt)
Source: myautomount
Binary: myautomount
Architecture: all
-Version: 0.0.3-1
+Version: 0.0.4-1
Maintainer: B. Stack <bgstack15@gmail.com>
Homepage: https://bgstack15.wordpress.com/
Standards-Version: 4.5.0
diff --git a/myautomount.spec b/myautomount.spec
index 8f91f25..d401d85 100644
--- a/myautomount.spec
+++ b/myautomount.spec
@@ -20,7 +20,7 @@
%global git_commit 0d5f8b7657527eab8380f5aa81ecd072714cf13c
%{?git_commit:%global git_commit_hash %(c=%{git_commit}; echo ${c:0:7})}
%else
-%global git_commit 0.0.3
+%global git_commit 0.0.4
%endif
%global releasenum 1
@@ -103,6 +103,9 @@ update-desktop-database 1>/dev/null 2>&1 || :
%endif
%changelog
+* Sat Oct 14 2023 B. Stack <bgstack15@gmail.com> - 0.0.4-1
+- New version
+
* Wed Oct 04 2023 B. Stack <bgstack15@gmail.com> - 0.0.3-1
- New version
diff --git a/src/Makefile b/src/Makefile
index 14e83af..0192a23 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -14,7 +14,7 @@
# build-devuan: txt2man, bgscripts-core
APPNAME = myautomount
-APPVERSION = 0.0.3
+APPVERSION = 0.0.4
SRCDIR = $(CURDIR)
prefix = /usr
SYSCONFDIR = $(DESTDIR)/etc
diff --git a/src/usr/bin/myautomountd b/src/usr/bin/myautomountd
index e6a1466..df2dc97 100755
--- a/src/usr/bin/myautomountd
+++ b/src/usr/bin/myautomountd
@@ -10,6 +10,7 @@
# 2020-09-23 originally translated by bgstack15 to shell from Go version (reference 1)
# 2020-09-25 diverged from original architecture
# 2023-10-04 add fs_type to path to make autofs work with exact fs type
+# 2023-10-14 add floppy disk support
# Usage:
# Invoke this at X startup. This can be from the xdg autostart mechanism, or "exec myautomountd &" in ~/fluxbox.startup
# This is the backend to myautomount-trayicon
@@ -67,11 +68,11 @@ createEntry() {
_device="${1}"
_filepath="${2}"
test -n "${STACKTRACE}" && echo "STUB createEntry \"${_device}\" \"${_filepath}\"" 1>&2
- unset _fs _model _vendor _label _atracks _fs_version _use_fs
+ unset _fs _model _vendor _label _atracks _fs_version _use_fs _type
# _use_fs simplifies the mount types a little
_bytes="$( udevadm info "/dev/${_device}" 2>/dev/null )"
- _shortbytes="$( printf "%s\n" "${_bytes}" | sed -r -e 's/^E:\s*//;' | grep -E '^(ID_FS_TYPE|ID_MODEL|ID_VENDOR|ID_FS_LABEL|ID_CDROM_MEDIA_TRACK_COUNT_AUDIO|ID_FS_VERSION)=' )"
- unset ID_FS_TYPE ID_MODEL ID_VENDOR ID_FS_LABEL ID_CDROM_MEDIA_TRACK_COUNT_AUDIO ID_FS_VERSION
+ _shortbytes="$( printf "%s\n" "${_bytes}" | sed -r -e 's/^E:\s*//;' | grep -E '^(ID_FS_TYPE|ID_MODEL|ID_VENDOR|ID_FS_LABEL|ID_CDROM_MEDIA_TRACK_COUNT_AUDIO|ID_FS_VERSION|ID_TYPE)=' )"
+ unset ID_FS_TYPE ID_MODEL ID_VENDOR ID_FS_LABEL ID_CDROM_MEDIA_TRACK_COUNT_AUDIO ID_FS_VERSION ID_TYPE
eval "${_shortbytes}"
_fs="${ID_FS_TYPE}"
_fs_version="${ID_FS_VERSION}"
@@ -79,7 +80,8 @@ createEntry() {
_vendor="${ID_VENDOR}"
_label="${ID_FS_LABEL}"
_atracks="${ID_CDROM_MEDIA_TRACK_COUNT_AUDIO}"
- test -n "${DEBUG}" && echo "fs=${_fs} model=${_model} vendor=${_vendor} label=${_label} atracks=${_atracks}" 1>&2
+ _type="${ID_TYPE}"
+ test -n "${DEBUG}" && echo "fs=${_fs} model=${_model} vendor=${_vendor} label=${_label} atracks=${_atracks} _type=${_type}" 1>&2
test "${_fs}" = "" && test "${_atracks}" = "" && return # if the fs cannot be detected
test "${_fs}" = "vfat" && test "${_fs_version}" = "FAT32" && _use_fs="fat32"
case "${_fs}" in
@@ -109,12 +111,17 @@ createEntry() {
echo "GenericName=${_vendor} ${_model}"
fi
echo "Comment=${_device} (${_fs})"
- case "${_fs}" in
- "cd9600") echo "Icon=media-optical" ;;
- "udf") echo "Icon=media-optical-dvd" ;;
- "") echo "Icon=media-optical-audio" ;;
- *) echo "Icon=media-removable" ;;
- esac
+ if test "${_type}" = "floppy" ;
+ then
+ echo "Icon=system-floppy"
+ else
+ case "${_fs}" in
+ "cd9600") echo "Icon=media-optical" ;;
+ "udf") echo "Icon=media-optical-dvd" ;;
+ "") echo "Icon=media-optical-audio" ;;
+ *) echo "Icon=media-removable" ;;
+ esac
+ fi
} > "${_filepath}"
}
diff --git a/src/usr/libexec/myautomount/myautomount-initialize.sh b/src/usr/libexec/myautomount/myautomount-initialize.sh
index 1194ed5..1798c65 100644
--- a/src/usr/libexec/myautomount/myautomount-initialize.sh
+++ b/src/usr/libexec/myautomount/myautomount-initialize.sh
@@ -26,13 +26,19 @@ setupSystem() {
} > "${MYA_PREFIX}${AUTOMOUNT_FILE}.ext4" || fail "Could not setup autofs rules! Check if this is being run as root?"
_needrestart=1
}
+ ! grep -q -e "fstype=auto,noatime" "${MYA_PREFIX}${AUTOMOUNT_FILE}" 2>/dev/null && {
+ {
+ echo "# for CDs"
+ echo "* -fstype=auto,noatime,rw,nosuid :/dev/& "
+ } > "${MYA_PREFIX}${AUTOMOUNT_FILE}" || fail "Could not setup autofs rules! Check if this is being run as root?"
+ _needrestart=1
! grep -q -e "${AUTOMOUNT_BROWSEDIR}" "${MYA_PREFIX}${AUTOMOUNT_DIR_FILE}" 2>/dev/null && {
{
touch "${MYA_PREFIX}${AUTOMOUNT_DIR_FILE}"
echo "${AUTOMOUNT_BROWSEDIR}/ext4 ${AUTOMOUNT_FILE}.ext4 --timeout=5 "
echo "${AUTOMOUNT_BROWSEDIR}/fat32 ${AUTOMOUNT_FILE}.fat32 --timeout=5 "
echo "${AUTOMOUNT_BROWSEDIR}/ntfs ${AUTOMOUNT_FILE}.fat32 --timeout=5 "
- echo "#${AUTOMOUNT_BROWSEDIR} ${AUTOMOUNT_FILE} --timeout=5 "
+ echo "${AUTOMOUNT_BROWSEDIR} ${AUTOMOUNT_FILE} --timeout=5 "
} > "${MYA_PREFIX}${AUTOMOUNT_DIR_FILE}" || fail "Could not setup autofs rules! Check if this is being run as root?"
_needrestart=1
}
bgstack15