|
From: | Grabben D |
Subject: | Ability to specify root directory with grub-mkconfig command? |
Date: | Mon, 18 Sep 2023 16:43:52 +0000 |
After successfully building a OSTree system to a dedicated disk which is mounted in /mnt directory, the final rootfs looks like this:
$ ls /mnt
boot ostree
Generating bootloader to /mnt/boot/efi works as intended:
$ grub-install --target=x86_64-efi --efi-directory=/mnt/boot/efi --removable --boot-directory=/mnt/boot/efi/EFI --bootloader-id=archlinux /dev/sda1
However, generation of grub.cfg doesn't support switching root, because of this it generates boot entries which uses the disk of the parent system and not /mnt:
$ grub-mkconfig -o /mnt/boot/efi/EFI/grub/grub.cfg
Currently the only workaround is to mount: the OSTree system (/mnt/ostree/deploy/archlinux/deploy/*), bootloader (/mnt/boot), device nodes from parent (/dev /proc /sys) and use chroot to finalize generation of grub.cfg
Ability to use a different root as the reference point while generating grub.cfg would be tremendously useful to build OSTree systems and even when rescuing a regular installation which has a broken bootloader.
Would love to hear what you guys think about this
|
[Prev in Thread] | Current Thread | [Next in Thread] |