
The original image-builder approach had an entirely containerized approach for building target images. This approach was flawed because: 1. There are a number of debian packages which will not install without /sys, /proc, /dev, or /dev/pts mountpoints, and 2. Container build process does not support building with privileges needed to bind-mount these directories into the chroot build space 3. It is a requirement for all packages to be installed in the container image in order to avoid deployment risk of missing mirror resources This patchset addresses this problem by performing necessary privileged steps outside of a containerized build process. At the end of this process, the root filesystem is packaged into a docker container when elevated permissions are no longer required. Change-Id: I5f8dc972f67c5649bf5f9403a5a512d06c948720
61 lines
1.7 KiB
YAML
61 lines
1.7 KiB
YAML
- name: "ISO | Reduce image size"
|
|
file:
|
|
state: absent
|
|
path: "{{ root_image }}/lib"
|
|
- name: "ISO | Reduce image size"
|
|
file:
|
|
state: absent
|
|
path: "{{ root_image }}/usr"
|
|
- name: "ISO | Reduce image size"
|
|
file:
|
|
state: absent
|
|
path: "{{ root_image }}/bin"
|
|
- name: "ISO | Reduce image size"
|
|
file:
|
|
state: absent
|
|
path: "{{ root_image }}/sbin"
|
|
- name: "ISO | Reduce image size"
|
|
file:
|
|
state: absent
|
|
path: "{{ root_image }}/var"
|
|
- name: "ISO | Reduce image size"
|
|
file:
|
|
state: absent
|
|
path: "{{ root_image }}/opt"
|
|
|
|
- name: "ISO | Ensure any old iso image at target location is removed"
|
|
file:
|
|
state: absent
|
|
path: "{{ img_output_dir }}/{{ img_name }}"
|
|
|
|
- name: "ISO | Ensuring {{ img_output_dir }} directory exists"
|
|
file:
|
|
path: "{{ img_output_dir }}"
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: "ISO | Writing ISO with xorriso"
|
|
shell:
|
|
cmd: |
|
|
xorriso \
|
|
-as mkisofs \
|
|
-iso-level 3 \
|
|
-full-iso9660-filenames \
|
|
-volid "config-2" \
|
|
-eltorito-boot boot/grub/bios.img \
|
|
-no-emul-boot \
|
|
-boot-load-size 4 \
|
|
-boot-info-table \
|
|
--eltorito-catalog boot/grub/boot.cat \
|
|
--grub2-boot-info \
|
|
--grub2-mbr /usr/lib/grub/i386-pc/boot_hybrid.img \
|
|
-eltorito-alt-boot \
|
|
-e EFI/efiboot.img \
|
|
-no-emul-boot \
|
|
-append_partition 2 0xef {{ root_image }}/boot/grub/efiboot.img \
|
|
-output {{ img_output_dir }}/{{ img_name }} \
|
|
-graft-points \
|
|
{{ root_image }} \
|
|
/boot/grub/bios.img={{ root_image }}/boot/grub/bios.img \
|
|
/EFI/efiboot.img={{ root_image }}/boot/grub/efiboot.img
|