Skip to content

Commit

Permalink
Merge pull request #2643 from mcbridematt/t5828-grub-arm64-fix
Browse files Browse the repository at this point in the history
T5828: fix grub installation on arm64-efi machines
  • Loading branch information
dmbaturin authored Dec 19, 2023
2 parents b873112 + 37bd574 commit ac170ee
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions python/vyos/system/grub.py
Original file line number Diff line number Diff line change
@@ -13,6 +13,8 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.

import platform

from pathlib import Path
from re import MULTILINE, compile as re_compile
from typing import Union
@@ -57,16 +59,22 @@ def install(drive_path: str, boot_dir: str, efi_dir: str, id: str = 'VyOS') -> N
boot_dir (str): a path to '/boot' directory
efi_dir (str): a path to '/boot/efi' directory
"""
commands: list[str] = [
f'grub-install --no-floppy --target=i386-pc --boot-directory={boot_dir} \
{drive_path} --force',
f'grub-install --no-floppy --recheck --target=x86_64-efi \

efi_installation_arch = "x86_64"
if platform.machine() == "aarch64":
efi_installation_arch = "arm64"
elif platform.machine() == "x86_64":
cmd(
f'grub-install --no-floppy --target=i386-pc \
--boot-directory={boot_dir} {drive_path} --force'
)

cmd(
f'grub-install --no-floppy --recheck --target={efi_installation_arch}-efi \
--force-extra-removable --boot-directory={boot_dir} \
--efi-directory={efi_dir} --bootloader-id="{id}" \
--no-uefi-secure-boot'
]
for command in commands:
cmd(command)
)


def gen_version_uuid(version_name: str) -> str:

0 comments on commit ac170ee

Please sign in to comment.