mirror of
https://github.com/Kicksecure/security-misc.git
synced 2024-12-25 17:59:24 -05:00
fix, sysctl-initramfs: switch log to /run/initramfs/sysctl-initramfs-error.log
since ephemeral, in RAM, not written to disk, no conflict with grub-live https://forums.whonix.org/t/kernel-hardening/7296/435
This commit is contained in:
parent
701da5f6cc
commit
4898a9e753
@ -15,19 +15,12 @@ prereqs)
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
## ${rootmnt} is mounted read-only in the initramfs so it needs to be remounted first.
|
## Write to '/run/initramfs' folder.
|
||||||
if mount | grep "${rootmnt}" | grep -q "(ro,"; then
|
## https://forums.whonix.org/t/kernel-hardening/7296/435
|
||||||
remount="yes"
|
|
||||||
mount -o remount,rw "${rootmnt}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
sysctl -p ${rootmnt}/etc/sysctl.conf >/dev/null 2> "${rootmnt}/var/log/sysctl-initramfs-error.log"
|
sysctl -p ${rootmnt}/etc/sysctl.conf >/dev/null 2> "/run/initramfs/sysctl-initramfs-error.log"
|
||||||
sysctl -p ${rootmnt}/etc/sysctl.d/*.conf >/dev/null 2>> "${rootmnt}/var/log/sysctl-initramfs-error.log"
|
sysctl -p ${rootmnt}/etc/sysctl.d/*.conf >/dev/null 2>> "/run/initramfs/sysctl-initramfs-error.log"
|
||||||
|
|
||||||
if [ "${remount}" = "yes" ]; then
|
grep -v "unprivileged_userfaultfd" "/run/initramfs/sysctl-initramfs-error.log"
|
||||||
mount -o remount,ro "${rootmnt}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
grep -v "unprivileged_userfaultfd" "${rootmnt}/var/log/sysctl-initramfs-error.log"
|
|
||||||
|
|
||||||
true
|
true
|
||||||
|
Loading…
Reference in New Issue
Block a user