From 8c4e0ff1c4d6191dbb40b28cfc23a8185cc0cbdb Mon Sep 17 00:00:00 2001 From: madaidan Date: Sun, 12 Jan 2020 21:37:37 +0000 Subject: [PATCH] Set sysctl values in initramfs --- etc/initramfs-tools/hooks/sysctl-initramfs | 21 +++++++++++++++++++ .../scripts/init-bottom/sysctl-initramfs | 18 ++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 etc/initramfs-tools/hooks/sysctl-initramfs create mode 100755 etc/initramfs-tools/scripts/init-bottom/sysctl-initramfs diff --git a/etc/initramfs-tools/hooks/sysctl-initramfs b/etc/initramfs-tools/hooks/sysctl-initramfs new file mode 100755 index 0000000..d091ca8 --- /dev/null +++ b/etc/initramfs-tools/hooks/sysctl-initramfs @@ -0,0 +1,21 @@ +#!/bin/sh + +## Copyright (C) 2012 - 2019 ENCRYPTED SUPPORT LP +## See the file COPYING for copying conditions. + +set -e + +PREREQ="" +prereqs() +{ + echo "$PREREQ" +} +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +. /usr/share/initramfs-tools/hook-functions +copy_exec /sbin/sysctl /sbin diff --git a/etc/initramfs-tools/scripts/init-bottom/sysctl-initramfs b/etc/initramfs-tools/scripts/init-bottom/sysctl-initramfs new file mode 100755 index 0000000..534d8a7 --- /dev/null +++ b/etc/initramfs-tools/scripts/init-bottom/sysctl-initramfs @@ -0,0 +1,18 @@ +#!/bin/sh + +## Copyright (C) 2012 - 2019 ENCRYPTED SUPPORT LP +## See the file COPYING for copying conditions. + +PREREQ="" +prereqs() +{ + echo "$PREREQ" +} +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +sysctl -p ${rootmnt}/etc/sysctl.d/*.conf