summaryrefslogtreecommitdiff
path: root/roles/install-grub/tasks/main.yml
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2020-05-26 21:49:18 +0300
committerzsdc <taras@vyos.io>2020-05-26 21:49:18 +0300
commit93879fe015cd9a60a94becd923c609376edf777d (patch)
tree70b14e66826515320bee99fc2f2b28613fdb3fb9 /roles/install-grub/tasks/main.yml
parente025218641378434864f73cf0b7354ce5b97c6a9 (diff)
downloadvyos-vm-images-93879fe015cd9a60a94becd923c609376edf777d.tar.gz
vyos-vm-images-93879fe015cd9a60a94becd923c609376edf777d.zip
Fixes for the images building process
- Fixed GRUB installation on UEFI hosts. On UEFI machines GRUB will try to install EFI version by default, so we need to set `--target` on i386-pc version too; - Fixed /dev/mapper devices unmounting, removing, and loopback detach. `kpartx -d` does not detach devices from `/dev/mapper` at least in a testing environment (Debian Buster inside Docker). That why we need to run `dmsetup remove` directly for this. The same with a loopback device. If not do this, resources will be busy and all builds except the first one may fail; - Deleted hybrid MBR creating task. It has a wrong syntax and does not work, and it looks like it is needless anyway.
Diffstat (limited to 'roles/install-grub/tasks/main.yml')
-rw-r--r--roles/install-grub/tasks/main.yml4
1 files changed, 1 insertions, 3 deletions
diff --git a/roles/install-grub/tasks/main.yml b/roles/install-grub/tasks/main.yml
index f9cc772..a711b5e 100644
--- a/roles/install-grub/tasks/main.yml
+++ b/roles/install-grub/tasks/main.yml
@@ -1,4 +1,3 @@
-
- name: Create GRUB directory
become: true
file:
@@ -19,7 +18,6 @@
args:
warn: no
-
- name: Mount EFI
mount:
src: "{{ vyos_target_drive }}p2"
@@ -29,7 +27,7 @@
- name: Install GRUB in the boot sector of {{ vyos_target_drive }}
become: true
- command: "chroot {{ vyos_install_root }} grub-install --no-floppy --root-directory=/boot {{ vyos_grub_drive }} --force"
+ command: "chroot {{ vyos_install_root }} grub-install --no-floppy --target=i386-pc --root-directory=/boot {{ loop_device.stdout }} --force"
args:
creates: "{{ vyos_install_root }}/boot/grub/grubenv"