diff options
author | Max Ammann <max@maxammann.org> | 2024-02-14 15:55:32 +0000 |
---|---|---|
committer | Max Ammann <max@maxammann.org> | 2024-02-14 15:55:32 +0000 |
commit | 1b84448be3534ed9d15a945560b16626f48113d5 (patch) | |
tree | 64bc474bee5fdbf944ae5c7e2384905c63a5b1e1 /afl-persistent-config | |
parent | 61ceef64b10cc8da0bba79c3f97ae223d2095fc5 (diff) | |
download | afl++-1b84448be3534ed9d15a945560b16626f48113d5.tar.gz |
afl-persistent-config: Use GRUB_CMDLINE_LINUX instead of GRUB_CMDLINE_LINUX_DEFAULT.
The latter is often overwritten in images used in cloud setups. For example DigitalOcean sets GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0" in /etc/default/grub.d/
Diffstat (limited to 'afl-persistent-config')
-rwxr-xr-x | afl-persistent-config | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/afl-persistent-config b/afl-persistent-config index d1649468..ef1c9da2 100755 --- a/afl-persistent-config +++ b/afl-persistent-config @@ -124,14 +124,14 @@ kernel.sched_latency_ns=250000000 EOF } - grep -E -q '^GRUB_CMDLINE_LINUX_DEFAULT=' /etc/default/grub 2>/dev/null || echo Error: /etc/default/grub with GRUB_CMDLINE_LINUX_DEFAULT is not present, cannot set boot options - grep -E -q '^GRUB_CMDLINE_LINUX_DEFAULT=' /etc/default/grub 2>/dev/null && { - grep -E '^GRUB_CMDLINE_LINUX_DEFAULT=' /etc/default/grub | grep -E -q 'noibrs pcid nopti' || { + grep -E -q '^GRUB_CMDLINE_LINUX=' /etc/default/grub 2>/dev/null || echo Error: /etc/default/grub with GRUB_CMDLINE_LINUX is not present, cannot set boot options + grep -E -q '^GRUB_CMDLINE_LINUX=' /etc/default/grub 2>/dev/null && { + grep -E '^GRUB_CMDLINE_LINUX=' /etc/default/grub | grep -E -q 'noibrs pcid nopti' || { echo "Configuring performance boot options" - LINE=`grep -E '^GRUB_CMDLINE_LINUX_DEFAULT=' /etc/default/grub | sed 's/^GRUB_CMDLINE_LINUX_DEFAULT=//' | tr -d '"'` + LINE=`grep -E '^GRUB_CMDLINE_LINUX=' /etc/default/grub | sed 's/^GRUB_CMDLINE_LINUX=//' | tr -d '"'` OPTIONS="$LINE ibpb=off ibrs=off kpti=off l1tf=off spec_rstack_overflow=off mds=off no_stf_barrier noibpb noibrs pcid nopti nospec_store_bypass_disable nospectre_v1 nospectre_v2 pcid=on pti=off spec_store_bypass_disable=off spectre_v2=off stf_barrier=off srbds=off noexec=off noexec32=off tsx=on tsx=on tsx_async_abort=off mitigations=off audit=0 hardened_usercopy=off ssbd=force-off" - echo Setting boot options in /etc/default/grub to GRUB_CMDLINE_LINUX_DEFAULT=\"$OPTIONS\" - sed -i "s|^GRUB_CMDLINE_LINUX_DEFAULT=.*|GRUB_CMDLINE_LINUX_DEFAULT=\"$OPTIONS\"|" /etc/default/grub + echo Setting boot options in /etc/default/grub to GRUB_CMDLINE_LINUX=\"$OPTIONS\" + sed -i "s|^GRUB_CMDLINE_LINUX=.*|GRUB_CMDLINE_LINUX=\"$OPTIONS\"|" /etc/default/grub } } |