#!/bin/bash set -e case "$1" in configure) # This package replaces /etc/grub.d/10_linux and so # this removes the executable bit if [ -x /etc/grub.d/10_linux ]; then chmod -x /etc/grub.d/10_linux fi # Update grub to apply above changes if [ -e /boot/grub/grub.cfg ] && which update-grub >/dev/null 2>&1; then update-grub fi # If refind is installed or a configuration for refind # exists, let's add a lowlatency entry (threadirqs) if [ -e /boot/refind_linux.conf ]; then if ! grep -qi 'lowlatency' /boot/refind_linux.conf; then _rootUuid=$(lsblk -no UUID "$(df -P / | awk 'END{print $1}')"); _refindWrite="\"Boot with lowlatency options\" \"root=UUID=${_rootUuid} ro quiet splash threadirqs vt.handoff=1\""; sed -i "1i ${_refindWrite}" /boot/refind_linux.conf; fi # Ensure lastest lowlatency kernel is the default for refind, based on timestamp _lowLatencyKernels=(/boot/vmlinuz-*-lowlatency) touch "${_lowLatencyKernels[-1]}" fi ;; esac # Tag to allow some debhelper commands to inject relevant code