Codebase list kali-defaults / c3c90e7
Implement noautomount feature as an XDG autostart script. Raphaël Hertzog 6 years ago
6 changed file(s) with 44 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
+0
-16
52kali_noautomount less more
0 # This file implements the "noautomount" boot option used by Kali's
1 # forensic mode to avoid auto-mounting disks which are detected
2 # dynamically by udisks
3
4 # The downside of this approach is that the setting is overwritten every
5 # time that you login in the graphical interface. If you're fed up by this
6 # and want to keep automount always disabled, just edit this file and
7 # comment everything.
8
9 if [ -r /proc/cmdline ] && [ -x "$(which gsettings)" ]; then
10 if grep -q -E "\bnoautomount\b" /proc/cmdline 2>/dev/null; then
11 gsettings set org.gnome.desktop.media-handling automount false
12 else
13 gsettings set org.gnome.desktop.media-handling automount true
14 fi
15 fi
00 kali-defaults (2017.2.1) UNRELEASED; urgency=medium
11
22 * Drop no longer needed work-around (/etc/X11/Xsession.d/52kali_fix_lang).
3 * Implement noautomount feature as an XDG autostart script.
34
45 -- Raphaël Hertzog <[email protected]> Tue, 29 Aug 2017 10:48:22 +0200
56
0 52kali_noautomount etc/X11/Xsession.d/
10 .bashrc usr/share/kali-defaults/
21 browser/kali.js etc/firefox-esr/
32 browser/distribution.ini usr/share/firefox-esr/distribution/
87 dconf/kali-tweaks etc/dconf/db/local.d/
98 postgresql/kali_postgresql.conf lib/systemd/system/[email protected]/
109 postgresql/postgresql_reduce_shared_buffers usr/share/kali-defaults/
10 noautomount/setup-noautomount usr/share/kali-defaults/
11 noautomount/kali-noautomount.desktop etc/xdg/autostart/
2323 done
2424 fi
2525
26 if dpkg --compare-versions "$2" lt-nl 2017.2.1; then
27 rm -f /etc/X11/Xsession.d/52kali_fix_lang
28 rm -f /etc/X11/Xsession.d/52kali_noautomount
29 fi
30
2631 for file in /etc/skel/.bashrc /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
2732 do
2833 orig_file="/usr/share/kali-defaults/$(basename $file)"
0 [Desktop Entry]
1 Type=Application
2 Name=Kali script to disable automount
3 Exec=/usr/share/kali-defaults/setup-noautomount
4 NoDisplay=true
5 X-GNOME-Autostart-Phase=Initialization
6 X-KDE-autostart-phase=1
0 #!/bin/sh
1
2 # This file implements the "noautomount" boot option used by Kali's
3 # forensic mode to avoid auto-mounting disks which are detected
4 # dynamically by udisks
5
6 # It is executed through /etc/xdg/autostart/kali-noautomount.desktop
7
8 # The downside of this approach is that the setting is overwritten every
9 # time that you login in the graphical interface. If you're fed up by this
10 # and want to keep automount always disabled, just edit this file and
11 # comment everything.
12
13 if [ ! -r /proc/cmdline ]; then
14 echo "WARNING: unable to read /proc/cmdline and detect noautomount option" >&2
15 exit 0
16 fi
17
18 if [ ! -x "$(which gsettings 2>/dev/null)" ]; then
19 echo "WARNING: unable to find gsettings needed to disable automount" >&2
20 exit 0
21 fi
22
23 if grep -q -E "\bnoautomount\b" /proc/cmdline; then
24 echo "INFO: disabling automount as requested by kernel command line" >&2
25 gsettings set org.gnome.desktop.media-handling automount false
26 else
27 gsettings set org.gnome.desktop.media-handling automount true
28 fi