mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-20 05:28:08 +00:00
init: Adding checks for sysfs and runtime panic_on_oom=1
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
This commit is contained in:
parent
a051483c79
commit
c73687a232
19
initrd/init
19
initrd/init
@ -24,7 +24,7 @@ if [ "$CONFIG_LINUXBOOT" = "y" ]; then
|
|||||||
mount /sys/firmware/efi/efivars
|
mount /sys/firmware/efi/efivars
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Setup the pty psudeo filesystem
|
# Setup the pty pseudo filesystem
|
||||||
mkdir /dev/pts
|
mkdir /dev/pts
|
||||||
mount /dev/pts 2>/dev/ttyprintk
|
mount /dev/pts 2>/dev/ttyprintk
|
||||||
|
|
||||||
@ -78,6 +78,23 @@ fi
|
|||||||
|
|
||||||
TRACE "Under init"
|
TRACE "Under init"
|
||||||
|
|
||||||
|
# make sure we have sysctl requirements
|
||||||
|
if [ ! -d /proc/sys ]; then
|
||||||
|
warn "BUG!!! The following requirements to apply runtime kernel tweaks are missing:"
|
||||||
|
warn "CONFIG_SYSCTL=y"
|
||||||
|
warn "CONFIG_PROC_SYSCTL=y"
|
||||||
|
warn "Please open an issue"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -e /proc/sys/vm/panic_on_oom ]; then
|
||||||
|
warn "BUG!!! Requirements to setup Panic when under Out Of Memory situation through PROC_SYSCTL are missing (panic_on_oom was not enabled)"
|
||||||
|
warn "Please open an issue"
|
||||||
|
else
|
||||||
|
DEBUG "Applying panic_on_oom setting to sysctl"
|
||||||
|
echo 1 > /proc/sys/vm/panic_on_oom
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# set CONFIG_TPM dynamically before init
|
# set CONFIG_TPM dynamically before init
|
||||||
if [ ! -e /dev/tpm0 ]; then
|
if [ ! -e /dev/tpm0 ]; then
|
||||||
CONFIG_TPM='n'
|
CONFIG_TPM='n'
|
||||||
|
Loading…
Reference in New Issue
Block a user