mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-12-17 01:43:50 -05:00
Allow specifying alternative keys in panic key combo, fix optical disk eject handling
This commit is contained in:
parent
dfb6f143f0
commit
e387086de4
3 changed files with 70 additions and 31 deletions
27
usr/libexec/security-misc/emerg-shutdown
Executable file
27
usr/libexec/security-misc/emerg-shutdown
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2025 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
|
||||
# See the file COPYING for copying conditions.
|
||||
|
||||
gcc \
|
||||
-o \
|
||||
/run/emerg-shutdown \
|
||||
-static \
|
||||
/usr/src/security-misc/emerg-shutdown.c \
|
||||
|| {
|
||||
printf "%s\n" 'Could not compile force-shutdown executable!'
|
||||
exit 1;
|
||||
}
|
||||
|
||||
readarray -t root_devices < <(/usr/libexec/helper-scripts/get-backing-devices-for-mountpoint '/');
|
||||
|
||||
## memlockd daemonizes itself, so no need to background it
|
||||
memlockd -c /usr/share/security-misc/security-misc-memlockd.cfg
|
||||
|
||||
OLDIFS="$IFS"
|
||||
IFS=','
|
||||
/run/emerg-shutdown "--devices=${root_devices[*]}" '--keys=KEY_LEFTCTRL|KEY_RIGHTCTRL,KEY_LEFTALT|KEY_RIGHTALT,KEY_DELETE' &
|
||||
IFS="$OLDIFS"
|
||||
sleep 1
|
||||
disown
|
||||
exit 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue