summaryrefslogtreecommitdiff
path: root/roles/unmount-all
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/unmount-all
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/unmount-all')
-rw-r--r--roles/unmount-all/tasks/main.yml11
1 files changed, 9 insertions, 2 deletions
diff --git a/roles/unmount-all/tasks/main.yml b/roles/unmount-all/tasks/main.yml
index 98d4cdd..24dfc8c 100644
--- a/roles/unmount-all/tasks/main.yml
+++ b/roles/unmount-all/tasks/main.yml
@@ -36,14 +36,21 @@
become: true
mount:
name: "{{ vyos_write_root }}"
- src: "{{ vyos_target_drive }}"
- fstype: "{{ vyos_root_fstype }}"
state: absent
- name: Remove image partitions
become: true
command: "kpartx -dv {{ vyos_raw_img }}"
+- name: Remove /dev/mapper entries
+ become: true
+ command: "dmsetup remove {{ item }}"
+ with_items: "{{ loop_partitions.stdout_lines }}"
+
+- name: Detach {{ loop_device.stdout }}
+ become: true
+ command: "losetup -d {{ loop_device.stdout }}"
+
- name: Unmount {{ vyos_cd_squash_root }}
become: true
mount: