From c8826d6702ebaf280994effb22aea39b4cfd2dac Mon Sep 17 00:00:00 2001 From: madaidan <50278627+madaidan@users.noreply.github.com> Date: Sat, 21 Mar 2020 17:15:25 +0000 Subject: [PATCH] Fix sysctl-initramfs logs --- etc/initramfs-tools/scripts/init-bottom/sysctl-initramfs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etc/initramfs-tools/scripts/init-bottom/sysctl-initramfs b/etc/initramfs-tools/scripts/init-bottom/sysctl-initramfs index 6912637..31b7759 100755 --- a/etc/initramfs-tools/scripts/init-bottom/sysctl-initramfs +++ b/etc/initramfs-tools/scripts/init-bottom/sysctl-initramfs @@ -15,8 +15,11 @@ prereqs) ;; esac +## ${rootmnt} is mounted read-only in the initramfs so it needs to be remounted first. +mount -o remount,rw "${rootmnt}" sysctl -p ${rootmnt}/etc/sysctl.conf >/dev/null 2>${rootmnt}/var/log/sysctl-initramfs-error.log sysctl -p ${rootmnt}/etc/sysctl.d/*.conf >/dev/null 2>>${rootmnt}/var/log/sysctl-initramfs-error.log -grep -v "unprivileged_userfaultfd" /var/log/sysctl-initramfs-error.log +mount -o remount,ro "${rootmnt}" +grep -v "unprivileged_userfaultfd" "${rootmnt}/var/log/sysctl-initramfs-error.log" true