diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2021-08-21 22:33:39 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2021-08-21 22:36:48 +0200 |
commit | 7df5a58adc83702b40ec58a435e9c5e1b6062e26 (patch) | |
tree | a9fecd3a53dcef60171839630dfc0e04072474a9 /src | |
parent | 49a125230654d0a388718cfd43ded546a1d7e5f5 (diff) | |
download | VeraCrypt-7df5a58adc83702b40ec58a435e9c5e1b6062e26.tar.gz VeraCrypt-7df5a58adc83702b40ec58a435e9c5e1b6062e26.zip |
Linux: Better Linux desktop integration. Add mount.veracrypt script for fstab (proposed by unit193 at https://github.com/veracrypt/VeraCrypt/issues/814)
Diffstat (limited to 'src')
-rw-r--r-- | src/Build/CMakeLists.txt | 4 | ||||
-rwxr-xr-x | src/Main/Main.make | 7 | ||||
-rw-r--r-- | src/Setup/Linux/mount.veracrypt | 23 | ||||
-rw-r--r-- | src/Setup/Linux/veracrypt.desktop | 13 |
4 files changed, 41 insertions, 6 deletions
diff --git a/src/Build/CMakeLists.txt b/src/Build/CMakeLists.txt index a9b7967f..0c83638d 100644 --- a/src/Build/CMakeLists.txt +++ b/src/Build/CMakeLists.txt @@ -194,6 +194,9 @@ MESSAGE ( STATUS "Architecture = ${ARCHITECTURE}" ) install(DIRECTORY ${VERACRYPT_BUILD_DIR}/usr/bin DESTINATION . USE_SOURCE_PERMISSIONS) +install(DIRECTORY ${VERACRYPT_BUILD_DIR}/usr/sbin + DESTINATION . + USE_SOURCE_PERMISSIONS) install(DIRECTORY ${VERACRYPT_BUILD_DIR}/usr/share DESTINATION . USE_SOURCE_PERMISSIONS) @@ -317,6 +320,7 @@ elseif ( ( PLATFORM STREQUAL "CentOS" ) OR ( PLATFORM STREQUAL "openSUSE" ) ) # This is to avoid having %dir of these directories in the .spec file set( CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr" ) list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/bin" ) + list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/sbin" ) list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share" ) list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/applications" ) list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/doc" ) diff --git a/src/Main/Main.make b/src/Main/Main.make index 3a9ef8c6..37abaecb 100755 --- a/src/Main/Main.make +++ b/src/Main/Main.make @@ -255,11 +255,16 @@ prepare: $(APPNAME) mkdir -p $(BASE_DIR)/Setup/Linux/usr/share/veracrypt/languages cp -r $(BASE_DIR)/../Translations/* $(BASE_DIR)/Setup/Linux/usr/share/veracrypt/languages/ + mkdir -p $(BASE_DIR)/Setup/Linux/usr/sbin + cp $(BASE_DIR)/Setup/Linux/mount.$(APPNAME) $(BASE_DIR)/Setup/Linux/usr/sbin/mount.$(APPNAME) + chmod +x $(BASE_DIR)/Setup/Linux/usr/sbin/mount.$(APPNAME) ifndef TC_NO_GUI mkdir -p $(BASE_DIR)/Setup/Linux/usr/share/applications mkdir -p $(BASE_DIR)/Setup/Linux/usr/share/pixmaps + mkdir -p $(BASE_DIR)/Setup/Linux/usr/share/mime/packages cp $(BASE_DIR)/Resources/Icons/VeraCrypt-256x256.xpm $(BASE_DIR)/Setup/Linux/usr/share/pixmaps/$(APPNAME).xpm cp $(BASE_DIR)/Setup/Linux/$(APPNAME).desktop $(BASE_DIR)/Setup/Linux/usr/share/applications/$(APPNAME).desktop + cp $(BASE_DIR)/Setup/Linux/$(APPNAME).xml $(BASE_DIR)/Setup/Linux/usr/share/mime/packages/$(APPNAME).xml endif @@ -306,8 +311,10 @@ prepare: $(APPNAME) ifndef TC_NO_GUI mkdir -p $(BASE_DIR)/Setup/FreeBSD/usr/share/applications mkdir -p $(BASE_DIR)/Setup/FreeBSD/usr/share/pixmaps + mkdir -p $(BASE_DIR)/Setup/Linux/usr/share/mime/packages cp $(BASE_DIR)/Resources/Icons/VeraCrypt-256x256.xpm $(BASE_DIR)/Setup/FreeBSD/usr/share/pixmaps/$(APPNAME).xpm cp $(BASE_DIR)/Setup/Linux/$(APPNAME).desktop $(BASE_DIR)/Setup/FreeBSD/usr/share/applications/$(APPNAME).desktop + cp $(BASE_DIR)/Setup/Linux/$(APPNAME).xml $(BASE_DIR)/Setup/Linux/usr/share/mime/packages/$(APPNAME).xml endif chown -R root:wheel $(BASE_DIR)/Setup/FreeBSD/usr chmod -R go-w $(BASE_DIR)/Setup/FreeBSD/usr diff --git a/src/Setup/Linux/mount.veracrypt b/src/Setup/Linux/mount.veracrypt new file mode 100644 index 00000000..499ad9b9 --- /dev/null +++ b/src/Setup/Linux/mount.veracrypt @@ -0,0 +1,23 @@ +#!/bin/bash +DEV="$1" +MNTPT="$2" +VCOPTIONS="" +OPTIONS="" + +shift 3 +IFS=',' +for arg in $*; do + case "$arg" in + truecrypt) VCOPTIONS=(${VCOPTIONS[*]} --truecrypt);; + system) VCOPTIONS=(${VCOPTIONS[*]} --mount-options=system);; + fs=*) VCOPTIONS=(${VCOPTIONS[*]} --filesystem=${arg#*=});; + keyfiles=*) VCOPTIONS=(${VCOPTIONS[*]} --keyfiles=${arg#*=});; + password=*) VCOPTIONS=(${VCOPTIONS[*]} --password=${arg#*=});; + pim=*) VCOPTIONS=(${VCOPTIONS[*]} --pim==${arg#*=});; + protect-hidden=*) VCOPTIONS=(${VCOPTIONS[*]} --protect-hidden=${arg#*=});; + slot=*) VCOPTIONS=(${VCOPTIONS[*]} --slot=${arg#*=});; + *) OPTIONS="${OPTIONS}${arg},";; + esac +done + +/usr/bin/veracrypt --non-interactive --text ${VCOPTIONS[*]} --fs-options="${OPTIONS%,*}" ${DEV} ${MNTPT} diff --git a/src/Setup/Linux/veracrypt.desktop b/src/Setup/Linux/veracrypt.desktop index 01dfaf61..4504f20c 100644 --- a/src/Setup/Linux/veracrypt.desktop +++ b/src/Setup/Linux/veracrypt.desktop @@ -1,10 +1,11 @@ [Desktop Entry] -Encoding=UTF-8 +Type=Application Name=VeraCrypt -GenericName=VeraCrypt -Comment=VeraCrypt -Exec=/usr/bin/veracrypt +GenericName=VeraCrypt volume manager +Comment=Create and mount VeraCrypt encrypted volumes Icon=veracrypt +Exec=/usr/bin/veracrypt %f +Categories=Security;Utility;Filesystem +Keywords=encryption,filesystem Terminal=false -Type=Application -Categories=Encryption;Encryption Tools;Utility; +MimeType=application/x-veracrypt-volume;application/x-truecrypt-volume;
\ No newline at end of file |