mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-11-26 16:56:33 -05:00
Merge branch 'arraybolt3/emerg-shutdown' into arraybolt3/trixie
This commit is contained in:
commit
5f2425ba6f
9 changed files with 219 additions and 62 deletions
48
usr/lib/dracut/modules.d/99emerg-shutdown/module-setup.sh
Executable file
48
usr/lib/dracut/modules.d/99emerg-shutdown/module-setup.sh
Executable file
|
|
@ -0,0 +1,48 @@
|
|||
#!/bin/bash
|
||||
|
||||
## Copyright (C) 2025 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
|
||||
## See the file COPYING for copying conditions.
|
||||
|
||||
## called by dracut
|
||||
check() {
|
||||
require_binaries /run/emerg-shutdown || return 1
|
||||
return 255
|
||||
}
|
||||
|
||||
## called by dracut
|
||||
depends() {
|
||||
echo 'systemd bash'
|
||||
return 0
|
||||
}
|
||||
|
||||
## called by dracut
|
||||
install() {
|
||||
local config_file
|
||||
|
||||
inst systemd-notify
|
||||
|
||||
inst_simple /usr/libexec/security-misc/emerg-shutdown
|
||||
inst_simple /usr/share/security-misc/emerg-shutdown-initramfs.service /usr/lib/systemd/system/emerg-shutdown-initramfs.service
|
||||
inst_simple /run/emerg-shutdown /emerg-shutdown
|
||||
|
||||
for config_file in /etc/security-misc/emerg-shutdown/*.conf; do
|
||||
if [ -f "${config_file}" ]; then
|
||||
inst_multiple /etc/security-misc/emerg-shutdown/*.conf
|
||||
break
|
||||
fi
|
||||
done
|
||||
for config_file in /usr/local/etc/security-misc/emerg-shutdown/*.conf; do
|
||||
if [ -f "${config_file}" ]; then
|
||||
inst_multiple /usr/local/etc/security-misc/emerg-shutdown/*.conf
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
mkdir -p "${initdir}/usr/lib/systemd/system/initrd.target.wants"
|
||||
ln -s '../emerg-shutdown-initramfs.service' "${initdir}/usr/lib/systemd/system/initrd.target.wants/emerg-shutdown-initramfs.service"
|
||||
}
|
||||
|
||||
## called by dracut
|
||||
installkernel () {
|
||||
hostonly='' instmods evdev
|
||||
}
|
||||
|
|
@ -6,8 +6,8 @@ Description=Emergency shutdown when boot media is removed
|
|||
Documentation=https://github.com/Kicksecure/security-misc
|
||||
DefaultDependencies=no
|
||||
Before=sysinit.target
|
||||
Requires=udev.service
|
||||
After=udev.service
|
||||
Requires=systemd-udevd.service
|
||||
After=systemd-udevd.service
|
||||
Requires=local-fs.target
|
||||
After=local-fs.target
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ Description=Forcibly shut down the system if normal shutdown gets stuck
|
|||
Documentation=https://github.com/Kicksecure/security-misc
|
||||
DefaultDependencies=no
|
||||
Before=sysinit.target
|
||||
Requires=udev.service
|
||||
After=udev.service
|
||||
Requires=systemd-udevd.service
|
||||
After=systemd-udevd.service
|
||||
Wants=emerg-shutdown.service
|
||||
After=emerg-shutdown.service
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue