diff options
| author | Yuya Kusakabe <yuya.kusakabe@gmail.com> | 2022-03-16 15:49:07 +0900 |
|---|---|---|
| committer | Yuya Kusakabe <yuya.kusakabe@gmail.com> | 2022-03-16 15:49:07 +0900 |
| commit | d6532ad9f6d6317ec3a235148fb4458ec45bb419 (patch) | |
| tree | 58d89bb59f47b799a979985c4b203819e22a637a | |
| parent | ad998a841d5679a5fb7040f9bfd380e30571dc37 (diff) | |
| download | vyos-vm-images-d6532ad9f6d6317ec3a235148fb4458ec45bb419.tar.gz vyos-vm-images-d6532ad9f6d6317ec3a235148fb4458ec45bb419.zip | |
T4278: Use overlayfs instead of aufs
| -rw-r--r-- | roles/install-grub/tasks/main.yml | 2 | ||||
| -rw-r--r-- | roles/install-packages/tasks/main.yml | 5 | ||||
| -rw-r--r-- | roles/mount-iso/tasks/main.yml | 2 | ||||
| -rw-r--r-- | roles/mount-root-fs/tasks/main.yml | 32 | ||||
| -rw-r--r-- | roles/setup-root-partition/tasks/main.yml | 1 |
5 files changed, 34 insertions, 8 deletions
diff --git a/roles/install-grub/tasks/main.yml b/roles/install-grub/tasks/main.yml index 608d002..75de819 100644 --- a/roles/install-grub/tasks/main.yml +++ b/roles/install-grub/tasks/main.yml @@ -31,6 +31,7 @@ path: "{{ vyos_install_root }}/boot/efi" fstype: vfat state: mounted + boot: no when: partition_num_efi is defined - name: Install GRUB in the boot sector of {{ vyos_target_drive }} @@ -60,4 +61,5 @@ path: "{{ vyos_install_root }}/boot/efi" fstype: vfat state: absent + boot: no when: partition_num_efi is defined diff --git a/roles/install-packages/tasks/main.yml b/roles/install-packages/tasks/main.yml index deaf215..6e157dd 100644 --- a/roles/install-packages/tasks/main.yml +++ b/roles/install-packages/tasks/main.yml @@ -9,13 +9,12 @@ - e2fsprogs - gnupg - qemu-utils - - python-lxml - - aufs-tools + - python3-lxml - grub-efi-amd64 - grub-efi-amd64-bin - grub-common - isolinux - - python-requests + - python3-requests - rsync - unzip - zlib1g-dev diff --git a/roles/mount-iso/tasks/main.yml b/roles/mount-iso/tasks/main.yml index 6e6b09d..6439b15 100644 --- a/roles/mount-iso/tasks/main.yml +++ b/roles/mount-iso/tasks/main.yml @@ -6,6 +6,7 @@ fstype: iso9660 opts: loop,ro state: mounted + boot: no - name: Verify checksums of all the files in the ISO image command: md5sum -c md5sum.txt @@ -21,3 +22,4 @@ fstype: squashfs opts: loop,ro state: mounted + boot: no diff --git a/roles/mount-root-fs/tasks/main.yml b/roles/mount-root-fs/tasks/main.yml index 67d036d..a29dead 100644 --- a/roles/mount-root-fs/tasks/main.yml +++ b/roles/mount-root-fs/tasks/main.yml @@ -1,17 +1,39 @@ - name: Mount squashfs image from root partition become: true mount: - name: "{{ vyos_read_root }}" + path: "{{ vyos_read_root }}" src: "{{ vyos_write_root }}/boot/{{ vyos_version }}/{{ vyos_version }}.squashfs" fstype: squashfs opts: loop,ro state: mounted + boot: no + +- name: Set rw directory for overlayfs + set_fact: + vyos_rw_dir: "{{ vyos_write_root }}/boot/{{ vyos_version }}/rw" + +- name: Create a rw directory if it does not exist + file: + path: "{{ vyos_rw_dir }}" + state: directory + mode: '0755' + +- name: Set work directory for overlayfs + set_fact: + vyos_work_dir: "{{ vyos_write_root }}/boot/{{ vyos_version }}/work" + +- name: Create a work directory if it does not exist + file: + path: "{{ vyos_work_dir }}" + state: directory + mode: '0755' - name: Set up union root for post installation tasks become: true mount: - name: "{{ vyos_install_root }}" - src: none - fstype: aufs - opts: "noatime,dirs={{ vyos_write_root }}/boot/{{ vyos_version }}/rw=rw:{{ vyos_read_root }}=rr" + path: "{{ vyos_install_root }}" + src: overlay + fstype: overlay + opts: "noatime,upperdir={{ vyos_rw_dir }},lowerdir={{ vyos_read_root }},workdir={{ vyos_work_dir }}" state: mounted + boot: no diff --git a/roles/setup-root-partition/tasks/main.yml b/roles/setup-root-partition/tasks/main.yml index 436b2c5..cc832e7 100644 --- a/roles/setup-root-partition/tasks/main.yml +++ b/roles/setup-root-partition/tasks/main.yml @@ -71,3 +71,4 @@ fstype: "{{ vyos_root_fstype }}" state: mounted opts: discard + boot: no |
