From a2a790a3369b2e498d349d900a274d45388a858a Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Tue, 16 Jan 2024 22:07:18 +0100 Subject: [PATCH] Use the old 10_sortix when upgrading without a new grub port. --- sysinstall/grub | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sysinstall/grub b/sysinstall/grub index 27afce28..29c22de3 100755 --- a/sysinstall/grub +++ b/sysinstall/grub @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2023 Jonas 'Sortie' Termansen. +# Copyright (c) 2023, 2024 Jonas 'Sortie' Termansen. # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -24,6 +24,14 @@ set -e +# If the new system root doesn't contain the grub port, use the old 10_sortix +# script instead since we're not upgrading to a new version of the bootloader. +if [ ! -e /sysmerge/etc/default/grub.d/10_sortix -a \ + -e /etc/default/grub.d/10_sortix ]; then + mkdir -p /sysmerge/etc/default/grub.d + cp /etc/default/grub.d/10_sortix /sysmerge/etc/default/grub.d/10_sortix +fi + # The old system has copied the new kernel and initrd files from /sysmerge/boot # to /boot/sysmerge and we need to configure grub to boot them. /sysmerge/etc/default/grub.d/10_sortix --sysmerge