From 092c7e70d147cabefeb1f172dcf51f913ff268e6 Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Thu, 24 Dec 2020 13:48:46 -0500 Subject: [PATCH] upgrades: Allow grub-pc upgrade without reinstalling grub Signed-off-by: James Valleroy Reviewed-by: Sunil Mohan Adapa --- actions/upgrades | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/actions/upgrades b/actions/upgrades index 2a2570ec0..ee278845d 100755 --- a/actions/upgrades +++ b/actions/upgrades @@ -11,7 +11,8 @@ import re import subprocess import sys -from plinth.action_utils import apt_hold, run_apt_command, service_restart +from plinth.action_utils import (apt_hold, debconf_set_selections, + run_apt_command, service_restart) from plinth.modules.apache.components import check_url from plinth.modules.upgrades import (BACKPORTS_SOURCES_LIST, SOURCES_LIST, get_current_release, is_backports_current) @@ -392,7 +393,12 @@ def _perform_dist_upgrade(): run_apt_command(['install', 'base-files']) run_apt_command(['install', 'unattended-upgrades']) - print('Running unattended-upgrade...') + # Tell grub-pc to continue without installing grub again. + print('Set grub-pc to not require re-installing grub...', flush=True) + debconf_set_selections( + ['grub-pc grub-pc/install_devices_empty boolean true']) + + print('Running unattended-upgrade...', flush=True) subprocess.run(['unattended-upgrade', '--verbose']) # Remove obsolete packages that may prevent other packages from