security-misc/usr/lib/dracut/modules.d/20remount-secure/remount-secure.sh

25 lines
543 B
Bash
Raw Normal View History

2023-10-22 08:10:48 -04:00
#!/bin/sh
## Copyright (C) 2023 - 2023 ENCRYPTED SUPPORT LP <adrelanos@whonix.org>
## See the file COPYING for copying conditions.
2023-10-22 09:36:03 -04:00
## This script is intended to remount specified mount points with more secure
## options based on kernel command line parameters.
2023-10-22 08:10:48 -04:00
remount_hook() {
local remount_action
remount_action=$(getarg remountsecure)
2023-10-22 09:36:03 -04:00
if getargbool 1 remountnoexec; then
remount-secure --remountnoexec
2023-10-22 08:10:48 -04:00
return 0
fi
2023-10-22 09:36:03 -04:00
if getargbool 1 remountsecure; then
remount-secure
return 0
fi
2023-10-22 08:10:48 -04:00
}
remount_hook