././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4512393 diskimage_builder-3.42.0/0000775000175000017500000000000015201026275014065 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/.stestr.conf0000664000175000017500000000016015201026231016323 0ustar00zuulzuul[DEFAULT] test_path=./diskimage_builder/ group_regex=diskimage_builder.(tests|elements|block_device) top_dir=./ ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.305236 diskimage_builder-3.42.0/.zuul.d/0000775000175000017500000000000015201026275015364 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/.zuul.d/jobs.yaml0000664000175000017500000003247615201026231017211 0ustar00zuulzuul- job: name: dib-functests-base abstract: true parent: base run: playbooks/dib-functests/run.yaml post-run: playbooks/dib-functests/post.yaml timeout: 5400 required-projects: - openstack/diskimage-builder - openstack/requirements irrelevant-files: - ^.*\.rst$ - ^doc/.*$ - ^releasenotes/.*$ - job: name: dib-functests description: | This is the base set of stable tests parent: dib-functests-base nodeset: nodes: - name: nested-virt-debian-bookworm label: nested-virt-debian-bookworm vars: dib_functests: - containerfile/jammy-build-succeeds # Disabled until it gets updated to match the version being mirrored #- openeuler-minimal/22.03-LTS-build-succeeds # Image based tests - centos/9-stream-build-succeeds - centos/10-stream-build-succeeds # Containerfile based tests - almalinux-container/almalinux-9-build-succeeds - almalinux-container/almalinux-10-build-succeeds - rocky-container/rocky-9-build-succeeds - rocky-container/rocky-10-build-succeeds # NOTE(rpittau) Fedora 37 is EOL, disalbing this until we move to # Fedora 39 or more recent. #- fedora/build-succeeds # NOTE(ianw) 2022-08-02 : disabled due to upstream # checksum mismatches; see # https://bugzilla.suse.com/show_bug.cgi?id=1202041 # - opensuse/build-succeeds - ubuntu/focal-build-succeeds - ubuntu/jammy-build-succeeds - ubuntu/noble-build-succeeds - ubuntu/resolute-build-succeeds # NOTE(ianw) : these jobs are split to keep the build times a bit more # reasonable. - job: name: dib-functests-arm64-deb description: | ARM64 build tests (Debian-like distros) nodeset: debian-bookworm-arm64 parent: dib-functests-base vars: dib_functests: - ubuntu-minimal/focal-arm64-build-succeeds - ubuntu-minimal/jammy-arm64-build-succeeds - ubuntu-minimal/noble-arm64-build-succeeds - ubuntu-minimal/resolute-arm64-build-succeeds - debian-minimal/bullseye-arm64-build-succeeds - debian-minimal/bookworm-arm64-build-succeeds - job: name: dib-functests-arm64-rpm description: | ARM64 build tests (RPM-like distros) nodeset: debian-bookworm-arm64 parent: dib-functests-base vars: dib_functests: - almalinux-container/almalinux-9-aarch64-build-succeeds - almalinux-container/almalinux-10-aarch64-build-succeeds - centos-minimal/9-stream-aarch64-build-succeeds - centos-minimal/10-stream-aarch64-build-succeeds # Disabled until it gets updated to match the version being mirrored #- openeuler-minimal/22.03-LTS-build-succeeds - rocky-container/rocky-9-aarch64-build-succeeds - rocky-container/rocky-10-aarch64-build-succeeds # # Build and boot functional tests # - job: name: dib-devstack-functional-src-base abstract: true description: | Base job for DIB functional tests, which build and boot an image under devstack, using source versions of dependencies such as devstack, dib (of course) and glean. parent: devstack pre-run: playbooks/dib-devstack/pre.yaml run: playbooks/dib-devstack/build-boot-run.yaml required-projects: - name: opendev.org/openstack/devstack - name: opendev.org/openstack/diskimage-builder - name: opendev.org/opendev/glean - name: opendev.org/openstack/requirements irrelevant-files: - ^.*\.rst$ - ^doc/.*$ - ^releasenotes/.*$ vars: default_elements: - vm - simple-init - growroot - devuser - openssh-server - journal-to-console - openstack-ci-mirrors build_diskimage_image_name: "{{ diskimage.base_element }}" build_diskimage_formats: - raw build_diskimage_image_root: "{{ ansible_user_dir }}/dib_tmp/dib-images" build_diskimage_elements: >- {{ ( [diskimage.base_element] + default_elements + diskimage.additional_elements|default([]) ) | flatten }} default_diskimage_environment: DIB_CHECKSUM: '1' DIB_DEBUG_TRACE: 1 DIB_INSTALLTYPE_simple_init: 'repo' DIB_REPOLOCATION_glean: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/opendev/glean'].src_dir }}" DIB_REPOREF_glean: "{{ zuul.projects['opendev.org/opendev/glean'].checkout }}" DIB_RELEASE: "{{ diskimage.release }}" DIB_SHOW_IMAGE_USAGE: '1' ROOT_LABEL: 'gate-rootfs' TMPDIR: "{{ ansible_user_dir }}/dib_tmp" build_diskimage_environment: "{{ default_diskimage_environment|combine(diskimage['env-vars']|default({})) }}" # NOTE(tonyb): For the time being we need to disable this as the cli-server always uses the # 'devstack-admin' cloud and therefore the private network ends in the wrong # tennant and causes failures devstack_services: openstack-cli-server: false devstack_localrc: SWIFT_MAX_FILE_SIZE: 5368709122 # 5G + 2 bytes (swift default) SWIFT_LOOPBACK_DISK_SIZE: "6G" # Alittle more than ^^ - job: name: dib-devstack-functional-openstack-almalinux-8-containerfile-src description: | Test building and booting a AlmaLinux image from a containerfile with devstack and OpenStack (from git) parent: dib-devstack-functional-src-base vars: diskimage: base_element: almalinux-container release: '8' - job: name: dib-devstack-functional-openstack-almalinux-9-containerfile-src description: | Test building and booting a AlmaLinux image from a containerfile with devstack and OpenStack (using released libraries) parent: dib-devstack-functional-src-base vars: diskimage: base_element: almalinux-container release: '9' - job: name: dib-devstack-functional-openstack-almalinux-10-v2-containerfile-src description: | Test building and booting a AlmaLinux image from a containerfile with devstack and OpenStack (using released libraries) parent: dib-devstack-functional-src-base vars: diskimage: base_element: almalinux-container env-vars: DIB_CONTAINERFILE_BUILDOPTS: "--platform linux/amd64/v2" release: '10' - job: name: dib-devstack-functional-openstack-centos-8-stream-src description: | Test building and booting a Centos 8 Stream image with devstack and OpenStack. parent: dib-devstack-functional-src-base vars: diskimage: base_element: centos-minimal release: '8-stream' - job: name: dib-devstack-functional-openstack-centos-9-stream-src description: | Test building and booting a Centos 9 Stream image with devsatck and OpenStack. parent: dib-devstack-functional-src-base vars: diskimage: base_element: centos-minimal release: '9-stream' - job: name: dib-devstack-functional-openstack-centos-10-stream-src description: | Test building and booting a Centos 10 Stream image with devstack and OpenStack. nodeset: nodes: - name: controller label: nested-virt-ubuntu-noble parent: dib-devstack-functional-src-base vars: diskimage: base_element: centos-minimal release: '10-stream' devstack_localrc: LIBVIRT_CPU_MODE: custom LIBVIRT_CPU_MODEL: Haswell - job: name: dib-devstack-functional-openstack-fedora-37-containerfile-src description: | Test building and booting an Fedora image from a containerfile with devstack and OpenStack (using released libraries) parent: dib-devstack-functional-src-base vars: diskimage: base_element : fedora-container release: '37' - job: name: dib-devstack-functional-openstack-rockylinux-8-containerfile-src description: | Test building and booting a Rocky Linux image from a containerfile with devstack and OpenStack (using released libraries) parent: dib-devstack-functional-src-base vars: diskimage: base_element: rocky-container release: '8' - job: name: dib-devstack-functional-openstack-rockylinux-9-containerfile-src description: | Test building and booting a Rocky Linux image from a containerfile with devstack and OpenStack (using released libraries) parent: dib-devstack-functional-src-base vars: diskimage: base_element: rocky-container release: '9' - job: name: dib-devstack-functional-openstack-rockylinux-10-containerfile-src description: | Test building and booting a Rocky Linux image from a containerfile with Nodepool and OpenStack (using released libraries) nodeset: nodes: - name: controller label: nested-virt-ubuntu-noble parent: dib-devstack-functional-src-base vars: diskimage: base_element: rocky-container release: '10' devstack_localrc: LIBVIRT_CPU_MODE: custom LIBVIRT_CPU_MODEL: Haswell - job: name: dib-devstack-functional-openstack-ubuntu-focal-src description: | Test building and booting an Ubuntu focal image with devstack and OpenStack parent: dib-devstack-functional-src-base vars: diskimage: base_element: ubuntu-minimal release: 'focal' env-vars: DIB_APT_LOCAL_CACHE: '0' DIB_DISABLE_APT_CLEANUP: '1' DIB_DEBOOTSTRAP_EXTRA_ARGS: '--no-check-gpg' DIB_DISTRIBUTION_MIRROR: "http://{{ zuul_site_mirror_fqdn }}/ubuntu" - job: name: dib-devstack-functional-openstack-ubuntu-jammy-src description: | Test building and booting an Ubuntu jammy image with devstack and OpenStack parent: dib-devstack-functional-src-base vars: diskimage: base_element: ubuntu-minimal release: 'jammy' env-vars: DIB_APT_LOCAL_CACHE: '0' DIB_DISABLE_APT_CLEANUP: '1' DIB_DEBOOTSTRAP_EXTRA_ARGS: '--no-check-gpg' DIB_DISTRIBUTION_MIRROR: "http://{{ zuul_site_mirror_fqdn }}/ubuntu" - job: name: dib-devstack-functional-openstack-ubuntu-noble-src description: | Test building and booting Ubuntu Noble with devstack. parent: dib-devstack-functional-src-base vars: diskimage: base_element: ubuntu-minimal release: 'noble' env-vars: DIB_APT_LOCAL_CACHE: '0' DIB_DISABLE_APT_CLEANUP: '1' DIB_DEBOOTSTRAP_EXTRA_ARGS: '--no-check-gpg' DIB_DISTRIBUTION_MIRROR: "http://{{ zuul_site_mirror_fqdn }}/ubuntu" - job: name: dib-devstack-functional-openstack-ubuntu-resolute-src description: | Test building and booting Ubuntu Resolute with devstack. parent: dib-devstack-functional-src-base vars: # TODO(mnasiadka): Remove when Resolute is mirrored within OpenDev default_elements: - vm - simple-init - growroot - devuser - openssh-server - journal-to-console diskimage: base_element: ubuntu-minimal release: 'resolute' env-vars: DIB_APT_LOCAL_CACHE: '0' DIB_DISABLE_APT_CLEANUP: '1' DIB_DEBOOTSTRAP_EXTRA_ARGS: '--no-check-gpg' - job: name: dib-devstack-functional-openstack-gentoo-src description: | Test building and booting a Gentoo image with devstack and OpenStack parent: dib-devstack-functional-src-base vars: diskimage: base_element: gentoo release: '' - job: name: dib-devstack-functional-openstack-debian-stretch-src description: | Test building and booting a Debian stretch image with devstack and OpenStack parent: dib-devstack-functional-src-base vars: diskimage: base_element: debian-minimal release: 'stretch' env-vars: DIB_APT_LOCAL_CACHE: '0' DIB_DISABLE_APT_CLEANUP: '1' DIB_DEBOOTSTRAP_EXTRA_ARGS: '--no-check-gpg' - job: name: dib-devstack-functional-openstack-debian-bullseye-src description: | Test building and booting a Debian bullseye image with devstack and OpenStack parent: dib-devstack-functional-src-base vars: diskimage: base_element: debian-minimal release: 'bullseye' env-vars: DIB_APT_LOCAL_CACHE: '0' DIB_DISABLE_APT_CLEANUP: '1' DIB_DEBOOTSTRAP_EXTRA_ARGS: '--no-check-gpg' DIB_DISTRIBUTION_MIRROR: "http://{{ zuul_site_mirror_fqdn }}/debian" - job: name: dib-devstack-functional-openstack-debian-buster-src description: | Test building and booting a Debian buster image with devstack and OpenStack parent: dib-devstack-functional-src-base vars: diskimage: base_element: debian-minimal release: 'buster' env-vars: DIB_APT_LOCAL_CACHE: '0' DIB_DISABLE_APT_CLEANUP: '1' DIB_DEBOOTSTRAP_EXTRA_ARGS: '--no-check-gpg' - job: name: dib-devstack-functional-openstack-opensuse-15-src description: | Test building and booting an openSUSE 15.x image with devstack and OpenStack parent: dib-devstack-functional-src-base vars: diskimage: base_element: opensuse-minimal release: '15.2' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/.zuul.d/project.yaml0000664000175000017500000001030015201026231017700 0ustar00zuulzuul- project: templates: - openstack-cover-jobs - check-requirements - release-notes-jobs-python3 check: jobs: - openstack-tox-linters - tox-py38: nodeset: nodes: - name: ubuntu-focal label: ubuntu-focal - tox-py39: nodeset: nodes: - name: ubuntu-focal label: ubuntu-focal - tox-py310: nodeset: nodes: - name: ubuntu-jammy label: ubuntu-jammy - tox-py311: nodeset: nodes: - name: debian-bookworm label: debian-bookworm - tox-py312: nodeset: nodes: - name: ubuntu-noble label: ubuntu-noble - tox-py313: nodeset: nodes: - name: debian-trixie label: debian-trixie-8GB - dib-functests - opendev-buildset-registry - dib-devstack-functional-openstack-almalinux-8-containerfile-src: voting: false - dib-devstack-functional-openstack-almalinux-9-containerfile-src: voting: false - dib-devstack-functional-openstack-almalinux-10-v2-containerfile-src: voting: false - dib-devstack-functional-openstack-centos-9-stream-src - dib-devstack-functional-openstack-centos-10-stream-src: voting: false - dib-devstack-functional-openstack-rockylinux-8-containerfile-src: voting: false - dib-devstack-functional-openstack-rockylinux-9-containerfile-src: voting: false - dib-devstack-functional-openstack-rockylinux-10-containerfile-src: voting: false - dib-devstack-functional-openstack-ubuntu-focal-src - dib-devstack-functional-openstack-ubuntu-jammy-src - dib-devstack-functional-openstack-ubuntu-noble-src - dib-devstack-functional-openstack-ubuntu-resolute-src # NOTE(ianw): 2020-04-22 these have been out of the gate for a # while; promote to voting after some stability. - dib-devstack-functional-openstack-opensuse-15-src: voting: false - dib-devstack-functional-openstack-gentoo-src: voting: false - dib-devstack-functional-openstack-debian-bullseye-src: voting: false - ironic-python-agent-check-image-dib-centos9 # IPA job that builds AND validates an image via deployment - ipa-tempest-bios-ipmi-direct-src: voting: false check-arm64: jobs: - dib-functests-arm64-deb - dib-functests-arm64-rpm gate: jobs: - openstack-tox-linters - tox-py38: nodeset: nodes: - name: ubuntu-focal label: ubuntu-focal - tox-py39: nodeset: nodes: - name: ubuntu-focal label: ubuntu-focal - tox-py310: nodeset: nodes: - name: ubuntu-jammy label: ubuntu-jammy - tox-py311: nodeset: nodes: - name: debian-bookworm label: debian-bookworm - tox-py312: nodeset: nodes: - name: ubuntu-noble label: ubuntu-noble - tox-py313: nodeset: nodes: - name: debian-trixie label: debian-trixie-8GB - opendev-buildset-registry - nodepool-build-image-siblings - dib-devstack-functional-openstack-centos-9-stream-src - dib-devstack-functional-openstack-ubuntu-focal-src - dib-devstack-functional-openstack-ubuntu-jammy-src - dib-devstack-functional-openstack-ubuntu-noble-src - dib-functests - ironic-python-agent-check-image-dib-centos9 experimental: jobs: - opendev-buildset-registry - nodepool-build-image-siblings - dib-devstack-functional-openstack-debian-stretch-src - dib-devstack-functional-openstack-debian-buster-src ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658493.0 diskimage_builder-3.42.0/AUTHORS0000664000175000017500000003522615201026275015145 0ustar00zuulzuulAbel Lopez Adam Gandelman Adam Harwell Albin Vass Alex Schultz Alexander Gordeev Alexis Lee Alfredo Moralejo Amrith Kumar Ana Krivokapic Andreas Florath Andreas Florath Andreas Jaeger Andrei Nistor Andrey Shestakov Angel Noam Angus Salkeld Anshul Jain Antoine Musso Aparna Arata Notsu Arx Cruz Atsushi SAKAI Augustina Ragwitz AzherKhan Bartosz Bezak Ben Kero Ben Nemec Ben Nemec Benedikt Loeffler Bernard Cafarelli Birger J. Nordølum Bob Ball Bob Fournier Bruno Cornec Cady_Chen Cao Xuan Hoang Carlos Goncalves Chandan Kumar (raukadah) Charalampos Kominos Charalampos Kominos Chhavi Agarwal Chris Alfonso Chris Jones Chris Jones Chris Krelle Chris MacNaughton Christian Berendt Christian Berendt Christopher Stone Chuck Short Cian O'Driscoll Clark Boylan Clif Houck Clint Adams Clint Byrum Cody A.W. Somerville Coleman Corrigan Colleen Murphy Colleen Murphy Colleen Murphy Corey O'Brien Corey O'Brien Curt Moore Cédric Jeanneret Cédric Ollivier Damien Rannou Dan Prince Dan Radez Daniel Abad Daniel Bengtsson Daniel Pawlik Danni Shi Darragh Bailey Darragh Bailey Dave Hill Dave Thomas David Hill Denys Mischenko Derek Higgins Devananda van der Veen Dirk Mueller Dmitriy Rabotyagov Dmitriy Rabotyagov Dmitriy Rabotyagov Dmitry Tantsur Dmitry Tantsur Dmitry Tantsur Doug Goldstein Doug Hellmann Doug Szumski Dougal Matthews Dr. Jens Harbott Dustin J. Mitchell Eduardo Santos Emilien Macchi Endre Karlson Erik Berg Erno Kuvaja Erwan Velu Ethan Gafford Ettore Simone Evgeny Antyshev Fatih Degirmenci Felipe Alencastro Francois RIGAULT Frederic Lepied Frikin Evgenii Gabriele Cerami Gary Duan Gaëtan Trellu Ghe Rivero Ghe Rivero Ghe Rivero Ghe Rivero Giulio Fidente Gloria Gonéri Le Bouder Gonéri Le Bouder Gonéri Le Bouder Gregory Haynes Gregory Thiemonge Gwen Dawes Haomeng, Wang Harald JensÃ¥s HeroicHitesh Hervé Rousseau Hironori Shiina Hoang Trung Hieu Ian Wienand Igor Belikov Isaac Beckman Iury Gregory Melo Ferreira Ivan Anfimov Ivan Berezovskiy IvanBerezovskiy JUN JIE NAN JUNJIE NAN Jack Hodgkiss Jakub Darmach James Arendt James E. Blair James E. Blair James Polley James Slagle Jamie Lennox Jan Grant Jan Provaznik Jan Zerebecki Jane.zhang Jason Paroly Javier Pena Jay Faulkner Jay Faulkner Jeff Peeler Jeffrey Zhang Jens Harbott Jens Harbott Jeremy Stanley Jerry Zhao Jesse Keating Jesse Pretorius Jiri Stransky Joe Gordon Joel Capitao Joey D John L. Villalovos John L. Villalovos John Trowbridge Jon-Paul Sullivan Jonas Sticha Jonathan Brownell Juan Antonio Osorio Robles Juerg Haefliger Julia Kreger Junya Akahira K Jonathan Harker Kashyap Chamarthy Kevin Carter Kevin TIBI Kiall Mac Innes Kui Shi Lee Yarwood Lennart Regebro Lenny Verkhovsky Lin Tan Liu Qing Logan V Lon Hohberger Luca Lorenzetto Lucas Alvares Gomes Luigi Toscano Lukas Kranz Luong Anh Tuan Madhuri Kumari Maksim Malchuk Manuel Torrinha Marcin Juszkiewicz Marcin Juszkiewicz Marco Vaschetto Mark Goddard Mark Hamzy Mark McLoughlin Markos Chandras Martin André Martin André Mateusz Kowalski Mathieu GagneÌ� Mathieu Mitchell Matt Anson Matthew Farrellee Matthew Thode Michael Johnson Michael Kerrin Michael McCune Michael Still Michael Turek Michael Turek Michal Arbet Michal Nasiadka Michele Baldessari Mikhail S Medvedev Mohammed Naser Monty Taylor Moshe Levi NTTdocomo NTTdocomo-openstack Nam Nguyen Hoai Natal Ngétal Neil Hanlon Neil Hanlon Newell Jensen Nguyen Hung Phuong Nguyen Van Trung Nicholas Randon Nicolas Hicher Nikhil Manchanda Nir Magnezi Nisha Agarwal NoBodyCam Noam Angel Noam Angel Nuutti Hakala Oded Le'Sage Oliver Walsh Olivier Bourdon Om Kumar OndÅ™ej Nový Owen Jones Paul Belanger Pavlo Shchelokovskyy Pawel Konczalski Pedro Alvarez Perry Myers Peter Stachowski Pierre Crégut Pierre Riteau Pierre Riteau Pino Toscano Piotr Parczewski Quique Llorente Radoslaw Smigielski Rafael Folco Rafael Folco Rafal Lewandowski Ralf Haferkamp Ramakrishnan G Ramil Minishev Ricardo Carrillo Cruz Riccardo Pittau Richard Su Ripal Nathuji Robert Collins Robert Collins Robert Li Robert Myers Roman Gorshunov Roman Podoliaka RotanChen Rubén Cabrera Russell Sim Ryan Brady Ryan Hallisey Sagi Shnaidman Sam Betts Sam James Sam Yaple SamYaple Sandhya Ganapathy Sascha Peilicke Saverio Proto Serena Ziviani Shane Wang Shivanand Tendulker Simon Leinen Simon Westphahl Sorin Sbarnea Spencer Krum Stanislav Makar Stephen Mulcahy Steve Baker Steve Brasier Steve Kowalik Steven Dake Steven DuChene Stuart McLaren Sushil Kumar THOMAS J. COCOZZELLO Tadas Sutkaitis Takashi Kajinami Takashi Kajinami Thom Leggett Thomas Bechtold Thomas Goirand Tim Flink Tim Miller Tim Potter Tim Serong Tobias Henkel Tomas Hancock Tomas Sedovic Tony Breeds Trent Geerdes Tristan Cacqueray Tristan Cacqueray Uwe Grawert Van Hung Pham Vanou Ishii Victor Lowther Vipul Sabhaya Vu Cong Tuan Waldemar Znoinski Wesley Hayutin Will Szumski Xavier Coulon Xiang Chen XiaojueGuan Xinliang Liu Yanis Guenane Yolanda Robla Yolanda Robla Yolanda Robla Mota Your Name YuehuiLei YuikoTakada Yuriy Zveryanskyy Zhangfei Gao Zhao Lei Zhiguo Deng afazekas annumishra_17 aweiteka azvyagintsev caoyuan chengebj5238 chenxiangui chenxing chriskrelle d.marlin gecong1973 gengchc2 goldyfruit gugug iberezovskiy inspurericzhang jacky06 janonymous jgupta jodewey justin-hopper kaiokassiano lifeless likui liyingjun liyuanzhen loki mcreach melissaml nishagbkar nizam pengyuesheng sayalilunkad scrungus sjing smoshiur1237 stephane tanlin vmud213 waleedm wangqi wangxiyuan weiyj wjunlu wu.chunyang xhzhf yatin yatinkarel yogananth subramanian zhang.lei zhangboye zhangdebo zhangjian zhouxinyong zhufl ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658493.0 diskimage_builder-3.42.0/ChangeLog0000664000175000017500000034653615201026275015660 0ustar00zuulzuulCHANGES ======= 3.42.0 ------ * fix: add support for \`cloud-init\` in \`Ubuntu Resolute\` * Suppress warning from eventlet * Add support for building Ubuntu Resolute (26.04) * Remove unnecessary return statement 3.41.0 ------ * mellanox: remove qperf package from element * block\_device: remove cmp\_mount\_order * Add tox-py313 job * Fix issue with insecure HTTPS repository 3.40.2 ------ * Add devuser to the specified group(s) * Add support for HWE kernels for ubuntu 22.04+24.04 * Drop unnecessary \_\_future\_\_ import * Bump minimum python version to 3.8 * Declare Python 3.11/12 support * fix: add Debian stable to the same package rule as trixie 3.40.1 ------ * Drop remaining reference to TripleO * Fix openstack-ci-mirrors element for CentOS Stream * Fix RPM DB path for Centos 10 Stream 3.40.0 ------ * Fix GRUB arm64 package names * almalinux-container: Add support for building 10 * Remove testing for f37 * Remove nodepool based testing * root password for dynamic-login made simpler * Automatically accept "dnf mark" commands * feat: introduce new cloud-init service names * Drop unnecessary debian security location configuration switch * Drop remaining reference to TripleO * Drop Ubuntu Bionic and Older testing * Add support for DNF5-based systems * Add a sha256sum check for CentOS Cloud Images * Allow openSUSE Leap version 15.6 * Add a 5 second delay between cache update retries * Drop backports from debian-minimal by default * debian: software-properties-common isn't in testing * Retry git clone/fetch on errors * Remove mirror from experimental debian jobs * docs: clarify when debian-systemd makes sense 3.39.0 ------ * Add Rocky Linux 10 support to rocky-container element * Add support for CentOS Stream 10 * Disable nodepool testing * Add new openstack/devstack based functional testing * Fix debian-systemd element for non-root user * CI: Use opendevmirror/ubuntu for functests 3.38.0 ------ * bootloader: Fix searching for grub-mkconfig * Fix growvols multipath partition\_delimiter detect * Remove qemu-debootstrap from debootstrap element * Fix rhel/centos multipathing issues * Remove deprecated datetime.utcnow() * Make mellanox element depend on epel * CI: Add a tool for displaying CPU flags and QEMU version * rocky-container: use Quay.io instead of Docker Hub * [doc] Document expected environment for dib * Change grub variables for style and timeout * tox: Drop functest target from tox * Fix: Run final Gentoo tasks in post-install.d 3.37.0 ------ * Revert "dib-functests: run on bookworm" * Temporarily disable OpenEuler functional testing * Force grub2-install to bypass secureboot complaints * Fix pyyaml install for svc-map * Update default Ubuntu to noble (latest LTS) * Followup: Ensure devuser-created dir has sane perms * [gentoo] Fix+Update CI for 23.0 profile * Reapply "Make sure dnf won't autoremove packages that we explicitly installed" * Update Nodepool image location in docs * Remove the usage of pkg\_resource 3.36.0 ------ * Install glibc-langpack on centos as well * Reduce LVM extent usage * trivial: provide a little more context for disk size failures 3.35.0 ------ * Setup C.UTF-8 as a RPM install lang in yum-minimal * Remove vm element from container based image 3.34.0 ------ * Fall back to extract-image on ubuntu build * Drop logic for old python versions * Update functests * docs: add two contextual warnings to the replace-partition element * Fix hashbang of non-executed bash libs * Add block device rollback for lvm volumes and groups * New elements replace-partition(-redhat) * Add DIB\_SKIP\_BASE\_PACKAGE\_INSTALL to base element * Add DIB\_SKIP\_GRUB\_PACKAGE\_INSTALL for bootloader * Adapt to upstream CentOS Stream mirror changes * feat: Add new autoupdates element * 4k Block device support * Refactor selinux-fixfiles-restore into its own element * Change centos DIB\_RELEASE default to 9-stream * Not duplicate grub defaults * Upgrade curl-minimal for RHEL based images built from containers * Run functest jobs on bookworm * Add podman to bindep * Allow to override Fedora subrelease regexp * Fix regexp for Fedora element SUBRELEASE parsing * Add tox-py312 job for testing * Remove EOLed CentOS 7 and RHEL 7 * CentOS-7 EOL: remove jobs * bootloader: Strip prior console settings * minor ci: quick cleanup and remove centos8 * remove console entries when console is disabled * Provide an ability to disable serial console injection * dib-functests: run on bookworm * Disable Stream-8, non-vote FC 37, and assume yes on debian functest * Fix manifest element with non-root user * growvols, enforce pvcreate and overwrite old VG signature * Fix uninstall gentoo packages * Fix setting apt mirror for noble 3.33.0 ------ * simple-init: Swap continue for true * ConfigDrive: Disable cloud-init auto dhcp by default * Add tox-py311 job * Add Ubuntu 24.04 (noble) build to testing * Overwrite EFI grub.cfg when it exists * CI: Drop tripleo project template * fix(rocky): don't uninstall linux-firmware * feat: add almalinux-container element * Call grub2-mkconfig with --update-bls-cmdline * Cleanup uses of DIB\_IMAGE\_ROOT\_FS\_UUID variable * Bump upper version of flake8 * Fetch compatibile dnf download command in functest setup * Write fedora download redirect info to stderr * Fix various minor issues with Gentoo; make CI pass * Get rid of 3rd party mock 3.32.0 ------ * Replace OpenSUSE Leap 15.3 to OpenSUSE Leap 15.5 * Enable the no\_timer\_check option to be removable * gentoo: don't uninstall packages that aren't installed * Add san support to growvols * Fix small syntax issue * python3.12: "fix" unittests * rocky-container: Add installation of Minimal Install group * Add NetworkManager-config-server to rocky-container * allow passing arbitrary build options in containerfile element * feat: Add new fail2ban elemenent * Remove cloud-init when using simple-init * Stop creating default user for cloud-init * Fix indentation of output formats * Update bindep rules for Debuntu * Set grub timeout style * Refactor cloud-init element * Remove extra spaces from GRUB\_CMDLINE\_LINUX\_DEFAULT * Change default value of DIB\_DEBIAN\_ALT\_INIT\_PACKAGE 3.31.0 ------ * Fix and issue with wait\_for * Deprecate legacy deployment elements * growvols: reserve space for spare metadata volume * Install netplan.io for Debian Bookworm * Remove pre-bullseye release workaround * Fix baseurl for Fedora versions before 36 * Update the shebang to python3 * Extend the checksum files generation procedure * Append detailed printing information when exec\_sudo fails * Add nm-dhcp-ib-interfaces element * fedora: don't use CI mirrors 3.30.0 ------ * Fix openeuler-minimal mirror problem 3.29.0 ------ * Allow custom console=tty0 argument * fix ifupdown pkg map for dhcp-all-interfaces of redhat family * Update satellite\_repo labels + add env var * Rename openeuler mirror script * Check and grow the GPT structure to the end of the volume * Remove lower-constraints.txt 3.28.0 ------ * Fix jsonschema version to match lower-constraint * Fix openeuler mirror problem * Fix ubuntu-minimal to run autoremove * Add a FIPS element 3.27.0 ------ * Correct boot path to cover FIPS usage cases * Update Fedora to 37 * Removal focal pins for testing * Document diskimage-builder command * Switch run\_functests.sh from disk-image-create to diskimage-builder * A new diskimage-builder command for yaml image builds * chore: support building Fedora on arm64 AKA aarch64 * Add swap support * Fix double-keyed json * Repeat to umount filesystem when exception occurs 3.26.0 ------ * cache-url: Give up on curl install for Redhat platforms * Clean up tox.ini for tox v4 * Reduce thin pool by one more extent * Grow thin pool metadata by 1GiB * Add variable for check installing python3 in yum element * tox jobs: pin to correct nodesets; use host networking for containerfile * Fix issue in extract image * Added example configuration * Added cloud-init growpart element * Add Rocky 9 ARM64 functional test 3.25.0 ------ * Start running dib-lint again * Install Fedora ifcfg NM compat package * added elrepo element * changed release check logic in lvm element * Adds passwd to rocky-container os packages * Allow flake8 version 5 3.24.0 ------ * Support LVM thin provisioning * Add thin provisioning support to growvols 3.23.1 ------ * rocky : create machine-id in 9 * Allow setting ROOT\_LABEL from environment * Do dmsetup remove device in rollback * Fix wrong yum.conf name of CentOS 9 Stream 3.23.0 ------ * Add Rockylinux 9 build configuration and update jobs for 8 and 9 * Add subscription-manager repo names for RHEL-9 * Disable the opensuse functest * Upgrade openEuler to 22.03 LTS * rockylinux : create machine-id early * cache-url: turn off -x by default * opensuse: better report checksum errors * ubuntu: more exact match on squashfs file, containerfile: use focal * Allow Gentoo to manage python versions by itself * Parse block device lvm lvs size attributes * update default python for gentoo to 3.10 * Removing old grub removal step * Use internal dhcp client for centos 9-stream and beyond * Fix BLS entries for /boot partitions 3.22.0 ------ * Add Fedora 36 support * containerfile: warn if we don't have a Dockerfile * Add support for Python 3.10 * Revert "CentOS 9-stream : work around selinux permissions issue" * Fix backward regex match * Add a warning in satellite configuration * Use plain tox jobs instead of openstack ones * Stop using openstack upper constraints * CentOS 9-stream : work around selinux permissions issue * Revert "Remove py 3.6 support and update jobs" * Drop tumbleweed job * Remove py 3.6 support and update jobs * Check and mount boot volume for data extraction with nouuid * Fix openssl example command in dynamic-login * Fix grub setup on Gentoo * Adopted dkms element to work on Ubuntu Jammy and nvidia drivers * Switch to the CentOS 9 IPA job 3.21.1 ------ * Ensure cloud-init is configured to generated host keys * Add Jammy functesting to dib 3.21.0 ------ * Ensure passwd is installed on RH and derivatives * Revert "Temporarily stop running OpenSUSE functtests" * yum-minimal: workaround missing $releasedir variable * Temporarily stop running OpenSUSE functtests * Make centos reset-bls-entries behave the same as rhel * Switch to release-notes-jobs-python3 * Revert "Fallback to persistent netifs names with systemd" * Fix dhcp-all-interfaces on debuntu systems * centos: avoid head pipe failure * containerfile: update test to jammy * Add a job to test building jammy * Move reset-bls-entries to post-install * Set machine-id to uninitialized to trigger first boot * yum-minimal: clean up release package installs 3.20.3 ------ * source-repositories : use explicit sudo/-C args when in REPO\_DEST * Update gentoo python version to 3.9 3.20.2 ------ * CentOS Stream 9 has EPEL now * Add interpolation note for dynamic-login password * Move grub-install to the end, and skip for partition images * Use https for downloading ubuntu images 3.20.1 ------ * containerfile: Add support for setting network driver 3.20.0 ------ * Update fedora element testing to F35 * containerfile: add support for Docker * Handle btrfs root subvolume for fedora extract-image * Correctly create DIB\_ENV variable and dib\_environment file * Revert "Revert "Detect boot and EFI partitions in extract-image"" 3.19.1 ------ * Revert "Detect boot and EFI partitions in extract-image" * Force use of NetworkManager with glean on Rocky Linux * Detect boot and EFI partitions in extract-image 3.19.0 ------ * rhel: work around RHEL-9 BLS issues * bootloader: clean up EFI checking * Add rocky support to the epel element * bootloader: fix arm64 install path * update gpg / file verification for Gentoo * Remove OS CI mirror role from fedora(-minimal) tests * Update platform support to describe stable testing * Futher bootloader cleanups 3.18.0 ------ * Fallback to persistent netifs names with systemd * Revert "Use rpm -e instead of dnf for cleaning old kernels" * fedora-container: pull in glibc-langpack-en * Make growvols config path platform independent 3.17.0 ------ * Remove contrib/setup-gate-mirrors.sh * Cleanup more CentOS 8 bits * Remove CentOS-8 jobs * Add new container element - Rocky Linux * Add 9-stream ARM64 testing * Switch 9-stream testing to use opendev mirrors * centos: do not use $releasever in .repo files * Fix openSUSE images and bump them to 15.3 * debian-minimal: remove old testing targets * Add debian-bullseye-arm64 build test * dhcp-all-interfaces: opt let NetworkManager doit * Don't run functional tests on doc changes * General improvements to the ubuntu-minimal docs * Rename existing BLS entry with the new machine-id * Remove centos 9 and rhel 8 block in grub2 pkg-map * Fixes for centos-9-stream efi behaviour * Use https for base centos image download * Remove opensuse related funtests * Remove extra if/then/else construct in pip element * centos: work around 9-stream BLS issues * Avoid unbound variable error when installing pip * enable cloud-init by default on systemd * Fix failure in pip element * Install only python3 pip in debian bullseye * Use OpenDev mirrors for 8-stream CI builds * Test 8-stream aarch64 build * Document EFI elements requirements 3.16.0 ------ * Fix BLS based bootloader installation * Trivial: fix whitespace in ubuntu element rst * update gentoo source suffix (where it finds the file to download) * Allowing ubuntu element use local image * Added missing grubby arg DIB\_BOOTLOADER\_DEFAULT\_CMDLINE 3.15.2 ------ * source-repositories: don't use --git-dir * Replace deprecated assertEquals * Revert "centos 9-stream: make non-voting for mirror issues" 3.15.1 ------ * containerfile: handle errors better * containerfile: fix tar extraction * centos 9-stream: make non-voting for mirror issues 3.15.0 ------ * fedora-container: update to Fedora 35 * Add support for CentOS Stream 9 in DIB * dracut-regenerate: drop Python 2 packages * tests: remove debootstrap install * Add openEuler jobs back * Fix bootloader installation for gentoo * Switch ARM64 testing to bullseye 3.14.0 ------ * Update centos element for 9-stream * Run functional tests on Debian Bullseye * Simplify functests job * Remove extras job, put gentoo job in gate * functests: drop minimal tests in the gate * centos7 : drop functional testing * functests: drop apt-sources * ubuntu: add Focal test * ubuntu-systemd-container: deprecate and remove jobs * Revert "Allowing ubuntu element use local image" * epel: match replacement better * Remove py35 tox jobs * Update keylime-agent and tpm-emulator elements * Drop lower version requirement for networkx * Allowing ubuntu element use local image * Fix lower constraints * Add DIB\_YUM\_REPO\_PACKAGE as an alternative to DIB\_YUM\_REPO\_CONF * Add policycoreutils package mappings for RHEL/Centos 9 * RHEL/Centos 9 does not have package grub2-efi-x64-modules * Support grubby and the Bootloader Spec * Move grubenv to EFI dir * Fix debian-minimal security repos * Fix cron not installed in debian * Fix doc typo * yum-minimal: use DNF tools on host * Bump Ubuntu release to focal * Use non-greedy modifier for SUBRELEASE grep * Introduce openEuler distro * Fedora: bump DIB\_RELEASE to 34 * Permit specification of extra bootstrap packages 3.13.0 ------ * Update IRC networks * Add a keylime-agent element and a tpm-emulator element * Replace deprecated import of ABCs from collections * fedora-container: install dnf-plugins-core * Mount /sys RO * Add a growvols utility for growing LVM volumes * Migrate from testr to stestr * cache-url : turn down verbose curl * Add element block-device-efi-lvm 3.12.0 ------ * Do not uninstall non-installed packages * Remove octvia-v1-dsvm-\* jobs * Fix DISTRO\_NAME in Fedora elements * Add fedora-containerfile element * bootloader: remove extlinux/syslinux path * bootloader: disable BLS for Fedora * Auto find greatest Fedora cloud image sub-release * containerfile: automatically search for distro docker files * dib-lint: match text/x-script.python * Add containerfile element * setup.cfg: Replace dashes with underscores * Update the ironic jobs 3.11.0 ------ * debian-minimal: bullseye: /updates -> -security * debian-minimal: Set bullseye version * Collect openstack logs * Remove dib-nodepool-functional-openstack-ubuntu-bionic * Install pbr before glean to address SNI issues * dib-run-parts: stop leaving PROFILE\_DIR behind * Ensure redhat efi packages are reinstalled during finalise 3.10.0 ------ * Add Debian Bullseye Zuul job 3.9.0 ----- * Improved the documentation for DIB\_DNF\_MODULE\_STREAMS * Properly set grub2 root device when using efi * Make DIB\_DNF\_MODULE\_STREAMS part of yum element * Convert multi line if statement to case * Fix centos stream set mirror * Fix: IPA image buidling with OpenSuse * simple-init: support installing Glean from packages * simple-init: allow disabling DHCP fallback 3.8.0 ----- * update gentoo keywords to support gcc-10 * replace the link which is in the 06-hpdsa file * Only add rhel base repos when REG\_REPOS is not set * Support secure-boot bootloader where possible * Change get-pip url * Add aarch64 support for rhel * Add efibootmgr utility for UEFI boot menu management * Fix hooks order for CentOS/Fedora when mirror used * Don't use hardcode while override base image file * Fix installation of proliant tools * Change paths for bootloader files in iso element * Use the same bootloader pkg-map for all redhat family * Don't install centos-linux-release on 8-stream * Remove fedora-31 testing * Check and remove existing image interface configurations * Revert "Make sure dnf won't autoremove packages that we explicitly installed" 3.7.0 ----- * Set eus repositories if REG\_RELEASE is set * Install last stable version of get-pip.py script * simplify updating python versions in gentoo * Install epel-release from URL * Add 'DIB\_UBUNTU\_MIRROR\_DISTS' to ubuntu-minimal * Fix CentOS Stream 8 base repo in centos element * Remove the deprecated ironic-agent element 3.6.0 ----- * add missing packages for python reinstall on gentoo * Fix centos 8.3 partition image building error with element iscsi-boot * Fix building error with element dracut-regenerate * Enable dracut list installed modules * docs: fix wrong key in the lvm sample configuration 3.5.0 ----- * Remove centos-repos package for Centos 8.3 * Install git-core instead of git on RH systems 3.4.0 ----- * simple-init: also remove en\* interfaces from the images * Fix dynamic-login with grub2 * Run autoremove on post-install step * Fix python-stow-versions * Remove dib-block-device console entrypoint * Remove entry-point for element-info * Add support for vlan interfaces in dhcp-all-interfaces.sh * yum-minimal: Add centos-stream-repos package for centos-8-stream * Allow processing 'focal' ubuntu release in lvm * Remove the unused coding style modules * Add Python3 Wallaby unit tests * Ensure yum-utils is installed in epel element * Fix runtime error if DIB\_DNF\_MODULE\_STREAMS is not set * Disable growpart in cloud-init-disable-resizefs * Remove unused fedora-30 job * Test opensuse 15 builds with 15.2 * Remove install unnecessary package * Revert "Avoid disabling rhel-7-server-rh-common-rpms" 3.3.1 ----- * Rename duplicating 10-debian-minimal.bash 3.3.0 ----- * rhel-common: Provide method to select module streams * Install gzip instead of busybox-gzip on suse * Install grep before busybox on suse distros * bootloader: remove dangling grubenv links * Move centos python3 installation after RHEL subscription * Copy apt gpg keys directly into trusted.gpg.d * Make iscsi-boot element support centos 8 * update various gentoo bits * Don't remove packages that are requested to be installed 3.2.1 ----- * Revert "source-repositories: git is a build-only dependency" 3.2.0 ----- * update gentoo to allow building arm64 images * Makes EFI images bootable by bios * Fedora 32 support * Do not install python2 packages in ubuntu focal * Update name of ipa job * Handle NetworkManager for dhcp-all-interfaces * source-repositories: git is a build-only dependency * Add support for CentOS 8 Stream cloud image * Remove glance-registry * Deprecate dib-python; remove from in-tree elements * Pre-install python3 for CentOS * Update the tox minversion parameter * Adds gnupg2 for apt-keys in ubuntu-minimal * Support non-x86\_64 DIB\_DISTRIBUTION\_MIRROR variable for CentOS 7 * Fixes DIB\_IPA\_CERT certificate copy issue * add openrc init system support to serial console element * update gentoo-releng gpg key * Fix DIB scripts python version * Switch from unittest2 compat methods to Python 3.x methods * Install yum and yum-utils on Red Hat family hosts * Revert "Make ipa centos8 job non-voting" * Disable all enabled epel repos in CentOS8 * Make ipa centos8 job non-voting * add musl profile to gentoo * Download latest CentOS cloud image * Add support for CentOS 8 Stream 3.1.0 ----- * add more python selections to gentoo * update grub cmdline to current kernel parameters * Stop bringing the test environment into the mocks * Remove virtualenv activation * Add .eggs to gitignore * Switch to newer openstackdocstheme and reno versions * Use kpartx option to update partition mappings * Do not fail in a venv when activate\_this.py is not found * Fix yumdownloader cache dir * Update readme to clarify an ubuntu bionic image is built * Drop six usage * Cleanup py27 and docs support * Add back pep8 and tarball jobs 3.0.0 ----- * Drop support for python2 2.38.0 ------ * Prepare to drop Python 2 support 2.37.3 ------ * Revert "dib-lint: use yamllint to parse YAML files" * use stage3 instead of stage4 for gentoo builds * Pre-install xz package in opensuse chroot * Add dependency on yamllint 2.37.2 ------ * Revert "Revert "ubuntu-minimal : only install 16.04 HWE kernel on xenial"" * package-installs : allow a list of parameters * dib-lint: use yamllint to parse YAML files 2.37.1 ------ * Revert "ubuntu-minimal : only install 16.04 HWE kernel on xenial" 2.37.0 ------ * ubuntu-minimal: Add Ubuntu Focal test build * ubuntu-minimal : only install 16.04 HWE kernel on xenial * ubuntu-minimal: fix HWE install for focal * package-installs: allow when filter to be a list * Disable all repositories after attaching a pool * block device: update variable name * functests: use ensure-virtualenv 2.36.0 ------ * Add sibling container builds to experimental queue * Add a focal test * Restore SUSE tests to gate * Switch functional tests to containers * Bionic functional tests should be voting * pip-and-virtualenv : fix fedora 30 install * yum-minimal: strip env vars in chroot calls * Fix args to debuntu functional tests * Remove Trusty testing * pip-and-virtualenv: drop f31 & tumbleweed, rework suse 15 install * Remove Babel and any signs of translations * Add centos aarch64 tests * Do not try to use MBR on AArch64 * Make ipa centos8 dib job voting * opensuse: fix python 2.x install * Debuntu: add apt-transport-https * centos 8 image build: fix mirror * run\_functests: handle build without tar 2.35.0 ------ * Add Fedora 31 support and test jobs * Mellanox element: removed ibutils,libibcm,libmlx4-dev * Use rpm -e instead of dnf for cleaning old kernels * Add python-stow-versions element * Add support for build-only packages * bindep: remove lsb-release 2.34.1 ------ * Remove hacking from requirements 2.34.0 ------ * Add ensure-venv element, install glean with it * Remove Fedora 29 job * Do not include efibootmgr and efivars for ppc architectures * Change tgt pkg-map to target-restore CentOS/RHEL-8 * Uncap hacking * Add CentOS 8 support * fix iscsi-boot element exiting build even if dracut-regenerate used * Add efi packages for ironic-agent * Allow python3 to be used in Debian * Fix cache-url -f * Add ironic jobs to the CI * dib-lint: test elements have README.rst file * Enable possibility to select HWE kernel for Ubuntu minimal * Remove trusty jobs 2.33.0 ------ * Fix Yum repositories and GPG keys for CentOS 8.1 * allow building of Gentoo images for non-systemd profiles * modprobe.d: use $TMP\_MOUNT\_PATH * Add arm64 based functional test * Install rng-tools in Red Hat family distro images * Update bindep for RHEL/CentOS 8 2.32.0 ------ * Fix wrong URL in ironic-agent element * Set correct python version for non-chroot scripts * Work around Trusty ext4 metadata\_csum errors on Bionic * Drop Xenial from functional test 2.31.0 ------ * Fix regex for mirror URL substitution * Install ndisc6 package in element script * Make sure DIB\_DEBUG\_TRACE has a default value * Allow zypper repos to be overrideable * Fix login.defs config for tumbleweed * Break retry loop on success in dhcp-all-interfaces 2.30.0 ------ * Stop installing pydistutils.cfg * Update bindep.txt for some missing dependencies * Only wait for checksum processes * Introduce manual setting of DIB\_INIT\_SYSTEM * Add output for mis-configured element scripts * Add grub-efi-x86\_64 pkg-map * Add IPv6 support in dhcp-all-interfaces * Remove unused job * Adds support for GPG keyring * vhd-util : note on Xen/RAX images 2.29.1 ------ * Revert "Drop vhdutil dependency, use qemu-img" 2.29.0 ------ * Revert "Pause Fedora jobs" * Deprecates the existing "ironic-agent" element in DIB * pip-and-virtualenv: include python3-venv for Debuntu * Ensure nouveau is blacklisted in initramfs too * Pause Fedora jobs * Fix syntax error in selinux-fixfiles-restore * Drop vhdutil dependency, use qemu-img * Add security suite name override in debian-minimal 2.28.2 ------ 2.28.1 ------ * centos7; use numeric DIB\_RELEASE * Temporarily disable Fedora 30 build jobs * Remove RA solicit delay * Blacklist sphinx 2.1.0 (autodoc bug) 2.28.0 ------ * CentOS 8 minimal testing and support * Add NetworkManager and dhcp-client for CentOS 8 * Fix networking for CentOS 8 * simple-init: Use wrappers to call pip for glean install * simple-init: default to NetworkManager for CentOS and Fedora * bootloader: make serial console configurable * Add security mirror override for debian-minimal * pip-and-virtualenv : deprecate source for CentOS 8, new variables * yum-minimal: Don't install yum, install libcurl * Use $YUM instead of direct calls in more places * Add environment switch for centos8 to use dnf * Update redhat-common pkg-map for centos 8 * Update locales for Centos 8 * dib-python : handle centos 8 * yum-minimal : update mirrors for Centos 8 * Remove "failovermethod=priority" for Fedora (dnf) 2.27.2 ------ * Install Python 3 libselinux packages for Fedora * Ensure machine-id is not included in images * Update gentoo test to current system profile 2.27.1 ------ * Revert "Fixed use of flake8" * Only install doc requirements if needed * Use x86 architeture specific grub2 packages for RHEL * Move doc related modules to doc/requirements.txt 2.27.0 ------ * Add fedora-30 testing to gate * Uninstall linux-firmware and linux-firmware-whence * Fixed use of flake8 * Rename openSUSE 15.1 testing to 15 * Allow configurable gzip binary name * Do not delete cracklib from /usr/share * Fedora 30 functional and boot tests 2.26.1 ------ * zypper-minimal: Don't get confused by etc/resolv.conf symlink 2.26.0 ------ * simple-init: add configurable RA timeout with network-manager * update gentoo systemd profile to 17.1 from 17.0 * rpm-distro: ensure we selinux relabel underlying directories * Allow extra repositories to be added to images * yum-minimal: install fedora-release-cloud * block-device-efi : expand disk size calculation * Don't show all elements found * dracut-regenerate: catch failures and exit code * Fixes packages for arm64 bootloader * Fixes DIB\_DISTRIBUTION\_MIRROR\_UBUNTU\_IGNORE matching when empty * Fix the pypi element for multiple mirror URLs * Stop regex warning * Create /etc/machine-id for RHEL images * fix comments / spelling errors in gentoo element * support alternate portage directories * journal-to-console: element to send systemd journal to console * Enable nodepool debugging for functional tests * update version of open-iscsi that is installed on musl * Add a nodepool job based on releases 2.25.0 ------ * Only enable dbus-daemon on fedora-29 * Set router solicitation delay with using NM * [RHEL-8] Set \_clear\_old\_files=0 in install-pip element * disable autounmask for emerge * ironic-agent: Use targetcli & python3-devel on rhel8 * Mailing lists change openstack-dev to openstack-discuss * install gnupg2 by default in debian-minimal * set default sources conf for buster as it now has a release * Cleanup: remove useless statement * Enable nodepool testing for opensuse 15.1 * Replace nodepool func jobs * Move existing Zuul project config to projects.yaml * Move Zuul config in-repo * Add DIB\_UBUNTU\_KERNEL to ubuntu-minimal * Sync Sphinx requirement 2.24.0 ------ * Update test coverage for openSUSE/-minimal to 15.1 * Remove the rhel 8 check for xfs * debootstrap: make default network interface names configurable * Move pypi to dib-python * ironic-agent: install mdadm on the ramdisk * Use architecture-specific grub2 RPMs on RHEL8 * Increase size of EFI system partition (again) * bindep: exclude zypper from debian-stretch * Makes image caching more resilient * fail early when lates build information can not be fetched * Deprecate rhel7 in favor of rhel * Add version-less RHEL element for RHEL7 and RHEL8 * allow the use of non-bzip compressed stages for building gentoo * Replace git.openstack.org URLs with opendev.org URLs 2.23.0 ------ * Use megabyte granularity for image extra space * bindep: add sudo * Update test coverage for openSUSE/-minimal to 15.0 * Use fedora-release-common for fedora 30+ 2.22.0 ------ * Only enable dbus-daemon for fedora-29 and below * Switch simple-init to support python3 * openssh-server: harden sshd config * Fix broken requirements url * Support defining the free space in the image * Replace git.openstack.org URLs with opendev.org URLs * Allow specification of filesystem journal size * Document the various global filesystem options * Update to https:// version of \*openstack.org urls * OpenDev Migration Patch * Constraint networkx to <2.3 for Python 2 * Fix Fedora aarch64 image location * debian-minimal buster support * Also use selinuxenabled to check selinux status 2.21.0 ------ * Replace openstack.org git:// URLs with https:// * Replace openstack.org git:// URLs with https:// * Minor clarifications in centos7 element docs * Unmount internal mounts on finalise errors * Add DIB\_APT\_MINIMAL\_CREATE\_INTERFACES toggle * [lvm] Add Ubuntu bionic as supported distro 2.20.3 ------ * Update gentoo-releng gpg key 2.20.2 ------ * Add option to skip update packages * Fix opensuse 42.3 pip-and-virtualenv * Keep git after ironic-agent post * set rhel minor release 2.20.1 ------ * pip-and-virtualenv: handle centos image-based builds 2.20.0 ------ * pip-and-virtualenv : only remove system files on centos * Enable dbus-broker for Fedora 29 * fix systemd import-tar for gentoo * Add python3-setuptools to bindep.txt for Fedora * support cracklib in pam for Gentoo's musl profile * Make sure $TMP\_BUILD\_DIR/mnt is owned by root * [Configuration] Add missing py37 and corrected default envlist * [Core] Change openstack-dev to openstack-discuss 2.19.0 ------ * change to python36 for gentoo * update spelling errors * source-repositories: Replace documentation http with https links * Delete the duplicate words in 50-zipl * Change phase to check for dracut-regenerate in iscsi-boot * Add policycoreutils-python-utils to bindep * Use template for lower-constraints * simple-init: allow for NetworkManager support * package-installs: provide for skip from env var * Revert "Make tripleo-buildimage-overcloud-full-centos-7 non-voting" * Fix unit tests for elements * Capture ramdisk test run logs * Make tripleo-buildimage-overcloud-full-centos-7 non-voting * Only cap pylint for python2 * Fix a typo in the help message of disk-image-create * Add missing ws separator between words * Add an element to configure iBFT network interfaces * move selinux-permissive configure to pre-install phase * Update to Fedora 29 * fix some errors for ill-syntax in README.rst * delete the duplicate words in package-outside-debootstrap-ac93e9ce991819f1.yaml * Increase size of EFI system partition 2.18.0 ------ * Add systemd-containers functional tests * Add ubuntu-systemd-container operating-system element * Remove python3 legacy jobs * Remove legacy playbooks * Native zuulv3 tests * Move several packages to bindep.txt * Turn on quiet mode when logfile specified * Fix epel repo rewrite, add to testing * Add a post-root.d phase * Fix DIB\_DISTRIBUTION\_MIRROR\_UBUNTU\_IGNORE regex typo * Add support for Fedora 28, remove EOL Fedora 26 * Set EPEL mirror during openstack-ci-mirrors * ubuntu: Add options to ignore mirror components and use insecure repos * simplify overlay logic for Gentoo * simplify python3.6 selection on gentoo * Turn down pkg-map and hook copy tracing output * enable caching for gentoo builds * Add a pre-finalise.d phase * Minor documentation updates * Allow debootstrap to cleanup without a kernel * fix a typo * Fail build due to missing kauditd only when SELinux is enabled * Fix DIB ubuntu-minimal running on bionic (18.04) * ubuntu-common: Update default DIB\_RELEASE to bionic * Remove redundant sources change/update * Move common ubuntu environment setting to ubuntu-common element 2.17.0 ------ * Only append DIB\_BOOTLOADER\_DEFAULT\_CMDLINE to default grub entry * Fix CentOS image build failure when dib runs on system where audit disabled * Fix bootloader packages for aarch64 * Replace assertRaisesRegexp with assertRaisesRegex * Remove unsued opensuse jobs * Remove legacy-opensuse-423 nodeset * Install ca-certificate with redhat-common * Add netcat to redhat-common map-packages * Fix typo in installation.rst * Only detach device if all partitions have been cleaned * Move LVM cleanup phase into cleanup * Add DIB element to blacklist nouveau * modprobe DIB\_MODPROBE\_BLACKLIST should be optional * cache-url requires curl 2.16.0 ------ * Update pylint to 1.7.6, uncap networkx * Fix for proper LVM support * Update developing\_elements * Add expected semicolons for dhclient.conf * fix tox python3 overrides * Add keyring if supplied * Call kpartx remove in umount, not cleanup * Move localloop to exec\_sudo * Add new modprobe element * block-device lvm: fix umount phase * Don't quote names with sgdisk * better handle existing keywords files/directories * Add iscsi-boot element for CentOS images * Remove redundant word * Fix /etc/network/interfaces file contents * Convert labels to upper case * Fix bootloader for efi on rhel systems * Don't run setfiles on /boot/efi * Add iscsi-boot element * Fix bootloader packages for rhel 2.15.1 ------ * elements: pip-and-virtualenv: Handle openSUSE Leap 15 * Added release notes for Change 568697 2.15.0 ------ * Don't install zypper on bionic * Rename output log files * Add log directory option to functional tests * Save and close stdout on exit * Reduce path length in PS4 for debug * Use surrogateescape with outfilter.py * Allow to rebuild arbitrary images * Replace the ubuntu-minimal trusty test with a bionic one * Remove non-maintained ubuntu-core element * elements: zypper-minimal: Add support for openSUSE Leap 15.X * Add Ubuntu 18.04 support * IPA requires iptables * Remove duplicate GRUB command line entry * rpm-distro: set the contentdir yum var * Trivial: update url to new url * Fixes add-apt-keys in dpkg element * Add pip cache cleanup to pip-and-virtualenv * Install sudo on Gentoo images by deault * pip-and-virtualenv: fix install-pip when centos-release-openstack is enabled * Stop using slave\_scripts/install-distro-packages.sh 2.14.1 ------ * Fix epel element for centos-minimal 2.14.0 ------ * Revert "debootstrap: Call update-initramfs explicitly" * Remove installed packages before pip install * allow building non-gentoo images on gentoo hosts 2.13.0 ------ * Don't only install python3-virtualenv * Don't use -e to test for what might be broken symlink * add lower-constraints job * Set the dhclient timeout to match DIB\_DHCP\_TIMEOUT * Formalise saving of /etc/resolv.conf * Restore tracing on exit points of block\_device\_create\_config\_file * delete unused module * debootstrap: Call update-initramfs explicitly * Change the GENTOO\_PORTAGE\_CLEANUP variable default * Fix element-provides in debian element * Revert "Remove tripleo jobs" * enable systemd profile for Gentoo * install sudo in the devuser element 2.12.1 ------ * Fix default partition type * Remove tripleo jobs * remove portage git directory 2.12.0 ------ * Updated from global requirements * Updated from global requirements * proliant-tools: add net-tools package to support hpsum utility * Make the build reproducible * Updated from global requirements * secondary architectures use different url * Fix encoding issue during processing output * Fix for rhel7 iso image creation * Fix for passing user defined value for satellite cert for rhel-common * arm64: use HWE kernel and fix console * Choose appropriate bootloader for block-device * Add block-device defaults * Fail if two elements provide the same thing * GPT partitioning support * update Gentoo Hardened profiles (now stable) * Checking link status according to DIB\_DHCP\_TIMEOUT 2.11.0 ------ * Install systemd earlier for Ubuntu Bionic * update gentoo vars for new profile and python * Fix typo doc * Zuul: Remove project name * Remove some redundant indents * Set default label for XFS disks * Don't install dmidecode on Fedora ppc64le * Updated from global requirements * Add support for Fedora 27, remove EOL Fedora 25 * Don't fstrim vfat partitions * Remove RH1 check OVB jobs from configuration * upgrade pip before using -c option * Correct link address * Updated from global requirements * Add SUSE Mapping 2.10.1 ------ * Revert "Dont install python-pip for py3k" 2.10.0 ------ * Adding mapping for SUSE package * Check source-repository-\* files for trailing newline * Update Fedora defaults to 27 * ironic-agent: don't remove make * Remove architecture rules on lshw dependency in ironic-agent * zypper: fix package removal * Avoid tox\_install.sh for constraints support * Fix wrong epel-release-7\* package URL * Add the groundwork for musl profile support * Enable support for Gentoo overlays * Pre-install curl * Install fedora-gpg-keys for F27 * Make preinstall.d more deterministic * Use EPEL for debootstrap on centos * Fix /dev/pts mount options handling * Make python changes more reliable * zuul: add tripleo jobs * Remove setting of version/release from releasenotes * elements: zypper-minimal: Refresh repositories where necessary * Updated from global requirements * elements: Respect devpts mount options * Dont install python-pip for py3k * Enable gentoo in pip-and-virtualenv element * zypper-minimal: Set default locale env to C.UTF-8 * Add zipl element as s390x architecture bootloader * diskimage\_builder: lib: common-functions: Fix options for devpts mount * Zuul: add file extension to playbook path * Move to a common lock-file directory * Create rescue user on ironic agent * Use -t devpts for /dev/pts mounts * Dont install python-virtualenv for py3k in deb * Import legacy playbooks * Add debian minimal requirement for arm64 * Fix grub2 dependency on arm64 * Remove dd from LVM element * Update Gentoo element for element changes * Update proliant-tools to support Gen10 Proliant servers * Move fstrim to block device layer * Add Constraints support 2.9.0 ----- * Revert "Support networkx 2.0" * Support networkx 2.0 * Add initramfs-tools for ubuntu-minimal * Actually sort mount-point list * Change to install a package in 'proliant-tools' * Create /etc/machine-id for fedora * Use latest Fedora .qcow URL * Updated from global requirements * Add missing package dependency for yaml * Mention the need of dracut-regenerate element * Move the ordering of the dracut regenerate command * Remove nested quotes from TAROPTS * Use [[ for =~ matches * Fix cylical systemd config for dhcp-all-interfaces * Updated from global requirements * LVM support for dib-block-device * Increase timeout for removal * Add netbase to ensure /etc/protocols is placed for debian * Add kpartx as a requirement to build images * Clear up debian element documentation * Clear /etc/machine-id to avoid duplicate machine-ids * Bump fedora/fedora-minimal DIB\_RELEASE 26 * Updated from global requirements 2.8.0 ----- * Move selinux packages to redhat-common * Allow users to specify partition type in the MBR PTE 2.7.2 ----- * Use SELinuxfs to check selinux status * Switch openSUSE to 42.3 by default 2.7.1 ----- * elements: zypper-minimal: Install tar package 2.7.0 ----- * Move setfiles to outside chroot with runcon * zypper: Clean caches and don't cache packages locally * doc: supported\_distros: Add openSUSE Leap 42.2/3 and Tumbleweed * Add -m flag to setfiles for Fedora 26 * yum-minimal: pre-install coreutils * Force install during pip-and-virtualenv * Fix latest-limit command line * Updated from global requirements * opensuse-minimal: install glibc-locale * elements: openstack-ci-mirrors: Use openSUSE mirrors for gating jobs * Update the documentation link for doc migration * Remove DIB\_[DISTRO]\_DISTRIBUTION\_MIRROR * doc: Switch from oslosphinx to openstackdocstheme * The correct option for label name in fat and vfat is '-n' * zypper-minimal: No point in preserving the environment here * Remove additional Bumblebee repository for opensuse element * Enable console during kernel boot on Power * fix readme.rst to reflect correct environment variable * Add symlink test for resolv.conf restore * pip-and-virtualenv: Install python3 on openSUSE * Support for Cloud Images on ppc64le for rhel7 and centos7 * bindep.txt: Exclude gnupg2 package on openSUSE * Avoid hanging endlessly on unreachable cache urls * elements: pip-and-virtualenv: Use common packages for openSUSE * Remove mirror create * Remove centos and rhel elements * Updated from global requirements * dib-lint: Ignore editor temp files for linting run * As far as block-device layout is concerned ppc64le == ppc64el * [doc] Add some notes about PowerPC Architecture names * Move image download tests to default skip * Fix mkfs use wrong label option for vfat * Use the dib python to do cleanup 2.6.1 ----- * On suse the python2 dev package is python-devel * Move ironic-agent test to fedora-minimal * Start at using CI mirrors for fedora/centos * Use local mirror for ubuntu-minimal jobs * Move apt-sources to ubuntu-minimal / move debian to skip list * Sync after writing partition table * Install systemd earlier for Stretch * Fix mkfs failure when loop device is not ready * Add timestamp output filter 2.6.0 ----- * PPC bootloader; install to boot partition * Pass all blockdevices to bootloader * Move rollback into NodeBase object * Move global mount tracking into state * Use global state to check for duplicate fs labels * Remove 'state' argument from later cmd\_\* calls * Add state to NodeBase class * Use picked nodes for later cmd\_\* calls * Don't make image & loopdev functions static * Add env var to dump config graph * Use class as super() argument * Move ppc block-device default to right $ARCH * Update tracing in block\_device\_create\_config\_file * Add a keep-output flag for functional tests * Updated from global requirements * Pad state dump * Use https in docs links * Add missing test requirements, fixup pylint env * Move "functional" unit tests under block-device * Replace assertRaisesRegexp with assertRaisesRegex * Adjust package mapping for SUSE family * Drop support for Ubuntu precise * Adjust package installation for openSUSE * Trivial fix typos * Make BlockDeviceState implement a dict * Refactor mount-point sorting * Remove dracut-network element * Remove ccache * Decode string to bytes in dracut-regenerate * Test openSUSE 42.2/42.3 image builds * Add state object, rename "results", add unit tests * allow uninstalls to fail on gentoo * Refactor: use lazy logging * Add pylint with indent check 2.5.0 ----- * Disable recommended package installations for zypper-minimal * Move create\_graph into config.py * Create and use plugin/node abstract classes * Use networkx for digraph * Add a more generic tree->graph parser * Adding unit testing for configuration * drop deprecated map-services/packages from zypper element * Produce API documentation 2.4.1 ----- * Set manifest permissions in the image * dhcp-all-interfaces.sh - Add support for InfiniBand interface DHCP * Move parts of Partition creation into object * Split partition into it's own file * Move exception to it's own file (again) * Add weights to digraph * Switch debian to deb.debian.org * Remove use of 'which' * Add dracut-regenerate elements * Remove \_config\_error thrower * Set manifests to mode 600 and owner root * Use fakelogger in test\_blockdevice\_mbr * Remove PluginBase/NodePluginBase class * Only unmount directories that are mounted * Updated from global requirements * Apply setfiles on all mountpoints * Updated from global requirements 2.4.0 ----- * Refactor: block-device filesystem creation, mount and fstab * Remove args from BlockDevice() init * Move to subparsers * Clear \_\_init\_\_.py from cmd move * Take --params from environment * Create BlockDeviceCmd object * Move YAML parsing into cmd.py; default to env * Move dib-block-device implementation into cmd.py * Move blockdevicesetupexception.py into blockdevice.py * Remove unused val\_else\_none * block\_device: reorder imports * exec\_sudo: check cmd for str, log output and raise exception * Use check\_output * Add sort\_mount\_point method * Refactor documentation on image creation * Add a test to validate we can build debian vms * Introduce exec\_sudo command * Fix py3 error in block-device * Refactor block-device base functions * Add bzip2 to test install * Add refactor of tree-like vs graph * Set LC\_ALL in disk-image-create * Improve documentation for image creation * Refactor block\_device: isolate the getval call * Refactor block\_device: passing command line parameters * Make Gentoo package updates work more often 2.3.3 ----- * Add yum-utils as EPEL dependency * Turn off strict\_id mode for Ec2 datasource * Clean up dib-python symlink * Updated from global requirements 2.3.2 ----- * Skip python3-virtualenv on <= trusty 2.3.1 ----- * pip-and-virtualenv : install python2 & 3, and default to 2 * Install pip with python interpreter 2.3.0 ----- * Move do\_extra\_package\_install to run in install phase * Clean out apt index caches at end of image build * Updated from global requirements * Unify and fix doc of several Debian and Ubuntu elements * Fix package-installs-v2 output * Basic logging for package-installs-squash * Use DIB\_PYTHON\_EXEC to run commands * Fix typo in pip-and-virtualenv * Ignore missing path in unmount\_dir * Run dib-run-parts out of /tmp * Don't provide dib-run-parts * Add flag to disable EPEL * Fix code-block in README of rhel7 element * Fix opensuse-minimal element on non-SUSE hosts 2.2.0 ----- * Have simple-init enable network.service * Use stevedore for plugin config of block device * Use correct Ubuntu distro url on non-x86 arches * Typo fix: curent => current * functests: skip qcow2 generically but add specific test * Add default PPC block-device layout * Capture output in \_exec\_sudo * Adding aarch64 support for CentOS7 * Fix typo in CMDLINE env var for bootloader 2.1.0 ----- * Allow ELEMENTS\_DIR to be configurable * Use sphinx warning-is-error * Updated from global requirements * squash-package-install to use the correct python * Make our virtualenv source py3 safe * blockdevice.py: python3 fixes * Fix dib-init-system for Debian Jessie and Debian Stretch * Replace architecture-emulation-binaries with qemu-debootstrap 2.0.0 ----- * Add 2.0.0 release notes * Send custom parameters in bootloader to GRUB\_CMDLINE 2.0.0rc2 -------- * Run indent checks in diskimage\_builder/lib * Use OrderedDict for partitions instead of simple dictionary * Refactor: block-device partitioning cleanup 1.28.0 ------ * [suse] Handle pip-and-virtualenv install for opensuse * pip-and-virtualenv: also handle rhel distros * [suse] remove --no-confirm from zypper invocation * gentoo: do not manually clean /tmp * Fix requirements update * Fix #1627402: fix grub2 element for ubuntu xenial 2.0.0rc1 -------- * Semi-automatic doc generation of element dependency * Fix up doc errors * Fix up element doc generation * python-brickclient: accommodate python2/3 changes * Move Ubuntu specific use\_tempaddr setting to ubuntu-common element * Fix typo in README.rst * yum/install-packages output cleanup * Preinstall pyOpenSSL * Target map-packages deprecation message * Turn down some low-value tracing output * Move generation of dib\_[environment|args] to manifest element * Check return of \_load\_state * block-device: change top level config from dict to list 1.27.0 ------ * Handle blank lines in element-deps * Don't run unit tests from run\_functests.sh * Git ignore coverage stuff * Refactor: block-device handling (partitioning) * Add DIB\_IPA\_COMPRESS\_CMD option * ironic-agent: use /sbin for modprobe * move post-install.d to finalize.d * Bump fedora release to 25 * Fix dhcp-all-interfaces for ubuntu-minimal xenial * Use strings in package-installs follow output * Don't set base element path in run\_functests.sh * Fix coverage report * Use %i instead of %I in dhcp-interface@.service * Remove hardcoded components * Set grub device in /etc/default/grub * Replace yaml.load() with yaml.safe\_load() * Unify tidy up logs in lib/img-functions * Also check bin/ for tabs * Handle failure of carrier check in dhcp-all-interfaces.sh * Fix Gentoo builds on Ubuntu 16.04 Xenial hosts * Make DHCP timeout configurable * Run dhcp-interface@.service after network.target * Update component docs to refer to ironic-agent * Change "Openstack" to "OpenStack" * update pkg-map entries for python3 1.26.1 ------ * Revert "Revert Xenial to Python 2" * Dont run with VIRTUAL\_ENV set * dib-lint: python3 compatibility fixes * H803 hacking have been deprecated * Update documented default Ubuntu version 1.26.0 ------ * Revert Xenial to Python 2 * debootstrap: avoid duplicate network configuration * Start func testing on centos-minimal again * Increase func testing for ubuntu-minimal element * Remove yum chroot caching * Set grub timeout default * Switch py34 tests to py35 * Add get\_elements; preserve backwards compat for expand\_dependencies * Update our package classifiers * set default DIB\_PYTHON\_VERSION=2 for rhel7 * Add squashfs output image format 1.25.2 ------ * Add output image format tgz support * Install dracut-generic-config package * Switch to openSUSE Leap 42.2 release by default * FIx the DIB\_CLOUD\_INIT\_ALLOW\_SSH\_PWAUTH variable name in README file 1.25.1 ------ * Add ubuntu-precise support to dib-python * Fix bootloader element on ppc * Create ubuntu/fedora test for pip-and-virtualenv 1.25.0 ------ * Recreate initramfs within loopback image * Pip install as 10- incompatible with 05-heat-cfntools * Support sysv init system used by Debian Wheezy * elements: dib-python: Add python2 as the default version for openSUSE * Fix pip-and-virtualenv to work with python3 * Allow package-installs to parse DIB\_PYTHON\_VERSION * Add install-types as pip-and-virtualenv dep * Disable centos6 testing * Move pip-and-virtualenv source install to 10- * Speed up chroot checking loop * Don't set the executable bit on dhcp-interface@.service * Make dib-python use the default python for distro * Allow disto-specific mirror settings * Put MKFS\_OPTS after filesystem type * Update hpssacli to ssacli in proliant-tools element * Update sysctl-write-value to do conflict checking * Delete deprecated Hacking in tox.ini * elements: Drop executable bits from environment files 1.24.0 ------ * Fix --version display * DIB element to support cinder local attach/detach functionality * Perform package install outside of debootstrap * Improve checksum performance for images * Activate virtualenv in disk-image-create * elements: zypper-minimal: Add ca-certificates-mozilla package * Changed author and author-email 1.23.0 ------ 1.22.2 ------ * yum-minimal: add systemd to initial install * Catch errors in DIB\_INIT\_SYSTEM export * Replace six.iteritems() with .items() * Trace package install in package-installs-v2 * Special case dib-python in dib-lint * elements: Drop unneeded DIB\_INIT\_SYSTEM usage * elements: Add new openssh-server element * add option to configure cloud-init to allow password authentication * elements: pip-and-virtualenv: Add python-xml dependency 1.22.1 ------ * Fix runtime ssh host keys script * Turn off tracing around pid/chroot check * Fix a typo 1.22.0 ------ * Change path for dnf arch override so basearch is not overwritten * Fedora AArch64 (64-bit ARM) support in diskimage-builder * Disable all repos in os-refresh-config too * lib: common-functions: Fix tmpfs umounting * add support for SUSE in dhcp-all-interfaces * simplify ARCH param for rhel/centos param can be x86\_64 and amd64 * debian: install dialog package * Install lsb package by map name instead of package name * In disk-image-create, append to INSTALL\_PACKAGES instead of clobbering * Cleanup yumdownloader repos * Updated from global requirements * Remove execute perm from disk-image-create * Move dib-run-parts into diskimage-builder * Avoid disabling rhel-7-server-rh-common-rpms * elements: zypper-minimal: Mount common pseudo filesystems * Updated from global requirements * dhcp-all-interfaces: support Centos/RHEL 6 * Move diskimage-image-create to an entry point * Move elements & lib relative to diskimage\_builder package * Fail on element-info error * elements: zypper-minimal: Refresh repositories after adding the cache * elements: opensuse-minimal: Add support for building Tumbleweed images * Fix ironic-python-agent image not loading vfat mod * Don't include openstack/common in flake8 exclude list * Drop MANIFEST.in - it's not needed by pbr * Changed the home-page of diskimage-builder in setup.cfg * Remove RedHat grub workaround install * Add support for bindep.txt * Don't log datestamp by default in functional tests * elements: zypper: Do not pull recommended packages * Turn down yum install-packages * Don't set tracing in environment files * elements: source-repositories: Add git package mapping for SUSE * elements: growroot: Add SUSE package mappings * elements: runtime-ssh-host-keys: Add openssh-client mapping for SUSE * Don't use ssh-keygen -A for init scripts * elements: simple-init: Remove SUSE interfaces * Document install of diskimage-builder on Gentoo * Add element for setting sysctl values * start cloud-init-local in the boot runlevel * Fix formatting for supported distros in docs * Rename devloper documentation to developer guide * Remove copyright from docs / toc * Use globaltoc in docs for sidebar * Fix developer guide TOC * Add low-hanging-fruit bug tag to docs * Add bugs link to docs * Generate ssh-hostkeys on boot for ironic agent * Enable release notes translation * Add pkg-map for gentoo to runtime-ssh-host-keys * Remove deploy element * Remove deprecated deploy-ironic element * Remove deprecated ironic-discoverd-ramdisk * Remove deprecated expand-dependencies arg * Remove deprecated serial-console element * Remove deprecated map-services * Remove deprecated map-services 1.21.0 ------ * Create (md5|sha256) checksum files for images * Add opensuse-minimal element * Add zypper-minimal element * Move the opensuse mkinitrd script to the zypper element * Fix a command in Developer Documentation * Default to http://ftp.us.debian.org/debian for debian-minimal * Updated from global requirements * Move opensuse utils to zypper so they can be shared by SUSE-based distros 1.20.0 ------ * Disabling all previous repos registered in the system * Fix typo in extracting root partition * Create runtime-ssh-host-keys element * Fix grub installation for RHEL * Add release notes for block device handling * Shorten DHCP timeout in dhcp-all-interfaces 1.19.1 ------ * yum-minimal: Disable excludes when installing pkg manager * Add libselinux-python to yum-minimal * elements: opensuse: Add support for openSUSE Leap 1.19.0 ------ * Remove EPEL as hardcoded dependency of centos elements * Remove unnecessary dkms install from base * Fix mellanox element required kernel modules and user space packages * don't configure 'lo' for dhcp * Move element-info to a standard entry-point * Refactor: block-device handling (local loop) * Convert pkg-map and svc-map copies to explicit variables * Add IMAGE\_ELEMENT\_YAML and get\_image\_element\_array * Making element overriding explicit * fix systemd resource deadlock * Add option to be able to run\_functests.sh in parallel * Document source glean installs in simple-init * Disabled IPv6 privacy extensions * Generate and use upper-constraints for ironic-agent * Explain difference between two envvars * Add tests for building \*-minimal images * Spec for changing the block device handling * Update portage only if needed * Update GRUB\_MKCONFIG for detecting what's installed * Allow ramdisk-create to run without $USER set * Use temp file for du calculations * Clarify OVERWRITE\_OLD\_IMAGE docs * Add blurb about communication to docs landing page * Change DIB\_IPA\_CERT resulting file name * Allow to skip kernel cleanup * Add specs dir * Add "audit"package to yum-minimal * secure\_path in sudoers: deal with possible quotes * Optionally remove portage files * Generalize logic for skipping final image generation 1.18.2 ------ * add no\_proxy when debootstrap trying to use proxy * Correct order of parameters in call to qemu-img convert * Correct order of parameters in call to tune2fs * Fix proliant-tools dependencies * Fix packaging problems for Debian * Remove the escape in the centos7 README file * Spec for changing the block device handling: partitioning * yum-minimal: set locale.conf and tz in chroot * Revert "Revert "Pre-install pip/virtualenv packages"" * Don't create an ironic-agent image just to delete it * Make Fedora 24 the default * Check sudoers file after editing 1.18.1 ------ * Add 1.18.1 releasenotes * Revert "Pre-install pip/virtualenv packages" * package-installs: add list to arch and "not-arch" list * Export YUM variable in centos bases * Clear up "already provided" message * Fix the bug that "mktemp: failed to create directory" * dmidecode does not exist for ppc64/ppc64el * Updated from global requirements 1.18.0 ------ * Convert element\_dependencies to logging * Release notes for 1.18 * Make xenial the ubuntu default * Clean more from ironic-agent ramdisk image * Updated from global requirements * Handle locales install on Fedora 24 * Fix copyright in docs * Run RHEL system unregister element earlier * Updated from global requirements * Fix sphinx-build to not depend on diskimage-builder * Pre-install pip/virtualenv packages * Ironic agent kernel should be owned by user building image * Introspect logging testing more * Add python logger configuration * Remove discover from test-requirements * Move pkg-map to dib-python * Add cinder-backup mappings 1.17.0 ------ * Release notes for 1.17.0 * Cleanup source-repositories output * Refactor: rename temporary directories * Refactor: remove unused functions * Rework yum-minimal locale cleanup * Remove Fedora 21 from test-build * Export die() function * Fix variable unbound error while REPOREF="\*" * Handle file magic type varying order matching * Remove deprecated overriding of cloud-init defaults * Add cloud-initramfs-growroot for Precise * Add release to pkg-map * Export FS\_TYPE and remove hardcoded ext4 values * Add PS4 to show file/function/line in debug output 1.16.1 ------ * Revert "Revert "Properly fail/trap in eval\_run\_d"" and fix PIPESTATUS * Fix path issue for locale-archive.tmpl * Revert "Properly fail/trap in eval\_run\_d" * Add dhcp-all-interfaces.target for syncing units * Small doc update, add link to relnotes 1.16.0 ------ * centos-minimal: can be used with base * Properly fail/trap in eval\_run\_d * Add 1.16.0 releasenotes * Do not remove sudo in ironic-agent * Fail functests if refusing to run tests * Install docker for tests * Fix apt-sources configuration for debian-minimal * Add install-bin element * tests/elements/fake-os: add '/tmp' as top level dir * Updated from global requirements * Add a best-effort sudo safety check * Fix OpenSUSE support * Install proliantutils in IPA's virtualenv * Add documentation for dib-lint * Add test dependency installation on Gentoo 1.15.0 ------ * Use generic "dhcp-client" name * Split YAML & JSON parsing * Add some output to dib-lint * dhcp-all-interfaces depends on dib-init-system * dhcp-all-interfaces depends on dhcp * Add Gentoo to the dhcp-all-interfaces element * Updated from global requirements * yum-minimal: strip locale archive * Add releasenotes * Change to latest CentOS-6 image * Document upstream executable numbering convention * Move selinux restore to end of finalise * yum-minimal : better cleanup of initial yum failure * Add EPEL as requirement of centos-minimal * Allow skipping the md docs check * Don't stop dib-lint on first flake8 failure * Fix up EPEL element * Updated from global requirements * Support to add certificate in ironic-agent * simple-init: Fix path for /etc/ssh test * Fix disk usage report * Add qcow2 generation for better test coverage * Skip gentoo test * Turn of tracing around du invocations 1.14.1 ------ * Fix add-apt-repository package for precise * Fix ssh key cleanup to run in chroot * Debian: dont set always the hostname to debian 1.14.0 ------ * Remove ssh host keys when using simple init * dib-run-parts: make cp to target root more robust * Set tgtd not auto-start on OS boot time 1.13.0 ------ * Handle unconfigured interfaces for dhcp-all-ifaces * Really remove all interfaces in dhcp-all-ifaces * ironic-agent postinst fails on systemd with no iptables * add pkg-map to pip-and-virtualenv element * Turn down tracing for source-repo cache * ironic-python-agent should use console output * Add psmisc to the packages for ironic-agent * Add new posix element * Note requirement for parted on gentoo hosts * Remove all interface configs for simple-init * Set default locale to image in debootstrap element * Make ubuntu-core support releases * Add testing for the Gentoo element * Updated from global requirements 1.12.0 ------ * Use fstrim to prep the block device * Revert "Zerofree the image if possible" * centos-minimal does not provide base * Add lshw package to ironic-agent * yum-minimal: clear our rpm/dnf/yum data in chroot * Add image size report * Zerofree the image if possible * Create new partitioning-sfdisk element * Fix spurious = in dib-python readme * Fix cloud-init-disable-resizefs README title * Reorder developer quickstart docs * Add --version option to disk-image-create * Add Gentoo to the list of supported distributions * Prioritize venv python on host 1.11.1 ------ * Fix building on gentoo hosts * Depend on ifupdown in simple-init * Rework functional test runner * Revert "Correct rhel-common for rhel6" * Adding InfiniBand Support * Add force-confdef in debian package install * Install IPA in a virtual environment * Don't cache debootstrap rootfs by default * Don't remove python3 & grubby in 99-remove-extra-packages 1.11.0 ------ * debian-minimal: configurable debootstrap components 1.10.0 ------ * Remove eclean-dist as it's not available by default * Reorder the package-uninstall action * Do not remove python-dev from ironic-agent image * yum-minimal: pre-install base packages * Fix dpkg element for Ubuntu Xenial * Refactor growroot for debuggabilty * Fix startup race with growroot/systemd * Replace sfdisk partitioning with parted * Switch simple-init to pip-and-virtualenv element * Revert "Skip centos functional testing" * Use dnf to cleanup old kernels * Increase interface has link retries to 20 * Fix growroot for Gentoo's openrc * Fix tar listing in functional tests * Add support for OpenRC to dib-init-system 1.9.0 ----- * Add new cloud-init element * Fix Gentoo hardened support * Skip centos functional testing * Fix package-installs for python3 * Add support for gentoo to simple-init * Mark ironic-discoverd-ramdisk as deprecated in favor of ironic-agent * Add Gentoo support to growroot * Add support for Gentoo to source-repositories * Remove outdated translation files * Only match #!/bin/bash in scripts * Fix debian-minimal image building * Updated from global requirements * Don't use wc -l for the umount check * Cleanup unmount\_dir function * Add systemd/fedora support to growroot * Remove argparse from requirements * Revert "Use pip 7 for ironic" * Updated from global requirements * Force dib-python symlink creation * Remove zero length files * Use pip 7 for ironic 1.8.0 ----- 1.7.2 ----- * Add inetutils-ping to test-deps * Move speedup section to image building guide * Add pkg-map for redhat * Revert "Fix discoverd bug when dmidecode reports GB" * Print unparsable file in pkg-map 1.7.1 ----- * Fill out bootloader pkg-map 1.7.0 ----- * Initial add of gentoo support for diskimage-builder * Prune old branches when updating cache * Correct rhel-common for rhel6 * deploy-ironic: Fix syntax error when checking for root device hints * Add pip-and-virtualenv element * Run package-intalls with py3k if we must * The mirror for installing epel is timing out * Properly account for pipefail during cleanup * Make dkms element depend on dkms package * py26 is no longer supported by Infra's CI 1.6.0 ----- * Fix discoverd bug when dmidecode reports GB * yum-minimal : install selinux policy packages * yum-minimal: do not configure eth0 & eth1 for DHCP automatically * yum-minimal: leave behind dummy /etc/resolv.conf * Fix growroot device detection * Package installs defaults to tracing off * Don't print trace unless trace is on in pkg-map * Fix unmount/remove race in cleanup\_build\_dir * Make check for image-should-fail quiet * Document byte-to-inode ratio * Split vm and bootloader elements * Deprecated tox -downloadcache option removed * Add a new element hpdsa * Add dib-python element * Allow grub2 to build with opensuse 1.5.0 ----- * Add kmod to package-installs of ironic-agent * Load the 8021q kernel module in simple-init * Add openssh-server package-install to local-config * Fix grub-efi-amd64-signed install failure * Fix fedora-minimal on CentOS builds * Follow up patch for 25d3ee547176528e86d42eb026c99a134dff9452 * Updated from global requirements * Add centos7 test * Add DIB\_LOCAL\_CONFIG\_USERNAME to local-config * Use ironic-agent for source-repositories * Add dynamic-login element 1.4.0 ----- * Remove fedora-minimal/install.d/99-ramdisk * Remove cloud-initramfs-growroot package * Extend root device hints for different types of WWN * Move install-types doc to user guide 1.3.0 ----- * Fixup RPM db path when building Fedora on Ubuntu * Remove unused RELEASE\_RPMS variable * Fix diskimage-builder image size * Add proliant-tools element * Add missing six requirement for svc-map element * Fix fedora-minimal kernel-install on older platforms * Clarify what fedora-minimal/install.d/99-ramdisk is doing * Fix uniqueness check of initrd in fedora-minimal * Updated from global requirements * debian: cloud hostname ignored by Jessie * Selectively prune /root for ironic-agent ramdisk * Add a tox target to run functional tests locally * Create YUM\_CACHE\_DIR in yum-minimal * Use DIB\_EPEL\_MIRROR when finding the epel-release package 1.2.0 ----- * Add support for Xen PV disks * Add --force to grub-install * Preserve env when calling yum with sudo * Define a default for $YUM * Fix tests/test\_functions.bash * Fix devuser pubkey defaults * Reset yum/dnf cache to correct location * Remove extra install of release pkgs in fedora-minimal * Update default fedora-minimal to f22 * Add Fedora 22 support to yum-minimal * Enable decimal value for $DIB\_IMAGE\_SIZE * Update rhel7 element readme * Move yum-based install into function * Update apt-preferences element README from free text to table formatting * Update apt-conf elements README from free text to table formatting * Fix title of env vars section of fedora README to match template * Fix title of env vars section of redhat-common README to match template * Avoid transcending /proc with find * Reorder the script number of 'elements/dkms/post-install.d/99-dkms' * dib-lint: ignore blank lines in element ordering * Restrict search for python object files to ./usr * Add flake8 to requirements * agent: ensure vmlinuz file does not exist before hard-linking into it * Prevent overwriting of user modified blacklist.conf * Remove quotes from subshell call in bash script * Contains the directory name of /sys and /proc * Install 'gdisk' when building ramdisk with ironic-agent * Use --nodeps when installing fedora-release * Output failing lines when dib-lint finds wrong indents * Adds debian support to iso element * ironic-agent element to output a .kernel file * Add functional test for ironic-agent on Fedora * Updated from global requirements * Add option to set EPEL mirror * Remove dnf workaround in ironic-agent * ironic-agent: remove python object files * Install ironic-agent dependencies via package-installs * Fix variable misspelling error 1.1.2 ----- * Prettyfy source-repositories doc * Prettify 'Caches and offline mode' documentation * Download a compressed centos cloud images * Prettify 'Developing Elements' documentation * Add centos7 support for DIB\_DISTRIBUTION\_MIRROR * Don't create a centos yum repository * Add #!/bin/bash to library functions * Make README.rst a bit more generic * Deprecate the deploy-ironic element * dib-lint: validate json/yaml files * Make sure dnf won't autoremove packages that we explicitly installed * Handle install with pip -e * doc: migrate from README.rst to Sphinx * Update fedora elements README from free text to table formatting * Update redhat-common elements README from free text to table formatting * svc-map: do not specify user/group for install * Activate pep8 check that \_ is imported * Remove grub2 in redhat-common/pre-install.d/15-remove-grub * Remove old entries from MANIFEST.in * ironic-agent: ensure dmidecode and ipmitool are installed * [ironic-agent] Use svc-map for enabling agent * Update dpkg elements README from free text to table formatting * Fix ironic-image pkg-map 1.1.1 ----- * Run growroot after all filesystems are mounted * Updated from global requirements 1.1.0 ----- * Fix a typo in README.rst * create growroot element * Install-static depends on rsync * Fix init-scripts element path munging and deps * Pin the Fedora mirror for testing * Reduce the size of the ironic-agent ramdisk * Set and export DIB\_RELEASE for centos7 * Correct URL in ironic-agent README * Add curl to ironic-agent package installs * Handle modern sfdisk and correctly align image partition * Set DIB\_RELEASE for the Debian test-element * Add documentation of output formats for users * Remove docker doc from docs * Add ability to build ironic-python-agent ramdisk from packages * Adds Ubuntu and Debian to ironic-python-agent Support-list * Fix link in installation doc 1.0.0 ----- * debian: properly configure interfaces * typos on the document * Only warn about missing map files with debug * Fix test cleanup trap to cleanup tmpdir * Support building ACIs * Document what our stable interfaces are * Add element to disable cloud-init resizefs * Update default Fedora to 22 * Cleanup yum downloading * Add base element for using docker as image base * Add docker output support * Add init-scripts directory support * Document our supported distributions * Use official mirror name for debian-minimal * debian: install DHCP client and ifconfig packages * Removes hardcoded refrences for ethernet interface * Remove deprecated disk-image-get-kernel * opensuse: Update README * openSUSE: Fix link to the images download folder * Use the init scripts from the glean package 0.1.47 ------ * Have glean set hostname if a config drive exists * Add oat-client element * Allow source-repositories ref to be "\*" * Only chown tmp dirs when they are a tmpfs mount * Work around yum/dnf differences * Add YUM variable to for Fedora >= 22 * Optimize Python install in deploy-targetcli * Updated from global requirements * dib-lint: make it work on Mac OS X * Wait longer for root device to become available * Revert "Revert "Ensure DIB\_RELEASE is exported for fedora"" * Add test for centos 6 * Document only exectuables in phase dirs policy * Change simple-init to use a PATH variable * Add explicit f21 test * Dont fail if were missing setfiles * Revert "Remove unused map\_nbd function" * ramdisk: enable ppc64 support for symlink * Cleanup the build directories earlier 0.1.46 ------ * Revert "Ensure DIB\_RELEASE is exported for fedora" * CentOS-6 resize support * Follow symlink for elements * Add grub2 element * Don't log tmpfs message during cleanup * Support custom kernel cmdline args for deploy iso * Address follow-up comments * Add Ironic API version to passthru URL for deploy-ironic * Skip backups and other non-relevant files for dib-lint * Use tar -t instead of -l because centos 6 * Make it clear that tmpfs is optional * Ensure DIB\_RELEASE is exported for fedora * rhel-common element should not use attach with activation key * Make $DIB\_YUM\_REPO\_CONF accept a list of repo files * Pass glean output to the console log * Use environment setfiles * redhat-common: rename 01-clean-old-kernels.sh to drop .sh extension * Cleanup /tmp in the guest * Add debian build test case * Install debian locales * Add smoketest for fedora * Initial element tests * doc: small snippet about operating system elements * Use Centos 7 cloud image symlink * vm: use $DISTRO\_NAME instead of lsb\_release * rax-nova-agent: switch to $DISTRO\_NAME * ramdisk: switch from lsb\_release to $DISTRO\_NAME * Simple-init should disable cloud-init * Make managing hosts entries optional * Have simple-init regenerate ssh keys on boot 0.1.45 ------ * Remove install of vlan/vconfig from base * package-installs: fix error case for Python 2.6 * centos/centos7: switch to epel element * epel: support centos element * Address comments on virtual media device label commit * debootstrap: fix syntax issues * Fix disk image create errors behind proxy * force arch amd64 for EL7 elements * Add packages required for iscsi extension in agent * Package ldlinux.c32 along with isolinux.bin if it exists * Add install\_test\_deps script * Fix $DIB\_DEFAULT\_INSTALLTYPE export statement * Export DIB\_RELEASE in centos 0.1.44 ------ * debian-minimal: Remove -backport's restricted + universe 0.1.43 ------ * Actually set a sane PATH for inside chroot * Turn docs warnings into errors and fix issues * Generate locales in debian-based elements * Split the debootstrap functions into an element * Install glean from openstack source * Support arch-specific package-installs * Add functional smoke test for disk-image-create * Updated from global requirements * Mount with -o nouuid for XFS base images * Port centos-minimal to yum-minimal * Use shorter temporary file names for kpartx * Fix image size to fit filesystem journal * Use labels for virtual media dev in Ironic ramdisk * Append full path to img-functions:run\_in\_target * Updated from global requirements * Remove unused map\_nbd function * update the dib centos7 baseurl to use a mirrorlist * openSUSE update * Add a yum-minimal element that just uses yum * Add element to process config-drive network info * Break install-types out of base * Support VHD output format * Update packages earlier * Fix to load only signed kernel in UEFI secure boot * Add element ubuntu-signed to provide signed kernel * Update install docs to be more user friendly * Switch default Fedora image to F21 0.1.42 ------ * Clean up targetcli ramdisk installation * Make troubleshoot work with dracut ramdisks * Do not export REG\_HALT\_UNREGISTER between hook scripts * Add generic devuser element * Update cloud-init-datasources README * Improved apt-sources README * Don't trace RHEL Registration scripts * Try 5 times for rmdir command call after umount * Generate the default en\_US locale * No markdown docs for elements * Create the dracut directory if not existing already * Export image properties * Correctly handle raw type ordering * Create a user guide * Report status of boot loader installation to Ironic * Fix dhclient in Fedora ramdisks * Use find instead of ls * Reorder tox environments * Add py34 to tox * Run svc-map tests * Open MKFS\_OPTS for extension in disk-image-create * Short circuit qemu-img convert for raw images * Download of translations not properly disabled in APT * Split dib-init-system into its own element * Handle non-cloud-init installs * Dont try to unmount if were not using tmpfs * Run udevadm settle after kpartx -l * Refactor deploy ramdisk to allow use of targetcli * Allow elements to add drivers to dracut * Fedora: install redhat-rpm-config * Cleanup/restify components.rst * redhat-common: Fix MariaDB-Galera-server case * Flagging ubuntu-minimal as untested 0.1.41 ------ * Ironic: Deploy ramdisk to find the right root device * Ironic: uefi localboot support * Convert leftover unconditional set -x to DIB\_DEBUG\_TRACE * Fix check for installtype * Fix incorrect package name dmidecoded to dmidecode * ironic-agent: exclude content of /tmp from initramfs * UEFI secure boot support for iso element * Install Fedora kernel-modules pkg for iscsi\_tcp * Allow disabling apt-get clean * Set DIB\_RELEASE in ubuntu element * CentOS 6 Element * Fix race in svc-map * Use package-installs on dpkg-based elements * openSUSE update * package-installs: work with Python < 2.7 * Split out README into separate files * Add wget to package-installs.yaml for epel * Updated readme * Fix unbound variables in apt-{preferences,sources} * pkg-map: respect --missing-ok also on missing pkg-map file * update epel version number in epel element * Allow setting DIB\_PIP\_RETRIES * Add a link to the "Writing an element" section * Quote to handle empty DIB\_RELEASE * Namespace PYPI\_MIRROR\_URL vars with DIB * Fix memory detection in ironic-discoverd-ramdisk * Add documentation of DIB\_IMAGE\_CACHE variable * Simplify ironic-discoverd-ramdisk * Support assigning IPMI credentials in ironic-discoverd-ramdisk * Use oslosphinx for docs site * Standarise tracing for scripts * Bump to hacking 0.10 * Fix the bootloader on UEFI machines * Add \`tox -edocs\` capability * Create docs site containing element READMEs * Fix type in DIB\_DISTRIBUTION\_MIRROR use * Pass BOOTIF to ironic-discoverd from the ramdisk * Use package-installs for ubuntu and base elements * Add apt-get autoremove * Add install-static element * Enable vm element to create PowerPC image * Add no\_timer\_check to vm grub cmdline * Dont fail if we have no old-style package-installs * Use sudo -E when squashing package installs files 0.1.40 ------ * setfiles consistently * Ironic: Local boot * Corrected \`element-info\` usage * Add installtype support to package-installs * Fix issue with leaking /tmp/image.\* directories * ironic-discoverd-ramdisk element cleanup * Add support for using local PowerPC VM image * ramdisk-image-create: add support for vmlinux file 0.1.39 ------ * Switch manage\_etc\_hosts from True to localhost * Set http\_proxy to retrieve the signed Release file * Run Registration Once * Fix Satellite Repo * Use DIB\_IMAGE\_CACHE in dpkg element * Fix for RHEL6 * Allow for disabling rhel registration * dracut-ramdisk: fix support for elements with ramdisk-install.d * Don't trace RHEL registration scripts * Ignore stderr from pkg-map * Allow absolute path to image with ironic-agent * Add install section to Ironic agent systemd service file * Fail helpfully if uuidgen is missing * Continue past dependency ordering diffs * Add element for ubuntu-core * Add rax-nova-agent element * Add minimal ubuntu and centos base elements 0.1.38 ------ * Rework package-installs to collapse on build host * Fallback to a boot\_server kernel param if ip= not passed * Add some speedups to dpkg * Deprecates username and password from boot time registration * Use env python * Fix repo enablement for RHEL during registration * Allow injecting arbitrary yum repo configuration * Don't use lsb\_release * Fix rst rendering * Add Activation Key Support For Customer Portal * Migrate to new package-installs * Add new package-installs system * Improve --ramdisk-element docs * Unset requiretty if it exists in sudoers * Remove the grub2 install from redhat-common * Remove use of sudo from yum pre and post elements * Add element for hardware discovery ramdisk for ironic-discoverd 0.1.37 ------ * disk-image-create: fix test when no argument is given * Warning when using pypi element without a mirror * Make some pkg-map errors soft * Fail helpfully if no elements are specified * Check python with flake8 instead of dib-lint * Update RHEL Registration 0.1.36 ------ * Deprecate map-packages, replaced by pkg-map * Allow multiple identical sources * Add DIB\_DEBOOTSTRAP\_EXTRA\_ARGS environment variable * deploy-kexec depends on deploy * Remove duplicate binary-deps from dracut-ramdisk * Add element for building ramdisk with ironic-python-agent * Simplify Dracut cmdline script * Add deprecation warning when using map-services * Fix indent exclusion * Install PyYAML for the svc-map element * Install lsb\_release from package * Enable RHEL Registration * Support installing packages by default * Optimize speed of deletion in find command * package-installs assumes packages have a pkg-map * Updated from global requirements * Unset trap before dracut ramdisk build script exits * iso element to use 'search --label' for grub * Update Debian repo to retrieve signed Release file * export DIB\_ROOT\_LABEL to make it global 0.1.35 ------ * Use binary-deps.d for dracut ramdisks * Move busybox binary-dep to ramdisk element * svc-map requires PyYAML * iso element to build bootable ISO images * Handle extra spaces in merge-svc-map-files * Enable dracut deploy ramdisks * Revert "introduce $SYSTEMD\_SYSTEM\_UNIT\_DIR" * Avoid overwritting of hooks * Disable all interfaces on eni systems * Remove first-boot.d support * Force empty $TMPDIR inside the chroot * Allow source-repositories to be disabled completely 0.1.34 ------ * Move to final release of CentOS7 images * Consolidate lsb\_release source-repositories * Allow for multiple image outputs from raw source * Echo that qemu-img convert is running * Preserve exit value when leaving cleanup trap * Don't re-install cloud-init for centos7 images * Check for epel before installing it 0.1.33 ------ * Do not try to detach non-existant loopback devices * Move install bin from rpm-distro to yum * Use DIB\_IMAGE\_CACHE everywhere * Save extended attributes when creating tar * Ensure epel7 is installed only on rhel7/centos7 * Update EPEL release rpm * Fix $DISTRO\_NAME usage for centos7 element 0.1.32 ------ * Add unit test for cache-url * Use $((EXPRESSION)) instead of $[EXPRESSION] * Install openstack-selinux on RHEL * Updated from global requirements * Move dpkg manifest creation to finalise * Allow custom rootfs labels * Add svc-map element * Refactor ramdisk element to allow alternate implementations * Updated from global requirements * Adds EPEL repo, cleans up rhel7 repos * Update to newer Centos7 images * Provide ability to build images for other architectures * Handle non-existing \*generic kernel and initrd 0.1.31 ------ * Change order for yum-repos file in centos7 element * Make diskimage-builder work in Docker * Add ceilometer service mappings 0.1.30 ------ * Run environment.d hook for manifests earlier * Reset yum configuration in post-install.d * Add vmedia boot support for deploy-ironic element * opensuse: Support pkg removal in install-packages * Use package-installs in more elements * Replace backticks with $() * Fix openSUSE kernel/initrd detection * Correct statement about ramdisk and tmpfs * Fix for host env leak into grub 0.1.29 ------ * Fix openSUSE cloud image download and extraction * Add element-manifest * Changed serial console setup * Map dkms package for SUSE in base element * Fix capitalization of openSUSE * Fix ramdisk pkg-map for openSUSE * Truncate instead of deleting log files * Lock around extract-image downloads and extracts * Add support for flashing ILO BMC's from ramdisks * Remove docs about deprecated pypi-mirror tool * Use dib-run-parts from dib-utils 0.1.28 ------ * Make RHSM registration set -u safe * Add service mappings for ironic * Revert "Remove the temporary deploy element after rename" * Remove hardcoded version * Increase source-repositories support for tarballs * map-services: add openstack-nova-novncproxy * Allow to specify an empty package list in pkg\_map * Use package-installs in fedora * package-installs for pre-install.d/post-install.d * Formatting fixes for dhcp-all-interfaces * Remove disable\_interface from dhcp-all-interfaces 0.1.27 ------ * Relabel filesystem if SELinux is available * debian: exclude contents of /tmp from debootstrap tarballs * Centralize handling of /lost+found 0.1.26 ------ * Cleanup apt cache after grub install * Extend/fix support for extlinux bootloader * Create cache directory * Remove package mapping for mariadb-rdo-galera-server * Adds RHEL common element * Support for UBoot * Add dib-lint exclusions * Revert "Cleanup apt cache after grub install" * Fix sourcing of environment files * Add virtual media boot support in ramdisk element * Cleanup apt cache after grub install * Update RHEL7 element since release * Bump hacking to 0.9.x series * Lock around ubuntu tarball download * Avoid to install a blank list of packages * Don't try to install if packages is empty * Add a ramdisk-install.d hook path * Initial centos7 support 0.1.25 ------ * Update RHEL 6.5 Image name * Add dhcp support for ramdisk element * Handle non-script grub2-install * Use readlink to get script path * Detail 'other' directories in the README 0.1.24 ------ * Lock around source repositories setup * Really handle Ubuntu mirror cache skew, * Echo output when pkg-map fails * Optimizing directory creation * Revert "Don't match editor backup files in env.. * Allow overwriting old images * Correction: if then statement code style * Last ditch effort to correct a wrong shasum * Avoid to install a blank list of packages * Add global exclusions to dib-lint * Don't match editor backup files in environment * Remove fixfiles from rpm-distro finalize 0.1.23 ------ * Rename rhel element yum blacklist * Set LC\_ALL=C into dib-run-parts env * update opensuse element * Use $DISTRO\_NAME instead of local lsb\_release * Add RHEL7 to Red Hat family in pkg-map * Use common element select-boot-kernel-initrd * Always bind-mount pypi mirror if dir exists * Add select-boot-kernel-initrd element 0.1.22 ------ * Ignore manifest outputs more carefully * VM element: Enable serial console on Debian * Disk-image-create should allow sending compat flags to qemu-img * Ensure cache directory exists before use * update zypper element 0.1.21 ------ * Drop ending slash from DIB\_CLOUD\_IMAGES * Update base element to make use of pkg-map * opensuse: support pkg-map in bin/install-packages * dpkg: support pkg-map in bin/install-packages * Element to remove unwanted kernel/initrd * introduce $SYSTEMD\_SYSTEM\_UNIT\_DIR * Update README regarding Debian and OpenSUSE support * Do not use DatasourceNone for precise cloud-init * Explicitly name element enable-serial-console * avoid failure if /lib/firmware doesn't exist * Tidy base image by removing /var/log files * debian: fix network on Wheezy 0.1.20 ------ * Refactor code to select boot kernel * fail at startup with no operating-system element * Add test to ensure we don't duplicate filenames * Name deploy-ironic and deploy-baremetal files uniq * Name 10-rhel-cloud-image uniquely * Name 01-install-bin uniquely * Delete redhat-common 00-usr-local-bin-secure-path * Name 99-setup-first-boot uniquely * Yum: support pkg-map in bin/install-packages * Add tar as an output type * Correct source-repository comments * dpkg: local cache for .deb files * map-services: add openvswitch * Ensure dib-run-parts profiling works with py3 and py2 * Rename old image file instead of rewrite it * Add missing dollar * Replacing deploy to deploy-baremetal in README.md * Reinstate Trusty as default for Ubuntu * Only use Ec2 cloud-init data source for Ubuntu * Remove uneeded code from pkg-map * Correct the wrong rename in rhel element * Add manifests to .gitignore * Check return code of element-info * Add new cloud-init-datasources element 0.1.19 ------ * Set DISTRO\_NAME in OS environment.d 0.1.18 ------ * Add pkg-map element * Factor out error behavior in dib-lint * Fix package removal * Create an element to allow using a dpkg manifest * Check for set -o pipefail * Set -o pipefail new scripts * Add support for source-repos gerrit refs 0.1.17 ------ * Stop using bash arrays for whitelisting in yum * Tidy up SuSE kernel selection * Parameterise PXE kernel and initrd selection * Debian: Support additional debootstrap arguments * \`set -u\` doesn't permit bash arrays to test -n * Ensure we can read the kernel out * Export unbound variable DIB\_RHSM\_USER * indent: search for !=4 spaces indentation * 4 spaces indent * Updated from global requirements * Adding -x to set parameters for more output 0.1.16 ------ * Ensure scripts are set -u * set -u and -o pipefail everywhere * Fedora: Add support for configuring Yum mirrors * dib-lint: check for tab indent in files * dib-lint: ensure file finish with a new line * add some missing \n at end of file * Add map-services for debian distros * Make sure all scripts are set -e * Allow excluding tests from certain files * Eliminate 'tr' in favor of inline bash * Support declarative package installs/uninstalls * Build raw image in separate tmpfs * debian: properly deal with Debian stable/unstable 0.1.15 ------ * Permit cache-url to work with fifos * debian: add systemd support * debian: support upstart on Wheezy * Debian element should activate eth0 * Respect inmutable resolv.conf in the image * set -e all the things * Explicitly use bash * Remove All Rights Reserved 0.1.14 ------ * Add package uninstall support * Revert default Ubuntu release back to Saucy * Add a mapping for kernel headers * Map openjdk-7-jre-headless to RHEL+SUSE * Sort rhel/bin/map-packages * Add sysv support to elements/dhcp-all-interfaces * Place /usr/lib64/ccache in PATH * Small fixes for dhcp-all-interfaces * cleaning up 01-copy-manifests-dir * Remove the temporary deploy element after rename * Use provides to note an element provides deploy * Remove dependency on /etc/lsb-release * indent: replace tab by 4 spaces * Make "trusty" (Ubuntu 14.04) the default release * Add switch to turn on caching for debian element * Remove cloudy interfaces in dhcp-all-interfaces * debian: simplify the way debian element is called 0.1.13 ------ * Fix set -eu and pipefail failures * Move instead of copy the temporary git manifest * Add mapping for mariadb rdo package * map-services: add apache2 in the list * Remove map-services from fedora element * Use provides to note an element provides an OS * Standardise manifest creation and retrieval * Remove call to depmod in busybox * apt-conf: uninitialised variables fix 0.1.12 ------ * Iterate over provided elements first * Add ability to add extra apt keys * doc: indentation rules for element * Document a little the concerns for operators * debian: use sudo to create file in the chroot * Disable splashimage for legacy grub * Change refspec used to fetch all branches and tags * fix grub2 installation on Debian Wheezy * Fix Grub configurations for Fedora images built on a UEFI host 0.1.11 ------ * Fix dhcp-all-interfaces upstart job * Fix dhcp-all-interfaces on Ubuntu/Debian * Fix resource exhaustion with upstart * Write a dpkg manifest to list installed packages * Fix "(None)" seed hostname on Debian * dhcp-all-interfaces: correct ifquery return stmt 0.1.10 ------ * Make stable-interface-names its own element * Uses policy-rc.d to prevent dpkg starting daemons * Enforce alphabetical ordering of element-deps * Alphabetize all element-deps * Add dib-lint script * Adds package mapping for mariadb packages * Adding pypi-mirror dependencies for redhat * Revert "Only create a tmpfs big enough for DIB\_MIN\_TMPFS" * debian: install cloud-init on Wheezy * Remove an excess cp of disk images * Adds "element-provides" support to element dependencies * Add console kernel parameters to extlinux configuration * Permit use of wheel mirrors in pypi element * baremetal: correct the path of ifcfg-eth0 * Adds libmariadb-dev package mapping * rename udev.rules to dhcp-all-interfaces-udev * serial-console: Use udev rules to startup getty * Set +x on executable files 0.1.9 ----- * DHCP: make udev rules want dhcp-interface@.service * Add RHEL 7 image element * Use redhat-common in fedora element * Add redhat-common element * Correct README.md markdown errors * Support adding DHCP interfaces one at a time * Move install type enablement into base element * Remove hardcoded /tftpboot/ from token's tftp path * RHEL Package maps for build-essential, python-dev and libz-dev * Extract move cache logic to a function * Always export IMAGE\_NAME * baremetal element: Enable stable interface names * Fixup all occurrences of REPONAME for replacing '-' * Create a git manifest from source-repositories * Add apache2 mod\_wsgi pkg map for suse * Updated from global requirements * 98-source-repositories tries to return from script * Add libaio1 to libaio pkg map for fedora * Only create a tmpfs big enough for DIB\_MIN\_TMPFS * Additional swift storage service mappings * Update openSUSE package mapping for libffi-dev * Better apt-sources docs * Add nfs-common package mapping * Replace more then just "-" in REPONAME * Bash eval the lines in source-repository scripts * Fix spelling error in "vm" element README.md * Add $EXTRA\_ARGS back to yum call * Update the image name for RHEL Guest Image * Alphabetize openSUSE services dictionary * Alphabetize openSUSE packages dictionary * Alphabetize Fedora services dictionary * Alphabetize Fedora packages dictionary * Enable extlinux support for (non-Ubuntu) Debian platforms * Replace use of show-ref with name-rev 0.1.8 ----- * Fix syntax error in GRUB\_OPTS env var handling * Update README formatting and content * Improve local-config proxy handling * Enable custom apt.conf in apt-conf element * Add rsync to the package list used by debootstrap * Enable simple modification of git repo location * Add NFS package mapping * Improve usability of the source-repositories cache * Fix unbound variable in debian element 0.1.7 ----- * Replace security.ubuntu.com when setting mirror * Generalize install-packages for yum * Remove accidental merge marker * Add libvirt-bin -> libvirtd to map-services * Make max-online-resize an option * Correct DIB long option parsing * Add 00-fedora-fixup-vim * Update pypi element to suggest pypi-mirror * Permit using arbitrary PyPI urls * Pep8/Pyflakes fixing * Shift debian element to DIB\_DISTRIBUTION\_MIRROR * Revert "Add Fedora DHCP interfaces via udev rules." * Revert "Support adding DHCP interfaces one at a time. " * Teach cache-url to handle file:// URIs 0.1.6 ----- * Remove tox locale overrides * Add Fedora DHCP interfaces via udev rules * Support adding DHCP interfaces one at a time * Rename Openstack to OpenStack * Don't hardcode environment.d * Add more package name mappings for openSUSE * Add lsof package to all Fedora images * ifquery doesn't exist on Fedora * Remove unneeded service mapping for mysql on openSUSE * Fix misspellings in diskimage-builder * Fix kernel extraction on openSUSE * Adjust neutron package install for Fedora * Make the MIRROR\_TARGET directory if it didn't exist * Add tgt service mapping for Fedora * Update openSUSE package mappings for OpenStack * Updated from global requirements * Update map-services for Fedora * Add Fedora packages mappings for snmpd * Add mysql mapping for Fedora * Add package map for stunnel4 * Add ability to use local cloud image * Add a service mapping for openSUSE * Add bash as a dependency to the deploy ramdisk * Include /lib64 into the deploy ramdisk on openSUSE * Fix tftp mapping on openSUSE * Use /usr/bin/env, not /bin/env 0.1.5 ----- * Rename generate-interfaces-file.sh.. * Only configure DHCP for real interfaces * Add map-services * Skip relabel unless SELinux is enforcing * Mount root filesystem readonly during boot * Fix kernel/initrd extraction for SUSE based distros * Fix ramdisk element for openSUSE * Workaround broken udev update on openSUSE * Make copy\_required\_libs() more robust * Add Copyright and License header to debian element * Setup ccache symlinks on openSUSE * Add support for Red Hat Satellite * Support list of Red Hat channels and repos * Add support Red Hat Network (RHN) * Update default RHEL guest image * Create a new baremetal element * Fix mysql package mappings for opensuse * fedora/RHEL: use env from /usr/bin * Allow use of mirrors when building Ubuntu images * Update to Fedora 20 * Convert -dev to -devel in fedora/map-packages * Fix the curl command in the ironic-deploy element * Move Babel and argparse from test-requirements.txt * Symlink correct element install type * dib-run-parts should dereference symlinks * Add debian-upstart for experimenting with upstart * Allow adding packages to debootstrap * Add support for Debian * Wait for tgtd socket to be available 0.1.4 ----- * Add new modprobe-blacklist element * Install traceroute on Fedora * Retry link check up to 10 times * Implement serial-console for systemd * Removing the config-applier element * Add package support to source-repositories * Increase padding to allow for smaller images * Remove old versions of grub2 from the yum cache * Implement dhcp-all-interfaces for systemd * Install tcpdump on Fedora * Mark install-packages +x * Make sure a loop device exists before kpartx is called * Fixed command dib-init-system not found error * Refactor unmount\_image with unmount\_dir * Fixed device or resource busy issue in EXIT trap * Add a package mapping for libvirt-dev 0.1.3 ----- * Log unsupported source repository types * Improve source-repositories git caching * Add element to modify /etc/apt/sources.list in dib * Fix package-mappings for openSUSE * Update login.defs on openSUSE * Make sure sbin paths are in $PATH 0.1.2 ----- * Add -U to pip install command in tox.ini * Add zypper element * Increase the size heuristic for images * opensuse: Update README.md * Fix $TARGET\_ROOT usage in yum element * local-config: Configure proxy for zypper repos * Updates tox.ini to use new features * Quieten disk-image-get-kernel 0.1.1 ----- * Add support for building openSUSE images * Add examples for ramdisk-image-create * Fix no busybox symlinks issue on rhel * Log the repository fetches in source-repositories * Default name for ramdisks to image * Add deploy ramdisk element for Ironic 0.1.0 ----- * Modify /etc/selinux/config if it exists * Drop default distribution root element support * Remove dot after TMP\_HOOKS\_PATH * Store DIB\_\* only env variables * Remove the dot typo in extra-data script * Updates .gitignore * Switch Ubuntu element to installing saucy * Enhance dib-run-parts usage message * Add mapping for tgt to RHEL element * Update openssl for Fedora * Add option --image-size * Fix typo in source-repositories README 0.0.11 ------ * Detect udevd version and behave accordingly * Fix issue with Ubuntu grub pre-install step for ARM * Check existence of rhel rpm key * Fix troubleshooting override * Support building wheels (PEP-427) * Document ramdisk troubleshooting * Add troubleshooting override to deploy ramdisk * Add mapping for gearmand * Make pxe\_mac accurate in two common cases * /bin/bash all the things * Split network bringup out of base ramdisk init * Don't block the upstart daemon if it doesn't exist * Make sorting of ramdisk init elements explicit * Provide a way of determining init system used * Usage message enhancement 0.0.10 ------ * Add mapping for libffi-dev * Allow heat-admin to sudo without tty * Python code refactorings * Add \*.egg to .gitignore * Remove BUSYBOX variable from ramdisk-defaults * Replace assertEquals with assertEqual * Updated from global requirements 0.0.9 ----- * Check existence of directory 'lost+found' * Remove mapping of atftpd to tftpd-server * Remove dependency on dracut-network * Add redhat mapping from tftpd-hpa to tftp-server 0.0.8 ----- * Add apache and mod\_wsgi to Fedora's package map * Allow for bad Fedora image mirrors * exit 44 if http 404 is returned * Ignore basename failures * Dracut regenerate initrd w/ the right kernel * Fix disk-image-get-kernel for redhat * Remove framebuffer video drivers from ramdisks * Remove old-kernels for fedora 0.0.7 ----- * Conditionally add dhcp-all-interfaces 0.0.6 ----- * Remove \r chars from dhcp-all-interfaces * Make dhcp-all-interfaces block all interfaces * Fix ifquery call in dhcp-all-interfaces * Allow for redirects to ftp servers * Updated from global requirements * Specify distro release in fedora image name * Move /tmp/ccache setup to base element * Use --numeric-owner when extracting base image * Mount /dev/pts in chroot * Using python to run testr instead * Make RHEL subscription optional 0.0.5 ----- * Increase journal size to 64 M for ext4 file system * Fix mellanox module loading * Ignore empty files returned by curl * Generate interfaces file before cloud-init runs * Updated from global requirements * Fix typo in dhcp-all-interfaces * Set locale for the profiling printf command * Update from requirements 0.0.4 ----- * Deprecate first-boot.d * Add mapping for atftpd in fedora/rhel * Make RHEL subscriptions optional * Add RHEL mapping for openssh-client * Add RHEL mapping for augeas-tools * Add RHEL mapping for default-jre * Translations license statement correction 0.0.3 ----- * Do not prompt on removal of apt-xapian-index from ubuntu cloud images * Add DIB\_IMAGE\_CACHE 0.0.2 ----- * Remove apt-xapian-index from ubuntu cloud images * Use lazy umount to avoid race problems with dev * Remove github references * Move textmode forcer to vm element * Fix grub/linux text mode override * Add deploy-kexec element * Consolidate the checks for /etc/grub * Check cached file size when downloading an url * Fedora 19 has no grub2 conf file * Install fedora grub from cached rpm during finalise * Remove -r option from kpartx for successful build * Fixes files ordering when choosing newest image * Add package mapping for default-jre * Set raw image size to be multiple of 64k 0.0.1 ----- * Delete -new image once copied * Add --list support to dib-run-parts * On Fedora, use Linux Foundation bzr lsb\_release * Add support for file to source-repositories * Install patch for dracut patching * Add rhel installation element * Add option --min-tmpfs to disk-image-create * Add package mappings for MySQL-MariaDB * Combine compress and save image into one function * Extlinux fallback * Rename 51-grub to 51-bootloader * Add a pip-cache element * Fix URL to os-apply-config * qpid package mappings * Call sync before unmounting keeps the mount from being busy * Remove a device mapping, then let the loop device get removed * Extracting common functionality for rpm based distros * Use kpartx if partition device doesn't exist * Set file permission to be executable * Fixed a network setup issue for F19 * Update stackforge references to openstack * Package dib-run-parts * Add yum element * dkms is unavailable on RHEL and derivatives * Fix pypi element README.md errors * Allow using a pypi mirror to install via pip * Make $HOME in the chroot be reasonable * Cleanup mount points automatically * Change the rootfs label in F18 and F19 * Remove explicit sudoers requirement * Document the dangers of co-existing elements * Blacklist H803 * Capture the repositories from source-repositories * Improve caching documentation * Package with pbr * Add a new break on error * Ensure $TMP\_BUILD\_DIR is actually created * Modify relative paths of lib, elements for packaging * Add binaries for setuptools * Make Ubuntu 13.04 (raring) the default release * Ignore emacs autosave files in source-repositories * Provide hint for what package contains qemu-img * Fix hacking errors * Add downloadonly flag to fedora * Fixed up test-requirements * Add needed symlink for Fedora deployment ramdisk * Install which on Fedora * Only remove $TMP\_BUILD\_DIR on cleanup * Enable running disk-image-create on SUSE Linux * Update TripleO incubator URL reference * Support repo names with multiple '-'s * Set work-dir to cached repository * Move the getsources hook earlier * Cache repository-sources data * Update the Fedora element to honour --offline * Enable --offline support for Ubuntu root images * Fix the DIB\_OFFLINE setting to actually work * Document an interface for offline operation * Allow 'sudo kpartx -d' used in EACTION for Fedora * Move end user docs higher up in README.md * Remove excess whitespace in README.md * Fedora 19 GRUB * Fix for mounted readonly filesystem for Fedora 19 * EFI hosts * F19 GRUB configuration file * Add package mappings for augeas-tools and openssh-client * Build ramdisks in an image chroot * Make cloud-init-nocloud work cross-platform * Update Fedora cloud image to its latest version * Adding docs for the source-repositories element * Use ccache to cache all compiles between builds * Add environment.d hook to setup environment * Curl to redo the request (Found 302) * Fix loop0p2 does not exist on F19 * Add arping to the fedora map-packages * Fix 50-firmware.rules no such file on Fedora 19 * Add mysql-devel to fedora map-packages * Fix cache-url to use single '=' in test expression * Fix cloud-init routing issue on Fedora * Move functions to common-functions for reuse * Factor out element processing * Consolidate more ramdisk and disk-image code * Fix pyOpenSSL on Fedora * Improve debugging of missing elements * Fix unit tests to have accurate return code * Use the source-repository interface * Install git with source-repositories element * Use full path to dib-run-parts during firstboot * Enable Flake8 F\*\*\* checks * Switch from pep8 to flake8/hacking * Re-use cache\_url() in fedora element * Improve first time download of ubuntu images * Use dib-run-parts on dib-first-boot * Reduce duplication between ramdisk and disk image codepaths * Add mechanism to send error messages to helper * Make bash troubleshooting configurable * Make the finalise\_base function less Ubuntu-ish * Adding element to get source for elements * deploy element: Call find\_disk in loop w/ timeout * Add disable-selinux element * dib-run-parts was failing with empty targets * Add /usr/local/bin to the secure\_path variable * Fix cloud-init-nocloud to actually work * Stop apt-get installing qemu-img * Change the rootfs label in fedora's /etc/fstab * Add zlib-devel and qemu-img to fedora map-packages * Document some dependencies * Add RedHat support for disk-image-get-kernel * Add dracut-network element * Add fedora support for ramdisk-image-create * Remove obsolete Fedora rc-local install.d hook * Switch from losetup+partprobe to kpartx for Fedora image creation * Move package install of dkms to install.d * Fix fedora element to work with qcow2 images * Install dkms before using it * Build all dkms modules near the end of the image build * Set correct mode for .ssh/authorized\_keys files * Update sudoers rules for 1PB resizing * Increase the size heuristic for images * The ext4 resize fix was faulty - fix it * Basic wall clock profiling per element script * Move the ensure\_nbd function call * Ensure that the ext4 fs can be rebuilt up to 1PB in size * Force text mode console in base element * Refactor the first boot routine * Run fixfiles restore in chroot instead of firstboot * Trigger SELinux autorelabel on first boot * An element for putting SELinux in permissive mode * Fix for running /etc/rc.local on Fedora * Honor $DIB\_IMAGE\_SIZE * install redhat-lsb before pre-install.d baseline-tools * install redhat-lsb-core instead of redhat-lsb * Enable serial console for fedora * Fix fedora fstab so / is mounted rw properly * Add an element to configure a serial console * Retry losetup -d for up to 10 seconds * Force the inclusion of /usr/local/bin in PATH * Tweak the moved cleanup\_dirs to match the original * Remove img-functions from ramdisk-image-create * Ignore errors when ldd'ing static binaries * Extend mellanox support to disk images * Reinstate support for real hardware with Ubuntu * Remove tripleo PPA from base element * Only use tmpfs if build machine has 4GB+ RAM * Use conditional GET to fetch latest ubuntu image * Revert "Improve Fedora build host support." * Fix architecture filter * Unbreak grub for precise * Fix GRUB command quote escape for VM element * Fix GRUB for for precise * Fix missing export of $ARCH * Improve Fedora build host support * Use a different approach to solving the ramdisk-image-create failure * Source img-functions into common-functions * Build images using loopdev instead of qemu-nbd * Add few other packages to the map list for fedora * Fix up the conflict between audit and glibc packages * Improve Fedora build host support: architectures * Fix Ubuntu image fetching * Fix a small typo in fake init scripts * Adds support for post-install scripts * Grab the next available /dev/nbdX * Allow build dir to be changed from /tmp * Migrate cloud image URL/Release options to DIB\_ * Introduce the DIB\_ namespace for build-time config * Fedora element allows root to sudo without TTY * Generate ssh hostkeys on first-boot * Add armhf support * Always include the in-tree elements directory * Delete elements moved to tripleo-image-elements * Update README.md for build-time state capture * Fix mysql migration script to handle errors * Remove strict sql\_mode setting which breaks apps * Do not require arguments for os-svc-daemon * Store build-time settings * Disable tunneling in quantum-ovs * Migrate data into MySQL from bootstrap * Run os-config-applier using os-refresh-config * Bring os-svc-install element docs up-to-date * Enable use\_namespaces setting for quantum agents * Clearly mark unaudited config templates as such * Replace glance-api+glance-reg elements with glance: * Streamline upstart scripts in os-svc-daemon * Add a nova-baremetal element * Add a quantum element * Run all openstack services in virtualenvs: * Add element to run DHCP on all network interfaces * Create users in mysql server based on metadata * Set mysql server\_id based on instance-id * Refactor mysql element to do less in first-boot.d * Adding cfn-credentials file to heat-cfntools * remove unnecessary '/usr/local/bin' from install.d * Install os-config-applier from stackforge repo * Switch to using the incubator-bootstrap tree * Fix os-refresh-config failing without scripts * Remove duplicate file extensions * Correctly translate all branches/tags/shas: * Update keystone middleware in cinder api-paste: * Fix script that installs os-refresh-config scripts * local-config: Configure proxy for apt and/or yum * Fix issues causing Fedora images to fail * Seperate install of services and start scripts: * Update keystone element to use os-refresh-config * Make 99-install-config-templates executable: * Install os-refresh-config scripts automatically * local-config element adds authorized\_key for root: * Integrate os-refresh-config with heat-cfntools * Allow elements to include skeleton config * Add a cinder element * Namespace SHA256SUMS file to distro/release/arch * Fix heat-cfntools to work on Fedora * Verify Ubuntu Cloud Images using SHA256SUMS * Fix elements\_path default path * Use multiple locations for elements dir * Specify os-refresh-config path in README * Don't use sudo in base * Add an openstack all-openstack-db element: * Devstack element pulls from master * Fix ramdisk-image-create * Run alternatives pip -> pip-python * Install heat-cfntools from pypi * Support multiple outputs disk formats * Prevent silent failure of element-info: * Fix the sudo rules for unpacking fedora raw images * first-boot.d scripts log to a file: * Fedora needs to depend on dib-run-parts too * New element that uses a fedora cloud image as the base * Add dib-run-parts install command to sudoers.d * Use dib-run-parts for running scripts in target * Make populate\_libs() more generic * Work in progress run-parts replacement * Move the dpkg specific stuff to a dpkg element rather than being hardcoded * Change run-parts usage to be compatible with Fedora * Give stack user passwordless sudo: * Consolidate common OS installation into a script: * Bad code landed, causing ubuntu to be always landed * cloud-init-nocloud element for non-cloud image * Add cfn-hup configuration for os-refresh-config * Fix broken pep8 in setup.py * Add element to call os-refresh-config * Add default element selection * Correct misuse of return in ramdisk-image-create * Fix unnecessarily creating a temporary directory * ramdisk-image-create shows a failed binary dependency * The default ARCH was broken due to $ARCH not being exported * Add missing python-pip dependency in heat-jeos * Work around cfn API bug in HEAT w/ specific boto * Move initial root contents into a hook * Make it possible for openstack-CI to run tests * Export the ELEMENTS\_DIR so that dependencies work * Add os-config-applier element * Split stack user creation out of devstack element * Improve error message for missing element * Create install-packages as a binary * Add option to clear environment * Switch locale to C * Add sudoers rule to format and mount anykind of partitions in disks * Add openstack-all element * Add element to install config-applier * Enable 'ec2-user' in HEAT for quantal images * Add a simple implementation of element dependency * Disable Apt Recommends * add default gateway to deploy init script * Allow manual installation of packages * Include English locale in base * Install nova-api from github * Add Icinga elements * Add missing whitespace to local-config * Replace demo references with incubator * Add an element to install the HEAT JEOS tools * Install quantum-api from github * Clean up the MySQL element to make it suitable for generic use * Fix disk-image-create's getopt error handling: * Tidy up base element: * Add guidelines for composing elements * Copy both http and https proxy to local-config * Add a test framework for testing elements * Ignore .pyc files * Add a .testr.conf configuration and ignore .testrepository * Add the ability to break into a shell during builds * Add glance-api element * Move everything 'common' into base, making it avoidable for tests * Make it possible to not recompress the qcow2 image at the end * Added true to avoid exit on error * updating devstack element to reference incubator * Add keystone element * Add copyright to lib/ramdisk-\* * Generate apt.conf files with correct content, fixes bug 1088805 * Further fleshing out of hwdiscovery element * Move grub installation to the vm element * Rename flavour to element * Configure git proxy settings and prefer http(s) protocol * Use system resolv.conf file when available * Remove udev stuff from the source tree * Add .gitreview file * Jenkins image fixed * Reinstate /mnt redirection of jenkins - HPCS cloud images have a very restricted / * Untrap EXIT before run-parts * Update hwdiscovery flavour to have lots more structure that we can build on * fix crappy header * Updated jenkins flavour * Make a primitive jenkins image * be smarter about mounting qcow images * Use base in all examples * added br\* filter for interfaces * adding BASIC hardware discovery * adding dhclient support * adding dhclient * move misplaced salt-master install script * mount\_qcow\_image should mount p1 * removes AMQP install and adds hwinfo * added lsmod to default busybox links * add salt-master flavor * remove force-xtrace in disk-image-get-kernel * add some tooling that baremetal-devstack wants * move tgtd & tgtadm to bin-deps of deploy and remove from lib/ramdisk-functions * Adding python-AMQPLib install to HWdiscovery * Fix copyrights for HP work * Add a flavour for doing generic this-node-is-in-a-cloud stuff, like cloud-init tweaks * adding mysql flavor (untested) * Document more about the layers * Some cleanup on nova-vm flavour * Add support for flavours to ship udev rules.d files and port over the mellanox variant to use this * Fix mysql passwords * Default to 2G in size - 1G is just too small * Fix handling of parameters that are not set by any flavour for eval\_run\_d * Make it possible to set a size from within a flavour, and use that for devstack * Rename baremetal to deploy * Remove some whitespace * Update ramdisk building to support init hooks for flavours * Update docs for ramdisk building * Add readmes to the ramdisk flavours * Documented binary-deps feature * Port old baremetal-mkinitrd.sh to the new image creation standards * Land an extension of baremetal-mkinitrd.sh which can also build flavours, with a start at making hwdiscovery and hwburning flavours * Bring across disk image code * Ignore temporary files * Support KVM instances - allow /dev/vda to be detected as a disk * Turn off udev logging, it makes debugging too hard. Better would be to log to a file or something * change working directory name template * Rename to baremetal-mkinitrd.sh * initial commit ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/LICENSE0000664000175000017500000002613615201026231015072 0ustar00zuulzuul Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4512393 diskimage_builder-3.42.0/PKG-INFO0000644000175000017500000000576115201026275015171 0ustar00zuulzuulMetadata-Version: 2.4 Name: diskimage-builder Version: 3.42.0 Summary: Golden Disk Image builder. Home-page: https://docs.openstack.org/diskimage-builder/latest/ Author: OpenStack Author-email: openstack-discuss@lists.openstack.org License: Apache License (2.0) Classifier: Development Status :: 5 - Production/Stable Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Environment :: Console Requires-Python: >=3.8 License-File: LICENSE Requires-Dist: networkx>=2.3.0 Requires-Dist: pbr!=2.1.0,>=2.0.0 Requires-Dist: PyYAML>=3.12 Requires-Dist: stevedore>=1.20.0 Requires-Dist: flake8<7.0.0,>=3.6.0 Requires-Dist: jsonschema>=3.0.2 Dynamic: author Dynamic: author-email Dynamic: classifier Dynamic: description Dynamic: home-page Dynamic: license Dynamic: license-file Dynamic: requires-dist Dynamic: requires-python Dynamic: summary ================================== Image building tools for OpenStack ================================== ``diskimage-builder`` is a flexible suite of components for building a wide-range of disk images, filesystem images and ramdisk images for use with OpenStack. This repository has the core functionality for building such images, both virtual and bare metal. Images are composed using `elements`; while fundamental elements are provided here, individual projects have the flexibility to customise the image build with their own elements. For example:: $ DIB_RELEASE=bionic disk-image-create -o ubuntu-bionic.qcow2 vm ubuntu will create a bootable Ubuntu Bionic based ``qcow2`` image. ``diskimage-builder`` is useful to anyone looking to produce customised images for deployment into clouds. They are used extensively to build images for testing OpenStack itself, particularly with `nodepool `__. Platforms supported include AlmaLinux, CentOS Stream, Debian, Fedora, RHEL, Rocky Linux and Ubuntu. Full documentation, the source of which is in ``doc/source/``, is published at: * https://docs.openstack.org/diskimage-builder/latest/ Copyright ========= Copyright 2012 Hewlett-Packard Development Company, L.P. Copyright (c) 2012 NTT DOCOMO, INC. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/README.rst0000664000175000017500000000347115201026231015551 0ustar00zuulzuul================================== Image building tools for OpenStack ================================== ``diskimage-builder`` is a flexible suite of components for building a wide-range of disk images, filesystem images and ramdisk images for use with OpenStack. This repository has the core functionality for building such images, both virtual and bare metal. Images are composed using `elements`; while fundamental elements are provided here, individual projects have the flexibility to customise the image build with their own elements. For example:: $ DIB_RELEASE=bionic disk-image-create -o ubuntu-bionic.qcow2 vm ubuntu will create a bootable Ubuntu Bionic based ``qcow2`` image. ``diskimage-builder`` is useful to anyone looking to produce customised images for deployment into clouds. They are used extensively to build images for testing OpenStack itself, particularly with `nodepool `__. Platforms supported include AlmaLinux, CentOS Stream, Debian, Fedora, RHEL, Rocky Linux and Ubuntu. Full documentation, the source of which is in ``doc/source/``, is published at: * https://docs.openstack.org/diskimage-builder/latest/ Copyright ========= Copyright 2012 Hewlett-Packard Development Company, L.P. Copyright (c) 2012 NTT DOCOMO, INC. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.306236 diskimage_builder-3.42.0/bin/0000775000175000017500000000000015201026275014635 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/bin/dib-lint0000775000175000017500000002323115201026231016256 0ustar00zuulzuul#!/bin/bash # Copyright 2014 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. # This script checks all files in the "elements" directory for some # common mistakes and exits with a non-zero status if it finds any. set -eu set -o pipefail ELEMENTS_DIR=${ELEMENTS_DIR:-diskimage_builder/elements} LIB_DIR=${LIB_DIR:-diskimage_builder/lib} parse_exclusions() { # Per-file exclusions # Example: # dib-lint: disable=sete setpipefail local filename=$1 local disable_pattern="# dib-lint: disable=" local exclusions=$(grep "^$disable_pattern.*$" $filename | sed "s/$disable_pattern//g") # Global exclusions read from tox.ini # Example section in tox.ini: # [dib-lint] # ignore = sete setu section="dib-lint" option="ignore" global_exclusions=$(python - < ${UNSORTED} sort ${UNSORTED} > ${SORTED} if [ -n "$(diff -c ${UNSORTED} ${SORTED})" ]; then error "$i is not sorted alphabetically" diff -y ${UNSORTED} ${SORTED} fi fi # for consistency, let's just use #!/bin/bash everywhere (not # /usr/bin/env, etc) regex='^#!.*bash' if [[ "$firstline" =~ $regex && "$firstline" != "#!/bin/bash" ]]; then error "$i : only use #!/bin/bash for scripts" fi # Check that all scripts are set -eu -o pipefail and look for # DIB_DEBUG_TRACE # NOTE(bnemec): This doesn't verify that the set call occurs high # enough in the file to be useful, but hopefully nobody will be # sticking set calls at the end of their file to trick us. And if # they are, that's easy enough to catch in reviews. # Also, this is only going to check bash scripts - we've decided to # explicitly require bash for any scripts that don't have a specific # need to run under other shells, and any exceptions to that rule # may not want these checks either. if [[ "$firstline" =~ '#!/bin/bash' ]]; then if ! excluded sete; then if [ -z "$(grep "^set -[^ ]*e" $i)" ]; then error "$i is not set -e" fi fi if ! excluded setu; then if [ -z "$(grep "^set -[^ ]*u" $i)" ]; then error "$i is not set -u" fi fi if ! excluded setpipefail; then if [ -z "$(grep "^set -o pipefail" $i)" ]; then error "$i is not set -o pipefail" fi fi if ! excluded dibdebugtrace; then if [ -z "$(grep "DIB_DEBUG_TRACE" $i)" ]; then error "$i does not follow DIB_DEBUG_TRACE" fi fi fi # check that environment files don't "set -x" and they have no executable # bits set if [[ "$i" =~ (environment.d) ]]; then if grep -q "set -x" $i; then error "Environment file $i should not set tracing" fi if [[ -x $i ]]; then error "Environment file $i should not be marked as executable" fi fi # check for # export FOO=$(bar) # calls. These are dangerous, because the export hides the return # code of the $(bar) call. Split this into 2 lines and -e will # fail on the assignment if grep -q 'export .*\$(' $i; then error "Split export and assignments in $i" fi # check that sudo calls in phases run outside the chroot look # "safe"; meaning that they seem to operate within the chroot # somehow. This is not fool-proof, but catches egregious errors, # and makes you think about it if you're doing something outside # the box. if ! excluded safe_sudo; then if [[ $(dirname $i) =~ (root.d|extra-data.d|block-device.d|finalise.d|cleanup.d) ]]; then while read LINE do if [[ $LINE =~ "sudo " ]]; then # messy regex ahead! Don't match: # - explicitly ignored # - basic comments # - install-packages ... sudo ... # - any of the paths passed into the out-of-chroot elements if [[ $LINE =~ (dib-lint: safe_sudo|^#|install-packages|TARGET_ROOT|IMAGE_BLOCK_DEVICE|TMP_MOUNT_PATH|TMP_IMAGE_PATH) ]]; then continue fi error "$i : potentially unsafe sudo\n -- $LINE" fi done < $i fi fi # check that which calls are not used. It is not built in and is missing # from some constrained environments if ! excluded which; then while read LINE do if [[ $LINE =~ "which " ]]; then # Don't match: # - explicitly ignored # - commented if [[ $LINE =~ (dib-lint: which|^#) ]]; then continue fi error "$i : potential use of which\n -- $LINE" fi done < $i fi done echo "Checking indents..." for i in $(find $ELEMENTS_DIR -type f -and -name '*.rst' -or -type f -executable) \ $(find $LIB_DIR -type f); do # Skip files in .gitignore if git check-ignore -q "$i" ; then echo Skipping $i continue fi # Check for tab indentation if ! excluded tabindent; then if grep -q $'^ *\t' ${i}; then error "$i contains tab characters" fi fi if ! excluded newline; then if [ "$(tail -c 1 $i)" != "" ]; then error "No newline at end of file: $i" fi fi done if ! excluded mddocs; then md_docs=$(find $ELEMENTS_DIR -name '*.md') if [ -n "$md_docs" ]; then error ".md docs found: $md_docs" fi fi echo "Checking YAML parsing..." for i in $(find $ELEMENTS_DIR -type f -name '*.yaml'); do echo "Parsing $i" py_check=" import yaml import sys try: objs = yaml.safe_load(open('$i')) except yaml.parser.ParserError: sys.exit(1) " if ! python -c "$py_check"; then error "$i is not a valid YAML file" fi done echo "Checking pkg-map files..." for i in $(find $ELEMENTS_DIR -type f \ -name 'pkg-map' -a \! -executable); do echo "Parsing $i" py_check=" import json import sys try: objs = json.load(open('$i')) except ValueError: sys.exit(1) " if ! python -c "$py_check"; then error "$i is not a valid JSON file" fi done if [[ $rc == 0 ]]; then echo "PASS" else echo "*** FAIL: Some tests failed!" fi exit $rc ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/bindep.txt0000664000175000017500000000312115201026231016054 0ustar00zuulzuul# This is a cross-platform list tracking distribution packages needed by tests; # see https://docs.openstack.org/infra/bindep/ for additional information. # common binutils bzip2 util-linux dosfstools gdisk kpartx sudo curl git podman [!platform:debian-buster !platform:debian-stretch !platform:ubuntu-trusty !platform:ubuntu-bionic !platform:ubuntu-focal !platform:suse !platform:gentoo] squashfs-tools [!platform:suse] squashfs [platform:suse] zypper [!platform:debian-stretch !platform:redhat !platform:ubuntu-trusty !platform:ubuntu-bionic !platform:ubuntu-focal !platform:ubuntu-jammy] gnupg2 [!platform:redhat !platform:ubuntu-trusty !platform:suse] # ubuntu apt-transport-https [platform:dpkg] inetutils-ping [platform:dpkg] qemu-utils [platform:dpkg] rpm [platform:dpkg] uuid-runtime [platform:dpkg] debootstrap [platform:dpkg] zstd [platform:dpkg] procps [platform:dpkg] libguestfs-tools [platform:dpkg] # Version/distro specific items python-lzma [platform:ubuntu-bionic platform:debian-buster] yum-utils [platform:ubuntu-bionic platform:debian-buster] dnf [platform:dpkg !platform:debian-buster !platform:ubuntu-trusty !platform:ubuntu-bionic !platform:ubuntu-focal] # centos/fedora qemu-img [platform:redhat] libguestfs [platform:redhat] policycoreutils-python [platform:rhel-7 platform:centos-7] policycoreutils-python-utils [platform:fedora platform:rhel-8 platform:centos-8] procps-ng [platform:redhat] yum [platform:redhat] yum-utils [platform:redhat] # suse python-pyliblzma [platform:suse] yum-utils [platform:suse] qemu-tools [platform:suse] debootstrap [platform:suse] procps [platform:suse] ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.306236 diskimage_builder-3.42.0/diskimage_builder/0000775000175000017500000000000015201026275017530 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/__init__.py0000664000175000017500000000000015201026231021617 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3082361 diskimage_builder-3.42.0/diskimage_builder/block_device/0000775000175000017500000000000015201026275022141 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/__init__.py0000664000175000017500000000000015201026231024230 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/blockdevice.py0000664000175000017500000004404115201026231024760 0ustar00zuulzuul# Copyright 2016-2017 Andreas Florath (andreas@florath.net) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import codecs import collections.abc import json import logging import os import pickle import pprint import shutil import yaml from diskimage_builder.block_device.config import config_tree_to_graph from diskimage_builder.block_device.config import create_graph from diskimage_builder.block_device.exception import \ BlockDeviceSetupException from diskimage_builder.block_device.utils import exec_sudo logger = logging.getLogger(__name__) def _load_json(file_name): """Load file from .json file on disk, return None if not existing""" if os.path.exists(file_name): with codecs.open(file_name, encoding="utf-8", mode="r") as fd: return json.load(fd) return None class BlockDeviceState(collections.abc.MutableMapping): """The global state singleton An reference to an instance of this object is saved into nodes as a global repository. It wraps a single dictionary "state" and provides a few helper functions. The state ends up used in two contexts: - The node list (including this state) is pickled and dumped between cmd_create() and later cmd_* calls that need to call the nodes. - Some other cmd_* calls, such as cmd_writefstab, only need access to values inside the state and not the whole node list, and load it from the json dump created after cmd_create() """ # XXX: # - we could implement getters/setters such that if loaded from # disk, the state is read-only? or make it append-only # (i.e. you can't overwrite existing keys) def __init__(self, filename=None): """Initialise state :param filename: if :param:`filename` is passed and exists, it will be loaded as the state. If it does not exist an exception is raised. If :param:`filename` is not passed, state will be initalised to a blank dictionary. """ if filename: if not os.path.exists(filename): raise BlockDeviceSetupException("State dump not found") else: self.state = _load_json(filename) assert self.state is not None else: self.state = {} def __delitem__(self, key): del self.state[key] def __getitem__(self, key): return self.state[key] def __setitem__(self, key, value): self.state[key] = value def __iter__(self): return iter(self.state) def __len__(self): return len(self.state) def save_state(self, filename): """Persist the state to disk :param filename: The file to persist state to """ logger.debug("Writing state to: %s", filename) self.debug_dump() with open(filename, "w") as fd: json.dump(self.state, fd) def debug_dump(self): """Log state to debug""" # This is pretty good for human consumption, but maybe a bit # verbose. nice_output = pprint.pformat(self.state, width=40) for line in nice_output.split('\n'): logger.debug('{0:{fill}{align}50}'.format( line, fill=' ', align='<')) class BlockDevice(object): """Handles block devices. This class handles the complete setup and deletion of all aspects of the block device level. A typical call sequence: cmd_init: initialize the block device level config. After this call it is possible to e.g. query information from the (partially automatic generated) internal state like root-label. cmd_getval: retrieve information about the (internal) block device state like the block image device (for bootloader) or the root-label (for writing fstab). cmd_create: creates all the different aspects of the block device. When this call is successful, the complete block level device is set up, filesystems are created and are mounted at the correct position. After this call it is possible to copy / install all the needed files into the appropriate directories. cmd_writefstab: creates the (complete) fstab for the system. cmd_umount: unmount and detaches all directories and used many resources. After this call the used (e.g.) images are still available for further handling, e.g. converting from raw in some other format. cmd_cleanup: removes everything that was created with the 'cmd_create' call, i.e. all images files themselves and internal temporary configuration. cmd_delete: unmounts and removes everything that was created during the 'cmd_create' all. This call should be used in error conditions when there is the need to remove all allocated resources immediately and as good as possible. From the functional point of view this is mostly the same as a call to 'cmd_umount' and 'cmd_cleanup' - but is typically more error tolerance. In a script this should be called in the following way: dib-block-device init ... # From that point the database can be queried, like ROOT_LABEL=$(dib-block-device getval root-label) Please note that currently the dib-block-device executable can only be used outside the chroot. dib-block-device create ... trap "dib-block-device delete ..." EXIT # copy / install files dib-block-device umount ... # convert image(s) dib-block-device cleanup ... trap - EXIT """ def _merge_rootfs_params(self): """Merge rootfs related parameters into configuration To maintain compatability with some old block-device environment variables from before we had a specific block-device config, disk-image-create provides a "parameters" file that translates the old bash-environment variables into a YAML based configuration file (``self.params``). Here we merge the values in this parameters file that relate to the root file-system into the final configuration. We look for the ``mkfs_root`` node in the new config, and pull the relevant settings from the parameters into it. """ for entry in self.config: for k, v in entry.items(): if k == 'mkfs': if 'name' not in v: continue if v['name'] != 'mkfs_root': continue if 'type' not in v \ and 'root-fs-type' in self.params: v['type'] = self.params['root-fs-type'] if 'opts' not in v \ and 'root-fs-opts' in self.params: v['opts'] = self.params['root-fs-opts'] if 'label' not in v \ and 'root-label' in self.params: if self.params['root-label'] is not None: v['label'] = self.params['root-label'] else: # The default label is "cloudimg-rootfs" # for historical reasons (upstream # images/EC2 defaults/cloud-init etc). We # want to remain backwards compatible, but # unfortunately that's too long for XFS so # we've decided on 'img-rootfs' in that # case. Note there's separate checks if # the label is specified explicitly. if v.get('type') == 'xfs': v['label'] = 'img-rootfs' else: v['label'] = 'cloudimg-rootfs' def __init__(self, params): """Create BlockDevice object Arguments: :param params: YAML file from --params """ logger.debug("Creating BlockDevice object") self.params = params logger.debug("Params [%s]", self.params) self.state_dir = os.path.join( self.params['build-dir'], "states/block-device") self.state_json_file_name \ = os.path.join(self.state_dir, "state.json") self.config_json_file_name \ = os.path.join(self.state_dir, "config.json") self.node_pickle_file_name \ = os.path.join(self.state_dir, "nodes.pickle") self.config = _load_json(self.config_json_file_name) # This needs to exists for the state and config files try: os.makedirs(self.state_dir) except OSError: pass def cmd_init(self): """Initialize block device setup This initializes the block device setup layer. One major task is to parse and check the configuration, write it down for later examiniation and execution. """ with open(self.params['config'], "rt") as config_fd: self.config = yaml.safe_load(config_fd) logger.debug("Config before merge [%s]", self.config) self.config = config_tree_to_graph(self.config) logger.debug("Config before merge [%s]", self.config) self._merge_rootfs_params() logger.debug("Final config [%s]", self.config) # Write the final config with open(self.config_json_file_name, "wt") as fd: json.dump(self.config, fd) logger.info("Wrote final block device config to [%s]", self.config_json_file_name) def _config_get_mount(self, path): for entry in self.config: for k, v in entry.items(): if k == 'mount' and v['mount_point'] == path: return v assert False def _config_get_all_mount_points(self): rvec = [] for entry in self.config: for k, v in entry.items(): if k == 'mount': rvec.append(v['mount_point']) return rvec def _config_get_mkfs(self, name): for entry in self.config: for k, v in entry.items(): if k == 'mkfs' and v['name'] == name: return v assert False def cmd_getval(self, symbol): """Retrieve value from block device level The value of SYMBOL is printed to stdout. This is intended to be captured into bash-variables for backward compatibility (non python) access to internal configuration. Arguments: :param symbol: the symbol to get """ logger.info("Getting value for [%s]", symbol) if symbol == "root-label": root_mount = self._config_get_mount("/") root_fs = self._config_get_mkfs(root_mount['base']) logger.debug("root-label [%s]", root_fs['label']) print("%s" % root_fs['label']) return 0 if symbol == "root-fstype": root_mount = self._config_get_mount("/") root_fs = self._config_get_mkfs(root_mount['base']) logger.debug("root-fstype [%s]", root_fs['type']) print("%s" % root_fs['type']) return 0 if symbol == "boot-label": try: boot_mount = self._config_get_mount("/boot") boot_fs = self._config_get_mkfs(boot_mount['base']) # If not explicitly defined, we appear to fallback # to name for a label, which we can only get from the # resulting filesystem config. boot_label = boot_fs.get('label', boot_fs.get('name', '')) except AssertionError: boot_label = '' logger.debug("boot-label [%s]", boot_label) print("%s" % boot_label) return 0 if symbol == 'mount-points': mount_points = self._config_get_all_mount_points() # we return the mountpoints joined by a pipe, because it is not # a valid char in directories, so it is a safe separator for the # mountpoints list print("%s" % "|".join(mount_points)) return 0 # the following symbols all come from the global state # dictionary. They can only be accessed after the state has # been dumped; i.e. after cmd_create() called. state = BlockDeviceState(self.state_json_file_name) # The path to the .raw file for conversion if symbol == 'image-path': print("%s" % state['blockdev']['image0']['image']) return 0 # This is the loopback device where the above image is setup if symbol == 'image-block-device': print("%s" % state['blockdev']['image0']['device']) return 0 # Full list of created devices by name. Some bootloaders, for # example, want to be able to see their boot partitions to # copy things in. Intended to be read into a bash array if symbol == 'image-block-devices': out = "" for k, v in state['blockdev'].items(): out += " [%s]=%s " % (k, v['device']) print(out) return 0 logger.error("Invalid symbol [%s] for getval", symbol) return 1 def cmd_writefstab(self): """Creates the fstab""" logger.info("Creating fstab") # State should have been created by prior calls; we only need # the dict state = BlockDeviceState(self.state_json_file_name) tmp_fstab = os.path.join(self.state_dir, "fstab") with open(tmp_fstab, "wt") as fstab_fd: # This gives the order in which this must be mounted for mp in state['mount_order']: logger.debug("Writing fstab entry for [%s]", mp) fs_base = state['mount'][mp]['base'] fs_name = state['mount'][mp]['name'] fs_val = state['filesys'][fs_base] if 'label' in fs_val: diskid = "LABEL=%s" % fs_val['label'] else: diskid = "UUID=%s" % fs_val['uuid'] # If there is no fstab entry - do not write anything if 'fstab' not in state: continue if fs_name not in state['fstab']: continue options = state['fstab'][fs_name]['options'] dump_freq = state['fstab'][fs_name]['dump-freq'] fsck_passno = state['fstab'][fs_name]['fsck-passno'] fstab_fd.write("%s %s %s %s %s %s\n" % (diskid, mp, fs_val['fstype'], options, dump_freq, fsck_passno)) target_etc_dir = os.path.join(self.params['build-dir'], 'built', 'etc') exec_sudo(['mkdir', '-p', target_etc_dir]) exec_sudo(['cp', tmp_fstab, os.path.join(target_etc_dir, "fstab")]) return 0 def cmd_create(self): """Creates the block device""" logger.info("create() called") logger.debug("Using config [%s]", self.config) # Create a new, empty state state = BlockDeviceState() try: dg, call_order = create_graph(self.config, self.params, state) for node in call_order: node.create() except Exception: logger.exception("Create failed; rollback initiated") reverse_order = reversed(call_order) for node in reverse_order: node.rollback() # save the state for debugging state.save_state(self.state_json_file_name) logger.error("Rollback complete, exiting") raise # dump state and nodes, in order # XXX: we only dump the call_order (i.e. nodes) not the whole # graph here, because later calls do not need the graph # at this stage. might they? state.save_state(self.state_json_file_name) pickle.dump(call_order, open(self.node_pickle_file_name, 'wb')) logger.info("create() finished") return 0 def cmd_umount(self): """Unmounts the blockdevice and cleanup resources""" # If the state is not here, cmd_cleanup removed it? Nothing # more to do? # XXX: better understand this... if not os.path.exists(self.node_pickle_file_name): logger.info("State already cleaned - no way to do anything here") return 0 call_order = pickle.load(open(self.node_pickle_file_name, 'rb')) reverse_order = reversed(call_order) for node in reverse_order: node.umount() return 0 def cmd_cleanup(self): """Cleanup all remaining relicts - in good case""" # Cleanup must be done in reverse order try: call_order = pickle.load(open(self.node_pickle_file_name, 'rb')) except IOError: raise BlockDeviceSetupException("Pickle file not found") reverse_order = reversed(call_order) for node in reverse_order: node.cleanup() logger.info("Removing temporary state dir [%s]", self.state_dir) shutil.rmtree(self.state_dir) return 0 def cmd_delete(self): """Cleanup all remaining relicts - in case of an error""" # Deleting must be done in reverse order try: call_order = pickle.load(open(self.node_pickle_file_name, 'rb')) except IOError: raise BlockDeviceSetupException("Pickle file not found") reverse_order = reversed(call_order) for node in reverse_order: node.delete() logger.info("Removing temporary state dir [%s]", self.state_dir) shutil.rmtree(self.state_dir) return 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/cmd.py0000664000175000017500000001021015201026231023240 0ustar00zuulzuul# Copyright 2016-2017 Andreas Florath (andreas@florath.net) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import argparse import logging import os import sys import yaml from diskimage_builder.block_device.blockdevice import BlockDevice from diskimage_builder import logging_config logger = logging.getLogger(__name__) class BlockDeviceCmd(object): def cmd_init(self): self.bd.cmd_init() def cmd_getval(self): self.bd.cmd_getval(self.args.symbol) def cmd_create(self): self.bd.cmd_create() def cmd_umount(self): self.bd.cmd_umount() def cmd_cleanup(self): self.bd.cmd_cleanup() def cmd_delete(self): self.bd.cmd_delete() def cmd_writefstab(self): self.bd.cmd_writefstab() def main(self): logging_config.setup() parser = argparse.ArgumentParser(description="DIB Block Device helper") parser.add_argument('--params', required=False, help="YAML file containing parameters for " "block-device handling. Default is " "DIB_BLOCK_DEVICE_PARAMS_YAML") subparsers = parser.add_subparsers(title='commands', description='valid commands', dest='command', help='additional help') cmd_init = subparsers.add_parser('init', help='Initialize configuration') cmd_init.set_defaults(func=self.cmd_init) cmd_getval = subparsers.add_parser('getval', help='Retrieve information about ' 'internal state') cmd_getval.set_defaults(func=self.cmd_getval) cmd_getval.add_argument('symbol', help='symbol to print') cmd_create = subparsers.add_parser('create', help='Create the block device') cmd_create.set_defaults(func=self.cmd_create) cmd_umount = subparsers.add_parser('umount', help='Unmount blockdevice and ' 'cleanup resources') cmd_umount.set_defaults(func=self.cmd_umount) cmd_cleanup = subparsers.add_parser('cleanup', help='Final cleanup') cmd_cleanup.set_defaults(func=self.cmd_cleanup) cmd_delete = subparsers.add_parser('delete', help='Error cleanup') cmd_delete.set_defaults(func=self.cmd_delete) cmd_writefstab = subparsers.add_parser('writefstab', help='Create fstab for system') cmd_writefstab.set_defaults(func=self.cmd_writefstab) self.args = parser.parse_args() # Find, open and parse the parameters file if not self.args.params: if 'DIB_BLOCK_DEVICE_PARAMS_YAML' in os.environ: param_file = os.environ['DIB_BLOCK_DEVICE_PARAMS_YAML'] else: parser.error( "DIB_BLOCK_DEVICE_PARAMS_YAML or --params not set") else: param_file = self.args.params logger.info("params [%s]", param_file) try: with open(param_file) as f: self.params = yaml.safe_load(f) except Exception: logger.exception("Failed to open parameter YAML") sys.exit(1) # Setup main BlockDevice object from args self.bd = BlockDevice(self.params) self.args.func() def main(): bdc = BlockDeviceCmd() return bdc.main() if __name__ == "__main__": sys.exit(main()) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/config.py0000664000175000017500000002234415201026231023755 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging import networkx as nx import os from stevedore import extension from diskimage_builder.block_device.exception import \ BlockDeviceSetupException from diskimage_builder.block_device.plugin import NodeBase from diskimage_builder.block_device.plugin import PluginBase logger = logging.getLogger(__name__) _extensions = extension.ExtensionManager( namespace='diskimage_builder.block_device.plugin', invoke_on_load=False) # check if a given name is registered as a plugin def is_a_plugin(name): return any( _extensions.map(lambda x: x.name == name)) def recurse_config(config, parent_base=None): """Convert a config "tree" to it's canonical name/base graph version This is a recursive function to convert a YAML layout "tree" config into a "flat" graph-based config. Arguments: :param config: the incoming config dictionary :param parent_base: the name of the parent node, if any :return: a list of expanded, graph-based config items """ output = [] this = {} # We should only have one key, with multiple values, being the # config entries. e.g. (this was checked by config_tree_to_graph) # # mkfs: # # type: ext4 # # label: 1234 assert len(config.items()) == 1 for k, v in config.items(): key = k values = v # If we don't have a base, we take the parent base; first element # can have no base, however. if 'base' not in values: if parent_base is not None: this['base'] = parent_base else: this['base'] = values['base'] # If we don't have a name, it is made up as "key_base" if 'name' not in values: this['name'] = "%s_%s" % (key, this['base']) else: this['name'] = values['name'] # Go through the values dictionary. Either this is a "plugin" # key that needs to be recursed, or it is a value that is part of # this config entry. for nk, nv in values.items(): if nk == "partitions": # "partitions" is a special key of the "partitioning" # object. It is a list. Each list-entry gets treated # as a top-level entry, so we need to recurse it's # keys. But instead of becoming its own entry in the # graph, it gets attached to the .partitions attribute # of the parent. (see end for example) this['partitions'] = [] for partition in nv: new_part = {} for pk, pv in partition.items(): if is_a_plugin(pk): output.extend( recurse_config({pk: pv}, partition['name'])) else: new_part[pk] = pv new_part['base'] = this['base'] this['partitions'].append(new_part) elif is_a_plugin(nk): # is this key a plugin directive? If so, we recurse # into it. output.extend(recurse_config({nk: nv}, this['name'])) else: # A value entry; just save as part of this entry this[nk] = nv output.append({k: this}) return output def config_tree_to_graph(config): """Turn a YAML config into a graph config Our YAML config is a list of entries. Each Arguments: :parm config: YAML config; either graph or tree :return: graph-based result """ output = [] for entry in config: # Top-level entries should be a dictionary and have a plugin # registered for it if not isinstance(entry, dict): raise BlockDeviceSetupException( "Config entry not a dict: %s" % entry) keys = list(entry.keys()) if len(keys) != 1: raise BlockDeviceSetupException( "Config entry top-level should be a single dict: %s" % entry) if not is_a_plugin(keys[0]): raise BlockDeviceSetupException( "Config entry is not a plugin value: %s" % entry) output.extend(recurse_config(entry)) return output def create_graph(config, default_config, state): """Generate configuration digraph Generate the configuration digraph from the config :param config: graph configuration file :param default_config: default parameters (from --params) :param state: reference to global state dictionary. Passed to :func:`PluginBase.__init__` :return: tuple with the graph object (a :class:`nx.Digraph`), ordered list of :class:`NodeBase` objects """ # This is the directed graph of nodes: each parse method must # add the appropriate nodes and edges. dg = nx.DiGraph() # check about dg.nodes, to support different networkx versions if hasattr(dg.nodes, '__iter__'): dg_nodes = dg.nodes else: dg_nodes = dg.node for config_entry in config: # this should have been checked by generate_config assert len(config_entry) == 1 logger.debug("Config entry [%s]", config_entry) cfg_obj_name = list(config_entry.keys())[0] cfg_obj_val = config_entry[cfg_obj_name] # Instantiate a "plugin" object, passing it the # configuration entry # XXX : would a "factory" pattern for plugins, where we # make a method call on an object stevedore has instantiated # be better here? if not is_a_plugin(cfg_obj_name): raise BlockDeviceSetupException( ("Config element [%s] is not implemented" % cfg_obj_name)) plugin = _extensions[cfg_obj_name].plugin assert issubclass(plugin, PluginBase) cfg_obj = plugin(cfg_obj_val, default_config, state) # Ask the plugin for the nodes it would like to insert # into the graph. Some plugins, such as partitioning, # return multiple nodes from one config entry. nodes = cfg_obj.get_nodes() assert isinstance(nodes, list) for node in nodes: # plugins should return nodes... assert isinstance(node, NodeBase) # ensure node names are unique. networkx by default # just appends the attribute to the node dict for # existing nodes, which is not what we want. if node.name in dg_nodes: raise BlockDeviceSetupException( "Duplicate node name: %s" % (node.name)) logger.debug("Adding %s : %s", node.name, node) dg.add_node(node.name, obj=node) # Now find edges for name, attr in dg.nodes(data=True): obj = attr['obj'] # Unfortunately, we can not determine node edges just from # the configuration file. It's not always simply the # "base:" pointer. So ask nodes for a list of nodes they # want to point to. *mostly* it's just base: ... but # mounting is different. # edges_from are the nodes that point to us # edges_to are the nodes we point to edges_from, edges_to = obj.get_edges() logger.debug("Edges for %s: f:%s t:%s", name, edges_from, edges_to) for edge_from in edges_from: if edge_from not in dg_nodes: raise BlockDeviceSetupException( "Edge not defined: %s->%s" % (edge_from, name)) dg.add_edge(edge_from, name) for edge_to in edges_to: if edge_to not in dg_nodes: raise BlockDeviceSetupException( "Edge not defined: %s->%s" % (name, edge_to)) dg.add_edge(name, edge_to) # this can be quite helpful debugging but needs pydotplus which # isn't in requirements. for debugging, do # .tox/py27/bin/pip install pydotplus # DUMP_CONFIG_GRAPH=1 tox -e py27 -- specific_test # dotty /tmp/graph_dump.dot # to see helpful output if 'DUMP_CONFIG_GRAPH' in os.environ: nx.nx_pydot.write_dot(dg, '/tmp/graph_dump.dot') # Topological sort (i.e. create a linear array that satisfies # dependencies) and return the object list call_order_nodes = list(nx.topological_sort(dg)) logger.debug("Call order: %s", call_order_nodes) call_order = [dg_nodes[n]['obj'] for n in call_order_nodes] return dg, call_order # # On partitioning: objects # # To be concrete -- # # # partitioning: # # base: loop0 # # name: mbr # # partitions: # # - name: partition1 # # foo: bar # # mkfs: # # type: xfs # # mount: # # mount_point: / # # gets turned into the following graph: # # # partitioning: # # partitions: # # - name: partition1 # # base: image0 # # foo: bar # # # mkfs: # # base: partition1 # # name: mkfs_partition1 # # type: xfs # # # mount: # # base: mkfs_partition1 # # name: mount_mkfs_partition1 # # mount_point: / ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/exception.py0000664000175000017500000000116415201026231024503 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. class BlockDeviceSetupException(Exception): """Generic exception""" ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3082361 diskimage_builder-3.42.0/diskimage_builder/block_device/level0/0000775000175000017500000000000015201026275023330 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/level0/__init__.py0000664000175000017500000000000015201026231025417 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/level0/localloop.py0000664000175000017500000001162615201026231025664 0ustar00zuulzuul# Copyright 2016 Andreas Florath (andreas@florath.net) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging import os from diskimage_builder.block_device.exception import \ BlockDeviceSetupException from diskimage_builder.block_device.plugin import NodeBase from diskimage_builder.block_device.plugin import PluginBase from diskimage_builder.block_device.utils import exec_sudo from diskimage_builder.block_device.utils import parse_abs_size_spec logger = logging.getLogger(__name__) def image_create(filename, size): logger.info("Create image file [%s]", filename) with open(filename, "w") as fd: fd.seek(size - 1) fd.write("\0") def image_delete(filename): logger.info("Remove image file [%s]", filename) os.remove(filename) def loopdev_attach(filename, block_size): if str(block_size) not in ['512', '4096']: logger.warning("Block device size is set to %s, only 512 and " "4096 has been tested.", block_size) logger.info("loopdev attach") log_msg = ("Calling [sudo losetup --sector-size %s --show -f %s]" % (str(block_size), filename)) logger.debug(log_msg) block_device = exec_sudo(["losetup", "--sector-size", str(block_size), "--show", "-f", filename]) # [:-1]: Cut of the newline block_device = block_device[:-1] logger.info("New block device [%s]", block_device) return block_device def loopdev_detach(loopdev): logger.info("loopdev detach") # loopback dev may be tied up a bit by udev events triggered # by partition events for try_cnt in range(10, 1, -1): try: exec_sudo(["losetup", "-d", loopdev]) return except BlockDeviceSetupException as e: # Do not raise an error - maybe other cleanup methods # can at least do some more work. logger.error("loopdev detach failed (%s)", e.returncode) logger.debug("Gave up trying to detach [%s]", loopdev) return 1 class LocalLoopNode(NodeBase): """Level0: Local loop image device handling. This class handles local loop devices that can be used for VM image installation. """ def __init__(self, config, default_config, state): logger.debug("Creating LocalLoop object; config [%s] " "default_config [%s]", config, default_config) super(LocalLoopNode, self).__init__(config['name'], state) if 'size' in config: self.size = parse_abs_size_spec(config['size']) logger.debug("Image size [%s]", self.size) else: self.size = parse_abs_size_spec(default_config['image-size']) logger.debug("Using default image size [%s]", self.size) if 'directory' in config: self.image_dir = config['directory'] else: self.image_dir = default_config['image-dir'] if 'DIB_BLOCK_SIZE' in os.environ: self.block_size = os.environ['DIB_BLOCK_SIZE'] elif 'block_size' in config: self.block_size = config['block_size'] else: self.block_size = 512 self.filename = os.path.join(self.image_dir, self.name + ".raw") def get_edges(self): """Because this is created without base, there are no edges.""" return ([], []) def create(self): logger.debug("[%s] Creating loop on [%s] with size [%d]", self.name, self.filename, self.size) self.add_rollback(image_delete, self.filename) image_create(self.filename, self.size) block_device = loopdev_attach(self.filename, self.block_size) self.add_rollback(loopdev_detach, block_device) if 'blockdev' not in self.state: self.state['blockdev'] = {} self.state['blockdev'][self.name] = {"device": block_device, "image": self.filename} logger.debug("Created loop name [%s] device [%s] image [%s]", self.name, block_device, self.filename) return def umount(self): loopdev_detach(self.state['blockdev'][self.name]['device']) def delete(self): image_delete(self.state['blockdev'][self.name]['image']) class LocalLoop(PluginBase): def __init__(self, config, defaults, state): super(LocalLoop, self).__init__() self.node = LocalLoopNode(config, defaults, state) def get_nodes(self): return [self.node] ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.309236 diskimage_builder-3.42.0/diskimage_builder/block_device/level1/0000775000175000017500000000000015201026275023331 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/level1/__init__.py0000664000175000017500000000000015201026231025420 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/level1/lvm.py0000664000175000017500000003646115201026231024503 0ustar00zuulzuul# Copyright 2017 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import logging from diskimage_builder.block_device.exception \ import BlockDeviceSetupException from diskimage_builder.block_device.plugin import NodeBase from diskimage_builder.block_device.plugin import PluginBase from diskimage_builder.block_device.utils import exec_sudo from diskimage_builder.block_device.utils import parse_abs_size_spec PHYSICAL_EXTENT_BYTES = parse_abs_size_spec('4MiB') LVS_TYPES = ['thin', 'thin-pool'] logger = logging.getLogger(__name__) # # LVM # --- # # The LVM config has three required keys; pvs, vgs and lvs # # lvm: -> LVSNode # pvs: -> PvsNode # lvs: -> LvsNode # vgs: -> VgsNode # # The LVMPlugin will verify this and build nodes into the # configuration graph. # # As described below, a LVSNode is created for synchronisation # purposes. Thus if you had something like two partitions that became # two physical-volumes (pv1 & pv2), that you then combine into a # single volume group (vg) and then create several logical volumes # (lv1, lv2, lv3) your graph would end up looking like: # # partition1 partition2 # | | # ---> LVSNode <--+ # | # +------+------+ # v v # pv1 pv2 # | | # +--> vg <---+ # | # +-----+-----+ # v v v # lv1 lv2 lv3 # # After the create() call on the LVSNode object, the entire LVM setup # would actually be complete. The other nodes are all just # place-holders, and are used for further ordering (for example, the # fs creation & mounting should depend on the logical volume nodes). # For this reason, their create() calls are blank. However, for code # organisational purposes they have a private _create() and _cleanup() # call that is driven by the LVSNode object. def lvremove(device_name): logger.debug('Removing logical volume %s', device_name) try: exec_sudo(["lvchange", "--activate", "n", device_name]) exec_sudo(["lvremove", "--yes", "/dev/%s" % device_name]) except BlockDeviceSetupException as e: # Do not raise an error - maybe other cleanup methods # can at least do some more work. logger.warning("Removing logical volume failed (%s)", e.returncode) def vgremove(vg_name): logger.debug('Removing volume group %s', vg_name) try: exec_sudo(["vgremove", "--yes", "--force", vg_name]) except BlockDeviceSetupException as e: # Do not raise an error - maybe other cleanup methods # can at least do some more work. logger.warning("Removing volume group failed (%s)", e.returncode) class PvsNode(NodeBase): def __init__(self, name, state, base, options): """Physical volume This is a placeholder node for the LVM physical volumes. Arguments: :param name: Name of this node :param state: global state pointer :param base: Parent partition :param options: config options """ super(PvsNode, self).__init__(name, state) self.base = base self.options = options def _create(self): # the underlying device path of our parent was previously # recorded into the state during blockdev creation; look it # up. phys_dev = self.state['blockdev'][self.base]['device'] cmd = ["pvcreate"] cmd.append(phys_dev) if self.options: cmd.extend(self.options) logger.debug("Creating pv command [%s]", cmd) exec_sudo(cmd) # save state if 'pvs' not in self.state: self.state['pvs'] = {} self.state['pvs'][self.name] = { 'opts': self.options, 'device': phys_dev } def get_edges(self): # See LVMNode.get_edges() for how this gets connected return ([], []) def create(self): # see notes in LVMNode object pass class VgsNode(NodeBase): def __init__(self, name, state, base, options): """Volume Group This is a placeholder node for a volume group Arguments: :param name: Name of this node :param state: global state pointer :param base: Parent :class:`PvsNodes` this volume group exists on :param options: extra options passed to the `vgcreate` command """ super(VgsNode, self).__init__(name, state) self.base = base self.options = options def _create(self): # The PV's have saved their actual device name into the state # during their _create(). Look at our base elements and thus # find the underlying device paths in the state. pvs_devs = [] for pv in self.base: pvs_dev = self.state['pvs'][pv]['device'] pvs_devs.append(pvs_dev) cmd = ["vgcreate", ] cmd.append(self.name) cmd.extend(pvs_devs) if self.options: cmd.extend(self.options) logger.debug("Creating vg command [%s]", cmd) exec_sudo(cmd) self.add_rollback(vgremove, self.name) # save state if 'vgs' not in self.state: self.state['vgs'] = {} self.state['vgs'][self.name] = { 'opts': self.options, 'devices': self.base, } def _umount(self): exec_sudo(['vgchange', '-an', self.name]) def get_edges(self): # self.base is already a list, per the config. There might be # multiple pv parents here. edge_from = self.base edge_to = [] return (edge_from, edge_to) def create(self): # see notes in LVMNode object pass class LvsNode(NodeBase): def __init__(self, name, state, base, options, size, extents, segtype, thin_pool): """Logical Volume This is a placeholder node for a logical volume Arguments: :param name: Name of this node :param state: global state pointer :param base: the parent volume group :param options: options passed to lvcreate :param size: size of the LV, using the supported unit types (MB, MiB, etc) :param extents: size of the LV in extents :param segtype: value passed to segment type, supports thin and thin-pool :param thin_pool: name of the thin pool to create this volume from """ super(LvsNode, self).__init__(name, state) self.base = base self.options = options self.size = size self.extents = extents self.type = segtype self.thin_pool = thin_pool def _create(self): cmd = ["lvcreate", ] cmd.extend(['--name', self.name]) if self.type: cmd.extend(['--type', self.type]) if self.thin_pool: cmd.extend(['--thin-pool', self.thin_pool]) if self.size: size = parse_abs_size_spec(self.size) # ensuire size aligns with physical extents size = size - size % PHYSICAL_EXTENT_BYTES size_arg = '-V' if self.type == 'thin' else '-L' cmd.extend([size_arg, '%dB' % size]) elif self.extents: cmd.extend(['-l', self.extents]) if self.options: cmd.extend(self.options) cmd.append(self.base) logger.debug("Creating lv command [%s]", cmd) exec_sudo(cmd) # save state device_name = '%s-%s' % (self.base, self.name) self.state['blockdev'][self.name] = { 'vgs': self.base, 'size': self.size, 'extents': self.extents, 'opts': self.options, 'device': '/dev/mapper/%s' % device_name } self.add_rollback(lvremove, "%s/%s" % (self.base, self.name)) def _umount(self): exec_sudo(['lvchange', '-an', '/dev/%s/%s' % (self.base, self.name)]) def get_edges(self): edge_from = [self.base] edge_to = [] return (edge_from, edge_to) def create(self): # see notes in LVMNode object pass class LVMNode(NodeBase): def __init__(self, name, state, pvs, lvs, vgs): """LVM Driver Node This is the "global" node where all LVM operations are driven from. In the node graph, the LVM physical-volumes depend on this node. This node then depends on the devices that the PV's require. This node incorporates *all* LVM setup; i.e. after the create() call here we have created all pv's, lv's and vg. The Node objects in the graph are therefore just dependency place holders whose create() call does nothing. Arguments: :param name: name of this node :param state: global state pointer :param pvs: A list of :class:`PvsNode` objects :param lvs: A list of :class:`LvsNode` objects :param vgs: A list of :class:`VgsNode` objects """ super(LVMNode, self).__init__(name, state) self.pvs = pvs self.lvs = lvs self.vgs = vgs def get_edges(self): # This node requires the physical device(s), which is # recorded in the "base" argument of the PV nodes. pvs = [] for pv in self.pvs: pvs.append(pv.base) edge_from = set(pvs) # The PV nodes should then depend on us. i.e., we just made # this node a synchronisation point edge_to = [pv.name for pv in self.pvs] return (edge_from, edge_to) def create(self): # Run through pvs->vgs->lvs and create them # XXX: we could theoretically get this same info from walking # the graph of our children nodes? Would that be helpful in # any way? for pvs in self.pvs: pvs._create() for vgs in self.vgs: vgs._create() for lvs in self.lvs: lvs._create() def umount(self): for lvs in self.lvs: lvs._umount() for vgs in self.vgs: vgs._umount() exec_sudo(['udevadm', 'settle']) def cleanup(self): # Information about the PV, VG and LV is typically # cached in lvmetad. Even after removing PV device and # partitions this data is not automatically updated # which leads to a couple of problems. # the 'pvscan --cache' scans the available disks # and updates the cache. # This is in cleanup because it must be called after the # umount of the containing block device is done, (which should # all be done in umount phase). try: exec_sudo(['pvscan', '--cache']) except BlockDeviceSetupException as e: logger.info("pvscan call failed [%s]", e.returncode) class LVMPlugin(PluginBase): def _config_error(self, msg): raise BlockDeviceSetupException(msg) def __init__(self, config, defaults, state): """Build LVM nodes This reads the "lvm:" config stanza, validates it and produces the PV, VG and LV nodes. These are all synchronised via a LVMNode as described above. Arguments: :param config: "lvm" configuration dictionary :param defaults: global defaults dictionary :param state: global state reference """ super(LVMPlugin, self).__init__() # note lvm: doesn't require a base ... the base is the # physical devices the "pvs" nodes are made on. if 'name' not in config: self._config_error("Lvm config requires 'name'") if 'pvs' not in config: self._config_error("Lvm config requires a 'pvs'") if 'vgs' not in config: self._config_error("Lvm config needs 'vgs'") if 'lvs' not in config: self._config_error("Lvm config needs 'lvs'") # create physical volume nodes self.pvs = [] self.pvs_keys = [] for pvs_cfg in config['pvs']: if 'name' not in pvs_cfg: self._config_error("Missing 'name' in pvs config") if 'base' not in pvs_cfg: self._config_error("Missing 'base' in pvs_config") pvs_item = PvsNode(pvs_cfg['name'], state, pvs_cfg['base'], pvs_cfg.get('options')) self.pvs.append(pvs_item) # create volume group nodes self.vgs = [] self.vgs_keys = [] for vgs_cfg in config['vgs']: if 'name' not in vgs_cfg: self._config_error("Missing 'name' in vgs config") if 'base' not in vgs_cfg: self._config_error("Missing 'base' in vgs config") # Ensure we have a valid PVs backing this VG for pvs in vgs_cfg['base']: if not any(pv.name == pvs for pv in self.pvs): self._config_error("base:%s in vgs does not " "match a valid pvs" % pvs) vgs_item = VgsNode(vgs_cfg['name'], state, vgs_cfg['base'], vgs_cfg.get('options', None)) self.vgs.append(vgs_item) # create logical volume nodes self.lvs = [] for lvs_cfg in config['lvs']: if 'name' not in lvs_cfg: self._config_error("Missing 'name' in lvs config") if 'base' not in lvs_cfg: self._config_error("Missing 'base' in lvs config") if 'size' not in lvs_cfg and 'extents' not in lvs_cfg: self._config_error("Missing 'size' or 'extents' in lvs config") # ensure this logical volume has a valid volume group base if not any(vg.name == lvs_cfg['base'] for vg in self.vgs): self._config_error("base:%s in lvs does not match a valid vg" % lvs_cfg['base']) if 'type' in lvs_cfg: if lvs_cfg['type'] not in LVS_TYPES: self._config_error( "Unsupported type:%s, supported types: %s" % (lvs_cfg['type'], ', '.join(LVS_TYPES))) lvs_item = LvsNode(lvs_cfg['name'], state, lvs_cfg['base'], lvs_cfg.get('options', None), lvs_cfg.get('size', None), lvs_cfg.get('extents', None), lvs_cfg.get('type', None), lvs_cfg.get('thin-pool', None)) self.lvs.append(lvs_item) # create the "driver" node self.lvm_node = LVMNode(config['name'], state, self.pvs, self.lvs, self.vgs) def get_nodes(self): # the nodes for insertion into the graph are all of the pvs, # vgs and lvs nodes we have created above and the root node and # the cleanup node. return self.pvs + self.vgs + self.lvs \ + [self.lvm_node] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/level1/mbr.py0000664000175000017500000003612415201026231024461 0ustar00zuulzuul# Copyright 2016 Andreas Florath (andreas@florath.net) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging import os import random from struct import pack logger = logging.getLogger(__name__) # Details of the MBR object itself can be found in the inline # documentation. # # General design and implementation remarks: # o Because the whole GNU parted and co. (e.g. the python-parted that # is based on GNU parted) cannot be used because of the license: # everything falls under GPL2 (not LGPL2!) and therefore does not # fit into the Apache License here. # o It looks that there is no real alternative available (2016-06). # o The interface of python-parted is not that simple to handle - and # the initial try to use GNU (python-)parted was not that much # easier and shorter than this approach. # o When using tools (like fdisk or parted) they try to optimize the # alignment of partitions based on the data found on the host # system. These might be misleading and might lead to (very) poor # performance. # o These ready-to-use tools typically also change the CHS layout # based on the disk size. In case that the disk is enlarged (which # is a normal use case for golden images), the CHS layout of the # disk changes for those tools (and is not longer correct). # In the DIB implementation the CHS are chosen that way, that also # for very small disks the maximum heads/cylinder and sectors/track # is used: even if the disk size in increased, the CHS numbers will # not change. # o In the easy and straight forward way when only using one # partition, exactly 40 bytes (!) must be written - and the biggest # part of this data is fixed (same in all cases). # # Limitations and Incompatibilities # o With the help of this class it is possible to create an # arbitrarily number of extended partitions (tested with over 1000). # o There are limitations and shortcomings in the OS and in tools # handling these partitions. # o Under Linux the loop device is able to handle a limited number of # partitions. The module parameter max_loop can be set - the maximum # number might vary depending on the distribution and kernel build. # o Under Linux fdisk is able to handle 'only' 60 partitions. Only # those are listed, can be changed or written. # o Under Linux GNU parted can handle about 60 partitions. # # Be sure only to pass in the number of partitions that the host OS # and target OS are able to handle. class MBR(object): """MBR Disk / Partition Table Layout Primary partitions are created first - and must also be passed in first. The extended partition layout is done in the way, that there is one entry in the MBR (the last) that uses the whole disk. EBR (extended boot records) are used to describe the partitions themselves. This has the advantage, that the same procedure can be used for all partitions and arbitrarily many partitions can be created in the same way (the EBR is placed as block 0 in each partition itself). In conjunction with a fixed and 'fits all' partition alignment the major design focus is maximum performance for the installed image (vs. minimal size). Because of the chosen default alignment of 1MiB there will be (1MiB - 512B) unused disk space for the MBR and also the same size unused in every partition. Assuming that 512 byte blocks are used, the resulting layout for extended partitions looks like (blocks offset in extended partition given): ======== ============================================== Offset Description ======== ============================================== 0 MBR - 2047 blocks unused 2048 EBR for partition 1 - 2047 blocks unused 4096 Start of data for partition 1 ... ... X EBR for partition N - 2047 blocks unused X+2048 Start of data for partition N ======== ============================================== Direct (native) writing of MBR, EBR (partition table) is implemented - no other partitioning library or tools is used - to be sure to get the correct CHS and alignment for a wide range of host systems. """ # Design & Implementation details: # o A 'block' is a storage unit on disk. It is similar (equal) to a # sector - but with LBA addressing. # o It is assumed that a disk block has that number of bytes bytes_per_sector = 512 # o CHS is the 'good and very old way' specifying blocks. # When passing around these numbers, they are also ordered like 'CHS': # (cylinder, head, sector). # o The computation from LBA to CHS is not unique (it is based # on the 'real' (or assumed) number of heads/cylinder and # sectors/track), these are the assumed numbers. Please note # that these are also the maximum numbers: heads_per_cylinder = 254 sectors_per_track = 63 max_cylinders = 1023 # o There is the need for some offsets that are defined in the # MBR/EBR domain. MBR_offset_disk_id = 440 MBR_offset_signature = 510 MBR_offset_first_partition_table_entry = 446 MBR_partition_type_extended_chs = 0x5 MBR_partition_type_extended_lba = 0xF MBR_signature = 0xAA55 def __init__(self, name, disk_size, alignment): """Initialize a disk partitioning MBR object. The name is the (existing) name of the disk. The disk_size is the (used) size of the disk. It must be a proper multiple of the disk bytes per sector (currently 512) """ logger.info("Create MBR disk partitioning object") assert disk_size % MBR.bytes_per_sector == 0 self.disk_size = disk_size self.disk_size_in_blocks \ = self.disk_size // MBR.bytes_per_sector self.alignment_blocks = alignment // MBR.bytes_per_sector # Because the extended partitions are a chain of blocks, when # creating a new partition, the reference in the already # existing EBR must be updated. This holds a reference to the # latest EBR. (A special case is the first: when it points to # 0 (MBR) there is no need to update the reference.) self.disk_block_last_ref = 0 self.name = name self.partition_abs_start = None self.partition_abs_next_free = None # Start of partition number self.partition_number = 0 self.primary_partitions_created = 0 self.extended_partitions_created = 0 def __enter__(self): # Open existing file for writing (r+) self.image_fd = open(self.name, "r+b") self.write_mbr() self.write_mbr_signature(0) self.partition_abs_start = self.align(1) self.partition_abs_next_free \ = self.partition_abs_start return self def __exit__(self, exc_type, exc_value, traceback): self.image_fd.flush() os.fsync(self.image_fd.fileno()) self.image_fd.close() def lba2chs(self, lba): """Converts a LBA block number to CHS If the LBA block number is bigger than the max (1023, 63, 254) the maximum is returned. """ if lba > MBR.heads_per_cylinder * MBR.sectors_per_track \ * MBR.max_cylinders: return MBR.max_cylinders, MBR.heads_per_cylinder, \ MBR.sectors_per_track cylinder = lba // (MBR.heads_per_cylinder * MBR.sectors_per_track) head = (lba // MBR.sectors_per_track) % MBR.heads_per_cylinder sector = (lba % MBR.sectors_per_track) + 1 logger.debug("Convert LBA to CHS [%d] -> [%d, %d, %d]", lba, cylinder, head, sector) return cylinder, head, sector def encode_chs(self, cylinders, heads, sectors): """Encodes a CHS triple into disk format""" # Head - nothing to convert assert heads <= MBR.heads_per_cylinder eh = heads # Sector assert sectors <= MBR.sectors_per_track es = sectors # top two bits are set in cylinder conversion # Cylinder assert cylinders <= MBR.max_cylinders ec = cylinders % 256 # lower part hc = cylinders // 4 # extract top two bits and es = es | hc # pass them into the top two bits of the sector logger.debug("Encode CHS to disk format [%d %d %d] " "-> [%02x %02x %02x]", cylinders, heads, sectors, eh, es, ec) return eh, es, ec def write_mbr(self): """Write MBR This method writes the MBR to disk. It creates a random disk id as well that it creates the extended partition (as first partition) which uses the whole disk. """ disk_id = random.randint(0, 0xFFFFFFFF) self.image_fd.seek(MBR.MBR_offset_disk_id) self.image_fd.write(pack(" 0: raise RuntimeError("All primary partitions must be " "given first") if primaryflag: return self.add_primary_partition(bootflag, size, ptype) if self.extended_partitions_created == 0: # When this is the first extended partition, the extended # partition entry has to be written. self.partition_abs_start = self.partition_abs_next_free self.write_partition_entry( False, 0, self.partition_number, MBR.MBR_partition_type_extended_lba, self.partition_abs_next_free, self.disk_size_in_blocks - self.partition_abs_next_free) self.partition_number = 4 return self.add_extended_partition(bootflag, size, ptype) def free(self): """Returns the free (not yet partitioned) size""" return self.disk_size \ - (self.partition_abs_next_free + self.align(1)) \ * MBR.bytes_per_sector ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/level1/partition.py0000664000175000017500000000572115201026231025711 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging from diskimage_builder.block_device.exception import \ BlockDeviceSetupException from diskimage_builder.block_device.plugin import NodeBase logger = logging.getLogger(__name__) class PartitionNode(NodeBase): flag_boot = 1 flag_primary = 2 def __init__(self, config, state, parent, prev_partition): super(PartitionNode, self).__init__(config['name'], state) self.base = config['base'] self.partitioning = parent self.prev_partition = prev_partition # filter out some MBR only options for clarity if self.partitioning.label == 'gpt': if 'flags' in config and 'primary' in config['flags']: raise BlockDeviceSetupException( "Primary flag not supported for GPT partitions") self.flags = set() if 'flags' in config: for f in config['flags']: if f == 'boot': self.flags.add(self.flag_boot) elif f == 'primary': self.flags.add(self.flag_primary) else: raise BlockDeviceSetupException("Unknown flag: %s" % f) if 'size' not in config: raise BlockDeviceSetupException("No size in partition" % self.name) self.size = config['size'] if self.partitioning.label == 'gpt': self.ptype = str(config['type']) if 'type' in config else '8300' elif self.partitioning.label == 'mbr': self.ptype = int(config['type'], 16) if 'type' in config else 0x83 def get_flags(self): return self.flags def get_size(self): return self.size def get_type(self): return self.ptype def get_edges(self): edge_from = [self.base] edge_to = [] if self.prev_partition is not None: edge_from.append(self.prev_partition.name) return (edge_from, edge_to) # These all call back to the parent "partitioning" object to do # the real work. Every node calls it, but only one will succeed; # see the gating we do in the parent function. # # XXX: A better model here would be for the parent object to a # real node in the config graph, so it's create() gets called. # These can then just be stubs. def create(self): self.partitioning.create() def umount(self): self.partitioning.umount() def cleanup(self): self.partitioning.cleanup() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/level1/partitioning.py0000664000175000017500000002367615201026231026420 0ustar00zuulzuul# Copyright 2016 Andreas Florath (andreas@florath.net) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging import os from diskimage_builder.block_device.exception import \ BlockDeviceSetupException from diskimage_builder.block_device.level1.mbr import MBR from diskimage_builder.block_device.level1.partition import PartitionNode from diskimage_builder.block_device.plugin import PluginBase from diskimage_builder.block_device.utils import exec_sudo from diskimage_builder.block_device.utils import parse_abs_size_spec from diskimage_builder.block_device.utils import parse_rel_size_spec from diskimage_builder.block_device.utils import remove_device logger = logging.getLogger(__name__) class Partitioning(PluginBase): def __init__(self, config, default_config, state): logger.debug("Creating Partitioning object; config [%s]", config) super(Partitioning, self).__init__() # Unlike other PluginBase we are somewhat persistent, as the # partition nodes call back to us (see create() below). We # need to keep this reference. self.state = state # Because using multiple partitions of one base is done # within one object, there is the need to store a flag if the # creation of the partitions was already done. self.number_of_partitions = 0 # Parameter check if 'base' not in config: raise BlockDeviceSetupException("Partitioning config needs 'base'") self.base = config['base'] if 'partitions' not in config: raise BlockDeviceSetupException( "Partitioning config needs 'partitions'") if 'label' not in config: raise BlockDeviceSetupException( "Partitioning config needs 'label'") self.label = config['label'] if self.label not in ("mbr", "gpt"): raise BlockDeviceSetupException("Label must be 'mbr' or 'gpt'") # It is VERY important to get the alignment correct. If this # is not correct, the disk performance might be very poor. # Example: In some tests a 'off by one' leads to a write # performance of 30% compared to a correctly aligned # partition. # The problem for DIB is, that it cannot assume that the host # system uses the same IO sizes as the target system, # therefore here a fixed approach (as used in all modern # systems with large disks) is used. The partitions are # aligned to 1MiB (which are about 2048 times 512 bytes # blocks) self.align = 1024 * 1024 # 1MiB as default if 'align' in config: self.align = parse_abs_size_spec(config['align']) self.partitions = [] prev_partition = None for part_cfg in config['partitions']: np = PartitionNode(part_cfg, state, self, prev_partition) self.partitions.append(np) prev_partition = np def get_nodes(self): # return the list of partitions return self.partitions def _size_of_block_dev(self, dev): with open(dev, "r") as fd: fd.seek(0, 2) return fd.tell() def _create_mbr(self): """Create partitions with MBR""" # NOTE(TheJulia): This is funcitonally incompatible with block/sector # sizing other than 512 bytes. with MBR(self.image_path, self.disk_size, self.align) as part_impl: for part_cfg in self.partitions: part_name = part_cfg.get_name() part_bootflag = PartitionNode.flag_boot \ in part_cfg.get_flags() part_primary = PartitionNode.flag_primary \ in part_cfg.get_flags() part_size = part_cfg.get_size() part_free = part_impl.free() part_type = part_cfg.get_type() logger.debug("Not partitioned space [%d]", part_free) part_size = parse_rel_size_spec(part_size, part_free)[1] part_no \ = part_impl.add_partition(part_primary, part_bootflag, part_size, part_type) logger.debug("Create partition [%s] [%d]", part_name, part_no) # We're going to mount all partitions with kpartx # below once we're done. So the device this partition # will be seen at becomes "/dev/mapper/loop0pX" assert self.device_path[:5] == "/dev/" device_name = "%sp%d" % (self.device_path[5:], part_no) device_path = "/dev/mapper/%s" % device_name self.state['blockdev'][part_name] \ = {'device': device_path} part_cfg.add_rollback(remove_device, device_name) def _create_gpt(self): """Create partitions with GPT""" # Use the loopback via device_path, as using the file means the # partitioning is exposed to sector sizing of the OS, not of the # underlying "device" provided by the loopback. cmd = ['sgdisk', self.device_path] # This padding gives us a little room for rounding so we don't # go over the end of the disk disk_free = self.disk_size - (2048 * 1024) pnum = 1 for p in self.partitions: args = {} args['pnum'] = pnum args['name'] = '%s' % p.get_name() args['type'] = '%s' % p.get_type() # convert from a relative/string size to bytes size = parse_rel_size_spec(p.get_size(), disk_free)[1] # We keep track in bytes, but specify things to sgdisk in # megabytes so it can align on sensible boundaries. And # create partitions right after previous so no need to # calculate start/end - just size. if not size <= disk_free: logger.error('The requested size of the image is smaller ' 'than the block device configuration.') assert size <= disk_free args['size'] = size // (1024 * 1024) new_cmd = ("-n", "{pnum}:0:+{size}M".format(**args), "-t", "{pnum}:{type}".format(**args), # Careful with this one, as {name} could have spaces "-c", "{pnum}:{name}".format(**args)) cmd.extend(new_cmd) # Fill the state; we mount all partitions with kpartx # below once we're done. So the device this partition # will be seen at becomes "/dev/mapper/loop0pX" assert self.device_path[:5] == "/dev/" device_name = "%sp%d" % (self.device_path[5:], pnum) device_path = "/dev/mapper/%s" % device_name self.state['blockdev'][p.get_name()] \ = {'device': device_path} disk_free = disk_free - size pnum = pnum + 1 logger.debug("Partition %s added, %s remaining in disk", pnum, disk_free) p.add_rollback(remove_device, device_name) logger.debug("cmd: %s", ' '.join(cmd)) exec_sudo(cmd) # not this is NOT a node and this is not called directly! The # create() calls in the partition nodes this plugin has # created are calling back into this. def create(self): # This is a bit of a hack. Each of the partitions is actually # in the graph, so for every partition we get a create() call # as the walk happens. But we only need to create the # partition table once... self.number_of_partitions += 1 if self.number_of_partitions > 1: logger.info("Not creating the partitions a second time.") return # the raw file on disk self.image_path = self.state['blockdev'][self.base]['image'] # the /dev/loopX device of the parent self.device_path = self.state['blockdev'][self.base]['device'] # underlying size self.disk_size = self._size_of_block_dev(self.image_path) logger.info("Creating partition on [%s] [%s]", self.base, self.image_path) assert self.label in ('mbr', 'gpt') if self.label == 'mbr': self._create_mbr() elif self.label == 'gpt': self._create_gpt() # "saftey sync" to make sure the partitions are written exec_sudo(["sync"]) # now all the partitions are created, get device-mapper to # mount them if not os.path.exists("/.dockerenv"): exec_sudo(["kpartx", "-uvs", self.device_path]) else: # If running inside Docker, make our nodes manually, # because udev will not be working. kpartx cannot run in # sync mode in docker. exec_sudo(["kpartx", "-av", self.device_path]) exec_sudo(["dmsetup", "--noudevsync", "mknodes"]) return def umount(self): # Remove the partition mappings made for the parent # block-device by create() above. This is called from the # child PartitionNode umount. Thus every # partition calls it, but we only want to do it once when # we know this is the very last partition self.number_of_partitions -= 1 if self.number_of_partitions == 0: exec_sudo(["kpartx", "-d", self.state['blockdev'][self.base]['device']]) def cleanup(self): pass ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.309236 diskimage_builder-3.42.0/diskimage_builder/block_device/level2/0000775000175000017500000000000015201026275023332 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/level2/__init__.py0000664000175000017500000000000015201026231025421 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/level2/mkfs.py0000664000175000017500000001264015201026231024637 0ustar00zuulzuul# Copyright 2017 Andreas Florath (andreas@florath.net) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging import uuid from diskimage_builder.block_device.exception \ import BlockDeviceSetupException from diskimage_builder.block_device.plugin import NodeBase from diskimage_builder.block_device.plugin import PluginBase from diskimage_builder.block_device.utils import exec_sudo logger = logging.getLogger(__name__) # There is the need to check the length of the label of # the filesystem. The maximum length depends on the used filesystem. # This map provides information about the maximum label length. file_system_max_label_length = { "ext2": 16, "ext3": 16, "ext4": 16, "xfs": 12, "vfat": 11, "swap": 16 } class FilesystemNode(NodeBase): def __init__(self, config, state): logger.debug("Create filesystem object; config [%s]", config) super(FilesystemNode, self).__init__(config['name'], state) # Parameter check (mandatory) for pname in ['base', 'type']: if pname not in config: raise BlockDeviceSetupException( "Mkfs config needs [%s]" % pname) setattr(self, pname, config[pname]) # Parameter check (optional) for pname in ['label', 'opts', 'uuid']: setattr(self, pname, config[pname] if pname in config else None) if self.label is None: self.label = self.name # for fat/vfat, we use the label as an identifier for the disk # so we need that the label is converted to upper case if self.type in ('vfat', 'fat'): self.label = self.label.upper() # ensure we don't already have a fs with this label ... they # all must be unique. if 'fs_labels' in self.state: if self.label in self.state['fs_labels']: raise BlockDeviceSetupException( "File system label [%s] used more than once" % self.label) self.state['fs_labels'].append(self.label) else: self.state['fs_labels'] = [self.label] if self.type in file_system_max_label_length: if file_system_max_label_length[self.type] < len(self.label): raise BlockDeviceSetupException( "Label [{label}] too long for filesystem [{type}]: " "{len} > {max_len}".format(**{ 'label': self.label, 'type': self.type, 'len': len(self.label), 'max_len': file_system_max_label_length[self.type]})) else: logger.warning("Length of label [%s] cannot be checked for " "filesystem [%s]: unknown max length", self.label, self.type) logger.warning("Continue - but this might lead to an error") if self.opts is not None: self.opts = self.opts.strip().split(' ') if self.uuid is None: self.uuid = str(uuid.uuid4()) logger.debug("Filesystem created [%s]", self) def get_edges(self): edge_from = [self.base] edge_to = [] return (edge_from, edge_to) def create(self): if self.type in ('swap'): cmd = ["mkswap"] else: cmd = ["mkfs"] cmd.extend(['-t', self.type]) if self.opts: cmd.extend(self.opts) if self.type in ('vfat', 'fat'): cmd.extend(["-n", self.label]) else: cmd.extend(["-L", self.label]) if self.type in ('ext2', 'ext3', 'ext4', 'swap'): cmd.extend(['-U', self.uuid]) elif self.type == 'xfs': cmd.extend(['-m', "uuid=%s" % self.uuid]) else: logger.warning("UUID will not be written for fs type [%s]", self.type) if self.type in ('ext2', 'ext3', 'ext4', 'xfs'): cmd.append('-q') if 'blockdev' not in self.state: self.state['blockdev'] = {} device = self.state['blockdev'][self.base]['device'] cmd.append(device) logger.debug("Creating fs command [%s]", cmd) exec_sudo(cmd) if 'filesys' not in self.state: self.state['filesys'] = {} self.state['filesys'][self.name] \ = {'uuid': self.uuid, 'label': self.label, 'fstype': self.type, 'opts': self.opts, 'device': device} class Mkfs(PluginBase): """Create a file system This block device module handles creating different file systems. """ def __init__(self, config, defaults, state): super(Mkfs, self).__init__() self.filesystems = {} fs = FilesystemNode(config, state) self.filesystems[fs.get_name()] = fs def get_nodes(self): nodes = [] for _, fs in self.filesystems.items(): nodes.append(fs) return nodes ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.309236 diskimage_builder-3.42.0/diskimage_builder/block_device/level3/0000775000175000017500000000000015201026275023333 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/level3/__init__.py0000664000175000017500000000000015201026231025422 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/level3/mount.py0000664000175000017500000001600415201026231025040 0ustar00zuulzuul# Copyright 2017 Andreas Florath (andreas@florath.net) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging import os import time from diskimage_builder.block_device.exception \ import BlockDeviceSetupException from diskimage_builder.block_device.plugin import NodeBase from diskimage_builder.block_device.plugin import PluginBase from diskimage_builder.block_device.utils import exec_sudo logger = logging.getLogger(__name__) class MountPointNode(NodeBase): def __init__(self, mount_base, config, state): super(MountPointNode, self).__init__(config['name'], state) # Parameter check self.mount_base = mount_base for pname in ['base', 'mount_point']: if pname not in config: raise BlockDeviceSetupException( "MountPoint config needs [%s]" % pname) setattr(self, pname, config[pname]) logger.debug("MountPoint created [%s]", self) def get_edges(self): """Insert all edges The dependency edge is created in all cases from the base element (typically a mkfs) and, if this is not the 'first' mount-point, an edge is created from the mount-point before in "sorted order" (see :func:`sort_mount_points`). This ensures that during mounting (and umounting) the globally correct order is used. """ edge_from = [] edge_to = [] # should have been added by __init__... assert 'sorted_mount_points' in self.state sorted_mount_points = self.state['sorted_mount_points'] # If we are not first, add our parent in the global dependency # list. sorted_mount_points is tuples (mount_point, node_name). # find ourselves in the mount_points, and our parent node # is one before us in node_name list. mount_points = [x[0] for x in sorted_mount_points] node_name = [x[1] for x in sorted_mount_points] mpi = mount_points.index(self.mount_point) if mpi > 0: dep = node_name[mpi - 1] edge_from.append(dep) edge_from.append(self.base) return (edge_from, edge_to) def create(self): if (self.state['filesys'][self.base]['fstype'] == 'swap'): # No need to mount/activate swap during image build. mount_point = self.mount_point = 'none' else: logger.debug("mount called [%s]", self.mount_point) rel_mp = self.mount_point if self.mount_point[0] != '/' \ else self.mount_point[1:] mount_point = os.path.join(self.mount_base, rel_mp) if not os.path.exists(mount_point): # Need to sudo this because of permissions in the new # file system tree. exec_sudo(['mkdir', '-p', mount_point]) logger.info("Mounting [%s] to [%s]", self.name, mount_point) exec_sudo(["mount", self.state['filesys'][self.base]['device'], mount_point]) if 'mount' not in self.state: self.state['mount'] = {} self.state['mount'][self.mount_point] \ = {'name': self.name, 'base': self.base, 'path': mount_point} if 'mount_order' not in self.state: self.state['mount_order'] = [] self.state['mount_order'].append(self.mount_point) def umount(self): if (self.state['filesys'][self.base]['fstype'] == 'swap'): # Swap not mounted/activated during image build. return logger.info("Called for [%s]", self.name) # Before calling umount, call 'fstrim' on suitable mounted # file systems. This discards unused blocks from the mounted # file system and therefore decreases the resulting image # size. # # A race condition can occur when trying to fstrim immediately # after deleting a file resulting in that free space not being # reclaimed. Calling sync before fstrim is a workaround for # this behaviour. # https://lists.gnu.org/archive/html/qemu-devel/2014-03/msg02978.html exec_sudo(["sync"]) if self.state['filesys'][self.base]['fstype'] != 'vfat': exec_sudo(["fstrim", "--verbose", self.state['mount'][self.mount_point]['path']]) # Even 'fstrim' call sometimes don't solve the issue with 'busy' # filesystem, so we need to catch the exception and repeat unount. mount_point = self.state['mount'][self.mount_point]['path'] catch = None for try_cnt in range(10, 1, -1): try: exec_sudo(["umount", mount_point]) return except BlockDeviceSetupException as e: catch = e logger.error("umount failed (%s)", e.output.strip()) time.sleep(3) logger.debug("Gave up trying to umount [%s]", mount_point) raise catch def delete(self): self.umount() class Mount(PluginBase): def __init__(self, config, defaults, state): super(Mount, self).__init__() if 'mount-base' not in defaults: raise BlockDeviceSetupException( "Mount default config needs 'mount-base'") self.node = MountPointNode(defaults['mount-base'], config, state) # save this new node to the global mount-point list and # re-order it to keep it in mount-order. Used in get_edges() # to ensure we build the mount graph in order # # note we can't just put the MountPointNode into the state, # because it's not json serialisable and we still dump the # state to json. that's why we have this (mount_point, name) # tuples and sorting trickery sorted_mount_points = state.get('sorted_mount_points', []) mount_points = [mp for mp, name in sorted_mount_points] if self.node.mount_point in mount_points: raise BlockDeviceSetupException( "Mount point [%s] specified more than once" % self.node.mount_point) sorted_mount_points.append((self.node.mount_point, self.node.name)) # Sort by mount point so hierarchy is in shortest to longest, such # that parents mount before children; e.g. # /var < /var/log sorted_mount_points.sort(key=lambda x: x[0]) # Save the state if it's new (otherwise this is idempotent update) state['sorted_mount_points'] = sorted_mount_points logger.debug("Ordered mounts now: %s", sorted_mount_points) def get_nodes(self): return [self.node] ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3102362 diskimage_builder-3.42.0/diskimage_builder/block_device/level4/0000775000175000017500000000000015201026275023334 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/level4/__init__.py0000664000175000017500000000000015201026231025423 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/level4/fstab.py0000664000175000017500000000371215201026231025000 0ustar00zuulzuul# Copyright 2017 Andreas Florath (andreas@florath.net) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging from diskimage_builder.block_device.plugin import NodeBase from diskimage_builder.block_device.plugin import PluginBase logger = logging.getLogger(__name__) class FstabNode(NodeBase): def __init__(self, config, state): super(FstabNode, self).__init__(config['name'], state) self.base = config['base'] self.options = config.get('options', 'defaults') self.dump_freq = config.get('dump-freq', 0) self.fsck_passno = config.get('fsck-passno', 2) def get_edges(self): edge_from = [self.base] edge_to = [] return (edge_from, edge_to) def create(self): logger.debug("fstab create called [%s]", self.name) if 'fstab' not in self.state: self.state['fstab'] = {} swap = 'none' in self.state['mount'] and \ self.state['mount']['none']['name'] == self.base self.state['fstab'][self.base] = { 'name': self.name, 'base': self.base, 'options': 'sw' if swap else self.options, 'dump-freq': 0 if swap else self.dump_freq, 'fsck-passno': 0 if swap else self.fsck_passno } class Fstab(PluginBase): def __init__(self, config, defaults, state): super(Fstab, self).__init__() self.node = FstabNode(config, state) def get_nodes(self): return [self.node] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/plugin.py0000664000175000017500000001471415201026231024010 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import abc import logging # # Plugins convert configuration entries into graph nodes ready for # processing. This defines the abstract classes for both. # logger = logging.getLogger(__name__) class NodeBase(object, metaclass=abc.ABCMeta): """A configuration node entry This is the main driver class for dib-block-device operation. The final operations graph is composed of instantiations of this class. The graph undergoes a topological sort (i.e. is linearised in dependency order) and each node has :func:`create` called in order to perform its operations. Every node has a unique string ``name``. This is its key in the graph and used for edge relationships. Implementations must ensure they initalize it; e.g. .. code-block:: python class FooNode(NodeBase): def __init__(name, arg1, ...): super(FooNode, self).__init__(name) """ def __init__(self, name, state): self.name = name self.state = state self.rollbacks = [] def get_name(self): return self.name def add_rollback(self, func, *args, **kwargs): """Add a call for rollback Functions registered with this method will be called in reverse-order in the case of failures during :func:`Nodebase.create`. :param func: function to call :param args: arguments :param kwargs: keyword arguments :return: None """ self.rollbacks.append((func, args, kwargs)) def rollback(self): """Initiate rollback Call registered rollback in reverse order. This method is called by the driver in the case of failures during :func:`Nodebase.create`. :return None: """ # XXX: maybe ignore SystemExit so we always continue? logger.debug("Calling rollback for %s", self.name) for func, args, kwargs in reversed(self.rollbacks): func(*args, **kwargs) @abc.abstractmethod def get_edges(self): """Return the dependencies/edges for this node This function will be called after all nodes are created (this is because some plugins need to know the global state of all nodes to decide their dependencies). This function returns a tuple with two lists * ``edges_from`` : a list of node names that point to us * ``edges_to`` : a list of node names we point to In most cases, node creation will have saved a single parent that was given in the ``base`` parameter of the configuration. A usual return might look like: .. code-block:: python def get_edges(self): return ( [self.base], [] ) Some nodes (``level0``) don't have a base, however """ return @abc.abstractmethod def create(self): """Main creation driver This is the main driver function. After the graph is linearised, each node has it's :func:`create` function called. :raises Exception: A failure should raise an exception. This will initiate a rollback. See :func:`Nodebase.add_rollback`. :return: None """ return def umount(self): """Umount actions Actions to taken when ``dib-block-device umount`` is called. The nodes are called in the reverse order to :func:`create` :return: None """ return def cleanup(self): """Cleanup actions Actions to taken when ``dib-block-device cleanup`` is called. This is the cleanup path in the *success* case. The nodes are called in the reverse order to :func:`create` :return: None """ return def delete(self): """Cleanup actions Actions to taken when ``dib-block-device delete`` is called. This is the cleanup path in case of a reported external *failure*. The nodes are called in the reverse order to :func:`create` :return: None """ return class PluginBase(object, metaclass=abc.ABCMeta): """The base plugin object This is the base plugin object. Plugins are an instantiation of this class. There should be an entry-point (see setup.cfg) defined under ``diskimage_builder.block_device.plugin`` for each plugin, e.g. foo = diskimage_builder.block_device.levelX.foo:Foo A configuration entry in the graph config that matches this entry point will create an instance of this class, e.g. .. code-block:: yaml foo: name: foo_node base: parent_node argument_a: bar argument_b: baz The ``__init__`` function will be passed three arguments: ``config`` The full configuration dictionary for the entry. A unique ``name`` entry can be assumed. In most cases a ``base`` entry will be present giving the parent node (see :func:`NodeBase.get_edges`). ``state`` A reference to the gobal state dictionary. This should be passed to :func:`NodeBase.__init__` on node creation ``defaults`` The global defaults dictionary (see ``--params``) ``get_nodes()`` should return the node object(s) created by the config for insertion into the final configuration graph. In the simplest case, this is probably a single node created during instantiation. e.g. .. code-block:: python class Foo(PluginBase): def __init__(self, config, defaults, state): super(Foo, self).__init__() self.node = FooNode(config.name, state, ...) def get_nodes(self): return [self.node] Some plugins require more, however. """ def __init__(self): pass @abc.abstractmethod def get_nodes(self): """Return nodes created by the plugin :returns: a list of :class:`.NodeBase` objects for insertion into the graph """ return ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3112361 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/0000775000175000017500000000000015201026275023303 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/__init__.py0000664000175000017500000000000015201026231025372 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3132362 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/0000775000175000017500000000000015201026275024550 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/bad_edge_graph.yaml0000664000175000017500000000071115201026231030316 0ustar00zuulzuul- local_loop: name: image0 - partitioning: base: image0 name: mbr label: mbr partitions: - flags: [boot, primary] name: root base: image0 size: 100% - mount: base: mkfs_root name: mount_mkfs_root mount_point: / - fstab: base: mount_mkfs_root name: fstab_mount_mkfs_root fsck-passno: 1 options: defaults - mkfs: base: this_is_not_a_node name: mkfs_root type: ext4 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/bad_plugin.yaml0000664000175000017500000000006615201026231027532 0ustar00zuulzuul- this_is_not_a_plugin_name: foo: bar baz: moo././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/cmd_create.yaml0000664000175000017500000000012615201026231027511 0ustar00zuulzuul- test_a: name: test_node_a - test_b: name: test_node_b base: test_node_a././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/deep_graph.yaml0000664000175000017500000000067215201026231027527 0ustar00zuulzuul- local_loop: name: image0 - partitioning: base: image0 name: mbr label: mbr partitions: - flags: [boot, primary] name: root base: image0 size: 100% - mount: base: mkfs_root name: mount_mkfs_root mount_point: / - fstab: base: mount_mkfs_root name: fstab_mount_mkfs_root fsck-passno: 1 options: defaults - mkfs: base: root name: mkfs_root type: ext4././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/deep_tree.yaml0000664000175000017500000000052615201026231027363 0ustar00zuulzuul- local_loop: name: image0 - partitioning: name: mbr base: image0 label: mbr partitions: - name: root flags: [ boot, primary ] size: 100% mkfs: type: ext4 mount: mount_point: / fstab: options: "defaults" fsck-passno: 1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/duplicate_fs_labels.yaml0000664000175000017500000000216015201026231031407 0ustar00zuulzuul- local_loop: name: image0 - partitioning: base: image0 name: mbr label: mbr partitions: - name: root base: image0 flags: [ boot, primary ] size: 55% - name: var base: image0 size: 40% - name: var_log base: image0 size: 5% - mkfs: base: root name: mkfs_root label: duplicate type: xfs - mount: base: mkfs_root name: mount_mkfs_root mount_point: / - fstab: base: mount_mkfs_root name: fstab_mount_mkfs_root fsck-passno: 1 options: defaults - mkfs: base: var name: mkfs_var label: duplicate type: xfs - mount: base: mkfs_var name: mount_mkfs_var mount_point: /var - fstab: base: mount_mkfs_var name: fstab_mount_mkfs_var fsck-passno: 1 options: defaults - mkfs: base: var_log name: mkfs_var_log type: xfs - mount: base: mkfs_var_log name: mount_mkfs_var_log mount_point: /var/log - fstab: base: mount_mkfs_var_log name: fstab_mount_mkfs_var_log fsck-passno: 1 options: defaults ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/duplicate_name.yaml0000664000175000017500000000073215201026231030400 0ustar00zuulzuul- local_loop: name: this_is_a_duplicate - partitioning: base: this_is_a_duplicate name: root label: mbr partitions: - flags: [boot, primary] name: root base: image0 size: 100% - mount: base: mkfs_root name: this_is_a_duplicate mount_point: / - fstab: base: mount_mkfs_root name: fstab_mount_mkfs_root fsck-passno: 1 options: defaults - mkfs: base: root name: mkfs_root type: ext4 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/gpt_efi.yaml0000664000175000017500000000141415201026231027041 0ustar00zuulzuul# A sample config that has GPT/bios and EFI boot partitions - local_loop: name: image0 - partitioning: base: image0 label: gpt partitions: - name: ESP type: 'EF00' size: 8MiB mkfs: type: vfat mount: mount_point: /boot/efi fstab: options: "defaults" fsck-passno: 1 - name: BSP type: 'EF02' size: 8MiB # spaces are probably a bad idea for max compatability, but # we're deliberatly testing it here. - name: Root Part type: '8300' size: 100% mkfs: type: ext4 mount: mount_point: / fstab: options: "defaults" fsck-passno: 1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/lvm_graph.yaml0000664000175000017500000000420115201026231027400 0ustar00zuulzuul- local_loop: name: image0 - partitioning: base: image0 name: mbr label: mbr partitions: - name: root base: image0 flags: [ boot,primary ] size: 3G - lvm: base: mbr name: lvm_mbr pvs: - name: pv options: ["--force"] base: root vgs: - name: vg base: ["pv"] options: ["--force"] lvs: - name: lv_root base: vg size: 1800M - name: lv_tmp base: vg size: 100M - name: lv_var base: vg size: 500M - name: lv_log base: vg size: 100M - name: lv_audit base: vg size: 100M - name: lv_home base: vg size: 200M - mkfs: name: fs_root base: lv_root label: "img-rootfs" type: "xfs" - mount: name: mount_fs_root base: fs_root mount_point: / - fstab: name: fstab_mount_fs_root base: mount_fs_root options: "rw,relatime" fsck-passno: 1 - mkfs: name: fs_var base: lv_var type: "xfs" - mount: name: mount_fs_var base: fs_var mount_point: /var - fstab: name: fstab_mount_fs_var base: mount_fs_var options: "rw,relatime" - mkfs: name: fs_log base: lv_log type: "xfs" - mount: name: mount_fs_log base: fs_log mount_point: /var/log - fstab: name: fstab_mount_fs_log base: mount_fs_log options: "rw,relatime" - mkfs: name: fs_audit base: lv_audit type: "xfs" - mount: name: mount_fs_audit base: fs_audit mount_point: /var/log/audit - fstab: name: fstab_mount_fs_audit base: mount_fs_audit options: "rw,relatime" - mkfs: name: fs_tmp base: lv_tmp type: "xfs" - mount: name: mount_fs_tmp base: fs_tmp mount_point: /tmp - fstab: name: fstab_mount_fs_tmp base: mount_fs_tmp options: "rw,nosuid,nodev,noexec,relatime" - mkfs: name: fs_home base: lv_home type: "xfs" - mount: name: mount_fs_home base: fs_home mount_point: /home - fstab: name: fstab_mount_fs_home base: mount_fs_home options: "rw,nodev,relatime" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/lvm_tree.yaml0000664000175000017500000000320515201026231027241 0ustar00zuulzuul- local_loop: name: image0 - partitioning: base: image0 name: mbr label: mbr partitions: - name: root base: image0 flags: [ boot,primary ] size: 3G - lvm: base: mbr pvs: - name: pv options: ["--force"] base: root vgs: - name: vg base: ["pv"] options: ["--force"] lvs: - name: lv_root base: vg size: 1800M - name: lv_tmp base: vg size: 100M - name: lv_var base: vg size: 500M - name: lv_log base: vg size: 100M - name: lv_audit base: vg size: 100M - name: lv_home base: vg size: 200M - mkfs: name: fs_root base: lv_root label: "img-rootfs" type: "xfs" mount: mount_point: / fstab: options: "rw,relatime" fsck-passno: 1 - mkfs: name: fs_var base: lv_var type: "xfs" mount: mount_point: /var fstab: options: "rw,relatime" - mkfs: name: fs_log base: lv_log type: "xfs" mount: mount_point: /var/log fstab: options: "rw,relatime" - mkfs: name: fs_audit base: lv_audit type: "xfs" mount: mount_point: /var/log/audit fstab: options: "rw,relatime" - mkfs: name: fs_tmp base: lv_tmp type: "xfs" mount: mount_point: /tmp fstab: options: "rw,nosuid,nodev,noexec,relatime" - mkfs: name: fs_home base: lv_home type: "xfs" mount: mount_point: /home fstab: options: "rw,nodev,relatime" ././@PaxHeader0000000000000000000000000000020600000000000010213 xustar00112 path=diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/lvm_tree_multiple_partitions.yaml 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/lvm_tree_multiple_partitions.ya0000664000175000017500000000374015201026231033103 0ustar00zuulzuul- local_loop: name: image0 - partitioning: base: image0 label: mbr partitions: - name: root flags: [ boot ] size: 3G - name: ESP type: 'EF00' size: 8MiB mkfs: type: vfat mount: mount_point: /boot/efi fstab: options: "defaults" fsck-passno: 1 - name: BSP type: 'EF02' size: 8MiB - lvm: name: lvm base: [ root ] pvs: - name: pv base: root options: [ "--force" ] vgs: - name: vg base: [ "pv" ] options: [ "--force" ] lvs: - name: lv_root base: vg extents: 28%VG - name: lv_tmp base: vg extents: 4%VG - name: lv_var base: vg extents: 40%VG - name: lv_log base: vg extents: 23%VG - name: lv_audit base: vg extents: 4%VG - name: lv_home base: vg extents: 1%VG - mkfs: name: fs_root base: lv_root type: xfs label: "img-rootfs" mount: mount_point: / fstab: options: "rw,relatime" fck-passno: 1 - mkfs: name: fs_tmp base: lv_tmp type: xfs mount: mount_point: /tmp fstab: options: "rw,nosuid,nodev,noexec,relatime" - mkfs: name: fs_var base: lv_var type: xfs mount: mount_point: /var fstab: options: "rw,relatime" - mkfs: name: fs_log base: lv_log type: xfs mount: mount_point: /var/log fstab: options: "rw,relatime" - mkfs: name: fs_audit base: lv_audit type: xfs mount: mount_point: /var/log/audit fstab: options: "rw,relatime" - mkfs: name: fs_home base: lv_home type: xfs mount: mount_point: /home fstab: options: "rw,nodev,relatime" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/lvm_tree_multiple_pv.yaml0000664000175000017500000000335215201026231031664 0ustar00zuulzuul- local_loop: name: image0 - partitioning: base: image0 label: mbr partitions: - name: root flags: [ boot,primary ] size: 3G - name: data flags: [ primary ] size: 1G - lvm: name: lvm pvs: - name: pv options: ["--force"] base: root - name: pv1 options: ["--force"] base: data vgs: - name: vg base: ["pv", "pv1"] options: ["--force"] lvs: - name: lv_root base: vg size: 1800M - name: lv_tmp base: vg size: 100M - name: lv_var base: vg size: 500M - name: lv_log base: vg size: 100M - name: lv_audit base: vg size: 100M - name: lv_home base: vg size: 200M - mkfs: name: fs_root base: lv_root label: "img-rootfs" type: "xfs" mount: mount_point: / fstab: options: "rw,relatime" fsck-passno: 1 - mkfs: name: fs_var base: lv_var type: "xfs" mount: mount_point: /var fstab: options: "rw,relatime" - mkfs: name: fs_log base: lv_log type: "xfs" mount: mount_point: /var/log fstab: options: "rw,relatime" - mkfs: name: fs_audit base: lv_audit type: "xfs" mount: mount_point: /var/log/audit fstab: options: "rw,relatime" - mkfs: name: fs_tmp base: lv_tmp type: "xfs" mount: mount_point: /tmp fstab: options: "rw,nosuid,nodev,noexec,relatime" - mkfs: name: fs_home base: lv_home type: "xfs" mount: mount_point: /home fstab: options: "rw,nodev,relatime" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/lvm_tree_multiple_pv_vg.yaml0000664000175000017500000000346015201026231032360 0ustar00zuulzuul- local_loop: name: image0 - partitioning: base: image0 label: mbr partitions: - name: root flags: [ boot,primary ] size: 3G - name: data flags: [ primary ] size: 1G - lvm: name: lvm pvs: - name: pv options: ["--force"] base: root - name: pv1 options: ["--force"] base: data vgs: - name: vg1 base: ["pv"] options: ["--force"] - name: vg2 base: ["pv1"] options: ["--force"] lvs: - name: lv_root base: vg1 size: 1800M - name: lv_tmp base: vg1 size: 100M - name: lv_var base: vg2 size: 500M - name: lv_log base: vg2 size: 100M - name: lv_audit base: vg2 size: 100M - name: lv_home base: vg2 size: 200M - mkfs: name: fs_root base: lv_root label: "img-rootfs" type: "xfs" mount: mount_point: / fstab: options: "rw,relatime" fsck-passno: 1 - mkfs: name: fs_var base: lv_var type: "xfs" mount: mount_point: /var fstab: options: "rw,relatime" - mkfs: name: fs_log base: lv_log type: "xfs" mount: mount_point: /var/log fstab: options: "rw,relatime" - mkfs: name: fs_audit base: lv_audit type: "xfs" mount: mount_point: /var/log/audit fstab: options: "rw,relatime" - mkfs: name: fs_tmp base: lv_tmp type: "xfs" mount: mount_point: /tmp fstab: options: "rw,nosuid,nodev,noexec,relatime" - mkfs: name: fs_home base: lv_home type: "xfs" mount: mount_point: /home fstab: options: "rw,nodev,relatime" ././@PaxHeader0000000000000000000000000000020500000000000010212 xustar00111 path=diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/lvm_tree_partition_ordering.yaml 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/lvm_tree_partition_ordering.yam0000664000175000017500000000227415201026231033054 0ustar00zuulzuul- local_loop: name: image0 size: 5G - partitioning: base: image0 label: mbr partitions: - name: boot flags: [boot, primary] size: 1G - name: root flags: [primary] size: 3G - lvm: name: lvm base: [root] pvs: - name: pv base: root vgs: - name: vg base: ["pv"] lvs: - name: lv_root base: vg size: 1900M - name: lv_var base: vg size: 500M - name: lv_swap base: vg size: 100M - mkfs: base: boot type: ext3 mount: mount_point: /boot fstab: options: "nodev,nosuid" fsck-passno: 2 - mkfs: name: mkfs_root base: lv_root label: "img-rootfs" type: "ext4" mount: mount_point: / fstab: options: "noacl,errors=remount-ro" fsck-passno: 1 - mkfs: name: mkfs_var base: lv_var type: "ext4" mount: mount_point: /var fstab: options: "noacl" fsck-passno: 2 - mkfs: name: mkfs_swap base: lv_swap type: "swap" mount: mount_point: none fstab: options: "sw" fsck-passno: 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/lvm_tree_spanned_vg.yaml0000664000175000017500000000234515201026231031451 0ustar00zuulzuul# testing config for a LVM data volume group that spans two partitions - local_loop: name: image0 - partitioning: base: image0 label: mbr partitions: - name: root flags: [ boot,primary ] size: 3G - name: data1 flags: [ primary ] size: 1G - name: data2 flags: [ primary ] size: 1G - lvm: name: lvm pvs: - name: pv_root options: ["--force"] base: root - name: pv_data1 options: ["--force"] base: data1 - name: pv_data2 options: ["--force"] base: data2 vgs: - name: vg_root base: ["pv_root"] options: ["--force"] - name: vg_data base: ["pv_data1", "pv_data2"] options: ["--force"] lvs: - name: lv_root base: vg_root size: 1800M - name: lv_data base: vg_data size: 2G - mkfs: name: fs_root base: lv_root label: "img-rootfs" type: "xfs" mount: mount_point: / fstab: options: "rw,relatime" fsck-passno: 1 - mkfs: name: fs_data base: lv_data type: "xfs" mount: mount_point: /opt fstab: options: "rw,relatime" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/lvm_tree_thin_provision.yaml0000664000175000017500000000402715201026231032376 0ustar00zuulzuul- local_loop: name: image0 - partitioning: base: image0 name: mbr label: mbr partitions: - name: root base: image0 flags: [ boot,primary ] size: 3G - lvm: base: mbr pvs: - name: pv options: ["--force"] base: root vgs: - name: vg base: ["pv"] options: ["--force"] lvs: - name: lv_thinpool type: thin-pool base: vg size: 2800MiB - name: lv_root type: thin thin-pool: lv_thinpool base: vg size: 1800MiB - name: lv_tmp type: thin thin-pool: lv_thinpool base: vg size: 100MiB - name: lv_var type: thin thin-pool: lv_thinpool base: vg size: 500MiB - name: lv_log type: thin thin-pool: lv_thinpool base: vg size: 100MiB - name: lv_audit type: thin thin-pool: lv_thinpool base: vg size: 100MiB - name: lv_home type: thin thin-pool: lv_thinpool base: vg size: 200MiB - mkfs: name: fs_root base: lv_root label: "img-rootfs" type: "xfs" mount: mount_point: / fstab: options: "rw,relatime" fsck-passno: 1 - mkfs: name: fs_var base: lv_var type: "xfs" mount: mount_point: /var fstab: options: "rw,relatime" - mkfs: name: fs_log base: lv_log type: "xfs" mount: mount_point: /var/log fstab: options: "rw,relatime" - mkfs: name: fs_audit base: lv_audit type: "xfs" mount: mount_point: /var/log/audit fstab: options: "rw,relatime" - mkfs: name: fs_tmp base: lv_tmp type: "xfs" mount: mount_point: /tmp fstab: options: "rw,nosuid,nodev,noexec,relatime" - mkfs: name: fs_home base: lv_home type: "xfs" mount: mount_point: /home fstab: options: "rw,nodev,relatime" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/multi_key_node.yaml0000664000175000017500000000020115201026231030424 0ustar00zuulzuul- mkfs: name: root_fs base: root_part type: xfs mount: name: mount_root_fs base: root_fs mount_point: /././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/multiple_partitions_graph.yaml0000664000175000017500000000265615201026231032725 0ustar00zuulzuul- local_loop: name: image0 - partitioning: base: image0 name: mbr label: mbr partitions: - name: root base: image0 flags: [boot, primary] size: 54% - name: var base: image0 size: 40% - name: var_log base: image0 size: 5% - name: swap base: image0 size: 1% - mkfs: base: root name: mkfs_root type: xfs uuid: root-uuid-1234 - mount: base: mkfs_root name: mount_mkfs_root mount_point: / - fstab: base: mount_mkfs_root name: fstab_mount_mkfs_root fsck-passno: 1 options: defaults - mkfs: base: var name: mkfs_var type: xfs uuid: var-uuid-1234 - mount: base: mkfs_var name: mount_mkfs_var mount_point: /var - fstab: base: mount_mkfs_var name: fstab_mount_mkfs_var fsck-passno: 1 options: defaults - mkfs: base: var_log name: mkfs_var_log type: vfat label: varlog - mount: base: mkfs_var_log name: mount_mkfs_var_log mount_point: /var/log - fstab: base: mount_mkfs_var_log name: fstab_mount_mkfs_var_log fsck-passno: 1 options: defaults - mkfs: base: swap name: mkfs_swap type: swap uuid: swap-uuid-1234 - mount: base: mkfs_swap name: mount_mkfs_swap mount_point: none - fstab: base: mount_mkfs_swap name: fstab_mount_mkfs_swap fsck-passno: 0 options: sw ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/multiple_partitions_tree.yaml0000664000175000017500000000203615201026231032553 0ustar00zuulzuul- local_loop: name: image0 - partitioning: base: image0 name: mbr label: mbr partitions: - name: root flags: [boot, primary] size: 54% mkfs: type: xfs uuid: root-uuid-1234 mount: mount_point: / fstab: options: "defaults" fsck-passno: 1 - name: var size: 40% mkfs: type: xfs uuid: var-uuid-1234 mount: mount_point: /var fstab: options: "defaults" fsck-passno: 1 - name: var_log size: 5% mkfs: type: vfat label: varlog mount: mount_point: /var/log fstab: options: "defaults" fsck-passno: 1 - name: swap size: 1% mkfs: type: swap uuid: swap-uuid-1234 mount: mount_point: none fstab: fsck-passno: 0 options: "sw" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/rollback.yaml0000664000175000017500000000105015201026231027211 0ustar00zuulzuul- test_a: name: test_node_a rollback_one_arg: down rollback_two_arg: you - test_b: base: test_node_a name: test_node_b rollback_one_arg: let rollback_two_arg: gonna - test_a: base: test_node_b name: test_node_aa rollback_one_arg: never rollback_two_arg: up - test_b: base: test_node_aa name: test_node_bb rollback_one_arg: you rollback_two_arg: give - test_a: base: test_node_bb name: test_node_aaa rollback_one_arg: gonna rollback_two_arg: never trigger_rollback: yes././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/simple_graph.yaml0000664000175000017500000000020215201026231030070 0ustar00zuulzuul- mkfs: name: root_fs base: root_part type: xfs - mount: name: mount_root_fs base: root_fs mount_point: /././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/simple_tree.yaml0000664000175000017500000000013315201026231027731 0ustar00zuulzuul- mkfs: name: root_fs base: root_part type: xfs mount: mount_point: /././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/config/too_long_fs_label.yaml0000664000175000017500000000015415201026231031073 0ustar00zuulzuul- mkfs: base: fake name: mkfs_root label: this_label_is_too_long_to_work_with_xfs type: xfs ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3142362 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/plugin/0000775000175000017500000000000015201026275024601 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/plugin/__init__.py0000664000175000017500000000000015201026231026670 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/plugin/test_a.py0000664000175000017500000000537315201026231026432 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # plugin test case import logging from diskimage_builder.block_device.plugin import NodeBase from diskimage_builder.block_device.plugin import PluginBase logger = logging.getLogger(__name__) class TestANode(NodeBase): def __init__(self, config, state, test_rollback): logger.debug("Create test 1") super(TestANode, self).__init__(config['name'], state) # might be a root node, so possibly no base if 'base' in config: self.base = config['base'] # put something in the state for test_b to check for state['test_init_state'] = 'here' # If we're doing rollback testing the config has some strings # set for us if test_rollback: self.add_rollback(self.do_rollback, config['rollback_one_arg']) self.add_rollback(self.do_rollback, config['rollback_two_arg']) # see if we're the node who is going to fail self.trigger_rollback = True if 'trigger_rollback' in config else False def get_edges(self): # may not have a base, if used as root node to = [self.base] if hasattr(self, 'base') else [] return (to, []) def do_rollback(self, string): # We will check this after all rollbacks to make sure they ran # in the right order self.state['rollback_test'].append(string) def create(self): # put some fake entries into state self.state['test_a'] = {} self.state['test_a']['value'] = 'foo' self.state['test_a']['value2'] = 'bar' if self.trigger_rollback: # The rollback test will append the strings to this as # it unrolls, and we'll check it's value at the end self.state['rollback_test'] = [] raise RuntimeError("Rollback triggered") return def umount(self): # Umount is run in reverse. This key should exist from test_b self.state['umount'].append('test_a') class TestA(PluginBase): def __init__(self, config, defaults, state): super(TestA, self).__init__() test_rollback = True if 'test_rollback' in defaults else False self.node = TestANode(config, state, test_rollback) def get_nodes(self): return [self.node] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/plugin/test_b.py0000664000175000017500000000446415201026231026433 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # plugin test case import logging from diskimage_builder.block_device.plugin import NodeBase from diskimage_builder.block_device.plugin import PluginBase logger = logging.getLogger(__name__) class TestBNode(NodeBase): def __init__(self, config, state, test_rollback): logger.debug("Create test 1") super(TestBNode, self).__init__(config['name'], state) self.base = config['base'] # If we're doing rollback testing the config has some strings # set for us. if test_rollback: self.add_rollback(self.do_rollback, config['rollback_one_arg']) self.add_rollback(self.do_rollback, config['rollback_two_arg']) def get_edges(self): # this should have been inserted by test_a before # we are called assert self.state['test_init_state'] == 'here' return ([self.base], []) def do_rollback(self, string): # We will check this after all rollbacks to make sure they ran # in the right order self.state['rollback_test'].append(string) def create(self): self.state['test_b'] = {} self.state['test_b']['value'] = 'baz' return def umount(self): # these values should have persisteted from create() assert self.state['test_b']['value'] == 'baz' # umount run in reverse. this should run before test_a assert 'umount' not in self.state self.state['umount'] = [] self.state['umount'].append('test_b') class TestB(PluginBase): def __init__(self, config, defaults, state): super(TestB, self).__init__() test_rollback = True if 'test_rollback' in defaults else False self.node = TestBNode(config, state, test_rollback) def get_nodes(self): return [self.node] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/test_base.py0000664000175000017500000000254215201026231025621 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import fixtures import logging import os import testtools import yaml logger = logging.getLogger(__name__) class TestBase(testtools.TestCase): """Base for all test cases""" def setUp(self): super(TestBase, self).setUp() fs = '%(asctime)s %(levelname)s [%(name)s] %(message)s' self.log_fixture = self.useFixture( fixtures.FakeLogger(level=logging.DEBUG, format=fs)) def get_config_file(self, f): """Get the full path to sample config file f """ logger.debug(os.path.dirname(__file__)) return os.path.join(os.path.dirname(__file__), 'config', f) def load_config_file(self, f): """Load f and return it after yaml parsing""" path = self.get_config_file(f) with open(path, 'r') as config: return yaml.safe_load(config) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/test_config.py0000664000175000017500000001374715201026231026165 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging from diskimage_builder.block_device.config import config_tree_to_graph from diskimage_builder.block_device.config import create_graph from diskimage_builder.block_device.exception import \ BlockDeviceSetupException from diskimage_builder.block_device.tests.test_base import TestBase logger = logging.getLogger(__name__) class TestConfig(TestBase): """Helper for setting up and reading a config""" def setUp(self): super(TestConfig, self).setUp() # previously we mocked some globals here ... class TestGraphGeneration(TestConfig): """Extra helper class for testing graph generation""" def setUp(self): super(TestGraphGeneration, self).setUp() self.fake_default_config = { 'build-dir': '/fake', 'image-size': '1000', 'image-dir': '/fake', 'mount-base': '/fake', } class TestConfigParsing(TestConfig): """Test parsing config file into a graph""" # test an entry in the config not being a valid plugin def test_config_bad_plugin(self): config = self.load_config_file('bad_plugin.yaml') self.assertRaises(BlockDeviceSetupException, config_tree_to_graph, config) # test a config that has multiple keys for a top-level entry def test_config_multikey_node(self): config = self.load_config_file('multi_key_node.yaml') self.assertRaisesRegex(BlockDeviceSetupException, "Config entry top-level should be a single " "dict:", config_tree_to_graph, config) # a graph should remain the same def test_graph(self): graph = self.load_config_file('simple_graph.yaml') parsed_graph = config_tree_to_graph(graph) self.assertCountEqual(parsed_graph, graph) # equivalence of simple tree to graph def test_simple_tree(self): tree = self.load_config_file('simple_tree.yaml') graph = self.load_config_file('simple_graph.yaml') parsed_graph = config_tree_to_graph(tree) self.assertCountEqual(parsed_graph, graph) # equivalence of a deeper tree to graph def test_deep_tree(self): tree = self.load_config_file('deep_tree.yaml') graph = self.load_config_file('deep_graph.yaml') parsed_graph = config_tree_to_graph(tree) self.assertCountEqual(parsed_graph, graph) # equivalence of a complicated multi-partition tree to graph def test_multipart_tree(self): tree = self.load_config_file('multiple_partitions_tree.yaml') graph = self.load_config_file('multiple_partitions_graph.yaml') parsed_graph = config_tree_to_graph(tree) logger.debug(parsed_graph) self.assertCountEqual(parsed_graph, graph) class TestCreateGraph(TestGraphGeneration): # Test a graph with bad edge pointing to an invalid node def test_invalid_missing(self): config = self.load_config_file('bad_edge_graph.yaml') self.assertRaisesRegex(BlockDeviceSetupException, "Edge not defined: this_is_not_a_node", create_graph, config, self.fake_default_config, {}) # Test a graph with bad edge pointing to an invalid node def test_duplicate_name(self): config = self.load_config_file('duplicate_name.yaml') self.assertRaisesRegex(BlockDeviceSetupException, "Duplicate node name: " "this_is_a_duplicate", create_graph, config, self.fake_default_config, {}) # Test digraph generation from deep_graph config file def test_deep_graph_generator(self): config = self.load_config_file('deep_graph.yaml') graph, call_order = create_graph(config, self.fake_default_config, {}) call_order_list = [n.name for n in call_order] # manually created from deep_graph.yaml # Note unlike below, the sort here is stable because the graph # doesn't have multiple paths with only one partition call_order_names = ['image0', 'root', 'mkfs_root', 'mount_mkfs_root', 'fstab_mount_mkfs_root'] self.assertListEqual(call_order_list, call_order_names) # Test multiple partition digraph generation def test_multiple_partitions_graph_generator(self): config = self.load_config_file('multiple_partitions_graph.yaml') graph, call_order = create_graph(config, self.fake_default_config, {}) call_order_list = [n.name for n in call_order] # The sort creating call_order_list is unstable. # We want to ensure we see the "partitions" object in # root->var->var_log order root_pos = call_order_list.index('root') var_pos = call_order_list.index('var') var_log_pos = call_order_list.index('var_log') self.assertGreater(var_pos, root_pos) self.assertGreater(var_log_pos, var_pos) # Ensure mkfs happens after partition mkfs_root_pos = call_order_list.index('mkfs_root') self.assertLess(root_pos, mkfs_root_pos) mkfs_var_pos = call_order_list.index('mkfs_var') self.assertLess(var_pos, mkfs_var_pos) mkfs_var_log_pos = call_order_list.index('mkfs_var_log') self.assertLess(var_log_pos, mkfs_var_log_pos) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/test_gpt.py0000664000175000017500000000700115201026231025474 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import fixtures import logging import os from unittest import mock import diskimage_builder.block_device.tests.test_config as tc from diskimage_builder.block_device.blockdevice import BlockDeviceState from diskimage_builder.block_device.config import config_tree_to_graph from diskimage_builder.block_device.config import create_graph from diskimage_builder.block_device.level0.localloop import image_create from diskimage_builder.block_device.level1.partition import PartitionNode logger = logging.getLogger(__name__) class TestGPT(tc.TestGraphGeneration): @mock.patch('diskimage_builder.block_device.level1.partitioning.exec_sudo') def test_gpt_efi(self, mock_exec_sudo): # Test the command-sequence for a GPT/EFI partition setup tree = self.load_config_file('gpt_efi.yaml') config = config_tree_to_graph(tree) state = BlockDeviceState() graph, call_order = create_graph(config, self.fake_default_config, state) # Create a fake temp backing file (we check the size of it, # etc). # TODO(ianw): exec_sudo is generically mocked out, thus the # actual creation is mocked out ... but we could do this # without root and use parted to create the partitions on this # for slightly better testing. An exercise for another day... self.tmp_dir = fixtures.TempDir() self.useFixture(self.tmp_dir) self.image_path = os.path.join(self.tmp_dir.path, "image.raw") # should be sparse... image_create(self.image_path, 1024 * 1024 * 1024) logger.debug("Temp image in %s", self.image_path) # Fake state for the loopback device state['blockdev'] = {} state['blockdev']['image0'] = {} state['blockdev']['image0']['image'] = self.image_path state['blockdev']['image0']['device'] = "/dev/loopX" for node in call_order: if isinstance(node, PartitionNode): node.create() # check the parted call looks right parted_cmd = ['sgdisk', '/dev/loopX', '-n', '1:0:+8M', '-t', '1:EF00', '-c', '1:ESP', '-n', '2:0:+8M', '-t', '2:EF02', '-c', '2:BSP', '-n', '3:0:+1006M', '-t', '3:8300', '-c', '3:Root Part'] cmd_sequence = [ mock.call(parted_cmd), mock.call(['sync']), mock.call(['kpartx', '-uvs', '/dev/loopX']) ] self.assertEqual(mock_exec_sudo.call_count, len(cmd_sequence)) mock_exec_sudo.assert_has_calls(cmd_sequence) # Check two new partitions appear in state correctly self.assertDictEqual(state['blockdev']['ESP'], {'device': '/dev/mapper/loopXp1'}) self.assertDictEqual(state['blockdev']['BSP'], {'device': '/dev/mapper/loopXp2'}) self.assertDictEqual(state['blockdev']['Root Part'], {'device': '/dev/mapper/loopXp3'}) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/test_lvm.py0000664000175000017500000007215015201026231025507 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import copy import logging from unittest import mock import diskimage_builder.block_device.tests.test_config as tc from diskimage_builder.block_device.blockdevice import BlockDeviceState from diskimage_builder.block_device.config import config_tree_to_graph from diskimage_builder.block_device.config import create_graph from diskimage_builder.block_device.exception import \ BlockDeviceSetupException from diskimage_builder.block_device.level0.localloop import LocalLoopNode from diskimage_builder.block_device.level1.lvm import LVMNode from diskimage_builder.block_device.level1.lvm import LVMPlugin from diskimage_builder.block_device.level1.lvm import LvsNode from diskimage_builder.block_device.level1.lvm import PvsNode from diskimage_builder.block_device.level1.lvm import VgsNode from diskimage_builder.block_device.level1.partitioning import PartitionNode logger = logging.getLogger(__name__) class TestLVM(tc.TestGraphGeneration): def test_lvm_tree_to_graph(self): # equivalence of tree-based to graph-based config tree = self.load_config_file('lvm_tree.yaml') graph = self.load_config_file('lvm_graph.yaml') parsed_graph = config_tree_to_graph(tree) self.assertCountEqual(parsed_graph, graph) def test_lvm_invalid_config(self): # test some invalid config paths config = self.load_config_file('lvm_graph.yaml') lvm_config = config[2]['lvm'] bad_config = copy.deepcopy(lvm_config) bad_config['vgs'][0]['base'] = ['invalid_pv'] self.assertRaisesRegex(BlockDeviceSetupException, "base:invalid_pv in vgs does not match " "a valid pvs", LVMPlugin, bad_config, {}, {}) bad_config = copy.deepcopy(lvm_config) bad_config['lvs'][0]['base'] = ['invalid_vg'] self.assertRaisesRegex(BlockDeviceSetupException, r"base:\['invalid_vg'\] in lvs does not match " r"a valid vg", LVMPlugin, bad_config, {}, {}) bad_config = copy.deepcopy(lvm_config) del bad_config['lvs'][0]['size'] self.assertRaisesRegex(BlockDeviceSetupException, "Missing 'size' or 'extents' in lvs config", LVMPlugin, bad_config, {}, {}) @mock.patch('diskimage_builder.block_device.level1.lvm.exec_sudo') def test_lvm_multi_pv(self, mock_exec_sudo): # Test the command-sequence for a more complicated LVM setup tree = self.load_config_file('lvm_tree_multiple_pv.yaml') config = config_tree_to_graph(tree) state = BlockDeviceState() graph, call_order = create_graph(config, self.fake_default_config, state) # XXX: todo; test call_order. Make sure PV's come before, VG; # VG before LV, and that mounts/etc happen afterwards. # Fake state for the two PV's specified by this config state['blockdev'] = {} state['blockdev']['root'] = {} state['blockdev']['root']['device'] = '/dev/fake/root' state['blockdev']['data'] = {} state['blockdev']['data']['device'] = '/dev/fake/data' for node in call_order: # XXX: This has not mocked out the "lower" layers of # creating the devices, which we're assuming works OK, nor # the upper layers. if isinstance(node, (LVMNode, PvsNode, VgsNode, LvsNode)): # only the LVMNode actually does anything here... node.create() # ensure the sequence of calls correctly setup the devices cmd_sequence = [ # create the pv's on the faked out block devices mock.call(['pvcreate', '/dev/fake/root', '--force']), mock.call(['pvcreate', '/dev/fake/data', '--force']), # create a volume called "vg" out of these two pv's mock.call(['vgcreate', 'vg', '/dev/fake/root', '/dev/fake/data', '--force']), # create a bunch of lv's on vg mock.call(['lvcreate', '--name', 'lv_root', '-L', '1799356416B', 'vg']), mock.call(['lvcreate', '--name', 'lv_tmp', '-L', '96468992B', 'vg']), mock.call(['lvcreate', '--name', 'lv_var', '-L', '499122176B', 'vg']), mock.call(['lvcreate', '--name', 'lv_log', '-L', '96468992B', 'vg']), mock.call(['lvcreate', '--name', 'lv_audit', '-L', '96468992B', 'vg']), mock.call(['lvcreate', '--name', 'lv_home', '-L', '197132288B', 'vg'])] self.assertEqual(mock_exec_sudo.call_count, len(cmd_sequence)) mock_exec_sudo.assert_has_calls(cmd_sequence) # Ensure the correct LVM state was preserved blockdev_state = { 'data': {'device': '/dev/fake/data'}, 'root': {'device': '/dev/fake/root'}, 'lv_audit': { 'device': '/dev/mapper/vg-lv_audit', 'extents': None, 'opts': None, 'size': '100M', 'vgs': 'vg' }, 'lv_home': { 'device': '/dev/mapper/vg-lv_home', 'extents': None, 'opts': None, 'size': '200M', 'vgs': 'vg' }, 'lv_log': { 'device': '/dev/mapper/vg-lv_log', 'extents': None, 'opts': None, 'size': '100M', 'vgs': 'vg' }, 'lv_root': { 'device': '/dev/mapper/vg-lv_root', 'extents': None, 'opts': None, 'size': '1800M', 'vgs': 'vg' }, 'lv_tmp': { 'device': '/dev/mapper/vg-lv_tmp', 'extents': None, 'opts': None, 'size': '100M', 'vgs': 'vg' }, 'lv_var': { 'device': '/dev/mapper/vg-lv_var', 'extents': None, 'opts': None, 'size': '500M', 'vgs': 'vg' }, } # state.debug_dump() self.assertDictEqual(state['blockdev'], blockdev_state) # XXX: mount ordering? fs creation? def test_lvm_multi_pv_vg(self): # Test the command-sequence for a more complicated LVM setup tree = self.load_config_file('lvm_tree_multiple_pv_vg.yaml') config = config_tree_to_graph(tree) state = BlockDeviceState() graph, call_order = create_graph(config, self.fake_default_config, state) # XXX: todo; test call_order. Make sure PV's come before, VG; # VG before LV, and that mounts/etc happen afterwards. # Fake state for the two PV's specified by this config state['blockdev'] = {} state['blockdev']['root'] = {} state['blockdev']['root']['device'] = '/dev/fake/root' state['blockdev']['data'] = {} state['blockdev']['data']['device'] = '/dev/fake/data' # We mock patch this ... it's just a little long! exec_sudo = 'diskimage_builder.block_device.level1.lvm.exec_sudo' # # Creation test # with mock.patch(exec_sudo) as mock_exec_sudo: for node in call_order: # XXX: This has not mocked out the "lower" layers of # creating the devices, which we're assuming works OK, nor # the upper layers. if isinstance(node, (LVMNode, PvsNode, VgsNode, LvsNode)): # only the PvsNode actually does anything here... node.create() # ensure the sequence of calls correctly setup the devices cmd_sequence = [ # create the pv's on the faked out block devices mock.call(['pvcreate', '/dev/fake/root', '--force']), mock.call(['pvcreate', '/dev/fake/data', '--force']), # create a volume called "vg" out of these two pv's mock.call(['vgcreate', 'vg1', '/dev/fake/root', '--force']), mock.call(['vgcreate', 'vg2', '/dev/fake/data', '--force']), # create a bunch of lv's on vg mock.call(['lvcreate', '--name', 'lv_root', '-L', '1799356416B', 'vg1']), mock.call(['lvcreate', '--name', 'lv_tmp', '-L', '96468992B', 'vg1']), mock.call(['lvcreate', '--name', 'lv_var', '-L', '499122176B', 'vg2']), mock.call(['lvcreate', '--name', 'lv_log', '-L', '96468992B', 'vg2']), mock.call(['lvcreate', '--name', 'lv_audit', '-L', '96468992B', 'vg2']), mock.call(['lvcreate', '--name', 'lv_home', '-L', '197132288B', 'vg2'])] self.assertListEqual(mock_exec_sudo.call_args_list, cmd_sequence) # Ensure the correct LVM state was preserved blockdev_state = { 'data': {'device': '/dev/fake/data'}, 'root': {'device': '/dev/fake/root'}, 'lv_audit': { 'device': '/dev/mapper/vg2-lv_audit', 'extents': None, 'opts': None, 'size': '100M', 'vgs': 'vg2' }, 'lv_home': { 'device': '/dev/mapper/vg2-lv_home', 'extents': None, 'opts': None, 'size': '200M', 'vgs': 'vg2' }, 'lv_log': { 'device': '/dev/mapper/vg2-lv_log', 'extents': None, 'opts': None, 'size': '100M', 'vgs': 'vg2' }, 'lv_root': { 'device': '/dev/mapper/vg1-lv_root', 'extents': None, 'opts': None, 'size': '1800M', 'vgs': 'vg1' }, 'lv_tmp': { 'device': '/dev/mapper/vg1-lv_tmp', 'extents': None, 'opts': None, 'size': '100M', 'vgs': 'vg1' }, 'lv_var': { 'device': '/dev/mapper/vg2-lv_var', 'extents': None, 'opts': None, 'size': '500M', 'vgs': 'vg2' }, } # state.debug_dump() self.assertDictEqual(state['blockdev'], blockdev_state) # # Umount test # with mock.patch(exec_sudo) as mock_exec_sudo, \ mock.patch('tempfile.NamedTemporaryFile') as mock_temp, \ mock.patch('os.unlink'): # each call to tempfile.NamedTemporaryFile will return a # new mock with a unique filename, which we store in # tempfiles tempfiles = [] def new_tempfile(*args, **kwargs): n = '/tmp/files%s' % len(tempfiles) # trap! note mock.Mock(name = n) doesn't work like you # think it would, since mock has a name attribute. # That's why we override it with the configure_mock # (this is mentioned in mock documentation if you read # it :) r = mock.Mock() r.configure_mock(name=n) tempfiles.append(n) return r mock_temp.side_effect = new_tempfile def run_it(phase): reverse_order = reversed(call_order) for node in reverse_order: if isinstance(node, (LVMNode, PvsNode, VgsNode, LvsNode)): getattr(node, phase)() else: logger.debug("Skipping node for test: %s", node) run_it('umount') run_it('cleanup') cmd_sequence = [ # delete the lv's mock.call(['lvchange', '-an', '/dev/vg1/lv_root']), mock.call(['lvchange', '-an', '/dev/vg1/lv_tmp']), mock.call(['lvchange', '-an', '/dev/vg2/lv_var']), mock.call(['lvchange', '-an', '/dev/vg2/lv_log']), mock.call(['lvchange', '-an', '/dev/vg2/lv_audit']), mock.call(['lvchange', '-an', '/dev/vg2/lv_home']), # delete the vg's mock.call(['vgchange', '-an', 'vg1']), mock.call(['vgchange', '-an', 'vg2']), mock.call(['udevadm', 'settle']), mock.call(['pvscan', '--cache']), ] self.assertListEqual(mock_exec_sudo.call_args_list, cmd_sequence) def test_lvm_spanned_vg(self): # Test when a volume group spans some partitions tree = self.load_config_file('lvm_tree_spanned_vg.yaml') config = config_tree_to_graph(tree) state = BlockDeviceState() graph, call_order = create_graph(config, self.fake_default_config, state) # XXX: todo; test call_order. Make sure PV's come before, VG; # VG before LV, and that mounts/etc happen afterwards. # Fake state for the two PV's specified by this config state['blockdev'] = {} state['blockdev']['root'] = {} state['blockdev']['root']['device'] = '/dev/fake/root' state['blockdev']['data1'] = {} state['blockdev']['data1']['device'] = '/dev/fake/data1' state['blockdev']['data2'] = {} state['blockdev']['data2']['device'] = '/dev/fake/data2' # We mock patch this ... it's just a little long! exec_sudo = 'diskimage_builder.block_device.level1.lvm.exec_sudo' # # Creation test # with mock.patch(exec_sudo) as mock_exec_sudo: for node in call_order: # XXX: This has not mocked out the "lower" layers of # creating the devices, which we're assuming works OK, nor # the upper layers. if isinstance(node, (LVMNode, PvsNode, VgsNode, LvsNode)): # only the LVMNode actually does anything here... node.create() # ensure the sequence of calls correctly setup the devices cmd_sequence = [ # create the pv's on the faked out block devices mock.call(['pvcreate', '/dev/fake/root', '--force']), mock.call(['pvcreate', '/dev/fake/data1', '--force']), mock.call(['pvcreate', '/dev/fake/data2', '--force']), # create a root and a data volume, with the data volume # spanning data1 & data2 mock.call(['vgcreate', 'vg_root', '/dev/fake/root', '--force']), mock.call(['vgcreate', 'vg_data', '/dev/fake/data1', '/dev/fake/data2', '--force']), # create root and data volume mock.call(['lvcreate', '--name', 'lv_root', '-L', '1799356416B', 'vg_root']), mock.call(['lvcreate', '--name', 'lv_data', '-L', '1996488704B', 'vg_data']) ] self.assertListEqual(mock_exec_sudo.call_args_list, cmd_sequence) with mock.patch(exec_sudo) as mock_exec_sudo, \ mock.patch('tempfile.NamedTemporaryFile') as mock_temp, \ mock.patch('os.unlink'): # see above ... tempfiles = [] def new_tempfile(*args, **kwargs): n = '/tmp/files%s' % len(tempfiles) r = mock.Mock() r.configure_mock(name=n) tempfiles.append(n) return r mock_temp.side_effect = new_tempfile def run_it(phase): reverse_order = reversed(call_order) for node in reverse_order: if isinstance(node, (LVMNode, PvsNode, VgsNode, LvsNode)): getattr(node, phase)() else: logger.debug("Skipping node for test: %s", node) run_it('umount') run_it('cleanup') cmd_sequence = [ # deactivate lv's mock.call(['lvchange', '-an', '/dev/vg_root/lv_root']), mock.call(['lvchange', '-an', '/dev/vg_data/lv_data']), # deactivate vg's mock.call(['vgchange', '-an', 'vg_root']), mock.call(['vgchange', '-an', 'vg_data']), mock.call(['udevadm', 'settle']), mock.call(['pvscan', '--cache']), ] self.assertListEqual(mock_exec_sudo.call_args_list, cmd_sequence) def test_lvm_multiple_partitions(self): # Test the command-sequence for several partitions, one containing # volumes on it tree = self.load_config_file('lvm_tree_multiple_partitions.yaml') config = config_tree_to_graph(tree) state = BlockDeviceState() graph, call_order = create_graph(config, self.fake_default_config, state) # Fake state for the partitions on this config state['blockdev'] = {} state['blockdev']['image0'] = {} state['blockdev']['image0']['device'] = '/dev/fake/image0' state['blockdev']['image0']['image'] = 'image' state['blockdev']['root'] = {} state['blockdev']['root']['device'] = '/dev/fake/root' state['blockdev']['ESP'] = {} state['blockdev']['ESP']['device'] = '/dev/fake/ESP' state['blockdev']['BSP'] = {} state['blockdev']['BSP']['device'] = '/dev/fake/BSP' # # Creation test # # We mock out the following exec_sudo and other related calls # calls for the layers we are testing. exec_sudo_lvm = 'diskimage_builder.block_device.level1.lvm.exec_sudo' exec_sudo_part = ('diskimage_builder.block_device.' 'level1.partitioning.exec_sudo') exec_sudo_loop = ('diskimage_builder.block_device.' 'level0.localloop.exec_sudo') image_create = ('diskimage_builder.block_device.level0.' 'localloop.LocalLoopNode.create') size_of_block = ('diskimage_builder.block_device.level1.' 'partitioning.Partitioning._size_of_block_dev') create_mbr = ('diskimage_builder.block_device.level1.' 'partitioning.Partitioning._create_mbr') manager = mock.MagicMock() with mock.patch(exec_sudo_lvm) as mock_sudo_lvm, \ mock.patch(exec_sudo_part) as mock_sudo_part, \ mock.patch(exec_sudo_loop) as mock_sudo_loop, \ mock.patch(image_create) as mock_image_create, \ mock.patch(size_of_block) as mock_size_of_block, \ mock.patch(create_mbr) as mock_create_mbr: manager.attach_mock(mock_sudo_lvm, 'sudo_lvm') manager.attach_mock(mock_sudo_part, 'sudo_part') manager.attach_mock(mock_sudo_loop, 'sudo_loop') manager.attach_mock(mock_image_create, 'image_create') manager.attach_mock(mock_size_of_block, 'size_of_block') manager.attach_mock(mock_create_mbr, 'create_mbr') for node in call_order: # We're just keeping this to the partition setup and # LVM creation; i.e. skipping mounting, mkfs, etc. if isinstance(node, (LVMNode, PvsNode, VgsNode, LvsNode, LocalLoopNode, PartitionNode)): node.create() else: logger.debug("Skipping node for test: %s", node) cmd_sequence = [ # create the underlying block device mock.call.image_create(), mock.call.size_of_block('image'), # write out partition table mock.call.create_mbr(), # now mount partitions mock.call.sudo_part(['sync']), mock.call.sudo_part(['kpartx', '-uvs', '/dev/fake/image0']), # now create lvm environment mock.call.sudo_lvm(['pvcreate', '/dev/fake/root', '--force']), mock.call.sudo_lvm( ['vgcreate', 'vg', '/dev/fake/root', '--force']), mock.call.sudo_lvm( ['lvcreate', '--name', 'lv_root', '-l', '28%VG', 'vg']), mock.call.sudo_lvm( ['lvcreate', '--name', 'lv_tmp', '-l', '4%VG', 'vg']), mock.call.sudo_lvm( ['lvcreate', '--name', 'lv_var', '-l', '40%VG', 'vg']), mock.call.sudo_lvm( ['lvcreate', '--name', 'lv_log', '-l', '23%VG', 'vg']), mock.call.sudo_lvm( ['lvcreate', '--name', 'lv_audit', '-l', '4%VG', 'vg']), mock.call.sudo_lvm( ['lvcreate', '--name', 'lv_home', '-l', '1%VG', 'vg']), ] manager.assert_has_calls(cmd_sequence) # # Umount/cleanup test # manager = mock.MagicMock() with mock.patch(exec_sudo_lvm) as mock_sudo_lvm, \ mock.patch(exec_sudo_part) as mock_sudo_part, \ mock.patch(exec_sudo_loop) as mock_sudo_loop: manager.attach_mock(mock_sudo_lvm, 'sudo_lvm') manager.attach_mock(mock_sudo_part, 'sudo_part') manager.attach_mock(mock_sudo_loop, 'sudo_loop') def run_it(phase): reverse_order = reversed(call_order) for node in reverse_order: if isinstance(node, (LVMNode, PvsNode, VgsNode, LvsNode, LocalLoopNode, PartitionNode)): getattr(node, phase)() else: logger.debug("Skipping node for test: %s", node) run_it('umount') run_it('cleanup') cmd_sequence = [ # deactivate LVM first mock.call.sudo_lvm(['lvchange', '-an', '/dev/vg/lv_root']), mock.call.sudo_lvm(['lvchange', '-an', '/dev/vg/lv_tmp']), mock.call.sudo_lvm(['lvchange', '-an', '/dev/vg/lv_var']), mock.call.sudo_lvm(['lvchange', '-an', '/dev/vg/lv_log']), mock.call.sudo_lvm(['lvchange', '-an', '/dev/vg/lv_audit']), mock.call.sudo_lvm(['lvchange', '-an', '/dev/vg/lv_home']), mock.call.sudo_lvm(['vgchange', '-an', 'vg']), mock.call.sudo_lvm(['udevadm', 'settle']), # now remove partitions (note has to happen after lvm removal) mock.call.sudo_part(['kpartx', '-d', '/dev/fake/image0']), # now remove loopback device mock.call.sudo_loop(['losetup', '-d', '/dev/fake/image0']), # now final LVM cleanup call mock.call.sudo_lvm(['pvscan', '--cache']), ] manager.assert_has_calls(cmd_sequence) @mock.patch('diskimage_builder.block_device.level1.lvm.exec_sudo') def test_lvm_thin_provision(self, mock_exec_sudo): # Test the command-sequence for a more complicated LVM setup tree = self.load_config_file('lvm_tree_thin_provision.yaml') config = config_tree_to_graph(tree) state = BlockDeviceState() graph, call_order = create_graph(config, self.fake_default_config, state) # Fake state for the two PV's specified by this config state['blockdev'] = {} state['blockdev']['root'] = {} state['blockdev']['root']['device'] = '/dev/fake/root' for node in call_order: # XXX: This has not mocked out the "lower" layers of # creating the devices, which we're assuming works OK, nor # the upper layers. if isinstance(node, (LVMNode, PvsNode, VgsNode, LvsNode)): # only the LVMNode actually does anything here... node.create() # ensure the sequence of calls correctly setup the devices cmd_sequence = [ # create the pv's on the faked out block devices mock.call(['pvcreate', '/dev/fake/root', '--force']), # create a volume called "vg" out of these two pv's mock.call(['vgcreate', 'vg', '/dev/fake/root', '--force']), mock.call(['lvcreate', '--name', 'lv_thinpool', '--type', 'thin-pool', '-L', '2936012800B', 'vg']), # create a bunch of lv's on vg using the pool mock.call(['lvcreate', '--name', 'lv_root', '--type', 'thin', '--thin-pool', 'lv_thinpool', '-V', '1887436800B', 'vg']), mock.call(['lvcreate', '--name', 'lv_tmp', '--type', 'thin', '--thin-pool', 'lv_thinpool', '-V', '104857600B', 'vg']), mock.call(['lvcreate', '--name', 'lv_var', '--type', 'thin', '--thin-pool', 'lv_thinpool', '-V', '524288000B', 'vg']), mock.call(['lvcreate', '--name', 'lv_log', '--type', 'thin', '--thin-pool', 'lv_thinpool', '-V', '104857600B', 'vg']), mock.call(['lvcreate', '--name', 'lv_audit', '--type', 'thin', '--thin-pool', 'lv_thinpool', '-V', '104857600B', 'vg']), mock.call(['lvcreate', '--name', 'lv_home', '--type', 'thin', '--thin-pool', 'lv_thinpool', '-V', '209715200B', 'vg'])] self.assertEqual(mock_exec_sudo.call_count, len(cmd_sequence)) mock_exec_sudo.assert_has_calls(cmd_sequence) # Ensure the correct LVM state was preserved blockdev_state = { 'root': {'device': '/dev/fake/root'}, 'lv_thinpool': { 'vgs': 'vg', 'size': '2800MiB', 'extents': None, 'opts': None, 'device': '/dev/mapper/vg-lv_thinpool' }, 'lv_root': { 'vgs': 'vg', 'size': '1800MiB', 'extents': None, 'opts': None, 'device': '/dev/mapper/vg-lv_root' }, 'lv_tmp': { 'vgs': 'vg', 'size': '100MiB', 'extents': None, 'opts': None, 'device': '/dev/mapper/vg-lv_tmp' }, 'lv_var': { 'vgs': 'vg', 'size': '500MiB', 'extents': None, 'opts': None, 'device': '/dev/mapper/vg-lv_var' }, 'lv_log': { 'vgs': 'vg', 'size': '100MiB', 'extents': None, 'opts': None, 'device': '/dev/mapper/vg-lv_log' }, 'lv_audit': { 'vgs': 'vg', 'size': '100MiB', 'extents': None, 'opts': None, 'device': '/dev/mapper/vg-lv_audit' }, 'lv_home': { 'vgs': 'vg', 'size': '200MiB', 'extents': None, 'opts': None, 'device': '/dev/mapper/vg-lv_home' } } self.assertDictEqual(state['blockdev'], blockdev_state) @mock.patch('diskimage_builder.block_device.level1.lvm.exec_sudo') def test_validate_lvs_type(self, mock_exec_sudo): # Test the command-sequence for a more complicated LVM setup tree = self.load_config_file('lvm_tree_thin_provision.yaml') print(tree) tree[2]['lvm']['lvs'][0]['type'] = 'thin-pol' config = config_tree_to_graph(tree) state = BlockDeviceState() self.assertRaisesRegex( BlockDeviceSetupException, "Unsupported type:thin-pol, supported types: thin, thin-pool", create_graph, config, self.fake_default_config, state) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/test_mbr.py0000664000175000017500000001474115201026231025473 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import fixtures import logging import os import subprocess from unittest import mock import diskimage_builder.block_device.tests.test_base as tb from diskimage_builder.block_device.level0.localloop import image_create from diskimage_builder.block_device.level1.mbr import MBR logger = logging.getLogger(__name__) class TestMBR(tb.TestBase): disk_size_10M = 10 * 1024 * 1024 disk_size_1G = 1024 * 1024 * 1024 def _get_path_for_partx(self): """Searches and sets the path for partx Because different distributions store the partx binary at different places, there is the need to look for it. """ dirs = ["/bin", "/usr/bin", "/sbin", "/usr/sbin"] for d in dirs: if os.path.exists(os.path.join(d, "partx")): return os.path.join(d, "partx") # If not found, try without path. return "partx" def setUp(self): super(TestMBR, self).setUp() self.tmp_dir = fixtures.TempDir() self.useFixture(self.tmp_dir) self.image_path = os.path.join(self.tmp_dir.path, "image.raw") image_create(self.image_path, TestMBR.disk_size_1G) logger.debug("Temp image is %s", self.image_path) self.partx_args = [self._get_path_for_partx(), "--raw", "--output", "NR,START,END,TYPE,FLAGS,SCHEME", "-g", "-b", "-", self.image_path] def _run_partx(self, image_path): logger.info("Running command: %s", self.partx_args) return subprocess.check_output(self.partx_args).decode("ascii") @mock.patch('os.fsync', wraps=os.fsync) def test_one_ext_partition(self, mock_os_fsync): """Creates one partition and check correctness with partx.""" with MBR(self.image_path, TestMBR.disk_size_1G, 1024 * 1024) as mbr: mbr.add_partition(False, False, TestMBR.disk_size_10M, 0x83) # the exit handler of MBR should have synced the raw device # before exit mock_os_fsync.assert_called() output = self._run_partx(self.image_path) self.assertEqual( "1 2048 2097151 0xf 0x0 dos\n" "5 4096 24575 0x83 0x0 dos\n", output) def test_zero_partitions(self): """Creates no partition and check correctness with partx.""" with MBR(self.image_path, TestMBR.disk_size_1G, 1024 * 1024): pass output = self._run_partx(self.image_path) self.assertEqual("", output) def test_many_ext_partitions(self): """Creates many partition and check correctness with partx.""" with MBR(self.image_path, TestMBR.disk_size_1G, 1024 * 1024) as mbr: for nr in range(0, 64): mbr.add_partition(False, False, TestMBR.disk_size_10M, 0x83) output = self._run_partx(self.image_path) lines = output.split("\n") self.assertEqual(66, len(lines)) self.assertEqual( "1 2048 2097151 0xf 0x0 dos", lines[0]) start_block = 4096 end_block = start_block + TestMBR.disk_size_10M / 512 - 1 for nr in range(1, 65): fields = lines[nr].split(" ") self.assertEqual(6, len(fields)) self.assertEqual(nr + 4, int(fields[0])) self.assertEqual(start_block, int(fields[1])) self.assertEqual(end_block, int(fields[2])) self.assertEqual("0x83", fields[3]) self.assertEqual("0x0", fields[4]) self.assertEqual("dos", fields[5]) start_block += 22528 end_block = start_block + TestMBR.disk_size_10M / 512 - 1 def test_one_pri_partition(self): """Creates one primary partition and check correctness with partx.""" with MBR(self.image_path, TestMBR.disk_size_1G, 1024 * 1024) as mbr: mbr.add_partition(True, False, TestMBR.disk_size_10M, 0x83) output = self._run_partx(self.image_path) self.assertEqual( "1 2048 22527 0x83 0x0 dos\n", output) def test_three_pri_partition(self): """Creates three primary partition and check correctness with partx.""" with MBR(self.image_path, TestMBR.disk_size_1G, 1024 * 1024) as mbr: for _ in range(3): mbr.add_partition(True, False, TestMBR.disk_size_10M, 0x83) output = self._run_partx(self.image_path) self.assertEqual( "1 2048 22527 0x83 0x0 dos\n" "2 22528 43007 0x83 0x0 dos\n" "3 43008 63487 0x83 0x0 dos\n", output) def test_many_pri_and_ext_partition(self): """Creates many primary and extended partitions.""" with MBR(self.image_path, TestMBR.disk_size_1G, 1024 * 1024) as mbr: # Create three primary partitions for _ in range(3): mbr.add_partition(True, False, TestMBR.disk_size_10M, 0x83) for _ in range(7): mbr.add_partition(False, False, TestMBR.disk_size_10M, 0x83) output = self._run_partx(self.image_path) self.assertEqual( "1 2048 22527 0x83 0x0 dos\n" # Primary 1 "2 22528 43007 0x83 0x0 dos\n" # Primary 2 "3 43008 63487 0x83 0x0 dos\n" # Primary 3 "4 63488 2097151 0xf 0x0 dos\n" # Extended "5 65536 86015 0x83 0x0 dos\n" # Extended Partition 1 "6 88064 108543 0x83 0x0 dos\n" # Extended Partition 2 "7 110592 131071 0x83 0x0 dos\n" # ... "8 133120 153599 0x83 0x0 dos\n" "9 155648 176127 0x83 0x0 dos\n" "10 178176 198655 0x83 0x0 dos\n" "11 200704 221183 0x83 0x0 dos\n", output) def test_pri_fat32_lba_partition(self): """Creates a partition with a non-default 'type' and verifies.""" with MBR(self.image_path, TestMBR.disk_size_1G, 1024 * 1024) as mbr: mbr.add_partition(True, False, TestMBR.disk_size_10M, 0x0c) output = self._run_partx(self.image_path) self.assertEqual( "1 2048 22527 0xc 0x0 dos\n", output) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/test_mkfs.py0000664000175000017500000000276015201026231025651 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging import diskimage_builder.block_device.tests.test_config as tc from diskimage_builder.block_device.config import create_graph from diskimage_builder.block_device.exception import \ BlockDeviceSetupException logger = logging.getLogger(__name__) class TestMkfs(tc.TestGraphGeneration): def test_duplicate_labels(self): config = self.load_config_file('duplicate_fs_labels.yaml') self.assertRaisesRegex(BlockDeviceSetupException, "used more than once", create_graph, config, self.fake_default_config, {}) def test_too_long_labels(self): config = self.load_config_file('too_long_fs_label.yaml') self.assertRaisesRegex(BlockDeviceSetupException, "too long for filesystem", create_graph, config, self.fake_default_config, {}) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/test_mount_order.py0000664000175000017500000001623615201026231027251 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging import os from unittest import mock import diskimage_builder.block_device.tests.test_config as tc from diskimage_builder.block_device.config import config_tree_to_graph from diskimage_builder.block_device.config import create_graph from diskimage_builder.block_device.level2.mkfs import FilesystemNode from diskimage_builder.block_device.level3.mount import MountPointNode logger = logging.getLogger(__name__) class TestMountOrder(tc.TestGraphGeneration): def _exec_sudo_log(*args, **kwargs): # Used as a side-effect from exec_sudo mocking so we can see # the call in-place in logs logger.debug("exec_sudo: %s", " ".join(args[0])) @mock.patch('diskimage_builder.block_device.level3.mount.exec_sudo', side_effect=_exec_sudo_log) @mock.patch('diskimage_builder.block_device.level2.mkfs.exec_sudo', side_effect=_exec_sudo_log) def test_mfks_and_mount_order(self, mock_exec_sudo_mkfs, mock_exec_sudo_mount): # XXX: better mocking for the os.path.exists calls to avoid # failing if this exists. self.assertFalse(os.path.exists('/fake/')) # This is probably in order after graph creation, so ensure it # remains stable. We test the mount and umount call sequences config = self.load_config_file('multiple_partitions_graph.yaml') state = {} graph, call_order = create_graph(config, self.fake_default_config, state) # Mocked block device state state['blockdev'] = {} state['blockdev']['root'] = {'device': '/dev/loopXp1/root'} state['blockdev']['var'] = {'device': '/dev/loopXp2/var'} state['blockdev']['var_log'] = {'device': '/dev/loopXp3/var_log'} state['blockdev']['swap'] = {'device': '/dev/loopXp4/swap'} for node in call_order: if isinstance(node, (FilesystemNode, MountPointNode)): node.create() for node in reversed(call_order): if isinstance(node, (FilesystemNode, MountPointNode)): node.umount() # ensure that partitions were mounted in order root->var->var/log self.assertListEqual(state['mount_order'], ['/', '/var', '/var/log', 'none']) # fs creation sequence (note we don't care about order of this # as they're all independent) cmd_sequence = [ mock.call(['mkfs', '-t', 'xfs', '-L', 'mkfs_root', '-m', 'uuid=root-uuid-1234', '-q', '/dev/loopXp1/root']), mock.call(['mkfs', '-t', 'xfs', '-L', 'mkfs_var', '-m', 'uuid=var-uuid-1234', '-q', '/dev/loopXp2/var']), mock.call(['mkfs', '-t', 'vfat', '-n', 'VARLOG', '/dev/loopXp3/var_log']), mock.call(['mkswap', '-L', 'mkfs_swap', '-U', 'swap-uuid-1234', '/dev/loopXp4/swap']) ] self.assertEqual(mock_exec_sudo_mkfs.call_count, len(cmd_sequence)) mock_exec_sudo_mkfs.assert_has_calls(cmd_sequence, any_order=True) # Check mount sequence cmd_sequence = [ # mount sequence mock.call(['mkdir', '-p', '/fake/']), mock.call(['mount', '/dev/loopXp1/root', '/fake/']), mock.call(['mkdir', '-p', '/fake/var']), mock.call(['mount', '/dev/loopXp2/var', '/fake/var']), mock.call(['mkdir', '-p', '/fake/var/log']), mock.call(['mount', '/dev/loopXp3/var_log', '/fake/var/log']), # umount sequence mock.call(['sync']), # note /fake/var/log is a vfs partition to make sure # we don't try to fstrim it mock.call(['umount', '/fake/var/log']), mock.call(['sync']), mock.call(['fstrim', '--verbose', '/fake/var']), mock.call(['umount', '/fake/var']), mock.call(['sync']), mock.call(['fstrim', '--verbose', '/fake/']), mock.call(['umount', '/fake/']) ] self.assertListEqual(mock_exec_sudo_mount.call_args_list, cmd_sequence) @mock.patch('diskimage_builder.block_device.level3.mount.exec_sudo', side_effect=_exec_sudo_log) def test_mount_order_unsorted(self, mock_exec_sudo): # As above, but this is out of order and gets sorted # so that root is mounted first (and skips the mkfs testing). config = self.load_config_file('lvm_tree_partition_ordering.yaml') parsed_graph = config_tree_to_graph(config) state = {} graph, call_order = create_graph(parsed_graph, self.fake_default_config, state) state['filesys'] = { 'mkfs_root': { 'device': '/dev/loopXp1', 'fstype': 'xfs' }, 'mkfs_var': { 'device': '/dev/loopXp2', 'fstype': 'xfs', }, 'mkfs_boot': { 'device': '/dev/loopXp3', 'fstype': 'vfat', }, 'mkfs_swap': { 'device': '/dev/loopXp4', 'fstype': 'swap', }, } for node in call_order: if isinstance(node, MountPointNode): node.create() for node in reversed(call_order): if isinstance(node, MountPointNode): node.umount() # ensure that partitions are mounted in order / -> /boot -> /var # swap not mounted in runtime, but should be in 'mount_order' list self.assertListEqual(state['mount_order'], ['/', '/boot', '/var', 'none']) cmd_sequence = [ # mount sequence mock.call(['mkdir', '-p', '/fake/']), mock.call(['mount', '/dev/loopXp1', '/fake/']), mock.call(['mkdir', '-p', '/fake/boot']), mock.call(['mount', '/dev/loopXp3', '/fake/boot']), mock.call(['mkdir', '-p', '/fake/var']), mock.call(['mount', '/dev/loopXp2', '/fake/var']), # umount sequence mock.call(['sync']), mock.call(['fstrim', '--verbose', '/fake/var']), mock.call(['umount', '/fake/var']), mock.call(['sync']), # no trim on vfat /fake/boot mock.call(['umount', '/fake/boot']), mock.call(['sync']), mock.call(['fstrim', '--verbose', '/fake/']), mock.call(['umount', '/fake/']) ] self.assertListEqual(mock_exec_sudo.call_args_list, cmd_sequence) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/test_state.py0000664000175000017500000001262715201026231026034 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import codecs import fixtures import json import logging import os from stevedore import extension from testtools.matchers import FileExists import diskimage_builder.block_device.blockdevice as bd import diskimage_builder.block_device.tests.test_base as tb from diskimage_builder.block_device.exception import \ BlockDeviceSetupException logger = logging.getLogger(__name__) class TestStateBase(tb.TestBase): def setUp(self): super(TestStateBase, self).setUp() # override the extensions to the test extensions test_extensions = extension.ExtensionManager( namespace='diskimage_builder.block_device.plugin_test', invoke_on_load=False) extensions_fixture = fixtures.MonkeyPatch( 'diskimage_builder.block_device.config._extensions', test_extensions) self.useFixture(extensions_fixture) # status and other bits saved here self.build_dir = fixtures.TempDir() self.useFixture(self.build_dir) class TestState(TestStateBase): # The the state generation & saving methods def test_state_create(self): params = { 'build-dir': self.build_dir.path, 'config': self.get_config_file('cmd_create.yaml') } bd_obj = bd.BlockDevice(params) bd_obj.cmd_init() bd_obj.cmd_create() # cmd_create should have persisted this to disk state_file = bd_obj.state_json_file_name self.assertThat(state_file, FileExists()) # ensure we see the values put in by the test extensions # persisted with codecs.open(state_file, encoding='utf-8', mode='r') as fd: state = json.load(fd) self.assertDictEqual(state, {'test_a': {'value': 'foo', 'value2': 'bar'}, 'test_b': {'value': 'baz'}, 'test_init_state': 'here'}) pickle_file = bd_obj.node_pickle_file_name self.assertThat(pickle_file, FileExists()) # run umount, which should load the picked nodes and run in # reverse. This will create some state in "test_b" that it # added to by "test_a" ... ensuring it was run backwards. It # also checks the state was persisted through the pickling # process. bd_obj.cmd_umount() # Test state going missing between phases def test_missing_state(self): params = { 'build-dir': self.build_dir.path, 'config': self.get_config_file('cmd_create.yaml') } bd_obj = bd.BlockDevice(params) bd_obj.cmd_init() bd_obj.cmd_create() # cmd_create should have persisted this to disk state_file = bd_obj.state_json_file_name self.assertThat(state_file, FileExists()) pickle_file = bd_obj.node_pickle_file_name self.assertThat(pickle_file, FileExists()) # simulate the state somehow going missing, and ensure that # later calls notice os.unlink(state_file) os.unlink(pickle_file) # This reads from the state dump json file self.assertRaisesRegex(BlockDeviceSetupException, "State dump not found", bd_obj.cmd_getval, 'image-path') self.assertRaisesRegex(BlockDeviceSetupException, "State dump not found", bd_obj.cmd_writefstab) # this uses the pickled nodes self.assertRaisesRegex(BlockDeviceSetupException, "Pickle file not found", bd_obj.cmd_delete) self.assertRaisesRegex(BlockDeviceSetupException, "Pickle file not found", bd_obj.cmd_cleanup) # XXX: figure out unit test for umount # Test ordering of rollback calls if create() fails def test_rollback(self): params = { 'build-dir': self.build_dir.path, 'config': self.get_config_file('rollback.yaml'), 'test_rollback': True } bd_obj = bd.BlockDevice(params) bd_obj.cmd_init() # The config file has flags in that tell the last node to # fail, which will trigger the rollback. self.assertRaises(RuntimeError, bd_obj.cmd_create) # cmd_create should have persisted this to disk even after the # failure state_file = bd_obj.state_json_file_name self.assertThat(state_file, FileExists()) with codecs.open(state_file, encoding='utf-8', mode='r') as fd: state = json.load(fd) # ensure the rollback was called in order self.assertListEqual(state['rollback_test'], ['never', 'gonna', 'give', 'you', 'up', 'never', 'gonna', 'let', 'you', 'down']) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/tests/test_utils.py0000664000175000017500000000424715201026231026053 0ustar00zuulzuul# Copyright 2016 Andreas Florath (andreas@florath.net) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging import diskimage_builder.block_device.tests.test_base as tb from diskimage_builder.block_device.utils import parse_abs_size_spec from diskimage_builder.block_device.utils import parse_rel_size_spec logger = logging.getLogger(__name__) class TestBlockDeviceUtils(tb.TestBase): """Tests for the utils.py This tests mostly the error and failure cases - because the good cases are tested implicitly with the higher level unit tests. """ def test_parse_rel_size_with_abs(self): """Calls parse_rel_size_spec with an absolute number""" is_rel, size = parse_rel_size_spec("154MiB", 0) self.assertFalse(is_rel) self.assertEqual(154 * 1024 * 1024, size) def test_parse_abs_size_without_spec(self): """Call parse_abs_size_spec without spec""" size = parse_abs_size_spec("198") self.assertEqual(198, size) def test_invalid_unit_spec(self): """Call parse_abs_size_spec with invalid unit spec""" self.assertRaises(RuntimeError, parse_abs_size_spec, "747InVaLiDUnIt") def test_broken_unit_spec(self): """Call parse_abs_size_spec with a completely broken unit spec""" self.assertRaises(RuntimeError, parse_abs_size_spec, "_+!HuHi+-=") def test_parse_size_spec(self): map(lambda tspec: self.assertEqual(parse_abs_size_spec(tspec[0]), tspec[1]), [["20TiB", 20 * 1024**4], ["1024KiB", 1024 * 1024], ["1.2TB", 1.2 * 1000**4], ["2.4T", 2.4 * 1000**4], ["512B", 512], ["364", 364]]) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/block_device/utils.py0000664000175000017500000001176715201026231023657 0ustar00zuulzuul# Copyright 2016 Andreas Florath (andreas@florath.net) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import locale import logging import re import subprocess from diskimage_builder.block_device.exception import \ BlockDeviceSetupException logger = logging.getLogger(__name__) SIZE_UNIT_SPECS = [ ["TiB", 1024**4], ["GiB", 1024**3], ["MiB", 1024**2], ["KiB", 1024**1], ["TB", 1000**4], ["GB", 1000**3], ["MB", 1000**2], ["KB", 1000**1], ["T", 1000**4], ["G", 1000**3], ["M", 1000**2], ["K", 1000**1], ["B", 1], ["", 1], # No unit -> size is given in bytes ] # Basic RE to check and split floats (without exponent) # and a given unit specification (which must be non-numerical). size_unit_spec_re = re.compile(r"^([\d\.]*) ?([a-zA-Z0-9_]*)$") def _split_size_unit_spec(size_unit_spec): """Helper function to split unit specification into parts. The first part is the numeric part - the second one is the unit. """ match = size_unit_spec_re.match(size_unit_spec) if match is None: raise RuntimeError("Invalid size unit spec [%s]" % size_unit_spec) return match.group(1), match.group(2) def _get_unit_factor(unit_str): """Helper function to get the unit factor. The given unit_str needs to be a string of the SIZE_UNIT_SPECS table. If the unit is not found, a runtime error is raised. """ for spec_key, spec_value in SIZE_UNIT_SPECS: if unit_str == spec_key: return spec_value raise RuntimeError("unit_str [%s] not known" % unit_str) def parse_abs_size_spec(size_spec): size_cnt_str, size_unit_str = _split_size_unit_spec(size_spec) unit_factor = _get_unit_factor(size_unit_str) return int(unit_factor * ( float(size_cnt_str) if len(size_cnt_str) > 0 else 1)) def parse_rel_size_spec(size_spec, abs_size): """Parses size specifications - can be relative like 50% In addition to the absolute parsing also a relative parsing is done. If the size specification ends in '%', then the relative size of the given 'abs_size' is returned. """ if size_spec[-1] == '%': percent = float(size_spec[:-1]) return True, int(abs_size * percent / 100.0) return False, parse_abs_size_spec(size_spec) def exec_sudo(cmd): """Run a command under sudo Run command under sudo, with debug trace of output. This is like subprocess.check_call() but sudo wrapped and with output tracing at debug levels. Arguments: :param cmd: str command list; for Popen() :return: the stdout+stderror of the called command :raises BlockDeviceSetupException: if return code != 0. Exception values similar to ``subprocess.CalledProcessError`` * ``returncode`` : returncode of child * ``cmd`` : the command run * ``output`` : stdout+stderr output """ assert isinstance(cmd, list) sudo_cmd = ["sudo"] sudo_cmd.extend(cmd) try: logger.info("Calling [%s]", " ".join(sudo_cmd)) except TypeError: # Popen actually doesn't care, but we've managed to get mixed # str and bytes in argument lists which causes errors logging # commands. Give a clue as to what's going on. logger.exception("Ensure all arguments are str type!") raise proc = subprocess.Popen(sudo_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) out = "" with proc.stdout: for line in iter(proc.stdout.readline, b''): line = line.decode(encoding=locale.getpreferredencoding(False), errors='backslashreplace') out += line logger.debug("exec_sudo: %s", line.rstrip()) proc.wait() if proc.returncode: e = BlockDeviceSetupException("exec_sudo failed: %s" % out) e.returncode = proc.returncode e.cmd = ' '.join(sudo_cmd) e.output = out raise e return out def remove_device(device_name): """Attempt to remove a device-mapper device Convenience rollback function to attempt to delete a device, logging a warning if the delete fails. :param device_name: Name of device to run dmsetup remove on """ logger.debug('Removing device %s', device_name) try: exec_sudo(["dmsetup", "remove", device_name]) except BlockDeviceSetupException as e: # Do not raise an error - maybe other cleanup methods # can at least do some more work. logger.warning("Removing device failed (%s)", e.returncode) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/disk_image_create.py0000664000175000017500000000265015201026231023514 0ustar00zuulzuul# Copyright 2016 Ian Wienand (iwienand@redhat.com) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import os import os.path import sys import diskimage_builder.paths def main(): environ = os.environ # pre-seed some paths for the shell script environ['_LIB'] = diskimage_builder.paths.get_path('lib') # export the path to the current python if not os.environ.get('DIB_PYTHON_EXEC'): os.environ['DIB_PYTHON_EXEC'] = sys.executable # we have to handle being called as "disk-image-create" or # "ramdisk-image-create". ramdisk-image-create is just a symlink # to disk-image-create # XXX: we could simplify things by removing the symlink, and # just setting IS_RAMDISK in environ here depending on sys.argv[1] script = "%s/%s" % (diskimage_builder.paths.get_path('lib'), os.path.basename(sys.argv[0])) os.execve("/bin/bash", ['bash', script] + sys.argv[1:], environ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/diskimage_builder.py0000664000175000017500000003726315201026231023550 0ustar00zuulzuul# Copyright 2023 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import argparse import collections import io import jsonschema import os import os.path import shlex import subprocess import sys import textwrap import yaml import diskimage_builder.paths class SchemaProperty(object): """Base class for a basic schema and a help string""" key = None description = None schema_type = "string" def __init__(self, key, description, schema_type=None): self.key = key self.description = description if schema_type: self.schema_type = schema_type def to_schema(self): return {self.key: {"type": self.schema_type}} def type_help(self): return "Value is a string" def to_help(self): return "%s\n%s\n%s\n(%s)" % ( self.key, "-" * len(self.key), "\n".join(textwrap.wrap(self.description)), self.type_help(), ) class Env(SchemaProperty): """String dict schema for environment variables""" def __init__(self, key, description): super(Env, self).__init__(key, description, schema_type="object") def to_schema(self): schema = super(Env, self).to_schema() schema[self.key]["additionalProperties"] = {"type": "string"} return schema def type_help(self): return "Value is a map of strings" class Arg(SchemaProperty): """Command argument with associated value""" arg = None def __init__(self, key, description, schema_type=None, arg=None): super(Arg, self).__init__(key, description, schema_type=schema_type) self.arg = arg def arg_name(self): if self.arg is None: return "--%s" % self.key return self.arg def to_argument(self, value=None): arg = self.arg_name() if value is not None and value != "": return [arg, value] return [] class Flag(Arg): """Boolean value which does not contribute to arguments""" def __init__(self, key, description): super(Flag, self).__init__(key, description, schema_type="boolean") def to_argument(self, value=None): return [] def type_help(self): return "Value is a boolean" class ArgFlag(Arg): """Boolean value for a flag argument being set or not""" def __init__(self, key, description, arg=None): super(ArgFlag, self).__init__( key, description, arg=arg, schema_type="boolean" ) def to_argument(self, value=None): if value: return [self.arg_name()] return [] def type_help(self): return "Value is a boolean" class ArgEnum(Arg): """String argument constrained to a list of allowed values""" enum = None def __init__( self, key, description, schema_type="string", arg=None, enum=None ): super(ArgEnum, self).__init__( key, description, schema_type=schema_type, arg=arg ) self.enum = enum and enum or [] def to_schema(self): schema = super(ArgEnum, self).to_schema() schema[self.key]["enum"] = self.enum return schema def type_help(self): return "Allowed values: %s" % ", ".join(self.enum) class ArgFlagRepeating(ArgEnum): """Flag argument which repeats the specified number of times""" def __init__(self, key, description, arg=None, max_repeat=0): enum = list(range(max_repeat + 1)) super(ArgFlagRepeating, self).__init__( key, description, schema_type="integer", arg=arg, enum=enum ) def to_argument(self, value): return [self.arg] * value def type_help(self): return "Allowed values: %s" % ", ".join([str(i) for i in self.enum]) class ArgInt(Arg): """Integer argument which a minumum constraint""" minimum = 1 def __init__(self, key, description, arg=None, minimum=1): super(ArgInt, self).__init__( key, description, arg=arg, schema_type="integer" ) self.minimum = minimum def to_schema(self): schema = super(ArgInt, self).to_schema() schema[self.key]["minimum"] = self.minimum return schema def to_argument(self, value): return super(ArgInt, self).to_argument(str(value)) def type_help(self): return "Value is an integer" class ArgList(Arg): """List of strings converted to comma delimited argument""" def __init__(self, key, description, arg=None): super(ArgList, self).__init__( key, description, arg=arg, schema_type="array" ) def to_schema(self): schema = super(ArgList, self).to_schema() schema[self.key]["items"] = {"type": "string"} return schema def to_argument(self, value): if not value: return [] return super(ArgList, self).to_argument(",".join(value)) def type_help(self): return "Value is a list of strings" class ArgListPositional(ArgList): """List of strings converted to positional arguments""" def __init__(self, key, description): super(ArgListPositional, self).__init__(key, description) def to_argument(self, value): # it is already a list, just return it return value def type_help(self): return "Value is a list of strings" class ArgEnumList(ArgList): """List of strings constrained to a list of allowed values""" enum = None def __init__(self, key, description, arg=None, enum=None): super(ArgEnumList, self).__init__(key, description, arg=arg) self.enum = enum and enum or [] def to_schema(self): schema = super(ArgEnumList, self).to_schema() schema[self.key]["items"]["enum"] = self.enum return schema def type_help(self): return ( "Value is a list of strings with allowed values: %s)" % ", ".join(self.enum) ) class ArgDictToString(Arg): """Dict with string values converted to key=value,key2=value2 argument""" def __init__(self, key, description, arg=None): super(ArgDictToString, self).__init__( key, description, arg=arg, schema_type="object" ) def to_schema(self): schema = super(ArgDictToString, self).to_schema() schema[self.key]["additionalProperties"] = {"type": "string"} return schema def to_argument(self, value): as_list = [] for k, v in value.items(): as_list.append("%s=%s" % (k, v)) return super(ArgDictToString, self).to_argument(",".join(as_list)) def type_help(self): return "Value is a map of strings" PROPERTIES = [ Arg("imagename", "Set the imagename of the output image file.", arg="-o"), ArgEnum( "arch", "Set the architecture of the image.", arg="-a", enum=[ "aarch64", "amd64", "arm64", "armhf", "powerpc", "ppc64", "ppc64el", "ppc64le", "s390x", "x86_64", ], ), ArgEnumList( "types", "Set the image types of the output image files.", arg="-t", enum=[ "qcow2", "tar", "tgz", "squashfs", "vhd", "docker", "aci", "raw", ], ), Env( "environment", "Environment variables to set during the image build.", ), Flag( "ramdisk", "Whether to build a ramdisk image.", ), ArgFlagRepeating( "debug-trace", "Tracing level to log, integer 0 is off.", arg="-x", max_repeat=2, ), ArgFlag( "uncompressed", "Do not compress the image - larger but faster.", arg="-u", ), ArgFlag("clear", "Clear environment before starting work.", arg="-c"), Arg( "logfile", "Save run output to given logfile.", ), ArgFlag( "checksum", "Generate MD5 and SHA256 checksum files for the created image.", ), ArgInt( "image-size", "Image size in GB for the created image.", ), ArgInt( "image-extra-size", "Extra image size in GB for the created image.", ), Arg( "image-cache", "Location for cached images, defaults to ~/.cache/image-create.", ), ArgInt( "max-online-resize", "Max number of filesystem blocks to support when resizing. " "Useful if you want a really large root partition when the " "image is deployed. Using a very large value may run into a " "known bug in resize2fs. Setting the value to 274877906944 " "will get you a 1PB root file system. Making this " "value unnecessarily large will consume extra disk " "space on the root partition with extra file system inodes.", ), ArgInt( "min-tmpfs", "Minimum size in GB needed in tmpfs to build the image.", ), ArgInt( "mkfs-journal-size", "Filesystem journal size in MB to pass to mkfs.", ), Arg( "mkfs-options", "Option flags to be passed directly to mkfs.", ), ArgFlag("no-tmpfs", "Do not use tmpfs to speed image build."), ArgFlag("offline", "Do not update cached resources."), ArgDictToString( "qemu-img-options", "Option flags to be passed directly to qemu-img.", ), Arg( "root-label", 'Label for the root filesystem, defaults to "cloudimg-rootfs".', ), Arg( "ramdisk-element", "Specify the main element to be used for building ramdisks. " 'Defaults to "ramdisk". Should be set to "dracut-ramdisk" ' "for platforms such as RHEL and CentOS that do not package busybox.", ), ArgEnum( "install-type", "Specify the default installation type.", enum=["source", "package"], ), Arg( "docker-target", "Specify the repo and tag to use if the output type is docker, " "defaults to the value of output imagename.", ), ArgList( "packages", "Extra packages to install in the image. Runs once, after " '"install.d" phase. Does not apply when ramdisk is true.', arg="-p", ), ArgFlag( "skip-base", 'Skip the default inclusion of the "base" element. ' "Does not apply when ramdisk is true.", arg="-n", ), ArgListPositional( "elements", "list of elements to build the image with", ), ] SCHEMA_PROPERTIES = {} for arg in PROPERTIES: SCHEMA_PROPERTIES.update(arg.to_schema()) DIB_SCHEMA = { "type": "array", "items": { "type": "object", "properties": SCHEMA_PROPERTIES, "additionalProperties": False, }, "additionalProperties": False, } class Command(object): script = None args = None environ = None def __init__(self, script, properties, entry): self.script = script self.args = [] self.environ = {} for prop in properties: if prop.key in entry: value = entry[prop.key] if isinstance(prop, Env): self.environ.update(value) elif isinstance(prop, Arg): self.args.extend(prop.to_argument(value)) def merged_env(self): environ = os.environ.copy() # pre-seed some paths for the shell script environ["_LIB"] = diskimage_builder.paths.get_path("lib") environ.update(self.environ) return environ def command(self): return ["bash", self.script] + self.args def __repr__(self): elements = [] for k, v in self.environ.items(): elements.append("%s=%s" % (k, shlex.quote(v))) elements.extend([shlex.quote(a) for a in self.command()]) return " ".join(elements) + "\n" def help_properties(): str = io.StringIO() for prop in PROPERTIES: str.write(prop.to_help()) str.write("\n\n") return str.getvalue() def get_args(): description = ( """\ The file format is YAML which expects a list of image definition maps. Supported entries for an image definition are: %s """ % help_properties() ) parser = argparse.ArgumentParser( description=description, formatter_class=argparse.RawDescriptionHelpFormatter, ) parser.add_argument( "files", metavar="", nargs="+", help="Paths to image build definition YAML files", ) parser.add_argument( "--dry-run", action="store_true", help="Show the disk-image-create, ramdisk-image-create commands and " "exit", ) parser.add_argument( "--stop-on-failure", action="store_true", help="Stop building images when an image build fails", ) args = parser.parse_args(sys.argv[1:]) return args def merge_entry(merged_entry, entry): for k, v in entry.items(): if isinstance(v, list): # append to existing list list_value = merged_entry.setdefault(k, []) list_value.extend(v) elif isinstance(v, dict): # update environment dict dict_value = merged_entry.setdefault(k, {}) dict_value.update(v) else: # update value merged_entry[k] = v def build_commands(definition): jsonschema.validate(definition, schema=DIB_SCHEMA) dib_script = "%s/disk-image-create" % diskimage_builder.paths.get_path( "lib" ) rib_script = "%s/ramdisk-image-create" % diskimage_builder.paths.get_path( "lib" ) # Start with the default image name, 'image' previous_imagename = "image" merged_entries = collections.OrderedDict() for entry in definition: imagename = entry.get("imagename", previous_imagename) previous_imagename = imagename if imagename not in merged_entries: merged_entries[imagename] = entry else: merge_entry(merged_entries[imagename], entry) commands = [] for entry in merged_entries.values(): if entry.get("ramdisk", False): commands.append(Command(rib_script, PROPERTIES, entry)) else: commands.append(Command(dib_script, PROPERTIES, entry)) return commands def main(): args = get_args() # export the path to the current python if not os.environ.get("DIB_PYTHON_EXEC"): os.environ["DIB_PYTHON_EXEC"] = sys.executable definitions = [] for file in args.files: with open(file) as f: definitions.extend(yaml.safe_load(f)) commands = build_commands(definitions) final_returncode = 0 failed_command = None for command in commands: sys.stderr.write(str(command)) sys.stderr.write("\n") sys.stderr.flush() if not args.dry_run: p = subprocess.Popen(command.command(), env=command.merged_env()) p.communicate() if p.returncode != 0: final_returncode = p.returncode failed_command = command if args.stop_on_failure: break if final_returncode != 0: raise subprocess.CalledProcessError( final_returncode, failed_command.command() ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/element_dependencies.py0000664000175000017500000002740015201026231024234 0ustar00zuulzuul# Copyright 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import argparse import collections import errno import logging import os import sys import yaml import diskimage_builder.logging_config logger = logging.getLogger(__name__) class MissingElementException(Exception): pass class AlreadyProvidedException(Exception): pass class MissingOSException(Exception): pass class InvalidElementDir(Exception): pass class Element(object): """An element""" def _get_element_set(self, path): """Get element set from element-[deps|provides] file Arguments: :param path: path to element description :return: the set of elements in the file, or a blank set if the file is not found. """ try: with open(path) as f: lines = (line.strip() for line in f) # Strip blanks, but do we want to strip comment lines # too? No use case at the moment, and comments might # break other things that poke at the element-* files. lines = (line for line in lines if line) return set(lines) except IOError as e: if e.errno == errno.ENOENT: return set([]) else: raise def _make_rdeps(self, all_elements): """Make a list of reverse dependencies (who depends on us). Only valid after _find_all_elements() Arguments: :param all_elements: dict as returned by _find_all_elements() :return: nothing, but elements will have r_depends var """ # note; deliberatly left out of __init__ so that accidental # access without init raises error self.r_depends = [] for name, element in all_elements.items(): if self.name in element.depends: self.r_depends.append(element.name) def __init__(self, name, path): """A new element :param name: The element name :param path: Full path to element. element-deps and element-provides files will be parsed """ self.name = name self.path = path # read the provides & depends files for this element into a # set; if the element has them. self.provides = self._get_element_set( os.path.join(path, 'element-provides')) self.depends = self._get_element_set( os.path.join(path, 'element-deps')) # Uncomment to see all elements and deps listed as they're found # logger.debug("New element : %s", str(self)) def __eq__(self, other): return self.name == other.name def __repr__(self): return self.name def __str__(self): return '%s p:<%s> d:<%s>' % (self.name, ','.join(self.provides), ','.join(self.depends)) def _get_elements_dir(): if not os.environ.get('ELEMENTS_PATH'): raise Exception("$ELEMENTS_PATH must be set.") return os.environ['ELEMENTS_PATH'] def _expand_element_dependencies(user_elements, all_elements): """Expand user requested elements using element-deps files. Arguments: :param user_elements: iterable enumerating the elements a user requested :param all_elements: Element object dictionary from find_all_elements :return: a set containing the names of user_elements and all dependent elements including any transitive dependencies. """ final_elements = set(user_elements) check_queue = collections.deque(user_elements) provided = set() provided_by = collections.defaultdict(list) while check_queue: # bug #1303911 - run through the provided elements first to avoid # adding unwanted dependencies and looking for virtual elements element = check_queue.popleft() if element in provided: continue elif element not in all_elements: raise MissingElementException("Element '%s' not found" % element) element_obj = all_elements[element] element_deps = element_obj.depends element_provides = element_obj.provides # Check that we are not providing an element which has already # been provided by someone else, and additionally save which # elements provide another element for provide in element_provides: if provide in provided: raise AlreadyProvidedException( "%s: already provided by %s" % (provide, provided_by[provide])) provided_by[provide].append(element) provided.update(element_provides) check_queue.extend(element_deps - (final_elements | provided)) final_elements.update(element_deps) conflicts = set(user_elements) & provided if conflicts: logger.error( "The following elements are already provided by another element") for element in conflicts: logger.error("%s : already provided by %s", element, provided_by[element]) raise AlreadyProvidedException() if "operating-system" not in provided: raise MissingOSException("Please include an operating system element") out = final_elements - provided return [all_elements[element] for element in out] def _find_all_elements(paths=None): """Build a dictionary Element() objects Walk ELEMENTS_PATH and find all elements. Make an Element object for each element we wish to consider. Note we process overrides such that elements specified earlier in the ELEMENTS_PATH override those seen later. :param paths: A list of paths to find elements in. If None will use ELEMENTS_PATH from environment :return: a dictionary of all elements """ all_elements = {} # note we process the later entries *first*, so that earlier # entries will override later ones. i.e. with # ELEMENTS_PATH=path1:path2:path3 # we want the elements in "path1" to override "path3" if not paths: paths = list(reversed(_get_elements_dir().split(':'))) else: paths = list(reversed(paths.split(':'))) logger.debug("ELEMENTS_PATH is: %s", ":".join(paths)) for path in paths: if not os.path.isdir(path): raise InvalidElementDir("ELEMENTS_PATH entry '%s' " "is not a directory " % path) # In words : make a list of directories in "path". Since an # element is a directory, this is our list of elements. elements = [os.path.realpath(os.path.join(path, f)) for f in os.listdir(path) if os.path.isdir(os.path.join(path, f))] for element in elements: # the element name is the last part of the full path in # element (these are all directories, we know that from # above) name = os.path.basename(element) new_element = Element(name, element) if name in all_elements: logger.warning("Element <%s> overrides <%s>", new_element.path, all_elements[name].path) all_elements[name] = new_element # Now we have all the elements, make a call on each element to # store it's reverse dependencies for name, element in all_elements.items(): element._make_rdeps(all_elements) return all_elements def _get_elements(elements, paths=None): """Return the canonical list of Element objects This function returns Element objects. For exernal calls, use get_elements which returns a simple tuple & list. :param elements: user specified list of elements :param paths: element paths, default to environment """ all_elements = _find_all_elements(paths) return _expand_element_dependencies(elements, all_elements) def get_elements(elements, paths=None): """Return the canonical list of elements with their dependencies .. note:: You probably do not want to use this! Elements that require access to the list of all other elements should generally use the environment variables exported by disk-image-create below. :param elements: user specified elements :param paths: Alternative ELEMENTS_PATH; default is to use from env :return: A de-duplicated list of tuples [(element, path), (element, path) ...] with all elements and their dependents, including any transitive dependencies. """ elements = _get_elements(elements, paths) return [(element.name, element.path) for element in elements] def expand_dependencies(user_elements, element_dirs): """Deprecated method for expanding element dependencies. .. warning:: DO NOT USE THIS FUNCTION. For compatibility reasons, this function does not provide paths to the returned elements. This means the caller must process override rules if two elements with the same name appear in element_dirs :param user_elements: iterable enumerating the elements a user requested :param element_dirs: The ELEMENTS_PATH to process :return: a set containing user_elements and all dependent elements including any transitive dependencies. """ logger.warning("expand_dependencies() deprecated, use get_elements") elements = _get_elements(user_elements, element_dirs) return set([element.name for element in elements]) def _output_env_vars(elements): """Output eval-able bash strings for IMAGE_ELEMENT vars :param elements: list of Element objects to represent """ # first the "legacy" environment variable that just lists the # elements print("export IMAGE_ELEMENT='%s'" % ' '.join([element.name for element in elements])) # Then YAML output = {} for element in elements: output[element.name] = element.path print("export IMAGE_ELEMENT_YAML='%s'" % yaml.safe_dump(output)) # Then bash array. Unfortunately, bash can't export array # variables. So we take a compromise and produce an exported # function that outputs the string to re-create the array. # You can then simply do # eval declare -A element_array=$(get_image_element_array) # and you have it. output = "" for element in elements: output += '[%s]=%s ' % (element.name, element.path) print("function get_image_element_array {\n" " echo \"%s\"\n" "};\n" "export -f get_image_element_array;" % output) def main(): diskimage_builder.logging_config.setup() parser = argparse.ArgumentParser() parser.add_argument('elements', nargs='+', help='display dependencies of the given elements') parser.add_argument('--env', '-e', action='store_true', default=False, help=('Output eval-able bash strings for ' 'IMAGE_ELEMENT variables')) args = parser.parse_args(sys.argv[1:]) elements = _get_elements(args.elements) if args.env: _output_env_vars(elements) else: # deprecated compatibility output; doesn't include paths. print(' '.join([element.name for element in elements])) return 0 if __name__ == "__main__": main() ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3142362 diskimage_builder-3.42.0/diskimage_builder/elements/0000775000175000017500000000000015201026275021344 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/__init__.py0000664000175000017500000000000015201026231023433 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3142362 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/0000775000175000017500000000000015201026275025316 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/README.rst0000664000175000017500000000050015201026231026770 0ustar00zuulzuul=================== almalinux-container =================== Create a minimal image based on AlmaLinux container image This element sets the ``DISTRO_NAME`` var to 'almalinux'. The release of AlmaLinux to be installed can be controlled through the ``DIB_RELEASE`` variable, which defaults the latest supported release. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3142362 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/containerfiles/0000775000175000017500000000000015201026275030323 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/containerfiles/100000664000175000017500000000105115201026231030453 0ustar00zuulzuulFROM quay.io/almalinuxorg/almalinux:10 RUN dnf group install -y 'Minimal Install' --allowerasing && \ dnf install -y findutils util-linux sudo python3 NetworkManager \ curl libcurl --allowerasing RUN systemctl unmask console-getty.service dev-hugepages.mount \ getty.target sys-fs-fuse-connections.mount systemd-logind.service \ systemd-remount-fs.service # /etc/machine-id needs to be populated for /bin/kernel-install to # correctly copy kernels into /boot. We will clear this out in the # final image. RUN systemd-machine-id-setup././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/containerfiles/80000664000175000017500000000105115201026231030402 0ustar00zuulzuulFROM quay.io/almalinuxorg/almalinux:8 RUN dnf group install -y 'Minimal Install' --allowerasing && \ dnf install -y findutils util-linux sudo python3 NetworkManager \ curl libcurl --allowerasing RUN systemctl unmask console-getty.service dev-hugepages.mount \ getty.target sys-fs-fuse-connections.mount systemd-logind.service \ systemd-remount-fs.service # /etc/machine-id needs to be populated for /bin/kernel-install to # correctly copy kernels into /boot. We will clear this out in the # final image. RUN systemd-machine-id-setup ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/containerfiles/90000664000175000017500000000105115201026231030403 0ustar00zuulzuulFROM quay.io/almalinuxorg/almalinux:9 RUN dnf group install -y 'Minimal Install' --allowerasing && \ dnf install -y findutils util-linux sudo python3 NetworkManager \ curl libcurl --allowerasing RUN systemctl unmask console-getty.service dev-hugepages.mount \ getty.target sys-fs-fuse-connections.mount systemd-logind.service \ systemd-remount-fs.service # /etc/machine-id needs to be populated for /bin/kernel-install to # correctly copy kernels into /boot. We will clear this out in the # final image. RUN systemd-machine-id-setup ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/element-deps0000664000175000017500000000013215201026231027607 0ustar00zuulzuulcache-url containerfile package-installs redhat-common rpm-distro source-repositories yum ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3152363 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/environment.d/0000775000175000017500000000000015201026275030104 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022600000000000010215 xustar00128 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/environment.d/10-01-almalinux-distro-name.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/environment.d/10-01-almalinu0000664000175000017500000000026115201026231032254 0ustar00zuulzuulexport DISTRO_NAME=almalinux export DIB_RELEASE=${DIB_RELEASE:-10} # always the most recent major export EFI_BOOT_DIR="EFI/almalinux" export DIB_YUM_MINIMAL_CREATE_INTERFACES=0 ././@PaxHeader0000000000000000000000000000020500000000000010212 xustar00111 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/environment.d/11-yum-dnf.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/environment.d/11-yum-dnf.bas0000664000175000017500000000001715201026231032357 0ustar00zuulzuulexport YUM=dnf ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/package-installs.yaml0000664000175000017500000000017315201026231031415 0ustar00zuulzuulaudit: dnf-plugins-core: dracut: dracut-config-generic: grubby: kernel: initscripts: man-pages: passwd: redhat-rpm-config: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2452347 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/0000775000175000017500000000000015201026275030107 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000024000000000000010211 xustar00132 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-aarch64-build-succeeds/ 28 mtime=1778658493.3152363 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-a0000775000175000017500000000000015201026275032456 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000024400000000000010215 xustar00142 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-aarch64-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-a0000664000175000017500000000004415201026231032446 0ustar00zuulzuulVerify a AlmaLinux 10 aarch64 image ././@PaxHeader0000000000000000000000000000024600000000000010217 xustar00144 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-aarch64-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-a0000664000175000017500000000002315201026231032443 0ustar00zuulzuulblock-device-efi vm././@PaxHeader0000000000000000000000000000025600000000000010220 xustar00146 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-aarch64-build-succeeds/environment.d/ 28 mtime=1778658493.3152363 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-a0000775000175000017500000000000015201026275032456 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000027000000000000010214 xustar00162 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-aarch64-build-succeeds/environment.d/09-set-distro.sh 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-a0000664000175000017500000000002715201026231032447 0ustar00zuulzuulexport DIB_RELEASE='10'././@PaxHeader0000000000000000000000000000023000000000000010210 xustar00124 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-build-succeeds/ 28 mtime=1778658493.3152363 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-b0000775000175000017500000000000015201026275032457 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023400000000000010214 xustar00134 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-b0000664000175000017500000000004415201026231032447 0ustar00zuulzuulVerify a AlmaLinux 10 aarch64 image ././@PaxHeader0000000000000000000000000000023600000000000010216 xustar00136 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-b0000664000175000017500000000002315201026231032444 0ustar00zuulzuulblock-device-efi vm././@PaxHeader0000000000000000000000000000024600000000000010217 xustar00138 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-build-succeeds/environment.d/ 28 mtime=1778658493.3152363 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-b0000775000175000017500000000000015201026275032457 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000026000000000000010213 xustar00154 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-build-succeeds/environment.d/09-set-distro.sh 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-b0000664000175000017500000000002715201026231032450 0ustar00zuulzuulexport DIB_RELEASE='10'././@PaxHeader0000000000000000000000000000023700000000000010217 xustar00131 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-aarch64-build-succeeds/ 28 mtime=1778658493.3162363 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-aa0000775000175000017500000000000015201026275032547 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000024300000000000010214 xustar00141 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-aarch64-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-aa0000664000175000017500000000004315201026231032536 0ustar00zuulzuulVerify a AlmaLinux 9 aarch64 image ././@PaxHeader0000000000000000000000000000024500000000000010216 xustar00143 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-aarch64-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-aa0000664000175000017500000000005115201026231032535 0ustar00zuulzuulblock-device-efi openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000025500000000000010217 xustar00145 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-aarch64-build-succeeds/environment.d/ 28 mtime=1778658493.3162363 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-aa0000775000175000017500000000000015201026275032547 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000027100000000000010215 xustar00163 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-aarch64-build-succeeds/environment.d/09-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-aa0000664000175000017500000000002715201026231032540 0ustar00zuulzuulexport DIB_RELEASE='9' ././@PaxHeader0000000000000000000000000000022700000000000010216 xustar00123 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-build-succeeds/ 28 mtime=1778658493.3162363 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-bu0000775000175000017500000000000015201026275032574 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023300000000000010213 xustar00133 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-bu0000664000175000017500000000003315201026231032562 0ustar00zuulzuulVerify a AlmaLinux 9 image ././@PaxHeader0000000000000000000000000000023500000000000010215 xustar00135 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-bu0000664000175000017500000000002415201026231032562 0ustar00zuulzuulblock-device-efi vm ././@PaxHeader0000000000000000000000000000024500000000000010216 xustar00137 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-build-succeeds/environment.d/ 28 mtime=1778658493.3162363 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-bu0000775000175000017500000000000015201026275032574 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000026100000000000010214 xustar00155 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-build-succeeds/environment.d/09-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-bu0000664000175000017500000000002715201026231032565 0ustar00zuulzuulexport DIB_RELEASE='9' ././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00111 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/build-succeeds/ 28 mtime=1778658493.3162363 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/build-succeeds0000775000175000017500000000000015201026275032723 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021700000000000010215 xustar00121 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/build-succeeds0000664000175000017500000000006115201026231032712 0ustar00zuulzuulVerify we can build a almalinux-container image. ././@PaxHeader0000000000000000000000000000022100000000000010210 xustar00123 path=diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/almalinux-container/test-elements/build-succeeds0000664000175000017500000000000315201026231032706 0ustar00zuulzuulvm ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3162363 diskimage_builder-3.42.0/diskimage_builder/elements/apt-conf/0000775000175000017500000000000015201026275023053 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/apt-conf/README.rst0000664000175000017500000000064015201026231024532 0ustar00zuulzuul======== apt-conf ======== This element overrides the default apt.conf for APT based systems. Environment Variables --------------------- DIB_APT_CONF: :Required: No :Default: None :Description: To override `DIB_APT_CONF`, set it to the path to your apt.conf. The new apt.conf will take effect at build time and run time. :Example: ``DIB_APT_CONF=/etc/apt/apt.conf`` ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3172364 diskimage_builder-3.42.0/diskimage_builder/elements/apt-conf/extra-data.d/0000775000175000017500000000000015201026275025327 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020600000000000010213 xustar00112 path=diskimage_builder-3.42.0/diskimage_builder/elements/apt-conf/extra-data.d/99-override-default-apt-conf 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/apt-conf/extra-data.d/99-override-default-apt-co0000775000175000017500000000112015201026231032120 0ustar00zuulzuul#!/bin/bash # Override the default /etc/apt/apt.conf with $DIB_APT_CONF if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # exit directly if DIB_APT_CONF is not defined properly if [ -z "${DIB_APT_CONF:-}" ] ; then echo "DIB_APT_CONF is not set - no apt.conf will be copied in" exit 0 elif [ ! -f "$DIB_APT_CONF" ] ; then echo "$DIB_APT_CONF is not a valid apt.conf file." echo "You should assign a proper apt.conf file in DIB_APT_CONF" exit 1 fi # copy the apt.conf to cloudimg sudo cp -L -f $DIB_APT_CONF $TMP_MOUNT_PATH/etc/apt/apt.conf ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3172364 diskimage_builder-3.42.0/diskimage_builder/elements/apt-preferences/0000775000175000017500000000000015201026275024427 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/apt-preferences/README.rst0000664000175000017500000000126315201026231026110 0ustar00zuulzuul=============== apt-preferences =============== This element generates the APT preferences file based on the provided manifest provided by the :doc:`../manifests/README` element. The APT preferences file can be used to control which versions of packages will be selected for installation. APT uses a priority system to make this determination. For more information about APT preferences, see the apt_preferences(5) man page. Environment Variables --------------------- DIB_DPKG_MANIFEST: :Required: No :Default: None :Description: The manifest file to generate the APT preferences file from. :Example: ``DIB\_DPKG\_MANIFEST=~/image.d/dib-manifests/dib-manifest-dpkg-image`` ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3172364 diskimage_builder-3.42.0/diskimage_builder/elements/apt-preferences/extra-data.d/0000775000175000017500000000000015201026275026703 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021000000000000010206 xustar00114 path=diskimage_builder-3.42.0/diskimage_builder/elements/apt-preferences/extra-data.d/99-set-apt-package-pins 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/apt-preferences/extra-data.d/99-set-apt-package-0000775000175000017500000000314315201026231032104 0ustar00zuulzuul#!/bin/bash # # Copyright 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # exit directly if DIB_DPKG_MANIFEST is not defined properly if [ -z "${DIB_DPKG_MANIFEST:-}" ]; then echo "DIB_DPKG_MANIFEST must be set to the location of a manifest file you wish to use" exit 0 elif [ ! -f "$DIB_DPKG_MANIFEST" -o ! -s "$DIB_DPKG_MANIFEST" ]; then echo "$DIB_DPKG_MANIFEST is not a valid manifest file." echo "You should assign a proper manifest file in DIB_DPKG_MANIFEST" exit 1 fi DIB_DPKG_MANIFEST=$(readlink -f $DIB_DPKG_MANIFEST) # Create the preferences file from the given manifest outfile=$(mktemp) for package in $(jq -r ".packages[].package" $DIB_DPKG_MANIFEST); do version=$(jq -r ".packages[] | select(.package == \"${package}\") |\ .version" $DIB_DPKG_MANIFEST) cat << EOF >> $outfile Package: ${package} Pin: version ${version} Pin-Priority: 1001 EOF done if [ -s $outfile ]; then sudo mv $outfile $TMP_MOUNT_PATH/etc/apt/preferences else rm $outfile fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3172364 diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/0000775000175000017500000000000015201026275023611 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/README.rst0000664000175000017500000000076115201026231025274 0ustar00zuulzuul=========== apt-sources =========== Specify an apt sources.list file which is used during image building and then remains on the image when it is run. Environment Variables --------------------- DIB_APT_SOURCES :Required: No :Default: None (Does not replace sources.list file) :Description: Path to a file on the build host which is used in place of ``/etc/apt/sources.list`` :Example: ``DIB_APT_SOURCES=/etc/apt/sources.list`` will use the same sources.list as the build host. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3172364 diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/extra-data.d/0000775000175000017500000000000015201026275026065 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021400000000000010212 xustar00118 path=diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/extra-data.d/99-override-default-apt-sources 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/extra-data.d/99-override-default-apt0000775000175000017500000000137515201026231032273 0ustar00zuulzuul#!/bin/bash # Override the default /etc/apt/sources.list with $DIB_APT_SOURCES if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # exit directly if DIB_APT_SOURCES is not defined properly if [ -z "${DIB_APT_SOURCES:-}" ] ; then echo "DIB_APT_SOURCES must be set to the location of a sources.list file you wish to use" exit 0 elif [ ! -f "$DIB_APT_SOURCES" -o ! -s "$DIB_APT_SOURCES" ] ; then echo "$DIB_APT_SOURCES is not a valid sources.list file." echo "You should assign proper sources.list file in DIB_APT_SOURCES" exit 1 fi DIB_APT_SOURCES=`readlink -f $DIB_APT_SOURCES` # copy the sources.list to cloudimg pushd $TMP_MOUNT_PATH/etc/apt/ sudo cp -f $DIB_APT_SOURCES sources.list # dib-lint: safe_sudo popd ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2452347 diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/test-elements/0000775000175000017500000000000015201026275026402 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3172364 diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/test-elements/test-sources/0000775000175000017500000000000015201026275031042 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/test-elements/test-sources/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/test-elements/test-sources/element-d0000664000175000017500000000005115201026231032623 0ustar00zuulzuulbase openstack-ci-mirrors ubuntu-minimal ././@PaxHeader0000000000000000000000000000021700000000000010215 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/test-elements/test-sources/environment.d/ 28 mtime=1778658493.3172364 diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/test-elements/test-sources/environme0000775000175000017500000000000015201026275032765 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023300000000000010213 xustar00133 path=diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/test-elements/test-sources/environment.d/00-set-apt-sources 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/test-elements/test-sources/environme0000664000175000017500000000006115201026231032754 0ustar00zuulzuulDIB_APT_SOURCES=$(mktemp) export DIB_APT_SOURCES ././@PaxHeader0000000000000000000000000000021600000000000010214 xustar00114 path=diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/test-elements/test-sources/extra-data.d/ 28 mtime=1778658493.3172364 diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/test-elements/test-sources/extra-dat0000775000175000017500000000000015201026275032654 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023400000000000010214 xustar00134 path=diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/test-elements/test-sources/extra-data.d/00-write-apt-sources 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/test-elements/test-sources/extra-dat0000775000175000017500000000020015201026231032641 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail echo "testdata" > $DIB_APT_SOURCES ././@PaxHeader0000000000000000000000000000021700000000000010215 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/test-elements/test-sources/pre-install.d/ 28 mtime=1778658493.3182364 diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/test-elements/test-sources/pre-insta0000775000175000017500000000000015201026275032665 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023400000000000010214 xustar00134 path=diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/test-elements/test-sources/pre-install.d/00-test-apt-sources 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/apt-sources/test-elements/test-sources/pre-insta0000775000175000017500000000040015201026231032654 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eux set -o pipefail echo "Verifying apt sources.list content" [ -f /etc/apt/sources.list ] [ "$(cat /etc/apt/sources.list)" = "testdata" ] touch /tmp/dib-test-should-fail && exit 1 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3182364 diskimage_builder-3.42.0/diskimage_builder/elements/autoupdates/0000775000175000017500000000000015201026275023702 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/autoupdates/README.rst0000664000175000017500000000162015201026231025360 0ustar00zuulzuul=========== autoupdates =========== This element will configure both debian family and redhat family images to have an automatic updates mechanism built into the image, for example to update automatically from the security repos. For Debian based images it is based on unuattended-upgrades and for Redhat on dnf-automatic. Environment Variables --------------------- DIB_DEB_UPDATES_CONF :Required: Yes for the Debian Family :Default: None :Description: The location of a custom 50unattended-upgrades file on the builder which will be injected into the image. :Example: ``DIB_DEB_UPDATES_CONF=/home/50unattended-upgrades`` DIB_YUM_UPDATES_CONF :Required: Yes for the Redhat Family :Default: None :Description: The location of a custom automatic.conf file on the builder which will be injected into the image. :Example: ``DIB_YUM_UPDATES_CONF=/home/automatic.conf`` .. element_deps:: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/autoupdates/element-deps0000664000175000017500000000003115201026231026171 0ustar00zuulzuulpackage-installs pkg-map ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/autoupdates/package-installs.yaml0000664000175000017500000000004015201026231027772 0ustar00zuulzuulautoupdates: phase: install.d ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/autoupdates/pkg-map0000664000175000017500000000045315201026231025153 0ustar00zuulzuul{ "family":{ "redhat": { "autoupdates": "dnf-automatic" }, "debian":{ "autoupdates": "unattended-upgrades" }, "suse": { "autoupdates": "" }, "gentoo": { "autoupdates": "" } } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3182364 diskimage_builder-3.42.0/diskimage_builder/elements/autoupdates/post-install.d/0000775000175000017500000000000015201026275026555 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/autoupdates/post-install.d/82-enable-autoupdate0000775000175000017500000000211515201026231032320 0ustar00zuulzuul#!/bin/bash # Copyright (c) 2024 ECMWF # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail case "$DIB_INIT_SYSTEM" in systemd) if [[ $DISTRO_NAME =~ (ubuntu|debian)$ ]]; then systemctl enable unattended-upgrades.service elif [[ $DISTRO_NAME =~ (centos|rocky|rhel|openeuler)$ ]]; then systemctl enable dnf-automatic.timer else echo "The 'autoupdates' element does not support this distribution." echo "Exiting" exit 1 fi esac ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3182364 diskimage_builder-3.42.0/diskimage_builder/elements/autoupdates/root.d/0000775000175000017500000000000015201026275025107 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/autoupdates/root.d/61-create-update-config0000775000175000017500000000271215201026231031241 0ustar00zuulzuul#!/bin/bash # Copyright (c) 2024 ECMWF # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail # Check that only one of DIB_DEB_UPDATES_CONF or DIB_YUM_UPDATES_CONF is set if [[ -n ${DIB_DEB_UPDATES_CONF:-} && -n ${DIB_YUM_UPDATES_CONF:-} ]]; then echo "Error: Both DIB_DEB_UPDATES_CONF and DIB_YUM_UPDATES_CONF are set. Please select only one based on the distro." >&2 exit 1 elif [[ -z ${DIB_DEB_UPDATES_CONF:-} && -z ${DIB_YUM_UPDATES_CONF:-} ]]; then echo "Warning: Neither DIB_DEB_UPDATES_CONF nor DIB_YUM_UPDATES_CONF is set. Continuing without adding a config file." >&2 fi # Copy the appropriate configuration file if one is set if [[ -n ${DIB_DEB_UPDATES_CONF:-} ]]; then sudo cp ${DIB_DEB_UPDATES_CONF} $TARGET_ROOT/etc/apt/apt.conf.d/50unattended-upgrades elif [[ -n ${DIB_YUM_UPDATES_CONF:-} ]]; then sudo cp ${DIB_YUM_UPDATES_CONF} $TARGET_ROOT/etc/dnf/automatic.conf fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3182364 diskimage_builder-3.42.0/diskimage_builder/elements/baremetal/0000775000175000017500000000000015201026275023300 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/baremetal/README.rst0000664000175000017500000000100015201026231024746 0ustar00zuulzuul.. _element-baremetal: ========= baremetal ========= This is the baremetal (IE: real hardware) element. Does the following: * extracts the kernel and initial ramdisk of the built image. Optional parameters: * DIB_BAREMETAL_KERNEL_PATTERN and DIB_BAREMETAL_INITRD_PATTERN may be supplied to specify which kernel files are preferred; this can be of use when using custom kernels that don't fit the standard naming patterns. Both variables must be provided in order for them to have any effect. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3182364 diskimage_builder-3.42.0/diskimage_builder/elements/baremetal/cleanup.d/0000775000175000017500000000000015201026275025151 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020500000000000010212 xustar00111 path=diskimage_builder-3.42.0/diskimage_builder/elements/baremetal/cleanup.d/99-extract-kernel-and-ramdisk 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/baremetal/cleanup.d/99-extract-kernel-and-ramdis0000775000175000017500000000226015201026231032273 0ustar00zuulzuul#!/bin/bash # # Copyright 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # dib-lint: disable=safe_sudo if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail [ -n "$TARGET_ROOT" ] source $_LIB/img-functions # Dig up the initrd and kernel to use. select_boot_kernel_initrd $TARGET_ROOT sudo cp $BOOTDIR/$KERNEL ${IMAGE_NAME}.vmlinuz sudo cp $BOOTDIR/$RAMDISK ${IMAGE_NAME}.initrd sudo chmod a+r ${IMAGE_NAME}.vmlinuz sudo chmod a+r ${IMAGE_NAME}.initrd if [ -f $TARGET_ROOT/dib-signed-kernel-version ] ; then echo "Removing $TARGET_ROOT/dib-signed-kernel-version" sudo rm -f $TARGET_ROOT/dib-signed-kernel-version fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3192363 diskimage_builder-3.42.0/diskimage_builder/elements/base/0000775000175000017500000000000015201026275022256 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/base/README.rst0000664000175000017500000000260415201026231023737 0ustar00zuulzuul==== base ==== This is the base element. Almost all users will want to include this in their disk image build, as it includes a lot of useful functionality. The `DIB_CLOUD_INIT_ETC_HOSTS` environment variable can be used to customize cloud-init's management of `/etc/hosts`: * If the variable is set to something, write that value as cloud-init's manage_etc_hosts. * If the variable is set to an empty string, don't create manage_etc_hosts setting (cloud-init will use its default value). * If the variable is not set, use "localhost" for now. Later, not setting the variable will mean using cloud-init's default. (To preserve diskimage-builder's current default behavior in the future, set the variable to "localhost" explicitly.) The 'DIB_AVOID_PACKAGES_UPDATE' environment variable can be used to avoid updating all packages, useful when wanting to avoid release update. * 'DIB_AVOID_PACKAGES_UPDATE' default is '0', all packages will be updated. * set 'DIB_AVOID_PACKAGES_UPDATE' to '1' to avoid updating all packages. The 'DIB_SKIP_BASE_PACKAGE_INSTALL' environment variable can be used to avoid installing base packages, set to '1' to skip. Notes: * If you are getting warnings during the build about your locale being missing, consider installing/generating the relevant locale. This may be as simple as having language-pack-XX installed in the pre-install stage ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/base/element-deps0000664000175000017500000000004615201026231024553 0ustar00zuulzuuldib-init-system install-types pkg-map ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3192363 diskimage_builder-3.42.0/diskimage_builder/elements/base/environment.d/0000775000175000017500000000000015201026275025044 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/base/environment.d/10-base-defaults0000664000175000017500000000021115201026231027706 0ustar00zuulzuulexport DIB_AVOID_PACKAGES_UPDATE=${DIB_AVOID_PACKAGES_UPDATE:-0} export DIB_SKIP_BASE_PACKAGE_INSTALL=${DIB_SKIP_BASE_PACKAGE_INSTALL:-0}././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3192363 diskimage_builder-3.42.0/diskimage_builder/elements/base/install.d/0000775000175000017500000000000015201026275024146 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/base/install.d/00-baseline-environment0000775000175000017500000000040515201026231030424 0ustar00zuulzuul#!/bin/bash # These are useful, or at worst not harmful, for all images we build. if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [ ${DIB_SKIP_BASE_PACKAGE_INSTALL} -eq 0 ]; then install-packages -m base iscsi_package fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/base/install.d/00-up-to-date0000775000175000017500000000040015201026231026252 0ustar00zuulzuul#!/bin/bash # Fully upgrade everything on the system (if the package manager knows how to # do it). if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [ ${DIB_AVOID_PACKAGES_UPDATE} -eq 0 ]; then install-packages -u fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/base/install.d/10-cloud-init0000775000175000017500000000056015201026231026352 0ustar00zuulzuul#!/bin/bash # Tweak the stock ubuntu cloud-init config if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # cloud-init May not actually be installed mkdir -p /etc/cloud/cloud.cfg.d if [ -n "${DIB_CLOUD_INIT_ETC_HOSTS:-}" ]; then dd of=/etc/cloud/cloud.cfg.d/10_etc_hosts.cfg << EOF manage_etc_hosts: $DIB_CLOUD_INIT_ETC_HOSTS EOF fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/base/pkg-map0000664000175000017500000000151315201026231023525 0ustar00zuulzuul{ "family": { "redhat": { "iscsi_package": "iscsi-initiator-utils" }, "gentoo": { "curl": "net-misc/curl", "dhcp_client": "net-misc/dhcp", "extlinux": "sys-boot/syslinux", "git": "dev-vcs/git", "grub_bios": "sys-boot/grub", "grub-pc": "sys-boot/grub", "ironic-python-agent": "", "iscsi_package": "sys-block/open-iscsi", "isc-dhcp-client": "net-misc/dhcp", "isolinux": "", "ncat": "net-analyzer/netcat", "qemu-utils": "app-emulation/qemu", "python-dev": "", "PyYAML": "dev-python/pyyaml", "syslinux": "sys-boot/syslinux", "syslinux-common": "", "tftp": "net-ftp/tftp-hpa", "tgt": "sys-block/tgt" }, "suse": { "qemu-utils": "qemu-tools" } }, "default": { "iscsi_package": "open-iscsi" } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3192363 diskimage_builder-3.42.0/diskimage_builder/elements/base/pre-install.d/0000775000175000017500000000000015201026275024732 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/base/pre-install.d/03-baseline-tools0000775000175000017500000000107015201026231030006 0ustar00zuulzuul#!/bin/bash # Install baseline packages and tools. if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail case $DISTRO_NAME in 'ubuntu'|'debian') # Note: add-apt-repository would be nice for RPM platforms too - so when we # need something like it, create a wrapper in dpkg/bin and fedora/bin. apt-get -y update install-packages apt-transport-https if ! [[ $DIB_RELEASE =~ ^(testing|trixie|unstable|stable) ]]; then install-packages software-properties-common fi ;; esac ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3202364 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi/0000775000175000017500000000000015201026275024434 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi/README.rst0000664000175000017500000000072515201026231026117 0ustar00zuulzuul================ Block Device EFI ================ This provides a block-device configuration for the ``vm`` element to get a single-partition disk suitable for EFI booting. Note on x86 this provides the extra `BIOS boot partition `__ and a EFI boot partition for maximum compatability. This element requires ``mkfs.vfat`` command to be available on the build system, usually included in the dosfstools OS package. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi/block-device-default.yaml0000664000175000017500000000113315201026231031257 0ustar00zuulzuul- local_loop: name: image0 - partitioning: base: image0 label: gpt partitions: - name: ESP type: 'EF00' size: 550MiB mkfs: type: vfat mount: mount_point: /boot/efi fstab: options: "defaults" fsck-passno: 2 - name: BSP type: 'EF02' size: 8MiB - name: root type: '8300' size: 100% mkfs: type: ext4 mount: mount_point: / fstab: options: "defaults" fsck-passno: 1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi/element-provides0000664000175000017500000000001415201026231027624 0ustar00zuulzuulblock-device././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3212364 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi/environment.d/0000775000175000017500000000000015201026275027222 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi/environment.d/15-block-device.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi/environment.d/15-block-device.b0000664000175000017500000000031615201026231032127 0ustar00zuulzuul# # Arch gate # if [[ "ppc64 ppc64le ppc64el" =~ "$ARCH" ]]; then echo "block-device-efi is not supported on Power; use block-device-gpt or block-device-mbr" exit 1 fi export DIB_BLOCK_DEVICE=efi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3202364 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi-4k/0000775000175000017500000000000015201026275024750 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi-4k/README.rst0000664000175000017500000000143515201026231026432 0ustar00zuulzuul================ Block Device EFI ================ This provides a block-device configuration for the ``vm`` element to get a single-partition disk suitable for EFI booting on a block device which uses a native 4KiB sector size. This is important because GPT partitioning relies on sector boundry placement and the GPT disk partition table always starts on the second sector of the disk. Note on x86 this provides the extra `BIOS boot partition `__ and a EFI boot partition for maximum compatability. This element requires ``mkfs.vfat`` command to be available on the build system, usually included in the dosfstools OS package. Furthermore, the sector size created by this element will not be compatible with devices using 512 byte sectors. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi-4k/block-device-default.yaml0000664000175000017500000000115715201026231031601 0ustar00zuulzuul- local_loop: name: image0 block_size: 4096 - partitioning: base: image0 label: gpt partitions: - name: ESP type: 'EF00' size: 500MiB mkfs: type: vfat mount: mount_point: /boot/efi fstab: options: "defaults" fsck-passno: 2 - name: BSP type: 'EF02' size: 8MiB - name: root type: '8300' size: 100% mkfs: type: ext4 mount: mount_point: / fstab: options: "defaults" fsck-passno: 1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi-4k/element-provides0000664000175000017500000000001415201026231030140 0ustar00zuulzuulblock-device././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3202364 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi-4k/environment.d/0000775000175000017500000000000015201026275027536 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021200000000000010210 xustar00116 path=diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi-4k/environment.d/15-block-device.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi-4k/environment.d/15-block-devic0000664000175000017500000000031615201026231032056 0ustar00zuulzuul# # Arch gate # if [[ "ppc64 ppc64le ppc64el" =~ "$ARCH" ]]; then echo "block-device-efi is not supported on Power; use block-device-gpt or block-device-mbr" exit 1 fi export DIB_BLOCK_DEVICE=efi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3212364 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi-lvm/0000775000175000017500000000000015201026275025230 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi-lvm/README.rst0000664000175000017500000000126115201026231026707 0ustar00zuulzuul==================== Block Device EFI LVM ==================== This provides a block-device configuration for the ``vm`` element to get a disk suitable for EFI booting which uses LVM to define multiple volumes mounted to /, /tmp, /var, and /home. Please note that the sizes of the partitions may not be enough for production usage, they will need to be resized properly after deployment depending on the available disk size. Note on x86 this provides the extra `BIOS boot partition `__ and a EFI boot partition for maximum compatability. This element requires ``dosfstools`` and ``lvm2`` packages to be installed on the build system. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi-lvm/block-device-default.yaml0000664000175000017500000000257715201026231032070 0ustar00zuulzuul- local_loop: name: image0 - partitioning: base: image0 label: gpt partitions: - name: ESP type: 'EF00' size: 550MiB mkfs: type: vfat mount: mount_point: /boot/efi fstab: options: "defaults" fsck-passno: 2 - name: BSP type: 'EF02' size: 8MiB - name: root flags: [ boot ] size: 40G - lvm: name: lvm base: [ root ] pvs: - name: pv base: root options: [ "--force" ] vgs: - name: vg base: [ "pv" ] options: [ "--force" ] lvs: - name: lv_root base: vg extents: 23%VG - name: lv_var base: vg extents: 57%VG - name: lv_home base: vg extents: 20%VG - mkfs: name: fs_root base: lv_root type: xfs label: "img-rootfs" mount: mount_point: / fstab: options: "rw,relatime" fsck-passno: 1 - mkfs: name: fs_var base: lv_var type: xfs mount: mount_point: /var fstab: options: "rw,relatime" fsck-passno: 2 - mkfs: name: fs_home base: lv_home type: xfs mount: mount_point: /home fstab: options: "rw,nodev,relatime" fsck-passno: 2 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi-lvm/element-provides0000664000175000017500000000001415201026231030420 0ustar00zuulzuulblock-device././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3212364 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi-lvm/environment.d/0000775000175000017500000000000015201026275030016 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi-lvm/environment.d/15-block-device.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-efi-lvm/environment.d/15-block-devi0000664000175000017500000000031615201026231032173 0ustar00zuulzuul# # Arch gate # if [[ "ppc64 ppc64le ppc64el" =~ "$ARCH" ]]; then echo "block-device-efi is not supported on Power; use block-device-gpt or block-device-mbr" exit 1 fi export DIB_BLOCK_DEVICE=efi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3212364 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-gpt/0000775000175000017500000000000015201026275024463 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-gpt/README.rst0000664000175000017500000000047515201026231026150 0ustar00zuulzuul================ Block Device GPT ================ This provides a block-device configuration for the ``vm`` element to get a GPT based single-partition disk. Note on x86 this provides the extra `BIOS boot partition `__ as required for non-EFI boot environments. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-gpt/block-device-default.yaml0000664000175000017500000000070015201026231031305 0ustar00zuulzuul# Default single partition loopback using a GPT based partition table - local_loop: name: image0 - partitioning: base: image0 label: gpt partitions: - name: BSP type: 'EF02' size: 8MiB - name: root flags: [ boot ] size: 100% mkfs: type: ext4 mount: mount_point: / fstab: options: "defaults" fsck-passno: 1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-gpt/block-device-ppc64el.yaml0000664000175000017500000000145115201026231031142 0ustar00zuulzuul# Default GPT block device setup for PPC # -------------------------------------- # # Details (extracted from [1]) # # Power Firmware (OFW) scans chosen (nvram value boot-device) device, # for either PReP* partition or vfat. # # PReP is raw and small (8M max) partition which caries only stage1 # binary. # # [1] https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/W51a7ffcf4dfd_4b40_9d82_446ebc23c550/page/PowerLinux%20Boot%20howto - local_loop: name: image0 - partitioning: base: image0 label: gpt partitions: - name: boot type: '0x4100' size: 8MiB - name: root size: 100% mkfs: type: ext4 mount: mount_point: / fstab: options: "defaults" fsck-passno: 1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-gpt/element-provides0000664000175000017500000000001415201026231027653 0ustar00zuulzuulblock-device././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3212364 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-gpt/environment.d/0000775000175000017500000000000015201026275027251 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/block-device-gpt/environment.d/15-block-device.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-gpt/environment.d/15-block-device.b0000664000175000017500000000026215201026231032156 0ustar00zuulzuul# # Arch gate # if [[ "arm64 aarch64" =~ $ARCH ]]; then echo "block-device-gpt is not supported on AARCH64; use block-device-efi" exit 1 fi export DIB_BLOCK_DEVICE=gpt ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3222365 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-mbr/0000775000175000017500000000000015201026275024451 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-mbr/README.rst0000664000175000017500000000032615201026231026131 0ustar00zuulzuul================ Block Device MBR ================ This provides the default legacy block-device configuration for the "vm" element. This configures a single partition and is suitable for a MBR based bootloader. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-mbr/block-device-default.yaml0000664000175000017500000000053015201026231031274 0ustar00zuulzuul# Default single partition loopback - local_loop: name: image0 - partitioning: base: image0 label: mbr partitions: - name: root flags: [ boot, primary ] size: 100% mkfs: mount: mount_point: / fstab: options: "defaults" fsck-passno: 1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-mbr/block-device-ppc64el.yaml0000664000175000017500000000170215201026231031127 0ustar00zuulzuul# Default block device setup for PPC # ---------------------------------- # # Details (extracted from [1]) # # Power Firmware (OFW) scans chosen (nvram value boot-device) device, # for either PReP* partition or vfat. # # PReP is raw and small (8M max) partition which caries only stage1 # binary. # msdos partition table: # - PReP partition have 0x41 type (must be active) # - PReP partition must have boot flag set # # [1] https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/W51a7ffcf4dfd_4b40_9d82_446ebc23c550/page/PowerLinux%20Boot%20howto - local_loop: name: image0 - partitioning: base: image0 label: mbr partitions: - name: boot flags: [ boot, primary ] type: '0x41' size: 8MiB - name: root flags: [ primary ] size: 100% mkfs: mount: mount_point: / fstab: options: "defaults" fsck-passno: 1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-mbr/element-provides0000664000175000017500000000001415201026231027641 0ustar00zuulzuulblock-device././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3222365 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-mbr/environment.d/0000775000175000017500000000000015201026275027237 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/block-device-mbr/environment.d/15-block-device.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/block-device-mbr/environment.d/15-block-device.b0000664000175000017500000000026215201026231032144 0ustar00zuulzuul# # Arch gate # if [[ "arm64 aarch64" =~ $ARCH ]]; then echo "block-device-mbr is not supported on AARCH64; use block-device-efi" exit 1 fi export DIB_BLOCK_DEVICE=mbr ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3222365 diskimage_builder-3.42.0/diskimage_builder/elements/bootloader/0000775000175000017500000000000015201026275023476 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/bootloader/README.rst0000664000175000017500000000306215201026231025156 0ustar00zuulzuul========== bootloader ========== Installs ``grub[2]`` on boot partition on the system. Arguments ========= * ``DIB_GRUB_TIMEOUT`` sets the ``grub`` menu timeout. It defaults to 5 seconds. Set this to 0 (no timeout) for fast boot times. * ``DIB_GRUB_TIMEOUT_STYLE`` sets the visibility of the ``grub`` menu. It defaults to ``menu``. Set this to ``hidden`` (or ``countdown`` as an alias) to not display the menu until the timeout is reached at which point the default boot entry will be selected. * ``DIB_BOOTLOADER_DEFAULT_CMDLINE`` sets parameters that are appended to the ``GRUB_CMDLINE_LINUX_DEFAULT`` values in ``grub.cfg`` configuration. It defaults to ``nofb nomodeset gfxpayload=text``. * ``DIB_BOOTLOADER_USE_SERIAL_CONSOLE`` allows usage of a serial console to be disabled in the resulting image by setting to a value of ``False``. * ``DIB_BOOTLOADER_SERIAL_CONSOLE`` sets the serial device to be used as a console. It defaults to ``hvc0`` for PowerPC, ``ttyAMA0,115200`` for ARM64, otherwise ``ttyS0,115200``. * ``DIB_BOOTLOADER_VIRTUAL_TERMINAL`` sets the virtual terminal be used as a console. It defaults to ``tty0``. When explicitly set to an empty string then no virtual terminal console kernel argument is added. * ``DIB_NO_TIMER_CHECK`` allows the default kernel argument, ``no_timer_check`` to be removed from the kernel command line when the value is set to ``False``. * ``DIB_SKIP_GRUB_PACKAGE_INSTALL`` when set to ``True`` will not install any grub packages, and will assume all necessary packages are already installed. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3222365 diskimage_builder-3.42.0/diskimage_builder/elements/bootloader/environment.d/0000775000175000017500000000000015201026275026264 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021200000000000010210 xustar00116 path=diskimage_builder-3.42.0/diskimage_builder/elements/bootloader/environment.d/10-bootloader-default-cmdline 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/bootloader/environment.d/10-bootloader-default-c0000664000175000017500000000130415201026231032407 0ustar00zuulzuulexport DIB_BOOTLOADER_DEFAULT_CMDLINE=${DIB_BOOTLOADER_DEFAULT_CMDLINE:-"nofb nomodeset gfxpayload=text"} export DIB_BOOTLOADER_SERIAL_CONSOLE=${DIB_BOOTLOADER_SERIAL_CONSOLE:-""} if [ ! -v DIB_BOOTLOADER_VIRTUAL_TERMINAL ]; then # DIB_BOOTLOADER_VIRTUAL_TERMINAL is unset export DIB_BOOTLOADER_VIRTUAL_TERMINAL=tty0 else # DIB_BOOTLOADER_VIRTUAL_TERMINAL is set to empty string or other value export DIB_BOOTLOADER_VIRTUAL_TERMINAL=${DIB_BOOTLOADER_VIRTUAL_TERMINAL} fi export DIB_NO_TIMER_CHECK=${DIB_NO_TIMER_CHECK:-"True"} export DIB_BOOTLOADER_USE_SERIAL_CONSOLE=${DIB_BOOTLOADER_USE_SERIAL_CONSOLE:-"True"} export DIB_SKIP_GRUB_PACKAGE_INSTALL=${DIB_SKIP_GRUB_PACKAGE_INSTALL:-"False"} ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3232365 diskimage_builder-3.42.0/diskimage_builder/elements/bootloader/finalise.d/0000775000175000017500000000000015201026275025512 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/bootloader/finalise.d/50-bootloader0000775000175000017500000003155515201026231030015 0ustar00zuulzuul#!/bin/bash # Configure grub. Note that the various conditionals here are to handle # different distributions gracefully. if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail if [ ${DIB_EXTLINUX:-0} != "0" ]; then echo "DIB_EXTLINUX no longer supported" exit 1 fi # Some distros have pre-installed grub in some other way, and want to # skip this. if [[ -f "/tmp/grub/install" ]]; then exit 0 fi BOOT_DEV=$IMAGE_BLOCK_DEVICE # All available devices, handy for some bootloaders... declare -A DEVICES eval DEVICES=( $IMAGE_BLOCK_DEVICES ) DIB_BLOCK_DEVICE=${DIB_BLOCK_DEVICE:-} # Right now we can't use pkg-map to branch by arch, so tag an # architecture specific virtual package so we can install the # rigth thing based on distribution. if [[ "$ARCH" =~ "ppc" ]]; then GRUB_PACKAGES="grub-ppc64" elif [[ "${DIB_BLOCK_DEVICE}" == "mbr" || "${DIB_BLOCK_DEVICE}" == "gpt" ]]; then GRUB_PACKAGES="grub-pc" elif [[ "${DIB_BLOCK_DEVICE}" == "efi" ]]; then GRUB_PACKAGES="grub-efi grub-efi-$ARCH" else GRUB_PACKAGES="grub-pc grub-efi grub-efi-$ARCH" fi if [[ "False" == "${DIB_SKIP_GRUB_PACKAGE_INSTALL:-False}" ]]; then install-packages -m bootloader $GRUB_PACKAGES fi GRUBNAME=$(type -p grub-install) || echo "trying grub2-install" if [ -z "$GRUBNAME" ]; then GRUBNAME=$(type -p grub2-install) fi if type grub2-mkconfig >/dev/null 2>&1; then GRUB_MKCONFIG="grub2-mkconfig" else GRUB_MKCONFIG="grub-mkconfig" fi if [[ ! $($GRUBNAME --version) =~ ' 2.' ]]; then echo "Failure: not grub2" exit 1 fi # Ensure BLS entries are updated with default args if [[ $($GRUB_MKCONFIG --help) =~ '--update-bls-cmdline' ]]; then GRUB_MKCONFIG="$GRUB_MKCONFIG --update-bls-cmdline" fi # Some distros keep things in /boot/grub2, others in /boot/grub if [ -d /boot/grub2 ]; then GRUB_CFG=/boot/grub2/grub.cfg GRUBENV=/boot/grub2/grubenv else # NOTE(ianw) This used to be behind a "-d /boot/grub" but this # directory doesn't seem to exist for gentoo at this point; # something creates it later. So we just fallback to this # unconditionally. GRUB_CFG=/boot/grub/grub.cfg GRUBENV=/boot/grub/grubenv mkdir -p /boot/grub fi # When using EFI image-based builds, particularly rhel element # based on RHEL>=8.2 .qcow2, we might have /boot/grub2/grubenv # as a dangling symlink to /boot/efi because we have extracted # it from the root fs, but we didn't populate the separate EFI # boot partition from the image. grub2-install calls rename() # on this file, so if it's a dangling symlink it errors. Just # remove it if it exists. if [[ -L $GRUBENV ]]; then rm -f $GRUBENV fi function append_or_replace { local file=$1 local key=$2 local value=$3 if grep -q "^$key=" "$file"; then sed -i "s/^$key=.*/$key=$value/" "$file" else echo $key=$value >>"$file" fi } # NOTE(TheJulia): Explicitly strip out embedded console settings # in the source's grub defaults. This prevents re-introduction later. # Intentionally matching 'console=ttyS0,115200n8 console=tty0' # Also globally matches so it can handle 'console=tty0 stuff console=tty1' # ... and also matches # 'console=ttyS0,112500n81 console=ttyS1,n8 console=tty0' if [[ -f /etc/default/grub ]]; then sed -i 's/\>/etc/default/grub if [[ "True" == "${DIB_BOOTLOADER_USE_SERIAL_CONSOLE:-True}" ]]; then echo 'GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"' >>/etc/default/grub fi # os-prober leaks /dev/sda into config file in dual-boot host # Disable grub-os-prober to avoid the issue while running # grub-mkconfig # Setting a flag to track whether the entry is already there in grub config PROBER_DISABLED= if ! grep -qe "^\s*GRUB_DISABLE_OS_PROBER=true" /etc/default/grub; then PROBER_DISABLED=true echo 'GRUB_DISABLE_OS_PROBER=true' >> /etc/default/grub fi # GRUB_MKCONFIG call needs to happen after we configure # /etc/default/grub above. Without this we can set inappropriate # root device labels and then images don't boot. # # This produces a legacy config which both bios and uefi can boot # Later we copy the final config to an efi specific location to # support uefi specific functionality like secure boot. $GRUB_MKCONFIG -o $GRUB_CFG # If we are using BLS, for debugging purposes dump out the kernel if [[ -e /boot/loader/entries ]]; then grubby --info=ALL fi # Remove the fix to disable os_prober if [ -n "$PROBER_DISABLED" ]; then sed -i '$d' /etc/default/grub fi # Fix efi specific instructions in grub config file if [ -d /sys/firmware/efi ]; then sed -i 's%\(initrd\|linux\)efi /boot%\1 /boot%g' $GRUB_CFG fi # when using efi, and having linux16/initrd16, it needs to be replaced # by linuxefi/initrdefi. When building images on a non-efi system, # the 16 suffix is added to linux/initrd entries, but we need it to be # linuxefi/initrdefi for the image to boot under efi if [[ ${DIB_BLOCK_DEVICE} == "efi" ]]; then sed -i 's%\(linux\|initrd\)16 /boot%\1efi /boot%g' $GRUB_CFG fi # Finally copy the grub.cfg and grubenv to the EFI specific dir # to support functionality like secure boot. We make a copy because # /boot and /boot/efi may be different partitions and uefi looks # for a specific partition UUID preventing symlinks from working. if [ -n "${EFI_BOOT_DIR:-}" ] && [ -d /boot/efi/$EFI_BOOT_DIR ] ; then cp $GRUB_CFG /boot/efi/$EFI_BOOT_DIR/grub.cfg if [ -a $GRUBENV ]; then cp $GRUBENV /boot/efi/$EFI_BOOT_DIR/grubenv fi fi # Ensure paths in BLS entries account for /boot being a partition or part of the # root partition and perform any required entry removal. if [[ -e /boot/loader/entries ]]; then pushd /boot/loader/entries set +e mountpoint /boot bootmount=$? for entry in *; do if [[ $bootmount -eq 0 ]]; then sed -i "s| /boot/vmlinuz| /vmlinuz|" $entry sed -i "s| /boot/initramfs| /initramfs|" $entry else sed -i "s| /vmlinuz| /boot/vmlinuz|" $entry sed -i "s| /initramfs| /boot/initramfs|" $entry fi done set -e popd # Since we are already aware we're using BLS, we can go ahead and # do any cleanup to disable embedded serial console settings if they # already exist. if [[ "True" != "${DIB_BOOTLOADER_USE_SERIAL_CONSOLE:-True}" ]] && [[ "${VIRTUAL_TERMINAL}" == "" ]]; then # NOTE(TheJulia): This removes any console arguments and allows grub # to use it's default. It will also remove any embedded consoles in # source images, which may be highly desirable if your running # interrupt sensitive workloads, such as NFV workloads. grubby --update-kernel ALL --remove-args=console fi # Print resulting grubby output for debug purposes grubby --info=ALL fi if [[ ! "$ARCH" =~ "ppc" ]] && [[ -z "${DIB_BLOCK_DEVICE}" ]]; then echo "WARNING: No bootloader installation will occur." echo "To install a bootloader ensure you have included a block-device-* element" exit 0 fi echo "Installing GRUB2..." # We need --force so grub does not fail due to being installed on the # root partition of a block device. GRUB_OPTS="--force " if [[ "$ARCH" =~ "ppc" ]] ; then # For PPC (64-Bit regardless of Endian-ness), we use the "boot" # partition as the one to point grub-install to, not the loopback # device. ppc has a dedicated PReP boot partition. # For grub2 < 2.02~beta3 this needs to be a /dev/mapper/... node after # that a dev/loopXpN node will work fine. $GRUBNAME --modules="part_msdos" $GRUB_OPTS ${DEVICES[boot]} --no-nvram else # This set of modules is sufficient for all installs (mbr/gpt/efi) modules="part_msdos part_gpt lvm" if [[ ${DIB_BLOCK_DEVICE} == "mbr" || ${DIB_BLOCK_DEVICE} == "gpt" ]]; then if [[ ! "x86_64 amd64" =~ ${ARCH} ]]; then echo "*** ${ARCH} is not supported by mbr/gpt" fi $GRUBNAME --modules="$modules biosdisk" --target=i386-pc \ $GRUB_OPTS $BOOT_DEV elif [[ ${DIB_BLOCK_DEVICE} == "efi" ]]; then # We need to manually set the target if it's different to # the host. Setup for EFI case $ARCH in "x86_64"|"amd64") # This call installs grub for BIOS compatability # which makes portable EFI/BIOS images. $GRUBNAME --modules="$modules" --target=i386-pc $BOOT_DEV # Append the x86_64 specific efi target for the generic # installation below. GRUB_OPTS="${GRUB_OPTS} --target=x86_64-efi" ;; # At this point, we don't need to override the target # for any other architectures. esac # If we don't have a distro specific dir with presigned efi targets # we install a generic one. if [ ! -d /boot/efi/$EFI_BOOT_DIR ]; then echo "WARNING: /boot/efi/$EFI_BOOT_DIR does not exist, UEFI secure boot not supported" # This tells the EFI install to put the EFI binaries into # the generic /BOOT directory and avoids trying to update # nvram settings. extra_options="--removable" $GRUBNAME --modules="$modules" $extra_options $GRUB_OPTS $BOOT_DEV fi fi fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/bootloader/pkg-map0000664000175000017500000000324415201026231024750 0ustar00zuulzuul{ "family": { "gentoo": { "dkms_package": "", "extlinux": "syslinux", "grub-pc": "grub", "grub-efi": "grub", "grub-efi-amd64": "", "grub-efi-arm64": "", "grub-efi-aarch64": "" }, "suse": { "dkms_package": "", "extlinux": "syslinux", "grub-pc": "grub2", "grub-efi": "grub2", "grub-efi-amd64": "grub2-x86_64-efi" }, "redhat": { "extlinux": "syslinux-extlinux", "grub-pc": "grub2-tools grub2", "grub-ppc64": "grub2-tools grub2", "grub-efi": "grub2-tools grub2 efibootmgr", "grub-efi-amd64": "grub2-efi-x64 grub2-efi-x64-modules shim-x64", "grub-efi-x86_64": "grub2-efi-x64 grub2-efi-x64-modules shim-x64", "grub-efi-arm64": "grub2-efi-aa64 grub2-efi-aa64-modules shim-aa64", "grub-efi-aarch64": "grub2-efi-aa64 grub2-efi-aa64-modules shim-aa64" } }, "release": { "rhel": { "9": { "grub-efi-amd64": "grub2-efi-x64 shim-x64", "grub-efi-x86_64": "grub2-efi-x64 shim-x64", "grub-efi-arm64": "grub2-efi-aa64 shim-aa64", "grub-efi-aarch64": "grub2-efi-aa64 shim-aa64" } }, "centos": { "9": { "grub-efi-amd64": "grub2-efi-x64 shim-x64", "grub-efi-x86_64": "grub2-efi-x64 shim-x64", "grub-efi-arm64": "grub2-efi-aa64 shim-aa64", "grub-efi-aarch64": "grub2-efi-aa64 shim-aa64" } } }, "default": { "dkms_package": "dkms", "extlinux": "extlinux", "grub-pc": "grub-pc", "grub-efi": "efibootmgr", "grub-efi-amd64": "grub-efi grub-pc-bin", "grub-efi-arm64": "grub-efi-arm64 grub-efi-arm64-bin", "grub-ppc64": "grub-ieee1275" } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3232365 diskimage_builder-3.42.0/diskimage_builder/elements/cache-url/0000775000175000017500000000000015201026275023207 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cache-url/README.rst0000664000175000017500000000046415201026231024672 0ustar00zuulzuul========= cache-url ========= A helper script to download images into a local cache. **NOTE** : on RedHat platforms, ensure the curl binary is available. Due to conflicting differences in platform usage of ```curl-minimal`` and ```curl``, the usual package dependency methods do not work for this package. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cache-url/__init__.py0000664000175000017500000000000015201026231025276 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3232365 diskimage_builder-3.42.0/diskimage_builder/elements/cache-url/bin/0000775000175000017500000000000015201026275023757 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cache-url/bin/cache-url0000775000175000017500000000734215201026231025546 0ustar00zuulzuul#!/bin/bash # Copyright 2012 Hewlett-Packard Development Company, L.P. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. if [ ${DIB_DEBUG_TRACE:-0} -gt 1 ]; then set -x fi set -eu set -o pipefail CURL_DASH_V='' if [ ${DIB_DEBUG_TRACE:-0} -gt 1 ]; then CURL_DASH_V='-v' fi # Download a URL to a local cache # e.g. cache-url http://.../foo ~/.cache/image-create/foo SCRIPT_NAME=$(basename $0) SCRIPT_HOME=$(dirname $0) FORCE_REVALIDATE=0 function show_options () { echo "Usage: $SCRIPT_NAME [options] " echo echo "Download a URL and cache it to a specified location." echo "Subsequent requests will compare the last modified date" echo "of the upstream file to determine whether it needs to be" echo "downloaded again." echo echo "Options:" echo " -f -- force upstream caches to fetch a new copy of the file" echo " -h -- show this help" echo exit $1 } TEMP=$(getopt -o hf -n $SCRIPT_NAME -- "$@") if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi # Note the quotes around `$TEMP': they are essential! eval set -- "$TEMP" while true ; do case "$1" in -h|"-?") show_options 0;; -f) FORCE_REVALIDATE=1; shift 1;; --) shift; break;; *) echo "Error: unsupported option $1." ; exit 1 ;; esac done url=$1 dest=$2 time_cond= curl_opts=(--retry 3 --retry-delay 30) if [ -z $url -o -z $dest ] ; then show_options 1 fi if [ -p $dest ]; then type="fifo" tmp=$(mktemp --tmpdir download.XXXXXXXX) else type="normal" mkdir -p $(dirname $dest) tmp=$(mktemp $(dirname $dest)/.download.XXXXXXXX) fi if [ "$FORCE_REVALIDATE" = "1" ]; then curl_opts+=(-H "Pragma: no-cache, must-revalidate" -H "Cache-Control: no-cache, must-revalidate") success="Downloaded and cached $url, having forced upstream caches to revalidate" elif [ -f $dest -a -s $dest ] ; then time_cond="-z $dest" success="Server copy has changed. Using server version of $url" else success="Downloaded and cached $url for the first time" fi rcode=$(curl ${CURL_DASH_V} -L -o $tmp -w '%{http_code}' --connect-timeout 10 "${curl_opts[@]}" $url $time_cond) if [ "$rcode" == "200" -o "${url:0:7}" == "file://" ] ; then # In cases where servers ignore the Modified time, # curl cancels the download, outputs a 200 and leaves # the output file untouched, we don't want this empty file. if [ -n "$time_cond" -a ! -s $tmp ] ; then echo "Ignoring empty file returned by curl. Using locally cached $url" rm -f $tmp else echo $success if [ "fifo" = "$type" ]; then cp $tmp $dest rm $tmp else mv $tmp $dest fi fi # 213 is the response to a ftp MDTM command, curl outputs a 213 as the status # if the url redirected to a ftp server and Not-Modified elif [ "$rcode" = "304" -o "$rcode" = "213" ] ; then echo "Server copy has not changed. Using locally cached $url" rm -f $tmp else echo "Server returned an unexpected response code. [$rcode]" rm -f $tmp # expose some error codes so the calling process might know what happened if [ "$rcode" = "404" ] ; then exit 44 fi exit 1 fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cache-url/element-deps0000664000175000017500000000002115201026231025475 0ustar00zuulzuulpackage-installs ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cache-url/package-installs.yaml0000664000175000017500000000000615201026231027301 0ustar00zuulzuulcurl: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cache-url/pkg-map0000664000175000017500000000025015201026231024453 0ustar00zuulzuul{ "family": { "redhat": { "curl": "" } }, "distro": { "gentoo": { "curl": "net-misc/curl" } } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3242364 diskimage_builder-3.42.0/diskimage_builder/elements/cache-url/tests/0000775000175000017500000000000015201026275024351 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cache-url/tests/__init__.py0000664000175000017500000000000015201026231026440 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cache-url/tests/test_cache_url.py0000664000175000017500000000302215201026231027674 0ustar00zuulzuul# Copyright 2014 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import os import tempfile import time from diskimage_builder.tests import base class TestCacheUrl(base.ScriptTestBase): def test_cache_url_caches(self): tempdir = tempfile.mkdtemp() target = os.path.join(tempdir, 'target') source = 'http://fake/url' # Write fake data to the target file and return success self._stub_script('curl', 'echo "test" > ${3:7:100}\necho 200') self._run_command( ['diskimage_builder/elements/cache-url/bin/cache-url', source, target]) self.assertTrue(os.path.exists(target)) modification_time = os.path.getmtime(target) # Make sure that the timestamp would change if the file does time.sleep(1) self._stub_script('curl', 'echo "304"') self._run_command( ['diskimage_builder/elements/cache-url/bin/cache-url', source, target]) self.assertEqual(modification_time, os.path.getmtime(target)) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3242364 diskimage_builder-3.42.0/diskimage_builder/elements/centos/0000775000175000017500000000000015201026275022637 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/README.rst0000664000175000017500000000233115201026231024315 0ustar00zuulzuul====== centos ====== Use CentOS cloud images as the baseline for built disk images. For further details see the redhat-common README. Environment Variables --------------------- DIB_DISTRIBUTION_MIRROR: :Required: No :Default: None :Description: To use a CentOS Yum mirror, set this variable to the mirror URL before running bin/disk-image-create. This URL should point to the directory containing the ``7/8-stream/9-stream`` directories. :Example: ``DIB_DISTRIBUTION_MIRROR=http://amirror.com/centos`` DIB_CLOUD_IMAGES: :Required: No :Description: Set the desired URL to fetch the images from. ppc64le: Currently the CentOS community is working on providing the ppc64le images. Until then you'll need to set this to a local image file. :Example: ``DIB_CLOUD_IMAGES=/path/to/my/centos/8/CentOS-8-GenericCloud-x86_64.qcow2`` DIB_RELEASE: :Required: No :Description: To override the release to build, utilize this paraemter. Presently defaults to ``9-stream``, however may be changed by diskimage-builder to newer versions *as* the distribution versions move through their lifecycle. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/element-deps0000664000175000017500000000007315201026231025134 0ustar00zuulzuulcache-url redhat-common rpm-distro source-repositories yum ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/element-provides0000664000175000017500000000002115201026231026025 0ustar00zuulzuuloperating-system ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3272367 diskimage_builder-3.42.0/diskimage_builder/elements/centos/environment.d/0000775000175000017500000000000015201026275025425 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/environment.d/10-centos-distro-name.bash0000664000175000017500000000016615201026231032210 0ustar00zuulzuulexport DISTRO_NAME=centos export DIB_RELEASE=${DIB_RELEASE:-9-stream} export EFI_BOOT_DIR="EFI/centos" export YUM=dnf ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/package-installs.yaml0000664000175000017500000000022515201026231026734 0ustar00zuulzuul# Provides device-mapper-multipath which needs to be present for # any resulting artifact to be bootable with multipathing. device-mapper-multipath: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3282366 diskimage_builder-3.42.0/diskimage_builder/elements/centos/post-install.d/0000775000175000017500000000000015201026275025512 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/post-install.d/03-reset-bls-entries0000775000175000017500000000147715201026231031230 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [[ ! '9-stream' =~ ${DIB_RELEASE} ]]; then exit 0 fi # This is a workaround for the grub issue reported upstream with # https://bugzilla.redhat.com/show_bug.cgi?id=2032680 # This renames the BLS entries from the upstream .qcow2 image in # /boot/loader/entries with the current machine-id. This means that in the # bootloader setup, grub2-mkconfig will update config options as required. pushd /boot/loader/entries machine_id=$(= 9 if [[ "${STREAM_RELEASE_VERSION}" -ge "9" ]]; then sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/centos.repo sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/centos-addons.repo # Handle metalinks and new directory structure of https://mirror.stream.centos.org/ sed -e "s,^metalink=http[s]*://mirrors.centos.org/metalink?repo=centos-baseos-.*,baseurl=$DIB_DISTRIBUTION_MIRROR/$DIB_RELEASE/BaseOS/\$basearch/os," -i /etc/yum.repos.d/centos.repo sed -e "s,^metalink=http[s]*://mirrors.centos.org/metalink?repo=centos-appstream-.*,baseurl=$DIB_DISTRIBUTION_MIRROR/$DIB_RELEASE/AppStream/\$basearch/os," -i /etc/yum.repos.d/centos.repo sed -e "s,^metalink=http[s]*://mirrors.centos.org/metalink?repo=centos-extras-sig-extras-common-.*,baseurl=$DIB_DISTRIBUTION_MIRROR/SIGs/$DIB_RELEASE/extras/\$basearch/extras-common," -i /etc/yum.repos.d/centos-addons.repo # CentOS 8-stream elif [[ "${STREAM_RELEASE_VERSION}" -eq "8" ]]; then sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Stream-BaseOS.repo sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Stream-AppStream.repo sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Stream-Extras.repo sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Stream-PowerTools.repo else sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Linux-BaseOS.repo sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Linux-AppStream.repo sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Linux-Plus.repo sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Linux-Extras.repo sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Linux-PowerTools.repo fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/pre-install.d/02-set-machine-id0000775000175000017500000000140715201026231030241 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # Set a machine-id. The .qcow2 image doesn't have one, and sometimes # one will get made (if systemd is upgraded as part of the build # process) and sometimes not. The problem is that certain kernel # install scripts bail silently without it; kernel packages end up # being installed but the initramfs etc isn't copied into place. # # Note this is cleared out in the sysprep role. # # See also: # 768c5e188c1b4bff01da14a49b96b51301db4c03 : similar thing for fedora # https://bugzilla.redhat.com/show_bug.cgi?id=1737355 : upstream bug # https://bugzilla.redhat.com/show_bug.cgi?id=1486124 : unresolved # bug about kernel install requiring machine-id systemd-machine-id-setup ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3282366 diskimage_builder-3.42.0/diskimage_builder/elements/centos/root.d/0000775000175000017500000000000015201026275024044 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/root.d/10-centos-cloud-image0000775000175000017500000000445015201026231027662 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail [ -n "$ARCH" ] [ -n "$TARGET_ROOT" ] if [[ "amd64 x86_64 arm64 aarch64 ppc64le" =~ "$ARCH" ]]; then if [[ "amd64" =~ "$ARCH" ]]; then ARCH="x86_64" elif [[ "arm64" =~ "$ARCH" ]]; then ARCH="aarch64" fi if [[ "${DIB_RELEASE}" == "9" ]]; then dib_release_path=9-stream else dib_release_path=${DIB_RELEASE} fi DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://cloud.centos.org/centos/${dib_release_path}/${ARCH}/images} else echo 'centos root element only support the x86_64, aarch64 and ppc64le values for $ARCH' exit 1 fi DIB_LOCAL_IMAGE=${DIB_LOCAL_IMAGE:-} if [ -n "$DIB_LOCAL_IMAGE" ]; then IMAGE_LOCATION=$DIB_LOCAL_IMAGE # No need to copy a local image into the cache directory, so just specify # the cached path as the original path. CACHED_IMAGE=$IMAGE_LOCATION BASE_IMAGE_FILE=$(basename $DIB_LOCAL_IMAGE) BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz else DIB_FLAVOR=${DIB_FLAVOR:-GenericCloud} if [[ "${DIB_RELEASE}" == "9" ]]; then dib_release_path=9-stream else dib_release_path=${DIB_RELEASE} fi BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$(head -1 < <(curl -s https://cloud.centos.org/centos/${dib_release_path}/${ARCH}/images/ | grep -o "CentOS-.[^>]*${DIB_FLAVOR}-.[^>]*.qcow2" | sort -r))} BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz IMAGE_LOCATION=$DIB_CLOUD_IMAGES/$BASE_IMAGE_FILE CACHED_IMAGE=$DIB_IMAGE_CACHE/$BASE_IMAGE_FILE IMAGE_SUM_FILE=$BASE_IMAGE_FILE.SHA256SUM IMAGE_SUM_LOCATION=$IMAGE_LOCATION.SHA256SUM CACHED_SUM=$DIB_IMAGE_CACHE/$IMAGE_SUM_FILE # Fetching image and its hash prior to extract-image below. # extract-image will find the cached image and continue normally. # Until extract-image also incorporates hash checking, this is the way. $TMP_HOOKS_PATH/bin/cache-url $IMAGE_LOCATION $CACHED_IMAGE $TMP_HOOKS_PATH/bin/cache-url $IMAGE_SUM_LOCATION $CACHED_SUM pushd $DIB_IMAGE_CACHE if ! sha256sum --quiet --check $CACHED_SUM ; then echo "ERROR: Image '$CACHED_IMAGE' failed sha256sum check!" exit 1 fi popd fi echo "Extracting image..." $TMP_HOOKS_PATH/bin/extract-image $BASE_IMAGE_FILE $BASE_IMAGE_TAR $IMAGE_LOCATION $CACHED_IMAGE ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2512348 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/0000775000175000017500000000000015201026275025430 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3282366 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/10-stream-build-succeeds/0000775000175000017500000000000015201026275032032 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021400000000000010212 xustar00118 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/10-stream-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/10-stream-build-succeeds/RE0000664000175000017500000000002615201026231032251 0ustar00zuulzuulCentos Stream 10 test ././@PaxHeader0000000000000000000000000000021600000000000010214 xustar00120 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/10-stream-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/10-stream-build-succeeds/el0000664000175000017500000000003615201026231032344 0ustar00zuulzuulbase block-device-mbr epel vm ././@PaxHeader0000000000000000000000000000022600000000000010215 xustar00122 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/10-stream-build-succeeds/environment.d/ 28 mtime=1778658493.3292365 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/10-stream-build-succeeds/en0000775000175000017500000000000015201026275032355 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000024200000000000010213 xustar00140 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/10-stream-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/10-stream-build-succeeds/en0000664000175000017500000000003715201026231032347 0ustar00zuulzuulexport DIB_RELEASE='10-stream' ././@PaxHeader0000000000000000000000000000022500000000000010214 xustar00127 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/10-stream-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/10-stream-build-succeeds/te0000664000175000017500000000000515201026231032350 0ustar00zuulzuulqcow2././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3292365 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-build-succeeds/0000775000175000017500000000000015201026275030470 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-build-succeeds/README.rst0000664000175000017500000000001615201026231032144 0ustar00zuulzuulCentos 8 test ././@PaxHeader0000000000000000000000000000020600000000000010213 xustar00112 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-build-succeeds/element-de0000664000175000017500000000003715201026231032422 0ustar00zuulzuulbase epel openstack-ci-mirrors ././@PaxHeader0000000000000000000000000000021600000000000010214 xustar00114 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-build-succeeds/environment.d/ 28 mtime=1778658493.3292365 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-build-succeeds/environmen0000775000175000017500000000000015201026275032571 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023200000000000010212 xustar00132 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-build-succeeds/environmen0000664000175000017500000000002715201026231032562 0ustar00zuulzuulexport DIB_RELEASE='8' ././@PaxHeader0000000000000000000000000000021500000000000010213 xustar00119 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-build-succeeds/test-outpu0000664000175000017500000000000515201026231032527 0ustar00zuulzuulqcow2././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3292365 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-stream-build-succeeds/0000775000175000017500000000000015201026275031761 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-stream-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-stream-build-succeeds/REA0000664000175000017500000000002515201026231032300 0ustar00zuulzuulCentos Stream 8 test ././@PaxHeader0000000000000000000000000000021500000000000010213 xustar00119 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-stream-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-stream-build-succeeds/ele0000664000175000017500000000003715201026231032441 0ustar00zuulzuulbase epel openstack-ci-mirrors ././@PaxHeader0000000000000000000000000000022500000000000010214 xustar00121 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-stream-build-succeeds/environment.d/ 28 mtime=1778658493.3302367 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-stream-build-succeeds/env0000775000175000017500000000000015201026275032472 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000024100000000000010212 xustar00139 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-stream-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-stream-build-succeeds/env0000664000175000017500000000003615201026231032463 0ustar00zuulzuulexport DIB_RELEASE='8-stream' ././@PaxHeader0000000000000000000000000000022400000000000010213 xustar00126 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-stream-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/8-stream-build-succeeds/tes0000664000175000017500000000000515201026231032462 0ustar00zuulzuulqcow2././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3302367 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/9-stream-build-succeeds/0000775000175000017500000000000015201026275031762 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/9-stream-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/9-stream-build-succeeds/REA0000664000175000017500000000002515201026231032301 0ustar00zuulzuulCentos Stream 9 test ././@PaxHeader0000000000000000000000000000021500000000000010213 xustar00119 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/9-stream-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/9-stream-build-succeeds/ele0000664000175000017500000000006315201026231032441 0ustar00zuulzuulbase block-device-mbr epel openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000022500000000000010214 xustar00121 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/9-stream-build-succeeds/environment.d/ 28 mtime=1778658493.3302367 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/9-stream-build-succeeds/env0000775000175000017500000000000015201026275032473 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000024100000000000010212 xustar00139 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/9-stream-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/9-stream-build-succeeds/env0000664000175000017500000000003615201026231032464 0ustar00zuulzuulexport DIB_RELEASE='9-stream' ././@PaxHeader0000000000000000000000000000022400000000000010213 xustar00126 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/9-stream-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos/test-elements/9-stream-build-succeeds/tes0000664000175000017500000000000515201026231032463 0ustar00zuulzuulqcow2././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3242364 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/0000775000175000017500000000000015201026275024263 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/README.rst0000664000175000017500000000054415201026231025745 0ustar00zuulzuul============== centos-minimal ============== Create a minimal image based on CentOS Use of this element will require 'yum' and 'yum-utils' to be installed on Ubuntu and Debian. Nothing additional is needed on Fedora or CentOS. By default this builds CentOS-Stream 9 images. Set ``DIB_RELEASE`` to ``8`` or ``8-stream`` to explicitly select the release. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/element-deps0000664000175000017500000000001515201026231026554 0ustar00zuulzuulyum-minimal ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/element-provides0000664000175000017500000000002115201026231027451 0ustar00zuulzuuloperating-system ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3242364 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/environment.d/0000775000175000017500000000000015201026275027051 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/environment.d/10-centos-distro-name.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/environment.d/10-centos-distro-na0000664000175000017500000000030615201026231032372 0ustar00zuulzuulexport DISTRO_NAME=centos export DIB_RELEASE=${DIB_RELEASE:-9-stream} export EFI_BOOT_DIR="EFI/centos" export YUM=dnf export DIB_YUM_MINIMAL_CREATE_INTERFACES=${DIB_YUM_MINIMAL_CREATE_INTERFACES:-0}././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2502348 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/0000775000175000017500000000000015201026275027054 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023000000000000010210 xustar00124 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-aarch64-build-succeeds/ 28 mtime=1778658493.3252366 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-aarch64-b0000775000175000017500000000000015201026275032153 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023400000000000010214 xustar00134 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-aarch64-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-aarch64-b0000664000175000017500000000005415201026231032144 0ustar00zuulzuulVerify we can build a centos-minimal image. ././@PaxHeader0000000000000000000000000000023600000000000010216 xustar00136 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-aarch64-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-aarch64-b0000664000175000017500000000002415201026231032141 0ustar00zuulzuulblock-device-efi vm ././@PaxHeader0000000000000000000000000000024600000000000010217 xustar00138 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-aarch64-build-succeeds/environment.d/ 28 mtime=1778658493.3252366 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-aarch64-b0000775000175000017500000000000015201026275032153 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000026200000000000010215 xustar00156 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-aarch64-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-aarch64-b0000664000175000017500000000003715201026231032145 0ustar00zuulzuulexport DIB_RELEASE='10-stream' ././@PaxHeader0000000000000000000000000000022000000000000010207 xustar00116 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-build-succeeds/ 28 mtime=1778658493.3252366 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-build-suc0000775000175000017500000000000015201026275032373 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022400000000000010213 xustar00126 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-build-suc0000664000175000017500000000005415201026231032364 0ustar00zuulzuulVerify we can build a centos-minimal image. ././@PaxHeader0000000000000000000000000000022600000000000010215 xustar00128 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-build-suc0000664000175000017500000000002415201026231032361 0ustar00zuulzuulblock-device-efi vm ././@PaxHeader0000000000000000000000000000023600000000000010216 xustar00130 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-build-succeeds/environment.d/ 28 mtime=1778658493.3252366 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-build-suc0000775000175000017500000000000015201026275032373 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000025200000000000010214 xustar00148 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/10-stream-build-suc0000664000175000017500000000003715201026231032365 0ustar00zuulzuulexport DIB_RELEASE='10-stream' ././@PaxHeader0000000000000000000000000000022700000000000010216 xustar00123 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-aarch64-build-succeeds/ 28 mtime=1778658493.3252366 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-aarch64-bu0000775000175000017500000000000015201026275032267 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023300000000000010213 xustar00133 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-aarch64-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-aarch64-bu0000664000175000017500000000022515201026231032260 0ustar00zuulzuulVerify we can build a centos-minimal image. Note this test includes the vm element to test the bootloader install, and specifies to output a .qcow2 ././@PaxHeader0000000000000000000000000000023500000000000010215 xustar00135 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-aarch64-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-aarch64-bu0000664000175000017500000000005115201026231032255 0ustar00zuulzuulblock-device-efi openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000024500000000000010216 xustar00137 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-aarch64-build-succeeds/environment.d/ 28 mtime=1778658493.3262365 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-aarch64-bu0000775000175000017500000000000015201026275032267 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000026100000000000010214 xustar00155 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-aarch64-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-aarch64-bu0000664000175000017500000000003415201026231032256 0ustar00zuulzuulexport DIB_RELEASE=8-stream ././@PaxHeader0000000000000000000000000000024400000000000010215 xustar00142 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-aarch64-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-aarch64-bu0000664000175000017500000000001115201026231032251 0ustar00zuulzuultar,qcow2././@PaxHeader0000000000000000000000000000021700000000000010215 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-build-succeeds/ 28 mtime=1778658493.3262365 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-build-succ0000775000175000017500000000000015201026275032465 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022300000000000010212 xustar00125 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-build-succ0000664000175000017500000000005415201026231032456 0ustar00zuulzuulVerify we can build a centos-minimal image. ././@PaxHeader0000000000000000000000000000022500000000000010214 xustar00127 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-build-succ0000664000175000017500000000002415201026231032453 0ustar00zuulzuulopenstack-ci-mirrors././@PaxHeader0000000000000000000000000000023500000000000010215 xustar00129 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-build-succeeds/environment.d/ 28 mtime=1778658493.3262365 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-build-succ0000775000175000017500000000000015201026275032465 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000025100000000000010213 xustar00147 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-build-succeeds/environment.d/09-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/8-stream-build-succ0000664000175000017500000000003615201026231032456 0ustar00zuulzuulexport DIB_RELEASE='8-stream' ././@PaxHeader0000000000000000000000000000022700000000000010216 xustar00123 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-aarch64-build-succeeds/ 28 mtime=1778658493.3262365 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-aarch64-bu0000775000175000017500000000000015201026275032270 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023300000000000010213 xustar00133 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-aarch64-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-aarch64-bu0000664000175000017500000000005415201026231032261 0ustar00zuulzuulVerify we can build a centos-minimal image. ././@PaxHeader0000000000000000000000000000023500000000000010215 xustar00135 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-aarch64-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-aarch64-bu0000664000175000017500000000005115201026231032256 0ustar00zuulzuulblock-device-efi openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000024500000000000010216 xustar00137 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-aarch64-build-succeeds/environment.d/ 28 mtime=1778658493.3262365 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-aarch64-bu0000775000175000017500000000000015201026275032270 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000026100000000000010214 xustar00155 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-aarch64-build-succeeds/environment.d/09-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-aarch64-bu0000664000175000017500000000003615201026231032261 0ustar00zuulzuulexport DIB_RELEASE='9-stream' ././@PaxHeader0000000000000000000000000000021700000000000010215 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-build-succeeds/ 28 mtime=1778658493.3272367 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-build-succ0000775000175000017500000000000015201026275032466 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022300000000000010212 xustar00125 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-build-succ0000664000175000017500000000005415201026231032457 0ustar00zuulzuulVerify we can build a centos-minimal image. ././@PaxHeader0000000000000000000000000000022500000000000010214 xustar00127 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-build-succ0000664000175000017500000000002515201026231032455 0ustar00zuulzuulopenstack-ci-mirrors ././@PaxHeader0000000000000000000000000000023500000000000010215 xustar00129 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-build-succeeds/environment.d/ 28 mtime=1778658493.3272367 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-build-succ0000775000175000017500000000000015201026275032466 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000025100000000000010213 xustar00147 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-build-succeeds/environment.d/09-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/test-elements/9-stream-build-succ0000664000175000017500000000003615201026231032457 0ustar00zuulzuulexport DIB_RELEASE='9-stream' ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2502348 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/yum.repos.d/0000775000175000017500000000000015201026275026446 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3272367 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/yum.repos.d/10-stream/0000775000175000017500000000000015201026275030157 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/yum.repos.d/10-stream/appstream.repo 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/yum.repos.d/10-stream/appstream.r0000664000175000017500000000040715201026231032327 0ustar00zuulzuul[appstream] name=CentOS Stream 10 - AppStream metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-10-stream&arch=$basearch gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 metadata_expire=6h countme=1 enabled=1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/yum.repos.d/10-stream/base.repo0000664000175000017500000000037615201026231031756 0ustar00zuulzuul[baseos] name=CentOS Stream 10 - BaseOS metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-10-stream&arch=$basearch gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 metadata_expire=6h countme=1 enabled=1 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3272367 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/yum.repos.d/8-stream/0000775000175000017500000000000015201026275030106 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020600000000000010213 xustar00112 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/yum.repos.d/8-stream/appstream.repo 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/yum.repos.d/8-stream/appstream.re0000664000175000017500000000022615201026231032422 0ustar00zuulzuul[Stream-AppStream] name=CentOS-Stream - AppStream mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=AppStream gpgcheck=0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/yum.repos.d/8-stream/base.repo0000664000175000017500000000021315201026231031673 0ustar00zuulzuul[Stream-BaseOS] name=CentOS-Stream - Base mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=BaseOS gpgcheck=0 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3272367 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/yum.repos.d/9-stream/0000775000175000017500000000000015201026275030107 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020600000000000010213 xustar00112 path=diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/yum.repos.d/9-stream/appstream.repo 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/yum.repos.d/9-stream/appstream.re0000664000175000017500000000040515201026231032422 0ustar00zuulzuul[appstream] name=CentOS Stream 9 - AppStream metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-9-stream&arch=$basearch gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=0 repo_gpgcheck=0 metadata_expire=6h countme=1 enabled=1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/centos-minimal/yum.repos.d/9-stream/base.repo0000664000175000017500000000037415201026231031704 0ustar00zuulzuul[baseos] name=CentOS Stream 9 - BaseOS metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream&arch=$basearch gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=0 repo_gpgcheck=0 metadata_expire=6h countme=1 enabled=1 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3302367 diskimage_builder-3.42.0/diskimage_builder/elements/cleanup-kernel-initrd/0000775000175000017500000000000015201026275025540 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cleanup-kernel-initrd/README.rst0000664000175000017500000000015615201026231027221 0ustar00zuulzuul===================== cleanup-kernel-initrd ===================== Remove unused kernel/initrd from the image. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3302367 diskimage_builder-3.42.0/diskimage_builder/elements/cleanup-kernel-initrd/cleanup.d/0000775000175000017500000000000015201026275027411 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021400000000000010212 xustar00118 path=diskimage_builder-3.42.0/diskimage_builder/elements/cleanup-kernel-initrd/cleanup.d/99-cleanup-kernel-initrd 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cleanup-kernel-initrd/cleanup.d/99-cleanup-kerne0000775000175000017500000000303015201026231032313 0ustar00zuulzuul#!/bin/bash # # Copyright 2014 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail source $_LIB/img-functions function cleanup_old_kernel_initrd() { KERNEL_VERSION=${KERNEL#vmlinuz-} if [ -n "${BOOTDIR}" ] ; then for file in `ls $BOOTDIR/vmlinuz-* | grep -v $KERNEL_VERSION | grep -v debug` do echo "Removing unnecessary kernels and ramdisk images from image." file=$(basename $file) rm -Rvf $BOOTDIR/*${file#vmlinuz-}* done fi } # Dig up the initrd and kernel. select_boot_kernel_initrd $TARGET_ROOT BOOTDIR=$TARGET_ROOT/boot # Select_boot_kernel has support for redhat/debian/openSUSE # openSUSE has a built-in logic to delete old kernels # Hence cleanup_old_kernel will be used only for redhat and debian derived distros. if [ -f $TARGET_ROOT/etc/redhat-release -o -f $TARGET_ROOT/etc/debian_version ] ; then cleanup_old_kernel_initrd fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3312366 diskimage_builder-3.42.0/diskimage_builder/elements/cloud-init/0000775000175000017500000000000015201026275023413 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cloud-init/README.rst0000664000175000017500000000061215201026231025071 0ustar00zuulzuul========== cloud-init ========== Install's and enables cloud-init for systems that don't come with it pre-installed Currently only supports Gentoo. Environment Variables --------------------- DIB_CLOUD_INIT_ALLOW_SSH_PWAUTH :Required: No :Default: password authentication disabled when cloud-init installed :Description: customize cloud-init to allow ssh password authentication. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cloud-init/element-deps0000664000175000017500000000002115201026231025701 0ustar00zuulzuulpackage-installs ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cloud-init/package-installs.yaml0000664000175000017500000000001415201026231027504 0ustar00zuulzuulcloud-init: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cloud-init/pkg-map0000664000175000017500000000013315201026231024657 0ustar00zuulzuul{ "family": { "gentoo": { "cloud-init": "app-emulation/cloud-init" } } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3332367 diskimage_builder-3.42.0/diskimage_builder/elements/cloud-init/post-install.d/0000775000175000017500000000000015201026275026266 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cloud-init/post-install.d/20-enable-cloud-init0000775000175000017500000000133215201026231031715 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # gentoo if [[ "${DIB_INIT_SYSTEM}" == "openrc" ]]; then rc-update add cloud-config default rc-update add cloud-final default rc-update add cloud-init-local boot rc-update add cloud-init default fi if [[ "${DIB_INIT_SYSTEM}" == "systemd" ]]; then systemctl enable cloud-config.service systemctl enable cloud-final.service systemctl enable cloud-init-local.service if ! [[ $DIB_RELEASE =~ ^(testing|trixie|unstable|stable|resolute) ]]; then systemctl enable cloud-init.service else systemctl enable cloud-init-main.service systemctl enable cloud-init-network.service fi fi ././@PaxHeader0000000000000000000000000000021700000000000010215 xustar00121 path=diskimage_builder-3.42.0/diskimage_builder/elements/cloud-init/post-install.d/21-cloud-init-allow-password-auth 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cloud-init/post-install.d/21-cloud-init-allow-pa0000775000175000017500000000137715201026231032215 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # Set cloud-init to allow password authentication if [ -n "${DIB_CLOUD_INIT_ALLOW_SSH_PWAUTH:-}" ]; then if [ -f "/etc/cloud/cloud.cfg" ]; then if [ -z "$(grep ssh_pwauth /etc/cloud/cloud.cfg)" ]; then echo "ssh_pwauth not exist. append to EOF" echo "ssh_pwauth: 1" >> /etc/cloud/cloud.cfg else echo "ssh_pwauth exist. make sure ssh_pwauth enabled" sed -i -e 's/ssh_pwauth: *0/ssh_pwauth: 1/g' /etc/cloud/cloud.cfg sed -i -e 's/ssh_pwauth: *False/ssh_pwauth: True/g' /etc/cloud/cloud.cfg sed -i -e 's/ssh_pwauth: *false/ssh_pwauth: true/g' /etc/cloud/cloud.cfg fi fi fi ././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/cloud-init/post-install.d/22-cloud-init-ssh_genkeytypes 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cloud-init/post-install.d/22-cloud-init-ssh_genk0000775000175000017500000000064015201026231032273 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # Set cloud-init to generate ssh authkeys if [ -f "/etc/cloud/cloud.cfg" ]; then echo "Ensure ssh_genkeytypes is not present" sudo sed -i '/ssh_genkeytypes/d' /etc/cloud/cloud.cfg echo "Ensure ssh_genkeytypes value" echo "ssh_genkeytypes: ['rsa', 'ecdsa', 'ed25519']" | sudo tee -a /etc/cloud/cloud.cfg fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3312366 diskimage_builder-3.42.0/diskimage_builder/elements/cloud-init-datasources/0000775000175000017500000000000015201026275025726 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cloud-init-datasources/README.rst0000664000175000017500000000252515201026231027411 0ustar00zuulzuul====================== cloud-init-datasources ====================== Configures cloud-init to only use an explicit list of data sources. Cloud-init contains a growing collection of data source modules and most are enabled by default. This causes cloud-init to query each data source on first boot. This can cause delays or even boot problems depending on your environment. Including this element without setting `DIB_CLOUD_INIT_DATASOURCES` will cause image builds to fail. Environment Variables --------------------- DIB_CLOUD_INIT_DATASOURCES :Required: Yes :Default: None :Description: A comma-separated list of valid data sources to limit the data sources that will be queried for metadata on first boot. :Example: ``DIB_CLOUD_INIT_DATASOURCES="Ec2"`` will enable only the Ec2 data source. :Example: ``DIB_CLOUD_INIT_DATASOURCES="Ec2, ConfigDrive, OpenStack"`` will enable the Ec2, ConfigDrive and OpenStack data sources. .. warning:: Use of the ConfigDrive data source is only considered, by default, for initial network configuration per cloud-init documentation. It is recommended that you utilize ``OpenStack`` in addition to ``ConfigDrive`` to collect all available metadata and configuration. As a result of configuration drive use, cloud-init's automatic metadata discovery network activation is disabled. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3312366 diskimage_builder-3.42.0/diskimage_builder/elements/cloud-init-datasources/install.d/0000775000175000017500000000000015201026275027616 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021600000000000010214 xustar00120 path=diskimage_builder-3.42.0/diskimage_builder/elements/cloud-init-datasources/install.d/05-set-cloud-init-sources 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/cloud-init-datasources/install.d/05-set-cloud-in0000775000175000017500000000405615201026231032266 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail DIB_CLOUD_INIT_DATASOURCES=${DIB_CLOUD_INIT_DATASOURCES:-""} # NOTE(TheJulia): If your looking at slightly more exotic configuration, the # following links may be wortwhile to review. Specifically: ConfigDrive is just # initial datasource configuration, and fallback network configuration basically # always happens. Plus, cloud-init by default ignores other data in the # configuration drive unless "openstack" is referenced. :\ # https://cloudinit.readthedocs.io/en/latest/reference/datasources/configdrive.html # https://cloudinit.readthedocs.io/en/latest/reference/datasources/openstack.html#openstack-ironic-bare-metal if [ -z "$DIB_CLOUD_INIT_DATASOURCES" ] ; then echo "DIB_CLOUD_INIT_DATASOURCES must be set to a comma-separated list " echo "of cloud-init data sources you wish to use, ie 'Ec2, NoCloud, ConfigDrive'" exit 1 fi if [ -d /etc/cloud/cloud.cfg.d ]; then cat > /etc/cloud/cloud.cfg.d/91-dib-cloud-init-datasources.cfg < /etc/cloud/cloud.cfg.d/92-ec2-datasource.cfg < /etc/cloud/cloud.cfg.d/93-dib-cloud-init-disable-datasource-network-activation.cfg < /etc/cloud/cloud.cfg.d/55-growpart.cfg </dev/null 2>&1 && pwd )" path="$( dirname $path)" export DIB_CONTAINERFILE_DOCKERFILE="$path/files/Dockerfile" ././@PaxHeader0000000000000000000000000000022100000000000010210 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/containerfile/test-elements/jammy-build-succeeds/files/ 28 mtime=1778658493.3342366 diskimage_builder-3.42.0/diskimage_builder/elements/containerfile/test-elements/jammy-build-succeeds0000775000175000017500000000000015201026275032706 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022500000000000010214 xustar00127 path=diskimage_builder-3.42.0/diskimage_builder/elements/containerfile/test-elements/jammy-build-succeeds/files/Dockerfile 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/containerfile/test-elements/jammy-build-succeeds0000664000175000017500000000007415201026231032701 0ustar00zuulzuulFROM quay.io/opendevmirror/ubuntu:22.04 RUN touch /testfile ././@PaxHeader0000000000000000000000000000023000000000000010210 xustar00130 path=diskimage_builder-3.42.0/diskimage_builder/elements/containerfile/test-elements/jammy-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/containerfile/test-elements/jammy-build-succeeds0000664000175000017500000000000415201026231032672 0ustar00zuulzuultar ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3352368 diskimage_builder-3.42.0/diskimage_builder/elements/debian/0000775000175000017500000000000015201026275022566 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian/README.rst0000664000175000017500000000074515201026231024253 0ustar00zuulzuul====== debian ====== This element is based on ``debian-minimal`` with ``cloud-init`` and related tools installed. This produces something more like a standard upstream cloud image. By default this element creates the latest stable release. The exact setting can be found in the ``debian-minimal/environment.d`` directory in the variable ``DIB_RELEASE``. If a different release of Debian should be created, the variable ``DIB_RELEASE`` can be set appropriately. .. element_deps:: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian/element-deps0000664000175000017500000000004615201026231025063 0ustar00zuulzuuldebian-minimal openssh-server sysprep ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.337237 diskimage_builder-3.42.0/diskimage_builder/elements/debian/install.d/0000775000175000017500000000000015201026275024456 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian/install.d/10-cloud-opinions0000775000175000017500000000346515201026231027564 0ustar00zuulzuul#!/bin/bash # # Copyright 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail case "${DIB_RELEASE}" in hamm|slink|potato|woody|sarge|etch|lenny|squeeze|wheezy) DIB_DEBIAN_ALT_INIT_PACKAGE=${DIB_DEBIAN_ALT_INIT_PACKAGE:-sysvinit} DIB_DEBIAN_CLOUD_INIT_HELPER=${DIB_DEBIAN_CLOUD_INIT_HELPER:-'true'} ;; *) DIB_DEBIAN_ALT_INIT_PACKAGE=${DIB_DEBIAN_ALT_INIT_PACKAGE:-systemd-sysv} ;; esac if [ -n "${DIB_DEBIAN_CLOUD_INIT_HELPER:-}" ]; then adduser --gecos Debian-cloud-init-user --disabled-password --quiet debian install -d -m 0755 -o root -g root /etc/sudoers.d echo 'debian ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/debian-cloud-init chmod 0440 /etc/sudoers.d/debian-cloud-init fi if [ "$DIB_DEBIAN_ALT_INIT_PACKAGE" != "sysvinit" ]; then # To avoid a conflict against an essential package, we need to remove sysvinit first dpkg --purge --force remove-essential sysvinit apt-get install -y $DIB_DEBIAN_ALT_INIT_PACKAGE printf "Package: sysvinit\nPin: origin \"\"\nPin-Priority: -1\n" > \ /etc/apt/preferences.d/sysvinit fi case "${DIB_RELEASE}" in bookworm|stable|testing) apt-get install -y netplan.io ;; esac ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian/package-installs.yaml0000664000175000017500000000021415201026231026661 0ustar00zuulzuulfile: less: kbd: curl: rsync: bash-completion: isc-dhcp-client: net-tools: cloud-init: cloud-utils: cloud-initramfs-growroot: dialog: cron: ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.255235 diskimage_builder-3.42.0/diskimage_builder/elements/debian/test-elements/0000775000175000017500000000000015201026275025357 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.337237 diskimage_builder-3.42.0/diskimage_builder/elements/debian/test-elements/build-succeeds/0000775000175000017500000000000015201026275030252 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian/test-elements/build-succeeds/README.rst0000664000175000017500000000006415201026231031731 0ustar00zuulzuulTest that we can successfully build a debian image. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian/test-elements/build-succeeds/element-deps0000664000175000017500000000000515201026231032542 0ustar00zuulzuulbase ././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00112 path=diskimage_builder-3.42.0/diskimage_builder/elements/debian/test-elements/build-succeeds/environment.d/ 27 mtime=1778658493.337237 diskimage_builder-3.42.0/diskimage_builder/elements/debian/test-elements/build-succeeds/environment.0000775000175000017500000000000015201026275032615 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022600000000000010215 xustar00128 path=diskimage_builder-3.42.0/diskimage_builder/elements/debian/test-elements/build-succeeds/environment.d/09-debian-stable 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian/test-elements/build-succeeds/environment.0000664000175000017500000000025415201026231032610 0ustar00zuulzuul# We don't want to build against Debian unstable # (Needs to be a 09- because must be executed before # debian-minimal 10-debian-minimal.bash.) export DIB_RELEASE="stable" ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3352368 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/0000775000175000017500000000000015201026275024212 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/README.rst0000664000175000017500000000176315201026231025700 0ustar00zuulzuul============== debian-minimal ============== The ``debian-minimal`` element uses debootstrap for generating a minimal image. By default this element creates the latest stable release. The exact setting can be found in the element's ``environment.d`` directory in the variable ``DIB_RELEASE``. If a different release of Debian should be created, the variable ``DIB_RELEASE`` can be set appropriately. Note that this element installs ``systemd-sysv`` as the init system The element obeys the ``DIB_DISTRIBUTION_MIRROR`` argument for mirroring (see ``debootsrap`` element documentation). However, the security repositories are separate for Debian, so we can not assume they exist at ``DIB_DISTRIBUTION_MIRROR``. If you do not wish to use the upstream repository (from ``security.debian.org``) override it with ``DIB_DEBIAN_SECURITY_MIRROR``. The security suite name's subpath can also be overridden to something other than ``/updates`` with the ``DIB_DEBIAN_SECURITY_SUBPATH`` variable. .. element_deps:: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/element-deps0000664000175000017500000000002415201026231026503 0ustar00zuulzuuldebootstrap pkg-map ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/element-provides0000664000175000017500000000002115201026231027400 0ustar00zuulzuuloperating-system ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3352368 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/environment.d/0000775000175000017500000000000015201026275027000 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/environment.d/10-debian-minimal.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/environment.d/10-debian-minimal.b0000664000175000017500000000272215201026231032222 0ustar00zuulzuulexport DISTRO_NAME=debian export DIB_RELEASE=${DIB_RELEASE:-stable} export DIB_INIT_SYSTEM=systemd export EFI_BOOT_DIR="EFI/debian" if [ -n "${DIB_DEBIAN_DISTRIBUTION_MIRROR:-}" ]; then DIB_DISTRIBUTION_MIRROR=$DIB_DEBIAN_DISTRIBUTION_MIRROR fi export DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-http://deb.debian.org/debian} # With Debian, security is in a different repository. We can't, say, # assume "${DIB_DISTRIBUTION_MIRROR}-security" is valid. The only # choice is for people to add it separately, otherwise we use # upstream. DIB_DEBIAN_SECURITY_MIRROR=${DIB_DEBIAN_SECURITY_MIRROR:-http://security.debian.org/} export DIB_DEBIAN_COMPONENTS=${DIB_DEBIAN_COMPONENTS:-main} export DIB_DEBIAN_COMPONENTS_WS=${DIB_DEBIAN_COMPONENTS//,/ } DIB_DEBIAN_SECURITY_PATH="${DIB_RELEASE}-security" DIB_DEBIAN_SECURITY_SUBPATH=${DIB_DEBIAN_SECURITY_SUBPATH:-} DIB_APT_SOURCES_CONF_DEFAULT=\ "default:deb ${DIB_DISTRIBUTION_MIRROR} ${DIB_RELEASE} ${DIB_DEBIAN_COMPONENTS_WS} updates:deb ${DIB_DISTRIBUTION_MIRROR} ${DIB_RELEASE}-updates ${DIB_DEBIAN_COMPONENTS_WS} security:deb ${DIB_DEBIAN_SECURITY_MIRROR} ${DIB_DEBIAN_SECURITY_PATH}${DIB_DEBIAN_SECURITY_SUBPATH} ${DIB_DEBIAN_COMPONENTS_WS} " if [ "${DIB_RELEASE}" = "testing" -o "${DIB_RELEASE}" = "unstable" ]; then DIB_APT_SOURCES_CONF_DEFAULT="default:deb ${DIB_DISTRIBUTION_MIRROR} ${DIB_RELEASE} ${DIB_DEBIAN_COMPONENTS_WS}" fi export DIB_APT_SOURCES_CONF=${DIB_APT_SOURCES_CONF:-${DIB_APT_SOURCES_CONF_DEFAULT}} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/package-installs.yaml0000664000175000017500000000011315201026231030303 0ustar00zuulzuullinux-image-amd64: arch: amd64 linux-image-arm64: arch: arm64 netbase: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3352368 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/root.d/0000775000175000017500000000000015201026275025417 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/root.d/75-debian-minimal-baseinstall 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/root.d/75-debian-minimal-baseinst0000775000175000017500000000460615201026231032250 0ustar00zuulzuul#!/bin/bash # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # Copyright (c) 2016 Andreas Florath (andreas@florath.net) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. # dib-lint: disable=safe_sudo if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # NOTE(SamYaple): Add the keyring deboostrap used if specified if [ -n "${DIB_APT_KEYRING:-${DIB_DEBIAN_KEYRING:-}}" ]; then cat $DIB_APT_KEYRING | sudo chroot $TARGET_ROOT /usr/bin/apt-key add - fi # Writes the apt sources files. # The description is passed in via line coded elements. # (The approach using associative arrays for configuration faild, # because it looks that there is no way to handle defaults in # this case - and additionally we run with '-u'.) function apt_sources_write { local APT_SOURCES_CONF="$1" sudo mkdir -p $TARGET_ROOT/etc/apt/sources.list.d echo "${APT_SOURCES_CONF}" \ | while read line; do local name=$(echo ${line} | cut -d ":" -f 1) local value=$(echo ${line} | cut -d ":" -f 2-) echo "$value" | sudo tee $TARGET_ROOT/etc/apt/sources.list.d/${name}.list done } sudo mount -t proc none $TARGET_ROOT/proc sudo mount -o ro -t sysfs none $TARGET_ROOT/sys trap "sudo umount $TARGET_ROOT/proc; sudo umount $TARGET_ROOT/sys" EXIT apt_get="sudo chroot $TARGET_ROOT /usr/bin/apt-get" apt_sources_write "${DIB_APT_SOURCES_CONF}" # Need to update to retrieve the signed Release file $apt_get update $apt_get clean $apt_get dist-upgrade -y to_install="" # pre-stretch (9.0) brought this in via debootstrap, but init # dependencies have narrowed in the container world, so now we add it # explicitly here so it's brought in early. to_install+="systemd-sysv " # default required to_install+="busybox sudo " # required for dpkg element to be able to add apt keys to_install+="gnupg2 " to_install+="python3 " $apt_get install -y $to_install ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.254235 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/0000775000175000017500000000000015201026275027003 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022500000000000010214 xustar00121 path=diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bookworm-arm64-build-succeeds/ 28 mtime=1778658493.3352368 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bookworm-arm64-buil0000775000175000017500000000000015201026275032443 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023100000000000010211 xustar00131 path=diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bookworm-arm64-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bookworm-arm64-buil0000664000175000017500000000006315201026231032434 0ustar00zuulzuulVerify we can build a debian-minimal stable image. ././@PaxHeader0000000000000000000000000000023300000000000010213 xustar00133 path=diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bookworm-arm64-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bookworm-arm64-buil0000664000175000017500000000002415201026231032431 0ustar00zuulzuulblock-device-efi vm ././@PaxHeader0000000000000000000000000000024300000000000010214 xustar00135 path=diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bookworm-arm64-build-succeeds/environment.d/ 28 mtime=1778658493.3362367 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bookworm-arm64-buil0000775000175000017500000000000015201026275032443 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000025700000000000010221 xustar00153 path=diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bookworm-arm64-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bookworm-arm64-buil0000664000175000017500000000003415201026231032432 0ustar00zuulzuulexport DIB_RELEASE=bookworm ././@PaxHeader0000000000000000000000000000022500000000000010214 xustar00121 path=diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bullseye-arm64-build-succeeds/ 28 mtime=1778658493.3362367 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bullseye-arm64-buil0000775000175000017500000000000015201026275032430 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023100000000000010211 xustar00131 path=diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bullseye-arm64-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bullseye-arm64-buil0000664000175000017500000000006315201026231032421 0ustar00zuulzuulVerify we can build a debian-minimal stable image. ././@PaxHeader0000000000000000000000000000023300000000000010213 xustar00133 path=diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bullseye-arm64-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bullseye-arm64-buil0000664000175000017500000000002415201026231032416 0ustar00zuulzuulblock-device-efi vm ././@PaxHeader0000000000000000000000000000024300000000000010214 xustar00135 path=diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bullseye-arm64-build-succeeds/environment.d/ 28 mtime=1778658493.3362367 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bullseye-arm64-buil0000775000175000017500000000000015201026275032430 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000025700000000000010221 xustar00153 path=diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bullseye-arm64-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-minimal/test-elements/bullseye-arm64-buil0000664000175000017500000000003415201026231032417 0ustar00zuulzuulexport DIB_RELEASE=bullseye ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3362367 diskimage_builder-3.42.0/diskimage_builder/elements/debian-systemd/0000775000175000017500000000000015201026275024254 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-systemd/README.rst0000664000175000017500000000067215201026231025740 0ustar00zuulzuul============== debian-systemd ============== Debian used `sysvinit` by default till the `wheezy` release. If you want to use `systemd` instead of the classic sysv init system on images up to `wheezy`, include this element in your element list. For `jessie` onwards, this element is redundant, use a regular debian or `debian-minimal`. Note that this works with the ``debian`` element, not the ``debian-minimal`` element. .. element_deps:: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-systemd/element-deps0000664000175000017500000000000715201026231026546 0ustar00zuulzuuldebian ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3362367 diskimage_builder-3.42.0/diskimage_builder/elements/debian-systemd/root.d/0000775000175000017500000000000015201026275025461 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-systemd/root.d/05-debian-systemd0000775000175000017500000000031315201026231030526 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail cat << EOF | sudo tee ${TARGET_ROOT}/.extra_settings > /dev/null DIB_DEBIAN_ALT_INIT_PACKAGE=systemd-sysv EOF ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3362367 diskimage_builder-3.42.0/diskimage_builder/elements/debian-upstart/0000775000175000017500000000000015201026275024266 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-upstart/README.rst0000664000175000017500000000054615201026231025752 0ustar00zuulzuul============== debian-upstart ============== By default Debian will use sysvinit for booting. If you want to experiment with Upstart, or have need of it due to a need for upstart jobs, this element will build the image with upstart as the init system. Note that this works with the ``debian`` element, not the ``debian-minimal`` element. .. element_deps:: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-upstart/element-deps0000664000175000017500000000000715201026231026560 0ustar00zuulzuuldebian ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.337237 diskimage_builder-3.42.0/diskimage_builder/elements/debian-upstart/root.d/0000775000175000017500000000000015201026275025473 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-upstart/root.d/05-debian-upstart0000775000175000017500000000026115201026231030554 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail cat > ${TARGET_ROOT}/.extra_settings << EOF DIB_DEBIAN_ALT_INIT_PACKAGE=upstart EOF ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debian-upstart/root.d/20-debian-fix-upstart-jobs0000775000175000017500000000131015201026231032264 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail # Working around bug in Debian cloud-init packages with upstart # where startpar will wait forever for these because they are tasks # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=735204 for sysv_script in cloud-init cloud-init-local cloud-config cloud-final ; do sudo rm -f ${TARGET_ROOT}/etc/rc2.d/??${sysv_script} ${TARGET_ROOT}/etc/init.d/${sysv_script} done # And working around upstart job bug in Debian where cloud-config will never run # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=735207 sudo sed -i -e 's/start on .*/start on started rc RUNLEVEL=[2345]/' ${TARGET_ROOT}/etc/init/cloud-config.conf ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.337237 diskimage_builder-3.42.0/diskimage_builder/elements/debootstrap/0000775000175000017500000000000015201026275023672 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debootstrap/README.rst0000664000175000017500000000736115201026231025360 0ustar00zuulzuul=========== debootstrap =========== Base element for creating minimal debian-based images. This element is incomplete by itself, you'll want to use elements like debian-minimal or ubuntu-minimal to get an actual base image. There are two ways to configure apt-sources: 1. Using the standard way of defining the default apt sources release, updates and security repositories is the default. In this case you can overwrite the two environment variables to adapt the behavior: * ``DIB_DISTRIBUTION_MIRROR``: the mirror to use (default: ``__) * ``DIB_DEBIAN_COMPONENTS``: (default: ``main``) a comma separated list of components. For Debian this can be e.g. ``main,contrib,non-free``. By default only the ``main`` component is used. If ``DIB_DEBIAN_COMPONENTS`` (comma separated) from the ``debootstrap`` element has been set, that list of components will be used instead. Updates and security are included unless ``DIB_RELEASE`` is ``testing`` or ``unstable``. For these ``DIB_RELEASE`` values only the default release source is included. 2. Complete configuration given in the variable ``DIB_APT_SOURCES_CONF``. Each line contains exactly one entry for the sources.list.d directory. The first word must be the logical name (which is used as file name with ``.list`` automatically appended), followed by a colon ``:``, followed by the complete repository specification. .. code-block:: bash DIB_APT_SOURCES_CONF=\ "default:deb http://10.0.0.10/ stretch main contrib mysecurity:deb http://10.0.0.10/ stretch-security main contrib" If necessary, a custom apt keyring and debootstrap script can be supplied to the ``debootstrap`` command via ``DIB_APT_KEYRING`` and ``DIB_DEBIAN_DEBOOTSTRAP_SCRIPT`` respectively. Both options require the use of absolute rather than relative paths. Use of this element will also require the tool 'debootstrap' to be available on your system. It should be available on Ubuntu, Debian, and Fedora. It is also recommended that the 'debian-keyring' package be installed. The ``DIB_OFFLINE`` or more specific ``DIB_DEBIAN_USE_DEBOOTSTRAP_CACHE`` variables can be set to prefer the use of a pre-cached root filesystem tarball. The ``DIB_DEBOOTSTRAP_EXTRA_ARGS`` environment variable may be used to pass extra arguments to the debootstrap command used to create the base filesystem image. If --keyring is used in ``DIB_DEBOOTSTRAP_EXTRA_ARGS``, it will override ``DIB_APT_KEYRING`` if that is used as well. For further information about ``DIB_DEBIAN_DEBOOTSTRAP_SCRIPT`` , ``DIB_DEBIAN_USE_DEBOOTSTRAP_CACHE`` and ``DIB_DEBOOTSTRAP_EXTRA_ARGS`` please consult "README.rst" of the debootstrap element. .. note:: The rules above primarily apply to the debian-minimal element. The ubuntu-minimal element uses different configuration vars for things like configuring apt sources and its defaults may differ. ---------- Networking ---------- By default ``/etc/network/interfaces.d/eth[0|1]`` files will be created and enabled with DHCP networking. If you do not wish this to be done, set ``DIB_APT_MINIMAL_CREATE_INTERFACES`` to ``0``. If you need different interface names than ``eth[0|1]`` set ``DIB_NETWORK_INTERFACE_NAMES`` to a space separated list of network interface names like: .. code-block:: bash export DIB_NETWORK_INTERFACE_NAMES="ens3 ens4" ------------------- Note on ARM systems ------------------- Because there is not a one-to-one mapping of ``ARCH`` to a kernel package, if you are building an image for ARM on debian, you need to specify which kernel you want in the environment variable ``DIB_ARM_KERNEL``. For instance, if you want the ``linux-image-mx5`` package installed, set ``DIB_ARM_KERNEL`` to ``mx5``. .. element_deps:: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3382368 diskimage_builder-3.42.0/diskimage_builder/elements/debootstrap/cleanup.d/0000775000175000017500000000000015201026275025543 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debootstrap/cleanup.d/99-clean-up-cache0000775000175000017500000000145115201026231030466 0ustar00zuulzuul#!/bin/bash # # Copyright 2016 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail # NOTE(pabelanger): Remove cached info about APT repositories, as it will go # stale fast. sudo rm -rf $TARGET_ROOT/var/lib/apt/lists/* ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debootstrap/element-deps0000664000175000017500000000003615201026231026166 0ustar00zuulzuuldpkg modprobe pkg-map sysprep ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3382368 diskimage_builder-3.42.0/diskimage_builder/elements/debootstrap/environment.d/0000775000175000017500000000000015201026275026460 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/debootstrap/environment.d/10-debootstrap-default-locale 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debootstrap/environment.d/10-debootstrap-default0000664000175000017500000000012115201026231032553 0ustar00zuulzuulexport DIB_DEBOOTSTRAP_DEFAULT_LOCALE=${DIB_DEBOOTSTRAP_DEFAULT_LOCALE:-C.UTF-8} ././@PaxHeader0000000000000000000000000000021000000000000010206 xustar00114 path=diskimage_builder-3.42.0/diskimage_builder/elements/debootstrap/environment.d/20-network-interface-names 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debootstrap/environment.d/20-network-interface-n0000664000175000017500000000011515201026231032471 0ustar00zuulzuulexport DIB_NETWORK_INTERFACE_NAMES=${DIB_NETWORK_INTERFACE_NAMES:-eth0 eth1} ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3382368 diskimage_builder-3.42.0/diskimage_builder/elements/debootstrap/install.d/0000775000175000017500000000000015201026275025562 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debootstrap/install.d/10-debian-networking0000775000175000017500000000317115201026231031327 0ustar00zuulzuul#!/bin/bash # # Copyright 2015 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail # It would be eversogreat if we didn't need to do crap like this echo $DISTRO_NAME > /etc/hostname # If you want eth0 and eth1 created as DHCP based interfaces, enable # this. You don't want this if systemd is going to call the # interfaces on the real system something else, or if you're using a # network-manager like cloud-init, glean or systemd-networkd that will # handle the interfaces dynamically. if [[ "${DIB_APT_MINIMAL_CREATE_INTERFACES:-1}" -eq "1" ]]; then mkdir -p /etc/network/interfaces.d if ! grep -E -q '^source(|-directory) /etc/network/interfaces.d/\*' /etc/network/interfaces; then echo "source /etc/network/interfaces.d/*" >> /etc/network/interfaces echo 'Network configuration set to source /etc/network/interfaces.d/*' fi for interface in ${DIB_NETWORK_INTERFACE_NAMES}; do cat << EOF | tee /etc/network/interfaces.d/$interface auto $interface iface $interface inet dhcp EOF done fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/debootstrap/install.d/12-debian-locale-gen0000775000175000017500000000215715201026231031153 0ustar00zuulzuul#!/bin/bash # # Copyright 2015 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail [ -f /etc/locale.gen ] && rm /etc/locale.gen debconf-set-selections - < /etc/default/locale <`_. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3392367 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-baremetal/binary-deps.d/0000775000175000017500000000000015201026275027231 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-baremetal/binary-deps.d/deploy0000664000175000017500000000002115201026231030431 0ustar00zuulzuulbash tgtd tgtadm ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-baremetal/element-deps0000664000175000017500000000002115201026231027060 0ustar00zuulzuulpackage-installs ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3392367 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-baremetal/init.d/0000775000175000017500000000000015201026275025757 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-baremetal/init.d/80-deploy0000664000175000017500000000143515201026231027416 0ustar00zuulzuulif [ -z "$ISCSI_TARGET_IQN" ]; then err_msg "iscsi_target_iqn is not defined" troubleshoot fi t=0 while ! target_disk=$(find_disk "$DISK"); do if [ $t -eq 10 ]; then break fi t=$(($t + 1)) sleep 1 done if [ -z "$target_disk" ]; then err_msg "Could not find disk to use." troubleshoot fi echo "start iSCSI target on $target_disk" start_iscsi_target "$ISCSI_TARGET_IQN" "$target_disk" ALL if [ $? -ne 0 ]; then err_msg "Failed to start iscsi target." troubleshoot fi echo "request boot server to deploy image" d="i=$DEPLOYMENT_ID&k=$DEPLOYMENT_KEY&a=$BOOT_IP_ADDRESS&n=$ISCSI_TARGET_IQN&e=$FIRST_ERR_MSG" wget --post-data "$d" "http://$BOOT_SERVER:10000" echo "waiting for notice of complete" nc -l -p 10000 echo "stop iSCSI target on $target_disk" stop_iscsi_target ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-baremetal/package-installs.yaml0000664000175000017500000000000515201026231030663 0ustar00zuulzuultgt: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3392367 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-kexec/0000775000175000017500000000000015201026275023735 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-kexec/README.rst0000664000175000017500000000030315201026231025410 0ustar00zuulzuul============ deploy-kexec ============ Boots into the new image once baremetal-deploy-helper signals it is finished by downloading the kernel and ramdisk via tftp, and using the kexec utilities. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3392367 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-kexec/binary-deps.d/0000775000175000017500000000000015201026275026374 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-kexec/binary-deps.d/deploy-kexec0000664000175000017500000000000615201026231030674 0ustar00zuulzuulkexec ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-kexec/element-deps0000664000175000017500000000003015201026231026223 0ustar00zuulzuuldeploy package-installs ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3392367 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-kexec/init.d/0000775000175000017500000000000015201026275025122 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-kexec/init.d/81-deploy-kexec0000664000175000017500000000071315201026231027655 0ustar00zuulzuulTFTP_MAC_ADDRESS="01-"`echo $BOOT_MAC_ADDRESS | sed 's/:/-/g' | tr "A-Z" "a-z"` tftp -r /tftpboot/pxelinux.cfg/${TFTP_MAC_ADDRESS} -g ${BOOT_SERVER} APPEND=$(tail -n1 ${TFTP_MAC_ADDRESS} | cut -f3- -d" ") KERNEL=$(get_kernel_parameter BOOT_IMAGE | sed 's/deploy_//g') RAMDISK=$(echo $KERNEL | sed 's/kernel/ramdisk/') tftp -r ${KERNEL} -g ${BOOT_SERVER} tftp -r ${RAMDISK} -g ${BOOT_SERVER} kexec -l kernel --append="${APPEND}" --initrd=ramdisk && kexec -e ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-kexec/package-installs.yaml0000664000175000017500000000001515201026231030027 0ustar00zuulzuulkexec-tools: ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.340237 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/0000775000175000017500000000000015201026275024614 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/README.rst0000664000175000017500000000104115201026231026267 0ustar00zuulzuuldeploy-targetcli ================ Use targetcli for the deploy ramdisk for iSCSI deployments. .. Warning:: Ironic has removed the iSCSI deployment interface, it was last available in Wallaby, and even then had to be launched by the ironic-python-agent. This element is from the early days of baremetal deployment and is deprecated. Provides the necessary scripts and dependencies to use targetcli for exporting the iscsi target in the deploy ramdisk. Implemented as a dracut module, so will only work with dracut-based ramdisks. ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.340237 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/binary-deps.d/0000775000175000017500000000000015201026275027253 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/binary-deps.d/deploy-targetcli0000664000175000017500000000001215201026231032427 0ustar00zuulzuultargetcli ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.340237 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/dracut-drivers.d/0000775000175000017500000000000015201026275027774 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/dracut-drivers.d/targetcli-drivers 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/dracut-drivers.d/targetcli-driv0000664000175000017500000000014015201026231032622 0ustar00zuulzuultarget_core_mod iscsi_target_mod target_core_iblock target_core_file target_core_pscsi configfs ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/element-deps0000664000175000017500000000002115201026231027102 0ustar00zuulzuulpackage-installs ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.340237 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/extra-data.d/0000775000175000017500000000000015201026275027070 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021100000000000010207 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/extra-data.d/50-add-targetcli-module 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/extra-data.d/50-add-targetcli-m0000775000175000017500000000040115201026231032161 0ustar00zuulzuul#!/bin/bash set -eu set -o pipefail if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi MODULE_PATH="/usr/lib/dracut/modules.d" sudo mkdir -p ${TMP_MOUNT_PATH}${MODULE_PATH} sudo cp -r $(dirname $0)/module/ ${TMP_MOUNT_PATH}${MODULE_PATH}/50targetcli ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3412368 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/extra-data.d/module/0000775000175000017500000000000015201026275030355 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/extra-data.d/module/iscsi-func0000775000175000017500000000134515201026231032341 0ustar00zuulzuulfunction start_iscsi_target() { local iqn=$1 local dev=$2 local cli=$3 # used by tgtd mkdir -p /var/run ln -s /usr/bin/targetcli /targetcli_bin.py /targetcli-wrapper /backstores/block create block1 dev=$dev /targetcli-wrapper /iscsi create $iqn /targetcli-wrapper /iscsi/$iqn/tpg1/luns create /backstores/block/block1 1 /targetcli-wrapper /iscsi/$iqn/tpg1/portals create $BOOT_IP_ADDRESS /targetcli-wrapper /iscsi/$iqn/tpg1 set attribute authentication=0 /targetcli-wrapper /iscsi/$iqn/tpg1 set attribute demo_mode_write_protect=0 /targetcli-wrapper /iscsi/$iqn/tpg1 set attribute generate_node_acls=1 } function stop_iscsi_target() { /targetcli-wrapper clearconfig confirm=True } ././@PaxHeader0000000000000000000000000000021000000000000010206 xustar00114 path=diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/extra-data.d/module/module-setup.sh 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/extra-data.d/module/module-setu0000775000175000017500000000140215201026231032533 0ustar00zuulzuul#!/bin/bash # Dracut is bash too, and it doesn't play nicely with our usual sets # dib-lint: disable=setu sete setpipefail dibdebugtrace check() { return 0 } depends() { return 0 } install() { inst /bin/targetcli inst "$moddir/targetcli-wrapper" /targetcli-wrapper inst "$moddir/iscsi-func" /iscsi-func # Install all of Python # TODO(bnemec): At some point this will need to be extended to support # Python 3, but for the moment we aren't using that anyway. inst /usr/bin/python local all_of_python=() while IFS='' read -r -d '' i; do all_of_python+=("$i") done < <(find /usr/lib64/python2.7/ /usr/lib/python2.7/ -type f -not -name "*.pyc" -not -name "*.pyo" -print0) inst_multiple "${all_of_python[@]}" } ././@PaxHeader0000000000000000000000000000021200000000000010210 xustar00116 path=diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/extra-data.d/module/targetcli-wrapper 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/extra-data.d/module/targetcli-w0000775000175000017500000000162415201026231032520 0ustar00zuulzuul#!/usr/bin/env python3 # Copyright 2014 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import rtslib import targetcli_bin class MyISCSIFabricModule(rtslib.fabric.ISCSIFabricModule): def __init__(self): super(rtslib.fabric.ISCSIFabricModule, self).__init__('iscsi') self.wwn_types = ('free',) rtslib.fabric.fabric_modules['iscsi'] = MyISCSIFabricModule targetcli_bin.main() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-targetcli/package-installs.yaml0000664000175000017500000000001315201026231030704 0ustar00zuulzuultargetcli: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3412368 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-tgtadm/0000775000175000017500000000000015201026275024116 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-tgtadm/README.rst0000664000175000017500000000102015201026231025566 0ustar00zuulzuuldeploy-tgtadm ============= Use tgtadm and tgtd for the deploy ramdisk for iSCSI deployments. .. Warning:: Ironic has removed the iSCSI deployment interface, it was last available in Wallaby, and even then had to be launched by the ironic-python-agent. This element is from the early days of baremetal deployment and is deprecated. Provides the necessary scripts and dependencies to use tgtadm and tgtd for exporting the iscsi target in the deploy ramdisk. Will only work with the standard (not dracut) ramdisk. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3412368 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-tgtadm/binary-deps.d/0000775000175000017500000000000015201026275026555 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-tgtadm/binary-deps.d/deploy-tgtadm0000664000175000017500000000001415201026231031235 0ustar00zuulzuultgtadm tgtd ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3412368 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-tgtadm/extra-data.d/0000775000175000017500000000000015201026275026372 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021200000000000010210 xustar00116 path=diskimage_builder-3.42.0/diskimage_builder/elements/deploy-tgtadm/extra-data.d/50-inject-tgtadm-iscsi-func 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-tgtadm/extra-data.d/50-inject-tgtadm-iscs0000775000175000017500000000037315201026231032226 0ustar00zuulzuul#!/bin/bash set -eu set -o pipefail if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi RAMDISK_SCRIPT_PATH="$TMP_MOUNT_PATH/tmp/ramdisk-build/scripts/d" mkdir -p ${RAMDISK_SCRIPT_PATH} cp $(dirname $0)/scripts/iscsi-func ${RAMDISK_SCRIPT_PATH} ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3412368 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-tgtadm/extra-data.d/scripts/0000775000175000017500000000000015201026275030061 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-tgtadm/extra-data.d/scripts/iscsi-func0000664000175000017500000000113015201026231032032 0ustar00zuulzuulfunction start_iscsi_target() { local iqn=$1 local dev=$2 local cli=$3 # used by tgtd mkdir -p /var/run tgtd wait_for 10 0.5 check_tgtd_socket tgtadm --lld iscsi --mode target --op new --tid 1 --targetname "$iqn" tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 --backing-store "$dev" tgtadm --lld iscsi --mode target --op bind --tid 1 --initiator-address "$cli" } function stop_iscsi_target() { tgtadm --lld iscsi --mode logicalunit --op delete --tid 1 --lun 1 tgtadm --lld iscsi --mode target --op delete --tid 1 killall tgtd } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/deploy-tgtadm/package-installs.yaml0000664000175000017500000000000515201026231030207 0ustar00zuulzuultgt: ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.342237 diskimage_builder-3.42.0/diskimage_builder/elements/devuser/0000775000175000017500000000000015201026275023021 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/devuser/README.rst0000664000175000017500000000261615201026231024505 0ustar00zuulzuul======= devuser ======= Creates a user that is useful for development / debugging. The following environment variables can be useful for configuration: Environment Variables --------------------- DIB_DEV_USER_USERNAME :Required: No :Default: devuser :Description: Username for the created user. DIB_DEV_USER_GROUPS :Required: No :Default: No :Description: Additional groups (comma separated if many) for the created user (groups should already exist). DIB_DEV_USER_SHELL :Required: No :Default: System default (The useradd default is used) :Description: Full path for the shell of the user. This is passed to useradd using the -s parameter. Note that this does not install the (possibly) required shell package. DIB_DEV_USER_PWDLESS_SUDO :Required: No :Default: No :Description: Enable passwordless sudo for the user. DIB_DEV_USER_AUTHORIZED_KEYS :Required: No :Default: $HOME/.ssh/id_{rsa,dsa}.pub :Description: Path to a file to copy into this users' .ssh/authorized_keys If this is not specified then an attempt is made to use a the building user's public key. To disable this behavior specify an invalid path for this variable (such as /dev/null). DIB_DEV_USER_PASSWORD :Required: No :Default: Password is disabled :Description: Set the default password for this user. This is a fairly insecure method of setting the password and is not advised. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/devuser/element-deps0000664000175000017500000000002115201026231025307 0ustar00zuulzuulpackage-installs ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.342237 diskimage_builder-3.42.0/diskimage_builder/elements/devuser/environment.d/0000775000175000017500000000000015201026275025607 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/devuser/environment.d/50-devuser0000664000175000017500000000054315201026231027423 0ustar00zuulzuulexport DIB_DEV_USER_USERNAME=${DIB_DEV_USER_USERNAME:-devuser} export DIB_DEV_USER_GROUPS=${DIB_DEV_USER_GROUPS:-} export DIB_DEV_USER_SHELL=${DIB_DEV_USER_SHELL:-} export DIB_DEV_USER_PWDLESS_SUDO=${DIB_DEV_USER_PWDLESS_SUDO:-} export DIB_DEV_USER_AUTHORIZED_KEYS=${DIB_DEV_USER_AUTHORIZED_KEYS:-} export DIB_DEV_USER_PASSWORD=${DIB_DEV_USER_PASSWORD:-} ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.342237 diskimage_builder-3.42.0/diskimage_builder/elements/devuser/extra-data.d/0000775000175000017500000000000015201026275025275 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/devuser/extra-data.d/50-devuser0000775000175000017500000000076115201026231027116 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [ -n "$DIB_DEV_USER_AUTHORIZED_KEYS" ]; then if [ -f "$DIB_DEV_USER_AUTHORIZED_KEYS" ]; then cat $DIB_DEV_USER_AUTHORIZED_KEYS >> $TMP_HOOKS_PATH/devuser-ssh-authorized-keys fi else for fmt in rsa dsa; do if [ -f "$HOME/.ssh/id_$fmt.pub" ]; then cat $HOME/.ssh/id_$fmt.pub >> $TMP_HOOKS_PATH/devuser-ssh-authorized-keys break fi done fi ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.342237 diskimage_builder-3.42.0/diskimage_builder/elements/devuser/install.d/0000775000175000017500000000000015201026275024711 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/devuser/install.d/50-devuser0000775000175000017500000000235515201026231026533 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail user_shell_args= if [ -n "${DIB_DEV_USER_SHELL}" ]; then user_shell_args="-s ${DIB_DEV_USER_SHELL}" fi useradd -m ${DIB_DEV_USER_USERNAME} $user_shell_args if [ -n "${DIB_DEV_USER_GROUPS}" ]; then usermod -a -G ${DIB_DEV_USER_GROUPS} ${DIB_DEV_USER_USERNAME} fi set +x if [ -n "${DIB_DEV_USER_PASSWORD}" ]; then echo "Setting password." echo "${DIB_DEV_USER_USERNAME}:${DIB_DEV_USER_PASSWORD}" | chpasswd fi set -x if [ -n "${DIB_DEV_USER_PWDLESS_SUDO}" ]; then if [ ! -d /etc/sudoers.d/ ]; then mkdir -p /etc/sudoers.d/ chmod 0750 /etc/sudoers.d/ chown root:root /etc/sudoers.d/ fi cat > /etc/sudoers.d/${DIB_DEV_USER_USERNAME} << EOF ${DIB_DEV_USER_USERNAME} ALL=(ALL) NOPASSWD:ALL EOF chmod 0440 /etc/sudoers.d/${DIB_DEV_USER_USERNAME} visudo -c || rm /etc/sudoers.d/${DIB_DEV_USER_USERNAME} fi if [ -f /tmp/in_target.d/devuser-ssh-authorized-keys ]; then mkdir -p /home/${DIB_DEV_USER_USERNAME}/.ssh cp /tmp/in_target.d/devuser-ssh-authorized-keys /home/${DIB_DEV_USER_USERNAME}/.ssh/authorized_keys fi chown -R ${DIB_DEV_USER_USERNAME}:${DIB_DEV_USER_USERNAME} /home/${DIB_DEV_USER_USERNAME} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/devuser/package-installs.yaml0000664000175000017500000000000615201026231027113 0ustar00zuulzuulsudo: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/devuser/pkg-map0000664000175000017500000000011315201026231024263 0ustar00zuulzuul{ "family": { "gentoo": { "sudo": "app-admin/sudo" } } } ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.343237 diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/0000775000175000017500000000000015201026275025151 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/README.rst0000664000175000017500000000420315201026231026627 0ustar00zuulzuul=================== dhcp-all-interfaces =================== Autodetect network interfaces during boot and configure them for DHCP The rationale for this is that we are likely to require multiple network interfaces for use cases such as baremetal and there is no way to know ahead of time which one is which, so we will simply run a DHCP client on all interfaces with real MAC addresses (except lo) that are visible on the first boot. On non-Gentoo based distributions the script /usr/local/sbin/dhcp-all-interfaces.sh will be called early in each boot and will scan available network interfaces and ensure they are configured properly before networking services are started. On Gentoo based distributions we will install the dhcpcd package and ensure the service starts at boot. This service automatically sets up all interfaces found via dhcp and/or dhcpv6 (or SLAAC). Environment Variables --------------------- DIB_DHCP_TIMEOUT :Required: No :Default: 30 :Description: Amount of time in seconds that the systemd service(or dhclient) will wait to get an address. Should be increased in networks such as Infiniband. :Example: DIB_DHCP_TIMEOUT=300 DIB_DHCP_NETWORK_MANAGER_AUTO :Required: No :Default: false :Description: When NetworkManager is detected, and this is set to true the dhcp-all-interfaces service will not be installed. Only the NetworkManager configuration will be added. NetworkManager is quite capable to do automatic interface configuration. NetworkManager will by default try to auto-configure any interface with no configuration, it will use DHCP for IPv4 and Router Advertisements to decide how to initialize IPv6. :Example: DIB_DHCP_NETWORK_MANAGER_AUTO=true DIB_DHCP_CLIENT :Required: no :Default: internal :Description: When NetworkManager is in use, this setting conveys which DHCP client is in use for acquiring a DHCP address for the node. In some specific cases, where known that dhclient is the tested or most compatible default, specifically for Centos 8, and 8-Stream, as well as derived distributions. Otherwise, the "internal" dhcp client is the default. :Example: DIB_DHCP_CLIENT ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/element-deps0000664000175000017500000000005115201026231027442 0ustar00zuulzuuldib-init-system package-installs pkg-map ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.343237 diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/install.d/0000775000175000017500000000000015201026275027041 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021000000000000010206 xustar00114 path=diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interf0000775000175000017500000001063215201026231032154 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail SCRIPTDIR=$(dirname $0) if [ -e "/etc/redhat-release" ]; then # NOTE(TheJulia): RHEL, prior to RHEL8 used dhclient by default launched # by NetworkManager. In RHEL8, this default switched to the "internal" # dhcp client. # This is problematic in RHEL8, with port blocking situations as dhclient # has better behavior which includes shutting down the port between # retries which is critical for recovery from LACP port blocking # situations. As such, we'll force it to dhclient. # For more information, see https://storyboard.openstack.org/#!/story/2008001 if [[ '7' =~ ${DIB_RELEASE} ]]; then DIB_DHCP_CLIENT=${DIB_DHCP_CLIENT:-dhclient} elif [[ '8' =~ ${DIB_RELEASE} ]]; then DIB_DHCP_CLIENT=${DIB_DHCP_CLIENT:-dhclient} elif [[ '10' =~ ${DIB_RELEASE} ]]; then DIB_DHCP_CLIENT=${DIB_DHCP_CLIENT:-dhcpcd} fi # NOTE(TheJulia): Centos 9-stream/RHEL9, appear to need to leverage the # internal interface. See: https://storyboard.openstack.org/#!/story/2010109 fi # Sets appropriate NetworkManager configuration, if the folder is present. if [ -x "/etc/NetworkManager" ]; then install -D -g root -o root -m 0644 ${SCRIPTDIR}/NetworkManager-conf.d-00-main.conf /etc/NetworkManager/conf.d/00-main.conf sed -i "s/DIB_DHCP_CLIENT/${DIB_DHCP_CLIENT:-internal}/g" /etc/NetworkManager/conf.d/00-main.conf sed -i "s/DIB_DHCP_TIMEOUT/${DIB_DHCP_TIMEOUT:-30}/g" /etc/NetworkManager/conf.d/00-main.conf if [ "${DIB_DHCP_NETWORK_MANAGER_AUTO:-false}" == true ]; then # Use NetworkManager for auto configuration, it will behave just as # good as dhcp-all-interfaces.sh in most cases. exit 0 fi fi if [ -e "/etc/redhat-release" ]; then # TODO(hjensas): Once ndisc6 package is available in EPEL8 drop this, # and add the package back in pkg-map. # See: https://bugzilla.redhat.com/show_bug.cgi?id=1779134 if type dnf &>/dev/null; then dnf -v -y install ndisc6 || true else yum -v -y install ndisc6 || true fi fi # this script is not needed on Gentoo. if [ "$DISTRO_NAME" != "gentoo" ]; then install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-all-interfaces.sh /usr/local/sbin/dhcp-all-interfaces.sh sed -i "s/DIB_DHCP_TIMEOUT/${DIB_DHCP_TIMEOUT:-30}/" /usr/local/sbin/dhcp-all-interfaces.sh fi if [ -f /etc/dhcp/dhclient.conf ] ; then # Set the dhclient timeout configurations to match DIB_DHCP_TIMEOUT, if grep -o "^timeout " /etc/dhcp/dhclient.conf ; then sed -i -e "s/^timeout .*/# \"timeout\" Value set by dhcp-all-interfaces\ntimeout ${DIB_DHCP_TIMEOUT:-30};/" /etc/dhcp/dhclient.conf else echo -e "# \"timeout\" Value set by dhcp-all-interfaces\ntimeout ${DIB_DHCP_TIMEOUT:-30};" >> /etc/dhcp/dhclient.conf fi if grep -o "^retry " /etc/dhcp/dhclient.conf ; then sed -i -e '/^retry/s/^/# \"retry\" Value commented by dhcp-all-interfaces\n# /g' /etc/dhcp/dhclient.conf fi fi if [ "$DIB_INIT_SYSTEM" == "upstart" ]; then if [ -e "/etc/redhat-release" ] ; then # the init system is upstart but networking is using sysv compatibility (i.e. Centos/RHEL 6) install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-all-interfaces.init /etc/init.d/dhcp-all-interfaces chkconfig dhcp-all-interfaces on else install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-all-interfaces.conf /etc/init/dhcp-all-interfaces.conf fi elif [ "$DIB_INIT_SYSTEM" == "systemd" ]; then install -D -g root -o root -m 0644 ${SCRIPTDIR}/dhcp-interface@.service /usr/lib/systemd/system/dhcp-interface@.service install -D -g root -o root -m 0644 ${SCRIPTDIR}/dhcp-all-interfaces-udev.rules /etc/udev/rules.d/99-dhcp-all-interfaces.rules sed -i "s/TimeoutStartSec=DIB_DHCP_TIMEOUT/TimeoutStartSec=$(( ${DIB_DHCP_TIMEOUT:-30} * 2 ))s/" /usr/lib/systemd/system/dhcp-interface@.service elif [ "$DIB_INIT_SYSTEM" == "sysv" ]; then install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-all-interfaces.init /etc/init.d/dhcp-all-interfaces update-rc.d dhcp-all-interfaces defaults elif [ "$DISTRO_NAME" == "gentoo" ]; then # let ipv6 use normal slaac sed -i 's/slaac/#slaac/g' /etc/dhcpcd.conf # don't let dhcpcd set domain name or hostname sed -i 's/domain_name\,\ domain_search\,\ host_name/domain_search/g' /etc/dhcpcd.conf rc-update add dhcpcd default fi ././@PaxHeader0000000000000000000000000000022200000000000010211 xustar00124 path=diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/install.d/60-remove-cloud-image-interfaces 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/install.d/60-remove-cloud-im0000775000175000017500000000153715201026231032214 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # Cloud images may hard code interfaces so they # boot with DHCP. # RHEL/CentOS/Fedora for ifcfg in $(ls /etc/sysconfig/network-scripts/ifcfg-* | grep -v "ifcfg-lo"); do rm -f $ifcfg done # Ubuntu/Debian rm -f /etc/network/interfaces.d/* # Gentoo rm -f /etc/conf.d/net* # /etc/network/interfaces distributions if [ -f "/etc/network/interfaces" ]; then printf "auto lo\niface lo inet loopback\n\n" > /etc/network/interfaces if [ -d "/etc/network/interfaces.d/" ]; then if [ "$DISTRO_NAME" == "ubuntu" ] && [ "$DIB_RELEASE" == "trusty" ]; then printf "source-directory interfaces.d\n\n" >> /etc/network/interfaces else printf "source /etc/network/interfaces.d/*\n\n" >> /etc/network/interfaces fi fi fi ././@PaxHeader0000000000000000000000000000022400000000000010213 xustar00126 path=diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/install.d/NetworkManager-conf.d-00-main.conf 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/install.d/NetworkManager-con0000664000175000017500000000227115201026231032457 0ustar00zuulzuul# WARNING: This file has been modified by the diskimage-builder # dhcp-all-interfaces element as this machine is likely running # a ramdisk or needs to attempt auto-configuration on all interfaces. [main] # This makes sense even with dhcp on all interfaces in the event # that the configuration has been or is being supplied via external means. ignore-carrier=* # Use dhclient as was done previously to the Centos8/RHEL8 RPM defaults. # This is because dhclient shuts the interface down after a retry attempt # which allows the link state to reset with some switches, which may be # important for the ramdisk to recover networking. dhcp=DIB_DHCP_CLIENT [connection] # Keep retrying, this is important for this important espescialy for # ramdisks in environments where varying switch configurations may # cause traffic to be blocked or intermittent connectivity failures # such as those at an edge site may cause issues. autoconnect-retries=-1 # Set the timeout. Diskimage-builder dhcp-all-interfaces has a 30 # second default. NetworkManager, by default, is 45 seconds. # In some cases where ramdisks are in use, 60 seconds is advisable. ipv4.dhcp-timeout=DIB_DHCP_TIMEOUT ipv6.dhcp-timeout=DIB_DHCP_TIMEOUT ././@PaxHeader0000000000000000000000000000022000000000000010207 xustar00122 path=diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces-udev.rules 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interface0000664000175000017500000000016715201026231032402 0ustar00zuulzuulSUBSYSTEM=="net", KERNEL!="lo", ACTION=="add|move", TAG+="systemd", ENV{SYSTEMD_WANTS}+="dhcp-interface@$name.service" ././@PaxHeader0000000000000000000000000000021200000000000010210 xustar00116 path=diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces.conf 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interface0000664000175000017500000000053215201026231032376 0ustar00zuulzuul# Call a script to generate a /etc/network/interfaces file to DHCP all available interfaces # Then remove this config file so the script is never run again description "DHCP any connected, but unconfigured network interfaces" start on starting network-interface instance $INTERFACE task exec /usr/local/sbin/dhcp-all-interfaces.sh $INTERFACE ././@PaxHeader0000000000000000000000000000021200000000000010210 xustar00116 path=diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces.init 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interface0000775000175000017500000000127415201026231032405 0ustar00zuulzuul#!/bin/sh -e ### BEGIN INIT INFO # Provides: dhcp-all-interfaces # Required-Start: $local_fs # Required-Stop: $local_fs # Default-Start: S # Default-Stop: 0 6 # X-Start-Before: networking # chkconfig: 3 9 50 # Short-Description: Autodetect network interfaces # Description: Autodetect network interfaces during boot and configure them for DHCP ### END INIT INFO NAME=dhcp-all-interfaces INIT_NAME=/etc/init.d/${NAME} SCRIPT_NAME=/usr/local/sbin/${NAME}.sh [ -x $SCRIPT_NAME ] || exit 0 case "$1" in start) $SCRIPT_NAME ;; stop) ;; *) echo "Usage: $INIT_NAME {start|stop}" exit 1 ;; esac exit 0 ././@PaxHeader0000000000000000000000000000021000000000000010206 xustar00114 path=diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces.sh 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interface0000775000175000017500000002036415201026231032406 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail INTERFACE=${1:-} #optional, if not specified configure all available interfaces ENI_FILE="/etc/network/interfaces" PATH=/sbin:$PATH if [ -d "/etc/network" ]; then CONF_TYPE="eni" elif [ -d "/etc/sysconfig/network-scripts/" ]; then CONF_TYPE="rhel-netscripts" SCRIPTS_PATH="/etc/sysconfig/network-scripts/" elif [ -d "/etc/sysconfig/network/" ]; then # SUSE network scripts location CONF_TYPE="suse-netscripts" SCRIPTS_PATH="/etc/sysconfig/network/" else echo "Unsupported network configuration type!" exit 1 fi ARGS="$0 $@" function serialize_me() { if [ "$CONF_TYPE" == "eni" ]; then # Serialize runs so that we don't miss hot-add interfaces FLOCKED=${FLOCKED:-} if [ -z "$FLOCKED" ] ; then FLOCKED=true exec flock -x $ENI_FILE $ARGS fi fi } function get_if_link() { cat /sys/class/net/${1}/carrier || echo 0 } function get_if_type() { cat /sys/class/net/${1}/type } function interface_is_vlan() { # Check if this is a vlan interface created on top of an Ethernet interface. local interface=$1 # When the vlan interface is created, its mac address is copied from the # underlying address and the address assignment type is set to 2 mac_addr_type=$(cat /sys/class/net/${interface}/addr_assign_type) if [ "$mac_addr_type" != "2" ]; then return 1 fi # Only check for vlan interfaces named . lower_interface="$(echo $interface | cut -f1 -d'.')" if [[ ! -z $lower_interface ]]; then mac_addr_type=$(cat /sys/class/net/${lower_interface}/addr_assign_type) if [ "$mac_addr_type" == "0" ]; then return 0 # interface is vlan fi fi return 1 } function enable_interface() { local interface=$1 local ipv6_init=$2 local ipv6_AdvManagedFlag=$3 local ipv6_AdvOtherConfigFlag=$4 serialize_me if [ "$CONF_TYPE" == "eni" ]; then printf "auto $interface\niface $interface inet dhcp\n\n" >>$ENI_FILE if [ "$ipv6_init" == "True" ]; then # Make DUID-UUID Type 4 (RFC 6355) echo "default-duid \"\\x00\\x04$(sed 's/.\{2\}/\\x&/g' < /etc/machine-id)\";" >"/var/lib/dhcp/dhclient6--$interface.lease" if [ $ipv6_AdvManagedFlag == "Yes" ]; then # IPv6 DHCPv6 Stateful address configuration printf "iface $interface inet6 dhcp\n\n" >>$ENI_FILE echo "DHCPv6 Stateful Configured." elif [ $ipv6_AdvOtherConfigFlag == "Yes" ]; then # IPv6 DHCPv6 Stateless address configursation printf "iface $interface inet6 auto\n\tdhcp 1\n\n" >>$ENI_FILE echo "DHCPv6 Stateless Configured." else # IPv6 Autoconfiguration (SLAAC) printf "iface $interface inet6 auto\n\tdhcp 0\n\n" >>$ENI_FILE echo "IPv6 SLAAC Configured" fi fi printf "\n" >>$ENI_FILE elif [ "$CONF_TYPE" == "rhel-netscripts" ]; then if [ "$(get_if_type $interface)" == "32" ]; then printf "DEVICE=\"$interface\"\nBOOTPROTO=\"dhcp\"\nONBOOT=\"yes\"\nTYPE=\"InfiniBand\"\nCONNECTED_MODE=\"no\"\nDEFROUTE=\"yes\"\nPEERDNS=\"yes\"\nPEERROUTES=\"yes\"\nIPV4_FAILURE_FATAL=\"yes\"\nIPV6INIT=\"no\"" >"${SCRIPTS_PATH}ifcfg-$interface" else if interface_is_vlan $interface; then printf "DEVICE=\"$interface\"\nBOOTPROTO=\"dhcp\"\nONBOOT=\"yes\"\nVLAN=\"yes\"\n" >"${SCRIPTS_PATH}ifcfg-$interface" else printf "DEVICE=\"$interface\"\nBOOTPROTO=\"dhcp\"\nONBOOT=\"yes\"\nTYPE=\"Ethernet\"\n" >"${SCRIPTS_PATH}ifcfg-$interface" fi if [ "$ipv6_init" == "True" ]; then # Make DUID-UUID Type 4 (RFC 6355) echo "default-duid \"\\x00\\x04$(sed 's/.\{2\}/\\x&/g' < /etc/machine-id)\";" >"/var/lib/dhclient/dhclient6--$interface.lease" printf "IPV6INIT=\"yes\"\n" >>"${SCRIPTS_PATH}ifcfg-$interface" if [ $ipv6_AdvManagedFlag == "Yes" ]; then # IPv6 DHCPv6 Stateful address configuration printf "IPV6_FORCE_ACCEPT_RA=\"yes\"\nDHCPV6C=\"yes\"\n" >>"${SCRIPTS_PATH}ifcfg-$interface" echo "DHCPv6 Stateful Configured" elif [ $ipv6_AdvOtherConfigFlag == "Yes" ]; then # IPv6 DHCPv6 Stateless address configursation printf "IPV6_AUTOCONF=\"yes\"\nDHCPV6C=\"yes\"\nDHCPV6C_OPTIONS=\"-S\"\n" >>"${SCRIPTS_PATH}ifcfg-$interface" echo "DHCPv6 Stateless Configured" else # IPv6 Autoconfiguration (SLAAC) printf "IPV6_AUTOCONF=\"yes\"\n" >>"${SCRIPTS_PATH}ifcfg-$interface" echo "IPv6 SLAAC Configured" fi fi fi elif [ "$CONF_TYPE" == "suse-netscripts" ]; then printf "BOOTPROTO=\"dhcp\"\nSTARTMODE=\"auto\"" >"${SCRIPTS_PATH}ifcfg-$interface" fi echo "Configured $1" } function config_exists() { local interface=$1 if [[ "$CONF_TYPE" =~ "netscripts" ]]; then if [ -f "${SCRIPTS_PATH}ifcfg-$interface" ]; then return 0 fi else if ifquery $interface >/dev/null 2>&1; then if [ -z "$(ifquery $interface 2>&1)" ]; then return 1 else return 0 fi else return 1 fi fi return 1 } function inspect_interface() { local interface=$1 local mac_addr_type mac_addr_type=$(cat /sys/class/net/${interface}/addr_assign_type) echo -n "Inspecting interface: $interface..." if config_exists $interface; then echo "Has config, skipping." elif interface_is_vlan $interface || [ "$mac_addr_type" == "0" ]; then local has_link local tries=DIB_DHCP_TIMEOUT for ((; tries > 0; tries--)); do # Need to set the link up on each iteration ip link set dev $interface up &>/dev/null has_link=$(get_if_link $interface) [ "$has_link" == "1" ] && break sleep 1 done if [ "$has_link" == "1" ]; then local ipv6_init=False local ipv6_AdvManagedFlag=No local ipv6_AdvOtherConfigFlag=No if type rdisc6 &>/dev/null; then # We have rdisc6, let's try to configure IPv6 autoconfig/dhcpv6 tries=DIB_DHCP_TIMEOUT for ((; tries > 0; tries--)); do # Need to retry this, link-local-address required for # Neighbor Discovery, DHCPv6 etc. set +e # Do not exit on error, capture rdisc6 error codes. RA=$(rdisc6 --retry 3 --single "$interface" 2>/dev/null) local return_code=$? set -e # Re-enable exit on error. if [ $return_code -eq 0 ]; then ipv6_init=True ipv6_AdvManagedFlag=$(echo "$RA" | grep "Stateful address conf." | awk -F: '{ print $2 }') ipv6_AdvOtherConfigFlag=$(echo "$RA" | grep "Stateful other conf." | awk -F: '{ print $2 }') break elif [ $return_code -eq 1 ]; then sleep 1 elif [ $return_code -eq 2 ]; then # If rdisc6 does not receive any response after the # specified number of attempts waiting for wait_ms # (1000ms by default) milliseconds each time, it will # exit with code 2. break fi done else echo "rdisc6 not available, skipping IPv6 configuration." fi enable_interface "$interface" "$ipv6_init" "$ipv6_AdvManagedFlag" "$ipv6_AdvOtherConfigFlag" else echo "No link detected, skipping" fi else echo "Device has generated MAC, skipping." fi } if [ -n "$INTERFACE" ]; then inspect_interface $INTERFACE else for iface in $(ls /sys/class/net | grep -v ^lo$); do inspect_interface $iface done fi ././@PaxHeader0000000000000000000000000000021100000000000010207 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-interface@.service 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-interface@.se0000664000175000017500000000136215201026231032340 0ustar00zuulzuul[Unit] Description=DHCP interface %i # We want to run after network.target so it doesn't try to bring # up the interfaces a second time, but network-online should not # be reached until after we've brought up the interfaces. # We also need to break the default dependencies which prevents # this from operating on Ubuntu/Debian as the unit gets stuck # into a cyclical dependency loop. DefaultDependencies=no After=network.target Before=network-online.target Wants=network-online.target ConditionPathExists=!/etc/sysconfig/network-scripts/ifcfg-%i [Service] Type=oneshot User=root ExecStartPre=/usr/local/sbin/dhcp-all-interfaces.sh %i ExecStart=/sbin/ifup %i RemainAfterExit=true TimeoutStartSec=DIB_DHCP_TIMEOUT [Install] WantedBy=multi-user.target ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/package-installs.yaml0000664000175000017500000000003715201026231031247 0ustar00zuulzuuldhcp-client: ifupdown: ndisc6: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dhcp-all-interfaces/pkg-map0000664000175000017500000000145015201026231026420 0ustar00zuulzuul{ "release": { "almalinux": { "10": { "dhcp-client": "dhcpcd", "ifupdown": "" } }, "centos": { "10-stream": { "dhcp-client": "dhcpcd", "ifupdown": "" } }, "rocky": { "10": { "dhcp-client": "dhcpcd", "ifupdown": "" } } }, "family": { "redhat": { "dhcp-client": "dhclient", "ifupdown": "NetworkManager-initscripts-updown", "ndisc6": "" }, "gentoo": { "dhcp-client": "net-misc/dhcpcd", "ndisc6": "net-misc/ndisc6" }, "suse": { "dhcp-client": "dhcp-client" }, "debian": { "ifupdown": "ifupdown", "ndisc6": "ndisc6" } }, "default": { "dhcp-client": "isc-dhcp-client", "ifupdown": "", "ndisc6": "" } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3442369 diskimage_builder-3.42.0/diskimage_builder/elements/dib-init-system/0000775000175000017500000000000015201026275024365 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dib-init-system/README.rst0000664000175000017500000000103515201026231026043 0ustar00zuulzuul=============== dib-init-system =============== Element that handles aspects of the used target's init system. Any files placed in a ``init-scripts/INIT_SYSTEM`` directory inside the element will be copied into the appropriate directory if ``INIT_SYSTEM`` is in use on the host. Environment Variables --------------------- DIB_INIT_SYSTEM :Description: One of ``upstart``, ``systemd``, ``openrc`` or ``sysv`` depending on the init system in use for the target image. This should be set automatically by your platform elements. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3442369 diskimage_builder-3.42.0/diskimage_builder/elements/dib-init-system/environment.d/0000775000175000017500000000000015201026275027153 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dib-init-system/environment.d/99-dib-init-system0000664000175000017500000000142715201026231032352 0ustar00zuulzuul# # This runs last in the environment to ensure DIB_INIT_SYSTEM is set. # We expect the base environments to set this variable particular to # their platform. Note we used to try and guess this automatically # inside the chroot, but there's a chicken-and-egg issue when you're # building from scratch and you're guessing before you've even # installed the init system. # if [ -z "${DIB_INIT_SYSTEM:-}" ]; then echo "DIB_INIT_SYSTEM is not set! Can not continue" exit 1 fi # whitelist known systems case $DIB_INIT_SYSTEM in upstart) ;; openrc) ;; systemd) ;; sysv) ;; *) echo "Unrecognised init system: ${DIB_INIT_SYSTEM}!" echo "Can not continue" exit 1 esac # Tell emacs to use shell-mode # Local variables: # mode: sh # End: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3442369 diskimage_builder-3.42.0/diskimage_builder/elements/dib-init-system/install.d/0000775000175000017500000000000015201026275026255 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020500000000000010212 xustar00111 path=diskimage_builder-3.42.0/diskimage_builder/elements/dib-init-system/install.d/20-install-init-scripts 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dib-init-system/install.d/20-install-init-script0000775000175000017500000000141515201026231032324 0ustar00zuulzuul#!/bin/bash # Note that this relies on the detail that all elements share one dir inside # the chroot. This will copy all the files that elements have added to # element/static into the image. Mode, symlinks etc will be respected. if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail scripts_dir="$(dirname $0)/../init-scripts/$DIB_INIT_SYSTEM/" if [ -d "$scripts_dir" ]; then dest= case $DIB_INIT_SYSTEM in upstart) dest=/etc/init/ ;; openrc) dest=/etc/init.d/ ;; systemd) dest=/usr/lib/systemd/system/ ;; sysv) dest=/etc/init.d/ ;; esac if [ -z "$dest" ]; then echo "ERROR: DIB_INIT_SYSTEM ($DIB_INIT_SYSTEM) is not a known type" exit 1 fi cp -RP $scripts_dir. $dest || true fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3442369 diskimage_builder-3.42.0/diskimage_builder/elements/dib-init-system/post-install.d/0000775000175000017500000000000015201026275027240 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021100000000000010207 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/dib-init-system/post-install.d/10-enable-init-scripts 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dib-init-system/post-install.d/10-enable-init-sc0000775000175000017500000000124215201026231032165 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail SCRIPTS_DIR="$(dirname $0)/../init-scripts/${DIB_INIT_SYSTEM}/" if [[ -d "${SCRIPTS_DIR}" ]]; then # figure out init prefix case "${DIB_INIT_SYSTEM}" in upstart) ;; openrc) # only gentoo needs manual runlevel adding for INIT_SCRIPT in "${SCRIPTS_DIR}"*; do rc-update add $(basename "${INIT_SCRIPT}") default done ;; systemd) ;; sysv) ;; *) echo "ERROR: DIB_INIT_SYSTEM (${DIB_INIT_SYSTEM}) is not a known type" exit 1 ;; esac fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3442369 diskimage_builder-3.42.0/diskimage_builder/elements/dib-init-system/pre-install.d/0000775000175000017500000000000015201026275027041 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dib-init-system/pre-install.d/04-dib-init-system0000775000175000017500000000064215201026231032223 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail FILE=/usr/local/bin/dib-init-system # This is a dummy script that simply echos the output of # ${DIB_INIT_SYSTEM}. This script used to try and guess the init # system, but that doesn't work. This script is deprecated. cat > ${FILE} <&2 ; exit 1 ; fi eval set -- "$TEMP" while true ; do case "$1" in -u) install_deb_packages dist-upgrade; exit 0;; -e) ACTION="remove"; shift;; -m) MAP_ELEMENT=$2; shift 2;; -h) show_options;; --) shift; break ;; *) echo "Error: unsupported option $1."; exit 1;; esac done PKGS=$@ if [ -n "$MAP_ELEMENT" ]; then if ! PKGS=$(pkg-map --element $MAP_ELEMENT $@); then echo "bin/pkg-map error. $PKGS" exit 1 fi fi if [ -z "${PKGS}" ]; then echo "Not running install-packages $ACTION with empty packages list" else install_deb_packages $ACTION $PKGS fi ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.347237 diskimage_builder-3.42.0/diskimage_builder/elements/dpkg/cleanup.d/0000775000175000017500000000000015201026275024142 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dpkg/cleanup.d/40-unblock-daemons0000775000175000017500000000055415201026231027366 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail [ -n "$TARGET_ROOT" ] sudo mv $TARGET_ROOT/sbin/start-stop-daemon.REAL $TARGET_ROOT/sbin/start-stop-daemon if [ -f $TARGET_ROOT/sbin/initctl.REAL ]; then sudo mv $TARGET_ROOT/sbin/initctl.REAL $TARGET_ROOT/sbin/initctl fi sudo rm $TARGET_ROOT/usr/sbin/policy-rc.d ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dpkg/cleanup.d/50-remove-img-build-proxy0000775000175000017500000000031215201026231030621 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail [ -n "$TARGET_ROOT" ] # Undo our proxy support sudo rm -f $TARGET_ROOT/etc/apt/apt.conf.d/60img-build-proxy ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dpkg/cleanup.d/60-untrim-dpkg0000775000175000017500000000034015201026231026541 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail [ -n "$TARGET_ROOT" ] sudo rm $TARGET_ROOT/etc/dpkg/dpkg.cfg.d/02apt-speedup sudo rm $TARGET_ROOT/etc/apt/apt.conf.d/no-languages ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dpkg/element-deps0000664000175000017500000000004715201026231024567 0ustar00zuulzuulinstall-bin manifests package-installs ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.347237 diskimage_builder-3.42.0/diskimage_builder/elements/dpkg/environment.d/0000775000175000017500000000000015201026275025057 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dpkg/environment.d/10-dpkg.bash0000664000175000017500000000006015201026231027045 0ustar00zuulzuulexport DIB_ADD_APT_KEYS=${DIB_ADD_APT_KEYS:-""} ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.347237 diskimage_builder-3.42.0/diskimage_builder/elements/dpkg/finalise.d/0000775000175000017500000000000015201026275024305 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dpkg/finalise.d/99-clean-up-cache0000775000175000017500000000033015201026231027223 0ustar00zuulzuul#!/bin/bash # Do an apt-get clean. This will free some space. if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [ "${DIB_DISABLE_APT_CLEANUP:-0}" != "1" ]; then apt-get clean fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dpkg/finalise.d/99-write-dpkg-manifest0000775000175000017500000000253015201026231030343 0ustar00zuulzuul#!/bin/bash # # Copyright 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail DPKG_MANIFEST_NAME=dib-manifest-dpkg-$(basename ${IMAGE_NAME}) # Write the json preamble echo '{"packages": [' > ${DIB_MANIFEST_IMAGE_DIR}/${DPKG_MANIFEST_NAME} # Write a json-format output for the packages installed format='{"package": "${binary:Package}","arch": "${Architecture}","version": "${Version}","status": "${db:Status-Abbrev}"},' # Use the configurable dpkg --show output as a manifest dpkg-query --show --showformat="${format}" | tee -a ${DIB_MANIFEST_IMAGE_DIR}/${DPKG_MANIFEST_NAME} # Finish off the json structure and make it easier for human inspection sed -i -e 's/,$/\n]}/g' -e 's/\(},\)/ \1\n/g' ${DIB_MANIFEST_IMAGE_DIR}/${DPKG_MANIFEST_NAME} ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.347237 diskimage_builder-3.42.0/diskimage_builder/elements/dpkg/pre-install.d/0000775000175000017500000000000015201026275024745 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dpkg/pre-install.d/00-disable-apt-recommends0000775000175000017500000000041015201026231031412 0ustar00zuulzuul#!/bin/bash # Prevent apt from installing recommended packages if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail dd of=/etc/apt/apt.conf.d/95disable-recommends << _EOF_ APT::Install-Recommends "0"; Apt::Install-Suggests "0"; _EOF_ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dpkg/pre-install.d/99-apt-get-update0000775000175000017500000000025215201026231027742 0ustar00zuulzuul#!/bin/bash # Do an apt-get update, so that packages can be installed. if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail apt-get -y update ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.348237 diskimage_builder-3.42.0/diskimage_builder/elements/dpkg/root.d/0000775000175000017500000000000015201026275023476 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dpkg/root.d/09-apt-keyring0000775000175000017500000000154715201026231026103 0ustar00zuulzuul#!/bin/bash # Copyright (c) 2020 Matthew Thode (mthode@mthode.org) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. # dib-lint: disable=safe_sudo if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [ -n "${DIB_ADD_APT_KEYS}" ]; then find "${DIB_ADD_APT_KEYS}" -type f -exec sudo cp -L {} "${TARGET_ROOT}/etc/apt/trusted.gpg.d/" \; fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dpkg/root.d/50-block-apt-translations0000775000175000017500000000074615201026231030240 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail [ -n "$TARGET_ROOT" ] # Configure APT not to fetch translations files sudo dd of=$TARGET_ROOT/etc/apt/apt.conf.d/95no-translations < /dev/null # and remove the translations, too echo 'Acquire::Languages "none";' | sudo tee $TARGET_ROOT/etc/apt/apt.conf.d/no-languages > /dev/null ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.348237 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-network/0000775000175000017500000000000015201026275024315 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-network/README.rst0000664000175000017500000000022715201026231025775 0ustar00zuulzuul============== dracut-network ============== This element was removed in the Pike cycle. Please consider using the dracut-regenerate element instead. ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.349237 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/0000775000175000017500000000000015201026275024256 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/README.rst0000664000175000017500000000144115201026231025735 0ustar00zuulzuul============== dracut-ramdisk ============== Build Dracut-based ramdisks This is an alternative to the `ramdisk` element that uses Dracut to provide the base system functionality instead of Busybox. For elements that need additional drivers in the ramdisk image, a dracut-drivers.d feature is included that works in a similar fashion to the binary-deps.d feature. The element needing to add drivers should create a dracut-drivers.d directory and populate it with a single file listing all of the kernel modules it needs added to the ramdisk. Comments are not supported in this file. Note that these modules must be installed in the chroot first. By default, the virtio, virtio_net, and virtio_blk modules are included so that ramdisks are able to function properly in a virtualized environment. ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.349237 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/binary-deps.d/0000775000175000017500000000000015201026275026715 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/binary-deps.d/dracut-ramdisk0000664000175000017500000000007515201026231031544 0ustar00zuulzuultail head awk ifconfig cut expr route ping nc wget tftp grep ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.349237 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/dracut-drivers.d/0000775000175000017500000000000015201026275027436 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/dracut-drivers.d/base-drivers0000664000175000017500000000003515201026231031735 0ustar00zuulzuulvirtio virtio_net virtio_blk ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/element-deps0000664000175000017500000000007215201026231026552 0ustar00zuulzuuldeploy-targetcli pkg-map ramdisk-base source-repositories ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.349237 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/environment.d/0000775000175000017500000000000015201026275027044 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/environment.d/10-dracut-version.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/environment.d/10-dracut-version.b0000664000175000017500000000012615201026231032361 0ustar00zuulzuul# Using 037 because that matches the current Fedora package export DRACUT_VERSION=037 ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.260235 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/extra-data.d/0000775000175000017500000000000015201026275026532 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.260235 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/extra-data.d/scripts/0000775000175000017500000000000015201026275030221 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.349237 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/extra-data.d/scripts/module/0000775000175000017500000000000015201026275031506 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022000000000000010207 xustar00122 path=diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/extra-data.d/scripts/module/deploy-cmdline.sh 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/extra-data.d/scripts/module/deplo0000775000175000017500000000103715201026231032530 0ustar00zuulzuul#!/bin/bash # NOTE(bnemec): Dracut doesn't like it if we enable these # dib-lint: disable=setu sete setpipefail dibdebugtrace # We never let Dracut boot off the specified root anyway, so all # we need is a value it will accept. root=/dev/zero rootok=1 # Dracut doesn't correctly parse the ip argument passed to us. # Override /proc/cmdline to rewrite it in a way dracut can grok. sed 's/\(ip=\S\+\)/\1:::off/' /proc/cmdline > /run/cmdline mount -n --bind -o ro /run/cmdline /proc/cmdline # Force Dracut to re-read the cmdline args CMDLINE= ././@PaxHeader0000000000000000000000000000021600000000000010214 xustar00120 path=diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/extra-data.d/scripts/module/module-setup.sh 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/extra-data.d/scripts/module/modul0000775000175000017500000000046115201026231032545 0ustar00zuulzuul#!/bin/bash # Dracut is bash too, and it doesn't play nicely with our usual sets # dib-lint: disable=setu sete setpipefail dibdebugtrace check() { return 0 } depends() { return 0 } install() { inst_hook cmdline 80 "$moddir/deploy-cmdline.sh" inst_hook pre-mount 50 "$moddir/init.sh" } ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.349237 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/init.d/0000775000175000017500000000000015201026275025443 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/init.d/00-override-troubleshoot0000664000175000017500000000037015201026231032141 0ustar00zuulzuul# NOTE(bnemec): Dracut provides its own emergency shell, and it doesn't # seem to allow directly starting bash as the existing troubleshoot function # does. function troubleshoot() { echo "Starting troubleshooting shell." emergency_shell } ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.349237 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/install.d/0000775000175000017500000000000015201026275026146 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/install.d/20-install-dracut-deps0000775000175000017500000000123515201026231032163 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail DRACUT_NETWORK="dracut-network" if [ 'ubuntu' = "$DISTRO_NAME" ]; then DRACUT_NETWORK= # Install Dracut from source because the packaged version is # broken and old. For Dracut builds we throw away the chroot # anyway so it won't matter if we've installed some build deps. install-packages build-essential arping pushd /tmp tar xJvf dracut.tar.xz pushd dracut-$DRACUT_VERSION ./configure make make install popd popd fi PACKAGES=$(pkg-map --element dracut-ramdisk ncat tftp) install-packages $DRACUT_NETWORK wget $PACKAGES ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/pkg-map0000664000175000017500000000037215201026231025527 0ustar00zuulzuul{ "family":{ "debian":{ "ncat":"netcat-traditional", "tftp":"tftp-hpa" }, "redhat":{ "ncat":"nmap-ncat" }, "suse":{ "arping": "iputils" } }, "default":{ "ncat":"ncat", "tftp":"tftp" } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3502371 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/post-install.d/0000775000175000017500000000000015201026275027131 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/post-install.d/01-ensure-drivers0000775000175000017500000000116115201026231032241 0ustar00zuulzuul#!/bin/bash set -eu set -o pipefail if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi TARGET_DIR="/tmp/in_target.d/" EXTRA_DRIVERS= for _FILE in $(ls ${TARGET_DIR}/dracut-drivers.d/) ; do _FILE="${TARGET_DIR}/dracut-drivers.d/${_FILE}" if [ -s $_FILE ]; then for _LINE in $(cat $_FILE) ; do EXTRA_DRIVERS="${EXTRA_DRIVERS} $_LINE" done fi done if [ "$EXTRA_DRIVERS" = "" ]; then echo "No extra drivers found" else DRIVERS_OUTPUT="/etc/dib_dracut_drivers" echo "Creating extra drivers record at: ${DRIVERS_OUTPUT}" echo "$EXTRA_DRIVERS" >${DRIVERS_OUTPUT} fi ././@PaxHeader0000000000000000000000000000021100000000000010207 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/post-install.d/99-build-dracut-ramdisk 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/post-install.d/99-build-dracut-ra0000775000175000017500000000567615201026231032303 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail _LIB="/tmp/ramdisk-build" source "$_LIB/common-defaults" source "$_LIB/img-defaults" source "$_LIB/ramdisk-defaults" source "$_LIB/common-functions" source "$_LIB/img-functions" source "$_LIB/ramdisk-functions" KERNEL_VERSION="${DIB_KERNEL_VERSION:-$(find_kernel_version)}" MODULE_DIR="$MODULE_ROOT/lib/modules/$KERNEL_VERSION" FIRMWARE_DIR="$MODULE_ROOT/lib/firmware" LIB_UDEV="$LIB_UDEV_ROOT/lib/udev" INIT="$_LIB/scripts/init" FUNCTIONS_D="$_LIB/scripts/d" MODULE="$_LIB/scripts/module" # NOTE(bnemec): IMAGE_ELEMENT is normally set in disk-image-create, but we're # not using that to build the image here. IMAGE_ELEMENT= mk_build_dir mkdir -p "$TMP_BUILD_DIR/mnt" export TMP_HOOKS_PATH=/tmp export TMP_MOUNT_PATH="$TMP_BUILD_DIR/mnt" echo "building ramdisk in $TMP_MOUNT_PATH" populate_init SCRIPT_HOME=/tmp/in_target.d/bin TMP_HOOKS_PATH=/tmp/in_target.d run_d ramdisk-install MODULE_PATH="/usr/lib/dracut/modules.d" cp -r "$MODULE" "$MODULE_PATH/80deploy-ramdisk" mv "$TMP_MOUNT_PATH/init" "$MODULE_PATH/80deploy-ramdisk/init.sh" # NOTE(bnemec): Workaround for bug in Dracut. This fix has been proposed to # Dracut as well in https://github.com/haraldh/dracut/pull/34 , and once it has # been released for all of our supported platforms we can remove this. Until then # this makes --include work correctly and will be a noop if we're running a fixed # Dracut version. sed -i 's|cp --reflink=auto --sparse=auto -fa -t "$s" "$i"$|cp --reflink=auto --sparse=auto -fa -t "${initdir}/${tgt}" "$i"|g' $(type -p dracut) # Notes on the options passed to Dracut: # -N: Do not build a host-specific ramdisk. We want to be able to run this ramdisk # on as many different machines as possible. # --install: A list of the binaries needed by our ramdisk script fragments. # --kernel-cmdline: Kernel parameters to pass to the ramdisk. rd.neednet is required # to force Dracut to bring up networking even if it isn't passed a # network target root. Pre-loading the ahci module is necessary # on some systems to ensure that SATA disks are recognized. # --include: Files from the chroot to include in the ramdisk. # --kver: The kernel version to use, as determined above. # --add-drivers: Extra kernel modules to include in the ramdisk. # -o: Force omission of these dracut modules. Our scripts are written for bash, # so dash is not desirable, and plymouth was causing some issues on Ubuntu. dracut -N \ --install "$(cat /etc/dib_binary_deps)" \ --kernel-cmdline "rd.shell rd.debug rd.neednet=1 rd.driver.pre=ahci" \ --include "$TMP_MOUNT_PATH/" / \ --kver "${KERNEL_VERSION}" \ --add-drivers "$(cat /etc/dib_dracut_drivers)" \ -o "dash plymouth" \ /tmp/ramdisk cp "/boot/vmlinuz-${KERNEL_VERSION}" /tmp/kernel chmod o+r /tmp/kernel # We don't want to run cleanup (set in mk_build_dir above) when this exits trap EXIT ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-ramdisk/source-repository-dracut0000664000175000017500000000016015201026231031163 0ustar00zuulzuuldracut file /tmp/dracut.tar.xz https://www.kernel.org/pub/linux/utils/boot/dracut/dracut-$DRACUT_VERSION.tar.xz ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3502371 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-regenerate/0000775000175000017500000000000015201026275024745 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-regenerate/README.rst0000664000175000017500000000132215201026231026422 0ustar00zuulzuul================= dracut-regenerate ================= Adds the possibility of regenerating dracut on image build time, giving the possibility to load extra modules. It relies on the ``DIB_DRACUT_ENABLED_MODULES`` setting, that will accept a yaml blob with the following format:: - name: packages: - - - name: packages: - - By default, this element will bring lvm and crypt modules. Also adds the ability to copy specific files into /etc/dracut.conf.d directory to allow any dracut settings to be configured. To achieve that the files to be copied need to be placed inside an specific dracut.d directory of the element. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-regenerate/element-deps0000664000175000017500000000005415201026231027241 0ustar00zuulzuulpackage-installs select-boot-kernel-initrd ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3502371 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-regenerate/environment.d/0000775000175000017500000000000015201026275027533 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021000000000000010206 xustar00114 path=diskimage_builder-3.42.0/diskimage_builder/elements/dracut-regenerate/environment.d/10-dracut-regenerate 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-regenerate/environment.d/10-dracut-regene0000664000175000017500000000041515201026231032411 0ustar00zuulzuulexport DIB_DRACUT_ENABLED_MODULES_DEFAULT_CONFIG=" - name: crypt packages: - cryptsetup - name: lvm packages: - lvm2 " DIB_DRACUT_ENABLED_MODULES=${DIB_DRACUT_ENABLED_MODULES:-${DIB_DRACUT_ENABLED_MODULES_DEFAULT_CONFIG}} export DIB_DRACUT_ENABLED_MODULES ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3502371 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-regenerate/extra-data.d/0000775000175000017500000000000015201026275027221 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-regenerate/extra-data.d/50-dracut-conf0000775000175000017500000000106115201026231031564 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 1 ]; then set -x fi set -eu set -o pipefail if [ ! -d $TMP_MOUNT_PATH/etc/dracut.conf.d ]; then sudo mkdir -p $TMP_MOUNT_PATH/etc/dracut.conf.d fi eval declare -A image_elements=($(get_image_element_array)) for i in "${!image_elements[@]}"; do element=$i element_dir=${image_elements[$i]} if [ -d "${element_dir}/dracut.conf.d/" ]; then echo "Copying dracut config from ${element_dir}" sudo cp ${element_dir}/dracut.conf.d/*.conf $TMP_MOUNT_PATH/etc/dracut.conf.d/ fi done ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3502371 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-regenerate/finalise.d/0000775000175000017500000000000015201026275026761 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020500000000000010212 xustar00111 path=diskimage_builder-3.42.0/diskimage_builder/elements/dracut-regenerate/finalise.d/50-dracut-regenerate 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-regenerate/finalise.d/50-dracut-regenerat0000775000175000017500000000702415201026231032360 0ustar00zuulzuul#!/usr/bin/env python3 # Copyright 2017 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import glob import logging import os import re import subprocess import yaml logging.basicConfig( level=logging.DEBUG if int(os.getenv('DIB_DEBUG_TRACE', 0)) > 0 else logging.INFO) def main(): logging.info("Starting dracut regeneration") logging.debug("Debug logging enabled") dracut_env = os.getenv('DIB_DRACUT_ENABLED_MODULES') dracut_objects = yaml.safe_load(dracut_env) logging.debug(dracut_objects) modules_to_boot = [] for dracut_object in dracut_objects: # first, install dependent packages packages = dracut_object.get('packages', []) for package in packages: cmdline = ["install-packages", package] logging.debug("Calling: %s" % cmdline) subp = subprocess.Popen(cmdline, stdout=subprocess.PIPE) out = subp.communicate()[0] if subp.returncode: e = subprocess.CalledProcessError(subp.returncode, cmdline) e.output = out raise e # second, compose the list of modules to boot modules_to_boot.append(dracut_object.get('name', None)) conf_overrides = glob.glob('/etc/dracut.conf.d/*.conf') # regenerate dracut with the list of installed modules and conf overrides if modules_to_boot or conf_overrides: cmdline = ["select-boot-kernel-initrd"] logging.debug("Calling: %s" % cmdline) subp = subprocess.Popen(cmdline, stdout=subprocess.PIPE) out, err = subp.communicate() if subp.returncode: e = subprocess.CalledProcessError(subp.returncode, cmdline) e.output = out raise e kernel_set = out.decode().split(':') kernel_search = re.match("vmlinuz-(.*)", kernel_set[0]) kernel_version = "%s" % kernel_search.groups(1) ramdisk_path = "/boot/%s" % kernel_set[1].strip() # list installed modules of dracut cmdline = ['dracut', '--list-modules'] cmdline += [ramdisk_path, kernel_version] logging.debug("Calling: %s" % cmdline) subp = subprocess.Popen(cmdline, stdout=subprocess.PIPE) out, err = subp.communicate() if subp.returncode: e = subprocess.CalledProcessError(subp.returncode, cmdline) e.output = out raise e cmdline = ['dracut', '--force'] if modules_to_boot: modules_to_boot = ' ' .join(modules_to_boot) cmdline += ['--add', modules_to_boot] cmdline += ['-f', ramdisk_path, kernel_version] logging.debug("Calling: %s" % cmdline) subp = subprocess.Popen(cmdline, stdout=subprocess.PIPE) out, err = subp.communicate() if subp.returncode: e = subprocess.CalledProcessError(subp.returncode, cmdline) e.output = out raise e logging.info("dracut regenerate done") if __name__ == '__main__': main() # Local Variables: # mode: python # End: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-regenerate/package-installs.yaml0000664000175000017500000000005015201026231031036 0ustar00zuulzuulpython3-PyYAML: phase: pre-install.d ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dracut-regenerate/pkg-map0000664000175000017500000000050115201026231026210 0ustar00zuulzuul{ "family": { "gentoo": { "python3-PyYAML": "dev-python/pyyaml" }, "suse": { "python3-PyYAML": "python3-PyYAML" }, "redhat": { "python3-PyYAML": "python3-PyYAML" }, "debian": { "python3-PyYAML": "python3-yaml" } }, "default": { "python3-PyYAML": "" } } ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.351237 diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/0000775000175000017500000000000015201026275024076 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/README.rst0000664000175000017500000000423715201026231025563 0ustar00zuulzuul============= dynamic-login ============= This element insert a helper script in the image that allows users to dynamically configure credentials at boot time. This is specially useful for troubleshooting. Troubleshooting an image can be quite hard, specially if you can not get a prompt you can enter commands to find out what went wrong. By default, the images (specially ramdisks) doesn't have any SSH key or password for any user. Of course one could use the ``devuser`` element to generate an image with SSH keys and user/password in the image but that would be a massive security hole and very it's discouraged to run in production with a ramdisk like that. This element allows the operator to inject a SSH key and/or change the root password dynamically when the image boots. Two kernel command line parameters are used to do it: sshkey :Description: If the operator append sshkey="$PUBLIC_SSH_KEY" to the kernel command line on boot, the helper script will append this key to the root user authorized_keys. rootpwd :Description: If the operator append rootpwd="$ENCRYPTED_PASSWORD" to the kernel command line on boot, the helper script will set the root password to the one specified by this option. Note that this password must be **encrypted** and encoded in base64 format. For compatibility with previous versions of this element, the later step can be avoided but then $ character must be escaped. Encrypted passwords can be generated using the ``openssl`` command, e.g: ``openssl passwd -6 -stdin <<< YOUR_PASSWORD | base64 -w 0``. .. note:: The value of these parameters must be **quoted**, e.g: sshkey="ssh-rsa BBBA1NBzaC1yc2E ..." .. warning:: Some base operational systems might require selinux to be in **permissive** or **disabled** mode so that you can log in the image. This can be achieved by building the image with the ``selinux-permissive`` element for diskimage-builder or by passing ``selinux=0`` in the kernel command line. RHEL/CentOS are examples of OSs which this is true. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/element-deps0000664000175000017500000000005615201026231026374 0ustar00zuulzuuldib-init-system install-static openssh-server ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2622352 diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/init-scripts/0000775000175000017500000000000015201026275026526 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.351237 diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/init-scripts/systemd/0000775000175000017500000000000015201026275030216 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021400000000000010212 xustar00118 path=diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/init-scripts/systemd/dynamic-login.service 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/init-scripts/systemd/dynamic-login0000664000175000017500000000023415201026231032662 0ustar00zuulzuul[Unit] Description=Dynamic Login After=network.target [Service] Type=oneshot ExecStart=/usr/local/bin/dynamic-login [Install] WantedBy=multi-user.target ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.351237 diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/init-scripts/sysv/0000775000175000017500000000000015201026275027532 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020600000000000010213 xustar00112 path=diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/init-scripts/sysv/dynamic-login.init 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/init-scripts/sysv/dynamic-login.in0000775000175000017500000000111015201026231032600 0ustar00zuulzuul#!/bin/sh -e ### BEGIN INIT INFO # Provides: dynamic-login # Required-Start: $local_fs networking # Required-Stop: $local_fs # Default-Start: S # Default-Stop: 0 6 # X-Start-Before: # Short-Description: Dynamic Login # Description: Execute Dynamic Login ### END INIT INFO NAME=dynamic-login INIT_NAME=/etc/init.d/${NAME} SCRIPT_NAME=/usr/local/bin/${NAME} [ -x $SCRIPT_NAME ] || exit 0 case "$1" in start) $SCRIPT_NAME ;; stop) ;; *) echo "Usage: $INIT_NAME {start}" exit 1 ;; esac exit 0 ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.351237 diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/init-scripts/upstart/0000775000175000017500000000000015201026275030230 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021100000000000010207 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/init-scripts/upstart/dynamic-login.conf 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/init-scripts/upstart/dynamic-login0000664000175000017500000000030215201026231032670 0ustar00zuulzuuldescription "Dynamic Login" start on runlevel [2345] stop on runlevel [!2345] umask 022 expect stop script echo "Executing Dynamic Login" /usr/local/bin/dynamic-login end script ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.351237 diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/install.d/0000775000175000017500000000000015201026275025766 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021400000000000010212 xustar00118 path=diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/install.d/70-enable-dynamic-login-services 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/install.d/70-enable-dynamic-login-0000775000175000017500000000041315201026231032161 0ustar00zuulzuul#!/bin/bash if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail case "$DIB_INIT_SYSTEM" in systemd) systemctl enable dynamic-login.service ;; sysv) update-rc.d dynamic-login.init defaults ;; esac ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2622352 diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/static/0000775000175000017500000000000015201026275025365 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2622352 diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/static/usr/0000775000175000017500000000000015201026275026176 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2622352 diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/static/usr/local/0000775000175000017500000000000015201026275027270 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.351237 diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/static/usr/local/bin/0000775000175000017500000000000015201026275030040 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/dynamic-login/static/usr/local/bin/dynamic-login0000775000175000017500000000246615201026231032520 0ustar00zuulzuul#!/bin/bash # dib-lint: disable=dibdebugtrace # Copyright 2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. set -eu set -o pipefail # Reads an encrypted root password from the kernel command line and set # it to the root user if [[ $( $SSHDIR/authorized_keys chmod 600 $SSHDIR/authorized_keys fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3522372 diskimage_builder-3.42.0/diskimage_builder/elements/element-manifest/0000775000175000017500000000000015201026275024601 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/element-manifest/README.rst0000664000175000017500000000041715201026231026262 0ustar00zuulzuul================ element-manifest ================ Writes a manifest file that is the full list of elements that were used to build the image. The file path can be overridden by setting $DIB\_ELEMENT\_MANIFEST\_PATH, and defaults to /etc/dib-manifests/element-manifest. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/element-manifest/element-deps0000664000175000017500000000001215201026231027067 0ustar00zuulzuulmanifests ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3522372 diskimage_builder-3.42.0/diskimage_builder/elements/element-manifest/extra-data.d/0000775000175000017500000000000015201026275027055 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021400000000000010212 xustar00118 path=diskimage_builder-3.42.0/diskimage_builder/elements/element-manifest/extra-data.d/75-inject-element-manifest 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/element-manifest/extra-data.d/75-inject-element-0000775000175000017500000000055315201026231032207 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail DIB_ELEMENT_MANIFEST_PATH=${DIB_ELEMENT_MANIFEST_PATH:-"$DIB_MANIFEST_IMAGE_DIR/dib-element-manifest"} sudo mkdir -p $TMP_MOUNT_PATH/$(dirname $DIB_ELEMENT_MANIFEST_PATH) sudo /bin/bash -c "echo $IMAGE_ELEMENT | tr ' ' '\n' > $TMP_MOUNT_PATH/$DIB_ELEMENT_MANIFEST_PATH" ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3522372 diskimage_builder-3.42.0/diskimage_builder/elements/elrepo/0000775000175000017500000000000015201026275022632 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/elrepo/README.rst0000664000175000017500000000055715201026231024320 0ustar00zuulzuul====== ELRepo ====== Enables ELRepo, a community based repository for Enterprise Linux Packages with a focus on drivers for hardware such as network interface cards. RHEL/CentOS versions pior to 8 are not supported. * ``DIB_ELREPO_KERNEL`` Whether elrepo-kernel repository containing kernel-ml packages should be enabled (1) or disabled. Default is disabled (0). ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3522372 diskimage_builder-3.42.0/diskimage_builder/elements/elrepo/pre-install.d/0000775000175000017500000000000015201026275025306 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/elrepo/pre-install.d/01-elrepo0000775000175000017500000000073315201026231026733 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail case "$DISTRO_NAME" in almalinux* | centos* | rhel* | rocky*) dnf install -y elrepo-release.noarch if [ ${DIB_ELREPO_KERNEL:-0} -eq 1 ]; then rpm -q dnf-plugins-core || dnf install -y dnf-plugins-core dnf config-manager --set-enabled "elrepo-kernel" fi ;; *) echo "Distro \"$DISTRO_NAME\" is not supported" exit 1 ;; esac exit 0 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3522372 diskimage_builder-3.42.0/diskimage_builder/elements/enable-serial-console/0000775000175000017500000000000015201026275025507 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/enable-serial-console/README.rst0000664000175000017500000000060515201026231027167 0ustar00zuulzuul===================== enable-serial-console ===================== Start getty on active serial consoles. With ILO and other remote admin environments, having a serial console can be useful for debugging and troubleshooting. For upstart: If ttyS1 exists, getty will run on that, otherwise on ttyS0. For systemd: We dynamically start a getty on any active serial port via udev rules. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3522372 diskimage_builder-3.42.0/diskimage_builder/elements/enable-serial-console/cleanup.d/0000775000175000017500000000000015201026275027360 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/enable-serial-console/cleanup.d/99-fix-grub0000664000175000017500000000072115201026231031255 0ustar00zuulzuulset -euxo BOOTDIR=$TARGET_ROOT/boot # Splashimage in grub has a known issue with serial console # So grub config file needs to be fixed. if [ -f $BOOTDIR/grub/grub.conf ] ; then sed -i -e "/^splashimage/d;s/ rhgb\( \|$\)/\1/g;s/ quiet\( \|$\)/\1/g;/^serial/d;/^terminal/d;/^hiddenmenu/d" $BOOTDIR/grub/grub.conf sed -i "/^default/aserial --unit=0 --speed=9600 --word=8 --parity=no --stop=1\nterminal --timeout=5 serial console" $BOOTDIR/grub/grub.conf fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3532372 diskimage_builder-3.42.0/diskimage_builder/elements/enable-serial-console/install.d/0000775000175000017500000000000015201026275027377 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/enable-serial-console/install.d/20-stty0000775000175000017500000000201615201026231030536 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail SCRIPTDIR=$(dirname $0) if [ "$DIB_INIT_SYSTEM" == "upstart" ]; then install -m 0644 -o root -g root ${SCRIPTDIR}/ttySx.conf /etc/init/ttySx.conf elif [ "$DIB_INIT_SYSTEM" == "systemd" ]; then install -D -g root -o root -m 0644 ${SCRIPTDIR}/serial-console-udev.rules /etc/udev/rules.d/99-serial-console.rules elif [ "$DIB_INIT_SYSTEM" == "openrc" ]; then sed -r 's/^#(.*ttyS[0,1].*$)/\1/' -i /etc/inittab echo '# diskimage-builder serial console' >> /etc/inittab echo -n 's0:12345:respawn:/sbin/agetty -L 115200 ' >> /etc/inittab if [[ -n "${DIB_BOOTLOADER_SERIAL_CONSOLE}" ]]; then echo -n "${DIB_BOOTLOADER_SERIAL_CONSOLE}" >> /etc/inittab elif [[ "powerpc ppc64 ppc64le" =~ ${ARCH} ]]; then echo -n "hvc0" >> /etc/inittab elif [[ "arm64" =~ ${ARCH} ]]; then echo -n "ttyAMA0" >> /etc/inittab else echo -n "ttyS0" >> /etc/inittab fi echo ' vt100' >> /etc/inittab fi ././@PaxHeader0000000000000000000000000000021500000000000010213 xustar00119 path=diskimage_builder-3.42.0/diskimage_builder/elements/enable-serial-console/install.d/serial-console-udev.rules 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/enable-serial-console/install.d/serial-console-u0000664000175000017500000000015515201026231032474 0ustar00zuulzuulSUBSYSTEM=="tty", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}+="getty@$name.service", ATTRS{type}=="4" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/enable-serial-console/install.d/ttySx.conf0000664000175000017500000000070415201026231031372 0ustar00zuulzuul# This service maintains a getty on ttyS0/1 from the point the system is # started until it is shut down again. start on stopped rc or RUNLEVEL=[2345] stop on runlevel [!2345] respawn script console_port=0 echo "ttySx probing ttyS1" >/dev/ttyS1 2>/dev/null && console_port=1 echo "ttySx: console tty = /dev/ttyS$console_port" >&2 exec /sbin/agetty -m ttyS$console_port 115200,57600,38400,9600,4800 vt102 end script ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3532372 diskimage_builder-3.42.0/diskimage_builder/elements/ensure-venv/0000775000175000017500000000000015201026275023621 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ensure-venv/README.rst0000664000175000017500000000014015201026231025273 0ustar00zuulzuul=========== ensure-venv =========== A simple element to make sure `python3 -m venv` will work. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ensure-venv/element-deps0000664000175000017500000000002115201026231026107 0ustar00zuulzuulpackage-installs ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ensure-venv/package-installs.yaml0000664000175000017500000000001615201026231027714 0ustar00zuulzuulpython3-venv: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ensure-venv/pkg-map0000664000175000017500000000044715201026231025075 0ustar00zuulzuul{ "family": { "debian": { "python3-venv": "python3-venv" }, "gentoo": { "python3-venv": "dev-lang/python" }, "redhat": { "python3-venv": "python3" }, "suse": { "python3-venv": "python3" } }, "default": { "python3-venv": "" } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3532372 diskimage_builder-3.42.0/diskimage_builder/elements/epel/0000775000175000017500000000000015201026275022271 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/epel/README.rst0000664000175000017500000000141315201026231023747 0ustar00zuulzuul==== epel ==== This element installs the Extra Packages for Enterprise Linux (EPEL) repository GPG key as well as configuration for yum. Note this element is only useful with platforms that have EPEL support such as CentOS and RHEL DIB_EPEL_MIRROR: :Required: No :Default: None :Description: To use a EPEL Yum mirror, set this variable to the mirror URL before running bin/disk-image-create. This URL should point to the directory containing the ``5/6/7`` directories. :Example: ``DIB\_EPEL\_MIRROR=http://dl.fedoraproject.org/pub/epel`` DIB_EPEL_DISABLED: :Required: No :Default: 0 :Description: To disable the EPEL repo (but leave it available if used with an explicit ``--enablerepo``) set this to 1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/epel/element-deps0000664000175000017500000000002115201026231024557 0ustar00zuulzuulpackage-installs ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/epel/package-installs.yaml0000664000175000017500000000007715201026231026373 0ustar00zuulzuulwget: phase: pre-install.d yum-utils: phase: pre-install.d ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/epel/pkg-map0000664000175000017500000000046315201026231023543 0ustar00zuulzuul{ "distro": { "almalinux": { "wget": "wget", "yum-utils": "yum-utils" }, "centos": { "wget": "wget", "yum-utils": "yum-utils" }, "rocky": { "wget": "wget", "yum-utils": "yum-utils" } }, "default": { "wget": "", "yum-utils": "" } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3532372 diskimage_builder-3.42.0/diskimage_builder/elements/epel/pre-install.d/0000775000175000017500000000000015201026275024745 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/epel/pre-install.d/05-rpm-epel-release0000775000175000017500000000200715201026231030243 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [[ (${DISTRO_NAME} =~ "almalinux" || ${DISTRO_NAME} =~ "centos" || ${DISTRO_NAME} =~ "rocky") ]]; then # Centos has "epel-release" in extras, which is default enabled. ${YUM} install -y epel-release else echo "$DISTRO_NAME is not supported" # Not really a failure; we just don't do anything exit 0 fi if [ ${DIB_EPEL_DISABLED:-0} -ne 0 ]; then if [[ ${YUM} == "dnf" ]]; then rpm -q dnf-plugins-core || dnf install -y dnf-plugins-core dnf config-manager --set-disabled "epel*" else # Cannot rely on package-installs, it is executed later rpm -q yum-utils || yum install -y yum-utils yum-config-manager --disable "epel*" fi fi DIB_EPEL_MIRROR=${DIB_EPEL_MIRROR:-} [ -n "$DIB_EPEL_MIRROR" ] || exit 0 # Set the EPEL mirror to use sed -e "s|^#baseurl=http[s]*://.*/pub/epel|baseurl=$DIB_EPEL_MIRROR|;/^mirrorlist=/d;/^metalink=/d" -i /etc/yum.repos.d/epel.repo ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.354237 diskimage_builder-3.42.0/diskimage_builder/elements/fail2ban/0000775000175000017500000000000015201026275023022 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fail2ban/README.rst0000664000175000017500000000112715201026231024502 0ustar00zuulzuul======== fail2ban ======== This element installs the fail2ban binary from the upstream repositories. In the case of rocky linux, fail2ban lives in epel so the 'epel' element must also be included. In addition, a compulsory jail.local is expected, localy on the build system, to be inserted in the final image. Environment Variables --------------------- DIB_FAIL2BAN_CONF: :Required: Yes :Default: None :Description: The location of a fail2ban.conf file on the Builder system which will be injected into the image :Example: ``DIB_FAIL2BAN_CONF=~/home/jail.local`` .. element_deps:: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fail2ban/element-deps0000664000175000017500000000002115201026231025310 0ustar00zuulzuulpackage-installs ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fail2ban/package-installs.yaml0000664000175000017500000000003515201026231027116 0ustar00zuulzuulfail2ban: phase: install.d ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.354237 diskimage_builder-3.42.0/diskimage_builder/elements/fail2ban/post-install.d/0000775000175000017500000000000015201026275025675 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020600000000000010213 xustar00112 path=diskimage_builder-3.42.0/diskimage_builder/elements/fail2ban/post-install.d/80-enable-fail2ban-service 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fail2ban/post-install.d/80-enable-fail2ban-servi0000775000175000017500000000231715201026231032073 0ustar00zuulzuul#!/bin/bash # Copyright (c) 2023 ECMWF # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail case "$DIB_INIT_SYSTEM" in systemd) systemctl enable fail2ban.service ;; openrc) rc-update add fail2ban default ;; *) echo "Unsupported init system $DIB_INIT_SYSTEM" exit 1 ;; esac if [ -z "${DIB_FAIL2BAN_CONF:-}" ] ; then echo "DIB_FAIL2BAN_CONF is not set - no fail2ban config can be found" exit 0 fi for file in $DIB_FAIL2BAN_CONF; do if [ -f $file ]; then echo "$file is not a valid fail2ban file" echo "We need a proper file DIB_FAIL2BAN.CONF" fi done ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.354237 diskimage_builder-3.42.0/diskimage_builder/elements/fail2ban/root.d/0000775000175000017500000000000015201026275024227 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fail2ban/root.d/60-copy-fail2ban-config0000775000175000017500000000147515201026231030270 0ustar00zuulzuul#!/bin/bash # Copyright (c) 2023 ECMWF # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail if [[ -n ${DIB_FAIL2BAN_CONF:-} ]]; then sudo mkdir $TARGET_ROOT/etc/fail2ban sudo cp ${DIB_FAIL2BAN_CONF} $TARGET_ROOT/etc/fail2ban/jail.local fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3552372 diskimage_builder-3.42.0/diskimage_builder/elements/fedora/0000775000175000017500000000000015201026275022604 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora/README.rst0000664000175000017500000000171215201026231024264 0ustar00zuulzuul====== fedora ====== Use Fedora cloud images as the baseline for built disk images. For further details see the redhat-common README. Releases -------- This element targets the current and previous version of Fedora; these values clearly changes over time. To fix the version set the `DIB_RELEASE` variable to the Fedora version (e.g. ``36``). The default value is the current best supported version (i.e. it may change upward at any given release to support the next Fedora). Environment Variables --------------------- DIB_DISTRIBUTION_MIRROR: :Required: No :Default: None :Description: To use a Fedora Yum mirror, set this variable to the mirror URL before running bin/disk-image-create. This URL should point to the directory containing the ``releases/updates/development`` and ``extras`` directories. :Example: ``DIB\_DISTRIBUTION\_MIRROR=http://download.fedoraproject.org/pub/fedora/linux`` ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora/element-deps0000664000175000017500000000010015201026231025070 0ustar00zuulzuulcache-url dkms redhat-common rpm-distro source-repositories yum ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora/element-provides0000664000175000017500000000002115201026231025772 0ustar00zuulzuuloperating-system ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.357237 diskimage_builder-3.42.0/diskimage_builder/elements/fedora/environment.d/0000775000175000017500000000000015201026275025372 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora/environment.d/10-fedora-distro-name.bash0000664000175000017500000000014215201026231032114 0ustar00zuulzuulexport DISTRO_NAME=fedora export DIB_RELEASE=${DIB_RELEASE:-37} export EFI_BOOT_DIR="EFI/fedora" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora/environment.d/11-yum-dnf.bash0000664000175000017500000000031615201026231030017 0ustar00zuulzuul# since f22, dnf is the yum replacement. Mostly it drops in # unmodified, so while we transition KISS and use this to choose if [ $DIB_RELEASE -ge 22 ]; then export YUM=dnf else export YUM=yum fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora/package-installs.yaml0000664000175000017500000000262515201026231026707 0ustar00zuulzuul# On a fresh Fedora 18 install you might have to update audit in order to # fix a conflict with a file from the glibc package. # https://bugzilla.redhat.com/show_bug.cgi?id=894307 audit: # The version of openssl shipped in the fedora cloud image is no longer # compatible with new python environments installed by virtualenv, so we need # to update it first. # See https://bugs.launchpad.net/diskimage-builder/+bug/1254879 openssl: # FIXME: To avoid conflict between the pyOpenSSL installed via python-pip # and pyOpenSSL installed via yum, we are going to sort it out installing # it earlier at the beginning of the image building process. Python-pip # is installing pyOpenSSL as part of satisfying the requirements.txt # in python-glanceclient and afterwards yum tries to install it as a # dependency of the python-paste package needed for the heat element, # this seems to be conflicting and causing the image building process to # fail. The problem is happening on a Fedora 18 system. pyOpenSSL: # Workaround for: # https://bugzilla.redhat.com/show_bug.cgi?id=1066983 vim-minimal: # kernel modules to match the core kernel # Newer Fedora 21 splits these out into a separate package. # It contains iscsi_tcp.ko (for Ironic) among other things like network # driver modules, etc. kernel-modules: # This small package is required on Fedora 21 in order to build some # packages via source (MySQL driver). redhat-rpm-config: ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.357237 diskimage_builder-3.42.0/diskimage_builder/elements/fedora/pre-install.d/0000775000175000017500000000000015201026275025260 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora/pre-install.d/00-02-set-fedora-mirror0000775000175000017500000000155615201026231031202 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-} [ -n "$DIB_DISTRIBUTION_MIRROR" ] || exit 0 if [[ ${DIB_RELEASE} -gt 27 ]]; then # urgh, the repo is wrong in the "baseurl" line, see # https://pagure.io/fedora/repos/issue/70 for FILE in /etc/yum.repos.d/fedora-updates.repo /etc/yum.repos.d/fedora-updates-testing.repo; do sed -i "s,/os/,," $FILE done fi for FILE in /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora-updates.repo /etc/yum.repos.d/fedora-updates-testing.repo; do # In >=32 this became "download.example" not # "download.fedoraproject.org" cat $FILE sudo sed -e "s,^#baseurl=http[s]*://download.\(fedoraproject.org\|example\)/pub/fedora/linux,baseurl=$DIB_DISTRIBUTION_MIRROR,;/^metalink/d" -i $FILE cat $FILE done ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora/pre-install.d/02-set-machine-id0000775000175000017500000000115015201026231030201 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # The systemd .spec file does this in %post [1] and it turns out that # (in what is possibly a bug [2]) that kernel install requires # /etc/machine-id. This affects "fedora" (the image-based build) if # there is no systemd update to install ... with "fedora-minimal" we # are always installing into the chroot so, so %post always runs and # this is always run # # [1] https://src.fedoraproject.org/rpms/systemd/blob/master/f/systemd.spec # [2] https://bugzilla.redhat.com/show_bug.cgi?id=1486124 systemd-machine-id-setup ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.357237 diskimage_builder-3.42.0/diskimage_builder/elements/fedora/root.d/0000775000175000017500000000000015201026275024011 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora/root.d/10-fedora-cloud-image0000775000175000017500000000535115201026231027575 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail [ -n "$ARCH" ] [ -n "$TARGET_ROOT" ] if [ 'amd64' = "$ARCH" ] ; then ARCH="x86_64" fi if [[ "${ARCH}" == "arm64" ]]; then ARCH="aarch64" fi DIB_LOCAL_IMAGE=${DIB_LOCAL_IMAGE:-""} if [ -n "$DIB_LOCAL_IMAGE" ]; then IMAGE_LOCATION=$DIB_LOCAL_IMAGE # No need to copy a local image into the cache directory, so just specify # the cached path as the original path. CACHED_IMAGE=$IMAGE_LOCATION BASE_IMAGE_FILE=`basename $DIB_LOCAL_IMAGE` BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz else # note default DIB_RELEASE set in environment setup case ${ARCH} in x86_64|aarch64) if [[ ${DIB_RELEASE} -ge 37 ]]; then DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://download.fedoraproject.org/pub/fedora/linux/releases/${DIB_RELEASE}/Cloud/${ARCH}/images} elif [[ ${DIB_RELEASE} -ge 28 ]] && [[ ${DIB_RELEASE} -le 36 ]]; then DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/${DIB_RELEASE}/Cloud/${ARCH}/images} else DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/${DIB_RELEASE}/CloudImages/${ARCH}/images} fi ;; ppc64|ppc64le) if [[ ${DIB_RELEASE} -ge 37 ]]; then DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://dl.fedoraproject.org/pub/fedora-secondary/releases/${DIB_RELEASE}/Cloud/${ARCH}/images} elif [[ ${DIB_RELEASE} -ge 28 ]] && [[ ${DIB_RELEASE} -le 36 ]]; then DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://archives.fedoraproject.org/pub/archive/fedora-secondary/releases/${DIB_RELEASE}/Cloud/${ARCH}/images} else DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://archives.fedoraproject.org/pub/archive/fedora-secondary/releases/${DIB_RELEASE}/CloudImages/${ARCH}/images} fi ;; *) echo "Error: unknown ARCH: ${ARCH}" exit 1 ;; esac # We have curl write headers to stderr so that we can debug fedora # mirror locations that don't have valid subreleases in their paths. SUBRELEASE_REGEXP=${SUBRELEASE_REGEXP:-'(?<=Fedora-Cloud-Base-'${DIB_RELEASE}'-).*?(?=.'${ARCH}'.qcow2)'} SUBRELEASE=$(head -1 < <(curl -Lis -D /dev/stderr $DIB_CLOUD_IMAGES/ | grep -o -P $SUBRELEASE_REGEXP | sort -r)) BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-Fedora-Cloud-Base-$DIB_RELEASE-$SUBRELEASE.$ARCH.qcow2} BASE_IMAGE_TAR=Fedora-Cloud-Base-$DIB_RELEASE-$SUBRELEASE.$ARCH.tgz IMAGE_LOCATION=$DIB_CLOUD_IMAGES/$BASE_IMAGE_FILE CACHED_IMAGE=$DIB_IMAGE_CACHE/$BASE_IMAGE_FILE fi $TMP_HOOKS_PATH/bin/extract-image $BASE_IMAGE_FILE $BASE_IMAGE_TAR $IMAGE_LOCATION $CACHED_IMAGE ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2652352 diskimage_builder-3.42.0/diskimage_builder/elements/fedora/test-elements/0000775000175000017500000000000015201026275025375 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3582373 diskimage_builder-3.42.0/diskimage_builder/elements/fedora/test-elements/build-succeeds/0000775000175000017500000000000015201026275030270 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora/test-elements/build-succeeds/element-deps0000664000175000017500000000003215201026231032560 0ustar00zuulzuulbase openstack-ci-mirrors ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3552372 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/0000775000175000017500000000000015201026275024564 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/README.rst0000664000175000017500000000045615201026231026250 0ustar00zuulzuul================ fedora-container ================ Create a minimal image based on Fedora container image This element sets the ``DISTRO_NAME`` var to 'fedora'. The release of fedora to be installed can be controlled through the ``DIB_RELEASE`` variable, which defaults the latest supported release. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3552372 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/containerfiles/0000775000175000017500000000000015201026275027571 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/containerfiles/340000664000175000017500000000007715201026231027736 0ustar00zuulzuulFROM docker.io/library/fedora:34 RUN dnf install -y findutils ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/containerfiles/350000664000175000017500000000011215201026231027725 0ustar00zuulzuulFROM docker.io/library/fedora:35 RUN dnf install -y findutils util-linux ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/containerfiles/360000664000175000017500000000011215201026231027726 0ustar00zuulzuulFROM docker.io/library/fedora:36 RUN dnf install -y findutils util-linux ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/containerfiles/370000664000175000017500000000011215201026231027727 0ustar00zuulzuulFROM docker.io/library/fedora:37 RUN dnf install -y findutils util-linux ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/element-deps0000664000175000017500000000007415201026231027062 0ustar00zuulzuulcontainerfile package-installs redhat-common rpm-distro yum ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3562372 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/environment.d/0000775000175000017500000000000015201026275027352 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022000000000000010207 xustar00122 path=diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/environment.d/10-01-fedora-distro-name.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/environment.d/10-01-fedora-dist0000664000175000017500000000014115201026231032116 0ustar00zuulzuulexport DISTRO_NAME=fedora export DIB_RELEASE=${DIB_RELEASE:-34} export EFI_BOOT_DIR="EFI/fedora" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/environment.d/11-yum-dnf.bash0000664000175000017500000000001715201026231031775 0ustar00zuulzuulexport YUM=dnf ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/package-installs.yaml0000664000175000017500000000034215201026231030661 0ustar00zuulzuulaudit: dnf-plugins-core: dracut: dracut-config-generic: grubby: kernel: initscripts: man-pages: lsb_release: redhat-rpm-config: linux-firmware: uninstall: true linux-firmware-whence: uninstall: true glibc-langpack-en: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/pkg-map0000664000175000017500000000013415201026231026031 0ustar00zuulzuul{ "family": { "redhat": { "lsb_release": "redhat-lsb-core" } } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2642353 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/test-elements/0000775000175000017500000000000015201026275027355 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3562372 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/test-elements/build-succeeds/0000775000175000017500000000000015201026275032250 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021400000000000010212 xustar00118 path=diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/test-elements/build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/test-elements/build-succeeds/RE0000664000175000017500000000005615201026231032472 0ustar00zuulzuulVerify we can build a fedora-container image. ././@PaxHeader0000000000000000000000000000021600000000000010214 xustar00120 path=diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/test-elements/build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-container/test-elements/build-succeeds/el0000664000175000017500000000005115201026231032557 0ustar00zuulzuulblock-device-gpt openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3562372 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-minimal/0000775000175000017500000000000015201026275024230 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-minimal/README.rst0000664000175000017500000000202115201026231025702 0ustar00zuulzuul============== fedora-minimal ============== *Note* as at February 2022, this element is no longer tested or used by OpenDev. Changes to the RPM format used by recent Fedora releases have meant that this element can not build on Ubuntu hosts, which lack a packaged RPM sufficient to extract the base chroot environment. The ``fedora-containerfile`` element can be used instead of this element. Create a minimal image based on Fedora. Use of this element will require 'yum' and 'yum-utils' to be installed on Ubuntu and Debian. Nothing additional is needed on Fedora or CentOS. The element will need `python-lzma` everywhere. Due to a bug in the released version of urlgrabber, on many systems an installation of urlgrabber from git is required. The git repository can be found here: http://yum.baseurl.org/gitweb?p=urlgrabber.git;a=summary This element sets the ``DISTRO_NAME`` var to 'fedora'. The release of fedora to be installed can be controlled through the ``DIB_RELEASE`` variable, which defaults the latest supported release. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-minimal/element-deps0000664000175000017500000000001415201026231026520 0ustar00zuulzuulyum-minimal ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-minimal/element-provides0000664000175000017500000000002115201026231027416 0ustar00zuulzuuloperating-system ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.357237 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-minimal/environment.d/0000775000175000017500000000000015201026275027016 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/fedora-minimal/environment.d/10-fedora-distro-name.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-minimal/environment.d/10-fedora-distro-na0000664000175000017500000000014115201026231032301 0ustar00zuulzuulexport DISTRO_NAME=fedora export DIB_RELEASE=${DIB_RELEASE:-32} export EFI_BOOT_DIR="EFI/fedora" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-minimal/environment.d/11-yum-dnf.bash0000664000175000017500000000031615201026231031443 0ustar00zuulzuul# since f22, dnf is the yum replacement. Mostly it drops in # unmodified, so while we transition KISS and use this to choose if [ $DIB_RELEASE -ge 22 ]; then export YUM=dnf else export YUM=yum fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2642353 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-minimal/test-elements/0000775000175000017500000000000015201026275027021 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.357237 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-minimal/test-elements/build-succeeds/0000775000175000017500000000000015201026275031714 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021200000000000010210 xustar00116 path=diskimage_builder-3.42.0/diskimage_builder/elements/fedora-minimal/test-elements/build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-minimal/test-elements/build-succeeds/READ0000664000175000017500000000005415201026231032341 0ustar00zuulzuulVerify we can build a fedora-minimal image. ././@PaxHeader0000000000000000000000000000021400000000000010212 xustar00118 path=diskimage_builder-3.42.0/diskimage_builder/elements/fedora-minimal/test-elements/build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-minimal/test-elements/build-succeeds/elem0000664000175000017500000000002415201026231032545 0ustar00zuulzuulblock-device-gpt vm ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.357237 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-minimal/yum.repos.d/0000775000175000017500000000000015201026275026413 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fedora-minimal/yum.repos.d/yum.repo0000664000175000017500000000111215201026231030077 0ustar00zuulzuul[fedora] name=Fedora $releasever - $basearch #baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch gpgcheck=0 skip_if_unavailable=False [updates] name=Fedora $releasever - $basearch - Updates #baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/$releasever/Everything/$basearch/ metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch enabled=1 gpgcheck=0 skip_if_unavailable=False ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3582373 diskimage_builder-3.42.0/diskimage_builder/elements/fips/0000775000175000017500000000000015201026275022305 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fips/README.rst0000664000175000017500000000212415201026231023763 0ustar00zuulzuul==== fips ==== This image element attempts to setup the image so it will boot and operate in what is often referred to as "FIPS mode", where cryptography policies and algorithms are enforced to only those which are FIPS approved and certified. In this context, FIPS is an abbreviation for Federal Information Processing Standard, specifically publication number 140. You can learn more about FIPS policies at https://csrc.nist.gov/publications/fips This element is a best-effort element and additional software or elements may be processed after the fact which may impact the work of this element. It is **generally** regarded as critical to enable FIPS as early as possible, as cryptography policy can be applied, but may not be fully enforced without the kernel also operating in FIPS mode. If you intend to utilize this element to generate production FIPS images, it is highly recommended you do so on a host which has already had FIPS enabled for itself. Additionally, not all distributions are explicitly supported. Unsupported distributions will error providing appropriate guidance, if available. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fips/package-installs.yaml0000664000175000017500000000056015201026231026404 0ustar00zuulzuulcrypto-policies: when: - DISTRO_NAME != ubuntu - DISTRO_NAME != gentoo # NOTE(TheJulia): crypto-policies does not exist in: # - ubuntu # - gentoo crypto-policies-scripts: when: - DISTRO_NAME != debian - DISTRO_NAME != ubuntu - DISTRO_NAME != gentoo # NOTE(TheJulia): Crypto policies includes the # fips-mode-setup script in the debian package. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3582373 diskimage_builder-3.42.0/diskimage_builder/elements/fips/pre-install.d/0000775000175000017500000000000015201026275024761 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/fips/pre-install.d/01-setup-fips0000775000175000017500000000263615201026231027223 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [[ "${DISTRO_NAME}" == "ubuntu" ]]; then echo "ERROR: Setup of FIPS mode with DIB is not supported with Ubuntu." echo "Please see refer to Ubuntu documentation on how to configure " echo "FIPS, as it requires an Ubuntu Advantage subscription." echo "https://ubuntu.com/security/certifications/docs/fips-enablement" exit 1 elif [[ "${DISTRO_NAME}" == "gentoo" ]]; then echo "ERROR: Setup of FIPS mode with DIB is not supported with Gentoo." echo "Gentoo's documentation appears to largely omit references to" echo "FIPS setup, and the supportability is unknown." exit 1 elif [[ "${DISTRO_NAME}" == "opensuse" ]]; then echo "ERROR: Setup of FIPS mode with DIB is not supported with OpenSUSE." echo "Please refer to SUSE documentation on how to perform these actions." echo "https://www.suse.com/support/kb/doc/?id=000019432" exit 1 else # This command exists in Centos, Fedora, Rocky, and Debian # and is referenced in documentation and posts about how to setup FIPS. echo "Attempting to setup FIPS mode utilizing the fips-mode-setup command." fips-mode-setup --enable echo "FIPS mode setup completed, please remember this only applies to a" echo "running operating system nor implies the certification state of the" echo "resulting running operating system." fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3582373 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/0000775000175000017500000000000015201026275022637 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/README.rst0000664000175000017500000000523715201026231024325 0ustar00zuulzuul======== Gentoo ======== Use a Gentoo cloud image as the baseline for built disk images. The images are located in profile specific sub directories: http://distfiles.gentoo.org/releases/amd64/autobuilds/ As of this writing, only amd64 and arm64 images are available. Notes: * There are very frequently new automated builds that include changes that happen during the product maintenance. The download directories contain an unversioned name and a versioned name. The unversioned name will always point to the latest image, but will frequently change its content. The versioned one will never change content, but will frequently be deleted and replaced by a newer build with a higher version-release number. * In order to run the package-installs element you will need to make sure `dev-python/pyyaml` is installed on the host. * In order to run the vm element you will need to make sure `sys-block/parted` is installed on the host. * The default profile is ``default/linux/amd64/23.0``. * Any ``amd64`` or ``arm64`` profile with a stage tarball published by gentoo in the ``autobuilds`` directory for that arch are supported. Warning: the GENTOO_PROFILE environment variable will take precedence over the ARCH environment variable. * You can set the `GENTOO_PORTAGE_CLEANUP` environment variable to False to disable the clean up of portage repositories (including overlays). This will make the image bigger if caching is also disabled. * In many cases, the resulting image will not have a valid profile set. If you need to interactively use portage in a machine created with DIB, you will need to run `eselect profile set some/valid/profile` before interacting with portage. * Gentoo supports many different versions of python, in order to select one you may use the `GENTOO_PYTHON_TARGETS` environment variable to select the versions of python you want on your image. The format of this variable is a string as follows `"python3_10 python3_11"`. This variable only impacts the python versions used for distribution-installed python packages; see https://wiki.gentoo.org/wiki/Project:Python/PYTHON_TARGETS for more information. * You can enable overlays using the `GENTOO_OVERLAYS` variable. In it you should put a space separated list of overlays. The overlays must be in the official overlay list and must be git based. * `GENTOO_EMERGE_ENV` is a bash array containing default environment variables for package install, you can override it with another bash array. * `GENTOO_EMERGE_DEFAULT_OPTS` can be set to control the default options passed to emerge for all package actions, this includes operations like depclean and preserved-rebuild. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3592372 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/bin/0000775000175000017500000000000015201026275023407 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/bin/fix_shm0000775000175000017500000000257715201026231024775 0ustar00zuulzuul#!/bin/bash # Copyright 2017 Matthew Thode # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. if [[ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]]; then set -x fi set -eu set -o pipefail # make /dev/shm dir if it doesn't exist # mount tmpfs and chown it # existing programs could be using /dev/shm # This means it cannot be moved or backed # up as a copy easily. The only remaining # option is to move the link if it exists # as a link. Existing programs will still # hold the file handle of the original # location open and new programs can use # the fixed /dev/shm. [[ -e /run/lock/shm_fixed ]] && exit 0 # shm has already been fixed if [[ ! -d /dev/shm ]]; then if [[ ! -e /dev/shm ]]; then if [[ -L /dev/shm ]]; then mv /dev/shm /dev/shm.orig fi mkdir /dev/shm fi fi mount -t tmpfs none /dev/shm chmod 1777 /dev/shm mkdir -p /run/lock touch /run/lock/shm_fixed ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/bin/install-packages0000775000175000017500000001250615201026231026553 0ustar00zuulzuul#!/bin/bash # Copyright 2016 Matthew Thode # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. if [[ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]]; then set -x fi set -eu set -o pipefail # note(JayF): YACC and LEX are both set by gentoo alternatives handling if you want to # use alternative implementations of them. Since whatever alternative # implementation is opted-for may not availabe inside the image, we need to # unset the environment to ensure default behavior. unset YACC LEX # env is not sourced with user specified package inclusions # set the default bash array if GENTOO_EMERGE_ENV is not defined as an array if ! declare -p GENTOO_EMERGE_ENV 2> /dev/null | grep -q '^declare \-a'; then declare -a GENTOO_EMERGE_ENV GENTOO_EMERGE_ENV+=("USE=\"-build\"") GENTOO_EMERGE_ENV+=("FEATURES=\"binpkg-multi-instance buildpkg parallel-fetch parallel-install\"") GENTOO_EMERGE_ENV+=("PKGDIR=\"/tmp/portage-pkgdir\"") GENTOO_EMERGE_ENV+=("DISTDIR=\"/tmp/portage-distdir\"") GENTOO_EMERGE_ENV+=("PORTDIR=\"/tmp/portage-portdir\"") export GENTOO_EMERGE_ENV fi # iterate over the array, exporting each 'line' for (( i=0; i<${#GENTOO_EMERGE_ENV[@]}; i++ )); do eval export "${GENTOO_EMERGE_ENV[i]}" done # set default opts GENTOO_EMERGE_DEFAULT_OPTS=${GENTOO_EMERGE_DEFAULT_OPTS:-"--binpkg-respect-use --rebuilt-binaries=y --usepkg=y --with-bdeps=y --binpkg-changed-deps=y --jobs=2 --verbose --autounmask=n"} ACTION='install' SCRIPTNAME="$(basename $0)" function show_options { echo "Usage: ${SCRIPTNAME} [package ...]" echo echo 'Options:' echo ' -u -- update all packages' echo ' -e -- erase/remove packages' exit 0 } function install_gentoo_packages { RUN_ONCE_SHM='1' if mountpoint -q /dev/shm; then emerge ${GENTOO_EMERGE_DEFAULT_OPTS} $@ elif [[ -k /dev/shm ]]; then emerge ${GENTOO_EMERGE_DEFAULT_OPTS} $@ else fix_shm emerge ${GENTOO_EMERGE_DEFAULT_OPTS} $@ unfix_shm fi } TEMP="$(getopt -o huem: -n ${SCRIPTNAME} -- ${@})" if [[ "${?}" != 0 ]]; then echo 'Terminating...' >&2 exit 1 fi eval set -- "${TEMP}" while true; do case "${1}" in -u ) if [[ ! -f ${PORTDIR}/profiles ]]; then emerge-webrsync -q fi install_gentoo_packages --update --deep --changed-use @world install_gentoo_packages --verbose=n --depclean install_gentoo_packages --usepkg=n @preserved-rebuild etc-update --automode -5 eselect news read new exit 0 ;; -e ) ACTION='remove' shift ;; -m ) MAP_ELEMENT="${2}" shift 2 ;; -h ) show_options ;; -- ) shift break ;; * ) echo "Error: unsupported option ${1}." exit 1 ;; esac done PKGS="${@}" if [[ -n "${MAP_ELEMENT:-}" ]]; then PKGS="$(pkg-map --element ${MAP_ELEMENT} ${@})" if [[ "${?}" != 0 ]]; then echo "bin/pkg-map error. ${PKGS}" exit 1 fi fi if [[ -z "${PKGS}" ]]; then echo "Not running install-packages ${ACTION} with empty packages list" else if [[ "${ACTION}" == 'install' ]]; then if [[ ! -f ${PORTDIR}/profiles ]]; then emerge-webrsync -q fi # --noreplace prevents us from rebuilding a package already installed # --changed-use means that package will be rebuilt *if* USE flags for # it (configuration) has changed install_gentoo_packages --noreplace --changed-use "${PKGS}" elif [[ "${ACTION}" == 'remove' ]]; then if [[ ! -f ${PORTDIR}/profiles ]]; then emerge-webrsync -q fi # A good practice for removing packages in gentoo is to deselect them, # removing them from "world" set -- the equivalent of "unmark" in dnf. # This tells portage we no longer care if the package is installed, # and it can be removed if depedancies allow. # This means a removal is two steps: # - emerge --deselect $pkg # - emerge --depclean # # The depclean step removes all packages that are not in the "world" # set and are not in the dependency graph for any packages in "world" # set. # # Other methods of removal may work; but this method sets us up to # calculate the dependency graph exactly once and prevents portage # from erroring if any of the packages were not already selected. for PKG in ${PKGS}; do install_gentoo_packages --deselect $PKG done install_gentoo_packages --depclean else echo 'something went really wrong, install action is not install or remove' fi fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/bin/unfix_shm0000775000175000017500000000166415201026231025334 0ustar00zuulzuul#!/bin/bash # Copyright 2017 Matthew Thode # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. if [[ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]]; then set -x fi set -eu set -o pipefail # unmount tmpfs # care about anything still using it [[ ! -e /run/lock/shm_fixed ]] && exit 0 # shm hasn't been modified umount /dev/shm if fuser /dev/shm; then rmdir /dev/shm fi if [[ -e /dev/shm.orig ]]; then mv /dev/shm.orig /dev/shm fi rm /run/lock/shm_fixed ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3592372 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/cleanup.d/0000775000175000017500000000000015201026275024510 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/cleanup.d/05-unmount0000775000175000017500000000331315201026231026355 0ustar00zuulzuul#!/bin/bash if [[ ${DIB_DEBUG_TRACE:-0} -gt 0 ]]; then set -x fi set -eu set -o pipefail [[ -n "${TMP_MOUNT_PATH}" ]] sudo umount -f "${TMP_MOUNT_PATH}${DISTDIR}" sudo umount -f "${TMP_MOUNT_PATH}${PKGDIR}" sudo umount -f "${TMP_MOUNT_PATH}${PORTDIR}" sudo rm -Rf "${TMP_MOUNT_PATH}"/root/.ccache/* "${TMP_MOUNT_PATH}"/usr/src/* "${TMP_MOUNT_PATH}"/var/cache/edb/dep/* "${TMP_MOUNT_PATH}"/var/cache/genkernel/* "${TMP_MOUNT_PATH}"/var/empty/* "${TMP_MOUNT_PATH}"/var/state/* "${TMP_MOUNT_PATH}"/var/tmp/* sudo rm -Rf "${TMP_MOUNT_PATH}"/etc/*- "${TMP_MOUNT_PATH}"/etc/*.old "${TMP_MOUNT_PATH}"/etc/ssh/ssh_host_* "${TMP_MOUNT_PATH}"/root/.*history "${TMP_MOUNT_PATH}"/root/.lesshst "${TMP_MOUNT_PATH}"/root/.ssh/known_hosts "${TMP_MOUNT_PATH}"/root/.viminfo "${TMP_MOUNT_PATH}"/usr/share/genkernel "${TMP_MOUNT_PATH}"/usr/lib64/python*/site-packages/gentoolkit/test/eclean/testdistfiles.tar.gz if [[ "${GENTOO_PORTAGE_CLEANUP}" != "False" ]]; then # remove portage files sudo rm -Rf "${TMP_MOUNT_PATH}${PORTDIR}"/* "${TMP_MOUNT_PATH}${PORTDIR}"/.git "${TMP_MOUNT_PATH}"/var/cache/portage/distfiles "${TMP_MOUNT_PATH}"/usr/portage/* fi # shrink a bit for i in $(sudo -- find "${TMP_MOUNT_PATH}"/var/log -type f); do sudo -- sh -c "echo > $i"; done sudo find "${TMP_MOUNT_PATH}"/usr/share/man/ -mindepth 1 -maxdepth 1 -path "${TMP_MOUNT_PATH}/usr/share/man/man*" -prune -o -exec rm -rf {} \; # make it so we don't have to reinstall grub if [[ -a ${TMP_MOUNT_PATH}/usr/sbin/grub2-install ]]; then sudo mkdir -p "${TMP_MOUNT_PATH}"/tmp/grub sudo touch "${TMP_MOUNT_PATH}"/tmp/grub/install fi # systemd id if [[ "${GENTOO_PROFILE}" == *"systemd"* ]]; then sudo cp /dev/null "${TMP_MOUNT_PATH}"/etc/machine-id fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/element-deps0000664000175000017500000000004715201026231025135 0ustar00zuulzuulcache-url install-bin package-installs ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/element-provides0000664000175000017500000000002115201026231026025 0ustar00zuulzuuloperating-system ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3592372 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/environment.d/0000775000175000017500000000000015201026275025425 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/environment.d/00-gentoo-envars.bash0000664000175000017500000000305715201026231031265 0ustar00zuulzuulexport DIB_RELEASE=gentoo export DISTRO_NAME=gentoo export EFI_BOOT_DIR="EFI/gentoo" export GENTOO_PORTAGE_CLEANUP=${GENTOO_PORTAGE_CLEANUP:-'True'} export GENTOO_PYTHON_TARGETS=${GENTOO_PYTHON_TARGETS:-''} export GENTOO_OVERLAYS=${GENTOO_OVERLAYS:-''} export GENTOO_EMERGE_DEFAULT_OPTS=${GENTOO_EMERGE_DEFAULT_OPTS:-"--binpkg-respect-use --rebuilt-binaries=y --usepkg=y --with-bdeps=y --binpkg-changed-deps=y --quiet --jobs=2 --autounmask=n"} # NOTE(JayF): This defines the base gentoo profile version supported # in DIB. As gentoo is a rolling release distro, the older profiles # are unsupported. export GENTOO_BASE_PROFILE="default/linux/${ARCH}/23.0" export GENTOO_PROFILE=${GENTOO_PROFILE:-$GENTOO_BASE_PROFILE} # set the default bash array if GENTOO_EMERGE_ENV is not defined as an array if ! declare -p GENTOO_EMERGE_ENV 2> /dev/null | grep -q '^declare \-a'; then declare -a GENTOO_EMERGE_ENV GENTOO_EMERGE_ENV+=("USE=\"-build\"") GENTOO_EMERGE_ENV+=("FEATURES=\"binpkg-multi-instance buildpkg parallel-fetch parallel-install\"") GENTOO_EMERGE_ENV+=("PKGDIR=\"/tmp/portage-pkgdir\"") GENTOO_EMERGE_ENV+=("DISTDIR=\"/tmp/portage-distdir\"") GENTOO_EMERGE_ENV+=("PORTDIR=\"/tmp/portage-portdir\"") export GENTOO_EMERGE_ENV fi # iterate over the array, exporting each 'line' for (( i=0; i<${#GENTOO_EMERGE_ENV[@]}; i++ )); do eval export "${GENTOO_EMERGE_ENV[i]}" done if [[ "${GENTOO_PROFILE}" == *"systemd"* ]]; then export DIB_INIT_SYSTEM=${DIB_INIT_SYSTEM:-'systemd'} else export DIB_INIT_SYSTEM=${DIB_INIT_SYSTEM:-'openrc'} fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3592372 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/extra-data.d/0000775000175000017500000000000015201026275025113 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/extra-data.d/gentoo-releng.gpg0000664000175000017500000014604715201026231030363 0ustar00zuulzuul KBXf_ z0_ z0@cæ?iÜÐ[qê¹A™RD¬ÛkŒ–Ø¿m áÖ«¶;üûK /ßìYêÉ’P< );-ðX_ z…™ NÏ! ̈Dôúý}»Éq?÷SJÆÑåZš‚ã4Ñ õGw…"Eز /h ¤�æû²v€¹ö^£µCfµòwå7,L3…1æÇ ^Á°èªfåmr~ƒzl¸�jFØÆÖˆ˜p5„œì?È»æºiaòcÕÐà× ¬z+Q{4 hàÖ'öâË“àס�ÖÞ~9‹qùƒ·Mâš?W,H¨¶.’A‡QäŽø ’¦HÏa7¥Ž¬#bv?ño3­.\á^¸\ul0èßž ÝÝè´ì Z5vs�•MmˆxµA–ŠJ#¼¹)Yñ`œAÿ—|¯™w[f–ìWíõ¦ª|®I|ÑgˆíôK«…ù3ègäð�gFCäL€Rõ¶¼ ò\;/ݨ[§äG¦'mŒ}2�d~V¯C OO:Ïä�d}6ˆ ±<ËrÌšðîG„B®ÅCb‡a”es†=ùÖ¨^œ ’í{ææÜDÃi-åSqléLŽ›Uþ€ˆÂ\Ã„ŽæBëpƒþ[ u§"^ƒ¶È®zN2ú# µ_Í`±ÔýXžOC÷ù1þiëUÉ“‘Á»Š“Âo;Ámë ¾É{ã¡pÝIk‡Ñw žî†æ–Êek==ŠÞzJ¿¾7 öaéq á³ ßwKäµÞ9¾¨Ã‰#GtAÃ'g°/gpg_ z…#http://[2a00:1b98:1:4::254:0]:11371´;Gentoo Portage Snapshot Signing Key (Automated Signing Key)° gpgˆFNÏ"Ï ²{”N4ˆN… á ­tè€Ñƒ  ¼ξœŠÓÛ6ž$D±í?/Ýó w¸²} 6_é�°gpgˆ^QÉ¥. ³÷¸rÙiv­ÿh~7+›ÊH lR=€d£å™±*`7šöK.7uáx…|ÿv—Ëa3Z!òcô Í´ì(�;øüë75‰p=¨L/ø°gpg‰P×di 3E YZA¯}¿o|Ò.,íC+g°�–Z´{Ï—V"ä*d€BzWnœâp”ËÛ¾œ@Í,ìˆSþïdjë¼Ô(üjà–E[wRu)o«Ùð»$ºMÝ_¸Ÿ"I—¹!½ü17Òåû}Ÿj¢ê¶c+qšÌ¸6|ñQÕYf/ŽWNû·÷ë�ÛNÞc³ùôÏžvÃjçN4ÓUãî´På—„ÀdÉ\cH�üó“mÖ3•C7ž/ÙÔ´|¼A"q£YA…Ø`�Nís[›Û¼Ò€ÜGKç£üCǰgpg‰PÿKò ,šÅ—¯OøLþ/5äg„h„f-¸‰nÊd4מb.džªÄö&Œì€‹^tp>2A7nF\…ˆqjdhéè´|�d¦/}éú_àãÐD^…°!òê–ˆqãá 9ÎÙà>¹Z„´ær/‡{@Œ4u Þ•L{©a§ôêLE~ èM{9ÎËê~ûD°áì£/3„"K9[1R_K/°¨+Ƙ(6}þ[$Âu‘;¢]�Œt’Ñ"åÌm;RÃÎær‰€î(¸>²C9™kžú¤:ÑÕ Š³À†4Ö©§EÝÝÀ…Xd8ñ¢3w„VáJ1òA6Â;\Åü÷0¸ÈŒm�„°gpg‰Rßj@ /&xÒ<]š¤½BÿKrøM/Úôî˜_ÕåCÙ<šâ­ƒÚ0'A:D¯Eàð@‚f¨Ðð¾@¾ë‹)Úß#æ %.^€Ãjž¢:x$ æp-l)�Œáƒ~PH.Åg¸Ìû¤ñ?LRc�—Çq;Vƒšs/¡²ô#bX–è-e˜qdœýöäe�–o²ÂF&æo¸½Øsý® y¿ç·r#×'eG&wðª?å!¬ä˜´¨À3‘0ƒbå¶þ8\êèæ¸÷çþ}©ÝY÷c�Â*UO©’¦ò¼:£X�m’€êî¿ïüˆ=ø©…Vœ�=ô+¾\GbŽé_=}³N\2Ü:ˆý4$°gpg‰Y}— ?¤A>%Ú–4J6ª�k¯‡õõ&bÈê"Èn²áb§�ÕʶªøOUJʶI$à@ñ%žfÆË€œ;•ÝQc’ñ?çüQ�ajý¾.•©?aÅòoOÚ¥7UœãTÖ÷°Xw2ŽIF:páæZ)£§GÊà1Ég†€Ûdýü§Ý×ð¦EHòá1׿œÚnäµÕc�вzWK Å)B͉�°gpg‰XŠ9e ÛL1w£C• Máþ+Üçî.]t½�w/ba²ÿI–Q±«ÆhK³NáÞV;Þõµ,xøÊÌïk”ù´&;Yò‹+Í­ÿ™ôXlý ¡7À™�ƒ.™~X·°7•Ãva÷i ÊiMtžNχSêù2ߑޝ(Iwb€Gvø€ä6•²„·ò‹‘)Ép‚IŒ.V²î¾K‘4Äÿª³Is×AÝûq)@ÆÖóáoã�A$$“øØíàÉÅ„չ˜ç'ùU3dÑ)ÇÎìžé\÷ðØë¤ÛÒáÆ¹S;#CClÌÛ´Õ�|Þñ‡2M|ŸÓ,Ü>V’øoìÒMMÓxl;(ƒHYõe°û¶   5+¢�jzZT²¥:JøH/B*?C®ÎJQÄ6ÙÙû¦ù¼µØù+UæªÀ {ÿ‘�lç‡â‡—Šx«ð‹üçª�“Þ®¡V.`‚_,>Æ7²_Áý7]ù @n ¢ Ì�ýÏ6ô‚aÑȰ|зtC•±i>Gœ°Í�„´z36y»Õs´êëVìÞïOn‰¢ÃåÙ¶uÔ9´»ý˜tw‡½ù°gpg‰=' „΀NÏ"   ÛkŒ–Ø¿m\�ÿT÷üQ©èf„åþª×ªÐý!�¼…o”rœvá*ÎÃÝ:ä‘Î$}¡ì(þƒi;ßkuZ‚çöà|Á­“”¶è¾CÂÕË.OX°‚Ïî$ø¸s;èÓj3ð¸2…pôSļŒ�8–÷%R}M±`£=ôkä€[¢Æ=þi(+º�[ü<ÛŠîJ’`¥‰¡�Ìç¨ËœŒ%'6X•=n†e3±ºËyôÁéH!ê!5jÖš“õßñÈ"^KãÖ¦S»ë+ k¬‘ÓýNF"�Ÿ8OݾÁ›+´¸’e—ï)`ÏDÎsнŒ ±Ã¿Fþ“Â|°ûLŠJƒöް gÂôZΎѲ݆þDýŠevù!ÐÖ�Ûdïù3d«>α¾ç¶£¯”ÛZù]’ê*½Ì²w™Ë¸$òI½?Wi9rÊG¨Å­þ–›^¸³DnN® ãa|X!á ºRÏW"ù)‹6<(–møu°ÃFfÓôty’Þ»A:¼ë Ъx#-ÕW=‡ïƒ@–Pùn~ÿæÝ.@a�©a_ïJ´®Ø[ƒZí/ÉÕðPÇušvŒf닃ÓA+ʘfè–æ™•¹EZ$ó�ÈVdÓNš¦[.çÖvòh®÷8A¾Cᜂ¸Þßd*²w<ïæt?œA²äš�p…+B‡‚Wsä{D§+U°gpg‰='  €VS\ô ¦‘‚ ÛkŒ–Ø¿mÖˆÿW[VcŽDbtÍÃNX(“ÜA©œÓy,§ÉyQt!bá”*Gýìþ¸o¦³$i*댗GäØGô੪"¶Ý1[ÌÀ£Äï^)96Ò"NÆ3¦SD¯ï×þ=ã.b.hãîë>_øÌÛÅ"¿ô¿KM™µŽ“èUÏ04Mžå ŸJ8J0-És†#¯.©@=ÜÕ•ðñ&ý“âMnv LôäÿªV=W˜Ë÷oï!/»„öÃþaˆÙIÉ g p@õæ<Ò·âëeëdŸýP¼Žd²4ä%X2s>¶²þ€,[vK^lñe4˜å…ñ�LýýF«‘S"©s?kl_˜‘Õ¼ÊÊÉþ¶ù‹EþØmÏ«WÀ—Ø/-º§vø³ûfUm ’Ù#I�—MЗª,p5½“vÊ~ç´yÀ¤ô©tëjùÐÜ ªŒÓÞø­ô+ÁÞ MÎÛGÙÍ_Pö5>Öðö�ýƒ³¿käð'ŸTc ;"Éõ•Û¼,W"9‡Bƒ,Y¤ŸþÑ`ÿî}]R.¸8é'HôɸЭ<çýà‚­ÎøŒ³é�69š¤4;÷>‡�ÏäÔ¡ÐÉUz猒Îé”�ä«[þ©Urì~0Z`ý A1ZÅÞÂMgX¼4ÒsáÌOVeæ¿ÙRªì¡Ê�’Òß�ˆWÐÐZSé†ù°�ÞIa#„5^\ë0FÅÓS]ÂhØLð®H‰‡ºnÁåÙø ór'‘h˜®"ÞÎõ0[¦äLLƾ­èÔtƒÔ¼ô¨(‘ž¼±Èð ,9‰$�åâ Üiüþݨ"¿-œÌÈfþÌós_l«ó–²÷ª,Û/€ˆãÙõõCˆÒÚÞ¹Ÿ”Þ Y ¢ºK\å¦D…LªË­GYñ–¸9]Íü<@Õ-pþ…žÇo}B_UÃx)6WÍñàŠ)¬xÝuE‰íÆ`®?1( ᯱ×]m�­qÇ`E$B> %‚>œr¢{þœ›¡Ý6‚ BT°��t_IÕ£b${õ ðçÒúÌ8DÀ†/QÑÌÓ«Ä«²~ƒ� \ªÐ•–:ï¨ÝűÉd�S]…¹¶÷j¡äyx(+!ß±/± Ÿ8Ql“»6u”_pêÖt›Gnoµ CyÚ0é"-œj `Uc•8ëT~pàEô<º/�s*}Ù�ô¹PLsŽ<¤ösÇÌýµÄU¤•™ð¼ØDZpª(Q0gÛta 'âŽG˜Ä<[$)x)ú¨¬;RC±TeIÓ—«µKd “פY؇“Duw@àÀMY'êöÛÀ�ÆJ63¦‘|·0�ÊrwuMKD µC_bãß|«U(f&Zk¥È`ycò»{6KÐÙƒ†%—BEž~˜N˱·†mâFj`ƒ ˜rY‰ü:¡·{Ÿ¸ß‰×üÛ¡‰–°'UÊRË|ÌÏ 3&ôì­0; ûOöcª–¢^ÑžÌØÁ(>�çmSûö3`oÞ¦ _úÜ@û½{ŶP¸Ãy�@ÇIÄ!Թ߼öÁôšÎ&èwî9$&:À¤ï®×4 Lˆ¯œ³h¹ž�ÓFuǨ?t`›‹°ËÝÌ;CÉü�-è NÔbS§h»ðœ7O­Ò§5ŽÐeCZÔÈ kÇ/r¦MÔ`œÝüÎ+ Èœ\5Äø}Ôº>âøQé[–ßH6FZÌ8ßaA¢­•:¶(™«øÚv#þ6 {_‘îp�è`À6Kí?xÚÃfì’ܳzÁú@”bðýS��€˜¬Eô›£…Ncqn\ *„L�x†‰,uÚAóJ9Cˆ0º½¸„ÿ{RËx÷vŒB��.º*';Ž|�ïó“ò!=Ì׌áÀCÈC£¼oÛ¬„_Æ‘“�}*°rv. ®�ÀëI!úñ7P†¹õNtÊ gìÇäïa¸‚§¦Z³S÷§\.D”˜¶jQ[Y.:rÒ×ÜæwÂÀ›A௉äéçÅ(Ù4œ”Q8éJ\é)¤¥!‚Y÷µJ›®…¿¢Ê Éa¶Q.söbUÕgéäh�¡ŸÆÎgx2Z':)¶/Ù¯ÑhÓ³&Á_´H3è53(Sµ”‹�X[ï :�ë•Í>V¨ÆfþÔGQݳ¼ø‹µ#Pe}٤ŔT¥è£Ñ k€ðx`DX¼fá<ð ¥Áå ¥$“Ò°ºÃ¶?“Fø-5�âéx6¢Ým°Û¯`�µtÐüì–Ò AMS�¤à ,˜„¶ßâ!wÎÜ|ìRÁXîá½åeóü�ÔŒepF¡ûV¼ù=ÿØRÂ8?—b´ão©OûÝAx rˆºÃÏ„X |Ç�ÏPÉý¯‰˜ˆ*W`Î;“&÷´^݂ ïBÎ&vA¹[ „i§ZÜjtÒ Mî^SQèÛ®JÎÑ3ÿÓÉ–!¾)Ÿs9¬°û9¦©š…$XÂ!@íÒ@·'†N� Ö†¦¬¼ 'âM¨)ž›lðßTîáòû§.Ì£÷§©»–M4x$`‘Hþ-@² ¢þ\‘.[ž‡óŒ¯þ—âQ‡_8:^³�ã„|“´žÏèâ{Û@_+qö¨…�©ŸßQŠïùáë…mĬe_Ö“�>B“UˆAûÓ-1”Lƒ�žÆL5( \"ßš¨jòΡûíÆCKèy‹GJЧŒ:S«E´×U-ƒÀ¬á Ö¬Í§èk.óœÒl:{Å«”€æ°gpg‰Z D! Ø#ÿzó ôg >…%/›06XÔ4_&https://keybase.pub/h5/pgp/policy.txt …%/›06·9?ýÔƒ&:Ô§kóÕ‘sí<…ä-yze]V-PXÛWÌlj2ÙP^Ï>S‡Þƒ£"v柗(Óá¤ó'f«¾„2Ÿ»“ò·\…ç[V�¤ÜØhê³]Nφ‚òææßôC™iË#cÊÑo�/‹Ár(1¦üP£³�Å À¿âú…š'"$èg\‚sÈÊвCÜp~0±O‡„ðZ$FÞ’‡Œ+^¡õÏ‘qlqEÏ0q·u–ÇeøÌ_Ûë|œÇûÓ¢ ÿñ*[>e]µ£õÎôêW°æUå{ß 2›°?<�|/kµÞqÆ©#‹º* qíeå¨�Q0‹mN:nÅf‘·B9 Ç_¡´‹É[ÛF‹�nOèdy-ϬÍg Á±’s4ªýˆ ö rm’óÿÑÓ]YÎDWµ*Ì*¯})p�Ãm+µ1¬€ €hÒ½—sÄØ:5ñ”‹’X7ØÉ†(Fîz¨2{\íì³ø#RÞòþßWÀk'éåfO"Euìðb¢!ع Xí˜ø¾8kRUH«Ç$ÑP‹Ž–ñ|âõ®BÚ¿’öàÔgS=èy½˜Üóe#“j‚è j#Ô �ƒ•xf[»#¼þò›ÐGx\¾ß™…î˜W BÌŒkN-á·žö¹±‰傹üž°jš&�N³K0 ¦#J’ÜÌÎÁúëjRrg¢nÈØú59ÞyÂ&CLp6µ\ {뎗œcÐî !sÿ>9�²yZ6Kcí¥s掹 �E/]�YˆëäÞŸ8 ºMZð8?WtÚC§²bDà�úäâùCþÉ‚™cßîÅí®c?dZ£[TÜÃÕ•bœö¹õÜjøß®JIH)Åõ^×�¥ƒ'J½†ÿ<§X[7âieø™øŠz' ª ¯Õ$(ýÒ÷È^uÙšˆù÷ì¶·x«xUÔ…ŒìtÚ´¶É Ía hâxJ±ïqÿ¹¨¼Ù¾gq O+¶†ì¢ §ñþÜ?d”TfË9ÓêØ/”Q6©qW> }°ul¡4¨èÑÙ‡¸iHÜ…¶¢–21ùæ`ÒBˆÊ‰’~NbÍ¿>sû2kOÖµ´ÓL /ñ=¼Ï!#VþMÓéÂà?i2�K)¥ Ž/4õ…XP`Ô9ªuJ ‰ø€�ÀÂ@¸öÃyΰ'¤§\’þ¸(Ï÷Š˜¼Á‘wò„ ÿt¶ï�ÀSÜÁVÆ ´H1¶N²Î÷ÓÙ˜ªÁõA‰Æ"­ï­„«ÁÝðŠa`¥4‘Ò,«Ç^М–òÐt²�C+oFÛF+¾£…ÆP'Ø@vÇÎNm?€_“iû5°gpg‰3! TùkÄâ)“ƒ”^ ‘©Ž½NZ4#Š ^ ‘©Ž½N¨/¿£Ü||¸ü�\H¤–Yã›bú bÛÍoch¦9· -’?TÀÍTE/üè ©ç½ˆ¼Cš+•_#¨tÝ»N¿iÏ,XG±M �•Ž ´Ð¤Ámx§cJ­#ig|T9O^`k^‘»Í-ôÏ:1⌗b`ƒ_ï1kÏj3d�}#+gŸ}Ú¹1�ÚZs_n³#:H[×ÿøZ>ØQ8?¥ šXÙó¿üÖªS7¢y†àöU 3k›ñýÞÌG}QWùQØ­V ö9ð#«ŸÍº5‹Úˆ*Š …¤ï�³f„¼UþÅNRg&øsDÖû  —z!µÂæl£°gpgˆu!KRƒ“棰߲ï:dÉÅÇgÆú¢Zu²Ø ÉÅÇgÆú¢iÌÿTÄóO}œ+…°’åtŽèÆÞ)öŠO‘¹Ñ¦è*~¾MÿeärHHÞu!ì[nF—Í?Yà#Š·{îAj:×êx°gpg‰T >  €!ÜÐ[qê¹A™RD¬ÛkŒ–Ø¿mZlý– \57 ÛkŒ–Ø¿mIûþ>üxGN«7f§ „t ôy¼R¿�ükÍ&ù:3ãþ¦Jc\hˆåj2óOžá­Ñz¦T‚\^³Õ#4×4POâf·¡`‘y—4³oX‡.ßÇ�<¡ì³¨umenüy\N~ÎOÍ�§»åZ$kg¥“…žkº¨!ÛÅ9/f7Ww™MSzzÙ§Cª;VÔòÛ†¥TBº[ðGßyìRôzšuÕ�0­c"oVEFñ`æaw¨Õƒ ·ÞMj¸[“N¼l�Ŷ»G äJh@¯ªét±†jÕ¡Æ Hî9¾[lï(Õ¥½°ÔJµ0Vÿ~®xwQÍ ·\*>r¯T()¬WHë¾fÿ-•ÿ·€4!âÈ®Ë>í¯½eZèâǨÈ®Hŵ_ºTq;¶QéÖ’]Ì´^*‰ƒH@'4g©t/ HXâG�a'obR¨~Ç/áEP�›ÔåzÒ¦/!<âoRÍp™ÿA°&• ÜÎùÃ%ÿNÕ5ï5ô õ ¦òqÙ6ŠŽ˜gõâ Eß‹ âAÉ5¨›�¹0ŸÕƒ’ã2‹ùÎó‰Û˜üÀÕ¦³¸gáådJ¹.VUìé�è—g@ 4EÖ/°¡/Zµ!mx· BÅ”;ŒJI‡±¬â˜Ø.œâ§u–°­y°gpg‰3!l P§½˜÷žŽq«xZë•ñ“)ÀZ»‘u xZë•ñ“)Àª ž‚fÿCyGüã>ˆ‰qî0?û4Š]˜¡�]ŽS€°‹4qÑsÖLRêíô)+-œ\Ãß·0"aAè jao”RX{©þI´‡Gz)œ’æz‡ÆØ«7Mo¯¯Nmp\©SwPåq<=g&fØ¢Â-ÊVÕiÁ~YÔýŽf¤PŒÀ€}ñö0j.£*ÁÆö0d1•£톷_Rz‚èšðfýyer\3ýFð%oÅŒ¸6$³Ÿ�s‰oåGÀC®¶Ìƒ´\m1…ù„qôÀ·�š]¤l@åðåKHM�z�LÃ1&p„!”v¹¼çlÙjiæ´˜ºÈeEh÷h“)Pz�þ,Ö[m+æ�>_xU.¾åh\;ï÷¿¦esEÙJ‚ƒ -öžãæôU•�\ à}꫹°¢F~u³p»ç 3ò±Êžï¬7úî�€ÇÁ&p"ÑÃvŒÖÇZ]RDÌ £|–Xˆ»ôÈ Óm‰!S°òË褜„G#*.•›ÕÓ·/Œñ;á¦Ço£/hIÅËñì-Ó²B¼hð/EkæFgh/ïÖØ¥4g�ÞÊ[®bCAØS\d´m_“f–)$ݫՠèx1_5nÝ8žtòË�ÕŽÓñèÛ'+8ÎûíÜ;²Òš£S[[)õfÔƒïæÊάªÜËE˜u¯±æþ yàä°gpg‰3 !n¼íxkwbß(Ÿ`¾ßОͩZõr ¾ßОͩ˜¨ú_Ź+×40>µ¯ ºG“^yZ–gHO†rë~ìBAð¿qU,k«[‡Ì_¤Û[éú;ægÿºì€ Éð\½Ãj<…8b²^ÆÏDé¾ÿ ³ï_ LèÎ(ô´ÆèÀ¼¨†8v¿Q™#û±<ï0…¼¶%½ÝÿKú�ºƒæÑuR7Ûã³Ï:]îü^ UÈÇgt2&ŠÇu׿®/tA6§³Í]9æ �Z,æ‘zJòž ÄÅmÇ×aQí4ØP§A¡ð›$º ¼ì2›ÔO‘P¶ííjUÂ>_z5Ÿ;{Îú¬ÏIÂÙ\G+¦ ¨w¼ ï7²ÉŒò“¤-L~¥ü 8b‚•Û·ÔåT³+Ø2Žûö mDÀôIm´ê7” ÝÃìÔc> ’3'—/Öx×?7¶jÁc O¼‹„ó|Ô"«$³o˜fûtX.cÂÖ}…‡ï¿I…øv¥â¢ÀŽÙ˜ïì¹Òú“@5 º09:Ü7-ö ÏâÆ”3´oš®¾p1ŠÄ.ô¤Æú8dÄWp€¯¹êÀ‘^Óp’Ú³ž¾×Ûÿi"[L�aÄ–¦!uÆ:4ÎoµXH3#ôzLÁéJ¨‰†e:ínŽáÐ�¥îg»·ù»õƒÍ!s½^aþïÆUjÏ¢ùÒœRSñízR¥­ô±<¥>|›°gpgˆu !ò�-DŽ-äcà£AàBʪ¼Ø�)h[;}F Bʪ¼Ø�)h&Tþ*„¯Öj43_ùû²<‰4üX�ò´4|™ó¬çή¨>ÿIöœid¢Ï³‹M„)W‡>«w¾£’BBZó�ùÅçÞï°gpg‰T >  €!ÜÐ[qê¹A™RD¬ÛkŒ–Ø¿m^¢©“ !8 ÛkŒ–Ø¿mÑ.ýýóVhÞúëó8+Œþ¾®ð“‘ñ»®ûP}8ì1z4ŸLÅ_]ï[%ýðÈ*?¨á²¡\º:ˆö¹åŒ¢jö<ºlìô_ì[ ßŽ$ËF˜ØÖ=4Æ msö7òš4%ªRçøk©0 ׊ º¢H@×sôõîkA꟬z�1 þ¸-Ì̉RÝ׫)@³kæµÒ—Z±üP!¨¨¹Lw¤ð4ðì΄–�ÏÆ¢Äþ‡E@`{ nŠ4…B�Κh¦üw³2›ñ�ˆê½k¡»TÂð×Ü�6‚©·Åq“!³6òÌÔI,Yo¯{­õ›ÏR¢¤Í6%àUHcGC»a7ŽÂ‰ßb!Û|XÄé—úá!\¶}Þ76�¤sê´@G§zC)#œu}`…t^‚C¦¼_Ô¸Ô³xçeL½FN+ˆá€ü滃ˆÙ+ÁØ:Ä6¥vOƒ7Š>Ôxv˜>°”o±…S+Y�Ì-27ž,*¢*°ÅÕ¢…›"0ìG&mažÊ5¢-ýÿ”ÍÞË�(|kA[. î¹» åÛb†£ºÆæ£Ï\îD" òZˆ¯òn昵0?] Aw\²OcÎ7v?G«Ã5zá’ã•Ècy}ÌRãD V×x›¢'ÐmH�Î"90åè£øfü ‹°gpg´XGentoo ebuild repository signing key (Automated Signing Key) ° gpg‰T >!ÜÐ[qê¹A™RD¬ÛkŒ–Ø¿m[<íù \57   € ÛkŒ–Ø¿mà´ÿbJG¯ÆHÓ?>÷O¶Yоu=§½¶ pm 4ªüÐâÖ›Ó5TÆ¥$G_ø§í…Ó�0Ô«Û~J"ŽöÑÊÖ&®r©´~ @z™:õ)  à³Ö•9ÒÌò«-ܬÃŒ u=çPIi�Á¶úb¢'kÞÇxCMhl»L·MèeÊ:{¼æ8<Ô(JWºÕó*¢.,ÑÏ=Ë<ÅËÒF Ý7Ù¾¯Ǹ”ñ©VÒssì¦A‹ŒÑx+C(D&CÀ¿Q¥Ø²LˆÏ}M:« ÕPQ5tÙ˜º²‚�7Âf|å{Í’":åVމ†]Âe ì,ûKK®bšþ#_PÇ!‚ÜK’?kó£b÷R¸ìÔÕz9pµßPYN 1D¼w*©jA�rM%ÿƒ$5ÝI5‚yuî�¹ó3€ðåÄB¬‰š¼fJÖÔŒ¦[?Óp¡ÓSìf„à{®¢ÅV�Jsž�›¾ß¤ÙM¬LÁˆé?mÔóÇ1ÁZ>þzrvr ÷zJdÕ#çi8ä¨A­B|d_hu®SaS𒬇†±¤6¦Æd�´?¼…9EŒD»¡e ·f…9há{,*ZÄ£Ëïke•(¿..~4Yp?6u ü-Ußfyö0_ò—o6¿úŽ[lœð[Æ"؇{}VuÊ&Q”J»“Ÿ5H¯q:»°gpg‰T >   €!ÜÐ[qê¹A™RD¬ÛkŒ–Ø¿m\+xÅ =‹< ÛkŒ–Ø¿mWâÿVÊ÷–ýcÏ®~¶"�ÑDbŸe‘)+kèØ­�¨ oŠäÃdÄÔò~(Œ›‡°ç Wc¸ Y¼Æ8ó©¾@¨B²I €ãlFè1"öÖMVø/åäÌ]‡@¦¿ÀB,\Ù|<БŸÒÙßÎX†[zGµêätV S":‘rËr€�{\’Ž 7wd"?U��uJú' x¶Æf…ùÈÙÌ»9ŒÿWÀîK » ÷†¸tÕÙƒ£úÜTëëwˬŸ¬&•ÏÇçì1ƒv JΔä° ËdCÝñ†Hüpƒ^àJd™Ò½^)o�/¦@1P6¯ ‰k îï¥@í7ºD^©Gbmýš{þo["cNÊL7»¹`¤wò-St�vòìJ•§œòŸ£}\FÍòÊ“¢¬ç‘eýŽ÷Èz/ËÿL© Êç)µ!ø�ç–ÝžÊ`~ŠÜö _¡Ð¯C“·¨•LóïÃÆþîyÑN8n™”™ÚKBÓzêGi”Ì^T˜£Qò+¾ñc2„ÇE̱Z`±W 8§ºq—’I’Ιi çHHÞ1@ÿ-``o;½èFRÐ[dXzg+–|õŸöûü�J¬ ´p'B«ë/tŽ&Y• Ó;-\01ÒžÀ[þ†ª™–plNÚ²¥séÀ×/iÕ€´š4h„›—e-T6°gpg‰T >   €!ÜÐ[qê¹A™RD¬ÛkŒ–Ø¿m^¢©“ !8 ÛkŒ–Ø¿muÈÒ3ÌKÔ#¯*›=¶)\ÂHü›Ðù«üÖ1«®ˆÄ6"AÔ¦¶Jjºùêª~gí1 «x}€q‹Ž½Ho¾/šÁõÖ_bC!««]ŸË‚á3�EVníï²¶ e<å­)ó“ÎÊÃdA¹)p\ |¹rxOÿsÁ÷Ïrßð=jãg�~‚ƒcy›ÃW÷BM’½šç¦5�Û²ÀêËÙäüO¨¹àòÐe]Õ»«!ÿ7/%šœSzÇ‚Lê�ÿËf‰áp£Bï áˆä#éÐÑ}$Έ fåýâdöÒâF‡`¸p<JøE3 s¬áŽu˜N™ÛP¸¤j*8Õi�cqW>:Ÿ? «{lŒ i>Ý>‡ŸºÉŽÓX Ë$ÑÚ:þG�;MkŒ�™’œAÒ‰Êú·‹Œaü~n4ù•×Ó¥9Ðï¤Ø‘|�}îšÏƒâ8Ÿm¡u“›N£1-öKrZ1Pôëܶ)ª>’•ÀAføjô“Ì8……+™�Î5-ƒ`›3±oÈZýy»•RÜ‹S6ýhP£î8(±åz“˜A²SæK£�0Þ7FQ7 bÆ9hÑJ·¾Ô;]�«@&:.KÞ='Fª¶Ý9ŸËû‹,ŽsÃËbˆ;ÁÈth¢X”OÀ‹Òÿ·îeÍ&NøêcÀFQ¬Ø·Üy°gpg¹ NÏ!*·È=�ì ÔØ“i.�5­šªP( ™ºõó è�õDiš�mâvÃOÚï€tÎ.ðCZÏÄSöƒ¡„nRë ßi­ŠvÖã(xúÍ+cG™6ù½×TùÉÆ„C‚hì%}²¨¢â)©é^+~u‚—ÛÍLêI‘Oùê­Õgw×Í@Ûr*Šõ?/HSl²y­Äñ­mƺ*%üI($¶ìšŒ€Ë8šd)Ð'”ÂEá2÷šàã„ô´ô!�ÿ¿ºÊƒžV« —’íjµ"@Úmè6 Ž‹%m-$îºl*5M(踀à]‘†ák‘lIIÄÊG>%×"ÂÅìöó~¯Þ›­¶{Ȭ(�„bxS]Ƚ¸šA'üc”9oUfd¿ë§cŸPÊ Å»~ï|$(òlXuwzùÅÆ¾@Lñ“Fг2:Bá½¶Ès¤õ¹]u¤ö¬Äê?„EdÃÇ(IZä¡„$JqVªÉ–~šÚGÄOVk On`ݓݴcæM–µZ%Ñ»)‰[Áz›8éDU ƒ¨w´©•-L«bk`ý‰[ &!ÜÐ[qê¹A™RD¬ÛkŒ–Ø¿m\+¾v =ÐÌ)Á] NÏ!* ìYêÉ’Pîþ6rJŒ— ¾Û+ ç7¬¹Xè §Ó„ 9 $jàŒ©­K�K\xÝüúüc”hƒÁp;�ôNNô\€ßÓä Àt9èŠSò4YÍëXÓEˆœ]˼ÖPWÝUIÖ­ëþÛØA§“vÁÏE}áæê`  àáµ!l,@õ7v=Œí^4ÄÚß@oŒ2ö°ïá0()ÐdÀ\‹³¦ß˜�S¸\IHÞ³cV¹üóõ ¼%E××âI ˆr¨ÑBÑ®ãÉÚI`Ò—é. mGJ¯¾¼( ­UYöÉg*Ñ¥ÿÿ²Iì”�È®š²ÑŠ‘E- ‹wÆe)ÛÀ÷V&žuˆûœžÊØ«w¾—�ññ_ýzò}?“!JÏ4Ù¸°ª˜(ºGÉØê~^¿VÏlÁÌ( kÐB�®8Äþ³Üó’ÁÜ܃¢¯·ÈúR£³ŸÂ�q‰Fgq¼zµ:)ç0*Rñ›a!qï2ÿÖ¿@U¶KQÇÄ {Š%/u{E–u~ææqSeÇ”“ƒ¾|7¥­Ät•PÈcÎB8Îçõ~ ‹ÔÛš3θuµŸðüáb“]³µê2-¯ÓèéàéAò*sÅú¬X¯P|ôõ3Üê•iKÜ‘(ËBbÁÓ—g.ÆîÃRðY@³¯qA[ºë?ýÕOÄ0³ŽPBç­»ƒ�ˆoï ÛkŒ–Ø¿m#ü =TC ¹òûïsìÛ�âõ0gjãO:è–—„º‘^ÌC}vñìŽ|-5CÚW‘dߦtØ »�§`¥À8?}!�Jër8¾…pŸJ±íˆ¼ Á&Öç—Ë'wÊ0šGIL|ŠŒ{…¥ŸYÙFÝ“Î]³z…_*/2ó\ÿÀ†°’Ù°z¡èrž�. Ü™ox™ê­Âz‚¹g<×%†>H/ãDP�J™„ä´#ž~ÊŒŸ®ß!_¸9v8¹tº•òåá­ÙúCp;J`" ­á&ÖŸô6ÙÏ”ô„¡¸4¼'â�úÜ—VŠ®/ͺšœ™(D›òâZ’uQãERÿA¶âi1lG)x,Î×ÈÃ?�AúC±À&Æ+Œï6»(žþeZ�/në$Y˜>£Éj7ŽRFã ;fÿí—óii|�}Û»C´þ±)ÆDœÇApwó@ÿpto&°Å²Äh‡ò^ïZ·�‘VBHá�n ¡»¡{c,:p`ÇsòŸ=9åmˆ�¦è [‡¶h)½f5xK¼ÎM1³û²³*ŸK{=|x…œB`YÁ %×�¸Ÿ cïÒLàCGßðÅš–ì‚€â sҘȅ€ÓäÀÚòÍô®Ræý½eÆ!lrŽ-gËÕ³¤—N8X\´hʸöžhýl�%$¤|Ò¡š.>�c°gpg‰[ &!ÜÐ[qê¹A™RD¬ÛkŒ–Ø¿m^¢©  !)Á] NÏ!* ìYêÉ’Pîþ6rJŒ— ¾Û+ ç7¬¹Xè §Ó„ 9 $jàŒ©­K�K\xÝüúüc”hƒÁp;�ôNNô\€ßÓä Àt9èŠSò4YÍëXÓEˆœ]˼ÖPWÝUIÖ­ëþÛØA§“vÁÏE}áæê`  àáµ!l,@õ7v=Œí^4ÄÚß@oŒ2ö°ïá0()ÐdÀ\‹³¦ß˜�S¸\IHÞ³cV¹üóõ ¼%E××âI ˆr¨ÑBÑ®ãÉÚI`Ò—é. mGJ¯¾¼( ­UYöÉg*Ñ¥ÿÿ²Iì”�È®š²ÑŠ‘E- ‹wÆe)ÛÀ÷V&žuˆûœžÊØ«w¾—�ññ_ýzò}?“!JÏ4Ù¸°ª˜(ºGÉØê~^¿VÏlÁÌ( kÐB�®8Äþ³Üó’ÁÜ܃¢¯·ÈúR£³ŸÂ�q‰Fgq¼zµ:)ç0*Rñ›a!qï2ÿÖ¿@U¶KQÇÄ {Š%/u{E–u~ææqSeÇ”“ƒ¾|7¥­Ät•PÈcÎB8Îçõ~ ‹ÔÛš3θuµŸðüáb“]³µê2-¯ÓèéàéAò*sÅú¬X¯P|ôõ3Üê•iKÜ‘(ËBbÁÓ—g.ÆîÃRðY@³¯qA[ºë?ýÕOÄ0³ŽPBç­»ƒ�ˆoï ÛkŒ–Ø¿mY©»‰~¹Ùú:2±B4’|n·ô0 ‡MÍCàG]2ÃÌñœƒá½®¢;üѹaMKÌn�mZ‹_�mæWèpd"ØÿžJ–e¨WXÖ‰Œj’ð¸Ý '+½Ç�6㿱žˆn_mÝ-÷¿¡ÚT„PMNÁÍÕª³ïÎFbã~ïøn‹üÞˆ¢I¬nKëv﻽./AÈÂyÜ·zÑš•þ•¤=Ç9êèíH˜_Ðýòé!Ì4Tûã‹ecå„g|XïåÚr¿ÿR‚Žªg® .í‘RÛžÝcÛB950³O¢N¢òËI­¹³£�F¿`î×2@ë b!sdÚåU ÉÄa=1xf³è³¾Ý뤮xVCÚ7Ræ š+ùRË×bñŸ­­WøäŠ}Ô½�£Õ û}Áîõ¾ ìû_èïñk—ôºÃä˜%[Ûµs°M`73�ñBÐQ,<Ñ©B¿ðhŸ Ú˜ÞÀfÆ.’s+†+Ø#Ãæ¿¬øüQ°Cx%-Xë¹XxÎà‰;,©qªlb]´~NÑüŠ©Ÿõ¯ÅÁï5mõF.’§ß}ƒ«ÚažJ§f0¥§éì8š‘‡Á’ÇFï .™€ñÍOµ`%Éc ô”TH¥;?—¥žmt+„ÂfË'„òÀ]zâ£ÿA”T°øñe¨¬ ìô¿¿XB(Os×÷¬°gpg÷¡h Bk"�B;Ý0h'+ÔÑy_3â]=Ùž¬sy¨P¼ä}¥òžd8È X ÇúÈDÖ/!¡q´í< ºW[_ z…™¢@üx˜ ¨nu5šô/p=éÔ¡‚M¨Ús#ž+±_´œÞ+æ€4æiAyßG¬á#˜T‚ÃBgÇŽaŒ)0©Iu° gpgˆFAeÎÌ …R¸ûšùC Â¢ÙDyÝá˦Š]ϡݘ76 “Ž˜D@» {kP}ØUÜC¦Þ °gpgˆFCHåe ¯)9ÀŠ+ÁЇœC-¯ü?žJát}[D3T8Ÿu"ï•ÎI±�[“!g½ËeuJ¸°gpgˆFCW»/ 5 c ẋE  ¡°ˆ8”?z-+4\[5jƒtWM%ŸilŸ¨Ø‚rô‚,Üõß5×|˜É}°gpgˆFD uw Ö¬çŽˆP3Ÿ|¨­Û!fÀÅ 2†5T…3±ËŸBj*ÀfÞBåc™éXp=‡ÞÖ‡ °gpgˆFDæG" å|ö«—ºü[pŸ^ÁmÄi;�«–öG:»1sûŸkø³áñçØ;FÆ—‰Œc±°gpgˆFDæÛ¡ ¬�Ô›\ˆÿ�F÷�'^ædv¤ÜƼýÓ6LYßÄŸQõV•ñPL€ºÌëÙX�™o–i|°gpgˆFDç8 ²ßä‘ÉÙcìÙ,Ÿd,�?j��áb‡£K´>ažkôg�›êfØ"vZ\R¾aç¨?«N5½°gpgˆFDìq ‘>%4„·é�çœ÷wÝRîÒd‚J± ð-)–kΞ/[A‰š|³Ø/!`ªþ¶µI§Ê°gpgˆFDíEµ S•Ê é«üÒ�Iž!Q›œÔIë~¯l´‘8@Lrýý„ ˆY »öÅSòf<^o…�–ª°gpgˆFDîB Mq²¤ƒª3PÁZ�®‘Š®îÐñ´áD_�¸#ÝR� Vª 2çqóì^i‡ƒP›°gpgˆFDîB% >°¡?ÌÙ/&uN §JþÑKÀ•îí¿•Ôï#Gl”C æ_>­ø[¼ kewú4°côÜ@°gpgˆFD÷eL gó1n´”þ ž%A5”Œ(9–Âèn$èœJÎ=¢ºž4Õ ’ ª[L˜¢©V^5¤4ÁZë”°gpgˆFE8Ç Й6WP“C! ™NJ*®ô Iº³²Iòí _’�±GŒ/|¥ž�ËùE•“åÞzhx°gpgˆFEÝÑÛ ÿ�Up4Eœ5GÞŸzª™ˆmV÷Ôœª+|ÑÑèÏ?Á7]Ÿ}�A’%yvä�¬›Å~ó`åa4°gpgˆFFN  ÊãUošŸhæˆ<�†JÐ3Ø71wìÂpÛ$[Om!¡ŸOÄÔÞò=#ã½Ð¦_ðaÖ’É)°gpgˆFFÕ×¾ -v ~Ĩ¬{Ô €/ÁA¢¥?‘)*2[K½ zJ –¿}žã‡¿Ù#"©LòÉ0°gpgˆFG/– …6·¢ì=G*ŸqÖ$ƒ�‚r/o-õ;•ϵ¤žŸwê]./¯†²}S3ÕOdÈ4°gpgˆFG9Ó À) á 2¬e> ÇPŒÏW…ðäUmû×µðØÏ=Ô" ÆŒÈù 7rŽ1Пշ–]á°gpgˆFG×éà ` ž¬ïÈÀž*iÔÈHŽÃ 6T?‘€e‘°gpgˆFF’ã0 Ç5`>«Hqûs$�¤†ën ½�~ùïÙ™…ËM~÷žs´ÂêõWŸkÆ£t¼Ô~ˆ¦¸»&ºƒâ^‘0ŸzíéZùõc¼Û™…v5§´�$Ÿ °gpgˆL AòŽsƒÌP’ }%Ê Á)§Â(H›žý[›JÔð(ä.¼°×ž­]�X€Ë­Æ­ôj�ÐQ–±¨ê\°gpgˆL B룃©ób ÍñU!¯Ø}þË °½Wpã•3ûTãæo~ÜRf”ŸTcCÞ "¶ÛÞ›;&™#°@¢}°gpgˆL B¸xƒŸ&� >¦ýãU¤Ëeýœº�åp*E²^Taà¾e®°ž$ˆÔÅn RZŸr1.¹¡³¤×óû°gpgˆL B$ⵃ™üP =¼ÁpŽ_æŸOwýR] ׫ \íà®(ÅE˜Àž8l Õ«:’ôSðˆ:¯4ËÔ°gpgˆL BE�Rƒy]³ ƒæÖáÕÏ–Ê} ˆh½‘”ŠúkæÉôö{Ìaƒ,í1öž=–Éì Üô.š;8’™‹°gpgˆL Bh¶ƒVÄO &±Åã N°=Ç ¢…Ó�ÿ.�Yë0Å¢7âmˆºù  •¶DÆ”Z¹ j€‘G9l¾î÷%°gpgˆL C;ƒ¸¤ ¦¯ø££Sﬞ,ÞÅ”e%\ [ªTK*÷:é(‹% Ü"÷Q`UD:úCY·�÷íjÄq°gpgˆL Aý<éƒÁ¢ ’òã»S¼z¤o^ž5ŒÿҮˆOŒ¡†%4„·é�ºáž;ˆO’ v„ŠÀŒï*ßH`…½ÜŸC¿Y Ûv ,w;�äŒéL‘°gpgˆL B½fƒ§!Ÿ FÉ·x9»¹rEŸNÅWù�§ÊN•RWõ2TQ�!˜ž-šïþ—\ineå­Í…kI¼ôŰgpgˆL B�ƒ¦]ÿ vÁ¢1n¡_œ ŽÕ^øÔËa¼dW¸Ã8:çWµöŸi=” ! fNÏã¢37&Ör] °gpgˆL B>°Sƒ€.² i¨íIêÚ|Y¯¸ ÄÇ?àuè g>n‚¹’¼æ%¬÷ŸLøùYÏ&ŠžÒ •¾Î*{ß±vô§˜üêÔ‘Y«'™£Óåþ©cETw¥™ùã�$šˆqæÕf2&dk¿¼¦ˆoÂ'ëžgôåé®Ñ¾PN¾½u{Æ„§èÆh¤½HÚõ;”²@ 㛺ö�×.hªŠ¿g6Dd£È¹y칬ñÝ€¼£‘,°gpgˆ¢ AI¥ƒ·•` Šuk¡‰XUŸÿb¸ƒ§ {ïÞ~j9ó·÷ËåxZ6.|šV†ª2•¼Z­ý¨’‹8¹c5Þ76«—7FD“ŒÏrÔ5€ˆ'ÀFT(•¼¢ý@—&8Ç%IsMðêfrÌ¿©½‚qÂ>Ä4´±ƒ­BšVѰ1͘ŸVÏÁ `ú±çêï�.À»A"‹Úh»ôŠžD†©¨md{Äè*�o¼¤¢ñ‡Éi¨ÎúzÞ#eCôò¸`‡<&Ô}†u²8[;ØX‰û÷ · Ïy½šXbÒûhÂ0£ÆæÈ,d9~3@{{V6@ó1MU$×Én6¡btƒ°gpg‰MÇ͵ dXÓÔ}µ�ÈyýÆÒ®óÓÕ¢>�ZD%“X…•U··?Ýo_îÿ@éä�®Â&^‘—Fø+Z¶Ý`ÖWß0‚¬†AŒÃ £ ãe¢¼bÑ©%b"²öãËMáb¦7jõ¨f v·¹‘EGŒ´¨Û¶DHÖ«4'WƒÚ §¼½,ŽgÔÌ– ­Ÿ:˜{ðåãDOzð˜ô/O�‹µ;«ÙÚh:;Nƒ:’SW²·¢…Sd½½N/ѤxpÏ›Äs:ŒôñÔ¹(¶ý¤ÖXÈßÄæ¹QæÄ„¥³«†›¿54Hˆ¤¦x­GÏ]³Dª Ó8i}| fW:& ŽÜ�> ]�àð°gpg‰Rßju /&xÒ<]š¤8Ÿ‹^ï Èu'’ŸëVÆé¯\ôo4º°Îû¦²Ci×{ê¸.Y)ÅÞ®•3Ýgjp�Óå»òÑwƒÓ©#êwô Õ,wÇ~¡Pr¬T—j 8Âó…¿kÁ‘4”RdWC"‘ã¤_óq€ªŠËwÈö÷cMÙ¾?Q¢±Õ£¶ ïj€K�Û•®°r1ƒ�ÇþÖâæ)<à%30JöžÙJWË„ø·;Q{„ÛµLÍþé‚ùZ†ì²—­[éF#¥¶¥É:Æë†¨6òµFBp²H9u‹ E\ ¹ü¯ÛŠN„tñ�"ª’¤~9;0Ç4žQ6çöaóš�ŠÆÓyë‹m*°gpg‰ M½ˆµ å+½¼�¥®Ý”ÿFv ð;®2£é{D”µ5'*“(jnvžCÜ�VK]Hú|r‘}çzÁh¼A„:üÝ…;D3]x�„Å@mªCÊQʳœ©¸ÔZX´ �áƒ4kJî¡Á–M‹m[M÷~2Ø,–5Dåd¦ *$¤NZš÷iGa¾Ü/A<ñi–ï(àFZ( >èŸi’S³’è°’å‡A—ÿ1�kà!$Blˆþ;±2º7ö@dÄv®ž ²,0Ò‘ƒ €¥2}òè‚�Áf[ËÙ»L€A‰/Íól¹-+äMÖ—ôÙÐþ4ìïfvxþ*ãTåtaç*~é+:õY j4^Ì#-°gpg‰" Bb4Ÿu —¸›ÊW­|˜¶ªlS½‚CÚa)"¨ÖV’hƒ¹O-Ó¶ð.�ÁËt¸êJƒÞV³ºk±ÉJ£°ÿbp'X M Dh¿FIfðÐU‹¢W7cŸF/“zËõØx{ì úìUŒç¯¸I(M¹ùÆiRl�Bð×x‰æ ¶µÝ“¦+DôàƒN. ëK`9÷óÕÀIq/Ε ”œÂáÍH­•é©oÏRÓ·dX�ï�µÚ *2UÝqïyÑ„;©²på7»UEØgR-‚'Ñ ›0Õ0­|å›ç�²FÃëDÛmÞ¿o’3„¿B~ >õÖ–æ\Þ’ `rŸED½UÛðÉ?³é°gpg‰" BbÜBu —¸›ÊW­|©ùü 4å`mÏtü’z³ñg´N_MV´r§g›ÿ8:kùj72'ofJ<Æ6 ý =ôß­‚Bd'éÆV8HÆÄ�éòH¯Åáôî7ãf*�3Š#´Çy˜âY;u‹É…=Y“îÀ>º:ÉšGûf3ö©þ¦þk[7ŽÁif1´êñNhï"àº2 N�IБµT´›"\µ{o…° ÃÎ Þ¢N~r~JlZ—•ØÞzGLKI~ ¿Æ›p¶“±@•¾œŠ˜™î©ÿî‚¶Á|þSžVú$™mw�Ü—sÝœ?÷WA›q°ù�Mnë¨ l"`sÉ!¨À%ùù ¢¸Çƒ°gpg‰" BuZuu —¸›ÊW­|2ü ”±q è–„¥îÊh«ÙH$öýòß�Ó›\ÆôÆÊ|ŸÌCU6¦ÇÄÈ “¨"­@ƒ4êÑ%Î{Ž//-¯ÂÌ1ûG™YÛF�ìàȈ4èô8ëí»±#A«Cíq<:ºš!³Ý„“?Öb 6Ã%š$&‹7óœ| ×KW«–BÀ(Ô…ç7/¸Ô¡¾\L¸zUòá-¨S8¿_-#-ØnX1·dÏß6‰ Ç€?Õg¥}ºíƒúdeÕø¡fy"ˆ�m ¸ÁKš·;èãëÌ븢€,¨bcžä>f³k¼¼}ŒÉ°ˆŠ‘v¼ˆó±—I¥°;VŒÑ±¨Xõ±Ô}�SÅ�šQ°gpg‰" B¯Ô!u —¸›ÊW­|É ý�ÍÖ¿ûÓ¹¨¥³Ð›˜S<9uàó{¶9�CÐë°ý:Ë;t¶8|ôŸñÄÞƒw =ózÏ“òbûqÚ ¾g›ß2º:Û>Š¥4à0Ó—£ÀK5’ùËGó† Cñ¶T½·Ìr:¸)—L¡ å¹y‚5c)>ë)îÍ„,8‘°0–/aP)(ŽÍ–³1^Òþ[‘¢üÎüv¼õ½ó&k»ÎI{ŠofWŒR³/Zæ• ûë†oú;Èðº�èªL–¨ºÎÃÖ‡&K¾D–§Œ¾Në*§jBçÅðs¸iÈùÔD¥$À¯5=–ü]«VÈ‘!N²-ñåݘiØ“´¹©°gpg‰" Bµzu —¸›ÊW­|ÆÿszM,þ ¹Üšèj:«�“ýni²ï[uE6x³÷q{|Ç΄ÀÍû{à,ÐÆ½ Ýl_üK×;Y&¢Î«|�285˜3Ë›ù$=` åOðü Iº+J¡ñ´ù’ÈÇðå~ü÷¡+/N9ø©J’Jˆ3ÕÕ%S;bïA+ÇÞ=–#–—8á&lîäq(ýu`¹¶°«èb£ÿñá²Y“ŒîwˆËý›²–å+Tr?Zm•Ͷ«cóbª ��Xß혊�Vÿ/�rLÚ¼]äðǘndWF4¶K·šu·–þ”F+¦ŸµÊ" ój'=Äyӻݰgpg‰" B·yu —¸›ÊW­|: ÿ@æù jy Ñ2¯ô9_¬àô64B‰AoÁC–k¼}ºÑ%LÔéi;‹Z+"B÷5–Š·"Â{ce�ÕïŒ^l‘sîòÁ媺.f#r½|‰J·µ•­tüùx!EfYÿ}^ÌGEÌk¥B‰õ‡B =¶Àôý/+úÒ„ 5¾S|$Zäh`þäÉMBoe¤gNÀîlü¼ýÌï}A2–Dó3ƒÇÃ?øõ{7›�Xl昩e�÷ù†êç7ÑA±1‰T‹�žÖ"a•7ºxjÏŒæ›ßòuб•”èÄ´ó°˜Ad×%ò?5mˆUªˇs1„‘䮺„ éTì¦üåó°gpg‰" BÈåru —¸›ÊW­|è°´DTÙ]†È6Sž@/Až¯oÇffš¾âtœšxš1 &‘k뾋ˆƒ}ô= }ó›—í´8$ÀC¹6�.`q.ì2hX*”ßEДaˆ«¯gð–/Í„õÛúÈŠ¼{ïC§¼Ê0¦»÷V— í)¿ô™–‹›g¿ãè-ÉÅR9•—‚¾üIUÕÁ,܈åv|`×EȉrrT“$ó×ö¯šL=Û-?Œs•=ÁGÕÜÚ9Ñܸ.7Rš¢ÅY=$çžúeUKÜÆ·Ë^A2þæšãÝl…™¹r @̆èá“2Læ*¬>ñ¬92�_á¾aà/ÎI»°gpg‰" BÌØëu —¸›ÊW­|ý¤ý݉¢­žl˜x4±¡#Ša:d'á„TemÕÞ—Ø2„Øõük4–Òâ>„Dïé]˲i I¿%�ÒâY%+¢/Æ}%F—ã†)(B\˜ùò×:”Þ1—G /Œ † ûÍn̉‘<.WlÀ” 3y²=ADðô¯ßŒí^ j&t¹aîÂfå4•¦Ï+i®›ýÿâɗѲ¶ò‘x‡-m‚}{,r7I¿�œ´/~híÏ$G‰\ðÊv“ ºÎ�]0RJµ“{;0#ë/¸Ù6’dë/¸qçJ1õÎY‰]’íÏ]-Y×u.w\�*t»œðªD °gpg‰" BÑwGu —¸›ÊW­|ˆo—–áožs+z¼„HJF=,䉹‹ˆÂ Єrú]ærÏŒ>ÀJ¬©ôr2U}O+#^L›þ½As‹k a›BÜYä\ކzÐ×ã7¤þIÞ þz—Åøø¡�k<°Åwsð·ÅÞºPXÕŠ ߦµø¿• Ýøáåñ¬X~�[K ¥Ö 'Ö8-SœÀ\�€àòj€V¶mO6ÕÄ‚iÄœàÅ=ý“2òoB@xgÃ/0¿¿ÓYÝ«'x¦uzCÝÈŸÊ|ç^•,Ĥ×G¬•àeëá(ÞY[Áx/ºYIJþ™¡DI™¦@r¤-¡öÀ²Áu«Ð– °gpg‰" BãC5u —¸›ÊW­|aùÿG@™o´êö@œß9|ÝÖP’,ê‡Ö8®&S–øgÚ{%ý•ÅXàÇ·èÙ¢Û)ù6HæöcXägf¼¶î‹™Å7Nç-΀¶'—¯Ód½/Që44‡‹”C�¨mdŠúTh>Œ}TGxÂew‹�¬–)³� x„M3jï"ë*‡^ÿÐÖÍL 'EÞþÀHñÚ—ÖmÂ�ôŒ«t9èæd%ÒºU—úLß¿Oð<Èân¬âkB¢,Ø'>”ä ÷I8—ЬO �AƒïØ Ü!±*ÆPÞEùÙ…‡^ô"‹{d�ö €jtûàŠ~B‡ÝÜL¡ ýÊ<ÛFO7¦×�_¨°gpg‰" Bãë u —¸›ÊW­|CÕþ %žñ}'½CS —ŒÅøs#\FÞxëÂz)ßO!¿Ð-ž$UW/è†`Ì{Ä2õõM�P*5ÍIöÁè©©<(ËÄK(#ÿ¦O˺�!›&¬~Ôš‡^Ö–Mæ˜çŸÑ“-K�_0W2BkÎ¡Èø6ç€ÿÿ¥§”CXÎÀÛReºƒ‰�U(£Ùù¼w�ž:ÝMyƒd¶,_¡…ö²©�‹Óe`ñ‘¶z7UmO 4]ò*’¶*^eA¤ºRl†.©*øò.žn¨ùð›‹�µáî¶QîãŒAª5¶—m]¹öf˜–—ÍSÙ»Ù.§²ÅNr °gpg‰" Bì~u —¸›ÊW­|r/þ1j!"4°"ëªhÙÜädö7Ï 8G2"6]ÙǬY,#»â/ºad ·É¿ù»œ Y-�óu¸×‹fr%dZ¯¿çi�;þï‘+wÍÊÐö¶lŒ¹*Ÿ‰Ælöv¶ ^ÇÑ^ÅÈÎ i ú8†žJö*~ }¦ÿ¯þáΠþ‡ÊgÃ)gb!VÞl‘9WóEŲõ¯È Ý‹Á G@ûY¤muþõ˜GW¤ºšs Š%¯õÊ4XTR•ƒÊ°p‡¢ì¼;µF¡ƒWIŽ|O>�yöŽe¼ïßtSøôån’‚ô©ÃÙ¿�tUýVð·ÐåáŠÙ‰> ŸËaADذgpg‰" Bí&u —¸›ÊW­|.¨É—E)`ú÷ŸlâU1*„Áž#ò°+0„þ«I!ä(Ô»ˆ@•Cõèadt¸LY<Ã|g+kà-Ãm�ä¾Áº'q±'ŽŽZû,J°ùfe(?R>"¦kÿ &õ{6\3Ȱ?² “¿�§¦N¦¯­Cmy}Æ«+ü#C6ðA1��»ˆæ]äH²ÔNÒÒ¼ 'üíçò€*.*Z¬n%?ëÿQ{Fw}hé?÷asr¤–{c_£FÛkP’j­ZÔ²E4`$¸:¬&- زl�âŠM±F¹ôxÂ×Q€xEÛ áSGö0D}oF.þž`5UCFÿ~ª¼õRw°gpg‰" Bÿœ¨u —¸›ÊW­|£õ´6þÍŽcâZ©U¨ß俵÷6ACþ"­}FC4Bæ‡~i÷ü¿~0ÎP°ŠÏH”•ÿF tåO‘höyÕåJ¯ªOz·«Dvµ ¬¨“Ìc»ú¿œ¶ñ¿±úÎeÁ|¸”²Ío½kJÂÉò¬z¯Ãc~pÍA�ŽÁïÒc﫪.˜Ä§w\ Ü/YZz®]4tl9 µwHâkNAj*lÎWPö û«p†…¼)‹¤�Êg ٢܅ÿL'¨×M­ÄÐOàûëCþða‘Ò IÖÑ€ìwE¹¥Ä¤!¡}?fºó&8óñi#%ØN9WÎ_‹Že 2—œO¬æä}{°gpg‰" D­j”u —¸›ÊW­|G­¯bé4W}?lØ ?ŒN ¸}L‰6¶k[ç-ñÔzìå>å7ÎÐ^ñ3!Ñê+¢L‘ê÷è!PµJâãéb_NM× ŽïЃ+§~]K~.Wãy˜wø¸l`[ÐÐ¥io’ÏÖR×(‡TdQÀ67ɨþ[õߥu1Œx(*0ÃR(\0ëeÍ×GÅ_5HjB4‹‚Í$~¥n³:•†+o°ÊJkµ×@ Ü¹è¶ èû¾º&Šð湃¥x´O|h>Õr°ÒËáI7ñÝ`?æþqòél}Þ’§†&ú¡šÖ’èµÆÝYB„•Ò"`ºµÑw½Â†D0°Ñ"àIJl埈õ 7Ü¥¶¤d%HŸM‘&?$¶–Ú-ÑɆ`±§,NM"+¾Aäð6×­…šûº‘D /QÖl ž›ad+á›ýoXd‹z¼zÔ©í\0¤2ØD>Þ‘,*°—G{çǧ°gpg‰A}ð~ ljÇÿ,é6Qþ1: �©ó šÿCz+uúˆíxÏQä%(§A�øŸ@ZºÞp²7·òŽ7µ×Ž ®ŽÔmî@D<ÛÖàJ¡‡ìôÇžŽÄô¼'nõ'd·Eê\O:U/cà¥�o`NƒÖ†/n·÷ l~n¶�85^-@eÏ´UªÃ»õeÝìÿ†�j�e€©[ßç\®½/ö›"¼· u"U.$š‹É‚|ÑÈ"dN"¢ra浕81¡öȌޟ¢­>� ²ÉkýÕvE tYÅzïÙP¿ý X_åy€“LŠþ9‘ @Ñ-^ô�W´êx&¤‹¶Êí£Ø0¦hçºЂ^#†¶;Éÿó´|T†Œ&ºËÑÀ�Ü}¶éFé>d…hÞÀõÀÍhe‹¬Ã‡¸8v¤«Íïí¬²={[Ôc|.<72㞘%¾ ñ šcCÊkxÃä?Œ™¾áÙˆç+Òû&‡²µZÞ-—G-¯Oá÷ùÜ0k·›'@d RéŒ KZ?àIåK㉉FpæO)¾Cè5ná:\x„ÝŠJ“6©]lp¤H· Oâ컦¢d–ý]Ê�ÏTZ)w�Ê!Pä×ðÕÓPËPåOÛM(aÎs“„de!Â,ÙMÐ#v0së3Ñ1„Ü{^µ§‹Uþ3#©ÎîJƒwë7ó«p¨Ô’fM¢Ã|©³‹I°gpg‰F¿h ‹DÙ­Ê;2ªÑM’H�Äœ�~È5ÈÚçƒh6Z§!%ÑÛ¾)¸BüÛ¤‹!Š$E˜?Ì'éoqÁaÞ䘬þ¬»uO›”éx(Ñj¸þÈçÁÂÑ‚NœôgÌE¤%6Ð Ö=ú€ð~O0òeâí¯qì^­q—][6þ9 ˆÃ Ÿö68GªIúH+—(ÖÓ×~.ç wu'&B¶*P¤áÈóîhr–pm àÆ]³Û‡Œ“¢íÇ òìíp%Òÿùž�|†ÎïoÆ/<0öh�Ž¢™{𠸘{>ÉÄ7QN-™MðwŽ0Ú.�;ìAã6yâiùÏ/¦¨1ó|ÑW«Lüèdm»ã™Šk©§5w’Ά»ûÿ‘ù�¥{ ¥ËN¥µØòÁŽß¾@jWâpÄId(¶D`�4Ç´dÓ�.úS‘©Ç”"…Ïí�¨Ã¥¥‘¯»GS9ó®H)öÔÙ)-ÿp›C6¼UÿMºôQ¶o]€üZãbÚòüæP?qþ$· +Ú½d¶Ó¡?₃2|Û¿{óœÛÎ$ެmðÿ RÙÒ~Øþ®µ‰­Éé¡ßÇ‹ö;où$Ç!–Žð‚Ο~Ôê1ÄxÅ87×–æ£^ŠßmrLº8ã,‡ ©&œ^‹µ¬½¤õß^1Öõ�]7ôARTЏ)(I©¦†;Ã^7 cÃùN‡Ü¾ÁœìJèäþ“30Ì΃ŹOϯx"úæsÖã¬ã­M ÄgA”o�ÛÔ­æ¸?ï‹}iÑ»ä�ó¡Fì,¼?¿ŒZ PåxÓ—³y€Aó ‹d€^Õ•¾éÅLÞ &U˲zVùÚjK,\WŽò"StWq»œàB(Šj‹½­CˆVÍrœ,NùÔÇÚ÷@O %ôjÙ;–{È !ì ß2žÎ(t6V„Åyh‹è0¥›ô2ãç‡r�‚-ËP–ñÉc“Ð9W¢*°Ó1]qÌcçâÌÎeŠ.ÎGÔR`ªÚªT VÐ@‘\õZmí²îÊ\Ø`•scFzËДê,¸YƦڂ–9rˆ˜d Bzý!À2À ö<�1QüÃÄRÅ >Iɵ+–°ïúì~~ù, dø)ÉáqøJhV‰[Uùwþ×–P%(ïvrº.·¼�ê¦òœóð"1�È%.ûô:®¥’z©U‹÷b1þ;ü*Êy>s0#w{ÛA¹A¡ß?�«¸RJ>ÌgZVÀÑyr›øú„{~çc+E ß_A+®ûƒéé[ï”o¬9~„çg†—ɉéœíc bù~f~`uð.N“uDrO¶O‘"ÍÆnn•_÷Ü_§Ú�Û;JFµE©š‘V¹ª­ èù�¥eù£AiiÄf¶àÎDò…ÌDwvÑ« ˜»Að6¯"–Í?‰ÇïÄZG"ï�xb[dõÕ•aŒòh'ŸH"Óýq6ÞÏðgpg‰" Bëê)ƒÒôÜ ,.FÖq”+S…ÿw§>JpÛ!Nùœ�S;Ñ¥¨ó˜†ääŠ[w¦¤�ø§jÊœü¦ˆœ/¸7ÃL4±˜‰qr ÷‘+)¢ªÞiþKG ãó}ªÃÓéDz-|¾ùî�Å1\u›r�Žw7¡\µ˜#�ª@hÚs‰*Gk$¶÷ù´¼q3tO¸ƒ(Iòôî:Ï:ÿv‘$i×.”‰ ¤ƒ�舼+xZ˜—ý|:dXeñõmª0 ›­E¯›%h¶8¥‚AÃÏX¢¹7K ëøq±VVÓµ _TŒÛåxM6'� Iº6qèv“êŒeéënŸŠéñmÓ—U•o�k†VT�—Ák�/¼¤9ÐàK §{µ"(4,šÉ2l¿èŽÝƪ­:‘‰:KXÀ,�õñ¢(=l1Ï0_˜Ì&ŠŒ°³•‡îò˜'Ej×W¹È�swnŽsá4R9 ~UÇDª0@!§Üg¦:~!¸$}0—$™¼+c—²t’Ê Tmàz.¼vEÁ){J ¶(Ûõ,X* ÓÄ9ÿõ/¼êc|ßÇ!eõÀVá�5nddˆºö?Äêã,=S>œÝ4"Êhe/hE)ƒ³èþŽûSê¥x4ü1“,yØõµPQ£Ù“~ÖÔž¡DQ°gpg‰" AÒ ÑƒìÕ4 v^%ª ñx¡âþ%ù3Ñ´£ˆ ÉQnævwOˆKrû�vXZÍܽ[ÔñYµn¹†ÊçvxÛµ„ÿSC£Ä±fŒJË©šh(+åç=ó-IJ©Çû¿)<üæñ$†àBì'ÍGc]Œ3ù ¿¡5: 7(Õaºg„ÙœŽÕš�ÓL6(užœ¨LL@Š�,{äv=µ@Ëùíö-/áÔ!ÐÀÁ9§õøè³îT‹ uVA�ß»CÏ¥�‡› Ö¬íüŸ²¨! úq¯Ø|�•’€w¾Âô(EáÕ%s@çóÓ†¯è©Ñ¹í%½úà`áèdªéD—âÓ—*šªÜØ·yàÜÝZdò&ù@ÿøT|kˆý K?âàq j›së¹úN|·‹�Dè`DîôòÀ³:ð?–�ɱ*¹èÜœ a~ГxWE…ðù(ã™Ù‡¿ÿ4®¼†O~”�ŒþóÆäúÕ.‰ð:ú½—"`÷—a_yo¿hfºk}~r=Œ‹ý©(ÚFÙæqóEb÷�ÿtßr²€•‰Þæ h|×¼³¾ðl›wÐÙIœcßS•`=UìÕk’ãa=­Ô˜†FôÌœ…glŽKãæØ-¸ÐO@š¤_èÓ{M-f¦TÓÚ}T?Í´¥q»Z6‹µWQSÚ0Š‘ïJ>ö-èÈJìóq#Îó[Æ©9¸yî«Ñw•ÂnO~µ†Óú_† °�ñÞ Ad¤+öÜ•¿9Ð|ö.i„Ö‰˜WÓåuŒK‚ Ô\ÈÎ°Š¼™ ãCEÀàH ‚S]ÿBz5S�TPy²³r8'Ë)grž€x©ßƒ¢ˆ `Á(œøs.—v´ÛQ.T·ÅÖ±Òiqsà?[²öÁïjþí©Dˆ{¢ñMGŽy†¸Ín!¾OÎôñú½ÂÿØmR�¥š÷€©R°qÃÝ­ &Ã×–a"”NgÛ;2‹T>‘nÉKüÙj_©1‹e}|n°gpgˆd$ €WvÂŒ <¬­ žd8È XßÞ�þLm“âÇN©9ý1ùëvÎ9 ˆªmOIB43ë‰�(†ò2–6ëI°gpg‰Y}” ?œK÷DH7�)?“Œý�Õ†Æñv¯|BÜ/bdòŽ]¢èÔk+޾˜Ówz|ÒMU­KÕÌr.Å�Ÿ,‘`‚Zÿ^�Õ®´ÁÕ w”JÒð)…œXþÜ–º†Ge›t”Í(åf@Ýü^�ÍØÇÜŽl�{1&p�£u­Ò:ŠðPµÒ»G\Ïp¶|Cšlº:Ì2oNªÒ¿ñ¨1«ï ãéƒ�”d©ù4�î(‰QYZWå¬VœÆ¬LŽ0"9þF�ê*2k®$‚ë‚sP»ñ£}½Buþôq°ÈA†0¤ žÂ¬ä£De „üj°gpg‰3! TùkÄâ)“ƒ”^ ‘©Ž½NZ$O› ^ ‘©Ž½NE.þ/|œíæß?ðcž3nÉ¿ 3F´µ¨ÄGb¨‘  ç¹�]uÔ;ì®Ä‘ÿohW,ÿr9Si)\vñŽ™ã¢ÍëÒªÝ( ‹gñ;%í+v›oV#„êóc2£±«ìñh乄aRp0èˆpª¯_Ëù´ mƒbí½^‹×ç–Àìñÿm¶ðk£šÓaá/0í`³ÕÈ'½FFo²†£¤¢XþPL“‘AÔæ‹#·ü` àˆxwšQÑ�'V)×d Þªzt`ë5xáløÛ‘߃òå(rX˜±ÐÐkr;Dú´°gpg‰Z D! Ø#ÿzó ôg >…%/›06XÔ2·&https://keybase.pub/h5/pgp/policy.txt …%/›06g¶?þ$j_á/åøÈ½Éëù厗be©§ Î[ûÌ*˜2_”Þ܉4Ý,@äÈïx XÊí÷S ®´^@ÃÔ6°E€Eñ›ïª*k^°ôq¢³1ˆ xnñ§ƒÈ¢A&½†ÎºF­dEªéÍ£]!’ºò䨴Jâ*|”17!Oæªc�‚W'ªnÃöPò¢%ئi¿BŒ|›&i³ÿš ]—ëG$xVBE·»£Ø ±´lSERΨÓxìÔîÛV˜ŠÃÐKÍdp˜_Ÿ8M~U° è�¸¤o•‰ï•â�Jy…gøÈï.w\´Ë-¸ Iɤëß²ÍQnß› „.`h—|YMP:ðZ©9§¬BT5BãŸH—¨Aa}\. -[üù _xS�/R?†Âî4„q Ðü¥¡D§�ª"»uxMú¦!6Œ,Éÿ–œÂÓs{Í ·ca¯~ÞaàÐ"hk[ 9‡nNÄÆo~Ù®V.¤¯g§µÍ=;ö�þX"4µd›i…á—H’òf¬«w>ÒÈü·rµðùÙ-—&ÝÕ~7sí#f¿!Õ ¿¤rr_¨y뽩�_`ÅÊ·~¾‰K1Sê4[Š.~K¾/Ýì¤`]Ttƒ´p[«&WÅch˜"¹bìDžLŽC¹äR°:õ]½qÑMiç™A°"tî„ÐÍžã¿{ÍÄrØ|žâ©¸˜Ød6‚¥¨³e̓ë3�š~ØÐ_æE‘úl›÷÷¥l3º q�Þ?DÏ—ø‹“š€´l/¬àrB|íÞU9U’àH³ßisáÎ\̆Ù_(¾+ŒB “¹PΦ’fçÕÕ¡ü/IÓÓÒº6¬Ä&+Ö[…ÁžæëHí¥ó([F�0U ¥à˜;õÏʶàiCqħ`=虤½�)¿}\ÎŽ¡Bq)ëñg®Yê‡*Æê¾[K¿qf’&ƒLÞ£’ƒÊÐ)r3Ñ™m� »Äæjæ~H<»ù¿Ê~1öJïVšm<ÍgƜٰ´rÂpf]IH}u‚:Öž™›Ý«‘ÁÖØ6¼ÐŒGd¨‰‹®üħ´ÌÙîoIô?‡ìûK¤UJ‹Š2 ààÇ4ŠïrgÆ€°AáÝje¹Ï:h΢ã3ÅBQÐï‘V“âÓúÉbí # ¦/M©ì ÊåÀ•àš¨qû?îæó$-Ë 4ávNV#Z ˆ�”?Aö�x; Ä!°|Ñ;)ëNawÔý¤ÍwÿY­ 7%;ÀeNmq6(0¿Ž0à±V°åk0IÇȆEð(6—¥!E+×hc¯ëÒã¼Ë{fÅ&ýáÞ‚ÖŒ:ˆõÓ ™æ�Þp­å–¥þEx 1=ÛW5áøÁ¥/ä7:— ì—`7ø¥[¸²Npo"¥ò Æ |Kî耚ùjö-‰Ÿ øQ�‹ )´Ú@PÉ·¾J\É]&){imkt•ŠJ¦—Ö/D„ÿ!½+�@ƒTøÞ2’ãüö˜Éò=êsuYè»vã¼)QAWøÂvÖ—x» â$G¹F«$¼ÅO—’X¤Á¿o Hnµ) JÍuÒÝÅ ·�;ð¬Ü<õi¹2Lo¸ÒkGÈAæF¡|t€”ߥËÇœ¿»ODàwí¢]$ýúè_ZýžýÍ¢ÚÔ¬ñoí|«0(àìªe �A>ð–! -UAžÆÝ]yÃ~©=Ùh�·JÚ‹è~ *Ê‘¸B(�^R)Zˆ¸6x³!É#º­�¨kŽð¶Á§‹:aŸ±tƒSW �ÃfSôA3~n4X_$­/ ÈÞÕXKë¾_®ñÎæÿ#éRüL¡}ïJöV�+dqÍ]Ø`K4ʩض„–œÍñ²ÒC—îHÑ]ðü>~š¨e£�|‡>xv¥�(z·8g£eÝõì3þ¯j^ןÄÓL"Áîj%,Ý‹w*¹B¢¶;@õî\ ÂÜP–ñ»S غaÔ«g&±«ùõ‡MsŽ”™qš)›Â–CüNõ˜ @.eª¬Ö_XjÅé¯#Êó¶ËÂ^•�gl`W¹Ä×k#wïµH<<B©úÍ8 ÉŸ4�S¹3‡Oän§Õ>ˆ6(aé¼<ÜG¨H_!ü¨³¦™#–d“Ô g,L³Ç [­ž…ÙQ„ã˜øB-„ÓnÝrÄ]ÕUh̽“ìD¡¡9MÑP¹»IA$‚lòAé­»aOxžäÀí™LO“O¾k©—i�¡ÌVû7½à)®ÌZÛ7îIcT%aR.Ï–+“ AËk›ÉùÁ×£�þá UE2ãÐ� 8‚ ³ŽLFÝ£!ÿN½mL~EA&ôöÅ3½éËCU”Ãô­�Òˆ¤‚è† f$¥››%‚†Âˆv78D̉ìæ.l¢jϬ­ÎǽŠ\k®œÉð/) �"Ò ÅaÝÅx#¡ªÄS.צ¶ð°>âÒå÷…­è+9ölÖ±Fß>G´°ÙΟüaúFP� ©q†ß9, $_µ÷¬(íåÙpZâÆÝÏ+(öOŽ>±tŸâkØ-½Xö”ÈPõd|û]Ï ÉÓò×â¬5G‹p E–D—ç £Ïl¿]jÀQ2ÕJå�òšWm]£FZÔ졮 “ Ò¡"ÆÈßÒ£|÷EË…Œ[òOû/ËpÍgZÁöê/:ï$® á3;w}ƒ<"#öø»´E_»`ÓºTΤ5e¬i¼wŽhÿ/B+莿ÌhŸz8'°Â?˜›T£]ÐCv”NL“ÅHVU -º]6äê†Ü`EÚ‡ò_]ÜÖ“±0È.1w%5€Šyª çÜÙUÝÉ¥mûÄ[ª°gpg‰3!l P§½˜÷žŽq«xZë•ñ“)ÀZ»‘ª xZë•ñ“)À{™ª„ŽÏEm;§ËÏø6°ÐpØ"h°F›ãsÍÔ¾ÆD×À¿`Ýëþ&§S®º1[‚³t'õ\Ÿ&­zÙÍ'kÚcMU­Ü‰M^缞 €5ÙîÜû “Ÿ±žÃHËBÊÏìÏwMñ6ÜD:á9²é º§’Ã[ú½Ý)�I¶¸zÀ �áâN:2¸­« ^´]V¹ÁÖüFYà •Å#ì*‘à‡ŒÍŸËaQþS�‚Ì×eHNüO7oC�} rìèà ÷iâ¥ûG $ËåJ"gÚÊøR[£ô«'XÄ»øÏa ÁÝ`¥È{p¼ƒ`I ›jm˜ž‰•b¸óž‘ðÏÅV—¹ ¶*§óyÞ‰f7¢—j]¯F¯¿…ùö-ÕvÜ3Ö$*ÑÑÀuÇ mcm÷ ˆQ� F*#ÈæÍTXÈQ¢öÆ Ú –¥“&¬Âô% (Íú�Aß!½ï]‡còƒ}iOà¯u²%‚÷W9Ç˶Š× v»Ê΄ÄèÞœ¦$�lz!¯:u‘z][ê–†KÖ~Õ—Vú;êLÖôªlùžÆ:4´à‡·{Ÿ�öh_ÉqÑãpðÝ£�ïoö®dœà”¢#8o´ú?fuö÷„}›u$(‹Ï`÷ÖöZü~pY¥Ì?A‚ª3ô‰½ßãŒ!WNËOUæ,|=y¡ía7ü™¾=°gpg‰3 !n¼íxkwbß(Ÿ`¾ßОͩZõqÑ ¾ßОͩgQý�”íû"«žÂ,H?‚:U3mÕM·á]&W˜R¡^wZëEÜrÒ¦„n(®'µÍçòÛsÛù‡A&ÛÑÍsŸ·w”NûÒ�ãÀ XË~@”°:ÊÿWÖ«£­‚_Z¦I3o5ƒÜ�„u%–…”؈_&ü�ma£Å‚Ï€Â.õÆrn ½Ñä½ÜtÜÐæx6zÎî sp‡êw¯hŒÑJ¤k+ûê\ªO§€¥‡d]Òwkä…Yá¹\ÑF¿U@•ùû„o§ÌQ4ãE/íƒQyõ(BXtëä½G„ha93—ÆM{o•=öôJ”Êc¨„½y ¡ ¾âPL,î�ivb}˜�Í�Ôp:DƒÔ`�öf`¥ÁìK&§ÌÇä8ýmÔ®1O;š —Z£ e'ú£•’³–ÑÂ’IF¡(ÇÒKð3*oCôê_*ÈŒnu³•9’?ïˆ�t£ˆª¹"v#ÖN:G>pë«Ç<Â`�Üñ+ƒSc;8ì�V™ã¿Êj±…ªÂu#xøŽÿeãf¸p¸Ü†Ó£â7}øWZô9#©Þ'ÊÆÛ5¸…ÆâCÙ’©*$:ŽIFÓÇŸ˜løò™¨‹�Yæu4M ‘Bœ4ØK7+’%†øF¬S@¶áC?m„²Í>Y;ÌPq&Æ[нZÚIhòx=á†UiiYy4•[u°gpgˆ{; €!Ùž¬sy¨P¼ä}¥òžd8È X[5%p ¼ žd8È XC ¾Ò…ù'SøL50Å >ý›Ùž?ׂúá8†3´%›�hˆQ‚j{°gpgˆ”T € ÓÊD!Ùž¬sy¨P¼ä}¥òžd8È X^Ýt—hkps://keys.gentoo.org/ žd8È Xëð��l“éà{ìWƒšù­¨•Sº ž*­LK¯�vˆ�ZëxßÖÏA%°gpg¹ @üx‚Ï|W�å¤[ˆ*ùþlõ¥f±¼^�¹Íôé—S¶XK±Î™,IŽøÊ¾³ë3¢ ‚nD>$ñØâÿµ¦=tni,˜… ÁþV=éf&záûŸqÞXø–·X=ô§5&V£rVØ lÐ…†µÜç5¹‰ªku8͹P‡6‚i‚0·=´UÍxLeú¡ÝX\öC­Àǘ:ðŒ7D[^툨ÓæÀ ÕìTF=‰wÏ)|y’Ûø]Æ·ál‡@Ž0Uág>¸§�´¸À(^ŸuŸrÕzîd—a8ÐA{µØþg'£x+º&/¢ Píl-î´Å0Çžè/þ-öJ`ù[É™ÙÇÓÌjÚÉ�úØM¯‚�@N²l@Éq¢ —[ÇP@0lå»’£ÇVÙêP*2Où…Ž”¬Å¶Ý ê‰zïÚëÈÊ-|À¾Æ[‰-U” `”�ÅÃñqh¨â”‚ô²¯¼) ^Þ¦H´šqé,Ï�áð•9·�@•’7A ø"+zp—ë­³Êë4"0Û"2Êò>l¦eØß�A”¬—ÙÆ�ZVç잤` a£U«ÿV…Z*TÛ»ÁoKšÅ1{ú¸iírogÑ?˹Tñý‚Fï~#`4ÆV¡¨ù»~%ºÊíÿ¢…>%íîê@;›Ç¡Eõˆf& !Ùž¬sy¨P¼ä}¥òžd8È X[5%€ ± žd8È Xé  –Ñ‚"„aþ�8ðý×J°qBón ºsщó p ›Óp ¼<;fðgpgˆf& !Ùž¬sy¨P¼ä}¥òžd8È X^ÝhÖ ÓÊ2 žd8È XmJ §#Ñuµ/í.Hý­E‡f23\ŸCç¬�µÌÒ9èY6rñú,š=P°gpgbñ×f¾ë¢÷Šº’Sï Ïÿm4Ú†(ë½¾Þzw]ý±º»W.-) SNB «IîáÁ�–,Di]¹ö=< ÉS_ z…™ J”[8—~Ö†øunID©ÚA" ’9X[ò› (NçαÖÌ÷w¾¦É›Âü>:ÓG4/Ƈ 2æWñãæ-çCø¤@U¹:>”^ùu«,Y…�ìfR5 gÑãÌôòŽ½× 6ýÑF\©�O¦í`�ÆäíMTŠë8ºña~ ±Šüí“er½§Ù(ðÇ(w­J¸sMïp` Ïÿ$°˜öe�ÄÊõ‡µŸ{ÓÕrm L…�ÍG¾y3ŽÕä÷!,[³«Ú+?6> ÍŽ8ÛOCÈJùÊEåt �E«Ë¥ BH•¬µCFG|~¼‹/Dzäœ`V‚Yáç!¡U�Ж æRSZgËHóÛ],�?,†§#éÔ¥õ;¤m©õ-u#ߨV|†u@fø&{GœzE¯·Š¢ ÚÎKK2—8kÉÍsªaûF§]×èsî-»…‡š ¡2ø¢|eÊÉh‘ §JW}É�Üâì2‘ÁL›JµV‹oݳia×*1Ø�9Šé²·­¥«×_:ç­àÓUu$¨Æ@=·$3ê§U ð'ªH‚¢��îÊŠ›TN‹’o‡“š¹¥»àÕÊD¡ÖX vÐCÌè1Áô´ü�,9CØÉ¥î÷†“rÝ.‘’0²š–ÍÎ¥žso¡‘Mœ÷p`¥ø{@ý Ý*¯7 4Y«žýå°/gpg_ z…#http://[2a00:1b98:1:4::254:0]:11371´SGentoo Linux Release Engineering (Automated Weekly Release Key) ° gpg‰R < € x y!ë½¾Þzw]ý±º»W.-)\r©] »W.-)]@þ=Á.2§ûYÞ²ààò½_~9&þ1ÅJž5‡¼� ÍÕèV[;‚eó°_È�±Ë~—ù)HFq_y·È>^…k*-„ÙäôÄ"\é ‡><Ü`’q†°ÞöÃäé‘ûƒEõ†¬dHñÔ_?�•H:M»‰Úv«òZGçþÈñëíÁN¿ieO¨Nn�MðG“Á¬0üÔ[÷Ì ÉL‘ág:,/9A^àÁÙ \A8�\éGÆó8{œ$‘‹¶Ü%;¯¾r`•®2A¸ÜpæÁåa+Lõ1ó@|ÖØ^à¤�«´Ó×¹N¡uL/‘™8DLzC¥ÿ£î¶ë—þÜ Š=”D%#ÛÐk_G¸¤»HF‘`‡§qÌPÛ–ÿe#,*`õ-+W3-Ŧ“�×Fÿ´yEW�pù±=À"<éS?0üè8åq¥PCê{ý‰Äg®@´UêæåŠ¡v<ùTSaÛ)ÍÛWK^`�?Ÿ q–Ÿê—@}h:øBàfVæJï æÿwˆ®%÷Ä‹9n™z°(LæY ZðL°¶¯èBŽ)'óÄVDç\H Áž"%j7ïŽqO÷µ°tÄRæ(cË'ög.éë7%w±¨ƒÍ·]ϼ—“©ÚcÖ>gm½PøIæåª…Ƙ¦£“� ~>×ôŽ„_ý€t°gpg‰R < €!ë½¾Þzw]ý±º»W.-)^¢©É ;ç »W.-)ÚýžOÔ@]½º‹ÃÓ¾VâN½™‹lN¡Œ47œ…·TÂgÚbêI®¡+¨ô oñ×r+yØXõ {©RB¦à+ÚÕa�f¥ÎÌ®Œ3²mÈ5¦\XûS •æY?:¯!�’ã†?B›Ôª·>öŸ§‹­¤Q£X.^°ãùJ*ðg_俼”`ŒÙfT)ÑŸ.¤¶*ÖË�ëãß¾¸ÅÞE`O ‰uz_ÖÅ6rP¹�‡JÄ©”¢$è…Ká:ttO6ÿB³‡ðãgÛÂ�²ÌÉHÛ»ûWÐä):ûå¤zðüóX95]Åͨp™¨Û`Ë*Ùë^‚ß#M-«¬‹T*|Äîc Iö+æ¯Lîƒ6KÑ57Ñ]”{˜"Ô†0ÛÄ+Ÿ¢4eVì¦qvÏ¿þ÷…+Â�¶b8Ùa”´q“ovx=Â[¸>FH›¹PsL…(]¼ÅÀ}ŠÅ'•ž½AèéÊî¿ììP¯ÔyRBmá•Oå3QYp¾wôŒ†zÿ2 =o5#© ©ÒcÚ€=7Ç› Èžõ'$+7Õ¿‚_ü›�©Iˆbè»MèWcí ¯ &–�]«ÂÑŸ½¯”γÐx$Ë—V­� Œ-RÆf/Ì.]”–|‘ù¦E°B-µŒƒþлÂv€á–ÕêÒµ$—s¾‘]ï€wA&™E°gpg¹ \q5R«¯Ó„¬ºã‡Å7Ýß¡Ÿ÷sLxfØï£8ÿÅ?ÅB ’ïw‘fy€ºoâqä5õH ¸eÑ#p;5EI•9ÇŽ>j/Upé%z nAäV¾Äøàê´á8âˆÝ5 8Œq�ú- �$Løvtÿ^»¸Ñ"`è88{ ãÖ ó§|ŽbJ°2ÀS†m�öw,l³XPN ƒRË1¸Ïl„k6MÆÊ‚ÎÛa> ÎHþˆ Åæý ãõð`×îœa9O¨¹áû,žº9€$˜ÕÏ¥šì>8f4"¢(ypŽ88”-DGAήÌ_Áj¨¬Høz±ͳ ÉRAû‰Ò &!ë½¾Þzw]ý±º»W.-)\q5R ›FX  »W.-)ÀÔ  }!SNB «IîáÁ�–,Di]¹ö=\q5R_€.(issuer-fpr@notations.openpgp.fifthhorseman.net534E4209AB49EEE1C19D96162C44695DB9F6043D ,Di]¹ö=.?ÿ~§G²Ým|{Òé:Ÿ Hëpø±Í¸yk™=†™šdˆæŸQ´TbÊÍIcš¸?\¼!oæÁr%cNMHšõ¨'Ø•-®œ$*³xÅk¤"¡º¿¢YÌß,?™ÜÐ G&þÝs ,üU”³#’*Ç”YACßÅ—ˆöÚì¸ÄíçHfÓ|Ë.´�cÝ#;˜å_‚ÜÏtþèa-eÿÓšÒ§ú�¹¯ú’ˆ«€ýÍ “Q  /­ÍÉÎÜÙ ícW¸Ôñlf ·ÿ0ãçÏaÓG‡´¬­]šRã)ù%|ðè�Œ?‰ˆ•pÑ�¢Öñ¦Xî¤À[zRÒÄ>�ŽX*6‚Bx.ÿ|!oÿñOY‡ ()ãÕ…J›Ó!Gý„kü÷Cx­C�Ž&ò¬­²Öy)Q‚]c(W4gÚ„![Ž£CØÊѦaH«—Àf/ybÖþ¬Df 3¸¬¢|´Šìùɱ¸ß‰…ó·mM/tóÝo›b—¾>w8?�¯®ŒßR˜�hkY¯OBàĘ‹ y×A-„©Zð)}ðÙ+n¬ÁF\£¤Ñ™‰|Š·K;-º°.†—(r"¹ŒÿF¶bÁsmç1sÏe@[ÔÆ/Ÿ#¾Öïg#³Lɪ‰ÐŽ eclöò k!HM;“ðê¸ «€ïÀIð>Ë“šmWÄ'é´Ÿ�'�;Ðç²2|÷óÂ|B³WO6ÎO½Ñ¢I„b÷~X5lQ\ùêÐÐñ'þ_ñA!8ú?þDÅ…PUñÔŠ ŸIãP­ðfI�ôéÀÉ5·ôùô à^žÁ¶ оÉbs‰½íÑC©!†¤Ý+TùÃûžÚ=UE? ²ÿC¨t5IÉ$±ðgh›Nˆyÿ5à‡ÑI¤ê¥A‡ZspsOv§Bê~¿î©@úù·Œà ëìoU«£œÁÏ ,ìÅk¯åÑkÚCºÈ!Rècz�ßãêÜAs5Á?䩲§F•¿ô3*ßkÇ£-–²KiêÝ­1í 8úv=@©� ¸*°gpg‰Ò &!ë½¾Þzw]ý±º»W.-)^¢©Ô _ ï ÀÔ  }!SNB «IîáÁ�–,Di]¹ö=\q5R_€.(issuer-fpr@notations.openpgp.fifthhorseman.net534E4209AB49EEE1C19D96162C44695DB9F6043D ,Di]¹ö=.?ÿ~§G²Ým|{Òé:Ÿ Hëpø±Í¸yk™=†™šdˆæŸQ´TbÊÍIcš¸?\¼!oæÁr%cNMHšõ¨'Ø•-®œ$*³xÅk¤"¡º¿¢YÌß,?™ÜÐ G&þÝs ,üU”³#’*Ç”YACßÅ—ˆöÚì¸ÄíçHfÓ|Ë.´�cÝ#;˜å_‚ÜÏtþèa-eÿÓšÒ§ú�¹¯ú’ˆ«€ýÍ “Q  /­ÍÉÎÜÙ ícW¸Ôñlf ·ÿ0ãçÏaÓG‡´¬­]šRã)ù%|ðè�Œ?‰ˆ•pÑ�¢Öñ¦Xî¤À[zRÒÄ>�ŽX*6‚B »W.-)»„ÿdî°cå·-1JàŸôÌ≃,WþDÁi4½hè&½(¨”à²ð¢}oõíºZ!Qu�®­âzò1q¡ŒÇ®9"O_åÂbž}Žå™’x2;} :cn¯Îk Aó³;èÌü¶ÇJ¿dç¤õÕ?à�”©Ò‘Á/É>�¥Ó1ª×\d 5C[ÚÄ bãmäMÄ'CËT>å�‘ £žX’ÿ«ˆþ ›®ý ÜgYÓÃ>²>ƒÆ” Õ½Ì`)(ÕMF+Ýdÿ஄®ÀÛ ¢ü÷åÌÖ&*…¬Äzc| ‚‰tåìwNÚ¹œðM;¥qnÀqÉÂë²ÌÁüj¾•¬Ôy#Ó'ocO’ÜKÞP3TIíÕL#Q8Û¸q“³…^i ,‚ØŒ› •Ç묆—åR4ŒÓüa5³j@†³‘+œ·ü«b¢C5žëŽä:ÃN¶VW¶¯-?XÆ<@8Š{*’ÝÒ°¿GYìzí‘VšöÒií$žqu&¼ßÍ;à~‘ƒ¿G:‚ÙÊ[t¹B†áBõÇø‹.l£sX�,lûJg×U"‹vQš\Œ1zÒƒz/B™FÕ%:mÒíí}~WÒJ-Ö�üÚÎêåÛ 4ú³ŠP#i %4)ÿàXUˆq> q°bíT70ÄÉ€ñÕÓgòG;°gpgp~1‹s{ &å§ù-s”È…µÚ¯šï•8ÉèæC¥,Þß¡=ñ‘Nzr ÷Hé³Ä~9<ÂL�¯|*ÀœÙ�.ß< ÝO _ z…™ [ þ�Ça)fžüy¨°V�r�Eú9ë‹#÷€2 ǯ�¯´ù\iãš—Æ·¤¢¡éˆ´Ú{îÂ-¼C“åBÕÍtdMìD銸's‹€¦×|¤×p®jçÔQäöÜ”°v!+Fpî¤rØOímúOŽ„#2¡»·íÌ[æ�ПCê6Α…´¦p3TYœSß1BÚ0Ëó¼.–‰ÔêÎII(ï-s~·=1ý’+›÷{E {�EÅéM÷=�xÝ�¥@7| iÏ”@o;”ü}¤‰ðÖá;OŒº¢+Ó}G%ó|dŸ%Žå,Ê ä[  âV€Ïì[·“yÏS•Õn°¶0ÎP]U­U´J¸8{Ê!‡ÅŹp´*°“S£œ},§ÓEfd½–>žóU=0Ì3ÈdéòI½H �аJ©Áñ몱ErVw£±Q4]1&TÕù]J"A°¯åWï:° gpg‰T >   €!ï•8ÉèæC¥,Þß¡=ñ‘Nzr\q5/ }$ ¡=ñ‘NzrÒ þ YzE¯ c€QÆSßÚÏÁ@? `&{SÞǸ€«D±4±¡€€øyê✟tú«# _z~,¾r·‹œëTy–ªàüYÏ¿ô>W $LQ©Ñý"¶PÆüp÷—•rð|:U–á³'rê‡øЈ|O}» “Nns)ô— ýïõjÅ-¾Ûzü^¢ä rMDÎÀe¬}ðõOÇ�XcõÚÚä[HWQ?iœ¨Kû`iØCk8 àÄÐD¹Õ" ú,K¦ðR“q^Ø 00ÉG8á7~¾·M’»†S{È(/k†¥¢rf$nwNÎvÃàêwZb‚É-]�/—Qmö•ÐìN·ÄŒ™Ön—x4ñÞÊÙ‡ï(I�‹ÃG<-å n'ˆ´*´¬µç:4�JiZ!ýÄJ«åDÈ6§2Æß±ÓÒ^~±À©â:+k$=Ù` ¯8žc1ÕÄ«š�„ý?ˆa¹Ëˆ;”÷WÝÀ?OÄteAhZ§uêe‚®˜â­p†¶áe"ôެo èëïÔ,ß¼ëQ47Ý%RŽUt’Ÿ€™¤Ueh{”Ý4î†ýG0ëŠòZÎ÷÷¡ÊoHué×&pVºµ|ÿ¼¯Á�•S¸½éõˆ°gpg‰T>!ï•8ÉèæC¥,Þß¡=ñ‘Nzr[ þ� Âg   € ¡=ñ‘Nzr.èÿt_ÝÕîå" @¾ÝŠkuÁ]Ÿ„1ãUç¸át‹Y%ÅÄ õßmý �séë„:6p³vqÓªh�3Õ ‘‰þ?ÛhøÊÍ@ƒBU#]§1/5¸®¥‹ÿ@ù¡>6¢{"$scR ¤>ñÑ@µ‰N¢éí#@çËåH0É#ÄJÌK/FЛ>×Þ,¯/ѵÊ2s„¿²Éþí°ªÓÎÊÞòõØ—ë|Ð¾å ½$tÿŒ¸g.–Ë7= qF0`ÂAm>ùhA¶‡ŽÌÝ«óé—Æ62˜*™Q¯=Sd~ãòmj^Æ 2êÊþái^eª?GF‰¥nÄ]–9KБÁÂ^n��)„ª@ê'Лp�,�’ó†;þK-f5A¼ˆ¬-žF™ùí^ 3$»"•<+Æ�—Âq±†Û»‰!ºÊÑèЂ �6JeJ ¡Š 2à2¼’å³>²Dóö¡uÐu™hÿ>¡7œ4÷â.ÄÂl ìƒ8볇匿Á¼S}xhÛí)iW;3êòéðè´Ä ÿÔÖð§³ kå+M]žé¬·¸Fm¢z žcECI¥.‡ÁÕºÆk.8æ?ê‰$O߯ªêÊqaŸ™»²3%:ýǃF}úáU–c ù‡ÝqÇ"6�­ö¾˜Žú6—þÒB…›ÆkýgóËb[Ó`K°gpg‰3!l P§½˜÷žŽq«xZë•ñ“)À[AO xZë•ñ“)Àó|ý´g½­¤ (5s�èüþìfËQ‹ãs]Ås:´Ãå,­½M;³€³¸‘!ÃÎþɆß`ÈnHý’2í9ã;ínY$IÕ.Ÿ8ð¦{’‹il]Í­~–Íe‡¬Ñð¶Ù"³Ïœú­ )ÍgÒ%¶c :XвQ µ5�ªó¼ÁÕÿ½HàWªÙ,¡ÈR‹u(ÆÞJXÐ_Í‘BÖiƒ‡§Ñ’Ø®Õ4T‚föâ§‚¼…àµÃçwøâuçb?øyAPv‘K‹éYîÀüáreûóxë$»Ea¤\‰ˆÜ8Á» CϰÆgQð3м@4@ÉÿZQAe|j.?¿–‰:ÞÕ¹�HÉ÷×+ºpÜCÏ ÅséÚëþ`&(X.¹EÔÏdi*þ˜–®agÌ5QÆŽK?Ôu© ¬ô'�­I w™%­nò‡ì›zt· ¹Õ^õÀS€[ÿ�8l _ÄØŒðr–Æ([›züÞ[̱UYØZY`~«¯M¿‚êÁŒ¤DƒF¾ î>ìq¢~”õ ñ™˜9Z_%ËMJî;IBÃØ“¬_Š™³ï¾ï»å–Rj7áäÎmÄRá4ö°gpg‰T >   €!ï•8ÉèæC¥,Þß¡=ñ‘Nzr[ Ë â9¾ ¡=ñ‘NzrÅ™ü E4ÏŸÒ_êjô€{5”²SúëöÜL¶’”ÏHÒµ­�<*˜jÛþå-VS±pïÛ;óG`äÝÏÚQˆÛ¡buœ˜.[¾@öW´ð\*ÀAˆk�kÝ’˜}º8M4 ¥XOâׂ�•™<¾ù×Ô˳™ÈÏø¬¹–(Òƒ ÌÍr¼+͸v’”Kë ÊsmSjª„Ь¬Š…¨’y£ýETùV\<~”…>Ë•EE©îAµü8à´Ó–�Hâ=«D+íÇ)ð)-HàGù�}¦ 졘Šs�£µ€ÈHØÙöcû{‹W¹Ÿ’,¶µ¿~õ z¬HT!ÂI%�×ä&6$@FB©è:?šAšð>xç·H >áÄu4î$ Ýs ½+UÛ2ø½7È«ëòçI=Ky§ø¡Œ¬¸‘v0£lÚY2Ú‘M»ÅPŠ/'Ó½B“{ëN¶ðw%- Š'cØ�þtžïO—2º•ü��x+@¸êVû…ì@÷œ 7~×öÉ•ùј³/z?fåÊó-õ¦/˧W˜¹~Ñ.}fù¾w¤^p^žx\ñ¦ o^N�aI ]’XröNª;‚=¦�hÁs^=;w\¹¬UpWƒׂvUjJ¿¿Âl~?¤Ùo—–adbHþÙKhƒZ!¡Q…¦žËò;ƒ�¯ôL™L“ÉÅ 2€?°gpg‰T >   €!ï•8ÉèæC¥,Þß¡=ñ‘Nzr[ú\¥ }$ ¡=ñ‘NzrœPÿI6+Oýñu°vÑA˜[bè{›Î‚F$+¥$=U— |»IN„ òçn”u°7tŸmîXLHÀ´Ww¸ŽÈ>Ÿ(ÉT[ÆõÔÁ’ºÏJp‹_t„áààøº‘²øÎÃm½™õ{@DÙMÝ ;¢MБtä"° Ãår!_ä±P§âN±ÜY�-9¤¬ƒzžÚé¡aއNì#Œ_Ô}b'ŸTÍÀn!A�6�-ÙZµœ¿Å;~þ¼jHš<™‚)ç­C©üwƾèÂÅ[[k`!í64þìÏ›'C@H& K<½©3¦¼CîO�-vžÑi’ð¤ÄÍ©Xí�� -ÖÀœ¤˜oF,ªfÕ¨\wÔì³c@m¿<nýœ�üC¤C¼òF˜³�emJr•à#×­»_wÅjÔX/!Ë0•ÃêŒ^ »ŸÕõ? þq;£¾½ö6)iÞ—ç)Ô1•�B¢NzŒØIáë-§ÌD–’ï}œŸk#ÙÂD lS¯ËõÄäx¢"ÙÃK.ñª5½ð&h…-Ÿt*ÈkiN”ÒÚéÓîž™ÒU[¿ñÁ,ÇØ’ó” ±)?D(«™œaÎNš?1z0îWrš½|›y€rßq8dˆh? ÷–.ä_y2¶(EUõ¨ö×è0T«ÝŒ3èOí'Å©²Â(Ø °gpg‰T >   €!ï•8ÉèæC¥,Þß¡=ñ‘Nzr^¢©é ÄC´ ¡=ñ‘Nzrëþ!¾Taùx@£³ÉMYiÛC²Õµ¹<ŽGL¯ å ž¤*Oë²pÿ6ùs¶ŠÑÛPºÑÜ÷ íur÷(ñù^m›þÖU˜0u¡+S’œUöJ+苹&^P(§n�•̶í‰BÞØkÇ”J`SQ7tÏÅÚdžõ[ »™L�/_Ô?f¦Üð=Ú·† ã{˜*\~‰8H·‘¿ ú5£ {¥®^eØŽNQ[Ï%<1µ¿o§ùT—.ó,^@ \ºmx˜%Ú }�÷·0OüÜ<²Jc›�/(Öád¶¶d­3Î[БÙë´‰¬��ÂIM™-ÚÊ[ðÌyKHqüIe€&Eh�lè·6iÇìN­lÙyÝgN šƒGaeöÜF¨�yª¢�cg9(áÖ^¯sý¶K¶bw²Û@´$å“YÓ6w¨j, 8·Ój徉'ɲU~Ó/ïV<)e«Ã%Dt×L$F*jäŸM÷t±"âáí!ïw9N`ŠŒ9ój” �¿œ‚ú?ó^3–ð¦n~ ¢x¾±J€_gÚD·Ò®×Æž¼E ñ®;‘‚<¸ÿÛ »ïé)3Ô/‚êy Sñ³wMf+xfE`È>¦š�Å!Øï„ûwIvœ`ÜÈTqaÜÛû÷tÌ´¡ÏÜ?6Ί7™• ưgpg¹ [ ÿ±'ݨÆI#d¾ Åríï„®#)˹—kšYyiã5!aÝÖ*ÅÕrÛCÝZ¹Pa˜N8ýòóØÁm­€èkÖþt#€K\-oÉfŸ5C&ËáR3å±±¿GG¾0äl8±m=FÂ>!Ó ãG¦°]€ýOPØíº)Ñ'x…Oð"¤V<úUèËP U üÓ‰r &!ï•8ÉèæC¥,Þß¡=ñ‘Nzr\q4ú |ª@Àt !÷Hé³Ä~9<ÂL�¯|*ÀœÙ�.ß[ ÿ |*ÀœÙ�.ßóÅÿC2L,l�ˆ"xŒ&ª·Xù–z©ÿ@O‹[™b:å“WB «ögµ¾¼Z–¶gÉOX~°0×Ón<·‡dô»»Ð€ü˲†ôªw=AƒÉ|bø¶ ësë¢÷×wBŒÞs3jéšFޏ…#Ûü»Ì.gtÌ5 —@Ò�$¤X…Lâ=:ŠÜôæÂº+M Ð|Ô'6÷@‡„½ÌïL�ÁïˆR̪§ÕØÔy#ôU�4ûR鈀ó.ÂÏN¼•쿲.©,. õ$v¼1áÖ"õcȸn Û«C–­ôc.dÒ;©÷0 ’â5�#ÒpÃíy¤€ž9¶l]uR�Ã*O‘ðÒ’{ú/ˆ\·¯ù^B�;Á%ß=‹¦µf±#{f¸VêëÅÄ^`ÔŒ“ô:Æþ�œ>‹žž'Ã@~:õçÒM­+)¨k4¶ß‘«#™²Mm.äd å:UTy$®´<0óˆÞñ\� Žy饟ˆL"jêqu^AžbL¨¾Í^ÿîÅ»€ï>ûZ¢~Xåz3ŸJ¤JY™,ÚO õ“¶ Âãb©á³ žC ã½p<`ðµg9\¶š·µ šJ„Fbž‚v*J:sjG‡)hžêùWŒÄÄ|å@iGa"gˆióI#^ËeW‡"yý’+Ç%‡�âE£‹•Ä64õ'!ÑOŒ:ëÅ�ˆ#°gpg‰r &!ï•8ÉèæC¥,Þß¡=ñ‘Nzr^¢©ñ ÄC;@Àt !÷Hé³Ä~9<ÂL�¯|*ÀœÙ�.ß[ ÿ |*ÀœÙ�.ßóÅÿC2L,l�ˆ"xŒ&ª·Xù–z©ÿ@O‹[™b:å“WB «ögµƒ¦. g8óÿÚ?½YQ;¦ƒ�@W[­®º÷ 8Ady>1!(*~ö+À®sÿ'0®2Ðn;°= ôI@(�J2}‚¨¾ PYG7Wa'ûÂ>�ã¯K\°ò(ÿYà*‹Æ(„œtèmà`É*b�ŽKVF‘> ‚VËÀ3sd,t=õãB"tq|ðí>‹Ê ØÀt›ÝUå(ãìzí¤ íÉÞ§>íV­N¢ï6ƘX¼TÕhmp(Ýý‹3Ï]ÉpÛxÊëf¬ÕýClëð��!)í/Z½> T6é¼\+ã5ð™¾ã’E6%„\x?ÑHÌŠì¹0Ž€‡)Tž==[tn»› ÀÚ¿ó׈c“$,÷Ý…WÕäàÊeû×dfq Âj+G~ˆ  J–1ÚQñ‘Ý2OѦ °ôM¬±yW:­¢ÑfÛ3Å­YŬ€’¥ Z‚ùàè9V)E)¬ˆ4Gø•�÷€ËPP|ŠZ©b¦R?Yíù=çðz‚9âEn¢JÌ¢Wû%¦ÀV4íz[ãØß_Øi¾‡o^AApëퟣěæP#í¹9Ø–Ù}),�skÁÚâ0¡)eŒà…¢ØôOU¾OX8ó‰]yÆ"h;ßôƒ„+-Í­‰Y"ÞÀÞ÷Ü�éYª+bxñp<±é—zž+°gpg4³ÝPfýµ%¤�háìd=\]ì././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/package-installs.yaml0000664000175000017500000000010115201026231026725 0ustar00zuulzuulapp-admin/sudo: sys-fs/dosfstools: sys-kernel/gentoo-kernel-bin: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3592372 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/post-install.d/0000775000175000017500000000000015201026275025512 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/post-install.d/99-cleanup0000775000175000017500000000257015201026231027322 0ustar00zuulzuul#!/bin/bash if [[ ${DIB_DEBUG_TRACE:-0} -gt 0 ]]; then set -x fi set -eu set -o pipefail if mountpoint -q /dev/shm; then echo "/dev/shm found in /proc/self/mountinfo" elif [[ -k /dev/shm ]]; then echo "/dev/shm exists and is stickied" else fix_shm fi # sync if needed [[ ! -e ${PORTDIR}/profiles ]] && emerge-webrsync # make world consistent emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --update --changed-use --deep @world # rebuild packages that might need it emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --usepkg=n @preserved-rebuild # remove unneeded packages emerge --verbose=n --depclean # rebuild packages that might have somehow depended on the unneeded packages emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --usepkg=n @preserved-rebuild # update config files etc-update --automode -5 # clean up portage files emerge --verbose=n --depclean emaint all -f eselect news read all if [[ "${GENTOO_PORTAGE_CLEANUP}" != "False" ]]; then # remove the overlays if [[ ${GENTOO_OVERLAYS} != '' ]]; then for OVERLAY in ${GENTOO_OVERLAYS}; do layman -d "${OVERLAY}" done fi fi unfix_shm # remove within the chroot since /var/run is a symlink rm -Rf /var/run/* /run/* # after updating, set profile to where PORTDIR actually is (varies by profile) ln -sf ../.."$(env -u PORTDIR portageq get_repo_path / gentoo)/profiles/${GENTOO_PROFILE}" /etc/portage/make.profile ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3592372 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/pre-finalise.d/0000775000175000017500000000000015201026275025437 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/pre-finalise.d/01-gentoo-cache0000775000175000017500000000120715201026231030127 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail GENTOO_PORTAGE_DISTFILES_DIR="${DIB_IMAGE_CACHE}/gentoo/distfiles" GENTOO_PORTAGE_PACKAGE_DIR="${DIB_IMAGE_CACHE}/gentoo/packages/${GENTOO_PROFILE}" GENTOO_PORTAGE_DIR="${DIB_IMAGE_CACHE}/gentoo/portage" mkdir -p "${TMP_MOUNT_PATH}${PORTDIR}" sudo mount --bind "${GENTOO_PORTAGE_DIR}" "${TMP_MOUNT_PATH}${PORTDIR}" mkdir -p "${TMP_MOUNT_PATH}${DISTDIR}" sudo mount --bind "${GENTOO_PORTAGE_DISTFILES_DIR}" "${TMP_MOUNT_PATH}${DISTDIR}" mkdir -p "${TMP_MOUNT_PATH}${PKGDIR}" sudo mount --bind "${GENTOO_PORTAGE_PACKAGE_DIR}" "${TMP_MOUNT_PATH}${PKGDIR}" ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3602374 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/pre-install.d/0000775000175000017500000000000015201026275025313 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/pre-install.d/02-gentoo-00-set-profile0000775000175000017500000000073315201026231031412 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # set profile symlink to the hardcoded PORDIR ln -sf ../.."${PORTDIR}/profiles/${GENTOO_PROFILE}" /etc/portage/make.profile # Set timezone echo 'UTC' > /etc/timezone if [[ "${GENTOO_PROFILE}" != *"musl"* ]]; then # Set locale echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen echo 'en_US ISO-8859-1' >> /etc/locale.gen locale-gen -q eselect locale set en_US.utf8 fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/pre-install.d/02-gentoo-01-migrate-pax0000775000175000017500000000030615201026231031374 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # migrate pt_pax flags to xt_pax if [[ -a /usr/sbin/migrate-pax ]]; then /usr/sbin/migrate-pax -m fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/pre-install.d/02-gentoo-02-flags0000775000175000017500000000225415201026231030257 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # get the directories in order mkdir -p /etc/portage/profile mkdir -p /etc/portage/package.accept_keywords if [[ -f /etc/portage/package.keywords ]]; then mv /etc/portage/package.keywords /etc/portage/package.accept_keywords/prebuilt-1 fi mkdir -p /etc/portage/package.mask mkdir -p /etc/portage/package.unmask mkdir -p /etc/portage/package.use # needed in order to install pip packages as root echo 'dev-python/pip vanilla' >> /etc/portage/package.use/pip # needed to create disk images echo 'sys-fs/lvm2 lvm -thin' >> /etc/portage/package.use/grub echo 'sys-kernel/installkernel grub dracut' >> /etc/portage/package.use/kernel echo 'sys-boot/grub device-mapper' >> /etc/portage/package.use/grub echo 'sys-boot/grub grub_platforms_efi-64' >> /etc/portage/package.use/grub # always enable efi-64 if [[ 'amd64' == "${ARCH}" ]]; then echo 'sys-boot/grub grub_platforms_pc' >> /etc/portage/package.use/grub # bios support for bios systems fi # musl only valid for amd64 for now if [[ "${GENTOO_PROFILE}" == *"musl"* ]]; then echo "sys-libs/pam cracklib" >> /etc/portage/package.use/musl fi ././@PaxHeader0000000000000000000000000000020500000000000010212 xustar00111 path=diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/pre-install.d/02-gentoo-03-enable-overlays 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/pre-install.d/02-gentoo-03-enable-overlay0000775000175000017500000000140515201026231032066 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [[ ${GENTOO_OVERLAYS} != '' ]]; then if mountpoint -q /dev/shm; then echo "/dev/shm found in /proc/self/mountinfo" elif [[ -k /dev/shm ]]; then echo "/dev/shm exists and is stickied" else fix_shm fi if [[ ! -f ${PORTDIR}/profiles ]]; then emerge-webrsync -q fi emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --oneshot openssl openssh emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --oneshot eselect-repository # enable the various overlays, ignore failures (overlay my already be enabled) set +e for OVERLAY in ${GENTOO_OVERLAYS}; do eselect repository enable "${OVERLAY}" done set -e unfix_shm fi ././@PaxHeader0000000000000000000000000000021400000000000010212 xustar00118 path=diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/pre-install.d/02-gentoo-04-install-desired-python 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/pre-install.d/02-gentoo-04-install-desire0000775000175000017500000000260515201026231032104 0ustar00zuulzuul#!/bin/bash if [[ ${DIB_DEBUG_TRACE:-0} -gt 0 ]]; then set -x fi set -eu set -o pipefail if [[ ${GENTOO_PYTHON_TARGETS} != '' ]]; then if mountpoint -q /dev/shm; then echo "/dev/shm found in /proc/self/mountinfo" elif [[ -k /dev/shm ]]; then echo "/dev/shm exists and is stickied" else fix_shm fi [[ ! -f ${PORTDIR}/profiles ]] && emerge-webrsync -q # set active python targets echo "PYTHON_TARGETS=\"${GENTOO_PYTHON_TARGETS}\"" >> /etc/portage/make.conf # install portage first due to bug in env vars not being passed when portage installs itself and re-inits emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --update --newuse --deep sys-apps/portage # set the active python version emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --oneshot --update --newuse --nodeps dev-lang/python-exec dev-lang/python-exec-conf echo yes | etc-update --automode -3 /etc/python-exec/python-exec.conf # make world consistant emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --complete-graph=y --update --newuse --deep @world # rebuild packages that might need it emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --usepkg=n @preserved-rebuild # remove unneeded packages emerge --verbose=n --depclean # rebuild packages that might have somehow depended on the unneeded packages emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --usepkg=n @preserved-rebuild unfix_shm fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3602374 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/root.d/0000775000175000017500000000000015201026275024044 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/root.d/10-gentoo-image0000775000175000017500000000717615201026231026566 0ustar00zuulzuul#!/bin/bash # Copyright 2016 Matthew Thode # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail [ -n "${ARCH}" ] [ -n "${TARGET_ROOT}" ] P_SUFFIX="${GENTOO_PROFILE#$GENTOO_BASE_PROFILE}" F_SUFFIX="${P_SUFFIX//\//\-}" if [[ ${F_SUFFIX} != *"-systemd" ]]; then # NOTE(JayF): OpenRC is implied, and appended to the filename, unless systemd is specified. F_SUFFIX="${F_SUFFIX}-openrc" fi DIB_CLOUD_SOURCE=${DIB_CLOUD_SOURCE:-"https://distfiles.gentoo.org/releases/${ARCH}/autobuilds/latest-stage3-${ARCH}${F_SUFFIX}.txt"} echo "Fetching available stages from ${DIB_CLOUD_SOURCE} for profile ${GENTOO_PROFILE}" STAGE_LIST=$(curl "${DIB_CLOUD_SOURCE}" -s -f || true) if [[ -z ${STAGE_LIST} ]]; then echo "Unable to find a stage list for ${GENTOO_PROFILE} at ${DIB_CLOUD_SOURCE}." echo "This element only currently supports profiles included in the periodic" echo "Gentoo autobuilds." exit 1 fi UPSTREAM_FILENAME=$(echo "${STAGE_LIST}" | grep -B1 'BEGIN PGP SIGNATURE' | head -n1 | cut -d\ -f1) echo "Chose ${UPSTREAM_FILENAME} as candidate stage tarball" BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-"https://distfiles.gentoo.org/releases/${ARCH}/autobuilds/${UPSTREAM_FILENAME}"} BASE_IMAGE_FILE_SUFFIX=${BASE_IMAGE_FILE_SUFFIX:-"$(basename "${BASE_IMAGE_FILE}" | cut -d. -f 2,3)"} FILENAME_BASE="gentoo-${GENTOO_PROFILE//\//\-}.${BASE_IMAGE_FILE_SUFFIX}" SIGNATURE_FILE="${SIGNATURE_FILE:-${BASE_IMAGE_FILE}.asc}" CACHED_FILE="${DIB_IMAGE_CACHE}/${FILENAME_BASE}.${BASE_IMAGE_FILE_SUFFIX}" CACHED_SIGNATURE_FILE="${DIB_IMAGE_CACHE}/${FILENAME_BASE}.asc" if [[ -n "${DIB_OFFLINE}" ]] && [[ -f "${CACHED_FILE}" ]] ; then echo "Not checking freshness of cached ${CACHED_FILE}" else echo 'Fetching Base Image' "${TMP_HOOKS_PATH}"/bin/cache-url "${SIGNATURE_FILE}" "${CACHED_SIGNATURE_FILE}" "${TMP_HOOKS_PATH}"/bin/cache-url "${BASE_IMAGE_FILE}" "${CACHED_FILE}" pushd "${DIB_IMAGE_CACHE}" # import the key # this key can be verified at one of the following places # https://wiki.gentoo.org/wiki/Project:RelEng#Keys # https://dev.gentoo.org/~dolsen/releases/keyrings/gentoo-keys-*.tar.xz # https://distfiles.gentoo.org/distfiles/gentoo-keys-*.tar.xz # check the sig file if ! gpgv --keyring "${TMP_HOOKS_PATH}"/extra-data.d/gentoo-releng.gpg "${CACHED_SIGNATURE_FILE}" "${CACHED_FILE}"; then echo 'invalid signature file' exit 1 fi echo 'base image file verified' popd fi # Extract the base image (use --numeric-owner to avoid UID/GID mismatch between # image tarball and host OS) sudo tar -C "${TARGET_ROOT}" --numeric-owner --xattrs -xf "${CACHED_FILE}" # Put in a dummy /etc/resolv.conf over the temporary one we used # to bootstrap. systemd has a bug/feature [1] that it will assume # you want systemd-networkd as the network manager and create a # broken symlink to /run/... if the base image doesn't have one. # This broken link confuses things like dhclient. # [1] https://bugzilla.redhat.com/show_bug.cgi?id=1197204 echo -e "# This file intentionally left blank\n" | sudo tee "${TARGET_ROOT}"/etc/resolv.conf ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/root.d/50-gentoo-cache0000775000175000017500000000140315201026231026536 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail [ -n "${TARGET_ROOT}" ] GENTOO_PORTAGE_DISTFILES_DIR="${DIB_IMAGE_CACHE}/gentoo/distfiles" GENTOO_PORTAGE_PACKAGE_DIR="${DIB_IMAGE_CACHE}/gentoo/packages/${GENTOO_PROFILE}" GENTOO_PORTAGE_DIR="${DIB_IMAGE_CACHE}/gentoo/portage" mkdir -p "${GENTOO_PORTAGE_DIR}" "${GENTOO_PORTAGE_PACKAGE_DIR}" "${GENTOO_PORTAGE_DISTFILES_DIR}" mkdir -p "${TMP_MOUNT_PATH}${PORTDIR}" sudo mount --bind "${GENTOO_PORTAGE_DIR}" "${TMP_MOUNT_PATH}${PORTDIR}" mkdir -p "${TMP_MOUNT_PATH}${DISTDIR}" sudo mount --bind "${GENTOO_PORTAGE_DISTFILES_DIR}" "${TMP_MOUNT_PATH}${DISTDIR}" mkdir -p "${TMP_MOUNT_PATH}${PKGDIR}" sudo mount --bind "${GENTOO_PORTAGE_PACKAGE_DIR}" "${TMP_MOUNT_PATH}${PKGDIR}" ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.266235 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/test-elements/0000775000175000017500000000000015201026275025430 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3602374 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/test-elements/build-succeeds/0000775000175000017500000000000015201026275030323 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/test-elements/build-succeeds/README.rst0000664000175000017500000000006415201026231032002 0ustar00zuulzuulTest that we can successfully build a gentoo image. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/gentoo/test-elements/build-succeeds/element-deps0000664000175000017500000000000515201026231032613 0ustar00zuulzuulbase ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3612373 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/0000775000175000017500000000000015201026275023226 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/README.rst0000664000175000017500000000024615201026231024707 0ustar00zuulzuul======== growroot ======== Grow the root partition on first boot. This is only supported on: * ubuntu trusty or later * gentoo * fedora & centos * suse & opensuse ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/element-deps0000664000175000017500000000003715201026231025523 0ustar00zuulzuuldib-init-system install-static ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.266235 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/init-scripts/0000775000175000017500000000000015201026275025656 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3612373 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/init-scripts/openrc/0000775000175000017500000000000015201026275027144 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/init-scripts/openrc/growroot0000775000175000017500000000015215201026231030742 0ustar00zuulzuul#!/sbin/openrc-run start() { /usr/local/sbin/growroot eend 0 } depend() { need localmount } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3612373 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/init-scripts/systemd/0000775000175000017500000000000015201026275027346 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/init-scripts/systemd/growroot.service0000664000175000017500000000035315201026231032603 0ustar00zuulzuul[Unit] Description=Grow root partition Wants=systemd-udev-settle.service After=systemd-udev-settle.service [Service] Type=oneshot User=root ExecStart=/usr/local/sbin/growroot RemainAfterExit=true [Install] WantedBy=multi-user.target ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3612373 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/init-scripts/upstart/0000775000175000017500000000000015201026275027360 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/init-scripts/upstart/growroot.conf0000664000175000017500000000021015201026231032072 0ustar00zuulzuuldescription "Growing root partition" console output start on local-filesystems post-start script /usr/local/sbin/growroot end script ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/package-installs.yaml0000664000175000017500000000002415201026231027320 0ustar00zuulzuulgrowpart: e2fsprogs:././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/pkg-map0000664000175000017500000000072215201026231024476 0ustar00zuulzuul{ "family":{ "redhat": { "growpart": "cloud-utils-growpart", "e2fsprogs": "e2fsprogs" }, "debian":{ "growpart": "cloud-utils", "e2fsprogs": "e2fsprogs" }, "suse": { "growpart": "growpart", "e2fsprogs": "e2fsprogs" }, "gentoo": { "growpart": "sys-fs/growpart", "e2fsprogs": "sys-fs/e2fsprogs" } } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3612373 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/post-install.d/0000775000175000017500000000000015201026275026101 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/post-install.d/80-growroot0000775000175000017500000000066715201026231030137 0ustar00zuulzuul#!/bin/bash if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail case "$DIB_INIT_SYSTEM" in upstart) # nothing to do exit 0 ;; systemd) systemctl enable growroot.service ;; openrc) # let dib-init-system's postinstall handle enabling init scripts exit 0 ;; *) echo "Unsupported init system" exit 1 ;; esac ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2672353 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/static/0000775000175000017500000000000015201026275024515 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2672353 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/static/usr/0000775000175000017500000000000015201026275025326 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2672353 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/static/usr/local/0000775000175000017500000000000015201026275026420 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3612373 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/static/usr/local/sbin/0000775000175000017500000000000015201026275027353 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growroot/static/usr/local/sbin/growroot0000775000175000017500000000154515201026231031160 0ustar00zuulzuul#!/bin/bash # dib-lint: disable=dibdebugtrace set -exu set -o pipefail root_dev=$(df -P / | tail -n 1 | awk '/.*/ { print $1 }') if [ -z "${root_dev}" ]; then echo "*** Root device not found?" exit 1 fi udev_root=$(udevadm info --query=all --name $root_dev) part=$(grep ID_PART_ENTRY_DISK <<< "${udev_root}" | cut -d= -f2) if [ -z "${part}" ]; then echo "*** Root partition not found!" exit 1 fi part_no=$(grep ID_PART_ENTRY_NUMBER <<< "${udev_root}" | cut -d= -f2) if [ -z "${part_no}" ]; then echo "*** Root partition number not found!" exit 1 fi disk=$(find /sys/dev/block -name ${part}) disk="/dev/$(source ${disk}/uevent; echo $DEVNAME)" set +e growpart $disk $part_no # Error code 1 means no change if [ "$?" -le 1 ]; then # always return true because this might not work if were are non ext4 resize2fs $root_dev || true fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3622372 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/0000775000175000017500000000000015201026275023226 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/README.rst0000664000175000017500000000424115201026231024706 0ustar00zuulzuul======== growvols ======== Grow one or more LVM volumes on first boot. This installs utility `growvols` which grows the logical volumes in an LVM group to take available device space. The positional arguments specify how available space is allocated. They have the format = where: is the label or the mountpoint of the logical volume is an integer growth amount in the specified unit is one of the supported units Supported units are: % percentage of available device space before any changes are made MiB mebibyte (1048576 bytes) GiB gibibyte (1073741824 bytes) MB megabyte (1000000 bytes) GB gigabyte (1000000000 bytes) Each argument is processed in order and the requested amount is allocated to each volume until the disk is full. This means that if space is overallocated, the last volumes may only grow by the remaining space, or not grow at all, and a warning will be printed. When space is underallocated the remaining space will be given to the root volume (mounted at /). The currently supported partition layout is: - Exactly one of the partitions containing an LVM group - The disk having unpartitioned space to grow with - The LVM logical volumes being formatted with XFS filesystems Example usage: growvols /var=80% /home=20GB growvols --device sda --group vg img-rootfs=20% fs_home=20GiB fs_var=60% Environment variables can be set during image build to enable a systemd unit which will run growvols on boot: # DIB_GROWVOLS_TRIGGER defaults to 'manual'. When set to 'systemd' a systemd # unit will run using the following arguments export DIB_GROWVOLS_TRIGGER=systemd # DIB_GROWVOLS_ARGS contains the positional arguments for which volumes to grow # by what amount. If omitted the volume mounted at / will grow by all available # space export DIB_GROWVOLS_ARGS="img-rootfs=20% fs_home=20GiB fs_var=60%" # DIB_GROWVOLS_GROUP contains the name of the LVM group to extend. Defaults the # discovered group if only one exists. export DIB_GROWVOLS_GROUP=vg # DIB_GROWVOLS_DEVICE is the name of the disk block device to grow the # volumes in (such as "sda"). Defaults to the disk containing the root mount. export DIB_GROWVOLS_DEVICE=sda ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/__init__.py0000664000175000017500000000000015201026231025315 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/element-deps0000664000175000017500000000003715201026231025523 0ustar00zuulzuuldib-init-system install-static ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3622372 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/environment.d/0000775000175000017500000000000015201026275026014 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/environment.d/15-growvols0000664000175000017500000000142115201026231030032 0ustar00zuulzuul# Copyright 2021 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # export DIB_GROWVOLS_TRIGGER=${DIB_GROWVOLS_TRIGGER:-manual} export DIB_GROWVOLS_ARGS=${DIB_GROWVOLS_ARGS:-} export DIB_GROWVOLS_GROUP=${DIB_GROWVOLS_GROUP:-} export DIB_GROWVOLS_DEVICE=${DIB_GROWVOLS_DEVICE:-} ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2672353 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/init-scripts/0000775000175000017500000000000015201026275025656 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3622372 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/init-scripts/systemd/0000775000175000017500000000000015201026275027346 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/init-scripts/systemd/growvols.service0000664000175000017500000000043715201026231032606 0ustar00zuulzuul[Unit] Description=Grow LVM volumes Wants=systemd-udev-settle.service After=systemd-udev-settle.service [Service] Type=oneshot EnvironmentFile=-/etc/default/growvols User=root ExecStart=/usr/local/sbin/growvols --verbose --yes RemainAfterExit=true [Install] WantedBy=multi-user.target ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/package-installs.yaml0000664000175000017500000000005215201026231027321 0ustar00zuulzuulgdisk: util-linux: lvm2: parted: xfsprogs:././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3622372 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/post-install.d/0000775000175000017500000000000015201026275026101 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/post-install.d/80-growvols0000775000175000017500000000125415201026231030130 0ustar00zuulzuul#!/bin/bash if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail case ${DIB_GROWVOLS_TRIGGER} in manual) echo "growvols triggered manually after boot"; exit ;; systemd) echo "growvols triggered by systemd" ;; *) echo "Unsupported DIB_GROWVOLS_TRIGGER: ${DIB_GROWVOLS_TRIGGER}"; exit 1 ;; esac cat << EOF | sudo tee /etc/default/growvols > /dev/null GROWVOLS_ARGS="${DIB_GROWVOLS_ARGS}" GROWVOLS_GROUP="${DIB_GROWVOLS_GROUP}" GROWVOLS_DEVICE="${DIB_GROWVOLS_DEVICE}" EOF case "$DIB_INIT_SYSTEM" in systemd) systemctl enable growvols.service ;; *) echo "Unsupported init system" exit 1 ;; esac ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2682352 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/static/0000775000175000017500000000000015201026275024515 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2682352 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/static/usr/0000775000175000017500000000000015201026275025326 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2682352 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/static/usr/local/0000775000175000017500000000000015201026275026420 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3622372 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/static/usr/local/sbin/0000775000175000017500000000000015201026275027353 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/static/usr/local/sbin/growvols0000775000175000017500000005421115201026231031156 0ustar00zuulzuul#!/usr/bin/env python3 # Copyright 2021 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import argparse import collections import logging import os import re import shlex import subprocess import sys LOG = logging.getLogger(__name__) UNIT_BYTES = { 'MB': 1000000, 'MiB': 1048576, 'GB': 1000000000, 'GiB': 1073741824 } UNITS = ['%'] UNITS.extend(UNIT_BYTES.keys()) AMOUNT_UNIT_RE = re.compile('^([0-9]+)(%s)$' % '|'.join(UNITS)) UNIT_BYTES_FORMAT = { 'B': 1, 'KiB': 1024, 'MiB': 1048576, 'GiB': 1073741824 } # Regular expression to get digits at the end of a string DIGITS_EOF_STR_RE = re.compile(r'\d+$') # Only create growth partition if there is at least 1GiB available MIN_DISK_SPACE_BYTES = UNIT_BYTES['GiB'] # Default LVM physical extent size is 4MiB PHYSICAL_EXTENT_BYTES = 4 * UNIT_BYTES['MiB'] # Grow the thin pool metadata size to 1GiB POOL_METADATA_SIZE = UNIT_BYTES['GiB'] class Command(object): """ An object to represent a command to run with associated comment """ cmd = None comment = None def __init__(self, cmd, comment=None): self.cmd = cmd self.comment = comment def __repr__(self): if self.comment: return "\n# %s\n%s" % (self.comment, printable_cmd(self.cmd)) return printable_cmd(self.cmd) def parse_opts(argv): parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, description=''' Grow the logical volumes in an LVM group to take available device space. The positional arguments specify how available space is allocated. They have the format = where: is the label or the mountpoint of the logical volume is an integer growth amount in the specified unit is one of the supported units Supported units are: % percentage of available device space before any changes are made MiB mebibyte (1048576 bytes) GiB gibibyte (1073741824 bytes) MB megabyte (1000000 bytes) GB gigabyte (1000000000 bytes) Each argument is processed in order and the requested amount is allocated to each volume until the disk is full. This means that if space is overallocated, the last volumes may only grow by the remaining space, or not grow at all, and a warning will be printed. When space is underallocated the remaining space will be given to the root volume (mounted at /). The currently supported partition layout is: - Exactly one of the partitions containing an LVM group - The disk having unpartitioned space to grow with - The LVM logical volumes being formatted with XFS filesystems Example usage: growvols /var=80% /home=20GB growvols --device sda --group vg img-rootfs=20% fs_home=20% fs_var=60% ''') parser.add_argument('grow_vols', nargs="*", metavar="=", default=os.environ.get('GROWVOLS_ARGS', '').split(), help='A label or mountpoint, and the proportion to ' 'grow it by. Defaults to $GROWVOLS_ARGS. ' 'For example: /home=80%% img-rootfs=20%%') parser.add_argument('--group', metavar='GROUP', default=os.environ.get('GROWVOLS_GROUP'), help='The name of the LVM group to extend. Defaults ' 'to $GROWVOLS_GROUP or the discovered group ' 'if only one exists.') parser.add_argument('--device', metavar='DEVICE', default=os.environ.get('GROWVOLS_DEVICE'), help='The name of the disk block device to grow the ' 'volumes in (such as "sda"). Defaults to the ' 'disk containing the root mount.') parser.add_argument( '--exit-on-no-grow', action='store_true', help="Exit with error code 2 if no volume could be grown. ", default=False) parser.add_argument( '-d', '--debug', dest="debug", action='store_true', help="Print debugging output.", required=False) parser.add_argument( '-v', '--verbose', dest="verbose", action='store_true', help="Print verbose output.", required=False) parser.add_argument( '--noop', dest="noop", action='store_true', help="Return the configuration commands, without applying them.", required=False) parser.add_argument( '-y', '--yes', help='Skip yes/no prompt (assume yes).', default=False, action="store_true") opts = parser.parse_args(argv[1:]) return opts def configure_logger(verbose=False, debug=False): LOG_FORMAT = '[%(levelname)s] %(message)s' log_level = logging.WARN if debug: log_level = logging.DEBUG elif verbose: log_level = logging.INFO logging.basicConfig(format=LOG_FORMAT, level=log_level) def printable_cmd(cmd): """Convert a command list to a log printable string""" cmd_quoted = [shlex.quote(c) for c in cmd] return ' '.join(cmd_quoted) def convert_bytes(num): """Format a bytes amount with units GiB, MiB etc""" for x in ['GiB', 'MiB', 'KiB', 'B']: unit = UNIT_BYTES_FORMAT[x] unit_num = num // unit if unit_num > 0: break return "%d%s" % (unit_num, x) def shrink_bytes_for_alignment(num): """Shrink the amount of bytes to line up with LVM. The purpose of this method is to gently shrink the requested volume size of bytes to ensure that the size of the bytes range is in alignment with the LVM extent size, and that the bytes value used is modeled in the concept of extents where *two* extents have also been removed from the value to account for any possible structural alignment differences due to varying block sizes. In other words, reduce the size slightly to account for the differences. :param: num as in the number of bytes desired. :returns: The closest value accounting for extent sizing *minus* two LVM extents. """ result = ((num // PHYSICAL_EXTENT_BYTES) - 2) * PHYSICAL_EXTENT_BYTES if result <= 0: raise Exception( 'Not enough space available to shrink to alignment. ' 'Requires more than %s, requested: %s' % ( convert_bytes(PHYSICAL_EXTENT_BYTES * 2), convert_bytes(num))) return result def execute(cmd): """Run a command""" LOG.info('Running: %s', printable_cmd(cmd)) process = subprocess.Popen( cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True ) out, err = process.communicate() if process.returncode != 0: error_msg = ( 'Running command failed: cmd "{}", stdout "{}",' ' stderr "{}"'.format( ' '.join(cmd), out, err ) ) LOG.error(error_msg) raise Exception(error_msg) LOG.debug('Result: %s', out) return out def parse_shell_vars(output): """Parse tags from the lsblk/blkid output. Parses format KEY="VALUE" KEY2="VALUE2". :return: a generator yielding dicts with information from each line. """ for line in output.strip().split('\n'): if line.strip(): yield {key: value for key, value in (v.split('=', 1) for v in shlex.split(line))} def find_device(devices, keys, value): """Search devices list for one device that has a key matching the value""" if isinstance(keys, str): keys = [keys] for device in devices: for key in keys: if device.get(key) == value: return device def find_disk(opts, devices): """Find the disk device given a device option, or searching from mount /""" if opts.device: device = find_device(devices, ['KNAME', 'NAME'], opts.device) if not device: raise Exception('Could not find specified --device: %s' % opts.device) else: device = find_device(devices, 'MOUNTPOINT', '/') if not device: raise Exception('Could not find mountpoint for /') while True: device = find_device(devices, 'KNAME', device['PKNAME']) if not device: break if device['TYPE'] == 'disk': break if device['TYPE'] == 'mpath': break if not device['PKNAME']: break if not device: raise Exception('Could not detect disk device') if device['TYPE'] not in ('disk', 'mpath'): raise Exception('Expected a device with TYPE="disk" or TYPE="mpath", ' 'got: %s' % device['TYPE']) return device def grow_gpt(disk_name): device = '/dev/%s' % disk_name output = execute(['sgdisk', '-v', device]) search_str = "it doesn't reside\nat the end of the disk" if search_str in output: LOG.info('Fixing GPT structure, moving to end of device %s', device) execute(['sgdisk', '-e', device]) execute(['partprobe']) def find_space(disk_name): LOG.info('Finding spare space to grow into') dev_path = '/dev/%s' % disk_name largest = execute([ 'sgdisk', '--first-aligned-in-largest', '--end-of-largest', dev_path]) start_end = largest.strip().split('\n') sector_start = int(start_end[0]) sector_end = int(start_end[1]) size_sectors = sector_end - sector_start return sector_start, sector_end, size_sectors def find_devices(): LOG.info('Finding all block devices') lsblk = execute([ 'lsblk', '-Po', 'kname,pkname,name,label,type,fstype,mountpoint']) return list(parse_shell_vars(lsblk)) def find_group(opts): LOG.info('Finding LVM volume group') vgs = execute(['vgs', '--noheadings', '--options', 'vg_name']) vg_names = set([vg.strip() for vg in vgs.split('\n') if vg.strip()]) if opts.group: if opts.group not in vg_names: raise Exception('Could not find specified --group: %s' % opts.group) return opts.group if len(vg_names) > 1: raise Exception('More than one volume group, specify one to ' 'use with --group: %s' % ', '.join(sorted(vg_names))) if len(vg_names) < 1: raise Exception('No volume groups found') return vg_names.pop() def find_next_partnum(devices, disk): if disk['TYPE'] == 'disk': disk_name = disk['KNAME'] return len([d for d in devices if d['PKNAME'] == disk_name]) + 1 if disk['TYPE'] == 'mpath': max_partnum = 0 disk_name_length = len(disk['NAME']) seen_devs = set() for d in devices: if d['PKNAME'] != disk['KNAME']: continue dev_name = d['NAME'] if dev_name in seen_devs: continue seen_devs.add(dev_name) # Multipath device names may have a partition_delimiter between # the base device name and the partition number. By default, if # partition_delimiter is unset in the multipath configuration and # the base name ends in a digit, a 'p' is inserted. # A regular expression is used to reliably extract trailing # digits, regardless the presence of a partition delimiter or not. max_partnum = max(max_partnum, int(DIGITS_EOF_STR_RE.search( dev_name[disk_name_length:]).group(0))) return max_partnum + 1 def find_next_device_name(devices, disk, partnum): disk_name = disk['NAME'] existing_partnum = partnum - 1 # try partition scheme for SATA etc, then NVMe for part_template in '%s%d', '%sp%d': part = part_template % (disk_name, existing_partnum) LOG.debug('Looking for device %s' % part) if find_device(devices, 'NAME', part): return part_template % (disk_name, partnum) raise Exception('Could not find partition naming scheme for %s' % disk_name) def prompt_user_for_confirmation(message): """Prompt user for a y/N confirmation Use this function to prompt the user for a y/N confirmation with the provided message. The [y/N] should be included in the provided message to this function to indicate the expected input for confirmation. You can customize the positive response if y/N is not a desired input. :param message: Confirmation string prompt :param positive_response: Beginning character for a positive user input :return: boolean true for valid confirmation, false for all others """ try: if not sys.stdin.isatty(): LOG.error('User interaction required, cannot confirm.') return False else: sys.stdout.write(message) sys.stdout.flush() prompt_response = sys.stdin.readline().lower() if not prompt_response.startswith('y'): print('Taking no action.') return False LOG.info('User confirmed action.') return True except KeyboardInterrupt: # ctrl-c print('User did not confirm action (ctrl-c) so taking no action.') except EOFError: # ctrl-d print('User did not confirm action (ctrl-d) so taking no action.') return False def amount_unit_to_extent(amount_unit, total_size_bytes, remaining_bytes): m = AMOUNT_UNIT_RE.match(amount_unit) if not m: raise Exception('Value for not valid: %s' % amount_unit) amount = int(m.group(1)) unit = m.group(2) if unit in UNIT_BYTES: bytes = amount * UNIT_BYTES[unit] LOG.debug('%s is %s' % (amount_unit, convert_bytes(bytes))) else: bytes = int((amount / 100.0) * total_size_bytes) LOG.debug('%s of %s is %s' % (amount_unit, convert_bytes(total_size_bytes), convert_bytes(bytes))) if remaining_bytes <= 0: LOG.debug('No remaining space available to allocate %s' % amount_unit) bytes = 0 elif bytes > remaining_bytes: LOG.debug('Cannot allocate all of %s, only %s remaining space' % (convert_bytes(bytes), convert_bytes(remaining_bytes))) bytes = remaining_bytes # reduce to align on physical extent size bytes = bytes - bytes % PHYSICAL_EXTENT_BYTES return bytes, remaining_bytes - bytes def find_grow_vols(opts, devices, group, total_size_bytes): grow_vols = collections.OrderedDict() remaining_bytes = total_size_bytes arg_error = (' must be of the format ' '=, ' 'for example: /home=100% or fs_home=100%') grow_vols_opt = list(gv for gv in opts.grow_vols if gv) # append an implicit /=100% to grow root by any underallocation grow_vols_opt.append('/=100%') for gv in grow_vols_opt: if '=' not in gv: raise Exception(arg_error) devname, amount_unit = gv.split('=', 1) device = find_device(devices, ['LABEL', 'MOUNTPOINT'], devname) if not device: raise Exception('Could not find device %s for argument: %s' % (devname, gv)) if device['TYPE'] != 'lvm': raise Exception('Device %(NAME)s is not of type lvm: %(TYPE)s' % device) if device['FSTYPE'] != 'xfs': raise Exception('Device %(NAME)s is not of fstype xfs: %(FSTYPE)s' % device) size_bytes, remaining_bytes = amount_unit_to_extent( amount_unit, total_size_bytes, remaining_bytes) if size_bytes == 0: continue volume_path = '/dev/mapper/%s' % device['NAME'] grow_vols[volume_path] = size_bytes return grow_vols def find_sector_size(disk_name): sector_path = '/sys/block/%s/queue/logical_block_size' % disk_name LOG.info('Reading sector size from %s' % sector_path) with open(sector_path) as f: size = int(f.read().strip()) LOG.info('Sector size of %s is %s' % (disk_name, convert_bytes(size))) return size def find_thin_pool(devices, group): LOG.info('Finding LVM thin pool') lvs = execute(['lvs', '--noheadings', '--options', 'lv_name,lv_dm_path,lv_attr,pool_lv']) lvs_devices = [lvsd.strip().split() for lvsd in lvs.split('\n') if lvsd.strip()] thin_pool_device = None thin_pool_name = None # find any thin pool for d in lvs_devices: lv_name, lv_dm_path, lv_attr = d[:3] if lv_attr.startswith('t'): # this device is a thin pool thin_pool_device = lv_dm_path thin_pool_name = lv_name break if not thin_pool_device: return None, None # ensure every volume uses the pool for d in lvs_devices: lv_name, lv_dm_path, lv_attr = d[:3] if not lv_attr.startswith('V'): # Ignore device not a volume continue pool_lv = None if len(d) == 4: pool_lv = d[3] if pool_lv != thin_pool_name: raise Exception('All volumes need to be in pool %s. ' '%s is in pool %s' % (thin_pool_name, lv_name, pool_lv)) return thin_pool_device, thin_pool_name def main(argv): opts = parse_opts(argv) configure_logger(opts.verbose, opts.debug) devices = find_devices() disk = find_disk(opts, devices) disk_name = disk['KNAME'] grow_gpt(disk_name) sector_bytes = find_sector_size(disk_name) sector_start, sector_end, size_sectors = find_space(disk_name) min_required_sectors = MIN_DISK_SPACE_BYTES // sector_bytes size_bytes = size_sectors * sector_bytes if size_sectors < min_required_sectors: msg = ('Need at least %s sectors to expand into, there ' 'is only: %s' % (min_required_sectors, size_sectors)) if opts.exit_on_no_grow: LOG.error(msg) return 2 LOG.info(msg) return 0 group = find_group(opts) partnum = find_next_partnum(devices, disk) devname = find_next_device_name(devices, disk, partnum) thin_pool, thin_pool_name = find_thin_pool(devices, group) if thin_pool: # reserve for the size of the metadata volume, which # is *allocated* from the underlying storage as well. size_bytes -= POOL_METADATA_SIZE # reserve for the size of the spare metadata volume, # used for metadata check and repair size_bytes -= POOL_METADATA_SIZE # round down to a whole extent size_bytes -= size_bytes % PHYSICAL_EXTENT_BYTES # reduce for metadata overhead size_bytes -= PHYSICAL_EXTENT_BYTES if disk['TYPE'] == 'mpath': dev_path = '/dev/mapper/%s' % devname else: dev_path = '/dev/%s' % devname grow_vols = find_grow_vols(opts, devices, group, size_bytes) commands = [] commands.append(Command([ 'sgdisk', '--new=%d:%d:%d' % (partnum, sector_start, sector_end), '--change-name=%d:growvols' % partnum, '/dev/%s' % disk_name ], 'Create new partition %s' % devname)) if disk['TYPE'] == 'mpath': commands.append(Command( ['multipath', '-r'], 'Force a reload of all existing multipath maps')) commands.append(Command( ['partprobe'], 'Inform the OS of partition table changes')) commands.append(Command([ 'pvcreate', '-ff', '--yes', dev_path ], 'Initialize %s for use by LVM' % devname)) commands.append(Command([ 'vgextend', group, dev_path ], 'Add physical volume %s to group %s' % (devname, group))) if thin_pool: commands.append(Command([ 'lvextend', '--poolmetadatasize', '+%sB' % POOL_METADATA_SIZE, '%s/%s' % (group, thin_pool_name) ], 'Add %s to thin pool metadata %s' % ( convert_bytes(POOL_METADATA_SIZE), thin_pool))) commands.append(Command([ 'lvextend', '-L+%sB' % shrink_bytes_for_alignment(size_bytes), thin_pool, dev_path ], 'Add %s to thin pool %s' % (convert_bytes(size_bytes), thin_pool))) for volume_path, size_bytes in grow_vols.items(): if size_bytes > 0: extend_args = [ 'lvextend', '--size', '+%sB' % shrink_bytes_for_alignment(size_bytes), volume_path ] if not thin_pool: extend_args.append(dev_path) commands.append(Command( extend_args, 'Add %s to logical volume %s' % ( convert_bytes(size_bytes), volume_path))) for volume_path, size_bytes in grow_vols.items(): if size_bytes > 0: commands.append(Command([ 'xfs_growfs', volume_path ], 'Grow XFS filesystem for %s' % volume_path)) if opts.noop: print('The following commands would have run:') else: print('The following commands will be run:') for cmd in commands: print(cmd) sys.stdout.flush() if opts.noop: return 0 yes = opts.yes if not yes: yes = prompt_user_for_confirmation( '\nAre you sure you want to run these commands? [y/N] ') if yes: for cmd in commands: execute(cmd.cmd) return 0 if __name__ == '__main__': sys.exit(main(sys.argv)) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3622372 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/tests/0000775000175000017500000000000015201026275024370 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/tests/__init__.py0000664000175000017500000000000015201026231026457 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/growvols/tests/test_growvols.py0000664000175000017500000012165315201026231027663 0ustar00zuulzuul# Copyright 2014 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import copy import importlib import os import sys from unittest import mock from oslotest import base importlib.machinery.SOURCE_SUFFIXES.append('') file_path = (os.path.dirname(os.path.realpath(__file__)) + '/../static/usr/local/sbin/growvols') spec = importlib.util.spec_from_file_location('growvols', file_path) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) sys.modules['growvols'] = module growvols = module importlib.machinery.SOURCE_SUFFIXES.pop() # output of lsblk -Po kname,pkname,name,label,type,fstype,mountpoint LSBLK = """KNAME="sda" PKNAME="" NAME="sda" LABEL="" TYPE="disk" FSTYPE="" MOUNTPOINT="" KNAME="sda1" PKNAME="sda" NAME="sda1" LABEL="MKFS_ESP" TYPE="part" FSTYPE="vfat" MOUNTPOINT="/boot/efi" KNAME="sda2" PKNAME="sda" NAME="sda2" LABEL="" TYPE="part" FSTYPE="" MOUNTPOINT="" KNAME="sda3" PKNAME="sda" NAME="sda3" LABEL="" TYPE="part" FSTYPE="LVM2_member" MOUNTPOINT="" KNAME="sda4" PKNAME="sda" NAME="sda4" LABEL="config-2" TYPE="part" FSTYPE="iso9660" MOUNTPOINT="" KNAME="dm-0" PKNAME="sda3" NAME="vg-lv_root" LABEL="img-rootfs" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/" KNAME="dm-1" PKNAME="sda3" NAME="vg-lv_tmp" LABEL="fs_tmp" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/tmp" KNAME="dm-2" PKNAME="sda3" NAME="vg-lv_var" LABEL="fs_var" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var" KNAME="dm-3" PKNAME="sda3" NAME="vg-lv_home" LABEL="fs_home" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/home" """ # noqa # output of multipath lsblk LSBLK_MULTIPATH = """KNAME="sda" PKNAME="" NAME="sda" LABEL="" TYPE="disk" FSTYPE="mpath_member" MOUNTPOINT="" KNAME="dm-0" PKNAME="sda" NAME="mpatha" LABEL="" TYPE="mpath" FSTYPE="" MOUNTPOINT="" KNAME="dm-1" PKNAME="dm-0" NAME="mpatha1" LABEL="MKFS_ESP" TYPE="part" FSTYPE="vfat" MOUNTPOINT="/boot/efi" KNAME="dm-2" PKNAME="dm-0" NAME="mpatha2" LABEL="" TYPE="part" FSTYPE="" MOUNTPOINT="" KNAME="dm-3" PKNAME="dm-0" NAME="mpatha3" LABEL="mkfs_boot" TYPE="part" FSTYPE="ext4" MOUNTPOINT="/boot" KNAME="dm-4" PKNAME="dm-0" NAME="mpatha4" LABEL="" TYPE="part" FSTYPE="LVM2_member" MOUNTPOINT="" KNAME="dm-6" PKNAME="dm-4" NAME="vg-lv_thinpool_tmeta" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-8" PKNAME="dm-6" NAME="vg-lv_thinpool-tpool" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-9" PKNAME="dm-8" NAME="vg-lv_thinpool" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-10" PKNAME="dm-8" NAME="vg-lv_root" LABEL="img-rootfs" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/" KNAME="dm-11" PKNAME="dm-8" NAME="vg-lv_tmp" LABEL="fs_tmp" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/tmp" KNAME="dm-12" PKNAME="dm-8" NAME="vg-lv_var" LABEL="fs_var" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var" KNAME="dm-13" PKNAME="dm-8" NAME="vg-lv_log" LABEL="fs_log" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var/log" KNAME="dm-14" PKNAME="dm-8" NAME="vg-lv_audit" LABEL="fs_audit" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var/log/audit" KNAME="dm-15" PKNAME="dm-8" NAME="vg-lv_home" LABEL="fs_home" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/home" KNAME="dm-16" PKNAME="dm-8" NAME="vg-lv_srv" LABEL="fs_srv" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/srv" KNAME="dm-7" PKNAME="dm-4" NAME="vg-lv_thinpool_tdata" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-8" PKNAME="dm-7" NAME="vg-lv_thinpool-tpool" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-9" PKNAME="dm-8" NAME="vg-lv_thinpool" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-10" PKNAME="dm-8" NAME="vg-lv_root" LABEL="img-rootfs" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/" KNAME="dm-11" PKNAME="dm-8" NAME="vg-lv_tmp" LABEL="fs_tmp" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/tmp" KNAME="dm-12" PKNAME="dm-8" NAME="vg-lv_var" LABEL="fs_var" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var" KNAME="dm-13" PKNAME="dm-8" NAME="vg-lv_log" LABEL="fs_log" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var/log" KNAME="dm-14" PKNAME="dm-8" NAME="vg-lv_audit" LABEL="fs_audit" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var/log/audit" KNAME="dm-15" PKNAME="dm-8" NAME="vg-lv_home" LABEL="fs_home" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/home" KNAME="dm-16" PKNAME="dm-8" NAME="vg-lv_srv" LABEL="fs_srv" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/srv" KNAME="dm-5" PKNAME="dm-0" NAME="mpatha5" LABEL="config-2" TYPE="part" FSTYPE="iso9660" MOUNTPOINT="" KNAME="sdb" PKNAME="" NAME="sdb" LABEL="" TYPE="disk" FSTYPE="mpath_member" MOUNTPOINT="" KNAME="dm-0" PKNAME="sdb" NAME="mpatha" LABEL="" TYPE="mpath" FSTYPE="" MOUNTPOINT="" KNAME="dm-1" PKNAME="dm-0" NAME="mpatha1" LABEL="MKFS_ESP" TYPE="part" FSTYPE="vfat" MOUNTPOINT="/boot/efi" KNAME="dm-2" PKNAME="dm-0" NAME="mpatha2" LABEL="" TYPE="part" FSTYPE="" MOUNTPOINT="" KNAME="dm-3" PKNAME="dm-0" NAME="mpatha3" LABEL="mkfs_boot" TYPE="part" FSTYPE="ext4" MOUNTPOINT="/boot" KNAME="dm-4" PKNAME="dm-0" NAME="mpatha4" LABEL="" TYPE="part" FSTYPE="LVM2_member" MOUNTPOINT="" KNAME="dm-6" PKNAME="dm-4" NAME="vg-lv_thinpool_tmeta" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-8" PKNAME="dm-6" NAME="vg-lv_thinpool-tpool" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-9" PKNAME="dm-8" NAME="vg-lv_thinpool" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-10" PKNAME="dm-8" NAME="vg-lv_root" LABEL="img-rootfs" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/" KNAME="dm-11" PKNAME="dm-8" NAME="vg-lv_tmp" LABEL="fs_tmp" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/tmp" KNAME="dm-12" PKNAME="dm-8" NAME="vg-lv_var" LABEL="fs_var" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var" KNAME="dm-13" PKNAME="dm-8" NAME="vg-lv_log" LABEL="fs_log" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var/log" KNAME="dm-14" PKNAME="dm-8" NAME="vg-lv_audit" LABEL="fs_audit" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var/log/audit" KNAME="dm-15" PKNAME="dm-8" NAME="vg-lv_home" LABEL="fs_home" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/home" KNAME="dm-16" PKNAME="dm-8" NAME="vg-lv_srv" LABEL="fs_srv" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/srv" KNAME="dm-7" PKNAME="dm-4" NAME="vg-lv_thinpool_tdata" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-8" PKNAME="dm-7" NAME="vg-lv_thinpool-tpool" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-9" PKNAME="dm-8" NAME="vg-lv_thinpool" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-10" PKNAME="dm-8" NAME="vg-lv_root" LABEL="img-rootfs" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/" KNAME="dm-11" PKNAME="dm-8" NAME="vg-lv_tmp" LABEL="fs_tmp" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/tmp" KNAME="dm-12" PKNAME="dm-8" NAME="vg-lv_var" LABEL="fs_var" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var" KNAME="dm-13" PKNAME="dm-8" NAME="vg-lv_log" LABEL="fs_log" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var/log" KNAME="dm-14" PKNAME="dm-8" NAME="vg-lv_audit" LABEL="fs_audit" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var/log/audit" KNAME="dm-15" PKNAME="dm-8" NAME="vg-lv_home" LABEL="fs_home" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/home" KNAME="dm-16" PKNAME="dm-8" NAME="vg-lv_srv" LABEL="fs_srv" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/srv" KNAME="dm-5" PKNAME="dm-0" NAME="mpatha5" LABEL="config-2" TYPE="part" FSTYPE="iso9660" MOUNTPOINT="" KNAME="sdc" PKNAME="" NAME="sdc" LABEL="" TYPE="disk" FSTYPE="mpath_member" MOUNTPOINT="" KNAME="dm-0" PKNAME="sdc" NAME="mpatha" LABEL="" TYPE="mpath" FSTYPE="" MOUNTPOINT="" KNAME="dm-1" PKNAME="dm-0" NAME="mpatha1" LABEL="MKFS_ESP" TYPE="part" FSTYPE="vfat" MOUNTPOINT="/boot/efi" KNAME="dm-2" PKNAME="dm-0" NAME="mpatha2" LABEL="" TYPE="part" FSTYPE="" MOUNTPOINT="" KNAME="dm-3" PKNAME="dm-0" NAME="mpatha3" LABEL="mkfs_boot" TYPE="part" FSTYPE="ext4" MOUNTPOINT="/boot" KNAME="dm-4" PKNAME="dm-0" NAME="mpatha4" LABEL="" TYPE="part" FSTYPE="LVM2_member" MOUNTPOINT="" KNAME="dm-6" PKNAME="dm-4" NAME="vg-lv_thinpool_tmeta" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-8" PKNAME="dm-6" NAME="vg-lv_thinpool-tpool" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-9" PKNAME="dm-8" NAME="vg-lv_thinpool" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-10" PKNAME="dm-8" NAME="vg-lv_root" LABEL="img-rootfs" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/" KNAME="dm-11" PKNAME="dm-8" NAME="vg-lv_tmp" LABEL="fs_tmp" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/tmp" KNAME="dm-12" PKNAME="dm-8" NAME="vg-lv_var" LABEL="fs_var" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var" KNAME="dm-13" PKNAME="dm-8" NAME="vg-lv_log" LABEL="fs_log" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var/log" KNAME="dm-14" PKNAME="dm-8" NAME="vg-lv_audit" LABEL="fs_audit" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var/log/audit" KNAME="dm-15" PKNAME="dm-8" NAME="vg-lv_home" LABEL="fs_home" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/home" KNAME="dm-16" PKNAME="dm-8" NAME="vg-lv_srv" LABEL="fs_srv" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/srv" KNAME="dm-7" PKNAME="dm-4" NAME="vg-lv_thinpool_tdata" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-8" PKNAME="dm-7" NAME="vg-lv_thinpool-tpool" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-9" PKNAME="dm-8" NAME="vg-lv_thinpool" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-10" PKNAME="dm-8" NAME="vg-lv_root" LABEL="img-rootfs" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/" KNAME="dm-11" PKNAME="dm-8" NAME="vg-lv_tmp" LABEL="fs_tmp" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/tmp" KNAME="dm-12" PKNAME="dm-8" NAME="vg-lv_var" LABEL="fs_var" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var" KNAME="dm-13" PKNAME="dm-8" NAME="vg-lv_log" LABEL="fs_log" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var/log" KNAME="dm-14" PKNAME="dm-8" NAME="vg-lv_audit" LABEL="fs_audit" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var/log/audit" KNAME="dm-15" PKNAME="dm-8" NAME="vg-lv_home" LABEL="fs_home" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/home" KNAME="dm-16" PKNAME="dm-8" NAME="vg-lv_srv" LABEL="fs_srv" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/srv" KNAME="dm-5" PKNAME="dm-0" NAME="mpatha5" LABEL="config-2" TYPE="part" FSTYPE="iso9660" MOUNTPOINT="" KNAME="sdd" PKNAME="" NAME="sdd" LABEL="" TYPE="disk" FSTYPE="mpath_member" MOUNTPOINT="" KNAME="dm-0" PKNAME="sdd" NAME="mpatha" LABEL="" TYPE="mpath" FSTYPE="" MOUNTPOINT="" KNAME="dm-1" PKNAME="dm-0" NAME="mpatha1" LABEL="MKFS_ESP" TYPE="part" FSTYPE="vfat" MOUNTPOINT="/boot/efi" KNAME="dm-2" PKNAME="dm-0" NAME="mpatha2" LABEL="" TYPE="part" FSTYPE="" MOUNTPOINT="" KNAME="dm-3" PKNAME="dm-0" NAME="mpatha3" LABEL="mkfs_boot" TYPE="part" FSTYPE="ext4" MOUNTPOINT="/boot" KNAME="dm-4" PKNAME="dm-0" NAME="mpatha4" LABEL="" TYPE="part" FSTYPE="LVM2_member" MOUNTPOINT="" KNAME="dm-6" PKNAME="dm-4" NAME="vg-lv_thinpool_tmeta" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-8" PKNAME="dm-6" NAME="vg-lv_thinpool-tpool" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-9" PKNAME="dm-8" NAME="vg-lv_thinpool" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-10" PKNAME="dm-8" NAME="vg-lv_root" LABEL="img-rootfs" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/" KNAME="dm-11" PKNAME="dm-8" NAME="vg-lv_tmp" LABEL="fs_tmp" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/tmp" KNAME="dm-12" PKNAME="dm-8" NAME="vg-lv_var" LABEL="fs_var" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var" KNAME="dm-13" PKNAME="dm-8" NAME="vg-lv_log" LABEL="fs_log" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var/log" KNAME="dm-14" PKNAME="dm-8" NAME="vg-lv_audit" LABEL="fs_audit" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var/log/audit" KNAME="dm-15" PKNAME="dm-8" NAME="vg-lv_home" LABEL="fs_home" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/home" KNAME="dm-16" PKNAME="dm-8" NAME="vg-lv_srv" LABEL="fs_srv" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/srv" KNAME="dm-7" PKNAME="dm-4" NAME="vg-lv_thinpool_tdata" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-8" PKNAME="dm-7" NAME="vg-lv_thinpool-tpool" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-9" PKNAME="dm-8" NAME="vg-lv_thinpool" LABEL="" TYPE="lvm" FSTYPE="" MOUNTPOINT="" KNAME="dm-10" PKNAME="dm-8" NAME="vg-lv_root" LABEL="img-rootfs" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/" KNAME="dm-11" PKNAME="dm-8" NAME="vg-lv_tmp" LABEL="fs_tmp" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/tmp" KNAME="dm-12" PKNAME="dm-8" NAME="vg-lv_var" LABEL="fs_var" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var" KNAME="dm-13" PKNAME="dm-8" NAME="vg-lv_log" LABEL="fs_log" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var/log" KNAME="dm-14" PKNAME="dm-8" NAME="vg-lv_audit" LABEL="fs_audit" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/var/log/audit" KNAME="dm-15" PKNAME="dm-8" NAME="vg-lv_home" LABEL="fs_home" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/home" KNAME="dm-16" PKNAME="dm-8" NAME="vg-lv_srv" LABEL="fs_srv" TYPE="lvm" FSTYPE="xfs" MOUNTPOINT="/srv" KNAME="dm-5" PKNAME="dm-0" NAME="mpatha5" LABEL="config-2" TYPE="part" FSTYPE="iso9660" MOUNTPOINT="" """ # noqa DEVICES = [{ "FSTYPE": "", "KNAME": "sda", "LABEL": "", "MOUNTPOINT": "", "NAME": "sda", "PKNAME": "", "TYPE": "disk", }, { "FSTYPE": "vfat", "KNAME": "sda1", "LABEL": "MKFS_ESP", "MOUNTPOINT": "/boot/efi", "NAME": "sda1", "PKNAME": "sda", "TYPE": "part", }, { "FSTYPE": "", "KNAME": "sda2", "LABEL": "", "MOUNTPOINT": "", "NAME": "sda2", "PKNAME": "sda", "TYPE": "part", }, { "FSTYPE": "LVM2_member", "KNAME": "sda3", "LABEL": "", "MOUNTPOINT": "", "NAME": "sda3", "PKNAME": "sda", "TYPE": "part", }, { "FSTYPE": "iso9660", "KNAME": "sda4", "LABEL": "config-2", "MOUNTPOINT": "", "NAME": "sda4", "PKNAME": "sda", "TYPE": "part", }, { "FSTYPE": "xfs", "KNAME": "dm-0", "LABEL": "img-rootfs", "MOUNTPOINT": "/", "NAME": "vg-lv_root", "PKNAME": "sda3", "TYPE": "lvm", }, { "FSTYPE": "xfs", "KNAME": "dm-1", "LABEL": "fs_tmp", "MOUNTPOINT": "/tmp", "NAME": "vg-lv_tmp", "PKNAME": "sda3", "TYPE": "lvm", }, { "FSTYPE": "xfs", "KNAME": "dm-2", "LABEL": "fs_var", "MOUNTPOINT": "/var", "NAME": "vg-lv_var", "PKNAME": "sda3", "TYPE": "lvm", }, { "FSTYPE": "xfs", "KNAME": "dm-3", "LABEL": "fs_home", "MOUNTPOINT": "/home", "NAME": "vg-lv_home", "PKNAME": "sda3", "TYPE": "lvm", }] # output of sgdisk --first-aligned-in-largest --end-of-largest /dev/sda SECTOR_START = 79267840 SECTOR_END = 488265727 SGDISK_LARGEST = "%s\n%s\n" % (SECTOR_START, SECTOR_END) SGDISK_V = """ Problem: The secondary header's self-pointer indicates that it doesn't reside at the end of the disk. If you've added a disk to a RAID array, use the 'e' option on the experts' menu to adjust the secondary header's and partition table's locations. Identified 1 problems!""" # output of vgs --noheadings --options vg_name VGS = " vg\n" # output of lvs --noheadings --options lv_name,lv_dm_path,lv_attr,pool_lv LVS = ''' lv_audit /dev/mapper/vg-lv_audit Vwi-aotz-- lv_home /dev/mapper/vg-lv_home Vwi-aotz-- lv_log /dev/mapper/vg-lv_log Vwi-aotz-- lv_root /dev/mapper/vg-lv_root Vwi-aotz-- lv_srv /dev/mapper/vg-lv_srv Vwi-aotz-- lv_tmp /dev/mapper/vg-lv_tmp Vwi-aotz-- lv_var /dev/mapper/vg-lv_var Vwi-aotz-- ''' LVS_THIN = ''' lv_audit /dev/mapper/vg-lv_audit Vwi-aotz-- lv_thinpool lv_home /dev/mapper/vg-lv_home Vwi-aotz-- lv_thinpool lv_log /dev/mapper/vg-lv_log Vwi-aotz-- lv_thinpool lv_root /dev/mapper/vg-lv_root Vwi-aotz-- lv_thinpool lv_srv /dev/mapper/vg-lv_srv Vwi-aotz-- lv_thinpool lv_thinpool /dev/mapper/vg-lv_thinpool twi-aotz-- lv_tmp /dev/mapper/vg-lv_tmp Vwi-aotz-- lv_thinpool lv_var /dev/mapper/vg-lv_var Vwi-aotz-- lv_thinpool ''' class TestGrowvols(base.BaseTestCase): def test_printable_cmd(self): self.assertEqual( "foo --thing 'bar baz'", growvols.printable_cmd(['foo', '--thing', "bar baz"]) ) def test_convert_bytes(self): self.assertEqual('100B', growvols.convert_bytes(100)) self.assertEqual('1000B', growvols.convert_bytes(1000)) self.assertEqual('1MiB', growvols.convert_bytes(2000000)) self.assertEqual('2GiB', growvols.convert_bytes(3000000000)) self.assertEqual('3725GiB', growvols.convert_bytes(4000000000000)) def test_shrink_bytes_for_alignment(self): peb = growvols.PHYSICAL_EXTENT_BYTES half_peb = peb // 2 # shrink 3 extents to 1 self.assertEqual(peb, growvols.shrink_bytes_for_alignment(peb * 3)) # shrink 4.5 extents to 2 (round down to whole extent minus 2 extents) self.assertEqual(peb * 2, growvols.shrink_bytes_for_alignment( peb * 4 + half_peb)) # error shrinking zero e = self.assertRaises(Exception, growvols.shrink_bytes_for_alignment, 0) self.assertIn('Requires more than 8MiB, requested: 0B', str(e)) # error shrinking 1 extent e = self.assertRaises(Exception, growvols.shrink_bytes_for_alignment, peb) self.assertIn('Requires more than 8MiB, requested: 4MiB', str(e)) # error shrinking 2 extents e = self.assertRaises(Exception, growvols.shrink_bytes_for_alignment, peb * 2) self.assertIn('Requires more than 8MiB, requested: 8MiB', str(e)) @mock.patch('subprocess.Popen') def test_execute(self, mock_popen): mock_process = mock.Mock() mock_process.returncode = 0 mock_process.communicate.return_value = ('did the thing', '') mock_popen.return_value = mock_process result = growvols.execute(['do', 'the', 'thing']) self.assertEqual('did the thing', result) mock_process.returncode = 1 mock_process.communicate.return_value = ('', 'ouch') e = self.assertRaises(Exception, growvols.execute, ['do', 'the', 'thing']) self.assertIn('ouch', str(e)) def test_parse_shell_vars(self): devices = list(growvols.parse_shell_vars(LSBLK)) self.assertEqual(DEVICES, devices) def test_parse_shell_vars_multipath(self): devices = list(growvols.parse_shell_vars(LSBLK_MULTIPATH)) self.assertEqual(108, len(devices)) def test_find_device(self): sda = { "FSTYPE": "", "KNAME": "sda", "LABEL": "", "MOUNTPOINT": "", "NAME": "sda", "PKNAME": "", "TYPE": "disk", } fs_home = { "FSTYPE": "xfs", "KNAME": "dm-3", "LABEL": "fs_home", "MOUNTPOINT": "/home", "NAME": "vg-lv_home", "PKNAME": "sda3", "TYPE": "lvm", } self.assertEqual( sda, growvols.find_device(DEVICES, 'NAME', 'sda')) self.assertEqual( fs_home, growvols.find_device( DEVICES, ['KNAME', 'NAME'], 'vg-lv_home')) self.assertEqual( fs_home, growvols.find_device( DEVICES, ['KNAME', 'NAME'], 'dm-3')) self.assertIsNone( growvols.find_device( DEVICES, ['KNAME', 'NAME'], 'asdf')) def test_find_device_multipath(self): mpatha = { 'FSTYPE': '', 'KNAME': 'dm-0', 'LABEL': '', 'MOUNTPOINT': '', 'NAME': 'mpatha', 'PKNAME': 'sda', 'TYPE': 'mpath' } devices = list(growvols.parse_shell_vars(LSBLK_MULTIPATH)) self.assertEqual( mpatha, growvols.find_device( devices, ['KNAME', 'NAME'], 'mpatha')) def test_find_disk(self): devices = list(growvols.parse_shell_vars(LSBLK)) opts = mock.Mock() opts.device = None sda = growvols.find_device(devices, 'NAME', 'sda') # discover via MOUNTPOINT / self.assertEqual(sda, growvols.find_disk(opts, devices)) # fetch sda opts.device = 'sda' self.assertEqual(sda, growvols.find_disk(opts, devices)) # delete sda3, so can't find relationship # from MOUNTPOINT / to sda opts.device = None devices = [d for d in devices if d['NAME'] != 'sda3'] e = self.assertRaises(Exception, growvols.find_disk, opts, devices) self.assertEqual('Could not detect disk device', str(e)) # no sdb opts.device = 'sdb' e = self.assertRaises(Exception, growvols.find_disk, opts, devices) self.assertEqual('Could not find specified --device: sdb', str(e)) # sda is not TYPE disk sda['TYPE'] = 'dissed' opts.device = 'sda' e = self.assertRaises(Exception, growvols.find_disk, opts, devices) self.assertEqual('Expected a device with TYPE="disk" or TYPE="mpath"' ', got: dissed', str(e)) @mock.patch('growvols.execute') def test_find_space(self, mock_execute): mock_execute.return_value = SGDISK_LARGEST sector_start, sector_end, size_sectors = growvols.find_space( 'sda') self.assertEqual(SECTOR_START, sector_start) self.assertEqual(SECTOR_END, sector_end) self.assertEqual(SECTOR_END - SECTOR_START, size_sectors) mock_execute.assert_called_once_with([ 'sgdisk', '--first-aligned-in-largest', '--end-of-largest', '/dev/sda']) @mock.patch('growvols.execute') def test_find_devices(self, mock_execute): mock_execute.return_value = LSBLK self.assertEqual(DEVICES, growvols.find_devices()) mock_execute.assert_called_once_with([ 'lsblk', '-Po', 'kname,pkname,name,label,type,fstype,mountpoint']) @mock.patch('growvols.execute') def test_find_group(self, mock_execute): mock_execute.return_value = VGS opts = mock.Mock() opts.group = None self.assertEqual('vg', growvols.find_group(opts)) mock_execute.assert_called_once_with([ 'vgs', '--noheadings', '--options', 'vg_name']) # no volume groups mock_execute.return_value = "\n" e = self.assertRaises(Exception, growvols.find_group, opts) self.assertEqual('No volume groups found', str(e)) # multiple volume groups mock_execute.return_value = " vg\nvg2\nvg3" e = self.assertRaises(Exception, growvols.find_group, opts) self.assertEqual('More than one volume group, specify one to ' 'use with --group: vg, vg2, vg3', str(e)) # multiple volume groups with explicit group argument opts.group = 'vg' self.assertEqual('vg', growvols.find_group(opts)) # no such group opts.group = 'novg' e = self.assertRaises(Exception, growvols.find_group, opts) self.assertEqual('Could not find specified --group: novg', str(e)) def test_find_next_partnum(self): opts = mock.Mock() opts.device = None disk = growvols.find_disk(opts, DEVICES) self.assertEqual(5, growvols.find_next_partnum(DEVICES, disk)) disk = { "FSTYPE": "", "KNAME": "sdb", "LABEL": "", "MOUNTPOINT": "", "NAME": "sdb", "PKNAME": "", "TYPE": "disk", } self.assertEqual(1, growvols.find_next_partnum(DEVICES, disk)) def test_find_next_partnum_multipath(self): opts = mock.Mock() opts.device = 'mpatha' devices = list(growvols.parse_shell_vars(LSBLK_MULTIPATH)) disk = growvols.find_disk(opts, devices) self.assertEqual(6, growvols.find_next_partnum(devices, disk)) def test_find_next_partnum_multipath_partition_delimiter(self): opts = mock.Mock() opts.device = 'mpath2' local_lsblk = copy.deepcopy(LSBLK_MULTIPATH) local_lsblk = local_lsblk.replace('mpatha1', 'mpath2p1') local_lsblk = local_lsblk.replace('mpatha2', 'mpath2p2') local_lsblk = local_lsblk.replace('mpatha3', 'mpath2p3') local_lsblk = local_lsblk.replace('mpatha4', 'mpath2p4') local_lsblk = local_lsblk.replace('mpatha', 'mpath2') devices = list(growvols.parse_shell_vars(local_lsblk)) disk = growvols.find_disk(opts, devices) self.assertEqual(6, growvols.find_next_partnum(devices, disk)) def test_find_next_device_name(self): devices = list(growvols.parse_shell_vars(LSBLK)) disk = { "FSTYPE": "", "KNAME": "sda", "LABEL": "", "MOUNTPOINT": "", "NAME": "sda", "PKNAME": "", "TYPE": "disk", } # Use SATA etc device naming self.assertEqual( 'sda5', growvols.find_next_device_name(devices, disk, 5)) def test_find_next_device_name_no_partitions(self): devices = list(growvols.parse_shell_vars(LSBLK)) disk_no_partitions = { "FSTYPE": "", "KNAME": "sdb", "LABEL": "", "MOUNTPOINT": "", "NAME": "sdb", "PKNAME": "", "TYPE": "disk", } # No partitions e = self.assertRaises(Exception, growvols.find_next_device_name, devices, disk_no_partitions, 1) self.assertEqual( 'Could not find partition naming scheme for sdb', str(e)) def test_find_next_device_name_nvme(self): devices = list(growvols.parse_shell_vars(LSBLK)) disk = { "FSTYPE": "", "KNAME": "nvme0", "LABEL": "", "MOUNTPOINT": "", "NAME": "nvme0", "PKNAME": "", "TYPE": "disk", } # Use NVMe device naming for i in (1, 2, 3, 4): d = growvols.find_device(devices, 'KNAME', 'sda%s' % i) d['KNAME'] = 'nvme0p%s' % i d['NAME'] = 'nvme0p%s' % i self.assertEqual( 'nvme0p5', growvols.find_next_device_name(devices, disk, 5)) def test_find_next_device_name_multipath(self): opts = mock.Mock() opts.device = 'mpatha' devices = list(growvols.parse_shell_vars(LSBLK_MULTIPATH)) disk = growvols.find_disk(opts, devices) # Use dm device naming self.assertEqual( 'mpatha6', growvols.find_next_device_name(devices, disk, 6)) def test_amount_unit_to_extent(self): one_m = growvols.UNIT_BYTES['MiB'] four_m = one_m * 4 one_g = growvols.UNIT_BYTES['GiB'] ten_g = one_g * 10 forty_g = ten_g * 4 fidy_g = ten_g * 5 # invalid amounts self.assertRaises(Exception, growvols.amount_unit_to_extent, '100', one_g, one_g) self.assertRaises(Exception, growvols.amount_unit_to_extent, '100B', one_g, one_g) self.assertRaises(Exception, growvols.amount_unit_to_extent, '100%%', one_g, one_g) self.assertRaises(Exception, growvols.amount_unit_to_extent, '100TiB', one_g, one_g) self.assertRaises(Exception, growvols.amount_unit_to_extent, 'i100MB', one_g, one_g) # GiB amount self.assertEqual( (ten_g, forty_g), growvols.amount_unit_to_extent('10GiB', fidy_g, fidy_g) ) # percentage amount self.assertEqual( (ten_g, forty_g), growvols.amount_unit_to_extent('20%', fidy_g, fidy_g) ) # not enough space left self.assertEqual( (0, one_m), growvols.amount_unit_to_extent('20%', fidy_g, one_m) ) # exactly one extent self.assertEqual( (four_m, fidy_g - four_m), growvols.amount_unit_to_extent('4MiB', fidy_g, fidy_g) ) # under one extent is zero self.assertEqual( (0, fidy_g), growvols.amount_unit_to_extent('3MiB', fidy_g, fidy_g) ) # just over one extent is one extent self.assertEqual( (four_m, fidy_g - four_m), growvols.amount_unit_to_extent('5MiB', fidy_g, fidy_g) ) def test_find_grow_vols(self): one_g = growvols.UNIT_BYTES['GiB'] ten_g = one_g * 10 fidy_g = ten_g * 5 opts = mock.Mock() # buy default, assign all to / opts.grow_vols = [''] self.assertEqual( {'/dev/mapper/vg-lv_root': fidy_g}, growvols.find_grow_vols(opts, DEVICES, 'vg', fidy_g) ) # assign to /home, /var, remainder to / opts.grow_vols = ['/home=20%', 'fs_var=40%'] self.assertEqual( { '/dev/mapper/vg-lv_home': ten_g, '/dev/mapper/vg-lv_var': ten_g * 2, '/dev/mapper/vg-lv_root': ten_g * 2 }, growvols.find_grow_vols(opts, DEVICES, 'vg', fidy_g) ) # assign to /home, /var, /tmp by amount opts.grow_vols = ['/home=19GiB', 'fs_var=30GiB', '/tmp=1GiB'] self.assertEqual( { '/dev/mapper/vg-lv_home': one_g * 19, '/dev/mapper/vg-lv_var': one_g * 30, '/dev/mapper/vg-lv_tmp': one_g }, growvols.find_grow_vols(opts, DEVICES, 'vg', fidy_g) ) @mock.patch('builtins.open', autospec=True) def test_find_sector_size(self, mock_open): mock_open.return_value.__enter__ = lambda s: s mock_open.return_value.__exit__ = mock.Mock() read_mock = mock_open.return_value.read read_mock.side_effect = ['512'] # disk sdx exists self.assertEqual(512, growvols.find_sector_size('sdx')) # disk sdx doesn't exist mock_open.side_effect = FileNotFoundError self.assertRaises(FileNotFoundError, growvols.find_sector_size, 'sdx') @mock.patch('growvols.execute') def test_find_thin_pool(self, mock_execute): self._find_thin_pool(mock_execute, DEVICES) @mock.patch('growvols.execute') def test_find_thin_pool_multipath(self, mock_execute): devices = list(growvols.parse_shell_vars(LSBLK_MULTIPATH)) self._find_thin_pool(mock_execute, devices) def _find_thin_pool(self, mock_execute, devices): # No thin pool mock_execute.return_value = LVS self.assertEqual((None, None), growvols.find_thin_pool(devices, 'vg')) mock_execute.assert_called_once_with([ 'lvs', '--noheadings', '--options', 'lv_name,lv_dm_path,lv_attr,pool_lv']) # One thin pool, all volumes use it mock_execute.return_value = LVS_THIN self.assertEqual(('/dev/mapper/vg-lv_thinpool', 'lv_thinpool'), growvols.find_thin_pool(devices, 'vg')) # One pool, not used by all volumes mock_execute.return_value = ''' lv_thinpool /dev/mapper/vg-lv_thinpool twi-aotz-- lv_home /dev/mapper/vg-lv_home Vwi-aotz-- lv_root /dev/mapper/vg-lv_root Vwi-aotz-- lv_thinpool''' e = self.assertRaises(Exception, growvols.find_thin_pool, devices, 'vg') self.assertEqual('All volumes need to be in pool lv_thinpool. ' 'lv_home is in pool None', str(e)) # Two pools, volumes use both mock_execute.return_value = ''' lv_thin1 /dev/mapper/vg-lv_thin1 twi-aotz-- lv_thin2 /dev/mapper/vg-lv_thin2 twi-aotz-- lv_home /dev/mapper/vg-lv_home Vwi-aotz-- lv_thin2 lv_root /dev/mapper/vg-lv_root Vwi-aotz-- lv_thin1''' e = self.assertRaises(Exception, growvols.find_thin_pool, devices, 'vg') self.assertEqual('All volumes need to be in pool lv_thin1. ' 'lv_home is in pool lv_thin2', str(e)) @mock.patch('growvols.find_sector_size') @mock.patch('growvols.execute') def test_main(self, mock_execute, mock_sector_size): mock_sector_size.return_value = 512 # noop, only discover block device info mock_execute.side_effect = [ LSBLK, SGDISK_V, '', '', SGDISK_LARGEST, VGS, LVS, ] growvols.main(['growvols', '--noop']) mock_execute.assert_has_calls([ mock.call(['lsblk', '-Po', 'kname,pkname,name,label,type,fstype,mountpoint']), mock.call(['sgdisk', '-v', '/dev/sda']), mock.call(['sgdisk', '-e', '/dev/sda']), mock.call(['partprobe']), mock.call(['sgdisk', '--first-aligned-in-largest', '--end-of-largest', '/dev/sda']), mock.call(['vgs', '--noheadings', '--options', 'vg_name']), mock.call(['lvs', '--noheadings', '--options', 'lv_name,lv_dm_path,lv_attr,pool_lv']) ]) # no arguments, assign all to / mock_execute.reset_mock() mock_execute.side_effect = [ LSBLK, '', SGDISK_LARGEST, VGS, LVS, '', '', '', '', '', '' ] growvols.main(['growvols', '--yes']) mock_execute.assert_has_calls([ mock.call(['lsblk', '-Po', 'kname,pkname,name,label,type,fstype,mountpoint']), mock.call(['sgdisk', '-v', '/dev/sda']), mock.call(['sgdisk', '--first-aligned-in-largest', '--end-of-largest', '/dev/sda']), mock.call(['vgs', '--noheadings', '--options', 'vg_name']), mock.call(['lvs', '--noheadings', '--options', 'lv_name,lv_dm_path,lv_attr,pool_lv']), mock.call(['sgdisk', '--new=5:79267840:488265727', '--change-name=5:growvols', '/dev/sda']), mock.call(['partprobe']), mock.call(['pvcreate', '-ff', '--yes', '/dev/sda5']), mock.call(['vgextend', 'vg', '/dev/sda5']), mock.call(['lvextend', '--size', '+209396432896B', '/dev/mapper/vg-lv_root', '/dev/sda5']), mock.call(['xfs_growfs', '/dev/mapper/vg-lv_root']) ]) # assign to /home, /var, remainder to / mock_execute.reset_mock() mock_execute.side_effect = [ LSBLK, '', SGDISK_LARGEST, VGS, LVS, '', '', '', '', '', '', '', '', '', '' ] growvols.main(['growvols', '--yes', '--group', 'vg', '/home=20%', 'fs_var=40%']) mock_execute.assert_has_calls([ mock.call(['lsblk', '-Po', 'kname,pkname,name,label,type,fstype,mountpoint']), mock.call(['sgdisk', '-v', '/dev/sda']), mock.call(['sgdisk', '--first-aligned-in-largest', '--end-of-largest', '/dev/sda']), mock.call(['vgs', '--noheadings', '--options', 'vg_name']), mock.call(['lvs', '--noheadings', '--options', 'lv_name,lv_dm_path,lv_attr,pool_lv']), mock.call(['sgdisk', '--new=5:79267840:488265727', '--change-name=5:growvols', '/dev/sda']), mock.call(['partprobe']), mock.call(['pvcreate', '-ff', '--yes', '/dev/sda5']), mock.call(['vgextend', 'vg', '/dev/sda5']), mock.call(['lvextend', '--size', '+41871736832B', '/dev/mapper/vg-lv_home', '/dev/sda5']), mock.call(['lvextend', '--size', '+83751862272B', '/dev/mapper/vg-lv_var', '/dev/sda5']), mock.call(['lvextend', '--size', '+83756056576B', '/dev/mapper/vg-lv_root', '/dev/sda5']), mock.call(['xfs_growfs', '/dev/mapper/vg-lv_home']), mock.call(['xfs_growfs', '/dev/mapper/vg-lv_var']), mock.call(['xfs_growfs', '/dev/mapper/vg-lv_root']), ]) # no space to grow, failed sector_start = 79267840 sector_end = sector_start + 1024 sgdisk_largest = "%s\n%s\n" % (sector_start, sector_end) mock_execute.side_effect = [ LSBLK, '', sgdisk_largest, VGS, LVS, ] self.assertEqual( 2, growvols.main(['growvols', '--exit-on-no-grow']) ) # no space to grow, success mock_execute.side_effect = [ LSBLK, '', sgdisk_largest, VGS, LVS, ] self.assertEqual( 0, growvols.main(['growvols']) ) @mock.patch('growvols.find_sector_size') @mock.patch('growvols.execute') def test_main_thin_provision(self, mock_execute, mock_sector_size): mock_sector_size.return_value = 512 # assign to /home, /var, remainder to / mock_execute.reset_mock() mock_execute.side_effect = [ LSBLK, '', SGDISK_LARGEST, VGS, LVS_THIN, '', '', '', '', '', '', '', '', '', '', '', '' ] growvols.main(['growvols', '--yes', '--group', 'vg', '/home=20%', 'fs_var=40%']) mock_execute.assert_has_calls([ mock.call(['lsblk', '-Po', 'kname,pkname,name,label,type,fstype,mountpoint']), mock.call(['sgdisk', '-v', '/dev/sda']), mock.call(['sgdisk', '--first-aligned-in-largest', '--end-of-largest', '/dev/sda']), mock.call(['vgs', '--noheadings', '--options', 'vg_name']), mock.call(['lvs', '--noheadings', '--options', 'lv_name,lv_dm_path,lv_attr,pool_lv']), mock.call(['sgdisk', '--new=5:79267840:488265727', '--change-name=5:growvols', '/dev/sda']), mock.call(['partprobe']), mock.call(['pvcreate', '-ff', '--yes', '/dev/sda5']), mock.call(['vgextend', 'vg', '/dev/sda5']), mock.call(['lvextend', '--poolmetadatasize', '+1073741824B', 'vg/lv_thinpool']), mock.call(['lvextend', '-L+207244754944B', '/dev/mapper/vg-lv_thinpool', '/dev/sda5']), mock.call(['lvextend', '--size', '+41439723520B', '/dev/mapper/vg-lv_home']), mock.call(['lvextend', '--size', '+82892029952B', '/dev/mapper/vg-lv_var']), mock.call(['lvextend', '--size', '+82896224256B', '/dev/mapper/vg-lv_root']), mock.call(['xfs_growfs', '/dev/mapper/vg-lv_home']), mock.call(['xfs_growfs', '/dev/mapper/vg-lv_var']), mock.call(['xfs_growfs', '/dev/mapper/vg-lv_root']), ]) @mock.patch('growvols.find_sector_size') @mock.patch('growvols.execute') def test_main_thin_provision_multipath(self, mock_execute, mock_sector_size): mock_sector_size.return_value = 512 # assign to /home, /var, remainder to / mock_execute.reset_mock() mock_execute.side_effect = [ LSBLK_MULTIPATH, '', SGDISK_LARGEST, VGS, LVS_THIN, '', '', '', '', '', '', '', '', '', '', '', '', '' ] growvols.main(['growvols', '--yes', '--device', 'mpatha', '--group', 'vg', '/home=20%', 'fs_var=40%']) mock_execute.assert_has_calls([ mock.call(['lsblk', '-Po', 'kname,pkname,name,label,type,fstype,mountpoint']), mock.call(['sgdisk', '-v', '/dev/dm-0']), mock.call(['sgdisk', '--first-aligned-in-largest', '--end-of-largest', '/dev/dm-0']), mock.call(['vgs', '--noheadings', '--options', 'vg_name']), mock.call(['lvs', '--noheadings', '--options', 'lv_name,lv_dm_path,lv_attr,pool_lv']), mock.call(['sgdisk', '--new=6:79267840:488265727', '--change-name=6:growvols', '/dev/dm-0']), mock.call(['multipath', '-r']), mock.call(['partprobe']), mock.call(['pvcreate', '-ff', '--yes', '/dev/mapper/mpatha6']), mock.call(['vgextend', 'vg', '/dev/mapper/mpatha6']), mock.call(['lvextend', '--poolmetadatasize', '+1073741824B', 'vg/lv_thinpool']), mock.call(['lvextend', '-L+207244754944B', '/dev/mapper/vg-lv_thinpool', '/dev/mapper/mpatha6']), mock.call(['lvextend', '--size', '+41439723520B', '/dev/mapper/vg-lv_home']), mock.call(['lvextend', '--size', '+82892029952B', '/dev/mapper/vg-lv_var']), mock.call(['lvextend', '--size', '+82896224256B', '/dev/mapper/vg-lv_root']), mock.call(['xfs_growfs', '/dev/mapper/vg-lv_home']), mock.call(['xfs_growfs', '/dev/mapper/vg-lv_var']), mock.call(['xfs_growfs', '/dev/mapper/vg-lv_root']), ]) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3632374 diskimage_builder-3.42.0/diskimage_builder/elements/grub2/0000775000175000017500000000000015201026275022365 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/grub2/README.rst0000664000175000017500000000045015201026231024043 0ustar00zuulzuul===== grub2 ===== This image installs grub2 bootloader on the image, that's necessary for the local boot feature in Ironic to work. This is being made a separated element because usually images have grub2 removed for space reasons and also because they are going to boot from network (PXE boot). ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/grub2/package-installs.yaml0000664000175000017500000000023315201026231026461 0ustar00zuulzuulsigned_grub_efi: arch: amd64 signed_shim_efi: arch: amd64 grub_bios: arch: amd64 signed_grub_efi_arm64: arch: arm64 grub_bios_arm64: arch: arm64 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/grub2/pkg-map0000664000175000017500000000136415201026231023640 0ustar00zuulzuul{ "family":{ "debian":{ "signed_grub_efi": "grub-efi-amd64-signed", "signed_shim_efi": "shim-signed", "grub_bios": "grub-pc-bin", "signed_grub_efi_arm64": "grub-efi-arm64-signed", "grub_bios_arm64": "grub-efi-arm64" }, "redhat":{ "signed_grub_efi": "efibootmgr grub2-efi-x64-modules grub2-efi-x64", "signed_shim_efi": "shim", "grub_bios": "grub2", "grub_bios_arm64": "grub2-efi-aa64", "signed_grub_efi_arm64": "shim-aa64" }, "suse":{ "signed_grub_efi": "", "signed_shim_efi": "", "grub_bios": "grub2" } }, "default":{ "signed_grub_efi": "grub-efi-amd64-signed", "signed_shim_efi": "shim-signed", "grub_bios": "grub-pc-bin" } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3632374 diskimage_builder-3.42.0/diskimage_builder/elements/grub2/post-install.d/0000775000175000017500000000000015201026275025240 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/grub2/post-install.d/01-delete-grubenv0000775000175000017500000000033215201026231030302 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # Delete /boot/grub2/grubenv if it exists because # it will fail while doing grub-install again. rm -f /boot/grub2/grubenv ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3632374 diskimage_builder-3.42.0/diskimage_builder/elements/hpdsa/0000775000175000017500000000000015201026275022443 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/hpdsa/README.rst0000664000175000017500000000105115201026231024117 0ustar00zuulzuul===== hpdsa ===== This is the hpdsa element. This element enables the 'hpdsa' driver to be included in the ramdisk when invoked during ramdisk/image creation. This driver is required for deploying the HP Proliant Servers Gen9 with Dynamic Smart Array Controllers. Note: This element supports only Ubuntu image/ramdisk to be updated with the hpdsa driver. It installs hp certificate from https://downloads.linux.hp.com/SDR/hpPublicKey2048_key1.pub. Since HP has released this currently only for trusty, It has been restricted to work only for trusty. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/hpdsa/package-installs.yaml0000664000175000017500000000012115201026231026533 0ustar00zuulzuulbuild-essential: curl: phase: pre-install.d linux-headers-generic: hpdsa-dkms: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3642373 diskimage_builder-3.42.0/diskimage_builder/elements/hpdsa/post-install.d/0000775000175000017500000000000015201026275025316 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/hpdsa/post-install.d/95-hpdsa0000775000175000017500000000072415201026231026571 0ustar00zuulzuul#!/bin/bash if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail # Blacklist the ahci driver for hpdsa to recognize the disks. # It can also be done with element "modprobe-blacklist" which # would add the ahci driver to /etc/modprobe.d/blacklist.conf. # To be on safer side, blacklist the driver ahci without the # element "modprobe-blacklist" also. echo "blacklist ahci" >> /etc/modprobe.d/install-hpdsa.conf echo "hpdsa" >> /etc/modules ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/hpdsa/post-install.d/98-hpdsa-post-dkms0000775000175000017500000000030515201026231030506 0ustar00zuulzuul#!/bin/bash if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail # This is required for HPDSA driver to be included in the # ramdisk of the image. update-initramfs -u ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3642373 diskimage_builder-3.42.0/diskimage_builder/elements/hpdsa/pre-install.d/0000775000175000017500000000000015201026275025117 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/hpdsa/pre-install.d/06-hpdsa0000775000175000017500000000054615201026231026364 0ustar00zuulzuul#!/bin/bash if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail # Add hpdsa repository echo 'deb https://downloads.linux.hpe.com/SDR/repo/ubuntu-hpdsa' $DIB_RELEASE ' main' \ >> /etc/apt/sources.list.d/ubuntu-hpdsa.list # Add the key curl -f -s https://downloads.linux.hpe.com/SDR/hpPublicKey2048_key1.pub | apt-key add - ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3642373 diskimage_builder-3.42.0/diskimage_builder/elements/hpdsa/root.d/0000775000175000017500000000000015201026275023650 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/hpdsa/root.d/10-hpdsa-check-distro0000775000175000017500000000057515201026231027467 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [ 'ubuntu' != $DISTRO_NAME ] ; then echo "Only ubuntu is supported for hpdsa driver. The DISTRO is set to $DISTRO_NAME" exit 1 fi if [ 'trusty' != $DIB_RELEASE ] ; then echo "Only trusty is supported for hpdsa driver. The DIB_RELEASE is set to $DIB_RELEASE" exit 1 fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3642373 diskimage_builder-3.42.0/diskimage_builder/elements/hwburnin/0000775000175000017500000000000015201026275023200 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/hwburnin/README.rst0000664000175000017500000000015415201026231024657 0ustar00zuulzuul======== hwburnin ======== A hardware test ramdisk - exercises the machine RAM and exercises the hard disks ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3642373 diskimage_builder-3.42.0/diskimage_builder/elements/hwburnin/binary-deps.d/0000775000175000017500000000000015201026275025637 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/hwburnin/binary-deps.d/hwburnin0000664000175000017500000000001715201026231027404 0ustar00zuulzuulspew memtester ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3642373 diskimage_builder-3.42.0/diskimage_builder/elements/hwburnin/init.d/0000775000175000017500000000000015201026275024365 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/hwburnin/init.d/70-hwburnin0000664000175000017500000000015515201026231026361 0ustar00zuulzuulecho "Starting HW Burnin" memtester 1G 10 # XXX: Discover RAM size # XXX: Discover and test disks with spew ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3652375 diskimage_builder-3.42.0/diskimage_builder/elements/hwdiscovery/0000775000175000017500000000000015201026275023712 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/hwdiscovery/README.rst0000664000175000017500000000226515201026231025376 0ustar00zuulzuul=========== hwdiscovery =========== A ramdisk to report the hardware of a machine to an inventory service. This will collect up some basic information about the hardware it boots on: * CPU cores * RAM * Disk * NIC mac address This information will then be collated into a JSON document, base64 encoded and passed, via HTTP POST, to a URL that you must specify on the kernel commandline, thus: HW_DISCOVERY_URL=http://1.2.3.4:56/hw_script.asp This is currently fairly fragile as there can be a huge variability in the number of disks/NICs in servers and how they are configured. If other elements wish to inject data into the hardware discovery data, they can - they should be specified before hwdiscovery to the image building script, and they should contain something like this in their init fragment: _vendor_hwdiscovery_data="$_vendor_hwdiscovery_data \"some vendor key\" : \"some data you care about\", \"some other vendor key\" : \"some other data you care about\"," Note that you are essentially feeding JSON into the main hwdiscovery JSON. This will allow any number of vendor specific hwdiscovery elements to chain together their JSON fragments and maintain consistency. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3652375 diskimage_builder-3.42.0/diskimage_builder/elements/hwdiscovery/binary-deps.d/0000775000175000017500000000000015201026275026351 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/hwdiscovery/binary-deps.d/hwdiscovery0000664000175000017500000000004115201026231030625 0ustar00zuulzuullshw hwinfo dhclient wget base64 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/hwdiscovery/element-deps0000664000175000017500000000002115201026231026200 0ustar00zuulzuulpackage-installs ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3652375 diskimage_builder-3.42.0/diskimage_builder/elements/hwdiscovery/init.d/0000775000175000017500000000000015201026275025077 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/hwdiscovery/init.d/60-hwdiscovery0000664000175000017500000000732215201026231027607 0ustar00zuulzuulecho "Starting HW Discovery" function cpu_cores() { hwinfo --cpu | grep -c "Hardware Class: cpu" } function ram() { # XXX: /proc may not be the best place to get this from, but hwinfo reports weird values (e.g. "1GB + 512MB" on a test VM of mine) _KB=$(grep MemTotal /proc/meminfo | awk '{ print $2 }') echo "$((_KB * 1024)) bytes" } function pxe_mac() { local bootif_re='BOOTIF=([^ ]+)' _mac if [[ $(cat /proc/cmdline) =~ $bootif_re ]]; then # If we were booted using pxelinux and its config file has the # IPAPPEND 2 stanza under the entry we booted from, then pxelinux # will have appended a BOOTIF argument to the kernel parameters telling # us what MAC address we are booting with. From that, we can derive the # boot interface with no problems. _mac="${BASH_REMATCH[1]//-/:}" _mac="${_mac#*:}" elif [[ -d /sys/firmware/efi ]] && type efibootmgr &>/dev/null; then # Likewise, if we booted via the network while running in UEFI mode, and # efibootmgr is installed, we can determine the MAC address of the nic we # booted from. It would be good to have code that can also do this using # efivars or parsing the stuff under /sys/firmware/efi/efivars directly, # but that is a trickier thing to do. local -A boot_entries local bootent_re='^Boot([0-9]{4})' local efimac_re='MAC\(([0-9a-f]+)' local k v current_bootent while read line; do k="${line%% *}" v="${line#* }" if [[ $k = BootCurrent:* ]]; then current_bootent="${line##BootCurrent: }" elif [[ $k =~ $bootent_re ]]; then boot_entries["${BASH_REMATCH[1]}"]="$v" fi done < <(efibootmgr -v) if [[ ${boot_entries["$current_bootent"]} =~ $efimac_re ]]; then _mac='' for o in 0 2 4 6 8 10; do _mac+="${BASH_REMATCH[1]:$o:2}:" done _mac=${_mac%:} fi fi if [[ ! $_mac ]]; then # If none of the exact methods worked, fall back on the heuristic # method and just return the mac addresses of all the interfaces # that have a link. Hopefully whatever consumes this info is smarter # than we are. local _info1 _info2 _dev _info1=$(hwinfo --network|grep -B2 "Link detected: yes"|grep -C1 "HW Address:") _info2=$(echo "${_info1}"|awk '/Device File: (vlan*|br*)/{for(x=NR-2;x<=NR+2;x++)d[x];}{a[NR]=$0}END{for(i=1;i<=NR;i++)if(!(i in d))print a[i]}') _dev=$(echo "${_info1}" | grep "Device File:"|awk -F':' {'print $2'}|tr -d ' ') _mac=$(echo "${_info2}" | grep "HW Address:"|awk -F'ss:' {'print $2'}|tr -d ' ') fi echo $_mac export HW_DISCOVERY_BOOT_IFACE="$_mac" } function disk() { # XXX: This is returning only the first disk discovered, which is very likely to be insufficient on machines that present us with multiple disks # XXX: This is likely reporting in TB, but the units are not guaranteed. Maybe convert to bytes? lshw -C disk | grep size | awk -F'(' '{ print $2 }' | tr -d ')' | head -1 } function raw_disk() { hwinfo --disk } function raw_network() { hwinfo --network } HW_DISCOVERY_OUTPUT=$(cat <&2 exit 0 fi if [ ! -d "${DIB_ILO_FIRMWARE_PATH}" ]; then echo "Firmware path not found: ${DIB_ILO_FIRMWARE_PATH}" exit 1 fi # We copy to /tmp because its temporary - we do a mv later into the initramfs # image. mkdir -p "$TMP_MOUNT_PATH/tmp/ilo/" find "${DIB_ILO_FIRMWARE_PATH}" -type f \( -name '*.scexe' -o -name '*.exe' \) | while read FWNAME do TARGET="$TMP_MOUNT_PATH/tmp/ilo/$(basename "$FWNAME")" echo Unpacking $FWNAME to $TARGET bash "$FWNAME" "--unpack=$TARGET" echo Done done ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3662374 diskimage_builder-3.42.0/diskimage_builder/elements/ilo/init.d/0000775000175000017500000000000015201026275023314 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ilo/init.d/50-ilo-firmware0000664000175000017500000000133515201026231026050 0ustar00zuulzuulif [ -d /ilo ]; then find /ilo -type f \( -name flash_ilo3 -o -name flash_ilo4 \) | while read FWNAME do cd "$(dirname "$FWNAME")" logname="$(basename "$(dirname "$FWNAME")").log" echo Running $FWNAME "$FWNAME" --silent --log "$logname" result=$? echo Finished $FWNAME with result $? cat "$logname" #avoid leaking space during large runs rm "$logname" if [ $result -eq 2 ]; then echo "Firmware already up to date" elif [ $result -eq 4 ]; then echo "Firmware not applicable to machine" elif [ $result -ne 0 ]; then echo "Error applying firmware" troubleshoot fi done fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3662374 diskimage_builder-3.42.0/diskimage_builder/elements/ilo/ramdisk-install.d/0000775000175000017500000000000015201026275025447 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ilo/ramdisk-install.d/50-ilo-firmware0000775000175000017500000000024515201026231030205 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [ ! -d /tmp/ilo ]; then exit 0 fi mv /tmp/ilo "$TMP_MOUNT_PATH" ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3672373 diskimage_builder-3.42.0/diskimage_builder/elements/install-bin/0000775000175000017500000000000015201026275023560 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/install-bin/README.rst0000664000175000017500000000021715201026231025237 0ustar00zuulzuul=========== install-bin =========== Add any files in an element's bin directory to /usr/local/bin in the created image with permissions 0755. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3672373 diskimage_builder-3.42.0/diskimage_builder/elements/install-bin/pre-install.d/0000775000175000017500000000000015201026275026234 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/install-bin/pre-install.d/01-install-bin0000775000175000017500000000024315201026231030603 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail install -m 0755 -o root -g root $(dirname $0)/../bin/* /usr/local/bin ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3672373 diskimage_builder-3.42.0/diskimage_builder/elements/install-static/0000775000175000017500000000000015201026275024277 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/install-static/README.rst0000664000175000017500000000053615201026231025762 0ustar00zuulzuul============== install-static ============== Copy static files into the built image. The contents of any ``static/`` subdirs of elements will be installed into these images at build time using ``rsync -lCr``. So to install a file ``/etc/boo``, include ``static/etc/boo`` in your element. Note: This installs all files with owner and group of root. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/install-static/element-deps0000664000175000017500000000002115201026231026565 0ustar00zuulzuulpackage-installs ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3672373 diskimage_builder-3.42.0/diskimage_builder/elements/install-static/install.d/0000775000175000017500000000000015201026275026167 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/install-static/install.d/10-install-static-files0000775000175000017500000000064615201026231032364 0ustar00zuulzuul#!/bin/bash # Note that this relies on the detail that all elements share one dir inside # the chroot. This will copy all the files that elements have added to # element/static into the image. Mode, symlinks etc will be respected. if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail STATIC_SOURCE="$(dirname $0)/../static" [ -d "${STATIC_SOURCE}" ] || exit 0 rsync -lCr "${STATIC_SOURCE}"/ / ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/install-static/package-installs.yaml0000664000175000017500000000000715201026231030372 0ustar00zuulzuulrsync: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/install-static/pkg-map0000664000175000017500000000013515201026231025545 0ustar00zuulzuul{ "family":{ "gentoo": { "rsync": "net-misc/rsync" } } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3672373 diskimage_builder-3.42.0/diskimage_builder/elements/install-types/0000775000175000017500000000000015201026275024154 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/install-types/README.rst0000664000175000017500000000332315201026231025634 0ustar00zuulzuul============= install-types ============= Enable install-types support for elements. Install types permit elements to be installed from different sources, such as git repositories, distribution packages, or pip. The default install type is 'source' but it can be modified on the disk-image-create command line via the --install-type option. For example you can set: --install-type=package to enable package installs by default. Alternately, you can also set DIB\_DEFAULT\_INSTALLTYPE. Many elements expose different install types. The different implementations live under `--install` directories under an element's install.d. The base element enables the chosen install type by symlinking the correct hook scripts under install.d directly. `` can be a string of alphanumeric and '-' characters, but typically corresponds to the element name. For example, the nova element would provide: nova/install.d/nova-package-install/74-nova nova/install.d/nova-source-install/74-nova The following symlink would be created for the package install type: install.d/74-nova -> nova-package-install/74-nova Or, for the source install type: install.d/74-nova -> nova-source-install/74-nova All other scripts that exist under install.d for an element will be executed as normal. This allows common install code to live in a script under install.d. Environment Variables --------------------- DIB_INSTALLTYPE_ :Required: No :Default: source :Description: Set the install type for the dir prefix. '-' characters can be replaced with a '_'. :Example: ``DIB_INSTALLTYPE_simple_init=repo`` Sets the simple-init element install type to be repo. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3682375 diskimage_builder-3.42.0/diskimage_builder/elements/install-types/extra-data.d/0000775000175000017500000000000015201026275026430 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020600000000000010213 xustar00112 path=diskimage_builder-3.42.0/diskimage_builder/elements/install-types/extra-data.d/99-enable-install-types 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/install-types/extra-data.d/99-enable-install-typ0000775000175000017500000000452315201026231032315 0ustar00zuulzuul#!/bin/bash # Copyright 2014 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail declare -a SPECIFIED_ELEMS # Add a blank first element to the array, since we're running with -u, we don't # want an unbound variable error if no element install types were specified. SPECIFIED_ELEMS[0]="" # List of all env vars to set install types PREFIX="DIB_INSTALLTYPE_" INSTALL_TYPE_VARS=$(env | grep ^$PREFIX | cut -d'=' -f1 || echo "") for _install_type_var in $INSTALL_TYPE_VARS; do # Get the element name and its install type INSTALLDIRPREFIX=${_install_type_var:${#PREFIX}} INSTALLDIRPREFIX=${INSTALLDIRPREFIX//_/-} eval INSTALLTYPE=\$$_install_type_var # Create symlink for correct install type pushd $TMP_HOOKS_PATH/install.d if [ -d $INSTALLDIRPREFIX-$INSTALLTYPE-install ]; then ln -sf $INSTALLDIRPREFIX-$INSTALLTYPE-install/* . fi popd SPECIFIED_ELEMS+=($INSTALLDIRPREFIX) done # For any existing *--install directory under install.d, # if an environment variable setting a different install type was not seen, # enable the default (set via --install-type). default_install_type_dirs=$(find $TMP_HOOKS_PATH/install.d -maxdepth 1 -name "*-${DIB_DEFAULT_INSTALLTYPE}-install" -type d) for _install_dir in $default_install_type_dirs; do SUFFIX="-${DIB_DEFAULT_INSTALLTYPE}-install" _install_dir=$(basename $_install_dir) INSTALLDIRPREFIX=${_install_dir%$SUFFIX} found=0 for specified in ${SPECIFIED_ELEMS[@]}; do if [ "$specified" = "$INSTALLDIRPREFIX" ]; then found=1 break fi done # install type not specified, assume source if [ "$found" = "0" ]; then pushd $TMP_HOOKS_PATH/install.d ln -sf $_install_dir/* . popd fi done ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3682375 diskimage_builder-3.42.0/diskimage_builder/elements/iscsi-boot/0000775000175000017500000000000015201026275023417 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/iscsi-boot/README.rst0000664000175000017500000000134015201026231025074 0ustar00zuulzuul========== iscsi-boot ========== Handles configuration for the disk to be capable of serving as a remote root filesystem through iSCSI. Currently, this element can configure Ubuntu/Debian images and CentOS images. It performs the following actions: For Ubuntu/Debian images: * Installs the ``open-iscsi`` package. * Creates the ``etc/iscsi/iscsi.initramfs`` configuration file and sets ``ISCSI_AUTO=true`` within it. * Updates the initramfs to apply the changes. For CentOS images: * Required ``dracut-regenerate`` element when performs ``disk-image-create``. * Updates ``network`` and ``iscsi`` into ``dracut-regenerate`` during pre-installs. * Updates ``GRUB_CMDLINE_LINUX_DEFAULT`` into ``/etc/default/grub``. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/iscsi-boot/element-deps0000664000175000017500000000002115201026231025705 0ustar00zuulzuulpackage-installs ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3682375 diskimage_builder-3.42.0/diskimage_builder/elements/iscsi-boot/environment.d/0000775000175000017500000000000015201026275026205 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/iscsi-boot/environment.d/open-iscsi-config0000664000175000017500000000023015201026231031427 0ustar00zuulzuulif [[ $DISTRO_NAME =~ "centos" ]]; then DIB_DRACUT_ENABLED_MODULES+=" - name: network - name: iscsi " export DIB_DRACUT_ENABLED_MODULES fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3682375 diskimage_builder-3.42.0/diskimage_builder/elements/iscsi-boot/extra-data.d/0000775000175000017500000000000015201026275025673 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020600000000000010213 xustar00112 path=diskimage_builder-3.42.0/diskimage_builder/elements/iscsi-boot/extra-data.d/50-check-dracut-regenerate 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/iscsi-boot/extra-data.d/50-check-dracut-regenera0000775000175000017500000000053315201026231032157 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail if [[ $DISTRO_NAME =~ "centos" ]]; then eval declare -A image_elements=($(get_image_element_array)) if [[ ! "${image_elements[@]}" =~ "dracut-regenerate" ]]; then echo "The dracut-regenerate element is required!" exit 1 fi fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3682375 diskimage_builder-3.42.0/diskimage_builder/elements/iscsi-boot/finalise.d/0000775000175000017500000000000015201026275025433 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/iscsi-boot/finalise.d/51-open-iscsi-config0000775000175000017500000000055415201026231031114 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [[ $DISTRO_NAME =~ "centos" ]]; then if [[ -L /boot/grub2/grubenv ]]; then rm -f /boot/grub2/grubenv fi sed -i -E 's/(GRUB_CMDLINE_LINUX_DEFAULT=")(.+)(")/\1\2 rd.iscsi.firmware=1"/' /etc/default/grub grub2-mkconfig -o /boot/grub2/grub.cfg fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/iscsi-boot/package-installs.yaml0000664000175000017500000000003715201026231027515 0ustar00zuulzuulopen-iscsi: phase: install.d ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3682375 diskimage_builder-3.42.0/diskimage_builder/elements/iscsi-boot/post-install.d/0000775000175000017500000000000015201026275026272 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/iscsi-boot/post-install.d/open-iscsi-config0000775000175000017500000000036315201026231031526 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [[ $DISTRO_NAME = "ubuntu" || $DISTRO_NAME = "debian" ]]; then echo "ISCSI_AUTO=true" > /etc/iscsi/iscsi.initramfs update-initramfs -u fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3692374 diskimage_builder-3.42.0/diskimage_builder/elements/iso/0000775000175000017500000000000015201026275022136 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/iso/README.rst0000664000175000017500000000372015201026231023617 0ustar00zuulzuul=== iso === Generates a bootable ISO image from the kernel/ramdisk generated by the elements ``baremetal``, ``ironic-python-agent-ramdisk`` (from ironic-python-agent-builder) or ``ramdisk``. It uses isolinux to boot on BIOS machines and grub to boot on EFI machines. This element has been tested on the following distro(s): * ubuntu * fedora * debian **NOTE**: For other distros, please make sure the ``isolinux.bin`` file exists at ``/usr/lib/syslinux/isolinux.bin``. baremetal element ----------------- When used with ``baremetal`` element, this generates a bootable ISO image named ``-boot.iso`` booting the generated kernel and ramdisk. It also automatically appends kernel command-line argument 'root=UUID='. Any more kernel command-line arguments required may be provided by specifying them in ``DIB_BOOT_ISO_KERNEL_CMDLINE_ARGS``. **NOTE**: It uses pre-built efiboot.img by default to work for UEFI machines. This is because of a bug in latest version of grub[1]. The user may choose to avoid using pre-built binary and build efiboot.img on their own machine by setting the environment variable DIB\_UEFI\_ISO\_BUILD\_EFIBOOT to 1 (this might work only on certain versions of grub). The current efiboot.img was generated by the method build\_efiboot\_img() in 100-build-iso on Ubuntu 13.10 with grub 2.00-19ubuntu2.1. ramdisk element --------------- When used with ``ramdisk`` element, this generates a bootable ISO image named ``.iso`` booting the generated kernel and ramdisk. It also automatically appends kernel command-line argument 'boot\_method=vmedia' which is required for Ironic drivers ``iscsi_ilo``. ironic-python-agent-ramdisk element ----------------------------------- When used with ``ironic-python-agent-ramdisk`` element, this generates a bootable ISO image named ``.iso`` which boots the agent kernel and agent ramdisk. **REFERENCES** [1] https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1378658 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3692374 diskimage_builder-3.42.0/diskimage_builder/elements/iso/cleanup.d/0000775000175000017500000000000015201026275024007 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/iso/cleanup.d/100-build-iso0000775000175000017500000001457215201026231026123 0ustar00zuulzuul#!/bin/bash # # Copyright 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # dib-lint: disable=safe_sudo if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail function build_efiboot_img() { # Signed bootloader files are saved at tmp/bootloader_files during # post-install stage needs to copy them into image. # Signed bootloader packages used are:- # Ubuntu: grub-efi-amd64-signed and shim-signed # Fedora: grub2-efi and shim if [[ $DISTRO_NAME = "fedora" ]] ; then cp $TMP_BOOTLOADER_DIR/shim.efi $TMP_BUILD_DIR/bootx64.efi cp $TMP_BOOTLOADER_DIR/grubx64.efi $TMP_BUILD_DIR/grubx64.efi elif [[ $DISTRO_NAME = "centos" ]] ; then cp $TMP_BOOTLOADER_DIR/shimx64-centos.efi $TMP_BUILD_DIR/bootx64.efi cp $TMP_BOOTLOADER_DIR/grubx64.efi $TMP_BUILD_DIR/grubx64.efi elif [[ $DISTRO_NAME = "ubuntu" || $DISTRO_NAME = "debian" ]] ; then cp $TMP_BOOTLOADER_DIR/shimx64.efi.signed $TMP_BUILD_DIR/bootx64.efi cp $TMP_BOOTLOADER_DIR/grubx64.efi.signed $TMP_BUILD_DIR/grubx64.efi else cp $TMP_BOOTLOADER_DIR/shim.efi.signed $TMP_BUILD_DIR/bootx64.efi cp $TMP_BOOTLOADER_DIR/grubx64.efi.signed $TMP_BUILD_DIR/grubx64.efi fi dd if=/dev/zero of=$TMP_BUILD_DIR/efiboot.img bs=1K count=5760 mkdosfs -F 12 $TMP_BUILD_DIR/efiboot.img # Create a temporary mount point: MOUNTPOINT=$TMP_BUILD_DIR/tmpmount mkdir $MOUNTPOINT sudo mount -o loop $TMP_BUILD_DIR/efiboot.img $MOUNTPOINT sudo mkdir -p $MOUNTPOINT/EFI/BOOT sudo cp $TMP_BUILD_DIR/bootx64.efi $MOUNTPOINT/EFI/BOOT sudo cp $TMP_BUILD_DIR/grubx64.efi $MOUNTPOINT/EFI/BOOT sudo umount $MOUNTPOINT rmdir $MOUNTPOINT cp $TMP_BUILD_DIR/efiboot.img $TMP_IMAGE_DIR/isolinux } function build_iso() { KERNEL=$1 INITRD=$2 KERNEL_CMDLINE_ARGS=$3 OUTPUT_FILENAME=$4 SCRIPTNAME=$(basename $0) SCRIPTDIR=$(dirname $0) MKISOFS="/usr/bin/mkisofs" if [ $DISTRO_NAME = "fedora" ]; then EXTRA_KERNEL_PARAMS="usbcore.autosuspend=-1" #centos elif [ $DISTRO_NAME = "centos" ]; then EFI_BOOT_DIR="EFI/centos" EXTRA_KERNEL_PARAMS="" #debian elif [ $DISTRO_NAME = "debian" ]; then EXTRA_KERNEL_PARAMS="" #ubuntu: else EXTRA_KERNEL_PARAMS="" fi # Create a temporary build directory for holding the contents of iso TMP_IMAGE_DIR="$TMP_BUILD_DIR/image" echo "Creating temporary directory $TMP_IMAGE_DIR" mkdir -p "$TMP_IMAGE_DIR" # Copy isolinux bin to the isolinux directory mkdir -p "$TMP_IMAGE_DIR/isolinux" echo "Copying isolinux.bin" ISOLINUX_BIN=$TMP_BOOTLOADER_DIR/isolinux.bin LDLINUX_BIN=$TMP_BOOTLOADER_DIR/ldlinux.c32 cp $ISOLINUX_BIN "$TMP_IMAGE_DIR/isolinux" # Starting from SYSLINUX 5.00, the isolinux.bin is dependent # on ldlinux.c32. # http://www.syslinux.org/wiki/index.php/Library_modules if [ -f "$LDLINUX_BIN" ]; then cp $LDLINUX_BIN "$TMP_IMAGE_DIR/isolinux" fi # Copy initrd, kernel echo "Copying kernel to $TMP_IMAGE_DIR/vmlinuz" cp $KERNEL "$TMP_IMAGE_DIR/vmlinuz" echo "Copying initrd to $TMP_IMAGE_DIR/initrd" cp $INITRD "$TMP_IMAGE_DIR/initrd" # Generate isolinux.cfg for default booting echo "Generating isolinux.cfg" cat > "$TMP_IMAGE_DIR/isolinux/isolinux.cfg" << END_CONFIG DEFAULT install LABEL install menu label "Install image" kernel /vmlinuz append initrd=/initrd $KERNEL_CMDLINE_ARGS -- TIMEOUT 5 PROMPT 0 END_CONFIG echo "Creating EFI/ubuntu directory" mkdir -p "$TMP_IMAGE_DIR/$EFI_BOOT_DIR" # Generate grub.cfg for default booting echo "Generating grub.cfg" cat > "$TMP_IMAGE_DIR/$EFI_BOOT_DIR/grub.cfg" << END_CONFIG set default="0" set timeout="5" set hidden_timeout_quiet=false menuentry "install" { search --set=root --label VMEDIA_BOOT_ISO linuxefi /vmlinuz $EXTRA_KERNEL_PARAMS $KERNEL_CMDLINE_ARGS -- initrdefi /initrd } END_CONFIG build_efiboot_img # Create the ISO echo "Generating the ISO" $MKISOFS -r -V "VMEDIA_BOOT_ISO" -cache-inodes -J -l \ -b isolinux/isolinux.bin -no-emul-boot \ -boot-load-size 4 -boot-info-table \ -eltorito-alt-boot -e isolinux/efiboot.img \ -no-emul-boot -o $OUTPUT_FILENAME $TMP_IMAGE_DIR } IMAGE_NAME=${IMAGE_NAME:-'image'} if echo $IMAGE_ELEMENT | grep -q '\bramdisk\b'; then EMITTED_KERNEL=$IMAGE_NAME.kernel EMITTED_RAMDISK=$IMAGE_NAME.initramfs DIB_DEPLOY_ISO_KERNEL_CMDLINE_ARGS=${DIB_DEPLOY_ISO_KERNEL_CMDLINE_ARGS:-} EMITTED_KERNEL_CMDLINE_ARGS="boot_method=vmedia $DIB_DEPLOY_ISO_KERNEL_CMDLINE_ARGS" EMITTED_ISO_FILENAME=$IMAGE_NAME.iso elif echo $IMAGE_ELEMENT | grep -q '\bironic-python-agent\b'; then EMITTED_KERNEL=$IMAGE_NAME.vmlinuz EMITTED_RAMDISK=$IMAGE_NAME.initramfs DIB_DEPLOY_ISO_KERNEL_CMDLINE_ARGS=${DIB_DEPLOY_ISO_KERNEL_CMDLINE_ARGS:-} EMITTED_KERNEL_CMDLINE_ARGS="boot_method=vmedia $DIB_DEPLOY_ISO_KERNEL_CMDLINE_ARGS" EMITTED_ISO_FILENAME=$IMAGE_NAME.iso elif echo $IMAGE_ELEMENT | grep -q '\bbaremetal\b'; then EMITTED_KERNEL=${IMAGE_NAME}.vmlinuz EMITTED_RAMDISK=${IMAGE_NAME}.initrd EMITTED_KERNEL_CMDLINE_ARGS="root=LABEL=${DIB_BOOT_LABEL}" DIB_BOOT_ISO_KERNEL_CMDLINE_ARGS=${DIB_BOOT_ISO_KERNEL_CMDLINE_ARGS:-} if [ -n "$DIB_BOOT_ISO_KERNEL_CMDLINE_ARGS" ]; then EMITTED_KERNEL_CMDLINE_ARGS="$EMITTED_KERNEL_CMDLINE_ARGS $DIB_BOOT_ISO_KERNEL_CMDLINE_ARGS" fi export EMITTED_ISO_FILENAME="$IMAGE_NAME-boot.iso" else echo "Cannot find the kernel/ramdisk to build the iso image. " echo "Please use 'iso' element with either 'baremetal' or 'ramdisk' elements" fi export TMP_BOOTLOADER_DIR=$TARGET_ROOT/tmp/bootloader_files build_iso "$EMITTED_KERNEL" "$EMITTED_RAMDISK" "$EMITTED_KERNEL_CMDLINE_ARGS" \ "$EMITTED_ISO_FILENAME" # Clean-up the bootloaders directory sudo rm -fr $TMP_BOOTLOADER_DIR ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/iso/element-deps0000664000175000017500000000002715201026231024432 0ustar00zuulzuulgrub2 package-installs ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/iso/package-installs.yaml0000664000175000017500000000004515201026231026233 0ustar00zuulzuulsyslinux: syslinux-common: isolinux: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/iso/pkg-map0000664000175000017500000000113215201026231023402 0ustar00zuulzuul{ "distro":{ "debian":{ "syslinux": "syslinux", "syslinux-common": "syslinux-common", "isolinux": "isolinux" }, "ubuntu":{ "syslinux": "syslinux", "syslinux-common": "syslinux-common", "isolinux": "isolinux" } }, "family":{ "debian":{ "syslinux": "syslinux", "syslinux-common": "", "isolinux": "" }, "redhat":{ "syslinux": "syslinux", "syslinux-common": "", "isolinux": "" } }, "default":{ "syslinux": "syslinux", "syslinux-common": "", "isolinux": "" } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3692374 diskimage_builder-3.42.0/diskimage_builder/elements/iso/post-install.d/0000775000175000017500000000000015201026275025011 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/iso/post-install.d/01-copy-bootloaders0000775000175000017500000000327615201026231030442 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eux set -o pipefail TMP_BOOTLOADER_DIR=/tmp/bootloader_files mkdir -p $TMP_BOOTLOADER_DIR #fedora if [ $DISTRO_NAME = "fedora" ]; then GRUB_FILE="/boot/efi/EFI/fedora/grubx64.efi" SHIM_FILE="/boot/efi/EFI/fedora/shim.efi" SYSLINUX_FILE="/usr/share/syslinux/isolinux.bin" LDLINUX_FILE="/usr/share/syslinux/ldlinux.c32" #centos elif [ $DISTRO_NAME = "centos" ]; then GRUB_FILE="/boot/efi/EFI/centos/grubx64.efi" SHIM_FILE="/boot/efi/EFI/centos/shimx64-centos.efi" SYSLINUX_FILE="/usr/share/syslinux/isolinux.bin" LDLINUX_FILE="/usr/share/syslinux/ldlinux.c32" #debian/ubuntu elif [[ $DISTRO_NAME = "ubuntu" || $DISTRO_NAME = "debian" ]]; then GRUB_FILE="/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed" SHIM_FILE="/usr/lib/shim/shimx64.efi.signed" SYSLINUX_FILE="/usr/lib/ISOLINUX/isolinux.bin" LDLINUX_FILE="/usr/lib/syslinux/modules/bios/ldlinux.c32" #other else GRUB_FILE="/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed" SHIM_FILE="/usr/lib/shim/shimx64.efi.signed" SYSLINUX_FILE="/usr/lib/ISOLINUX/isolinux.bin" LDLINUX_FILE="/usr/lib/syslinux/modules/bios/ldlinux.c32" fi cp $GRUB_FILE $TMP_BOOTLOADER_DIR cp $SHIM_FILE $TMP_BOOTLOADER_DIR cp $SYSLINUX_FILE $TMP_BOOTLOADER_DIR # On some operating systems signed bootloader packages install # files with read permissions for root only, whereas some for all # the users. chmod --recursive +r $TMP_BOOTLOADER_DIR # Starting from SYSLINUX 5.00, the isolinux.bin is dependent # on ldlinux.c32. # http://www.syslinux.org/wiki/index.php/Library_modules if [ -f "$LDLINUX_FILE" ]; then cp $LDLINUX_FILE $TMP_BOOTLOADER_DIR fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3692374 diskimage_builder-3.42.0/diskimage_builder/elements/journal-to-console/0000775000175000017500000000000015201026275025076 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/journal-to-console/README.rst0000664000175000017500000000052015201026231026552 0ustar00zuulzuul================== journal-to-console ================== Configure systemd's journal to send all logs to console. Useful for debugging issues before you can log into a host, such as network or authentication issues. The console can be retrieved from an OpenStack cloud with a command such as ``openstack console log show ``. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3692374 diskimage_builder-3.42.0/diskimage_builder/elements/journal-to-console/post-install.d/0000775000175000017500000000000015201026275027751 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/journal-to-console/post-install.d/30-journal-to-console 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/journal-to-console/post-install.d/30-journal-to-0000775000175000017500000000145115201026231032257 0ustar00zuulzuul#!/bin/bash # # Copyright 2019 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail mkdir -p /etc/systemd/journald.conf.d cat > /etc/systemd/journald.conf.d/log-to-console.conf << EOF [Journal] ForwardToConsole=true EOF ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3702376 diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/0000775000175000017500000000000015201026275024077 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/README.rst0000664000175000017500000000342515201026231025562 0ustar00zuulzuul============= keylime-agent ============= Presently, we rely upon a certain level of trust for users that leverage baremetal resources. While we do perform cleaning between deployments, a malicious attacker could potentially modify firmware of attached devices in ways that may or may not be readily detectable. The solution that has been proposed for this is the use of a measured launch environments with engagement of Trusted Platform Management (TPM) modules to help ensure that the running system profile is exactly as desired or approved, by the attestation service. To leverage TPM's for attestation, we propose Keylime, an open source remote boot attestation and runtime integrity measurement system. Keylime agent is a component of the Keylime suite which runs on the baremetal node we are attesting during cleaning and deployment steps. Keylime regisrar is a database of all agents registered with Keylime and hosts the public keys of the TPM vendors. In order to enhance the ramdisk to support TPM 2.0 and Keylime, this keylime-agent element is proposed. This element provides configurations for Keylime agent to communicate with Keylime server. Keylime agent runs as a system service to collect Integrity Measurement Architecture (IMA) measurement lists and send the measurements to the Keylime verifier for attestation. Environment Variables --------------------- DIB_KEYLIME_AGENT_REGISTRAR_IP :Required: Yes :Default: 0 :Description: The IP address of Keylime registrar server which Keylime agent communicates with. DIB_KEYLIME_AGENT_REGISTRAR_PORT :Required: Yes :Default: 8890 :Description: The port of Keylime registrar server which Keylime agent communicates with. **REFERENCES** [1] github.com/keylime/ [2] review.opendev.org/c/openstack/ironic-specs/+/576718 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3702376 diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/cleanup.d/0000775000175000017500000000000015201026275025750 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/cleanup.d/98-copy-allowlist0000775000175000017500000000055515201026231031113 0ustar00zuulzuul#!/bin/bash # dib-lint: disable=safe_sudo if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail [ -n "$TARGET_ROOT" ] IMAGE_PATH=$(readlink -f $IMAGE_NAME) # copy allowlist and checksum to image path sudo cp $TARGET_ROOT/root/allowlist.txt ${IMAGE_PATH}-allowlist.txt sudo cp $TARGET_ROOT/root/checksum.txt ${IMAGE_PATH}-checksum.txt ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/element-deps0000664000175000017500000000011215201026231026366 0ustar00zuulzuulpackage-installs pip-and-virtualenv selinux-permissive source-repositories././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3702376 diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/environment.d/0000775000175000017500000000000015201026275026665 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/environment.d/16-keylime-agent0000664000175000017500000000033215201026231031555 0ustar00zuulzuulexport DIB_KEYLIME_AGENT_REGISTRAR_IP=${DIB_KEYLIME_AGENT_REGISTRAR_IP:-0} export DIB_KEYLIME_AGENT_REGISTRAR_PORT=${DIB_KEYLIME_AGENT_REGISTRAR_PORT:-8890} export DIB_KEYLIME_AGENT_PORT=${DIB_KEYLIME_AGENT_PORT:-9002}././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2732353 diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/install.d/0000775000175000017500000000000015201026275025767 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021700000000000010215 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/install.d/keylime-agent-source-install/ 28 mtime=1778658493.3702376 diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/install.d/keylime-agent-source-ins0000775000175000017500000000000015201026275032530 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000024100000000000010212 xustar00139 path=diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/install.d/keylime-agent-source-install/80-keylime-agent-install 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/install.d/keylime-agent-source-ins0000775000175000017500000000377715201026231032543 0ustar00zuulzuul#!/bin/bash if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail SCRIPTDIR=$(dirname $0) VENVDIR=/opt/keylime KLDIR=/tmp/keylime # create the virtual environment if [ $DIB_PYTHON_VERSION == 3 ]; then $DIB_PYTHON -m venv $VENVDIR else $DIB_PYTHON -m virtualenv $VENVDIR fi install -d /etc/ima/ install -c -m 0644 ${SCRIPTDIR}/ima-policy /etc/ima/ima-policy # install Keylime-agent inside the virtual environment $VENVDIR/bin/pip install 'pip>=19.1.1' $VENVDIR/bin/pip install -r $KLDIR/requirements.txt $KLDIR # dataclasses are missing in python3.6, so we have to install it manually $VENVDIR/bin/pip install dataclasses ln -s $VENVDIR/bin/keylime_agent /usr/local/bin/keylime_agent if [ "$DIB_KEYLIME_AGENT_REGISTRAR_IP" != "0" ]; then sed -i "s/registrar_ip = 127.0.0.1/registrar_ip = "$DIB_KEYLIME_AGENT_REGISTRAR_IP"/" /etc/keylime.conf fi if [ "$DIB_KEYLIME_AGENT_REGISTRAR_PORT" != "8890" ]; then sed -i "s/registrar_port = 8890/registrar_port = "$DIB_KEYLIME_AGENT_REGISTRAR_PORT"/" /etc/keylime.conf fi if [ "$DIB_KEYLIME_AGENT_PORT" != "9002" ]; then sed -i "s/cloudagent_port = 9002/cloudagent_port = "$DIB_KEYLIME_AGENT_PORT"/" /etc/keylime.conf fi # set the agent uuid to hash_ek sed -i 's/^\(agent\_uuid\s*=\s*\).*$/\1hash_ek/' /etc/keylime.conf sed -i 's/^\(level\s*=\s*\).*$/\1DEBUG/' /etc/keylime.conf sed -i 's/^\(cloudagent\_ip\s*=\s*\).*$/\10.0.0.0/' /etc/keylime.conf # create allowlist and checksum ./$KLDIR/scripts/create_allowlist.sh /root/allowlist.txt sha256sum touch /root/checksum.txt sha256sum /root/allowlist.txt > /root/checksum.txt case "$DIB_INIT_SYSTEM" in systemd) install -D -g root -o root -m 0644 ${SCRIPTDIR}/keylime-agent.service /usr/lib/systemd/system/keylime-agent.service ;; sysv) install -D -g root -o root -m 0755 ${SCRIPTDIR}/keylime-agent.init /etc/init.d/keylime-agent.init update-rc.d keylime-agent.init defaults ;; *) echo "Unsupported init system" exit 1 ;; esac ././@PaxHeader0000000000000000000000000000022300000000000010212 xustar00125 path=diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/install.d/keylime-agent-source-install/ima-policy 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/install.d/keylime-agent-source-ins0000664000175000017500000000061115201026231032520 0ustar00zuulzuul# MEASUREMENTS measure func=BPRM_CHECK measure func=FILE_MMAP mask=MAY_EXEC measure func=MODULE_CHECK uid=0 # PROC_SUPER_MAGIC dont_measure fsmagic=0x9fa0 # SYSFS_MAGIC dont_measure fsmagic=0x62656572 # DEBUGFS_MAGIC dont_measure fsmagic=0x64626720 # TMPFS_MAGIC dont_measure fsmagic=0x01021994 # RAMFS_MAGIC dont_measure fsmagic=0x858458f6 # SECURITYFS_MAGIC dont_measure fsmagic=0x73636673 ././@PaxHeader0000000000000000000000000000023300000000000010213 xustar00133 path=diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/install.d/keylime-agent-source-install/keylime-agent.init 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/install.d/keylime-agent-source-ins0000775000175000017500000000123215201026231032523 0ustar00zuulzuul#!/bin/sh -e ### BEGIN INIT INFO # Provides: keylime-agent # Required-Start: $local_fs networking # Required-Stop: $local_fs # Default-Start: S # Default-Stop: 0 6 # X-Start-Before: # Short-Description: Keylime Agent # Description: The keylime-agent is deployed to the node for attestation ### END INIT INFO NAME=keylime-agent INIT_NAME=/etc/init.d/${NAME} SCRIPT_NAME=/usr/local/bin/keylime_agent [ -x $SCRIPT_NAME ] || exit 0 case "$1" in start) $SCRIPT_NAME --config-dir /etc/keylime-agent.d/ ;; stop) ;; *) echo "Usage: $INIT_NAME {start|stop}" exit 1 ;; esac exit 0 ././@PaxHeader0000000000000000000000000000023600000000000010216 xustar00136 path=diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/install.d/keylime-agent-source-install/keylime-agent.service 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/install.d/keylime-agent-source-ins0000664000175000017500000000031715201026231032523 0ustar00zuulzuul[Unit] Description=The Keylime agent Wants=tpm2-abrmd.service After=network-online.target [Service] ExecStart=/usr/local/bin/keylime_agent Restart=always RestartSec=30s [Install] WantedBy=multi-user.target././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/package-installs.yaml0000664000175000017500000000000415201026231030167 0ustar00zuulzuulgit:././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3712375 diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/post-install.d/0000775000175000017500000000000015201026275026752 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/post-install.d/90-keylime-agent0000775000175000017500000000043015201026231031646 0ustar00zuulzuul#!/bin/bash if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail case "$DIB_INIT_SYSTEM" in systemd) systemctl enable keylime-agent ;; *) echo "Unsupported init system $DIB_INIT_SYSTEM" exit 1 ;; esac ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/keylime-agent/source-repository-keylime0000664000175000017500000000010715201026231031162 0ustar00zuulzuulkeylime git /tmp/keylime https://github.com/keylime/keylime.git v6.2.0 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3712375 diskimage_builder-3.42.0/diskimage_builder/elements/local-config/0000775000175000017500000000000015201026275023701 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/local-config/README.rst0000664000175000017500000000045715201026231025366 0ustar00zuulzuul============ local-config ============ Copies local user settings such as .ssh/authorized\_keys and $http\_proxy into the image. Environment Variables --------------------- DIB_LOCAL_CONFIG_USERNAME :Required: No :Default: root :Description: Username used when installing .ssh/authorized\_keys. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/local-config/element-deps0000664000175000017500000000002115201026231026167 0ustar00zuulzuulpackage-installs ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3712375 diskimage_builder-3.42.0/diskimage_builder/elements/local-config/environment.d/0000775000175000017500000000000015201026275026467 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/local-config/environment.d/62-ssh-key0000664000175000017500000000010415201026231030205 0ustar00zuulzuulexport DIB_LOCAL_CONFIG_USERNAME=${DIB_LOCAL_CONFIG_USERNAME:-root} ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3712375 diskimage_builder-3.42.0/diskimage_builder/elements/local-config/extra-data.d/0000775000175000017500000000000015201026275026155 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/local-config/extra-data.d/62-ssh-key0000775000175000017500000000054315201026231027705 0ustar00zuulzuul#!/bin/bash # Save user SSH public key if available. # (Obviously not suitable for downloadable images). if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail [ -n "$TMP_HOOKS_PATH" ] || die "Temp hook path not set" if [ -e ~/.ssh/authorized_keys ]; then cat ~/.ssh/authorized_keys > $TMP_HOOKS_PATH/ssh-authorized-keys fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3712375 diskimage_builder-3.42.0/diskimage_builder/elements/local-config/install.d/0000775000175000017500000000000015201026275025571 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/local-config/install.d/62-ssh-key0000775000175000017500000000112015201026231027311 0ustar00zuulzuul#!/bin/bash # Save user SSH public key if available. # XXX: Obviously not suitable for downloadable images. if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [ "$DIB_LOCAL_CONFIG_USERNAME" == "root" ]; then DIR_NAME=${DIB_LOCAL_CONFIG_USERNAME} else DIR_NAME=home/${DIB_LOCAL_CONFIG_USERNAME} fi if [ -e "/tmp/in_target.d/ssh-authorized-keys" ]; then mkdir -p /${DIR_NAME}/.ssh cat /tmp/in_target.d/ssh-authorized-keys >> /${DIR_NAME}/.ssh/authorized_keys chmod 0700 /${DIR_NAME}/.ssh chmod 0600 /${DIR_NAME}/.ssh/authorized_keys fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3712375 diskimage_builder-3.42.0/diskimage_builder/elements/local-config/pre-install.d/0000775000175000017500000000000015201026275026355 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/local-config/pre-install.d/02-proxy-settings0000775000175000017500000000403315201026231031531 0ustar00zuulzuul#!/bin/bash # Save the HTTP/[S] and noproxy settings if available. # XXX: Obviously not suitable for downloadable images. if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail have_apt= have_yum= have_zypper= http_proxy=${http_proxy:-""} https_proxy=${https_proxy:-""} if [ -d /etc/apt ] ; then have_apt=1 fi if [ -e /etc/yum.conf ] ; then have_yum=1 fi if [ -d /etc/zypp ] ; then have_zypper=1 fi if [ -n "$http_proxy" ]; then if [ -d ~stack ]; then echo export http_proxy=$http_proxy >> ~stack/.profile fi if [ -n "$have_apt" ] ; then echo "Acquire::http::Proxy \"$http_proxy\";" > /etc/apt/apt.conf.d/02-use-http-proxy fi if [ -n "$have_yum" ] ; then sed -i -e "s,\[main\],[main]\nproxy=$http_proxy," /etc/yum.conf fi if [ -n "$have_zypper" ] ; then sed -i -e "s,^HTTP_PROXY=.*$,HTTP_PROXY=\"$http_proxy\"," /etc/sysconfig/proxy fi fi if [ -n "$https_proxy" ]; then if [ -d ~stack ]; then echo export https_proxy=$https_proxy >> ~stack/.profile fi if [ -n "$have_apt" ] ; then echo "Acquire::https::Proxy \"$https_proxy\";" > /etc/apt/apt.conf.d/02-use-https-proxy fi if [ -n "$have_zypper" ] ; then sed -i -e "s,^HTTPS_PROXY=.*$,HTTPS_PROXY=\"$https_proxy\"," /etc/sysconfig/proxy fi fi no_proxy=${no_proxy:+"$no_proxy,192.0.2.1"} no_proxy=${no_proxy:-"192.0.2.1"} if [ -n "$no_proxy" ]; then if [ -d ~stack ]; then echo export no_proxy=$no_proxy >> ~stack/.profile fi if [ -n "$have_apt" ] ; then for host in $(sed 's/,/ /g' <<<$no_proxy); do echo "Acquire::http::Proxy::$host \"DIRECT\";" >> /etc/apt/apt.conf.d/02-no-proxy done fi if [ -n "$have_zypper" ] ; then sed -i -e "s,^\(NO_PROXY=.*\)\"$,\1\, $no_proxy\"," /etc/sysconfig/proxy fi fi if [ -n "$http_proxy" -o -n "$https_proxy" -o -n "$no_proxy" ]; then if [ -n "$have_zypper" ] ; then sed -i -e "s,^PROXY_ENABLED=.*$,PROXY_ENABLED=\"yes\"," /etc/sysconfig/proxy fi fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3722374 diskimage_builder-3.42.0/diskimage_builder/elements/lvm/0000775000175000017500000000000015201026275022142 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/lvm/README.rst0000664000175000017500000000072015201026231023620 0ustar00zuulzuul===== lvm ===== This is the LVM support element for Ubuntu Xenial. Note that this element requires initramfs-tools and lvm2 packages to be added to the DIB image using -p option. If this is not the case, an error will be triggered. This element enables that an image build with a customized DIB_BLOCK_DEVICE_CONFIG containing LVM volumes will boot properly. On CentOS like distributions, you should use dracut-regenerate element instead of current lvm element. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/lvm/element-deps0000664000175000017500000000004215201026231024433 0ustar00zuulzuulbootloader pkg-map ubuntu-minimal ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3722374 diskimage_builder-3.42.0/diskimage_builder/elements/lvm/finalise.d/0000775000175000017500000000000015201026275024156 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/lvm/finalise.d/60-bootloader0000775000175000017500000000450115201026231026451 0ustar00zuulzuul#!/bin/bash # Configure grub. Note that the various conditionals here are to handle # different distributions gracefully. if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail BOOT_DEV=$IMAGE_BLOCK_DEVICE # All available devices, handy for some bootloaders... declare -A DEVICES eval DEVICES=( $IMAGE_BLOCK_DEVICES ) # This might be better factored out into a per-distro 'install-bootblock' # helper. if [ -d /boot/grub2 ]; then GRUB_CFG=/boot/grub2/grub.cfg elif [ -d /boot/grub ]; then GRUB_CFG=/boot/grub/grub.cfg fi if type grub2-mkconfig >/dev/null; then GRUB_MKCONFIG="grub2-mkconfig -o $GRUB_CFG" else GRUB_MKCONFIG="grub-mkconfig -o $GRUB_CFG" fi # Retrieve root filesystem mount point to check if it is LVM based ROOTFS=$(awk '$2=="/"{print}' /proc/mounts) # Standard filesystems are mounted as /dev/mapper/loop* within DIB # so we need to exclude this case if echo "$ROOTFS" | grep -qv '/dev/mapper/loop'; then # LVM based filesystems are mounted as /dev/mapper/- within DIB if echo "$ROOTFS" | grep -q '/dev/mapper/'; then # Check if initramfs-tools are installed if [ ! -d /etc/initramfs-tools ]; then echo "You must have initramfs-tools installed for LVM based root filesystem to work properly" exit 1 fi # Check if system supports LVM if ! type pvs >/dev/null 2>&1; then echo "You must have lvm2 package installed for LVM based root filesystem to work properly" exit 1 fi # Check for appropriate filesystem support (for fsck) FSTYPE=$(echo $ROOTFS | awk '{print $3}') if ! type fsck.$FSTYPE >/dev/null 2>&1; then echo "You must have utility package for $FSTYPE filesystem installed for LVM based root filesystem to work properly (fsck.$FSTYPE is missing)" exit 1 fi # Change the current GRUB_DEVICE from LABEL=(cloud)img-rootfs to /dev/mapper/... sed -i -e "s?^GRUB_DEVICE=.*?GRUB_DEVICE=$(echo $ROOTFS | awk '{print $1}')?" /etc/default/grub # This is required for LVM2 driver to be included in the # ramdisk of the image. echo "lvm2" >> /etc/initramfs-tools/modules # We need to regenerated the init ramdisk at this point update-initramfs -u -v fi fi $GRUB_MKCONFIG ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/lvm/package-installs.yaml0000664000175000017500000000002715201026231026237 0ustar00zuulzuullvm2: initramfs-tools: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3722374 diskimage_builder-3.42.0/diskimage_builder/elements/lvm/root.d/0000775000175000017500000000000015201026275023347 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/lvm/root.d/10-lvm-check-distro0000775000175000017500000000057115201026231026661 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [ 'ubuntu' != $DISTRO_NAME ]; then echo "Only ubuntu is supported for LVM support. The DISTRO is set to $DISTRO_NAME" exit 1 fi if [[ $DIB_RELEASE =~ trusty ]]; then echo "Trusty release does not have LVM support. The DIB_RELEASE is set to $DIB_RELEASE" exit 1 fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3722374 diskimage_builder-3.42.0/diskimage_builder/elements/manifests/0000775000175000017500000000000015201026275023335 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/manifests/README.rst0000664000175000017500000000173415201026231025021 0ustar00zuulzuul========= manifests ========= An framework for saving manifest information generated during the build for later inspection. Manifests are kept in the final image and also copied to the build area post-image creation. Elements that wish to save any form of manifest should depend on this element and can save their data to into the ``DIB_MANIFEST_IMAGE_DIR`` ( which defaults to ``/etc/dib-manifests``). Note this is created in ``extra-data.d`` rather than ``pre-install.d`` to allow the ``source-repositories`` element to make use of it The manifests are copied to ``DIB_MANIFEST_SAVE_DIR``, which defaults to ``${IMAGE_NAME}.d/``, resulting in the manifests being available as ``${IMAGE_NAME}.d/dib-manifests`` by default after the build. Extra status ------------ This element will also add the files ``dib_environment`` and ``dib_arguments`` to the manifest recording the ``diskimage-builder`` specific environment (``DIB_*`` variables) and command-line arguments respectively. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3722374 diskimage_builder-3.42.0/diskimage_builder/elements/manifests/cleanup.d/0000775000175000017500000000000015201026275025206 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/manifests/cleanup.d/01-copy-manifests-dir0000775000175000017500000000340515201026231031061 0ustar00zuulzuul#!/bin/bash # # Copyright 2014 Hewlett-Packard Development Company, L.P. # Copyright 2017 Andreas Florath (andreas@florath.net) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail MANIFEST_IMAGE_PATH=${TMP_MOUNT_PATH}/${DIB_MANIFEST_IMAGE_DIR} # Double check: directory must be created in extra-data.d/20-manifest-dir [ -d ${MANIFEST_IMAGE_PATH} ] || { echo "Error: MANIFEST_IMAGE_PATH [${MANIFEST_IMAGE_PATH}] does not exist"; exit 1; } echo "$DIB_ENV" | sudo dd of=${MANIFEST_IMAGE_PATH}/dib_environment # dib-lint: safe_sudo echo "$DIB_ARGS" | sudo dd of=${MANIFEST_IMAGE_PATH}/dib_arguments # dib-lint: safe_sudo # Save the manifests locally to the save dir mkdir -p ${DIB_MANIFEST_SAVE_DIR} sudo cp --no-preserve=ownership -rv ${MANIFEST_IMAGE_PATH} ${DIB_MANIFEST_SAVE_DIR} # dib-lint: safe_sudo sudo chown -R $(whoami): ${DIB_MANIFEST_SAVE_DIR} # dib-lint: safe_sudo # Lock down permissions on the manifest files inside the image to # root. We don't want regular users being able to see what might # contain a password, etc. sudo find ${MANIFEST_IMAGE_PATH} -type f | xargs sudo chown root:root # dib-lint: safe_sudo sudo find ${MANIFEST_IMAGE_PATH} -type f | xargs sudo chmod 600 # dib-lint: safe_sudo ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3722374 diskimage_builder-3.42.0/diskimage_builder/elements/manifests/environment.d/0000775000175000017500000000000015201026275026123 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/manifests/environment.d/14-manifests0000664000175000017500000000136015201026231030251 0ustar00zuulzuul# Copyright 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # export DIB_MANIFEST_IMAGE_DIR=${DIB_MANIFEST_IMAGE_DIR:-/etc/dib-manifests} export DIB_MANIFEST_SAVE_DIR=${DIB_MANIFEST_SAVE_DIR:-${IMAGE_NAME}.d/} ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3732376 diskimage_builder-3.42.0/diskimage_builder/elements/manifests/extra-data.d/0000775000175000017500000000000015201026275025611 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/manifests/extra-data.d/20-manifest-dir0000775000175000017500000000136215201026231030332 0ustar00zuulzuul#!/bin/bash # # Copyright 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail sudo mkdir -p $TMP_MOUNT_PATH/${DIB_MANIFEST_IMAGE_DIR} ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3732376 diskimage_builder-3.42.0/diskimage_builder/elements/mellanox/0000775000175000017500000000000015201026275023163 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/mellanox/README.rst0000664000175000017500000000007715201026231024646 0ustar00zuulzuul======== mellanox ======== Force support for mellanox hardware ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/mellanox/element-deps0000664000175000017500000000003615201026231025457 0ustar00zuulzuulepel package-installs pkg-map ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3732376 diskimage_builder-3.42.0/diskimage_builder/elements/mellanox/init.d/0000775000175000017500000000000015201026275024350 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/mellanox/init.d/01-mellanox0000664000175000017500000000020315201026231026313 0ustar00zuulzuul# extra load for mellanox modprobe mlx4_en modprobe mlx4_ib modprobe ib_ipoib modprobe mlx5_ib modprobe ib_umad modprobe ib_uverbs ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3732376 diskimage_builder-3.42.0/diskimage_builder/elements/mellanox/install.d/0000775000175000017500000000000015201026275025053 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/mellanox/install.d/65-mellanox0000775000175000017500000000103615201026231027040 0ustar00zuulzuul#!/bin/bash # Ensure we load the mellanox driver somehow if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail home=$(dirname $0) install -m 0644 -o root -g root $home/mellanox-rules.udev /etc/udev/rules.d/81-mellanox.rules # needed kernel modules; mlx4_en mlx4_ib ib_ipoib mlx5_ib ib_umad ib_uverbs # mlx5_core loaded by mlx5_ib echo "mlx4_en" >>/etc/modules echo "mlx4_ib" >>/etc/modules echo "ib_ipoib" >>/etc/modules echo "mlx5_ib" >>/etc/modules echo "ib_umad" >>/etc/modules echo "ib_uverbs" >>/etc/modules ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/mellanox/install.d/mellanox-rules.udev0000664000175000017500000000053415201026231030701 0ustar00zuulzuulACTION!="add", GOTO="drivers_end" SUBSYSTEM=="net", RUN+="/sbin/modprobe mlx4_en" SUBSYSTEM=="net", RUN+="/sbin/modprobe mlx4_ib" SUBSYSTEM=="net", RUN+="/sbin/modprobe ib_ipoib" SUBSYSTEM=="net", RUN+="/sbin/modprobe mlx5_ib" SUBSYSTEM=="net", RUN+="/sbin/modprobe ib_umad" SUBSYSTEM=="net", RUN+="/sbin/modprobe ib_uverbs" LABEL="drivers_end" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/mellanox/package-installs.yaml0000664000175000017500000000036615201026231027266 0ustar00zuulzuuldkms: ibacm: ibverbs-utils: infiniband-diags: libibcommon: libibmad: libibumad: libibverbs: libibverbs-runtime: libmlx4: libmlx5: librdmacm: librdmacm-dev: librdmacm-runtime: mstflint: opensm: pciutils: perftest: rdma: rpm-build: srptools: vlan: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/mellanox/pkg-map0000664000175000017500000000331715201026231024436 0ustar00zuulzuul{ "family": { "debian":{ "dkms": "dkms", "libibverbs": "libibverbs*", "ibacm": "ibacm", "librdmacm": "librdmacm*", "libmlx4": "libmlx4*", "libmlx5": "libmlx5*", "libibmad": "libibmad.*", "libibumad": "libibumad*", "librdmacm-dev": "librdmacm-dev", "rdma": "rdmacm-utils", "vlan": "vlan", "ibverbs-utils": "ibverbs-utils" }, "redhat": { "libibverbs": "libibverbs.*", "librdmacm": "librdmacm.*", "libmlx4": "libmlx4.*", "libmlx5": "libmlx5.*", "libibmad": "libibmad.*", "libibumad": "libibumad.*", "rdma": "rdma", "pciutils": "pciutils" }, "suse":{ "libibverbs": "libibverbs", "librdmacm": "librdmacm", "libmlx4": "libmlx4", "libmlx5": "libmlx5", "libibmad": "libibmad", "libibumad": "libibumad", "rdma": "rdma", "rpm-build": "rpm-build", "libibverbs-runtime": "libibverbs-runtime", "librdmacm-runtime": "librdmacm-runtime", "libibcommon": "libibcommon" } }, "default": { "infiniband-diags": "infiniband-diags", "mstflint": "mstflint", "opensm": "opensm", "srptools": "srptools", "librdmacm-dev": "", "perftest": "perftest", "vlan": "", "pciutils": "", "ibverbs-utils": "", "rpm-build": "", "libibverbs-runtime": "", "librdmacm-runtime": "", "ibacm": "", "dkms": "", "libibcommon": "" } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3742375 diskimage_builder-3.42.0/diskimage_builder/elements/mellanox/udev.d/0000775000175000017500000000000015201026275024350 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/mellanox/udev.d/81-mellanox-drivers.rules0000664000175000017500000000053415201026231031137 0ustar00zuulzuulACTION!="add", GOTO="drivers_end" SUBSYSTEM=="net", RUN+="/sbin/modprobe mlx4_en" SUBSYSTEM=="net", RUN+="/sbin/modprobe mlx4_ib" SUBSYSTEM=="net", RUN+="/sbin/modprobe ib_ipoib" SUBSYSTEM=="net", RUN+="/sbin/modprobe mlx5_ib" SUBSYSTEM=="net", RUN+="/sbin/modprobe ib_umad" SUBSYSTEM=="net", RUN+="/sbin/modprobe ib_uverbs" LABEL="drivers_end" ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3742375 diskimage_builder-3.42.0/diskimage_builder/elements/modprobe/0000775000175000017500000000000015201026275023153 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/modprobe/README.rst0000664000175000017500000000125615201026231024636 0ustar00zuulzuul======== modprobe ======== Allows to configure specific modprobe options on the image. It contains the following functionalities: 1. Ability to blacklist specific modules using modprobe.d/blacklist.conf. In order to use set DIB_MODPROBE_BLACKLIST to the name of your module. To disable multiple modules you can set DIB_MODPROBE_BLACKLIST to a list of string separated by spaces. Example: export DIB_MODPROBE_BLACKLIST="igb" 2. Ability to copy specific files into /etc/modprobe.d directory, so it allows to configure settings with freedom. To achieve that, the files to be copied needs to be placed inside an specific modprobe.d directory of the element. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3742375 diskimage_builder-3.42.0/diskimage_builder/elements/modprobe/extra-data.d/0000775000175000017500000000000015201026275025427 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/modprobe/extra-data.d/50-modprobe-blacklist0000775000175000017500000000166015201026231031347 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail # This would only not be here if there was no kmod package installed, # which can happen in some container situations. Obviously # blacklisting a kernel module is not really useful; however allowing # this to work can allow modules that do other things that *are* # useful for a container to "just work" without a whole bunch of # refactoring. if [ ! -d $TMP_MOUNT_PATH/etc/modprobe.d ]; then # ^ so we can see in the logs if we took this path ... sudo mkdir -p $TMP_MOUNT_PATH/etc/modprobe.d fi # copy all modprobe.d snippets to /etc/modprobe.d eval declare -A image_elements=($(get_image_element_array)) for i in "${!image_elements[@]}"; do element=$i element_dir=${image_elements[$i]} if [ -d "${element_dir}/modprobe.d/" ]; then sudo cp ${element_dir}/modprobe.d/*.conf $TMP_MOUNT_PATH/etc/modprobe.d/ fi done ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3742375 diskimage_builder-3.42.0/diskimage_builder/elements/modprobe/install.d/0000775000175000017500000000000015201026275025043 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/modprobe/install.d/80-modprobe-blacklist0000775000175000017500000000036115201026231030763 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail MODULES_LIST=${DIB_MODPROBE_BLACKLIST:-""} for mod_name in $MODULES_LIST; do echo "blacklist $mod_name" >> /etc/modprobe.d/blacklist.conf done ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3742375 diskimage_builder-3.42.0/diskimage_builder/elements/modprobe-blacklist/0000775000175000017500000000000015201026275025121 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/modprobe-blacklist/README.rst0000664000175000017500000000074515201026231026606 0ustar00zuulzuul================== modprobe-blacklist ================== Blacklist specific modules using modprobe.d/blacklist.conf. In order to use set DIB_MODPROBE_BLACKLIST to the name of your module. To disable multiple modules you can set DIB_MODPROBE_BLACKLIST to a list of string separated by spaces. Example: export DIB_MODPROBE_BLACKLIST="igb" .. note:: This element has been deprecated and replaced by the modprobe element, that covers 100% the modprobe-blacklist functionality. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3742375 diskimage_builder-3.42.0/diskimage_builder/elements/modprobe-blacklist/install.d/0000775000175000017500000000000015201026275027011 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020600000000000010213 xustar00112 path=diskimage_builder-3.42.0/diskimage_builder/elements/modprobe-blacklist/install.d/80-modprobe-blacklist 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/modprobe-blacklist/install.d/80-modprobe-blackli0000775000175000017500000000042315201026231032361 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail MODULES_LIST=${DIB_MODPROBE_BLACKLIST:?"Please set DIB_MODPROBE_BLACKLIST."} for mod_name in $MODULES_LIST; do echo "blacklist $mod_name" >> /etc/modprobe.d/blacklist.conf done ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3742375 diskimage_builder-3.42.0/diskimage_builder/elements/nm-dhcp-ib-interfaces/0000775000175000017500000000000015201026275025403 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/nm-dhcp-ib-interfaces/README.rst0000664000175000017500000000054715201026231027070 0ustar00zuulzuul===================== nm-dhcp-ib-interfaces ===================== Add InfiniBand connection profile to run DHCP for InfiniBand interfaces As it's not implemented yet to create default connection profiles for InfiniBand interfaces in NetworkManager, we are providing a wildcard InfiniBand connection profile to allow it to run DHCP for InfiniBand interfaces. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3742375 diskimage_builder-3.42.0/diskimage_builder/elements/nm-dhcp-ib-interfaces/install.d/0000775000175000017500000000000015201026275027273 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021100000000000010207 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/nm-dhcp-ib-interfaces/install.d/50-dhcp-ib-interfaces 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/nm-dhcp-ib-interfaces/install.d/50-dhcp-ib-inter0000775000175000017500000000105015201026231032054 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail SCRIPTDIR=$(dirname $0) # Because NetworkManager can't automatically create default connection # profiles for InfiniBand interfaces, we are installing # NetworkManager-system-connections-infiniband.nmconnection to # NetworkManager to create a wildcard InfiniBand connection profile install -D -g root -o root -m 0600 ${SCRIPTDIR}/NetworkManager-system-connections-infiniband.nmconnection /etc/NetworkManager/system-connections/infiniband.nmconnection exit 0 ././@PaxHeader0000000000000000000000000000025500000000000010217 xustar00151 path=diskimage_builder-3.42.0/diskimage_builder/elements/nm-dhcp-ib-interfaces/install.d/NetworkManager-system-connections-infiniband.nmconnection 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/nm-dhcp-ib-interfaces/install.d/NetworkManager-s0000664000175000017500000000025115201026231032370 0ustar00zuulzuul[connection] id=infiniband type=infiniband multi-connect=3 [infiniband] transport-mode=datagram [ipv4] method=auto [ipv6] addr-gen-mode=default method=auto [proxy] ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3752377 diskimage_builder-3.42.0/diskimage_builder/elements/no-final-image/0000775000175000017500000000000015201026275024127 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/no-final-image/README.rst0000664000175000017500000000110315201026231025601 0ustar00zuulzuul============== no-final-image ============== This is a noop element which can be used to indicate to diskimage-builder that it should not bother creating a final image out of the generated filesystem. It is useful in cases where an element handles all of the image building itself, such as ironic-python-agent-ramdisk or Docker images. In those cases the final image normally generated by diskimage-builder is not the desired output, so there's no reason to spend time creating it. Elements that wish to behave this way should include this element in their element-deps file. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3752377 diskimage_builder-3.42.0/diskimage_builder/elements/oat-client/0000775000175000017500000000000015201026275023403 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/oat-client/README.rst0000664000175000017500000000113415201026231025061 0ustar00zuulzuul========== oat-client ========== This element installs oat-client on the image, that's necessary for trusted boot feature in Ironic to work. Intel TXT will measure BIOS, Option Rom and Kernel/Ramdisk during trusted boot, the oat-client will securely fetch the hash values from TPM. .. note:: This element only works on Fedora. Put `fedora-oat.repo` into `/etc/yum.repos.d/`:: export DIB_YUM_REPO_CONF=/etc/yum.repos.d/fedora-oat.repo .. note:: OAT Repo is lack of a GPG signature check on packages, which can be tracked on: https://github.com/OpenAttestation/OpenAttestation/issues/26 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/oat-client/element-deps0000664000175000017500000000002115201026231025671 0ustar00zuulzuulpackage-installs ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/oat-client/package-installs.yaml0000664000175000017500000000003515201026231027477 0ustar00zuulzuuloat-client: oat-commandtool: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3752377 diskimage_builder-3.42.0/diskimage_builder/elements/oat-client/yum.repos.d/0000775000175000017500000000000015201026275025566 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/oat-client/yum.repos.d/fedora-oat.repo0000664000175000017500000000034315201026231030466 0ustar00zuulzuul# Place this file in your /etc/yum.repos.d/ directory [oat] name=oat 2.2 packages and dependencies baseurl=http://repos.fedorapeople.org/repos/gwei3/oat/fedora-$releasever/$basearch/ enabled=1 skip_if_unavailable=1 gpgcheck=0 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3752377 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/0000775000175000017500000000000015201026275024766 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/README.rst0000664000175000017500000000104615201026231026446 0ustar00zuulzuul================= openeuler-minimal ================= Create a minimal image from scratch. Use of this element will require 'yum' and 'yum-utils' to be installed on Ubuntu and Debian. Nothing additional is needed on Fedora, CentOS or openEuler. Set ``DIB_RELEASE`` to ``22.03-LTS`` other release number to explicitly select the release. ``DIB_RELEASE`` defaults the latest LTS release. Set ``DIB_DISTRIBUTION_MIRROR`` to the mirror URL use a openEuler Yum mirror. This URL should point to the directory containing the ``DIB_RELEASE`` directories. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/element-deps0000664000175000017500000000005715201026231027265 0ustar00zuulzuulcloud-init growroot openssh-server yum-minimal ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/element-provides0000664000175000017500000000002115201026231030154 0ustar00zuulzuuloperating-system ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3762376 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/environment.d/0000775000175000017500000000000015201026275027554 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022100000000000010210 xustar00123 path=diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/environment.d/10-openeuler-distro-name.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/environment.d/10-openeuler-dis0000664000175000017500000000015615201026231032462 0ustar00zuulzuulexport DISTRO_NAME=openeuler export DIB_RELEASE=${DIB_RELEASE:-22.03-LTS} export EFI_BOOT_DIR="EFI/openEuler" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/environment.d/11-yum-dnf.bash0000664000175000017500000000001715201026231032177 0ustar00zuulzuulexport YUM=dnf ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/package-installs.yaml0000664000175000017500000000004715201026231031065 0ustar00zuulzuulopenEuler-latest-release: vim-minimal: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3762376 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/pre-install.d/0000775000175000017500000000000015201026275027442 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/pre-install.d/00-setup-mirror0000775000175000017500000000067115201026231032251 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [ -n "${DIB_DISTRIBUTION_MIRROR:-}" ]; then # Only set the mirror for OS, everything, EPOL and update repositories, # The others (debuginfo and source) aren't mirrored since they do not exist on all mirrors sed -i "/\(debuginfo\|source\)/! {s#http://repo.openeuler.org#$DIB_DISTRIBUTION_MIRROR#g}" /etc/yum.repos.d/openEuler.repo fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3762376 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/root.d/0000775000175000017500000000000015201026275026173 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/root.d/00-00-generate-repo0000775000175000017500000000130015201026231031272 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail # NOTE(xinliang): This script should run before script elements/yum-minimal/root.d/08-yum-chroot # So set the script name prefix as 00- yum_repos_dir="$(dirname $0)/../yum.repos.d" mkdir -p $yum_repos_dir REPO_URL=${DIB_DISTRIBUTION_MIRROR:-http://repo.openeuler.org} repo_file=$(mktemp) cat > $repo_file << EOF [OS] name=openEuler-$DIB_RELEASE - OS baseurl=${REPO_URL}/openEuler-$DIB_RELEASE/OS/\$basearch/ enabled=1 gpgcheck=0 [update] name=openEuler-$DIB_RELEASE - update baseurl=${REPO_URL}/openEuler-$DIB_RELEASE/update/\$basearch/ enabled=1 gpgcheck=0 EOF mv $repo_file ${yum_repos_dir}/openEuler.repo ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2772355 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/test-elements/0000775000175000017500000000000015201026275027557 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022300000000000010212 xustar00119 path=diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/ 28 mtime=1778658493.3762376 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-0000775000175000017500000000000015201026275031756 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022700000000000010216 xustar00129 path=diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-0000664000175000017500000000003115201026231031742 0ustar00zuulzuulopenEuler 22.03-LTS test ././@PaxHeader0000000000000000000000000000023100000000000010211 xustar00131 path=diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-0000664000175000017500000000005115201026231031744 0ustar00zuulzuulblock-device-efi openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000024100000000000010212 xustar00133 path=diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/environment.d/ 28 mtime=1778658493.3762376 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-0000775000175000017500000000000015201026275031756 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000025500000000000010217 xustar00151 path=diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-0000664000175000017500000000003715201026231031750 0ustar00zuulzuulexport DIB_RELEASE='22.03-LTS' ././@PaxHeader0000000000000000000000000000024000000000000010211 xustar00138 path=diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-0000664000175000017500000000000515201026231031743 0ustar00zuulzuulqcow2././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3772376 diskimage_builder-3.42.0/diskimage_builder/elements/openssh-server/0000775000175000017500000000000015201026275024327 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openssh-server/README.rst0000664000175000017500000000140015201026231026001 0ustar00zuulzuul============== openssh-server ============== This element ensures that openssh server is installed and enabled during boot. To disable hardening of sshd configuration, you have to set ``DIB_OPENSSH_SERVER_HARDENING`` to 0. This option will configure KexAlgorithms, Ciphers and MAC following good pratices on https://infosec.mozilla.org/guidelines/openssh Note ---- Most cloud images come with the openssh server service installed and enabled during boot. However, certain cloud images, especially those created by the \*-minimal elements may not have it installed or enabled. In these cases, using this element may be helpful to ensure your image will accessible via SSH. It's usually helpful to combine this element with others such as the `runtime-ssh-host-keys`. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openssh-server/element-deps0000664000175000017500000000006715201026231026627 0ustar00zuulzuuldib-init-system package-installs runtime-ssh-host-keys ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openssh-server/package-installs.yaml0000664000175000017500000000002015201026231030415 0ustar00zuulzuulopenssh-server: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openssh-server/pkg-map0000664000175000017500000000020515201026231025573 0ustar00zuulzuul{ "family": { "suse": { "openssh-server": "openssh" }, "gentoo": { "openssh-server": "openssh" } } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3772376 diskimage_builder-3.42.0/diskimage_builder/elements/openssh-server/post-install.d/0000775000175000017500000000000015201026275027202 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021000000000000010206 xustar00114 path=diskimage_builder-3.42.0/diskimage_builder/elements/openssh-server/post-install.d/80-enable-sshd-service 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openssh-server/post-install.d/80-enable-sshd-ser0000775000175000017500000000116515201026231032324 0ustar00zuulzuul#!/bin/bash if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail case "$DIB_INIT_SYSTEM" in upstart) # nothing to do exit 0 ;; systemd) if [[ $DISTRO_NAME = "ubuntu" || $DISTRO_NAME = "debian" ]]; then systemctl enable ssh.service else systemctl enable sshd.service fi ;; openrc) rc-update add sshd default ;; sysv) # ssh is enabled by default, nothing to do exit 0 ;; *) echo "Unsupported init system $DIB_INIT_SYSTEM" exit 1 ;; esac ././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/openssh-server/post-install.d/99-harden-sshd-config 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openssh-server/post-install.d/99-harden-sshd-con0000775000175000017500000000252415201026231032337 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail if [ ${DIB_OPENSSH_SERVER_HARDENING:-1} -eq 1 ]; then macs="MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com" ciphers="Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr" kexalgorithms="KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256" if ! grep -qE "^MACs" /etc/ssh/sshd_config; then sed -i "/# Ciphers and keying/a $macs" /etc/ssh/sshd_config elif ! grep -qE "$macs" /etc/ssh/sshd_config; then sed -i "s/^MACs.*/$macs/" /etc/ssh/sshd_config fi if ! grep -qE "^Ciphers" /etc/ssh/sshd_config; then sed -i "/# Ciphers and keying/a $ciphers" /etc/ssh/sshd_config elif ! grep -qE "$ciphers" /etc/ssh/sshd_config; then sed -i "s/^Ciphers.*/$ciphers/" /etc/ssh/sshd_config fi if ! grep -qE "^KexAlgorithms" /etc/ssh/sshd_config; then sed -i "/# Ciphers and keying/a $kexalgorithms" /etc/ssh/sshd_config elif ! grep -qE "$kexalgorithms" /etc/ssh/sshd_config; then sed -i "s/^KexAlgorithms.*/$kexalgorithms/" /etc/ssh/sshd_config fi fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3772376 diskimage_builder-3.42.0/diskimage_builder/elements/openstack-ci-mirrors/0000775000175000017500000000000015201026275025417 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openstack-ci-mirrors/README.rst0000664000175000017500000000046115201026231027077 0ustar00zuulzuul==================== openstack-ci-mirrors ==================== This element contains various settings to setup mirrors for openstack ci gate testing in a generic fashion. It is intended to be used as a dependency of testing elements that run in the gate. It should do nothing outside that environment. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3772376 diskimage_builder-3.42.0/diskimage_builder/elements/openstack-ci-mirrors/environment.d/0000775000175000017500000000000015201026275030205 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022600000000000010215 xustar00128 path=diskimage_builder-3.42.0/diskimage_builder/elements/openstack-ci-mirrors/environment.d/11-dib-distribution-mirror.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openstack-ci-mirrors/environment.d/11-dib-distri0000664000175000017500000000402415201026231032371 0ustar00zuulzuul# Set DIB_DISTRIBUTION_MIRROR and related if running in openstack gate # don't spam logs with this source _xtrace=$(set +o | grep xtrace) set +o xtrace if [ -f /etc/ci/mirror_info.sh ]; then # outside chroot mirror_info=/etc/ci/mirror_info.sh elif [ -f /tmp/in_target.d/mirror_info.sh ]; then # inside chroot mirror_info=/tmp/in_target.d/mirror_info.sh else echo "No mirror file found. Not an OpenStack CI node?" return 0 fi source $mirror_info $_xtrace # note 11- is after 10- which is where DISTRO_NAME is set usually if [[ "${DISTRO_NAME}" == "ubuntu" ]]; then if [[ "${ARCH}" == "arm64" ]]; then export DIB_DISTRIBUTION_MIRROR=${NODEPOOL_UBUNTU_PORTS_MIRROR} elif [[ "${ARCH}" == "amd64" ]]; then export DIB_DISTRIBUTION_MIRROR=$NODEPOOL_UBUNTU_MIRROR fi export DIB_DEBOOTSTRAP_EXTRA_ARGS+=" --no-check-gpg" elif [[ "${DISTRO_NAME}" == "debian" ]]; then export DIB_DISTRIBUTION_MIRROR=$NODEPOOL_DEBIAN_MIRROR export DIB_DEBOOTSTRAP_EXTRA_ARGS+=" --no-check-gpg" elif [[ "${DISTRO_NAME}" == "centos" ]]; then if [[ "${DIB_RELEASE}" == '9-stream' ]]; then export DIB_DISTRIBUTION_MIRROR=$NODEPOOL_CENTOS_MIRROR export DIB_EPEL_MIRROR=$NODEPOOL_EPEL_MIRROR fi elif [[ "${DISTRO_NAME}" == "opensuse" ]]; then export DIB_DISTRIBUTION_MIRROR=$NODEPOOL_OPENSUSE_MIRROR fi # Infra doesn't mirror non-free repos, so instruct to ignore these export DIB_DISTRIBUTION_MIRROR_UBUNTU_IGNORE="(universe|multiverse)" export DIB_DISTRIBUTION_MIRROR_UBUNTU_INSECURE=1 # These repo files are pre-created for the fedora/centos-minimal jobs # in the gate. Not relevant inside the chroot. if [[ -d ${DIB_OS_CI_YUM_REPOS:-/not/a/path/} ]]; then if [[ "${DISTRO_NAME}" == "centos" ]]; then export DIB_YUM_MINIMAL_BOOTSTRAP_REPOS=${DIB_OS_CI_YUM_REPOS}/centos-minimal/${DIB_RELEASE}/yum.repos.d elif [[ "${DISTRO_NAME}" == "openeuler" ]]; then export DIB_YUM_MINIMAL_BOOTSTRAP_REPOS=${DIB_OS_CI_YUM_REPOS}/openeuler-minimal/${DIB_RELEASE}/yum.repos.d fi fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3772376 diskimage_builder-3.42.0/diskimage_builder/elements/openstack-ci-mirrors/extra-data.d/0000775000175000017500000000000015201026275027673 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021100000000000010207 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/openstack-ci-mirrors/extra-data.d/75-copy-mirror-info 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openstack-ci-mirrors/extra-data.d/75-copy-mirror0000775000175000017500000000056415201026231032331 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # On infra nodes, make a copy of the mirror_info.sh script inside the # chroot for elements running in chroot like EPEL that want to # reference it. mirror_info=/etc/ci/mirror_info.sh if [ -f $mirror_info ]; then cp /etc/ci/mirror_info.sh $TMP_HOOKS_PATH/mirror_info.sh fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3772376 diskimage_builder-3.42.0/diskimage_builder/elements/openstack-ci-mirrors/root.d/0000775000175000017500000000000015201026275026624 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/openstack-ci-mirrors/root.d/10-apt-disable-gpg0000775000175000017500000000212115201026231031714 0ustar00zuulzuul#!/bin/bash # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # dib-lint: disable=safe_sudo if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # Disable gpg signing for apt openstack ci repos are created by reprepro # and not signed. # This has to be after debootstrap, but before anything else tries to # use the mirror. APT_DIR=${TARGET_ROOT}/etc/apt/apt.conf.d if [ -d ${APT_DIR} ]; then FILE=${APT_DIR}/99unauthenticated sudo dd of=${FILE} < will cause the list of packages in that file to be installed at the beginning of the respective phase. If the package name in the file starts with a "-", then that package will be removed at the end of the install.d phase. Using post-install.d for cleanup ================================ Package removal is done in post-install.d at level 95. If you a running cleanup functions before this, you need to be careful not to clean out any temporary files relied upon by this element. For this reason, generally post-install cleanup functions should occupy the higher levels between 96 and 99. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/__init__.py0000664000175000017500000000000015201026231026655 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3802378 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/bin/0000775000175000017500000000000015201026275025336 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/bin/package-installs0000775000175000017500000000301415201026231030474 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail SCRIPTNAME=$(basename $0) function show_options () { echo "Usage: $SCRIPTNAME -d " echo echo "Options:" echo " -d -- directory to search for package-installs-* files" exit 1 } TEMP=$(getopt -o hd: -n $SCRIPTNAME -- "$@") if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi eval set -- "$TEMP" WORKDIR= while true ; do case "$1" in -d) WORKDIR=$2; shift 2;; -h) show_options;; --) shift ; break ;; *) echo "Error: unsupported option $1."; exit 1;; esac done if [ -z "$WORKDIR" ]; then show_options fi PACKAGES= for PACKAGEFILE in $(find $WORKDIR -maxdepth 1 -name "package-installs-*" ); do basefile=$(basename $PACKAGEFILE) element_name=${basefile#"package-installs-"} while read pkg; do if [ -z "$pkg" ]; then continue fi # Ignore comments if [ ${pkg:0:1} = "#" ]; then continue fi if [ ${pkg:0:1} = "-" ]; then pkg=${pkg:1} fi if [ -e /usr/share/pkg-map/$element_name ]; then # map the package to its true name set +e map_pkg=$(pkg-map --element $element_name $pkg) if [ $? -eq 0 ]; then pkg=$map_pkg fi set -e fi PACKAGES="$PACKAGES $pkg" done < $PACKAGEFILE done if [ -n "$PACKAGES" ]; then install-packages $PACKAGES fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/bin/package-installs-squash0000775000175000017500000002067715201026231032014 0ustar00zuulzuul#!/usr/bin/env python3 # Copyright 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import argparse import collections import functools import json import logging import os import re import sys import yaml from diskimage_builder import logging_config logger = logging.getLogger(__name__) def get_element_installtype(element_name): default = os.environ.get("DIB_DEFAULT_INSTALLTYPE", "source") return os.environ.get( "DIB_INSTALLTYPE_%s" % element_name.replace('-', '_'), default) def _is_arch_in_list(strlist): """Checks if os.environ['ARCH'] is in comma separated strlist""" strlist = strlist.split(',') map(str.strip, strlist) return os.environ['ARCH'] in strlist def _valid_for_arch(pkg_name, arch, not_arch): """Filter out incorrect ARCH versions""" if arch is None and not_arch is None: # nothing specified; always OK return True if arch and not_arch: print("package-installs configuration error: arch and not_arch " "given for package [%s]" % pkg_name) sys.exit(1) # if we have an arch list, our current arch must be in it # to install. if arch: return _is_arch_in_list(arch) # if we don't have an explicit arch list, we should # install unless we are in the not-arch list. return not _is_arch_in_list(not_arch) def _when(statements): '''evaulate a when: statement Evaluate statements of the form when: ENVIRONMENT_VARIABLE[!]=value Returns True if the package should be installed, False otherwise If the ENVIRONMENT_VARIABLE is unset, raises an error ''' # No statement means install if statements is None: return True if not isinstance(statements, (list, tuple)): statements = [statements] result = [] for s in statements: # FOO = BAR # var op val match = re.match( r"(?P[\w]+)(\s*)(?P=|!=)(\s*)(?P.*)", s) if not match: print("Malformed when line: <%s>" % s) sys.exit(1) match = match.groupdict() var = match['var'] op = match['op'] val = match['val'] if var not in os.environ: raise RuntimeError("The variable <%s> is not set" % var) logger.debug("... when eval %s%s%s against <%s>" % (var, op, val, os.environ[var])) if op == '=': if val == os.environ[var]: result.append(True) continue elif op == '!=': if val != os.environ[var]: result.append(True) continue else: print("Malformed when op: %s" % op) sys.exit(1) result.append(False) return all(result) def collect_data(data, objs, element_name): for pkg_name, params in objs.items(): if not params: params = [{}] if not isinstance(params, (list, tuple)): params = [params] for param in params: logger.debug("Considering %s/%s param:%s" % (element_name, pkg_name, param)) phase = param.get('phase', 'install.d') installs = ["install"] if 'uninstall' in param or 'build-only' in param: # We don't add the package to the uninstall list if # something else has requested we install it without # removing it. in_install = any( map(lambda x: x[0] == pkg_name, data[phase]["install"])) not_in_uninstall = all( map(lambda x: x[0] != pkg_name, data[phase]["uninstall"])) if in_install and not_in_uninstall: if 'build-only' not in param: # Just skip further processing as we have no uninstall # work to do continue else: if 'uninstall' in param: installs = ["uninstall"] if 'build-only' in param: installs = ["install", "uninstall"] else: # Remove any uninstallations if we are trying to install # the package without uninstallation elsewhere. data[phase]["uninstall"] = [ x for x in data[phase]["uninstall"] if x[0] != pkg_name] # Filter out incorrect installtypes installtype = param.get('installtype', None) elem_installtype = get_element_installtype(element_name) valid_installtype = (installtype is None or installtype == elem_installtype) if not valid_installtype: logger.debug("... skipping due to installtype") continue valid_arch = _valid_for_arch(pkg_name, param.get('arch', None), param.get('not-arch', None)) if not valid_arch: logger.debug("... skipping due to arch match") continue dib_py_version = str(param.get('dib_python_version', '')) dib_py_version_env = os.environ.get('DIB_PYTHON_VERSION', '') valid_dib_python_version = (dib_py_version == '' or dib_py_version == dib_py_version_env) if not valid_dib_python_version: logger.debug("... skipping due to python version") continue # True means install, false skip if _when(param.get('when', None)) is False: logger.debug("... skipped due to when: failures") continue for install in installs: logger.debug("... installing for '%s'" % install) data[phase][install].append((pkg_name, element_name)) return data def main(): parser = argparse.ArgumentParser( description="Produce a single packages-installs file from all of" " the available package-installs files") parser.add_argument('--elements', required=True, help="Which elements to squash") parser.add_argument('--path', required=True, help="Elements path to search for elements") parser.add_argument('outfile', help="Location of the output file") args = parser.parse_args() logging_config.setup() # Replicate the logic of finding the first element, because we can't # operate on the post-copied hooks dir, since we lose element context element_dirs = list() for element_name in args.elements.split(): for elements_dir in args.path.split(':'): potential_path = os.path.join(elements_dir, element_name) if os.path.exists(potential_path): element_dirs.append((elements_dir, element_name)) logger.debug("element_dirs -> %s" % element_dirs) # Collect the merge of all of the existing install files in the elements # that are the first on the ELEMENT_PATH final_dict = collections.defaultdict( functools.partial(collections.defaultdict, list)) for (elements_dir, element_name) in element_dirs: for file_type in ('json', 'yaml'): target_file = os.path.join( elements_dir, element_name, "package-installs.%s" % file_type) if not os.path.exists(target_file): continue logger.info("Squashing install file: %s" % target_file) try: objs = json.load(open(target_file)) except ValueError: objs = yaml.safe_load(open(target_file)) final_dict = collect_data(final_dict, objs, element_name) logger.debug("final_dict -> %s" % final_dict) # Write the resulting file with open(args.outfile, 'w') as outfile: json.dump( final_dict, outfile, indent=True, separators=(',', ': '), sort_keys=False) if __name__ == '__main__': main() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/bin/package-installs-v20000775000175000017500000001146515201026231031032 0ustar00zuulzuul#!/usr/bin/env python3 # Copyright 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import argparse import json import locale import os import subprocess import sys from collections import defaultdict # run a command, return output # if follow is set, output will be echoed to stdout def process_output(cmdline, follow=False): proc = subprocess.Popen(cmdline, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) if follow: print("Running command: %s" % cmdline) out = "" with proc.stdout: for line in iter(proc.stdout.readline, b''): line = line.decode(encoding=locale.getpreferredencoding(False), errors='backslashreplace') out += line print("> %s" % line, end="") proc.wait() print("returncode: %d" % proc.returncode) else: out = proc.communicate()[0].decode(errors='backslashreplace') if proc.returncode: e = subprocess.CalledProcessError(proc.returncode, cmdline) e.output = out raise e return out def main(): dbg_level = int(os.getenv('DIB_DEBUG_TRACE', '0')) parser = argparse.ArgumentParser( description="Install or uninstall packages for a specific phase based" " on package-installs files.") parser.add_argument('--phase', required=True, help="Install phase to filter on. Valid options are" " 'install.d' or pre-install.d") parser.add_argument('--uninstall', action="store_true", help="Only show packages to uninstall. By default only" " packages to install are shown") parser.add_argument('-n', '--noop', action="store_true", help="Don't actually install, just print the command") parser.add_argument('infile', help="File to process") args = parser.parse_args() packages = json.load(open(args.infile)) if args.uninstall: install = "uninstall" else: install = "install" pkgs = list() if args.phase in packages and install in packages[args.phase]: install_packages = packages[args.phase][install] else: print("Nothing to %s" % install) sys.exit(0) # sort the list by element, this way we only do one pkg-map call # per element by_element = defaultdict(list) for (pkg, element) in install_packages: by_element[element].append(pkg) for element, packages in by_element.items(): print("Map %s for %s: %s" % (install, element, ', '.join(packages))) # Only trace pkg-map for higher levels of debugging. Note # that pkg-map debug output comes out on stderr, which is # captured into the output by process_output. We filter by # "prefix" so we don't think the debug lines are packages! pkg_map_args = ['pkg-map', '--prefix', '-', '--missing-ok', '--element', element] if dbg_level > 1: pkg_map_args.append('--debug') pkg_map_args.extend(packages) try: follow = True if dbg_level > 1 else False map_output = process_output(pkg_map_args, follow=follow) map_output = map_output.strip().split('\n') map_output = [m[1:] for m in map_output if m.startswith('-')] pkgs.extend(map_output) except subprocess.CalledProcessError as e: if e.returncode == 1: if args.noop: pkgs.append(pkg) continue else: print("pkg-map failed") sys.exit(1) elif e.returncode == 2: pkgs.append(pkg) continue install_args = ["install-packages"] if args.uninstall: install_args.append("-e") install_args.extend(list(set(pkgs))) if args.noop: print(" ".join(install_args)) else: try: process_output(install_args, follow=True) except subprocess.CalledProcessError as e: print("install-packages failed with returncode %d" % e.returncode) sys.exit(1) if __name__ == '__main__': main() # Tell emacs to use python-mode # Local variables: # mode: python # End: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/bin/package-uninstalls0000775000175000017500000000261115201026231031041 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail SCRIPTNAME=$(basename $0) function show_options () { echo "Usage: $SCRIPTNAME -d " echo echo "Options:" echo " -d -- directory to search for package-uninstalls-* files" exit 1 } TEMP=$(getopt -o hd: -n $SCRIPTNAME -- "$@") if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi eval set -- "$TEMP" WORKDIR= while true ; do case "$1" in -d) WORKDIR=$2; shift 2;; -h) show_options;; --) shift ; break ;; *) echo "Error: unsupported option $1."; exit 1;; esac done if [ -z "$WORKDIR" ]; then show_options fi PACKAGES= for PACKAGEFILE in $(find $WORKDIR -maxdepth 1 -name "package-installs-*" ); do basefile=$(basename $PACKAGEFILE) element_name=${basefile#"package-installs-"} while read pkg; do if [ -z "$pkg" ]; then continue fi # Ignore comments if [ ${pkg:0:1} = "#" ]; then continue fi if [ ! ${pkg:0:1} = "-" ]; then continue fi if [ -e /usr/share/pkg-map/$element_name ]; then # map the package to its true name pkg=$(pkg-map --element $element_name $pkg) fi pkg=${pkg:1} PACKAGES="$PACKAGES $pkg" done < $PACKAGEFILE done install-packages -e $PACKAGES ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/element-deps0000664000175000017500000000002415201026231027057 0ustar00zuulzuulinstall-bin pkg-map ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3802378 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/extra-data.d/0000775000175000017500000000000015201026275027042 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/extra-data.d/99-squash-package-install 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/extra-data.d/99-squash-package-0000775000175000017500000000037615201026231032177 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail sudo -E $DIB_PYTHON_EXEC $(dirname $0)/../bin/package-installs-squash --elements="$IMAGE_ELEMENT" --path=$ELEMENTS_PATH $TMP_MOUNT_PATH/tmp/package-installs.json ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3802378 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/install.d/0000775000175000017500000000000015201026275026456 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/install.d/01-package-installs0000775000175000017500000000030015201026231032025 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail package-installs -d $(dirname $0) package-installs-v2 --phase install.d /tmp/package-installs.json ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/install.d/99-package-uninstalls0000775000175000017500000000031615201026231032420 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail package-uninstalls -d $(dirname $0) package-installs-v2 --phase install.d --uninstall /tmp/package-installs.json ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3812377 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/post-install.d/0000775000175000017500000000000015201026275027441 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/post-install.d/00-package-installs 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/post-install.d/00-package-insta0000775000175000017500000000030515201026231032301 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail package-installs -d $(dirname $0) package-installs-v2 --phase post-install.d /tmp/package-installs.json ././@PaxHeader0000000000000000000000000000021100000000000010207 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/post-install.d/95-package-uninstalls 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/post-install.d/95-package-unins0000775000175000017500000000032315201026231032335 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail package-uninstalls -d $(dirname $0) package-installs-v2 --phase post-install.d --uninstall /tmp/package-installs.json ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3812377 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/pre-install.d/0000775000175000017500000000000015201026275027242 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020600000000000010213 xustar00112 path=diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/pre-install.d/10-package-installs 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/pre-install.d/10-package-instal0000775000175000017500000000030415201026231032256 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail package-installs -d $(dirname $0) package-installs-v2 --phase pre-install.d /tmp/package-installs.json ././@PaxHeader0000000000000000000000000000021000000000000010206 xustar00114 path=diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/pre-install.d/99-package-uninstalls 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/pre-install.d/99-package-uninst0000775000175000017500000000032215201026231032325 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail package-uninstalls -d $(dirname $0) package-installs-v2 --phase pre-install.d --uninstall /tmp/package-installs.json ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3812377 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/tests/0000775000175000017500000000000015201026275025730 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/tests/__init__.py0000664000175000017500000000000015201026231030017 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/package-installs/tests/test_package_squash.py0000664000175000017500000002237715201026231032323 0ustar00zuulzuul# Copyright 2018 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import collections import functools import importlib import os import sys from unittest import mock from oslotest import base from testtools.matchers import Mismatch importlib.machinery.SOURCE_SUFFIXES.append('') file_path = (os.path.dirname(os.path.realpath(__file__)) + '/../bin/package-installs-squash') spec = importlib.util.spec_from_file_location('installs_squash', file_path) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) sys.modules['installs_squash'] = module installs_squash = module importlib.machinery.SOURCE_SUFFIXES.pop() class IsMatchingInstallList(object): def __init__(self, expected): self.expected = expected def match(self, actual): for phase, ops in self.expected.items(): if phase not in actual: # missing the phase return Mismatch( "Phase %d does not exist in %s" % (phase, actual)) for op, pkgs in ops.items(): if op not in actual[phase]: # missing op (install/uninstall) return Mismatch( "Operation %s does not exist in %s" % (op, ops)) # on py2 these can be out of order, we just want a match expected_phase_ops = sorted(self.expected[phase][op]) actual_phase_ops = sorted(actual[phase][op]) if expected_phase_ops != actual_phase_ops: return Mismatch( "Operation list %s does not match expected %s" % (actual[phase][op], self.expected[phase][op])) class TestPackageInstall(base.BaseTestCase): def setUp(self): super(TestPackageInstall, self).setUp() self.final_dict = collections.defaultdict( functools.partial(collections.defaultdict, list)) def test_simple(self): '''Test a basic package install''' objs = { 'test_package': '' } result = installs_squash.collect_data( self.final_dict, objs, 'test_element') expected = { 'install.d': { 'install': [('test_package', 'test_element')] } } self.assertThat(result, IsMatchingInstallList(expected)) @mock.patch.object(os, 'environ', dict(ARCH='arm64')) def test_arch(self): '''Exercise the arch and not-arch flags''' objs = { 'test_package': '', 'test_arm64_package': { 'arch': 'arm64' }, 'do_not_install': { 'not-arch': 'arm64' } } result = installs_squash.collect_data( self.final_dict, objs, 'test_element') expected = { 'install.d': { 'install': [('test_package', 'test_element'), ('test_arm64_package', 'test_element')] } } self.assertThat(result, IsMatchingInstallList(expected)) kernel_objs = { 'linux-image-generic': [ { 'not-arch': 'arm64', 'when': 'DIB_UBUNTU_KERNEL = linux-image-generic', }, { 'arch': 'arm64', 'when': ( 'DIB_RELEASE != xenial', 'DIB_UBUNTU_KERNEL = linux-image-generic', ) }, ], 'linux-generic-hwe-16.04': { 'arch': 'arm64', 'when': ( 'DIB_RELEASE = xenial', 'DIB_UBUNTU_KERNEL = linux-image-generic', ) }, } def _test_kernel_objs_match(self, arch, release, expected): with mock.patch.object(os, 'environ', dict(ARCH=arch, DIB_UBUNTU_KERNEL='linux-image-generic', DIB_RELEASE=release)): result = installs_squash.collect_data( self.final_dict, self.kernel_objs, 'test_element') expected = { 'install.d': { 'install': [(expected, 'test_element')] } } self.assertThat(result, IsMatchingInstallList(expected)) def test_param_list_x86(self): self._test_kernel_objs_match('x86_64', 'focal', 'linux-image-generic') def test_param_list_arm64_xenial(self): self._test_kernel_objs_match('arm64', 'xenial', 'linux-generic-hwe-16.04') def test_param_list_arm64_focal(self): self._test_kernel_objs_match('arm64', 'focal', 'linux-image-generic') @mock.patch.object(os, 'environ', dict(DIB_FEATURE='1', **os.environ)) def test_skip_when(self): '''Exercise the when flag''' objs = { 'skipped_package': { 'when': 'DIB_FEATURE=0' }, 'not_skipped_package': { 'when': 'DIB_FEATURE=1' }, 'not_equal_package': { 'when': 'DIB_FEATURE!=0' }, 'not_equal_skipped_package': { 'when': 'DIB_FEATURE!=1' }, } result = installs_squash.collect_data( self.final_dict, objs, 'test_element') expected = { 'install.d': { 'install': [('not_skipped_package', 'test_element'), ('not_equal_package', 'test_element')] } } self.assertThat(result, IsMatchingInstallList(expected)) def test_skip_no_var(self): '''Exercise the skip_when missing variable failure case''' objs = { 'package': { 'when': 'MISSING_VAR=1' }, } self.assertRaises(RuntimeError, installs_squash.collect_data, self.final_dict, objs, 'test_element') @mock.patch.object(os, 'environ', dict( DIB_A_FEATURE='1', DIB_B_FEATURE='1', DIB_C_FEATURE='1')) def test_skip_when_list(self): '''Exercise the when flag with lists''' objs = { 'not_skipped_package': { 'when': [ 'DIB_A_FEATURE=1', 'DIB_B_FEATURE=1', 'DIB_C_FEATURE=1' ] }, 'skipped_package': { 'when': [ 'DIB_A_FEATURE=1', 'DIB_B_FEATURE=0', 'DIB_C_FEATURE=1', ] }, } result = installs_squash.collect_data( self.final_dict, objs, 'test_element') expected = { 'install.d': { 'install': [('not_skipped_package', 'test_element')] } } self.assertThat(result, IsMatchingInstallList(expected)) def test_install_overrides_uninstall_install_first(self): '''Test an install overrides uninstall''' objs = { 'test_package': '' } result = installs_squash.collect_data( self.final_dict, objs, 'test_element1') expected = { 'install.d': { 'install': [('test_package', 'test_element1')] } } self.assertThat(result, IsMatchingInstallList(expected)) objs = { 'test_package': {'build-only': 'true'} } result = installs_squash.collect_data( self.final_dict, objs, 'test_element2') expected = { 'install.d': { 'install': [('test_package', 'test_element1'), ('test_package', 'test_element2')] } } self.assertThat(result, IsMatchingInstallList(expected)) def test_install_overrides_uninstall_uninstall_first(self): '''Test an install overrides uninstall''' objs = { 'test_package': {'build-only': 'true'} } result = installs_squash.collect_data( self.final_dict, objs, 'test_element1') expected = { 'install.d': { 'install': [('test_package', 'test_element1')], 'uninstall': [('test_package', 'test_element1')] } } self.assertThat(result, IsMatchingInstallList(expected)) objs = { 'test_package': '' } result = installs_squash.collect_data( self.final_dict, objs, 'test_element2') expected = { 'install.d': { 'install': [('test_package', 'test_element1'), ('test_package', 'test_element2')] } } self.assertThat(result, IsMatchingInstallList(expected)) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3822377 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/0000775000175000017500000000000015201026275025071 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/README.rst0000664000175000017500000001010615201026231026546 0ustar00zuulzuul================== pip-and-virtualenv ================== This element installs pip and virtualenv in the image. Package install =============== If the package installtype is used then these programs are installed from distribution packages. In this case, ``pip`` and ``virtualenv`` will be installed *only* for the python version identified by ``dib-python`` (i.e. the default python for the platform). Namespacing of the tools will be up to your distribution. Some distribution packages have worked out name-spacing such that only python2 or python3 owns common scripts like ``/usr/bin/pip`` (on most platforms, ``pip`` refers to python2 pip, and ``pip3`` refers to python3 pip, although some may choose the reverse). Other platforms have avoided making a decision and require explicit version suffixes. To install pip and virtualenv from package:: export DIB_INSTALLTYPE_pip_and_virtualenv=package Source install ============== .. note:: For source installs this element setups and Python 2 and Python 3 environments. This means it will bring in python2 packages, so isn't appropriate if you want a python3 only environment. .. note:: Source install is considered deprecated for several reasons. Because it makes for a hetrogenous environment between distro packaged tools and upstream it means the final images create bespoke environments that make standarised testing difficult. The tricks used around holding packages to overwrite them cause difficulty for users of images. This also brings in Python 2 unconditonally, something not wanted on modern Python 3 only distributions. Source install is the default on most platforms for historical purposes. The current exception(s) are RHEL8 and CentOS 8. If the source installtype is used, ``pip`` and ``virtualenv`` are installed from the latest upstream releases. Source installs from upstream releases are not name-spaced. It is inconsistent across platforms if the first or last install will own common scripts like ``/usr/bin/pip`` and ``virtualenv``. To avoid inconsistency, we firstly install the packaged python 2 **and** 3 versions of ``pip`` and ``virtualenv``. This prevents a later install of these distribution packages conflicting with the source install. We then overwrite ``pip`` and ``virtualenv`` via ``get-pip.py`` and ``pip`` respectively. The system will be left in the following state: * ``/usr/bin/pip`` : python2 pip * ``/usr/bin/pip2`` : python2 pip (same as prior) * ``/usr/bin/pip3`` : python3 pip * ``/usr/bin/virtualenv`` : python2 virtualenv (note python3 ``virtualenv`` script is *not* installed, see below) Source install is supported on limited platforms. See the code, but this includes Ubuntu and RedHat platforms. Environment Variables ===================== To simplify the common-case of "install a package" or "create a virtualenv" with the default system Python, the following variables are exported by this element: * ``DIB_PYTHON_PIP`` * ``DIB_PYTHON_VIRTUALENV`` This will create/install using the ``dib-python`` version for the platform (i.e. python2 for older distros, python3 for modern distros). Note that on Python 3 platforms it will use the inbuilt ``venv`` (rather than the ``virtualenv`` package -- if you absolutely need features only ``virtualenv`` provides you should call it directly in your element; see below). Explicit use of the tools ========================= Due to the essentially unsolvable problem of "who owns the script", it is recommended to *not* call ``pip`` or ``virtualenv`` directly. You can directly call them with the ``-m`` argument to the python interpreter you wish to install with. For example, to create a python3 environment do:: # python3 -m virtualenv myenv # myenv/bin/pip install mytool To install a python2 tool from pip:: # python2 -m pip install mytool In this way, you can always know which interpreter is being used (and affected by) the call. Ordering ======== Any element that uses these commands must be designated as 05-* or higher to ensure that they are first installed. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/element-deps0000664000175000017500000000010315201026231027360 0ustar00zuulzuuldib-python epel install-types package-installs source-repositories ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3822377 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/environment.d/0000775000175000017500000000000015201026275027657 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022700000000000010216 xustar00129 path=diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/environment.d/51-pip-and-virutalenv-default.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/environment.d/51-pip-and-viru0000664000175000017500000000257315201026231032337 0ustar00zuulzuul# Due to the many historical problems mixing python2/3 versions and # upgrading packaged system pip/setuptools/virtualenv binaries with # upstream non-packaged versions, we wish to avoid this completely on # modern distros. if [[ $DISTRO_NAME =~ (centos|rhel) ]]; then export DIB_INSTALLTYPE_pip_and_virtualenv=${DIB_INSTALLTYPE_pip_and_virtualenv:-package} if [[ ${DIB_INSTALLTYPE_pip_and_virtualenv} == "source" ]]; then echo "*** pip-and-virtualenv does not support 'source' install for $DISTRO_NAME/$DIB_RELEASE" exit 1 fi fi # The default variables setup below are only useful during the phases # that dib-python exists if [[ ! -e /usr/local/bin/dib-python ]]; then return 0 fi # NOTE(ianw): you don't want to call "dib-python -m pip" because that # can leave behind interpreters #!/usr/local/bin/dib-python in # scripts. De-reference the link _dib_python_path=$(readlink /usr/local/bin/dib-python) export DIB_PYTHON_PIP="$_dib_python_path -m pip" # We make an opinionated, but simplifying decision here that on # Python3 platforms, just use venv. There are some corner cases that # the external "virtualenv" package still handles better, but for most # purposes "venv" should be fine. if [[ $DIB_PYTHON_VERSION == 3 ]]; then export DIB_PYTHON_VIRTUALENV="$_dib_python_path -m venv" else export DIB_PYTHON_VIRTUALENV="$_dib_python_path -m virtualenv" fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2792356 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/install.d/0000775000175000017500000000000015201026275026761 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023100000000000010211 xustar00125 path=diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/ 28 mtime=1778658493.3822377 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-0000775000175000017500000000000015201026275032504 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000024100000000000010212 xustar00139 path=diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-0000775000175000017500000002444115201026231032506 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # NOTES on pip install functions # It's all installed into /usr/local/bin so override any packages, even # if installed later. # NOTE(dpawlik): The get-pip.py script is not based on master release. # Ensure that uses the latest available version. function install_python3_pip { python3 /tmp/get-pip.py $pip_args python3 -m pip install $pip_args pip pip3 install $pip_args virtualenv } function install_python2_pip { python2 /tmp/get-pip.py $pip_args python2 -m pip install $pip_args pip pip install $pip_args virtualenv } # force things to happen so our assumptions hold pip_args="-U --force-reinstall" if [[ $DISTRO_NAME =~ (opensuse|fedora|centos|rhel) ]]; then # Default packages _do_py3=0 _extra_repo='' # see notes below on this var... _clear_old_files=0 case "$DISTRO_NAME" in centos*) # note python2-pip in epel _extra_repo="--enablerepo=epel" packages="python-virtualenv python2-pip" if [[ "$(rpm -q --qf '[%{obsoletes}\n]' python2-setuptools)" == "python-setuptools" ]]; then # If OpenStack release is installed, then python-setuptools is # obsoleted by python2-setuptools packages+=" python2-setuptools" else packages+=" python-setuptools" fi # see notes below _clear_old_files=1 ;; fedora) if [[ ${DIB_RELEASE} -gt 30 ]]; then echo "This element is not supported for this version of Fedora" exit 1 fi _do_py3=1 packages="python2-pip python2-setuptools" packages+=" python3-virtualenv python3-pip python3-setuptools" ;; rhel) case "$DIB_RELEASE" in 8) _do_py3=1 _clear_old_files=0 packages=" python3-virtualenv python3-pip python3-setuptools" ;; esac ;; opensuse) case "$DIB_RELEASE" in 42*) packages="python-virtualenv python-pip python-setuptools" _clear_old_files=1 ;; 15*) _do_py3=1 _clear_old_files=1 # python*-six gets dragged in, and then is a # distutils package and won't uninstall. put it # here so it gets cleaned. packages="python2-virtualenv python2-pip python2-setuptools python2-six" packages+=" python3-virtualenv python3-pip python3-setuptools python3-six" ;; tumbleweed) echo "This element is not supported for this platform" exit 1 ;; esac ;; esac # GENERAL WARNING : mixing packaged python libraries with # pip-installed versions always creates issues. Upstream # openstack-infra uses this a lot (especially devstack) but be # warned: here be dragons :) # Firstly we want to install the system packages. Otherwise later # on somebody does a "yum install python-virtualenv" and goes and # overwrites the pip installed version with the packaged version, # leading to all sorts of weird version issues. if [[ $DISTRO_NAME = opensuse ]]; then zypper -n install $packages else ${YUM:-yum} ${_extra_repo} install -y $packages fi # pip10 onwards (unlike earlier versions) will not uninstall # packages installed by distutils (note this is only a subset of # packages that don't use setuptools for various reasons; the # problem is essentially they do not include a manifest of files # in the package to delete, so pip was just guessing). We give it # a little help by clearing out the files from the packages we are # about to re-install so pip doesn't think anything is installed. # See: https://github.com/pypa/pip/issues/4805 # # This is only necessary on old CentOS and suse -- for complicated # reasons of course. On Fedora, the Python2 virtualenv packages # are *not* distutils based and pip overwrites them correctly. # For python3, pip has changed to not overwrite system packages (a # long standing difference between Debuntu and Fedora), but a # number of tools run with "python3 -Es" to isolate themselves to # the package installed versions. So we definitely don't want to # clear the packaged versions out in that case. if [[ ${_clear_old_files} == 1 ]]; then for pkg in $packages; do rpm -ql $pkg | xargs rm -rf done fi # install the latest python2 pip; this overwrites packaged pip # NOTE(dpawlik) The get-pip.py script is not base on master release. # Ensure that is uses latest available version. python /tmp/get-pip.py ${pip_args} python -m pip install ${pip_args} pip # Install latest setuptools; there is a slight chicken-egg issue in # that pip requires setuptools for some operations like building a # wheel. But this simple install should be fine. pip install ${pip_args} setuptools if [[ $_do_py3 -eq 1 ]]; then # Repeat above for python3 # python2 on fedora always installs into /usr/bin. Move pip2 # binary out, as we want "pip" in the final image to be # python2 for historical reasons. mv /usr/bin/pip /usr/bin/pip2 # You would think that installing python3 bits first, then # python2 would work -- alas get-pip.py doesn't seem to leave # python3 alone: # https://github.com/pypa/pip/issues/4435 # NOTE(dpawlik) The get-pip.py script is not base on master release. # Ensure that is uses latest available version. python3 /tmp/get-pip.py ${pip_args} python3 -m pip install ${pip_args} pip pip3 install ${pip_args} setuptools # on < 27, this installed pip3 to /usr/bin/pip. On >=27 it's # /usr/local/bin/pip. reclaim /usr/bin/pip back to pip2 and # remove the /usr/local/bin/pip (i.e. python3 version) if it # exists, so that "pip" calls pip2 always. if we want pip3 we # call it explicitly. ln -sf /usr/bin/pip2 /usr/bin/pip rm -f /usr/local/bin/pip # So on Fedora, there are now supposed to be two versions of # python3 setuptools installed; the one installed by pip in # /usr/local and the one installed by the system # python3-setuptools rpm package in /usr/local. The idea is # that packaged python tools use the "system" python (with -Es # flag) and are isolated from pip installs ... except there is # an issue where pip clears out the RPM version files before # installing it's isolated version: # https://bugzilla.redhat.com/show_bug.cgi?id=1550368 # # Thus we need to *reinstall* the RPM version now, so those # files come back and system tools continue to work if [[ $DISTRO_NAME != opensuse ]]; then dnf reinstall -y python3-setuptools fi fi # now install latest virtualenv. it vendors stuff it needs so # doesn't have issues with other system packages. # python[2|3]-virtualenv package has installed versioned scripts # (/usr/bin/virtualenv-[2|3]) but upstream does not! (see [2]). # For consistency, reinstall so we're just left with python2's # version. Note this is a rather moot point, the usual way we get # a python3 environment is to call "virtualenv -p python3 foo" and # that works to create a python3 virtualenv, even if using # python2's version. Thus we probably don't *really* need to # "pip3 install virtualenv". What we don't want is "virtualenv # foo" creating a python3 virtualenv by default, because that # confuses a lot of legacy code. # #[2] http://pkgs.fedoraproject.org/cgit/rpms/python-virtualenv.git/tree/python-virtualenv.spec#n116) pip install ${pip_args} virtualenv mv /usr/bin/virtualenv /usr/bin/virtualenv2 if [[ $_do_py3 -eq 1 ]]; then pip3 install ${pip_args} virtualenv fi # Reclaim virtualenv to virtualenv2; similar to above, on fedora # >27 the pip3 version has gone into /usr/local/bin; remove it so # only /usr/bin/virtualenv exists ln -sf /usr/bin/virtualenv2 /usr/bin/virtualenv rm -f /usr/local/bin/virtualenv # at this point, we should have the latest # pip/setuptools/virtualenv packages for python2 & 3, and # "/usr/bin/pip" and "/usr/bin/virtualenv" should be python2 # versions. if [[ $DISTRO_NAME = opensuse ]]; then for pkg in virtualenv pip setuptools; do cat - >> /etc/zypp/locks <> ${conf} fi elif [[ $DISTRO_NAME = gentoo ]]; then packages="dev-python/pip dev-python/virtualenv" emerge -U $packages elif [[ $DIB_RELEASE = bullseye ]]; then packages="python3-pip python3-virtualenv" apt-get -y install $packages install_python3_pip else # pre-install packages so dependencies are there. We will # overwrite with latest below. packages="python-pip python-virtualenv" # Unfortunately older ubuntu (trusty) doesn't have a # python3-virtualenv package -- it seems it wasn't ready at the # time and you had to use "python -m venv". Since then virtualenv # has gained 3.4 support so the pip install below will work if [[ ${DIB_PYTHON_VERSION} == 3 ]]; then packages+=" python3-pip python3-virtualenv" fi apt-get -y install $packages install_python2_pip if [[ ${DIB_PYTHON_VERSION} == 3 ]]; then install_python3_pip fi fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/package-installs.yaml0000664000175000017500000000176515201026231031200 0ustar00zuulzuul# The python-xml and python3 openSUSE packages contain core python modules # such as the XML one but the python devel packages do not pull them. As # such we need to install them during the pre-install.d phase so they are # available as early as possible. See # - https://bugzilla.suse.com/show_bug.cgi?id=1046990 # - https://review.opendev.org/#/c/478648/ # - https://review.opendev.org/#/c/478650/ # for discussions about this issue. python-xml: phase: pre-install.d dib_python_version: 2 python3: phase: pre-install.d installtype: package dib_python_version: 3 python-pip: installtype: package dib_python_version: 2 python3-pip: installtype: package dib_python_version: 3 python-virtualenv: installtype: package dib_python_version: 2 python3-virtualenv: installtype: package dib_python_version: 3 python-dev: installtype: source dib_python_version: 2 python3-dev: installtype: source dib_python_version: 3 # Separate package on debubuntu python3-venv: dib_python_version: 3 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/pkg-map0000664000175000017500000000145115201026231026341 0ustar00zuulzuul{ "release": { "rhel": { "8": { "python3-dev": "platform-python-devel" } } }, "family": { "debian": { "python3-venv": "python3-venv" }, "gentoo": { "python-pip": "dev-python/pip", "python3-pip": "dev-python/pip", "python-virtualenv": "dev-python/virtualenv", "python3-virtualenv": "dev-python/virtualenv", "python-dev": "dev-lang/python", "python3-dev": "dev-lang/python" }, "suse": { "python-xml": "python-xml", "python-dev": "python-devel", "python3-dev": "python3-devel", "python3": "python3" }, "redhat": { "python-dev": "python2-devel", "python3-dev": "python3-devel" } }, "default": { "python-xml": "", "python3": "", "python3-venv": "" } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3822377 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/post-install.d/0000775000175000017500000000000015201026275027744 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/post-install.d/89-clean-up-pip-cache 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/post-install.d/89-clean-up-pi0000775000175000017500000000042015201026231032226 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # TODO(johnsom) Fix this when https://github.com/pypa/pip/issues/4685 is # available. if [ "${DIB_DISABLE_PIP_CLEANUP:-0}" != "1" ]; then rm -rf ~/.cache/pip fi ././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/source-repository-pip-and-virtualenv 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/source-repository-pip-and-vir0000664000175000017500000000040115201026231032640 0ustar00zuulzuul# NOTE(dpawlik) We set get-pip.py script to use 3.5 version, that is compatible # with python2.7 and newer. It should be removed in the future, when Python 2 # is dropped. pip-and-virtualenv file /tmp/get-pip.py https://bootstrap.pypa.io/pip/3.5/get-pip.py ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2802355 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/0000775000175000017500000000000015201026275027662 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022100000000000010210 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-fedora/ 28 mtime=1778658493.3822377 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-0000775000175000017500000000000015201026275032624 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022700000000000010216 xustar00129 path=diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-fedora/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-0000664000175000017500000000004415201026231032614 0ustar00zuulzuulfedora-minimal openstack-ci-mirrors ././@PaxHeader0000000000000000000000000000023700000000000010217 xustar00131 path=diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-fedora/environment.d/ 28 mtime=1778658493.3822377 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-0000775000175000017500000000000015201026275032624 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000030100000000000010207 xustar00171 path=diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-fedora/environment.d/10-source-installtype-pip-and-virtualenv 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-0000664000175000017500000000006115201026231032613 0ustar00zuulzuulexport DIB_INSTALLTYPE_pip_and_virtualenv=source ././@PaxHeader0000000000000000000000000000022300000000000010212 xustar00119 path=diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-opensuse/ 28 mtime=1778658493.3822377 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-0000775000175000017500000000000015201026275032624 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023100000000000010211 xustar00131 path=diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-opensuse/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-0000664000175000017500000000004715201026231032617 0ustar00zuulzuulopenstack-ci-mirrors opensuse-minimal ././@PaxHeader0000000000000000000000000000024100000000000010212 xustar00133 path=diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-opensuse/environment.d/ 28 mtime=1778658493.3822377 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-0000775000175000017500000000000015201026275032624 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000030300000000000010211 xustar00173 path=diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-opensuse/environment.d/10-source-installtype-pip-and-virtualenv 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-0000664000175000017500000000006115201026231032613 0ustar00zuulzuulexport DIB_INSTALLTYPE_pip_and_virtualenv=source ././@PaxHeader0000000000000000000000000000022100000000000010210 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-ubuntu/ 28 mtime=1778658493.3822377 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-0000775000175000017500000000000015201026275032624 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022700000000000010216 xustar00129 path=diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-ubuntu/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-0000664000175000017500000000004415201026231032614 0ustar00zuulzuulopenstack-ci-mirrors ubuntu-minimal ././@PaxHeader0000000000000000000000000000023700000000000010217 xustar00131 path=diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-ubuntu/environment.d/ 28 mtime=1778658493.3832378 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-0000775000175000017500000000000015201026275032624 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000030100000000000010207 xustar00171 path=diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-ubuntu/environment.d/10-source-installtype-pip-and-virtualenv 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-0000664000175000017500000000006115201026231032613 0ustar00zuulzuulexport DIB_INSTALLTYPE_pip_and_virtualenv=source ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3832378 diskimage_builder-3.42.0/diskimage_builder/elements/pip-cache/0000775000175000017500000000000015201026275023175 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pip-cache/README.rst0000664000175000017500000000137015201026231024655 0ustar00zuulzuul========= pip-cache ========= # Use a cache for pip Using a download cache speeds up image builds. Including this element in an image build causes $HOME/.cache/image-create/pip to be bind mounted as /tmp/pip inside the image build chroot. The $PIP_DOWNLOAD_CACHE environment variable is then defined as /tmp/pip, which causes pip to cache all downloads to the defined location. Note that pip and its use of $PIP_DOWNLOAD_CACHE is not concurrency safe. Running multiple instances of diskimage-builder concurrently can cause issues. Therefore, it is advised to only have one instance of diskimage-builder that includes the pip-cache element running at a time. The pip concurrency issue is being tracked upstream at https://github.com/pypa/pip/issues/1141 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3832378 diskimage_builder-3.42.0/diskimage_builder/elements/pip-cache/environment.d/0000775000175000017500000000000015201026275025763 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pip-cache/environment.d/10-pip-cache0000664000175000017500000000004315201026231027742 0ustar00zuulzuulexport PIP_DOWNLOAD_CACHE=/tmp/pip ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3832378 diskimage_builder-3.42.0/diskimage_builder/elements/pip-cache/root.d/0000775000175000017500000000000015201026275024402 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pip-cache/root.d/11-pip-cache0000775000175000017500000000037015201026231026370 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail PIP_CACHE_DIR=$DIB_IMAGE_CACHE/pip mkdir -p $PIP_CACHE_DIR sudo mkdir -p $TMP_MOUNT_PATH/tmp/pip sudo mount --bind $PIP_CACHE_DIR $TMP_MOUNT_PATH/tmp/pip ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3832378 diskimage_builder-3.42.0/diskimage_builder/elements/pkg-map/0000775000175000017500000000000015201026275022700 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pkg-map/README.rst0000664000175000017500000000515715201026231024367 0ustar00zuulzuul======= pkg-map ======= Map package names to distro specific packages. Provides the following: * bin/pkg-map:: usage: pkg-map [-h] [--element ELEMENT] [--distro DISTRO] Translate package name to distro specific name. optional arguments: -h, --help show this help message and exit --element ELEMENT The element (namespace) to use for translation. --distro DISTRO The distro name to use for translation. Defaults to DISTRO_NAME --release RELEASE The release to use for translation. Defaults to DIB_RELEASE * Any element may create its own pkg-map JSON config file using the one of 4 sections for the release/distro/family/ and or default. The family is set automatically within pkg-map based on the supplied distro name. Families include: + redhat: includes centos, fedora, openeuler and rhel distros + debian: includes debian and ubuntu distros + suse: includes the opensuse distro The release is a specification of distro; i.e. the distro and release must mach for a translation. The most specific section takes priority. An empty package list can be provided. Example for Nova and Glance (NOTE: using fictitious package names for Fedora and package mapping for suse family to provide a good example!) Example format:: { "release": { "fedora": { "23": { "nova_package": "foo" "bar" } } }, "distro": { "fedora": { "nova_package": "openstack-compute", "glance_package": "openstack-image" } }, "family": { "redhat": { "nova_package": "openstack-nova", "glance_package": "openstack-glance" }, "suse": { "nova_package": "" } }, "default": { "nova_package": "nova", "glance_package": "glance" } } Example commands using this format: pkg-map --element nova-compute --distro fedora nova_package Returns: openstack-compute pkg-map --element nova-compute --distro rhel nova_package Returns: openstack-nova pkg-map --element nova-compute --distro ubuntu nova_package Returns: nova pkg-map --element nova-compute --distro opensuse nova_package Returns: * This output can be used to filter what other tools actually install (install-packages can be modified to use this for example) * Individual pkg-map files live within each element. For example if you are created an Apache element your pkg-map JSON file should be created at elements/apache/pkg-map. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3832378 diskimage_builder-3.42.0/diskimage_builder/elements/pkg-map/bin/0000775000175000017500000000000015201026275023450 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pkg-map/bin/pkg-map0000775000175000017500000001534315201026231024730 0ustar00zuulzuul#!/usr/bin/env python3 # Copyright 2014 Red Hat Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import argparse import json import logging import os import sys log = logging.getLogger() def os_family(distro): family = None if distro in ['almalinux', 'fedora', 'rhel', 'centos', 'openeuler', 'rocky']: family = 'redhat' elif distro in ['debian', 'ubuntu']: family = 'debian' elif distro == 'opensuse': family = 'suse' elif distro == 'gentoo': family = 'gentoo' return family def os_major_release(release): if release in ['8-stream']: return '8' return release def main(): parser = argparse.ArgumentParser( description="Translate package name to distro specific name." " Exits with 1 if error is encountered, 2 if no pkg-map" " file is found. Otherwise exits with 0.") parser.add_argument('--element', default='', help='The element (namespace) to use for translation.') parser.add_argument('--pkg-map', default='', help='Path to specific pkg-map file. ' '(Useful for testing)') parser.add_argument('--distro', default=os.environ.get('DISTRO_NAME'), help='The distro name to use for translation.' ' Defaults to DISTRO_NAME') parser.add_argument('--release', default=os.environ.get('DIB_RELEASE'), help='A more specfic name for distribution release') parser.add_argument('--missing-ok', action="store_true", help='Do not consider missing mappings an error.' ' Causes packages where no mapping is set to be' ' printed.') # This tool has traditionally output status and debug messages on # stderr. The problem is if a caller has stderr > stdout then # actual output gets messed in with the logs. This allows callers # to disambiguate actual output by specifying a unique prefix. parser.add_argument('--prefix', default='', help='Output mapped packages with this prefix') parser.add_argument('--debug', dest='debug', action="store_true", help="Enable debugging output") args, extra = parser.parse_known_args() # Logs have traditionally gone to stderr with this tool. Maintain # compatibility level = logging.DEBUG if args.debug else logging.INFO logging.basicConfig(stream=sys.stderr, level=level) if not args.element and not args.pkg_map: log.error('Please specify an --element argument.') sys.exit(1) if args.element and args.pkg_map: log.error('Specify either --element or --pkg-map') sys.exit(1) if not args.distro: log.error('Please specify a --distro argument or set DISTRO_NAME.') sys.exit(1) if args.pkg_map: # specifying the pkg-map by hand is just for manual testing element = "<%s>" % args.pkg_map map_file = args.pkg_map else: element = args.element map_file = '/usr/share/pkg-map/%s' % element log.info("Mapping for %s : %s" % (element, ' '.join(extra))) if not os.path.exists(map_file): if args.missing_ok: log.info("No package map for %s, done" % element) for name in extra: print('%s%s' % (args.prefix, name)) sys.exit(0) else: log.error('Required pkg-map for %s element does not exist.' % args.element) sys.exit(2) with open(map_file) as fd: try: package_names = json.loads(fd.read()) # log.debug(pprint.pformat(package_names)) except ValueError: log.error('Unable to parse %s' % map_file) raise # Parse mapping data in this form using release/distro/family/default # Most specific takes priority; order is # - release # - distro # - family # - default # An empty package list can be provided. # # Example for Nova and Glance (using fictitious name for Fedora and SUSE # and package mapping for SUSE family) # { # "release": { # "fedora" : { # "23" : { # "nova_package": "openstack-compute-foo" # } # } # } # "distro": { # "fedora": { # "nova_package": "openstack-compute", # "glance_package": "openstack-image" # } # }, # "family": { # "redhat": { # "nova_package": "openstack-nova", # "glance_package": "openstack-glance" # }, # "suse": { # "nova_package": "" # } # }, # "default": { # "nova_package": "nova", # "glance_package": "glance" # } # } name_map = package_names.get('default', {}) if 'family' in package_names: family_map = package_names['family'].get(os_family(args.distro)) if family_map: name_map.update(family_map) if 'distro' in package_names: distro_map = package_names['distro'].get(args.distro) if distro_map: name_map.update(distro_map) if 'release' in package_names: try: # release is a sub-concept of distro release = os_major_release(args.release) release_map = package_names['release'][args.distro][release] name_map.update(release_map) except KeyError: pass # log.debug(pprint.pformat(name_map)) for name in extra: pkg_name = name_map.get(name) if pkg_name: log.debug("map %s -> %s" % (name, pkg_name)) print('%s%s' % (args.prefix, pkg_name)) elif name in name_map: log.debug("map %s -> " % (name)) continue else: if args.missing_ok: log.debug("pass -> %s" % (name)) print('%s%s' % (args.prefix, name)) else: log.error("%s has no valid mapping for package %s" % (element, name)) sys.exit(1) sys.exit(0) if __name__ == '__main__': main() # Tell emacs to use python-mode # Local variables: # mode: python # End: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3832378 diskimage_builder-3.42.0/diskimage_builder/elements/pkg-map/extra-data.d/0000775000175000017500000000000015201026275025154 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pkg-map/extra-data.d/10-create-pkg-map-dir0000775000175000017500000000076115201026231030665 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 1 ]; then set -x fi set -eu set -o pipefail sudo mkdir -p $TMP_MOUNT_PATH/usr/share/pkg-map/ eval declare -A image_elements=($(get_image_element_array)) for i in "${!image_elements[@]}"; do element=$i element_dir=${image_elements[$i]} pkg_map="${element_dir}/pkg-map" if [ -f "${pkg_map}" ]; then echo "Copying pkg-map for ${element}" sudo cp "${pkg_map}" "$TMP_MOUNT_PATH/usr/share/pkg-map/$element" fi done ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3842378 diskimage_builder-3.42.0/diskimage_builder/elements/posix/0000775000175000017500000000000015201026275022506 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/posix/README.rst0000664000175000017500000000074015201026231024166 0ustar00zuulzuulposix ===== * This element installs packages to ensure that the resulting image has binaries necessary to meet the requirements of POSIX, laid out in the following URL: + http://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html * This has been tested to work on Ubuntu, Debian, and CentOS, although should work on Red Hat Enterprise Linux. * To add support for other distros please consult the URL for binaries, then add the providing packages to pkg-map. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/posix/element-deps0000664000175000017500000000001715201026231025001 0ustar00zuulzuulopenssh-server ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/posix/package-installs.yaml0000664000175000017500000000246015201026231026606 0ustar00zuulzuul"admin": "alias": "ar": "asa": "at": "awk": "basename": "batch": "bc": "bg": "c99": "cal": "cat": "cd": "cflow": "chgrp": "chmod": "chown": "cksum": "cmp": "comm": "command": "compress": "cp": "crontab": "csplit": "ctags": "cut": "cxref": "date": "dd": "delta": "df": "diff": "dirname": "du": "echo": "ed": "env": "ex": "expand": "expr": "false": "fc": "fg": "file": "find": "fold": "fort77": "fuser": "gencat": "get": "getconf": "getopts": "grep": "hash": "head": "iconv": "id": "ipcrm": "ipcs": "jobs": "join": "kill": "lex": "link": "ln": "locale": "localedef": "logger": "logname": "lp": "ls": "m4": "mailx": "make": "man": "mesg": "mkdir": "mkfifo": "more": "mv": "newgrp": "nice": "nl": "nm": "nohup": "od": "paste": "patch": "pathchk": "pax": "pr": "printf": "prs": "ps": "pwd": "qalter": "qdel": "qhold": "qmove": "qmsg": "qrerun": "qrls": "qselect": "qsig": "qstat": "qsub": "read": "renice": "rm": "rmdel": "rmdir": "sact": "sccs": "sed": "sh": "sleep": "sort": "split": "strings": "strip": "stty": "tabs": "tail": "talk": "tee": "test": "time": "touch": "tput": "tr": "true": "tsort": "tty": "type": "ulimit": "umask": "unalias": "uname": "uncompress": "unexpand": "unget": "uniq": "unlink": "uucp": "uudecode": "uuencode": "uustat": "uux": "val": "vi": "wait": "wc": "what": "who": "write": "xargs": "yacc": "zcat": ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/posix/pkg-map0000664000175000017500000001727115201026231023765 0ustar00zuulzuul{ "family":{ "debian":{ "admin": "", "alias": "", "ar": "binutils", "asa": "", "at": "at", "awk": "gawk", "basename": "coreutils", "batch": "at", "bc": "bc", "bg": "", "c99": "gcc", "cal": "bsdmainutils", "cat": "coreutils", "cd": "", "cflow": "cflow", "chgrp": "coreutils", "chmod": "coreutils", "chown": "coreutils", "cksum": "coreutils", "cmp": "diffutils", "comm": "coreutils", "command": "", "compress": "ncompress", "cp": "coreutils", "crontab": "cron", "csplit": "coreutils", "ctags": "exuberant-ctags", "cut": "coreutils", "cxref": "cxref", "date": "coreutils", "dd": "coreutils", "delta": "", "df": "coreutils", "diff": "diffutils", "dirname": "coreutils", "du": "coreutils", "echo": "coreutils", "ed": "ed", "env": "coreutils", "ex": "vim", "expand": "coreutils", "expr": "coreutils", "false": "coreutils", "fc": "", "fg": "", "file": "file", "find": "findutils", "fold": "coreutils", "fort77": "fort77", "fuser": "psmisc", "gencat": "libc-dev-bin", "get": "", "getconf": "libc-bin", "getopts": "", "grep": "grep", "hash": "", "head": "coreutils", "iconv": "libc-bin", "id": "coreutils", "ipcrm": "util-linux", "ipcs": "util-linux", "jobs": "", "join": "coreutils", "kill": "procps", "lex": "flex", "link": "coreutils", "ln": "coreutils", "locale": "libc-bin", "localedef": "libc-bin", "logger": "bsdutils", "logname": "coreutils", "lp": "cups-client", "ls": "coreutils", "m4": "m4", "mailx": "mailutils", "make": "make", "man": "man-db", "mesg": "sysvinit-utils", "mkdir": "coreutils", "mkfifo": "coreutils", "more": "util-linux", "mv": "coreutils", "newgrp": "login", "nice": "coreutils", "nl": "coreutils", "nm": "binutils", "nohup": "coreutils", "od": "coreutils", "paste": "coreutils", "patch": "patch", "pathchk": "coreutils", "pax": "pax", "pr": "coreutils", "printf": "coreutils", "prs": "", "ps": "procps", "pwd": "coreutils", "qalter": "", "qdel": "", "qhold": "", "qmove": "", "qmsg": "", "qrerun": "", "qrls": "", "qselect": "", "qsig": "", "qstat": "", "qsub": "", "read": "", "renice": "bsdutils", "rm": "coreutils", "rmdel": "cssc", "rmdir": "coreutils", "sact": "cssc", "sccs": "cssc", "sed": "sed", "sh": "dash", "sleep": "coreutils", "sort": "coreutils", "split": "coreutils", "strings": "binutils", "strip": "binutils", "stty": "coreutils", "tabs": "ncurses-bin", "tail": "coreutils", "talk": "talk", "tee": "coreutils", "test": "coreutils", "time": "", "touch": "coreutils", "tput": "ncurses-bin", "tr": "coreutils", "true": "coreutils", "tsort": "coreutils", "tty": "coreutils", "type": "", "ulimit": "", "umask": "", "unalias": "", "uname": "coreutils", "uncompress": "gzip", "unexpand": "coreutils", "unget": "", "uniq": "coreutils", "unlink": "coreutils", "uucp": "uucp", "uudecode": "sharutils", "uuencode": "sharutils", "uustat": "uucp", "uux": "uucp", "val": "", "vi": "vim", "wait": "", "wc": "coreutils", "what": "", "who": "coreutils", "write": "bsdmainutils", "xargs": "findutils", "yacc": "bison", "zcat": "gzip" }, "redhat":{ "admin": "", "alias": "bash", "ar": "binutils", "asa": "", "at": "at", "awk": "gawk", "basename": "coreutils", "batch": "at", "bc": "bc", "bg": "", "c99": "gcc", "cal": "util-linux", "cat": "coreutils", "cd": "bash", "cflow": "", "chgrp": "coreutils", "chmod": "coreutils", "chown": "coreutils", "cksum": "coreutils", "cmp": "diffutils", "comm": "coreutils", "command": "bash", "compress": "ncompress", "cp": "coreutils", "crontab": "cronie", "csplit": "coreutils", "ctags": "ctags", "cut": "coreutils", "cxref": "", "date": "coreutils", "dd": "coreutils", "delta": "", "df": "coreutils", "diff": "diffutils", "dirname": "coreutils", "du": "coreutils", "echo": "coreutils", "ed": "ed", "env": "coreutils", "ex": "vim-minimal", "expand": "coreutils", "expr": "coreutils", "false": "coreutils", "fc": "", "fg": "", "file": "file", "find": "findutils", "fold": "coreutils", "fort77": "", "fuser": "psmisc", "gencat": "glibc-common", "get": "", "getconf": "glibc-common", "getopts": "bash", "grep": "grep", "hash": "", "head": "coreutils", "iconv": "glibc-common", "id": "coreutils", "ipcrm": "util-linux", "ipcs": "util-linux", "jobs": "bash", "join": "coreutils", "kill": "util-linux", "lex": "flex", "link": "coreutils", "ln": "coreutils", "locale": "glibc-common", "localedef": "", "logger": "util-linux", "logname": "coreutils", "lp": "cups-client", "ls": "coreutils", "m4": "m4", "mailx": "mailx", "make": "make", "man": "man-db", "mesg": "sysvinit-utils", "mkdir": "coreutils", "mkfifo": "coreutils", "more": "util-linux", "mv": "coreutils", "newgrp": "shadow-utils", "nice": "coreutils", "nl": "coreutils", "nm": "binutils", "nohup": "coreutils", "od": "coreutils", "paste": "coreutils", "patch": "patch", "pathchk": "coreutils", "pax": "pax", "pr": "coreutils", "printf": "coreutils", "prs": "", "ps": "procps-ng", "pwd": "coreutils", "qalter": "", "qdel": "", "qhold": "", "qmove": "", "qmsg": "", "qrerun": "", "qrls": "", "qselect": "", "qsig": "", "qstat": "", "qsub": "", "read": "bash", "renice": "util-linux", "rm": "coreutils", "rmdel": "", "rmdir": "coreutils", "sact": "", "sccs": "", "sed": "sed", "sh": "bash", "sleep": "coreutils", "sort": "coreutils", "split": "coreutils", "strings": "binutils", "strip": "binutils", "stty": "coreutils", "tabs": "ncurses-bin", "tail": "coreutils", "talk": "talk", "tee": "coreutils", "test": "coreutils", "time": "", "touch": "coreutils", "tput": "ncurses", "tr": "coreutils", "true": "coreutils", "tsort": "coreutils", "tty": "coreutils", "type": "", "ulimit": "", "umask": "bash", "unalias": "bash", "uname": "coreutils", "uncompress": "ncompress", "unexpand": "coreutils", "unget": "", "uniq": "coreutils", "unlink": "coreutils", "uucp": "", "uudecode": "sharutils", "uuencode": "sharutils", "uustat": "", "uux": "", "val": "", "vi": "vim-minimal", "wait": "bash", "wc": "coreutils", "what": "", "who": "coreutils", "write": "util-linux", "xargs": "findutils", "yacc": "byacc", "zcat": "gzip" } } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3842378 diskimage_builder-3.42.0/diskimage_builder/elements/proliant-tools/0000775000175000017500000000000015201026275024332 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/proliant-tools/README.rst0000664000175000017500000000367315201026231026022 0ustar00zuulzuulproliant-tools ============== * This element can be used when building ironic-python-agent ramdisk. It enables ironic-python-agent ramdisk to do in-band cleaning operations specific to HPE ProLiant hardware. * Works with ubuntu and fedora distributions (on which the ironic-python-agent-ramdisk element is supported). * Currently the following utilities are installed: + `proliantutils`_ - This module registers an ironic-python-agent hardware manager for HPE ProLiant hardware, which implements in-band cleaning steps. The latest version of ``proliantutils`` available is installed. This python module is released with Apache license. + `HPE Smart Storage Administrator (HPE SSA) CLI for Linux 64-bit`_ - This utility is used by ``proliantutils`` library above for doing in-band RAID configuration on HPE ProLiant hardware. Currently installed version is 2.60. Newer version of ``ssacli`` when available, may be installed to the ramdisk by using the environment variable ``DIB_SSACLI_URL``. ``DIB_SSACLI_URL`` should contain the HTTP(S) URL for downloading the RPM package for ``ssacli`` utility. The old environmental variable ``DIB_HPSSACLI_URL``,a HTTP(S) URL for downloading the RPM package for ``hpssacli`` utility, is deprecated. The ``hpssacli`` utility is not supported anymore, use ``ssacli`` instead for the same functionality. Availability of newer versions can be in the Revision History in the above link. This utility is closed source and is released with `HPE End User License Agreement – Enterprise Version`_. .. _`proliantutils`: https://pypi.org/project/proliantutils .. _`HPE Smart Storage Administrator (HPE SSA) CLI for Linux 64-bit`: http://h20564.www2.hpe.com/hpsc/swd/public/detail?swItemId=MTX_5530b3f5b38b4e0781e6bf9c74 .. _`HPE End User License Agreement – Enterprise Version`: https://downloads.hpe.com/pub/softlib2/software1/doc/p1796552785/v113125/eula-en.html ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/proliant-tools/element-deps0000664000175000017500000000004415201026231026625 0ustar00zuulzuulpackage-installs pip-and-virtualenv ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3842378 diskimage_builder-3.42.0/diskimage_builder/elements/proliant-tools/install.d/0000775000175000017500000000000015201026275026222 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020600000000000010213 xustar00112 path=diskimage_builder-3.42.0/diskimage_builder/elements/proliant-tools/install.d/65-proliant-tools-install 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/proliant-tools/install.d/65-proliant-tools-insta0000775000175000017500000000342115201026231032472 0ustar00zuulzuul#!/bin/bash # # Copyright 2015 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail # Set the below variable to allow ssacli to be installed from custom URLs. if [[ -n "${DIB_HPSSACLI_URL:=}" ]]; then echo "The environment variable DIB_HPSSACLI_URL is deprecated; use DIB_SSACLI_URL instead." fi DIB_SSACLI_URL=${DIB_SSACLI_URL:-${DIB_HPSSACLI_URL:-https://downloads.hpe.com/pub/softlib2/software1/pubsw-linux/p1857046646/v122802/ssacli-3.10-3.0.x86_64.rpm}} curl -k -o /tmp/ssacli.rpm $DIB_SSACLI_URL if [[ $DISTRO_NAME = "ubuntu" || $DISTRO_NAME = "debian" ]]; then # There is no deb package for ssacli. Install with alien. alien -i /tmp/ssacli.rpm else rpm -iv /tmp/ssacli.rpm rpm --import https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub fi rm -f /tmp/ssacli.rpm # Install proliantutils python module in the # virtual environment of ironic-python-agent. # This is pre-installed by # ironic-python-agent-ramdisk/install.d/ironic-python-agent-ramdisk-source-install/60-ironic-python-agent-ramdisk-install. IPA_VENV=/opt/ironic-python-agent if [[ -d "$IPA_VENV" ]]; then $IPA_VENV/bin/pip install proliantutils else pip install proliantutils fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/proliant-tools/package-installs.yaml0000664000175000017500000000010315201026231030422 0ustar00zuulzuulalien: gcc: python-dev: unzip: net-tools: binutils: pciutils: tar: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/proliant-tools/pkg-map0000664000175000017500000000054415201026231025604 0ustar00zuulzuul{ "family": { "debian": { "alien": "alien" }, "redhat": { "python-dev": "python2-devel" }, "suse": { "python-dev": "python-devel" } }, "default": { "alien": "", "gcc": "gcc", "python-dev": "python-dev", "unzip": "unzip" } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3842378 diskimage_builder-3.42.0/diskimage_builder/elements/pypi/0000775000175000017500000000000015201026275022325 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pypi/README.rst0000664000175000017500000000452215201026231024007 0ustar00zuulzuul==== pypi ==== ==================== Inject a PyPI mirror ==================== Use a custom PyPI mirror to build images. The default is to bind mount one from ~/.cache/image-create/pypi/mirror into the build environment as mirror URL file:///tmp/pypi. The element temporarily overwrites /root/.pip.conf to use it. When online, the official pypi.python.org pypi index is supplied as an extra-url, so uncached dependencies will still be available. When offline, only the mirror is used - be warned that a stale mirror will cause build failures. To disable the pypi.python.org index without using --offline (e.g. when working behind a corporate firewall that prohibits pypi.python.org) set DIB\_NO\_PYPI\_PIP to any non-empty value. To use an arbitrary mirror set DIB\_PYPI\_MIRROR\_URL=http[s]://somevalue/ Additional mirrors can be added by exporting DIB\_PYPI\_MIRROR\_URL\_1=... etc. NB: The sort order for these variables is a simple string sort - if you have more than 9 additional mirrors, some care will be needed. You can also set the number of retries that occur on failure by setting the DIB\_PIP\_RETRIES environment variable. If setting fallback pip mirrors you typically want to set this to 0 to prevent the need to fail multiple times before falling back. A typical use of this element is thus: export DIB\_PYPI\_MIRROR\_URL=http://site/pypi/Ubuntu-13.10 export DIB\_PYPI\_MIRROR\_URL\_1=http://site/pypi/ export DIB\_PYPI\_MIRROR\_URL\_2=file:///tmp/pypi export DIB\_PIP\_RETRIES=0 [devpi-server](https://pypi.python.org/pypi/devpi-server) can be useful in making a partial PyPI mirror suitable for building images. For instance: * pip install -U devpi * devpi-server quickstart * devpi use http://machinename:3141 * Re-export your variables to point at the new mirror: export DIB\_PYPI\_MIRROR\_URL=http://machinename:3141/ unset DIB\_PYPI\__MIRROR\_URL\_1 unset DIB\_PYPI\__MIRROR\_URL\_2 The next time packages are installed, they'll be cached on the local devpi server; subsequent runs pointed at the same mirror will use the local cache if the upstream can't be contacted. Note that this process only has the server running temporarily; see [Quickstart: Permanent install on server/laptop](https://devpi.net/docs/devpi/devpi/latest/+d/quickstart-server.html) guide from the devpi developers for more information on a more permanent setup. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3842378 diskimage_builder-3.42.0/diskimage_builder/elements/pypi/extra-data.d/0000775000175000017500000000000015201026275024601 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pypi/extra-data.d/00-mount-pypi-mirror0000775000175000017500000000055115201026231030366 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail MIRROR_SOURCE=$DIB_IMAGE_CACHE/pypi/mirror/ if [ -d "$MIRROR_SOURCE" ]; then MIRROR_TARGET=$TMP_MOUNT_PATH/tmp/pypi sudo mkdir -p $MIRROR_SOURCE $MIRROR_TARGET # dib-lint: safe_sudo sudo mount --bind $MIRROR_SOURCE $MIRROR_TARGET # dib-lint: safe_sudo fi ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.385238 diskimage_builder-3.42.0/diskimage_builder/elements/pypi/post-install.d/0000775000175000017500000000000015201026275025200 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pypi/post-install.d/00-unconfigure-pypi-mirror0000775000175000017500000000030015201026231032137 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [ -e ~/.pip/pip.conf.orig ]; then mv ~/.pip/pip.conf{.orig,} else rm ~/.pip/pip.conf fi ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.385238 diskimage_builder-3.42.0/diskimage_builder/elements/pypi/pre-install.d/0000775000175000017500000000000015201026275025001 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/pypi/pre-install.d/04-configure-pypi-mirror0000775000175000017500000000523415201026231031414 0ustar00zuulzuul#!/usr/bin/env python3 # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import os.path from urllib.parse import urlparse def main(): home = os.path.expanduser("~") backup_configs(home) indices = [] if (os.environ.get('DIB_PYPI_MIRROR_URL') or os.environ.get('PYPI_MIRROR_URL')): candidates = [k for k in os.environ if k.startswith('DIB_PYPI_MIRROR_URL')] back_compat = [k for k in os.environ if k.startswith('PYPI_MIRROR_URL')] if len(back_compat) > 0: print('DEPRECATION WARNING: Please use DIB_PYPI_MIRROR_URL* rather' ' than PYPI_MIRROR_URL*') candidates += back_compat indices = list(map(os.environ.get, sorted(candidates))) else: indices = ['file:///tmp/pypi'] print('WARNING: You are using the pypi element but no pypi mirror is ' 'defined via the PYPI_MIRROR_URL env variable') use_pypi_python_org = True if os.environ.get('DIB_OFFLINE'): use_pypi_python_org = False if os.environ.get('DIB_NO_PYPI_PIP'): use_pypi_python_org = False if use_pypi_python_org: indices.append('https://pypi.python.org/simple') retries = os.environ.get('DIB_PIP_RETRIES') with open(home + '/.pip/pip.conf', 'wt') as output: output.write('[global]\n') output.write('log = %s/pip.log\n' % (home,)) output.write('index-url = %s\n' % (indices[0],)) output.write('trusted-host = %s\n' % (urlparse(indices[0]).hostname,)) if retries is not None: output.write('retries = %s\n' % retries) if len(indices) > 1: output.write('extra-index-url =\n') for index in indices[1:]: output.write(' %s\n' % (index,)) def backup_configs(home): pip_dir = home + '/.pip' if not os.path.exists(pip_dir): os.mkdir(pip_dir) if os.path.exists(pip_dir + '/pip.conf'): os.rename(pip_dir + '/pip.conf', pip_dir + '/pip.conf.orig') if os.path.exists(home + '/.pydistutils.cfg'): os.rename(home + '/.pydistutils.cfg', home + '/.pydistutils.cfg.orig') if __name__ == '__main__': main() ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.385238 diskimage_builder-3.42.0/diskimage_builder/elements/python-brickclient/0000775000175000017500000000000015201026275025154 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/python-brickclient/README.rst0000664000175000017500000000343715201026231026642 0ustar00zuulzuulpython-brickclient ================== * This element is aimed for providing cinder local attach/detach functionality. * Currently the feature has a dependency on a known bug ``__, which has been resolved and will be part of the upstream with the next release of ``python-brick-cinderclient-ext``. Note: Current version of ``python-brick-cinderclient-ext`` i.e. 0.2.0 requires and update to be made in Line32 for ``/usr/share/python-brickclient/venv/lib/python2.7/site-packages/brick_cinderclient_ext/__init__.py``: update ``brick-python-cinderclient-ext`` to ``python-brick-cinderclient-ext``. Usage ----- Pass the below shell script to parameter ``user-data`` and set ``config-drive=true`` at the time of provisioning the node via nova-boot to make cinder local attach/detach commands talk to your cloud controller. .. code-block:: bash #!/bin/bash FILE="/etc/bash.bashrc" [ ! -f "$FILE" ] && touch "$FILE" echo 'export OS_AUTH_URL="http://:5000/v2.0"' >> "$FILE" echo 'export OS_PASSWORD="password"' >> "$FILE" echo 'export OS_USERNAME="demo"' >> "$FILE" echo 'export OS_TENANT_NAME="demo"' >> "$FILE" echo 'export OS_PROJECT_NAME="demo"' >> "$FILE" exec bash To attach: ``/usr/share/python-brickclient/venv/bin/cinder local-attach `` To detach: ``/usr/share/python-brickclient/venv/bin/cinder local-detach `` Alternatively, the same action can be completed manually at the node which does not require setting up of config drive such as: .. code-block:: bash /usr/share/python-brickclient/venv/bin/cinder \ --os-username demo --os-password password \ --os-tenant-name demo --os-project-name demo \ --os-auth-url=http://:5000/v2.0 local-attach ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/python-brickclient/element-deps0000664000175000017500000000004415201026231027447 0ustar00zuulzuulpackage-installs pip-and-virtualenv ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/python-brickclient/package-installs.yaml0000664000175000017500000000021515201026231031250 0ustar00zuulzuullibssl-dev: libffi-dev: python-dev: installtype: source dib_python_version: 2 python3-dev: installtype: source dib_python_version: 3 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/python-brickclient/pkg-map0000664000175000017500000000052715201026231026427 0ustar00zuulzuul{ "family": { "redhat": { "python2-dev": "python2-devel", "python3-dev": "python3-devel", "libssl-dev": "openssl-devel", "libffi-dev": "libffi-devel" } }, "default": { "python2-dev": "python2-dev", "python3-dev": "python3-dev", "libssl-dev": "libssl-dev", "libffi-dev": "libffi-dev" } } ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.385238 diskimage_builder-3.42.0/diskimage_builder/elements/python-brickclient/post-install.d/0000775000175000017500000000000015201026275030027 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021500000000000010213 xustar00119 path=diskimage_builder-3.42.0/diskimage_builder/elements/python-brickclient/post-install.d/55-brick-client-install 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/python-brickclient/post-install.d/55-brick-clien0000775000175000017500000000174515201026231032365 0ustar00zuulzuul#!/bin/bash # # Copyright 2016 Hewlett Packard Enterprise Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail PBCDIR=/usr/share/python-brickclient mkdir $PBCDIR # create the virtual environment virtualenv $PBCDIR/venv # Install the required packages inside virtual env $PBCDIR/venv/bin/pip install python-brick-cinderclient-ext ln -s $PBCDIR/venv/bin/python-brickclient /usr/local/bin/python-brickclient ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3862379 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/0000775000175000017500000000000015201026275025525 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/README.rst0000664000175000017500000000016615201026231027207 0ustar00zuulzuul==================== python-stow-versions ==================== Element that installs latest minor releases of python ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/element-deps0000664000175000017500000000004515201026231030021 0ustar00zuulzuulpackage-installs source-repositories ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3862379 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/install.d/0000775000175000017500000000000015201026275027415 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/install.d/70-python-build0000775000175000017500000000214715201026231032201 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 1 ]; then set -x fi set -eu set -o pipefail #Install python-build /pyenv/plugins/python-build/install.sh DIB_PYTHON_VERSIONS=${DIB_PYTHON_VERSIONS:-"2.7,3.5,3.6,3.7,3.8,3.9"} DIB_VERSIONS_TO_INSTALL=${1:-$DIB_PYTHON_VERSIONS} # Get pyenv versions DIB_PYENV_VERSIONS=$(python-build --definitions \ | egrep "^\s*[2,3]\.[0-9]{1,2}\.[0-9]{1,2}$") declare -A DIB_PYTHON_VERSIONS_ARRAY for version in ${DIB_PYENV_VERSIONS}; do DIB_PYTHON_VERSIONS_ARRAY[${version%.*}]+="${version##*.} " done if [ -n $DIB_VERSIONS_TO_INSTALL ]; then readarray -t DIB_VERSIONS_ARRAY <<<\ "$(echo "$DIB_VERSIONS_TO_INSTALL" | tr ',' '\n')" fi for key in ${!DIB_PYTHON_VERSIONS_ARRAY[@]}; do if ([ -n $DIB_VERSIONS_ARRAY ] && \ [[ " ${DIB_VERSIONS_ARRAY[@]} " =~ " ${key} " ]]) || \ [ -z ${DIB_VERSIONS_ARRAY} ]; then DIB_LAST_VERSION=${key}.$(echo "${DIB_PYTHON_VERSIONS_ARRAY[${key}]}" \ | sed "s/ /\n/g" | sort -nr | head -n1) python-build ${DIB_LAST_VERSION} /usr/local/stow/python-${DIB_LAST_VERSION} fi done ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/package-installs.yaml0000664000175000017500000000035315201026231031624 0ustar00zuulzuulbzip-dev: build-only: True curl: gcc: build-only: True git: build-only: True make: build-only: True readline-dev: build-only: True ssl-dev: build-only: True stow: sqlite-dev: build-only: True zlib-dev: build-only: True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/pkg-map0000664000175000017500000000215015201026231026772 0ustar00zuulzuul{ "family": { "debian": { "bzip-dev": "libbz2-dev", "curl": "curl", "gcc": "gcc", "git": "git", "make": "make", "readline-dev": "libreadline-dev", "ssl-dev": "libssl-dev", "stow": "stow", "sqlite-dev": "libsqlite3-dev", "zlib-dev": "zlib1g-dev" }, "redhat": { "bzip-dev": "bzip2-devel", "curl": "curl", "gcc": "gcc", "git": "git", "make": "make", "readline-dev": "readline-devel", "ssl-dev": "openssl-devel", "stow": "stow", "sqlite-dev": "sqlite-devel", "zlib-dev": "zlib-devel" }, "suse": { "bzip-dev": "libbz2-devel", "curl": "curl", "gcc": "gcc", "git": "git", "make": "make", "readline-dev": "readline-devel", "ssl-dev": "openssl-devel", "stow": "stow", "sqlite-dev": "sqlite3-devel", "zlib-dev": "zlib-devel" } }, "default": { "bzip-dev": "", "curl": "curl", "gcc": "gcc", "git": "git", "make": "make", "readline-dev": "", "ssl-dev": "", "sqlite-dev": "", "zlib-dev": "" } }././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3862379 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/post-install.d/0000775000175000017500000000000015201026275030400 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/post-install.d/70-python-build 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/post-install.d/70-python-bu0000775000175000017500000000050415201026231032466 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 1 ]; then set -x fi set -eu set -o pipefail DIB_PYTHON_FILES=('/usr/local/bin/pyenv-install', \ '/usr/local/bin/pyenv-uninstall', '/usr/local/bin/python-build', \ '/usr/local/share/python-build', '/pyenv') for path in ${DIB_PYTHON_FILES}; do rm -rf ${path} done ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/source-repository-pyenv0000664000175000017500000000006115201026231032311 0ustar00zuulzuulpyenv git /pyenv/ https://github.com/pyenv/pyenv ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2822356 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/test-elements/0000775000175000017500000000000015201026275030316 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021600000000000010214 xustar00114 path=diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/test-elements/test-python-stow/ 28 mtime=1778658493.3862379 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/test-elements/test-python-s0000775000175000017500000000000015201026275032775 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022400000000000010213 xustar00126 path=diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/test-elements/test-python-stow/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/test-elements/test-python-s0000664000175000017500000000011115201026231032760 0ustar00zuulzuulpackage-installs python-stow-versions source-repositories ubuntu-minimal ././@PaxHeader0000000000000000000000000000023400000000000010214 xustar00128 path=diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/test-elements/test-python-stow/environment.d/ 28 mtime=1778658493.3862379 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/test-elements/test-python-s0000775000175000017500000000000015201026275032775 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000025600000000000010220 xustar00152 path=diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/test-elements/test-python-stow/environment.d/70-test-python-stow.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/test-elements/test-python-s0000664000175000017500000000005015201026231032762 0ustar00zuulzuulexport DIB_PYTHON_SUPPORTED_VERSIONS=3.8././@PaxHeader0000000000000000000000000000023000000000000010210 xustar00124 path=diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/test-elements/test-python-stow/install.d/ 28 mtime=1778658493.3872378 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/test-elements/test-python-s0000775000175000017500000000000015201026275032775 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000024500000000000010216 xustar00143 path=diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/test-elements/test-python-stow/install.d/69-test-python-stow 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/test-elements/test-python-s0000775000175000017500000000031515201026231032771 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eux set -o pipefail [ -f "/pyenv/plugins/python-build/install.sh" ] [ -d "/usr/local/stow" ] # dib-lint: disable=which which stow ././@PaxHeader0000000000000000000000000000024500000000000010216 xustar00143 path=diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/test-elements/test-python-stow/install.d/71-test-python-stow 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/python-stow-versions/test-elements/test-python-s0000775000175000017500000000132315201026231032771 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eux set -o pipefail DIB_STOW_PATH="/usr/local/stow" DIB_PY_BUILD_COUNTER=0 for pybuilds in $(ls -1 ${DIB_STOW_PATH} | grep "python-"); do DIB_PY_BUILD_COUNTER=$((DIB_PY_BUILD_COUNTER+1)) py_dir_version=$(echo ${pybuilds} | cut -d "-" -f 2) py_real_version=$(\ ${DIB_STOW_PATH}/${pybuilds}/bin/python --version | cut -d " " -f 2) [[ ${py_real_version} == ${py_dir_version} ]] pushd ${DIB_STOW_PATH} stow ${pybuilds} popd py_stow_version=$(\ /usr/local/bin/python${py_dir_version%.*} --version | cut -d " " -f 2) [[ ${py_stow_version} == ${py_dir_version} ]] done [ $DIB_PY_BUILD_COUNTER -eq 1 ] ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3872378 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk/0000775000175000017500000000000015201026275022776 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk/README.rst0000664000175000017500000000153315201026231024457 0ustar00zuulzuul======= ramdisk ======= This is the ramdisk element. Almost any user building a ramdisk will want to include this in their build, as it triggers many of the vital functionality from the basic diskimage-builder libraries (such as init script aggregation, busybox population, etc). An example of when one might want to use this toolchain to build a ramdisk would be the initial deployment of baremetal nodes in a TripleO setup. Various tools and scripts need to be injected into a ramdisk that will fetch and apply a machine image to local disks. That tooling/scripting customisation can be easily applied in a repeatable and automatable way, using this element. NOTE: ramdisks require 1GB minimum memory on the machines they are booting. See the top-level README.md of the project, for more information about the mechanisms available to a ramdisk element. ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.388238 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk/binary-deps.d/0000775000175000017500000000000015201026275025435 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk/binary-deps.d/ramdisk0000664000175000017500000000002415201026231026776 0ustar00zuulzuuldhclient ip busybox ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk/element-deps0000664000175000017500000000004315201026231025270 0ustar00zuulzuuldeploy-tgtadm pkg-map ramdisk-base ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.388238 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk/init.d/0000775000175000017500000000000015201026275024163 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk/init.d/10-start-base-system0000664000175000017500000000247115201026231027707 0ustar00zuulzuulmkdir -p /proc /sys /dev /boot /etc /mnt /lib/modules mount -t proc proc /proc mount -o ro -t sysfs none /sys UDEVD= if [ -x "/bin/systemd-udevd" ]; then UDEVD="systemd-udevd" else UDEVD="udevd" fi # udev versions 176 and newer require a different on-disk setup UDEVD_VERSION=$(udevadm --version) if [ "$UDEVD_VERSION" != "" -a $UDEVD_VERSION -gt 175 ]; then echo "Using new-style udevd setup" mount -t devtmpfs none /dev mkdir -p /run mount -t tmpfs -o "nosuid,size=20%,mode=0755" tmpfs /run mkdir -p /run/{lock,udev} else echo "Using old-style udevd setup" mount -t tmpfs none /dev ln -sf /proc/self/fd /dev/fd mknod /dev/null c 1 3 mknod /dev/zero c 1 5 mknod /dev/random c 1 8 mknod /dev/urandom c 1 9 mknod /dev/tty0 c 4 0 mknod /dev/tty1 c 4 1 mknod /dev/tty2 c 4 2 mknod /dev/tty3 c 4 3 mknod /dev/tty4 c 4 4 mknod /dev/tty5 c 4 5 mknod /dev/tty6 c 4 6 mknod /dev/tty7 c 4 7 mknod /dev/tty8 c 4 8 mknod /dev/tty9 c 4 9 mknod /dev/tty c 5 0 mknod -m 0600 /dev/console c 5 1 mknod -m 0666 /dev/ptmx c 5 2 mkdir -p /dev/.udev/data fi echo "starting syslogd" echo '*.* /initlog' > /etc/syslog.conf syslogd klogd echo "starting udevd" $UDEVD --daemon --resolve-names=never echo "load modules" load_modules_by_udev ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk/init.d/30-start-network0000664000175000017500000000300715201026231027142 0ustar00zuulzuulecho "starting network $BOOT_MAC_ADDRESS" t=0 while ! BOOT_INTERFACE=$(find_interface "$BOOT_MAC_ADDRESS"); do t=`expr "$t" + 5` if [ "$t" -gt 10 ]; then break fi sleep 5 done if [ -z "$BOOT_INTERFACE" ]; then err_msg "Could not find an interface that owns MAC: $BOOT_MAC_ADDRESS" troubleshoot fi readonly BOOT_INTERFACE ifconfig lo 127.0.0.1 up rv=0 ifconfig "$BOOT_INTERFACE" up || rv=1 if [ $rv -ne 0 ]; then sleep 10 rv=0 ifconfig "$BOOT_INTERFACE" up || rv=1 if [ $? -ne 0 ]; then err_msg "Failed to ifconfig up $BOOT_INTERFACE" troubleshoot fi fi # Check if boot IP address was specific or retrieve from DHCP if [ -n "$BOOT_IP_ADDRESS" ]; then ifconfig "$BOOT_INTERFACE" "$BOOT_IP_ADDRESS" netmask "$BOOT_NETMASK" route del default || true route add default gw $BOOT_GATEWAY else dhclient -1 "$BOOT_INTERFACE" if [[ $? == 2 ]]; then echo "Error getting IP address for $BOOT_INTERFACE with MAC \ $BOOT_MAC_ADDRESS" troubleshoot fi BOOT_IP_ADDRESS=$(ifconfig "$BOOT_INTERFACE" | grep 'inet addr:' | \ cut -d: -f2 | awk '{ print $1}') BOOT_NETMASK=$(ifconfig "$BOOT_INTERFACE" | grep 'Mask:' | cut -d':' -f4) BOOT_GATEWAY=$(route -n | grep "$BOOT_INTERFACE" | grep '^0.0.0.0' | \ awk '{print $2}') echo "obtained the following from dhcp: " echo " ip address = $BOOT_IP_ADDRESS" echo " netmask = $BOOT_NETMASK" echo " gateway = $BOOT_GATEWAY" fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3892379 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk/install.d/0000775000175000017500000000000015201026275024666 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk/install.d/20-install-dhcp-client0000775000175000017500000000026015201026231030657 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail DHCP_CLIENT=$(pkg-map --element ramdisk dhcp_client) install-packages $DHCP_CLIENT ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk/install.d/52-ramdisk-install-busybox0000775000175000017500000000017015201026231031615 0ustar00zuulzuul#!/bin/bash if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail install-packages busybox ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk/pkg-map0000664000175000017500000000026615201026231024251 0ustar00zuulzuul{ "family":{ "debian":{ "dhcp_client":"isc-dhcp-client" }, "suse":{ "dhcp_client":"dhcp-client" } }, "default":{ "dhcp_client":"dhclient" } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3892379 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk/post-install.d/0000775000175000017500000000000015201026275025651 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk/post-install.d/99-build-ramdisk0000775000175000017500000000352315201026231030560 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail _LIB="/tmp/ramdisk-build" source $_LIB/common-defaults source $_LIB/img-defaults source $_LIB/ramdisk-defaults source $_LIB/common-functions source $_LIB/img-functions source $_LIB/ramdisk-functions KERNEL_VERSION=${DIB_KERNEL_VERSION:-$(find_kernel_version)} MODULE_DIR=$MODULE_ROOT/lib/modules/$KERNEL_VERSION if [ -f /dib-signed-kernel-version ] ; then . /dib-signed-kernel-version fi if [ -n "${DIB_SIGNED_KERNEL_VERSION:-}" ]; then # Though kernel name is suffixed with efi.signed, modules directory is # without that suffix MOD_KERNEL_NAME=`echo "$DIB_SIGNED_KERNEL_VERSION" |sed "s/\.efi\.signed//g"` MODULE_DIR=$MODULE_ROOT/lib/modules/$MOD_KERNEL_NAME fi FIRMWARE_DIR=$MODULE_ROOT/lib/firmware LIB_UDEV=$LIB_UDEV_ROOT/lib/udev INIT="$_LIB/scripts/init" FUNCTIONS_D="$_LIB/scripts/d" BUSYBOX=${BUSYBOX:-$(type -p busybox)} # NOTE(bnemec): IMAGE_ELEMENT is normally set in disk-image-create, but we're # not using that to build the image here. IMAGE_ELEMENT= mk_build_dir mkdir -p $TMP_BUILD_DIR/mnt export TMP_HOOKS_PATH=/tmp export TMP_MOUNT_PATH=$TMP_BUILD_DIR/mnt echo "building ramdisk in $TMP_MOUNT_PATH" create_ramdisk_base populate_lib populate_busybox populate_init populate_udev SCRIPT_HOME=/tmp/in_target.d/bin TMP_HOOKS_PATH=/tmp/in_target.d run_d ramdisk-install finalise_image save_image /tmp/ramdisk # In the past save_image did this for us. If EXIT handler is not # reset ramdisk image builds fail. trap EXIT cp /boot/vmlinu[zx]-${KERNEL_VERSION} /tmp/kernel if [ -n "${DIB_SIGNED_KERNEL_VERSION:-}" ]; then cp /boot/vmlinu[zx]-${DIB_SIGNED_KERNEL_VERSION} /tmp/kernel fi chmod o+r /tmp/kernel if [ -f /dib-signed-kernel-version ] ; then echo "Removing /dib-signed-kernel-version" rm -f /dib-signed-kernel-version fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3872378 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/0000775000175000017500000000000015201026275023706 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/README.rst0000664000175000017500000000015715201026231025370 0ustar00zuulzuul============ ramdisk-base ============ Shared functionality required by all of the different ramdisk elements. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3872378 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/cleanup.d/0000775000175000017500000000000015201026275025557 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/cleanup.d/99-extract-ramdisk-files0000775000175000017500000000045415201026231032141 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail IMAGE_NAME=${IMAGE_NAME:-'image'} sudo chmod a+r $TMP_MOUNT_PATH/tmp/ramdisk $TMP_MOUNT_PATH/tmp/kernel cp $TMP_MOUNT_PATH/tmp/ramdisk $IMAGE_NAME.initramfs cp $TMP_MOUNT_PATH/tmp/kernel $IMAGE_NAME.kernel ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3872378 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/extra-data.d/0000775000175000017500000000000015201026275026162 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/extra-data.d/01-inject-ramdisk-build-files 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/extra-data.d/01-inject-ramdisk-buil0000775000175000017500000000060715201026231032156 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail export RAMDISK_BUILD_PATH="$TMP_MOUNT_PATH/tmp/ramdisk-build" mkdir -p $RAMDISK_BUILD_PATH for file in common-defaults common-functions ramdisk-defaults ramdisk-functions img-defaults img-functions ; do cp $_LIB/$file $RAMDISK_BUILD_PATH done cp -r $(dirname $0)/scripts $RAMDISK_BUILD_PATH ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3872378 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/extra-data.d/scripts/0000775000175000017500000000000015201026275027651 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.388238 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/extra-data.d/scripts/d/0000775000175000017500000000000015201026275030074 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/extra-data.d/scripts/d/init-func0000664000175000017500000001671415201026231031714 0ustar00zuulzuul# Copyright (c) 2012 NTT DOCOMO, INC. # Copyright 2012 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. source /iscsi-func function configure_vmedia_dir() { VMEDIA_MOUNT_POINT="/vfloppy_mnt" VMEDIA_DIR="/vfloppy" VMEDIA_CONFIG_FILE="parameters.txt" VMEDIA_DEVICE_BY_LABEL="/dev/disk/by-label/ir-vfd-dev" # Wait for some seconds for kernel to finish initializing the # virtual media devices. wait_for 5 1 "ls $VMEDIA_DEVICE_BY_LABEL" if [[ $? != 0 ]]; then # TODO(rameshg87) - 04/29/15 : This block of code is there only # for backward compatibility to older versions of Ironic. Remove this # after 2 releases. Ironic will now assign labels to Virtual Media # devices. SYSFS_DEVICE_MODELS="/sys/class/block/*/device/model" SYSFS_VMEDIA_DEVICE_MODEL="virtual media" grep -q -i "$SYSFS_VMEDIA_DEVICE_MODEL" $SYSFS_DEVICE_MODELS if [[ $? != 0 ]]; then echo "Error finding the virtual floppy device on the node." troubleshoot fi # Find the virtual media device from the kernel sysfs file system. VMEDIA_DEVICE=$(grep -l -i "$SYSFS_VMEDIA_DEVICE_MODEL" $SYSFS_DEVICE_MODELS | awk -F'/' '{print $5}') if [[ -z $VMEDIA_DEVICE ]]; then echo "Error finding the virtual floppy device on the node." troubleshoot fi VMEDIA_DEVICE_FILE="/dev/$VMEDIA_DEVICE" else VMEDIA_DEVICE_FILE="$VMEDIA_DEVICE_BY_LABEL" fi # Mount the virtual media device mkdir -p $VMEDIA_MOUNT_POINT mount $VMEDIA_DEVICE_FILE $VMEDIA_MOUNT_POINT if [[ $? != 0 ]]; then echo "Error mounting virtual media device $VMEDIA_DEVICE_FILE" troubleshoot fi # Copy the contents of the virtual media to a directory in root # filesystem so that we can unmount virtual media soon. cp -rf $VMEDIA_MOUNT_POINT $VMEDIA_DIR umount $VMEDIA_MOUNT_POINT } function get_kernel_parameter() { if [ "$BOOT_METHOD" = "$VMEDIA_BOOT_TAG" ]; then echo $(find_parameter_from_file $1 "$VMEDIA_DIR/$VMEDIA_CONFIG_FILE") else echo $(find_parameter_from_file $1 "/proc/cmdline") fi } function find_parameter_from_file() { local paramname=$1 local filename=$2 for i in `cat $filename`; do case "$i" in ${paramname}=*) echo "${i#${paramname}=}" return 0 ;; ${paramname}) echo "" return 0 ;; *) ;; esac done echo "" return 1 } function string_contains() { local string=$1 local word=$2 if [ "$string" != "${string/$word/}" ]; then return 0 else return 1 fi } function load_modules_by_udev() { udevadm trigger --action=add udevadm settle } function strip_dev() { echo "$1" | sed -e 's:^/dev/::' } function prepend_dev() { case "$1" in /dev/*) echo "$1" ;; *) echo "/dev/$1" ;; esac } function whole_disk_name() { local dev=`prepend_dev "$1"` case "$dev" in /dev/sd*|/dev/hd*|/dev/vd*|/dev/xvd*) echo "$dev" | sed -e 's/[0-9]*$//' ;; /dev/cciss/*) echo "$dev" | sed -e 's/p[0-9]*$//' ;; *) echo "" return 1 ;; esac } function partition_name() { local dev=`prepend_dev "$1"` local part=$2 case "$dev" in /dev/sd*|/dev/hd*|/dev/vd*|/dev/xvd*) echo "${dev}${part}" ;; /dev/cciss/*) echo "${dev}p${part}" ;; *) echo "" return 1 ;; esac } function find_interface() { local mac=$1 local interface interface=$(ip link show | grep -B1 -i $mac | awk '/mtu/ { print $2 }') if [ -n "$interface" ]; then echo "${interface%:}" return 0 else # Note(moshele): try to find the InfinBand interface by # matching the InfinBand MAC upper and lower # 3 octets to the GUID lower and upper 3 octets. local upper_octs=${mac:0:8} local lower_octs=${mac:9:16} ib_re="${upper_octs}:[A-F0-9][A-F0-9]:[A-F0-9][A-F0-9]:${lower_octs}" interface=$(ip link show | grep -B1 -i ${ib_re} | grep mtu | \ awk {'print $2'}) if [ -n "$interface" ]; then echo "${interface%:}" return 0 fi return 1 fi } function set_mac() { local dev=$1 local mac=$2 ip link set "$dev" address "$mac" } function swap_ifname() { local dev=$1 local dev2=$2 if [ "$dev" = "$dev2" ]; then return fi if ip link show "$dev2" >/dev/null; then # dev2 exists # swap device name ip link set "$dev" name "_$dev" ip link set "$dev2" name "$dev" ip link set "_$dev" name "$dev2" else ip link set "$dev" name "$dev2" fi } function partition_exists() { local dev=$1 dev=`strip_dev "$dev"` if tail -n +3 /proc/partitions | grep "$dev" >/dev/null; then return 0 else return 1 fi } function find_disk() { local disks=$1 local dev # find device local OLD_IFS=$IFS IFS=, for i in $disks; do dev=`whole_disk_name "$i"` if partition_exists "$dev"; then dev=`prepend_dev "$dev"` break fi dev="" done IFS=$OLD_IFS if [ -z "$dev" ]; then return 1 fi echo "$dev" return 0 } function check_tgtd_socket() { echo -n "waiting for tgtd socket..." if [ -e /var/run/tgtd.ipc_abstract_namespace.0 ]; then echo "found" return 0 else echo "not found" return 1 fi } wait_for(){ LOOPS=$1 SLEEPTIME=$2 shift ; shift i=0 while [ $i -lt $LOOPS ] ; do i=$((i + 1)) eval "$@" && return 0 || true sleep $SLEEPTIME done return 1 } function troubleshoot() { if [ "$TROUBLESHOOT" != 1 ]; then _DO_TROUBLESHOOT="" _t=0 echo -n "Troubleshooting required, press t to launch shell." while [ $_t -lt 10 ]; do read -n 1 -t 1 _DO_TROUBLESHOOT _t=$(($_t + 1)) if [ "$_DO_TROUBLESHOOT" == "t" ]; then export TROUBLESHOOT=1 break fi echo -n "." done echo "" fi if [ "$TROUBLESHOOT" == 1 ]; then echo "Starting troubleshooting shell." bash fi } function safe_url_encode() { local str=$1 local out="" for (( i=0; i<${#str}; i++ )); do c=${str:$i:1} case $c in [a-zA-Z0-9.-_] ) out+="$c" ;; ' ' ) out+="+" ;; *) #skip it ;; esac done echo "$out" } function err_msg() { message=$1 if [ -z "$FIRST_ERR_MSG" ]; then FIRST_ERR_MSG=$(safe_url_encode "$message") fi echo "$message" } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/extra-data.d/scripts/init0000775000175000017500000000167015201026231030536 0ustar00zuulzuul#!/bin/bash # Copyright (c) 2012 NTT DOCOMO, INC. # Copyright 2012 Hewlett-Packard Development Company, L.P. # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # NOTE(bnemec): We don't want this script to exit on failures because if init # dies then we get a kernel panic on ramdisk boot. # dib-lint: disable=sete setu setpipefail dibdebugtrace echo "init" source /init-func PATH=/sbin:/bin:/usr/bin:/usr/sbin export PATH ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/extra-data.d/scripts/init-end0000664000175000017500000000016615201026231031276 0ustar00zuulzuul # Final init steps echo "rebooting" reboot -f echo "failed to reboot" echo "Starting troubleshooting shell." bash ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.388238 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/init.d/0000775000175000017500000000000015201026275025073 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/init.d/20-init-variables0000664000175000017500000000420215201026231030134 0ustar00zuulzuulFIRST_ERR_MSG= # To identify that the node has booted from virtual media, a kernel # command-line argument boot_method=vmedia is added in the iso bootloader # configuration file (like isolinux.cfg for isolinux). VMEDIA_BOOT_TAG="vmedia" BOOT_METHOD=$(get_kernel_parameter boot_method) if [ "$BOOT_METHOD" = "$VMEDIA_BOOT_TAG" ]; then # If the node booted from virtual media cdrom, the arguments for the # installation are provided in virtual media floppy. Find out # the virtual media device, mount it and get the information. configure_vmedia_dir fi readonly _BOOTIF_=$(get_kernel_parameter BOOTIF) readonly _IP_=$(get_kernel_parameter ip) # _BOOTIF_ is the hardware type with the MAC address # see http://www.syslinux.org/wiki/index.php/PXELINUX if [[ $_BOOTIF_ =~ ^20.* && ${#_BOOTIF_} == 20 ]]; then # InfiniBand hardware type is 20 with InfiniBand MAC # For example InfiniBand GID: # 80:00:02:08:fe:80:00:00:00:00:00:00:f4:52:14:03:00:3a:16:b1 # is converted to BOOTIF 20:f4:52:14:3a:16:b1 MAC_ADDRESS=$(echo "$_BOOTIF_" | sed -e "s/-/:/g" | \ sed -e "s/^20://g" | tr 'a-f' 'A-F') else # Ethernet BOOTIF hardware type is 01 with MAC MAC_ADDRESS=$(echo "$_BOOTIF_" | sed -e "s/-/:/g" | \ sed -e "s/^01://g" | tr 'a-f' 'A-F') fi readonly BOOT_MAC_ADDRESS=$MAC_ADDRESS # If bootloader did not pass on network info, we fallback to a kernel # parameter to locate the address of the boot server. if [ -n "$_IP_" ]; then readonly BOOT_SERVER=$(echo "$_IP_" | cut -d':' -f2) else readonly BOOT_SERVER=$(get_kernel_parameter boot_server) fi # IP address, netmask, gateway can be set a later point of time if # IP address is assigned by dhcp (for non-pxe boots). BOOT_IP_ADDRESS=$(echo "$_IP_" | cut -d':' -f1) BOOT_NETMASK=$(echo "$_IP_" | cut -d':' -f4) BOOT_GATEWAY=$(echo "$_IP_" | cut -d':' -f3) readonly DISK=$(get_kernel_parameter disk) readonly DEPLOYMENT_ID=$(get_kernel_parameter deployment_id) readonly DEPLOYMENT_KEY=$(get_kernel_parameter deployment_key) readonly ISCSI_TARGET_IQN=$(get_kernel_parameter iscsi_target_iqn) TROUBLESHOOT=$(get_kernel_parameter troubleshoot) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/init.d/40-check-network-ready0000664000175000017500000000023715201026231031077 0ustar00zuulzuulif [ -n "$BOOT_SERVER" ]; then echo "pinging to boot server $BOOT_SERVER" wait_for 6 5 ping -c 5 -q "$BOOT_SERVER" > /dev/null fi echo "network ready"././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.388238 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/post-install.d/0000775000175000017500000000000015201026275026561 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/post-install.d/01-ensure-binaries0000775000175000017500000000207215201026231032011 0ustar00zuulzuul#!/bin/bash # Ensure that all binaries listed in ramdisk elements, exist if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail export TARGET_DIR="/tmp/in_target.d/" if [ -z $TARGET_DIR ] ; then echo "Target dir not specified" exit 1 fi if [ ! -d $TARGET_DIR ] ; then echo "Unable to find specified directory in target: $TARGET_DIR" bash exit 1 fi BINARY_DEPS= for _FILE in $(ls ${TARGET_DIR}/binary-deps.d/) ; do _FILE="${TARGET_DIR}/binary-deps.d/${_FILE}" if [ -a $_FILE ]; then for _LINE in $(cat $_FILE) ; do BINARY_DEPS="${BINARY_DEPS} $_LINE" done fi done for _BIN in $BINARY_DEPS ; do _LOCATION=$(type -p "$_BIN" || echo "") if [ -z "$_LOCATION" ]; then echo "$_BIN is not found in PATH. Please ensure your elements install it" exit 1 fi done if [ "$BINARY_DEPS" == "" ]; then echo "No binary-deps found" else DEPS_OUTPUT="/etc/dib_binary_deps" echo "Creating binary_deps record at: ${DEPS_OUTPUT}" echo "$BINARY_DEPS" >${DEPS_OUTPUT} fi ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.388238 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/udev.d/0000775000175000017500000000000015201026275025073 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ramdisk-base/udev.d/60-persistent-storage.rules0000664000175000017500000001302615201026231032226 0ustar00zuulzuul# do not edit this file, it will be overwritten on update # persistent storage links: /dev/disk/{by-id,by-uuid,by-label,by-path} # scheme based on "Linux persistent device names", 2004, Hannes Reinecke # forward scsi device event to corresponding block device ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change" ACTION=="remove", GOTO="persistent_storage_end" # enable in-kernel media-presence polling ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_poll_msecs}=="0", ATTR{parameters/events_dfl_poll_msecs}="2000" ACTION=="add", ATTR{removable}=="1", ATTR{events_poll_msecs}=="-1", ATTR{events_poll_msecs}="2000" SUBSYSTEM!="block", GOTO="persistent_storage_end" # skip rules for inappropriate block devices KERNEL=="fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md*", GOTO="persistent_storage_end" # ignore partitions that span the entire disk TEST=="whole_disk", GOTO="persistent_storage_end" # for partitions import parent information ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*" # virtio-blk KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}" KERNEL=="vd*[0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}-part%n" # ATA devices using the "scsi" subsystem KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", IMPORT{program}="ata_id --export $devnode" # ATA/ATAPI devices (SPC-3 or later) using the "scsi" subsystem KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{type}=="5", ATTRS{scsi_level}=="[6-9]*", IMPORT{program}="ata_id --export $devnode" # Run ata_id on non-removable USB Mass Storage (SATA/PATA disks in enclosures) KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", ATTR{removable}=="0", SUBSYSTEMS=="usb", IMPORT{program}="ata_id --export $devnode" # Otherwise fall back to using usb_id for USB devices KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id" # scsi devices KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $devnode", ENV{ID_BUS}="scsi" KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $devnode", ENV{ID_BUS}="cciss" KERNEL=="sd*|sr*|cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}" KERNEL=="sd*|cciss*", ENV{DEVTYPE}=="partition", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n" # firewire KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}" KERNEL=="sd*[0-9]", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}-part%n" KERNEL=="mmcblk[0-9]", SUBSYSTEMS=="mmc", ATTRS{name}=="?*", ATTRS{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}" KERNEL=="mmcblk[0-9]p[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}-part%n" KERNEL=="mmcblk[0-9]p[0-9]", ENV{PARTNAME}=="?*", SYMLINK+="disk/by-partlabel/$env{PARTNAME}" KERNEL=="mspblk[0-9]", SUBSYSTEMS=="memstick", ATTRS{name}=="?*", ATTRS{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/memstick-$env{ID_NAME}_$env{ID_SERIAL}" KERNEL=="mspblk[0-9]p[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/memstick-$env{ID_NAME}_$env{ID_SERIAL}-part%n" # by-path (parent device path) ENV{DEVTYPE}=="disk", DEVPATH!="*/virtual/*", IMPORT{builtin}="path_id" ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" # skip unpartitioned removable media devices from drivers which do not send "change" events ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end" # probe filesystem metadata of optical drives which have a media inserted KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", \ IMPORT{builtin}="blkid --offset=$env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}" # single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", \ IMPORT{builtin}="blkid --noraid" # probe filesystem metadata of disks KERNEL!="sr*", IMPORT{builtin}="blkid" # watch metadata changes by tools closing the device after writing KERNEL!="sr*", OPTIONS+="watch" # by-label/by-uuid links (filesystem metadata) ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" # by-id (World Wide Name) ENV{DEVTYPE}=="disk", ENV{ID_WWN_WITH_EXTENSION}=="?*", SYMLINK+="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}" ENV{DEVTYPE}=="partition", ENV{ID_WWN_WITH_EXTENSION}=="?*", SYMLINK+="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}-part%n" # by-partlabel/by-partuuid links (partition metadata) ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_UUID}=="?*", SYMLINK+="disk/by-partuuid/$env{ID_PART_ENTRY_UUID}" ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", SYMLINK+="disk/by-partlabel/$env{ID_PART_ENTRY_NAME}" LABEL="persistent_storage_end" ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3892379 diskimage_builder-3.42.0/diskimage_builder/elements/rax-nova-agent/0000775000175000017500000000000015201026275024173 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rax-nova-agent/README.rst0000664000175000017500000000042015201026231025646 0ustar00zuulzuul============== rax-nova-agent ============== Images for Rackspace Cloud currently require nova-agent to get networking information. Many of the things here are adapted from: https://developer.rackspace.com/blog/bootstrap-your-qcow-images-for-the-rackspace-public-cloud/ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rax-nova-agent/element-deps0000664000175000017500000000002415201026231026464 0ustar00zuulzuulsource-repositories ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3892379 diskimage_builder-3.42.0/diskimage_builder/elements/rax-nova-agent/install.d/0000775000175000017500000000000015201026275026063 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rax-nova-agent/install.d/05-xen-tools0000775000175000017500000000213515201026231030154 0ustar00zuulzuul#!/bin/bash # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail XS_TOOLS_DIR=$(mktemp -d) mount -o loop /tmp/xs-tools.iso $XS_TOOLS_DIR pushd $XS_TOOLS_DIR/Linux case "$DISTRO_NAME" in 'ubuntu'|'debian') # Seriously source versions.deb dpkg -i $XE_GUEST_UTILITIES_PKG_FILE_amd64 ;; 'fedora'|'centos'|'opensuse') source versions.rpm rpm -Uvh $XE_GUEST_UTILITIES_PKG_FILE_x86_64 ;; esac popd umount $XS_TOOLS_DIR ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rax-nova-agent/install.d/10-nova-agent0000775000175000017500000000625315201026231030264 0ustar00zuulzuul#!/bin/bash # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail cd /tmp/nova-agent ./installer.sh cat > /etc/cloud/cloud.cfg.d/80_restart_network.cfg <<'EOF' # Restart networking if it's got no IP. This is to catch if we're on RAX # and the baked in dhcp config didn't work, but is now probably reconfigured # by nova-agent runcmd: - ip addr show eth0 | grep inet || ( ifdown -a ; ifup -a ) EOF case "$DISTRO_NAME" in 'ubuntu'|'debian') # cloud-init / nova-agent sad panda hacks cat > /etc/init/nova-agent.conf <<'EOF' # nova-agent - start before cloud-init and hup network interfaces start on starting cloud-init-local task console output script /etc/init.d/nova-agent start sleep 13 ifdown -a ifup -a end script EOF cat > /etc/init/xe-linux-distribution.conf <<'EOF' # xe-linux-distribution - start the xentools before nova-agent runs start on starting nova-agent task console output script /etc/init.d/xe-linux-distribution start sleep 2 end script EOF # stop nova-agent from starting twice since we start it from upstart now update-rc.d -f nova-agent remove update-rc.d -f xe-linux-distribution remove # console fix for PV Ubuntus cat > /etc/init/hvc0.conf <<'EOF' # hvc0 - getty # # This service maintains a getty on hvc0 from the point the system is # started until it is shut down again. start on stopped rc RUNLEVEL=[2345] stop on runlevel [!2345] respawn exec /sbin/getty -L 115200 hvc0 vt102 EOF ;; 'fedora'|'centos'|'opensuse') cat > /usr/local/bin/run-nova-agent.sh <<'EOF' #!/bin/bash /etc/init.d/nova-agent start sleep 13 ifdown -a ifup -a EOF chmod 0755 /usr/local/bin/run-nova-agent.sh cat > /usr/local/bin/run-xe-linux-distribution.sh <<'EOF' #!/bin/bash /etc/init.d/xe-linux-distribution start sleep 2 EOF chmod 0755 /usr/local/bin/run-xe-linux-distribution.sh cat > /etc/systemd/system/nova-agent.service < /etc/systemd/system/xe-linux-distribution.service <<'EOF' [Unit] Description=xentools agent Before=nova-agent Wants=nova-agent [Service] ExecStart=/usr/local/bin/run-xe-linux-distribution.sh [Install] WantedBy=multi-user.target EOF # stop nova-agent from starting twice since we start it from systemd now chkconfig nova-agent off chkconfig xe-linux-distribution off systemctl enable nova-agent systemctl enable xe-linux-distribution ;; esac ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rax-nova-agent/package-installs.yaml0000664000175000017500000000004315201026231030266 0ustar00zuulzuulcloud-init: phase: pre-install.d ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rax-nova-agent/source-repository-nova-agent0000664000175000017500000000025215201026231031657 0ustar00zuulzuulnova-agent tar /tmp/nova-agent https://f97f271e9fde8f434e2a-fa73b8821af96cee574a861a54d04230.ssl.cf3.rackcdn.com/files/nova-agent/nova-agent-Linux-x86_64-1.39.0.tar.gz . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rax-nova-agent/source-repository-xen-tools0000664000175000017500000000022515201026231031550 0ustar00zuulzuulxen-tools file /tmp/xs-tools.iso https://f97f271e9fde8f434e2a-fa73b8821af96cee574a861a54d04230.ssl.cf3.rackcdn.com/files/xentools/xs-tools-6.2.0.iso ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.390238 diskimage_builder-3.42.0/diskimage_builder/elements/redhat-common/0000775000175000017500000000000015201026275024101 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/redhat-common/README.rst0000664000175000017500000000204415201026231025560 0ustar00zuulzuul============= redhat-common ============= Image installation steps common to RHEL, CentOS, Fedora and openEuler. Requirements: If used to build an image form a cloud image compress with xz (the default in centos), this element uses "unxz" to decompress the image. Depending on your distro you may need to install either the xz or xz-utils package. Environment Variables --------------------- DIB_LOCAL_IMAGE :Required: No :Default: None :Description: Use the local path of a qcow2 cloud image. This is useful in that you can use a customized or previously built cloud image from diskimage-builder as input. The cloud image does not have to have been built by diskimage-builder. It should be a full disk image, not just a filesystem image. :Example: ``DIB_LOCAL_IMAGE=rhel-9.4-x86_64-kvm.qcow2`` DIB_DISABLE_KERNEL_CLEANUP :Required: No :Default: 0 :Description: Specify if kernel needs to be cleaned up or not. When set to true, the bits that cleanup old kernels will not be executed. :Example: DIB_DISABLE_KERNEL_CLEANUP=1 ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.390238 diskimage_builder-3.42.0/diskimage_builder/elements/redhat-common/bin/0000775000175000017500000000000015201026275024651 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/redhat-common/bin/map-packages0000775000175000017500000000756015201026231027130 0ustar00zuulzuul#!/usr/bin/env python3 # dib-lint: disable=indent # dib-lint indent requirements causes issue with pep8 # Copyright 2012 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import sys # Manually maintained for brevity; consider making this compiled from # distromatch or other rich data sources. # Debian name on the left, Fedora/RHEL on the right. # # !!! DO NOT ADD ANY ENTRIES TO THIS FILE !!! # # This global list has been deprecated by the pkg-map element. New # package mappings should go in pkg-map files inside each element. # package_map = { 'apache2': 'httpd', 'arping': 'iputils', 'augeas-tools': 'augeas', 'build-essential': 'make automake gcc gcc-c++ kernel-devel', 'default-jre': 'java', 'extlinux': 'syslinux-extlinux', 'gearman-job-server': 'gearmand', 'grub-pc': 'grub2-tools grub2', 'libaio1': 'libaio', 'libapache2-mod-wsgi': 'mod_wsgi', 'libc6-dev': 'glibc-devel', 'libmariadb-dev': 'mariadb-devel', 'libffi-dev': 'libffi-devel', 'libldap2-dev': 'python-ldap', 'libmysql-dev': 'mysql++-devel', 'libmysql-java': 'mysql-connector-java', 'libmysqlclient-dev': 'mysql-devel', 'libpq-dev': 'libpqxx-devel', 'libxslt-dev': 'libxslt-devel', 'libsasl2-dev': 'cyrus-sasl-devel', 'libsqlite3-dev': 'libsqlite3x-devel', 'libssl-dev': 'openssl-devel', 'libvirt-bin': 'libvirt', 'libxml2-dev': 'libxml2-devel', 'libz-dev': 'zlib-devel', 'linux-headers-generic': 'kernel-headers', 'linux-image-generic': 'kernel', 'lm-sensors': 'lm_sensors', 'mysql-client-5.5': 'mariadb', 'mysql-server-5.5': 'mariadb-server', 'nagios-plugins-basic': 'nagios-plugins-all', 'netcat-openbsd': 'nmap-ncat', 'nfs-common': 'nfs-utils', 'nfs-kernel-server': 'nfs-utils', 'open-iscsi': 'iscsi-initiator-utils', 'openjdk-7-jre-headless': 'java-1.7.0-openjdk-headless', 'openssh-client': 'openssh-clients', 'openvswitch-common': 'openvswitch', 'openvswitch-switch': 'openvswitch', 'python-dev': 'python-devel', 'python-libvirt': 'libvirt-python', 'python-memcache': 'python-memcached', 'python-mysqldb': 'MySQL-python', 'python-numpy': 'numpy', 'python-pyopenssl': 'pyOpenSSL', 'python-xattr': 'pyxattr', 'qemu-utils': 'qemu-img', 'qpid-client': 'qpid-cpp-client', 'qpidd': 'qpid-cpp-server', 'snmp-mibs-downloader': '', 'snmpd': 'net-snmp', 'stunnel4': 'stunnel', 'tftpd-hpa': 'tftp-server', 'tgt': 'scsi-target-utils', 'vlan': 'vconfig', # openstack mappings 'openstack-neutron-dhcp-agent': 'openstack-neutron', } deprecated = [] for arg in sys.argv[1:]: if arg not in package_map and arg.endswith('-dev'): # convert -dev into devel converted = '%s%s' % (arg, 'el') deprecated.append((arg, converted)) print(converted) else: converted = package_map.get(arg, arg) if converted != arg: deprecated.append((arg, converted)) print(converted) if deprecated: print("WARNING: The following packages were re-mapped by " "redhat-common map-packages\n" "They should be converted to pkg-map:", file=sys.stderr) for arg, converted in deprecated: print(" %s -> %s" % (arg, converted), file=sys.stderr) sys.exit(0) # Tell emacs to use python-mode # Local variables: # mode: python # End: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/redhat-common/element-deps0000664000175000017500000000003115201026231026370 0ustar00zuulzuulpackage-installs sysprep ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.390238 diskimage_builder-3.42.0/diskimage_builder/elements/redhat-common/environment.d/0000775000175000017500000000000015201026275026667 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/redhat-common/environment.d/50-redhat-common0000664000175000017500000000014215201026231031556 0ustar00zuulzuulexport DIB_DISABLE_KERNEL_CLEANUP=${DIB_DISABLE_KERNEL_CLEANUP:-0} export DIB_INIT_SYSTEM=systemd ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.390238 diskimage_builder-3.42.0/diskimage_builder/elements/redhat-common/finalise.d/0000775000175000017500000000000015201026275026115 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/redhat-common/finalise.d/01-clean-old-kernels0000775000175000017500000000114215201026231031546 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [ $DIB_DISABLE_KERNEL_CLEANUP -ne 0 ]; then echo "Skipping kernel cleanup as configured" exit 0 fi YUM=${YUM:-yum} if [[ ${YUM} == "dnf" ]]; then # cribbed from # http://dnf.readthedocs.org/en/latest/cli_vs_yum.html _old_kernels="$(dnf repoquery --installonly --latest-limit=-1 -q)" if [[ -n "${_old_kernels}" ]]; then dnf remove -y --setopt=protect_running_kernel=False ${_old_kernels} fi else install-packages yum-utils package-cleanup --oldkernels -y --count=1 fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/redhat-common/package-installs.yaml0000664000175000017500000000057015201026231030201 0ustar00zuulzuul# Install any packages in this file that may not be in the base cloud # image but could reasonably be expected lsof: tcpdump: traceroute: which: gettext: phase: pre-install.d ca-certificates: # selinux-targeted policy and related tools selinux-policy: selinux-policy-targeted: python3-libselinux: python3-policycoreutils: policycoreutils-python-utils: rng-tools: passwd: ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.390238 diskimage_builder-3.42.0/diskimage_builder/elements/replace-partition/0000775000175000017500000000000015201026275024766 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/replace-partition/README.rst0000664000175000017500000000344115201026231026447 0ustar00zuulzuul================= replace-partition ================= A standalone element which consumes a base image which was created with ``diskimage-builder`` and rebuilds it without making any packaging changes. This allows the image contents to be copied to a new block device layout. Use cases for this element include: * Rebuilding a whole-disk image with a different partition layout by setting ``DIB_BLOCK_DEVICE_CONFIG`` * Rebuilding a whole-disk image with the same partitions but with the sector size increased to 4096 bytes See element ``replace-partition-redhat`` for a full example of how to use this element .. WARNING:: When using this element or elements based upon it, differences in the needs of ramdisk component artifacts are generally **not** accounted for. I.E. if you rebuild an image which did not have LVM to a disk layout with LVM, then the image is *unlikely* to work because the ramdisk lacks the contents necessary to detect and initailize the ramdisk. .. WARNING:: When rebuilding images, specifically with filesystems like XFS, you should utilize diskimage-builder on the same OS and Version as the image you are rebuilding. This is because some filesystem version and metadata characteristics of newer host kernels can prevent the image from being used by the kernel inside of the image. This is most pertinant with the XFS filesystem, but there may be other cases we are unaware of. Arguments ========= The following arguments are mandatory and should be set to the correct values as for other distro elements: * ``DISTRO_NAME`` * ``DIB_RELEASE`` * ``EFI_BOOT_DIR`` * ``DIB_INIT_SYSTEM`` * ``DIB_BLOCK_DEVICE`` * ``DIB_LOCAL_IMAGE`` ``DIB_SOURCE_BLOCK_SIZE`` can be set to 4096 if the base image ``DIB_LOCAL_IMAGE`` was created with a 4096 byte sector size. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/replace-partition/element-deps0000664000175000017500000000001215201026231027254 0ustar00zuulzuulbootloader././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/replace-partition/element-provides0000664000175000017500000000002015201026231030153 0ustar00zuulzuuloperating-system././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.391238 diskimage_builder-3.42.0/diskimage_builder/elements/replace-partition/environment.d/0000775000175000017500000000000015201026275027554 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021500000000000010213 xustar00119 path=diskimage_builder-3.42.0/diskimage_builder/elements/replace-partition/environment.d/10-replace-partition.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/replace-partition/environment.d/10-replace-parti0000664000175000017500000000131215201026231032432 0ustar00zuulzuulif [ -z "${DISTRO_NAME:-}" ]; then echo "DISTRO_NAME is not set! Can not continue" exit 1 fi if [ -z "${DIB_RELEASE:-}" ]; then echo "DIB_RELEASE is not set! Can not continue" exit 1 fi if [ -z "${EFI_BOOT_DIR:-}" ]; then echo "EFI_BOOT_DIR is not set! Can not continue" exit 1 fi if [ -z "${DIB_INIT_SYSTEM:-}" ]; then echo "DIB_INIT_SYSTEM is not set! Can not continue" exit 1 fi if [ -z "${DIB_BLOCK_DEVICE:-}" ]; then echo "DIB_BLOCK_DEVICE is not set! Can not continue" exit 1 fi export DIB_SKIP_GRUB_PACKAGE_INSTALL=True export DIB_SKIP_BASE_PACKAGE_INSTALL=1 export DIB_AVOID_PACKAGES_UPDATE=1 export DIB_IMAGE_EXTRACT_GUESTFISH=True export DIB_SOURCE_BLOCK_SIZE=512 ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.391238 diskimage_builder-3.42.0/diskimage_builder/elements/replace-partition/root.d/0000775000175000017500000000000015201026275026173 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/replace-partition/root.d/10-local-image-extract0000775000175000017500000000125015201026231032147 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail [ -n "$TARGET_ROOT" ] DIB_LOCAL_IMAGE=${DIB_LOCAL_IMAGE:-""} if [ -n "$DIB_LOCAL_IMAGE" ]; then IMAGE_LOCATION=$DIB_LOCAL_IMAGE # No need to copy a local image into the cache directory, so just specify # the cached path as the original path. CACHED_IMAGE=$IMAGE_LOCATION else echo "DIB_LOCAL_IMAGE is required" exit 1 fi guestfish -v -x -i --blocksize=$DIB_SOURCE_BLOCK_SIZE -a $CACHED_IMAGE < /tmp/yum-blacklist ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.393238 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/0000775000175000017500000000000015201026275024453 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/README.rst0000664000175000017500000000046015201026231026132 0ustar00zuulzuul================ rocky-container ================ Create a minimal image based on Rocky Linux container image This element sets the ``DISTRO_NAME`` var to 'rocky'. The release of rocky to be installed can be controlled through the ``DIB_RELEASE`` variable, which defaults the latest supported release. ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.393238 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/containerfiles/0000775000175000017500000000000015201026275027460 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/containerfiles/100000664000175000017500000000110615201026231027611 0ustar00zuulzuulFROM quay.io/rockylinux/rockylinux:10 RUN dnf group install -y 'Minimal Install' --allowerasing && \ dnf install -y findutils util-linux sudo python3 NetworkManager \ NetworkManager-config-server curl libcurl --allowerasing RUN systemctl unmask console-getty.service dev-hugepages.mount \ getty.target sys-fs-fuse-connections.mount systemd-logind.service \ systemd-remount-fs.service # /etc/machine-id needs to be populated for /bin/kernel-install to # correctly copy kernels into /boot. We will clear this out in the # final image. RUN systemd-machine-id-setup ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/containerfiles/80000664000175000017500000000110515201026231027537 0ustar00zuulzuulFROM quay.io/rockylinux/rockylinux:8 RUN dnf group install -y 'Minimal Install' --allowerasing && \ dnf install -y findutils util-linux sudo python3 NetworkManager \ NetworkManager-config-server curl libcurl --allowerasing RUN systemctl unmask console-getty.service dev-hugepages.mount \ getty.target sys-fs-fuse-connections.mount systemd-logind.service \ systemd-remount-fs.service # /etc/machine-id needs to be populated for /bin/kernel-install to # correctly copy kernels into /boot. We will clear this out in the # final image. RUN systemd-machine-id-setup ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/containerfiles/90000664000175000017500000000110515201026231027540 0ustar00zuulzuulFROM quay.io/rockylinux/rockylinux:9 RUN dnf group install -y 'Minimal Install' --allowerasing && \ dnf install -y findutils util-linux sudo python3 NetworkManager \ NetworkManager-config-server curl libcurl --allowerasing RUN systemctl unmask console-getty.service dev-hugepages.mount \ getty.target sys-fs-fuse-connections.mount systemd-logind.service \ systemd-remount-fs.service # /etc/machine-id needs to be populated for /bin/kernel-install to # correctly copy kernels into /boot. We will clear this out in the # final image. RUN systemd-machine-id-setup ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/element-deps0000664000175000017500000000013215201026231026744 0ustar00zuulzuulcache-url containerfile package-installs redhat-common rpm-distro source-repositories yum ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.393238 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/environment.d/0000775000175000017500000000000015201026275027241 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021600000000000010214 xustar00120 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/environment.d/10-01-rocky-distro-name.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/environment.d/10-01-rocky-distro0000664000175000017500000000025015201026231032236 0ustar00zuulzuulexport DISTRO_NAME=rocky export DIB_RELEASE=${DIB_RELEASE:-9} # always the most recent major export EFI_BOOT_DIR="EFI/rocky" export DIB_YUM_MINIMAL_CREATE_INTERFACES=0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/environment.d/11-yum-dnf.bash0000664000175000017500000000001715201026231031664 0ustar00zuulzuulexport YUM=dnf ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/package-installs.yaml0000664000175000017500000000017315201026231030552 0ustar00zuulzuulaudit: dnf-plugins-core: dracut: dracut-config-generic: grubby: kernel: initscripts: man-pages: redhat-rpm-config: passwd: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2872357 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/0000775000175000017500000000000015201026275027244 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.394238 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/build-succeeds/0000775000175000017500000000000015201026275032137 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/build-succeeds/REA0000664000175000017500000000005515201026231032461 0ustar00zuulzuulVerify we can build a rocky-container image. ././@PaxHeader0000000000000000000000000000021500000000000010213 xustar00119 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/build-succeeds/ele0000664000175000017500000000000315201026231032610 0ustar00zuulzuulvm ././@PaxHeader0000000000000000000000000000022700000000000010216 xustar00124 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-aarch64-build-succeeds/ 27 mtime=1778658493.394238 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-aarch64-b0000775000175000017500000000000015201026275032177 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023400000000000010214 xustar00134 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-aarch64-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-aarch64-b0000664000175000017500000000004015201026231032163 0ustar00zuulzuulVerify a Rocky 10 aarch64 image ././@PaxHeader0000000000000000000000000000023600000000000010216 xustar00136 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-aarch64-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-aarch64-b0000664000175000017500000000002415201026231032165 0ustar00zuulzuulblock-device-efi vm ././@PaxHeader0000000000000000000000000000024500000000000010216 xustar00138 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-aarch64-build-succeeds/environment.d/ 27 mtime=1778658493.394238 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-aarch64-b0000775000175000017500000000000015201026275032177 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000026200000000000010215 xustar00156 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-aarch64-build-succeeds/environment.d/09-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-aarch64-b0000664000175000017500000000003015201026231032162 0ustar00zuulzuulexport DIB_RELEASE='10' ././@PaxHeader0000000000000000000000000000021700000000000010215 xustar00116 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-build-succeeds/ 27 mtime=1778658493.394238 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-build-suc0000775000175000017500000000000015201026275032417 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022400000000000010213 xustar00126 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-build-suc0000664000175000017500000000003015201026231032402 0ustar00zuulzuulVerify a Rocky 10 image ././@PaxHeader0000000000000000000000000000022600000000000010215 xustar00128 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-build-suc0000664000175000017500000000002415201026231032405 0ustar00zuulzuulblock-device-efi vm ././@PaxHeader0000000000000000000000000000023500000000000010215 xustar00130 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-build-succeeds/environment.d/ 27 mtime=1778658493.394238 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-build-suc0000775000175000017500000000000015201026275032417 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000025200000000000010214 xustar00148 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-build-succeeds/environment.d/09-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-10-build-suc0000664000175000017500000000003015201026231032402 0ustar00zuulzuulexport DIB_RELEASE='10' ././@PaxHeader0000000000000000000000000000022700000000000010216 xustar00123 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-aarch64-build-succeeds/ 28 mtime=1778658493.3952382 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-aarch64-bu0000775000175000017500000000000015201026275032314 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023300000000000010213 xustar00133 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-aarch64-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-aarch64-bu0000664000175000017500000000003715201026231032306 0ustar00zuulzuulVerify a Rocky 9 aarch64 image ././@PaxHeader0000000000000000000000000000023500000000000010215 xustar00135 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-aarch64-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-aarch64-bu0000664000175000017500000000005115201026231032302 0ustar00zuulzuulblock-device-efi openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000024500000000000010216 xustar00137 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-aarch64-build-succeeds/environment.d/ 28 mtime=1778658493.3952382 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-aarch64-bu0000775000175000017500000000000015201026275032314 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000026100000000000010214 xustar00155 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-aarch64-build-succeeds/environment.d/09-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-aarch64-bu0000664000175000017500000000002715201026231032305 0ustar00zuulzuulexport DIB_RELEASE='9' ././@PaxHeader0000000000000000000000000000021700000000000010215 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-build-succeeds/ 28 mtime=1778658493.3952382 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-build-succ0000775000175000017500000000000015201026275032512 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022300000000000010212 xustar00125 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-build-succ0000664000175000017500000000002715201026231032503 0ustar00zuulzuulVerify a Rocky 9 image ././@PaxHeader0000000000000000000000000000022500000000000010214 xustar00127 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-build-succ0000664000175000017500000000002415201026231032500 0ustar00zuulzuulblock-device-efi vm ././@PaxHeader0000000000000000000000000000023500000000000010215 xustar00129 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-build-succeeds/environment.d/ 28 mtime=1778658493.3952382 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-build-succ0000775000175000017500000000000015201026275032512 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000025100000000000010213 xustar00147 path=diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-build-succeeds/environment.d/09-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rocky-container/test-elements/rocky-9-build-succ0000664000175000017500000000002715201026231032503 0ustar00zuulzuulexport DIB_RELEASE='9' ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3952382 diskimage_builder-3.42.0/diskimage_builder/elements/rpm-distro/0000775000175000017500000000000015201026275023444 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rpm-distro/README.rst0000664000175000017500000000010415201026231025116 0ustar00zuulzuulrpm-distro ---------- Base element for distributions based on RPM. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rpm-distro/element-deps0000664000175000017500000000003115201026231025733 0ustar00zuulzuulselinux-fixfiles-restore ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3952382 diskimage_builder-3.42.0/diskimage_builder/elements/rpm-distro/post-install.d/0000775000175000017500000000000015201026275026317 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/rpm-distro/post-install.d/06-network-config-nonzeroconf 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rpm-distro/post-install.d/06-network-config-nonz0000775000175000017500000000054715201026231032404 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # zeroconf should not be activated or it will add a 169.254.0.0 # route. The route will interfere with access to the nova metadata # server at 169.254.169.254. if ! grep NOZEROCONF /etc/sysconfig/network ; then echo "NOZEROCONF=yes" >> /etc/sysconfig/network fi ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.396238 diskimage_builder-3.42.0/diskimage_builder/elements/rpm-distro/pre-install.d/0000775000175000017500000000000015201026275026120 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rpm-distro/pre-install.d/00-fix-requiretty0000775000175000017500000000073415201026231031260 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # Fedora sets requiretty by default, which while great for machines that are # going to see a lot of passwords sent over the wire because of interactive # activity, that's not how we're using these. Remove the setting, and the # comments about it sed -i -e '/^Defaults\s*requiretty/d' -e '/Disable "ssh hostname/d' /etc/sudoers sed -i -e '/You have to run/d' /etc/sudoers visudo -c ././@PaxHeader0000000000000000000000000000021100000000000010207 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/rpm-distro/pre-install.d/00-usr-local-bin-secure-path 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rpm-distro/pre-install.d/00-usr-local-bin-secure0000775000175000017500000000026315201026231032207 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail sed -i -e "/secure_path/ s@\([\'\"]\?\)\$@:/usr/local/bin/\1@" /etc/sudoers visudo -c ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/rpm-distro/pre-install.d/01-override-yum-arch0000775000175000017500000000165715201026231031627 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [[ "amd64 x86_64" =~ "$ARCH" ]]; then basearch=x86_64 arch=x86_64 elif [[ "$ARCH" = "ppc64" ]]; then basearch=ppc64 arch=ppc64 elif [[ "$ARCH" = "ppc64le" ]]; then basearch=ppc64le arch=ppc64le elif [[ "arm64 aarch64" =~ "$ARCH" ]]; then basearch=aarch64 arch=aarch64 else echo "********************" echo "Unknown arch '$ARCH'" echo "********************" exit 1 fi if [[ ${YUM} == "dnf" ]]; then mkdir -p /etc/dnf/vars echo $basearch > /etc/dnf/vars/basearch echo $arch > /etc/dnf/vars/arch else echo $basearch > /etc/yum/vars/basearch echo $arch > /etc/yum/vars/arch fi if [[ ${DISTRO_NAME} =~ "centos" ]]; then if [[ ${arch} == "x86_64" ]]; then contentdir=centos else contentdir=altarch fi echo $contentdir > /etc/${YUM}/vars/contentdir fi ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.396238 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/0000775000175000017500000000000015201026275025546 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/README.rst0000664000175000017500000000063415201026231027230 0ustar00zuulzuul===================== runtime-ssh-host-keys ===================== An element to generate SSH host keys on first boot. Since ssh key generation is not yet common to all operating systems, we need to create a DIB element to manage this. We force the removal of the SSH host keys, then add init scripts to generate them on first boot. This element currently supports Debian and Ubuntu (both systemd and upstart). ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.396238 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/cleanup.d/0000775000175000017500000000000015201026275027417 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/cleanup.d/90-remove-ssh-host-keys 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/cleanup.d/90-remove-ssh-ho0000775000175000017500000000050015201026231032252 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # Cloud images shouldn't have ssh host keys baked # in so that they are regenerated on first boot and # are unique. if [ -d $TARGET_ROOT/etc/ssh ] ; then sudo find $TARGET_ROOT/etc/ssh -name 'ssh_host*' -type f -delete fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/element-deps0000664000175000017500000000003715201026231030043 0ustar00zuulzuuldib-init-system install-static ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2882357 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/init-scripts/0000775000175000017500000000000015201026275030176 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.396238 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/init-scripts/systemd/0000775000175000017500000000000015201026275031666 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022100000000000010210 xustar00123 path=diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/init-scripts/systemd/ssh-keygen.service 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/init-scripts/systemd/ssh-k0000664000175000017500000000031115201026231032621 0ustar00zuulzuul[Unit] Description=OpenSSH Server Key Generation Before=ssh.service [Service] ExecStart=/usr/local/sbin/runtime-ssh-host-keys.sh Type=oneshot RemainAfterExit=yes [Install] WantedBy=multi-user.target ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.396238 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/init-scripts/upstart/0000775000175000017500000000000015201026275031700 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021600000000000010214 xustar00120 path=diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/init-scripts/upstart/ssh-keygen.conf 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/init-scripts/upstart/ssh-k0000664000175000017500000000020715201026231032637 0ustar00zuulzuuldescription "OpenSSH Server Key Generation" start on starting ssh console output task exec /usr/local/sbin/runtime-ssh-host-keys.sh ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/package-installs.yaml0000664000175000017500000000002015201026231031634 0ustar00zuulzuulopenssh-client: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/pkg-map0000664000175000017500000000026715201026231027022 0ustar00zuulzuul{ "family": { "redhat": { "openssh-client": "openssh" }, "gentoo": { "openssh-client": "" }, "suse": { "openssh-client": "openssh" } } } ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.396238 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/post-install.d/0000775000175000017500000000000015201026275030421 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020600000000000010213 xustar00112 path=diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/post-install.d/80-ssh-keygen 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/post-install.d/80-ssh-keyg0000775000175000017500000000144115201026231032316 0ustar00zuulzuul#!/bin/bash if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail case "$DIB_INIT_SYSTEM" in upstart) # nothing to do exit 0 ;; systemd) if [[ $DISTRO_NAME = "ubuntu" || $DISTRO_NAME = "debian" ]]; then # NOTE(pabelanger): Only support ubuntu / debian today. systemctl enable ssh-keygen.service else # Since we are not enabling it, delete it. rm /usr/lib/systemd/system/ssh-keygen.service fi ;; openrc) # let dib-init-system's postinstall handle enabling init scripts exit 0 ;; sysv) # nothing to do exit 0 ;; *) echo "Unsupported init system $DIB_INIT_SYSTEM" exit 1 ;; esac ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2882357 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/static/0000775000175000017500000000000015201026275027035 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2882357 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/static/usr/0000775000175000017500000000000015201026275027646 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2882357 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/static/usr/local/0000775000175000017500000000000015201026275030740 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.397238 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/static/usr/local/sbin/0000775000175000017500000000000015201026275031673 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023000000000000010210 xustar00130 path=diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/static/usr/local/sbin/runtime-ssh-host-keys.sh 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/runtime-ssh-host-keys/static/usr/local/sbin/runt0000775000175000017500000000202315201026231032576 0ustar00zuulzuul#!/bin/bash # Copyright 2016 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # dib-lint: disable=dibdebugtrace setpipefail set -exu # We are running into race conditions with glean, which ssh-keygen -A is # not handling properly. So, create a new script to first check if the # file exists, then use 'yes' to disable overwriting of existing files. for key in dsa ecdsa ed25519 rsa; do FILE=/etc/ssh/ssh_host_${key}_key if ! [ -f $FILE ]; then /usr/bin/yes n | /usr/bin/ssh-keygen -f $FILE -N '' -t $key fi done ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.397238 diskimage_builder-3.42.0/diskimage_builder/elements/select-boot-kernel-initrd/0000775000175000017500000000000015201026275026331 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/select-boot-kernel-initrd/README.rst0000664000175000017500000000052715201026231030014 0ustar00zuulzuul========================= select-boot-kernel-initrd ========================= A helper script to get the kernel and initrd image. It uses the function select_boot_kernel_initrd from the library img-functions to find the newest kernel and ramdisk in the image, and returns them as a concatenated string separating the values with a colon (:). ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.397238 diskimage_builder-3.42.0/diskimage_builder/elements/select-boot-kernel-initrd/bin/0000775000175000017500000000000015201026275027101 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/select-boot-kernel-initrd/bin/select-boot-kernel-initrd 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/select-boot-kernel-initrd/bin/select-boot-kernel0000775000175000017500000000147615201026231032525 0ustar00zuulzuul#!/bin/bash # Copyright 2012 Hewlett-Packard Development Company, L.P. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail source /lib/diskimage-builder/img-functions select_boot_kernel_initrd / echo ${KERNEL}:${RAMDISK} ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.397238 diskimage_builder-3.42.0/diskimage_builder/elements/select-boot-kernel-initrd/cleanup.d/0000775000175000017500000000000015201026275030202 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022300000000000010212 xustar00125 path=diskimage_builder-3.42.0/diskimage_builder/elements/select-boot-kernel-initrd/cleanup.d/99-remove-dib-img-functions 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/select-boot-kernel-initrd/cleanup.d/99-remove-di0000775000175000017500000000031515201026231032245 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail sudo rm -f $TMP_MOUNT_PATH/lib/diskimage-builder/img-functions sudo rmdir $TMP_MOUNT_PATH/lib/diskimage-builder ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.397238 diskimage_builder-3.42.0/diskimage_builder/elements/select-boot-kernel-initrd/extra-data.d/0000775000175000017500000000000015201026275030605 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022400000000000010213 xustar00126 path=diskimage_builder-3.42.0/diskimage_builder/elements/select-boot-kernel-initrd/extra-data.d/99-copy-dib-img-functions 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/select-boot-kernel-initrd/extra-data.d/99-copy-d0000775000175000017500000000045315201026231032157 0ustar00zuulzuul#!/bin/bash # Copy elements-functions into chroot so we can access the get_kernel_image function if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail sudo mkdir -p $TMP_MOUNT_PATH/lib/diskimage-builder sudo cp -t $TMP_MOUNT_PATH/lib/diskimage-builder $_LIB/img-functions ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.397238 diskimage_builder-3.42.0/diskimage_builder/elements/selinux-fixfiles-restore/0000775000175000017500000000000015201026275026323 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/selinux-fixfiles-restore/README.rst0000664000175000017500000000014515201026231030002 0ustar00zuulzuulselinux-fixfiles-restore ------------------------ Performs an selinux relabel in the cleanup phase. ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.397238 diskimage_builder-3.42.0/diskimage_builder/elements/selinux-fixfiles-restore/cleanup.d/0000775000175000017500000000000015201026275030174 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022200000000000010211 xustar00124 path=diskimage_builder-3.42.0/diskimage_builder/elements/selinux-fixfiles-restore/cleanup.d/99-selinux-fixfiles-restore 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/selinux-fixfiles-restore/cleanup.d/99-selinux-fi0000775000175000017500000001104615201026231032436 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail # parser isn't smart enough to figure out \ # dib-lint: disable=safe_sudo # Here be dragons ... a previous dragon slayer helpfully pointed out in # http://www.spinics.net/lists/selinux/msg17379.html # # Not all of the contexts defined by the offline system's # file_contexts may be valid under the policy of the host on which # you are running (e.g. if they run different distributions or even # different releases of the same distribution), which will normally # prevent setting those contexts (the kernel won't recognize them). # If you have this issue, you'll need to run setfiles as root in a # special domain, setfiles_mac_t, that is allowed to set contexts # unknown to the host policy, and likely chrooted so that it doesn't # ask the kernel whether the contexts are valid via # /sys/fs/selinux/context. That is how livecd-creator supported # creating images for other releases. # One issue you might see without fixing selinux file labels is sshd # will run in the kernel_t domain instead of the sshd_t domain, making # ssh connections fail with "Unable to get valid context for " # error message. Other failures will occur too. # XXX: is it really valid to build rpm-distros without this? if [[ ! -f ${TARGET_ROOT}/etc/selinux/targeted/contexts/files/file_contexts ]]; then echo "No selinux policy found in chroot, skipping..." exit 0 fi if [[ ! -x ${TARGET_ROOT}/usr/sbin/setfiles ]]; then echo "Can not find setfiles in chroot!" exit 1 fi # If we're on a selinux system, enable permissive mode for # setfiles_mac_t so we can relabel within the chroot without concern # for whatever policy is in the host kernel. We will run under # "runcon" to specifically allow this _runcon="" if [[ -d /sys/fs/selinux ]] && selinuxenabled; then sudo semanage permissive -a setfiles_mac_t _runcon="runcon -t setfiles_mac_t -- " fi # setfiles in > Fedora 26 added this flag: # do not read /proc/mounts to obtain a list of # non-seclabel mounts to be excluded from relabeling # checks. Setting this option is useful where there is # a non-seclabel fs mounted with a seclabel fs # this describes our situation of being on a loopback device on # an ubuntu system, say. See also # https://bugzilla.redhat.com/show_bug.cgi?id=1472709 _dash_m="" if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -ge 26 ]]; then _dash_m+="-m" fi IFS='|' read -ra SPLIT_MOUNTS <<< "$DIB_MOUNTPOINTS" for MOUNTPOINT in "${SPLIT_MOUNTS[@]}"; do if [ "${MOUNTPOINT}" != "/tmp/in_target.d" ] && [ "${MOUNTPOINT}" != "/dev" ] && [ "${MOUNTPOINT}" != "/boot/efi" ]; then if ! [ -z "${_runcon}" ] && ! pgrep kauditd >/dev/null; then echo "*** SELinux enabled and kauditd not found, suggesting auditing support is disabled in the host kernel. setfiles will fail without this, please enable and rebuild" exit 1 fi if [[ ${MOUNTPOINT} == "/" ]]; then # If you don't label /dev, /proc and /sys (the actual, # on-disk directory in the image) correctly, it will have # bad effects when things like systemd try to do things # like make network or process namespaces. This generally # leads to obscure and hard-to-debug failures; [1] has # plenty of examples. # # But right now, /{dev,proc,sys} are mounted! With the # extant block-device code, we do not have a point to # break in when these are unmounted, but before we've # unmounted everything. So we do a hack; for the root # directory, we bind mount the target so we see the # underlying directories, and then run setfiles on that. # # XXX: we might be able to uncondtionally do this for all # mountpoints? leaving well enough alone for now... # # [1] https://bugzilla.redhat.com/show_bug.cgi?id=1663040 TMP_BIND_MOUNT=$(mktemp -d) sudo mount --bind ${TARGET_ROOT} ${TMP_BIND_MOUNT} sudo ${_runcon} chroot ${TMP_BIND_MOUNT} \ /usr/sbin/setfiles -F ${_dash_m} \ /etc/selinux/targeted/contexts/files/file_contexts / sudo umount ${TMP_BIND_MOUNT} sudo rmdir ${TMP_BIND_MOUNT} else sudo ${_runcon} chroot ${TARGET_ROOT} \ /usr/sbin/setfiles -F ${_dash_m} \ /etc/selinux/targeted/contexts/files/file_contexts ${MOUNTPOINT} fi fi done ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3982382 diskimage_builder-3.42.0/diskimage_builder/elements/selinux-permissive/0000775000175000017500000000000015201026275025217 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/selinux-permissive/README.rst0000664000175000017500000000030415201026231026673 0ustar00zuulzuul================== selinux-permissive ================== Puts selinux into permissive mode by writing SELINUX=permissive to /etc/selinux/config Enable this element when debugging selinux issues. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3982382 diskimage_builder-3.42.0/diskimage_builder/elements/selinux-permissive/pre-install.d/0000775000175000017500000000000015201026275027673 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021200000000000010210 xustar00116 path=diskimage_builder-3.42.0/diskimage_builder/elements/selinux-permissive/pre-install.d/11-selinux-permissive 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/selinux-permissive/pre-install.d/11-selinux-perm0000775000175000017500000000030115201026231032452 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail echo "SELINUX=permissive" > /etc/selinux/config echo "SELINUXTYPE=targeted" >> /etc/selinux/config ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.3982382 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/0000775000175000017500000000000015201026275023576 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/README.rst0000664000175000017500000000616415201026231025264 0ustar00zuulzuul=========== simple-init =========== Basic network and system configuration that can't be done until boot Unfortunately, as much as we'd like to bake it in to an image, we can't know in advance how many network devices will be present, nor if DHCP is present in the host cloud. Additionally, in environments where cloud-init is not used, there are a couple of small things, like mounting config-drive and pulling ssh keys from it, that need to be done at boot time. .. note:: This element removes cloud-init as it can stomp on the configuration applied by glean, resulting in additional problems for operators, and a more difficult path troubleshooting. Autodetect network interfaces during boot and configure them ------------------------------------------------------------ The rationale for this is that we are likely to require multiple network interfaces for use cases such as baremetal and there is no way to know ahead of time which one is which, so we will simply run a DHCP client on all interfaces with real MAC addresses (except lo) that are visible on the first boot. The script `/usr/local/sbin/simple-init.sh` will be called early in each boot and will scan available network interfaces and ensure they are configured properly before networking services are started. Processing startup information from config-drive ------------------------------------------------ On most systems, the DHCP approach desribed above is fine. But in some clouds, such as Rackspace Public cloud, there is no DHCP. Instead, there is static network config via `config-drive`. `simple-init` will happily call `glean` which will do nothing if static network information is not there. Finally, glean will handle ssh-keypair-injection from config drive if cloud-init is not installed. Chosing glean installation source --------------------------------- By default glean is installed using pip using the latest release on pypi. It is also possible to install glean from a specified git repository location. This is useful for debugging and testing new glean changes for example. To do this you need to set these variables:: DIB_INSTALLTYPE_simple_init=repo DIB_REPOLOCATION_glean=/path/to/glean/repo DIB_REPOREF_glean=name_of_git_ref For example to test glean change 364516 do:: git clone https://opendev.org/opendev/glean /tmp/glean cd /tmp/glean git review -d 364516 git checkout -b my-test-ref Then set your DIB env vars like this before running DIB:: DIB_INSTALLTYPE_simple_init=repo DIB_REPOLOCATION_glean=/tmp/glean DIB_REPOREF_glean=my-test-ref NetworkManager -------------- By default, this uses the "legacy" scripts on each platform. To use NetworkManager instead, set ``DIB_SIMPLE_INIT_NETWORKMANAGER`` to non-zero. See the glean documentation for what the implications for this are on each platform. This is currently only implemented for CentOS and Fedora platforms. Fallback -------- Glean falls back to DHCPv4 for all interfaces that do not have an explicit configuration. If this is not desired, set the following variable to disable the fallback and leave such interfaces unconfigured:: export DIB_SIMPLE_INIT_NO_DHCP_FALLBACK=1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/element-deps0000664000175000017500000000015315201026231026072 0ustar00zuulzuulcloud-init-datasources dib-init-system ensure-venv install-types runtime-ssh-host-keys source-repositories ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.399238 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/environment.d/0000775000175000017500000000000015201026275026364 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/environment.d/15-simple-init-networkmanager 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/environment.d/15-simple-init-network0000664000175000017500000000104615201026231032444 0ustar00zuulzuulif [[ ${DISTRO_NAME} =~ (almalinux|centos|fedora|rocky) ]]; then export DIB_SIMPLE_INIT_NETWORKMANAGER=${DIB_SIMPLE_INIT_NETWORKMANAGER:-1} else export DIB_SIMPLE_INIT_NETWORKMANAGER=${DIB_SIMPLE_INIT_NETWORKMANAGER:-0} fi if [[ (${DISTRO_NAME} == "almalinux" || ${DISTRO_NAME} == "rocky") && $DIB_RELEASE > 7 ]] || [[ ${DISTRO_NAME} == "fedora" ]]; then if [[ $DIB_SIMPLE_INIT_NETWORKMANAGER == 0 ]]; then echo "simple-init only supports NetworkManager mode on Fedora and AlmaLinux/CentOS/Rocky 8/9/10" exit 1 fi fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/environment.d/50-disable-cloud-init0000664000175000017500000000005115201026231032165 0ustar00zuulzuulexport DIB_CLOUD_INIT_DATASOURCES="None" ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.399238 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/install.d/0000775000175000017500000000000015201026275025466 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/install.d/50-simple-init0000775000175000017500000000202315201026231030055 0ustar00zuulzuul#!/bin/bash # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail SCRIPTDIR=$(dirname $0) # Ensure the 8021q module is loaded so that glean can support tagged interfaces echo "8021q" >> /etc/modules enable_nm="" if [[ ${DIB_SIMPLE_INIT_NETWORKMANAGER} != 0 ]]; then enable_nm="--use-nm" fi no_dhcp_fallback="" if [[ ${DIB_SIMPLE_INIT_NO_DHCP_FALLBACK:-0} != 0 ]]; then no_dhcp_fallback="--no-dhcp-fallback" fi glean-install ${enable_nm} ${no_dhcp_fallback} ././@PaxHeader0000000000000000000000000000021200000000000010210 xustar00116 path=diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/install.d/60-simple-init-remove-interfaces 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/install.d/60-simple-init-remove-inte0000775000175000017500000000173015201026231032312 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # Cloud images may hard code the eth0/ens* interfaces so they # boot with DHCP. # Fedora rm -f /etc/sysconfig/network-scripts/ifcfg-eth* rm -f /etc/sysconfig/network-scripts/ifcfg-en* # SUSE rm -f /etc/sysconfig/network/ifcfg-eth* rm -f /etc/sysconfig/network/ifcfg-en* # Ubuntu and Debian rm -f /etc/network/interfaces.d/eth* rm -f /etc/network/interfaces.d/en* # Gentoo rm -f /etc/conf.d/net* # /etc/network/interfaces distributions if [ -f "/etc/network/interfaces" ]; then printf "auto lo\niface lo inet loopback\n\n" > /etc/network/interfaces if [ -d "/etc/network/interfaces.d/" ]; then if [ "$DISTRO_NAME" == "ubuntu" ] && [ "$DIB_RELEASE" == "trusty" ]; then printf "source-directory interfaces.d\n\n" >> /etc/network/interfaces else printf "source /etc/network/interfaces.d/*\n\n" >> /etc/network/interfaces fi fi fi ././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00112 path=diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/install.d/simple-init-package-install/ 27 mtime=1778658493.399238 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/install.d/simple-init-package-instal0000775000175000017500000000000015201026275032522 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000024200000000000010213 xustar00140 path=diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/install.d/simple-init-package-install/package-installs-simple-init 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/install.d/simple-init-package-instal0000664000175000017500000000000615201026231032510 0ustar00zuulzuulglean ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.399238 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/install.d/simple-init-repo-install/0000775000175000017500000000000015201026275032327 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/install.d/simple-init-repo-install/40-glean 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/install.d/simple-init-repo-install/40000775000175000017500000000213515201026231032411 0ustar00zuulzuul#!/bin/bash # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail python3 -m venv /usr/glean # glean requires PBR to install. We explicitly pip install it to avoid # SNI problems with pypi.org on older distros. /usr/glean/bin/pip install pbr /usr/glean/bin/pip install /tmp/glean.git mkdir -p /usr/local/bin ln -sf /usr/glean/bin/glean /usr/local/bin/glean ln -sf /usr/glean/bin/glean.sh /usr/local/bin/glean.sh ln -sf /usr/glean/bin/glean-install /usr/local/bin/glean-install ././@PaxHeader0000000000000000000000000000021200000000000010210 xustar00111 path=diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/install.d/simple-init-source-install/ 27 mtime=1778658493.399238 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/install.d/simple-init-source-install0000775000175000017500000000000015201026275032603 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021500000000000010213 xustar00119 path=diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/install.d/simple-init-source-install/40-glean 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/install.d/simple-init-source-install0000775000175000017500000000212415201026231032577 0ustar00zuulzuul#!/bin/bash # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail python3 -m venv /usr/glean # glean requires PBR to install. We explicitly pip install it to avoid # SNI problems with pypi.org on older distros. /usr/glean/bin/pip install pbr /usr/glean/bin/pip install glean mkdir -p /usr/local/bin ln -sf /usr/glean/bin/glean /usr/local/bin/glean ln -sf /usr/glean/bin/glean.sh /usr/local/bin/glean.sh ln -sf /usr/glean/bin/glean-install /usr/local/bin/glean-install ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/package-installs.yaml0000664000175000017500000000041115201026231027670 0ustar00zuulzuuldhcp-client: net-tools: ifupdown: network-scripts: when: DIB_SIMPLE_INIT_NETWORKMANAGER = 0 NetworkManager: when: DIB_SIMPLE_INIT_NETWORKMANAGER != 0 NetworkManager-initscripts-ifcfg-rh: when: DIB_SIMPLE_INIT_NETWORKMANAGER != 0 cloud-init: uninstall: True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/pkg-map0000664000175000017500000000230415201026231025044 0ustar00zuulzuul{ "family": { "redhat": { "dhcp-client": "dhclient", "glean": "python3-glean" }, "debian": { "dhcp-client": "isc-dhcp-client", "ifupdown": "ifupdown", "NetworkManager": "network-manager" }, "gentoo": { "dhcp-client": "net-misc/dhcp", "python-pip": "dev-python/pip", "net-tools": "sys-apps/net-tools" }, "suse": { "dhcp-client": "dhcp-client", "network-scripts": "wicked-service" } }, "distro": { "fedora": { "network-scripts": "network-scripts" } }, "release": { "almalinux": { "10": { "dhcp-client": "dhcpcd" } }, "centos": { "10-stream": { "dhcp-client": "dhcpcd" } }, "fedora": { "36": { "NetworkManager-initscripts-ifcfg-rh": "NetworkManager-initscripts-ifcfg-rh" }, "37": { "NetworkManager-initscripts-ifcfg-rh": "NetworkManager-initscripts-ifcfg-rh" } }, "rocky": { "10": { "dhcp-client": "dhcpcd" } } }, "default": { "dhcp-client": "isc-dhcp-client", "ifupdown": "", "network-scripts": "", "NetworkManager-initscripts-ifcfg-rh": "" } } ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.399238 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/post-install.d/0000775000175000017500000000000015201026275026451 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/post-install.d/80-simple-init0000775000175000017500000000152515201026231031051 0ustar00zuulzuul#!/bin/bash if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail case "$DIB_INIT_SYSTEM" in upstart) # nothing to do exit 0 ;; systemd) if [[ ${DISTRO_NAME} =~ (opensuse) ]]; then # on suse, this is named wicked.service, but it's the same # as network.service. systemctl enable wicked.service else # NOTE(ianw): it might be better to whitelist platforms in # the future, but for now assume it will "just work" true fi ;; openrc) # let dib-init-system's postinstall handle enabling init scripts exit 0 ;; sysv) # nothing to do exit 0 ;; *) echo "Unsupported init system $DIB_INIT_SYSTEM" exit 1 ;; esac ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/simple-init/source-repository-simple-init0000664000175000017500000000007315201026231031456 0ustar00zuulzuulglean git /tmp/glean.git https://opendev.org/opendev/glean ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4002383 diskimage_builder-3.42.0/diskimage_builder/elements/source-repositories/0000775000175000017500000000000015201026275025371 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/source-repositories/README.rst0000664000175000017500000001336715201026231027062 0ustar00zuulzuul=================== source-repositories =================== With this element other elements can register their installation source by placing their details in the file ``source-repository-*``. source-repository-* file format ------------------------------- The plain text file format is space separated and has four mandatory fields optionally followed by fields which are type dependent:: [] ``name`` Identifier for the source repository. Should match the file suffix. ``type`` Format of the source. Either ``git``, ``tar``, ``package`` or ``file``. ``destination`` Base path to place sources. ``location`` Resource to fetch sources from. For ``git`` the location is cloned. For ``tar`` it is extracted. ``ref`` (optional). Meaning depends on the ``type``: ``file``: unused/ignored. ``git``: a git reference to fetch. A value of "``*``" prunes and fetches all heads and tags. Defaults to ``master`` if not specified. ``tar``: | "``.``" extracts the entire contents of the tarball. | "``*``" extracts the contents within all its subdirectories. | A subdirectory path may be used to extract only its contents. | A specific file path within the archive is **not supported**. The lines in the source-repository scripts are eval'd, so they may contain environment variables. The ``package`` type indicates the element should install from packages onto the root filesystem of the image build during the ``install.d`` phase. If the element provides an -package-install directory, symlinks will be created for those scripts instead. ``git`` and ``tar`` are treated as source installs. If the element provides an -source-install directory under it's ``install.d`` hook directory, symlinks to the scripts in that directory will be created under ``install.d`` for the image build. For example, the nova element would provide:: nova/install.d/nova-package-install/74-nova nova/install.d/nova-source-install/74-nova source-repositories will create the following symlink for the package install type:: install.d/74-nova -> nova-package-install/74-nova Or, for the source install type:: install.d/74-nova -> nova-source-install/74-nova All other scripts that exist under ``install.d`` for an element will be executed as normal. This allows common install code to live in a script outside of -package-install or -source-install. If multiple elements register a source location with the same then source-repositories will exit with an error. Care should therefore be taken to only use elements together that download source to different locations. The repository paths built into the image are stored in etc/dib-source-repositories, one repository per line. This permits later review of the repositories (by users or by other elements). The repository names and types are written to an environment.d hook script at 01-source-repositories-environment. This allows later hook scripts during the install.d phase to know which install type to use for the element. An example of an element "custom-element" that wants to retrieve the ironic source from git and pbr from a tarball would be: *Element file: elements/custom-element/source-repository-ironic*:: ironic git /usr/local/ironic https://opendev.org/openstack/ironic.git *File : elements/custom-element/source-repository-pbr*:: pbr tar /usr/local/pbr http://tarballs.openstack.org/pbr/pbr-master.tar.gz . diskimage-builder will then retrieve the sources specified and place them at the directory ````. Override per source ------------------- A number of environment variables can be set by the process calling diskimage-builder which can change the details registered by the element, these are: ``DIB_REPOTYPE_`` : change the registered type ``DIB_REPOLOCATION_`` : change the registered location ``DIB_REPOREF_`` : change the registered reference For example if you would like diskimage-builder to get ironic from a local mirror you would override the ```` field and could set: .. sourcecode:: sh DIB_REPOLOCATION_ironic=git://localgitserver/ironic.git *As you can see above, the \ of the repo is used in several bash variables. In order to make this syntactically feasible, any characters not in the set \[A-Za-z0-9_\] will be converted to \_* *For instance, a repository named "diskimage-builder" would set a variable called "DIB_REPOTYPE_diskimage_builder"* Alternatively if you would like to use the keystone element and build an image with keystone from a stable branch *stable/grizzly* then you would set: .. sourcecode:: sh DIB_REPOREF_keystone=stable/grizzly If you wish to build an image using code from a Gerrit review, you can set ``DIB_REPOLOCATION_`` and ``DIB_REPOREF_`` to the values given by Gerrit in the fetch/pull section of a review. For example, setting up Nova with change 61972 at patchset 8: .. sourcecode:: sh DIB_REPOLOCATION_nova=https://review.opendev.org/openstack/nova DIB_REPOREF_nova=refs/changes/72/61972/8 Alternate behaviors ------------------- Override git remote ^^^^^^^^^^^^^^^^^^^ The base url for all git repositories can be set by use of: ``DIB_GITREPOBASE`` So setting ``DIB_GITREPOBASE=https://github.com/`` when the repo location is set to https://opendev.org/openstack/nova.git will result in use of the https://github.com/openstack/nova.git repository instead. Disable external fetches ^^^^^^^^^^^^^^^^^^^^^^^^ When doing image builds in environments where external resources are not allowed, it is possible to disable fetching of all source repositories by including an element in the image that sets ``NO_SOURCE_REPOSITORIES=1`` in an ``environment.d`` script. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/source-repositories/element-deps0000664000175000017500000000004515201026231027665 0ustar00zuulzuulcache-url manifests package-installs ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4002383 diskimage_builder-3.42.0/diskimage_builder/elements/source-repositories/extra-data.d/0000775000175000017500000000000015201026275027645 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/source-repositories/extra-data.d/98-source-repositories 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/source-repositories/extra-data.d/98-source-repos0000775000175000017500000003352015201026231032452 0ustar00zuulzuul#!/bin/bash # dib-lint: disable=safe_sudo if [ ${DIB_DEBUG_TRACE:-0} -gt 1 ]; then set -x fi set -eu set -o pipefail # Don't provide any source repositories in environments where they are not allowed if [ -n "${NO_SOURCE_REPOSITORIES:-}" ]; then exit 0 fi # If the old cache exists, move it to the new name function make_new_cache(){ local OLD_CACHE_BASE=$1 local CACHE_BASE=$2 # If the old cache name exists, move it to the new cache name if [ -e "$OLD_CACHE_BASE" ] ; then if [ ! -e "$CACHE_BASE" ] ; then mv -n $OLD_CACHE_BASE $CACHE_BASE else echo "Not replacing new cache location with old cache" fi fi } # Gets repositories or individual files listed in the a repository file # and places them in the specified destination path. # The format of the repository file is one or more lines matching # [] function get_repos_for_element(){ local REPO_SOURCES=$1 local CACHE_URL=$TMP_HOOKS_PATH/bin/cache-url local REGEX="^([^ ]+) (git|tar|file|package) ?(/[^ ]+)? ?([^ ]+)? ?([^ ]*)$" # this can be a rather long list (e.g. caching ~1000 openstack # repos), so we make a rough count for progress display local COUNT=1 local REPO_SOURCES_COUNT=$(grep -v '^$\|^\s*\#' $REPO_SOURCES | wc -l) while read line; do # temporarily turn off globbing '*' (since it may be used as # the REPOREF for tarballs) and expand variables set -f; line=$(eval echo $line); set +f # ignore blank lines and lines beginning in '#' [[ "$line" == \#* ]] || [[ -z "$line" ]] && continue # rough progress counter printf "(%04d / %04d)\n" ${COUNT} ${REPO_SOURCES_COUNT} COUNT=$(( COUNT + 1)) if [[ "$line" =~ $REGEX ]] ; then local REPONAME=${BASH_REMATCH[1]} local REPOTYPE=${BASH_REMATCH[2]} local REPOPATH=${BASH_REMATCH[3]} local REPOLOCATION=${BASH_REMATCH[4]} local REPO_ORIG_LOCATION=$REPOLOCATION if [ $REPONAME = "tar" -a -z "${BASH_REMATCH[5]:-}" ] ; then echo "Warning: Default tarball REPOREF of '*' is deprecated; do not rely on it." fi # Default of '*' for tar repositories is deprecated; do not rely on it. local REPOREF_DEFAULT_TAR=* local REPOREF_DEFAULT_GIT=master local REPOREF_LOOKUP_DEFAULT=REPOREF_DEFAULT_${REPOTYPE^^} local REPOREF=${BASH_REMATCH[5]:-${!REPOREF_LOOKUP_DEFAULT:-}} local REPO_DEST=$TMP_MOUNT_PATH$REPOPATH local REPO_SUB_DIRECTORY=$(dirname $REPO_DEST) # REPOTYPE can be overridden with DIB_REPOTYPE_{name} local REPOTYPE_OVERRIDE=DIB_REPOTYPE_${REPONAME//[^A-Za-z0-9]/_} REPOTYPE=${!REPOTYPE_OVERRIDE:-$REPOTYPE} # REPOLOCATION can be overridden with DIB_REPOLOCATION_{name} local REPOLOCATION_OVERRIDE=DIB_REPOLOCATION_${REPONAME//[^A-Za-z0-9]/_} REPOLOCATION=${!REPOLOCATION_OVERRIDE:-$REPOLOCATION} # REPOREF can be overridden with DIB_REPOREF_{name} local REPOREF_OVERRIDE=DIB_REPOREF_${REPONAME//[^A-Za-z0-9]/_} REPOREF=${!REPOREF_OVERRIDE:-$REPOREF} # Determine a unique cache path for this repo CACHE_NAME=$(echo "${REPOTYPE}_${REPOLOCATION}" | sha1sum | awk '{ print $1 }' ) OLD_CACHE_PATH=${CACHE_BASE}/${CACHE_NAME} # Add the repo name to the sha1sum for readability CACHE_NAME=${REPONAME//[^A-Za-z0-9]/_}_${CACHE_NAME} CACHE_PATH=${CACHE_BASE}/$CACHE_NAME make_new_cache $OLD_CACHE_PATH $CACHE_PATH # Return if install type is not source local INSTALL_TYPE_VAR=DIB_INSTALLTYPE_${REPONAME//[^A-Za-z0-9]/_} local INSTALL_TYPE=${!INSTALL_TYPE_VAR:-$DIB_DEFAULT_INSTALLTYPE} if [ ! $INSTALL_TYPE = "source" ]; then echo "$REPONAME install type not set to source" continue fi case $REPOTYPE in git) if [ -z "${!REPOLOCATION_OVERRIDE:-""}" -a -n "${DIB_GITREPOBASE:-""}" ] ; then # Transform the current repo base to the new one local NEW_REPOLOCATION=$(echo $REPOLOCATION |\ sed "s,^[^:]\+://[^/]\+/\(~[^/]\+\)\?\(.*\)$,${DIB_GITREPOBASE}\2,g") echo "Transformed ${REPOLOCATION} to ${NEW_REPOLOCATION}" REPOLOCATION=$NEW_REPOLOCATION # Also update the cache location CACHE_NAME=$(echo "${REPOTYPE}_${REPOLOCATION}" | sha1sum | awk '{ print $1 }' ) CACHE_PATH=~/.cache/image-create/repository-sources/$CACHE_NAME fi sudo mkdir -p $REPO_SUB_DIRECTORY if [ ! -e "$CACHE_PATH" ] ; then echo "Caching $REPONAME from $REPOLOCATION in $CACHE_PATH" attempt=1 success=0 max_attempts=5 while [[ $success == 0 ]] && [ $attempt -le $max_attempts ]; do set +e git clone -q $REPOLOCATION $CACHE_PATH.tmp if [ $? -eq 0 ]; then success=1 else echo "Attempt $attempt failed. Trying again..." rm -rf $CACHE_PATH.tmp attempt=$((attempt + 1)) if [ $attempt -le $max_attempts ] ; then sleep 5 fi fi set -e done if [ $success != 1 ]; then echo "The git clone command failed after $max_attempts attempts." exit 1 fi mv ${CACHE_PATH}{.tmp,} fi if [ "$REPOREF" != "*" ] ; then HAS_REF=$(git -C ${CACHE_PATH} name-rev $REPOREF 2>/dev/null || true) fi if [ -z "$DIB_OFFLINE" -o -z "${HAS_REF:-}" ] ; then echo "Updating cache of $REPOLOCATION in $CACHE_PATH with ref $REPOREF" # Copy named refs (which might be outside the usual heads # pattern) - e.g. gerrit if [ "$REPOREF" == "*" ] || ! git -C ${CACHE_PATH} fetch -q --prune --update-head-ok $REPOLOCATION \ +${REPOREF}:${REPOREF} ; then # Copy all heads from the remote repository - this permits # using a SHA1 object reference so long as the object # reference is reachable from one of the heads. git does # not permit arbitrary sha fetching from remote servers. # This is a separate fetch to the prior one as the prior # one will fail when REPOREF is a SHA1. attempt=1 success=0 max_attempts=5 while [[ $success == 0 ]] && [ $attempt -le $max_attempts ]; do set +e git -C $CACHE_PATH fetch -q --prune --update-head-ok \ $REPOLOCATION +refs/heads/*:refs/heads/* +refs/tags/*:refs/tags/* if [ $? -eq 0 ]; then success=1 else echo "Attempt $attempt failed. Trying again..." attempt=$((attempt + 1)) if [ $attempt -le $max_attempts ] ; then sleep 5 fi fi set -e done if [ $success != 1 ]; then echo "The command failed after $max_attempts attempts." exit 1 fi fi # Ensure that we have a reference to the revision. if [ "$REPOREF" != "*" ] ; then if ! git -C ${CACHE_PATH} rev-parse -q --verify $REPOREF^{commit} > /dev/null; then echo "Failed to find reference to $REPOREF" exit 1 fi fi fi echo "Cloning from $REPONAME cache and applying ref $REPOREF" # If the local dir is already used, see if the pertinent details differ if [[ -d $REPO_DEST ]]; then DESIRED="$(sudo git -C ${REPO_DEST} config remote.origin.url)" if [[ "$CACHE_PATH" != "$DESIRED" ]]; then echo "REPOLOCATIONS don't match ("$CACHE_PATH" != "$DESIRED")" >&2 exit 1 elif [[ "$REPOREF" != "*" ]]; then # When we first clone we create a branch naming what we fetched # that must match, or we are asking for two different references from the # same repo, which is an error if ! sudo git -C ${REPO_DEST} rev-parse fetch_$REPOREF; then echo "REPOREFS don't match - failed to get sha1 of fetch_$REPOREF" >&2 exit 1 fi fi else sudo git clone -q $CACHE_PATH $REPO_DEST if [[ "$REPOREF" == "*" ]]; then sudo git -C ${REPO_DEST} fetch -q --prune --update-head-ok $CACHE_PATH \ +refs/heads/*:refs/heads/* +refs/tags/*:refs/tags/* git_sha=$(sudo git -C ${REPO_DEST} rev-parse HEAD) else sudo git -C ${REPO_DEST} fetch -q $CACHE_PATH $REPOREF:fetch_$REPOREF sudo git -C ${REPO_DEST} reset --hard FETCH_HEAD # Get the sha in use git_sha=$(sudo git -C ${REPO_DEST} rev-parse FETCH_HEAD) fi # Write the sha being used into the source-repositories manifest echo "$REPONAME git $REPOPATH $REPOLOCATION $git_sha" >> $GIT_MANIFEST fi ;; tar) # The top level directory of the tarball mightn't have a fixed name i.e. # it could contain version numbers etc... so we write it to a tmpdir # for inspection before transferring the contents into the target directory local tmpdir=$(mktemp --tmpdir=$TMP_MOUNT_PATH/tmp -d) if [ -n "$CACHE_PATH" ] ; then echo "Caching $REPONAME tarball from $REPOLOCATION in $CACHE_PATH" if [ ! -f "$CACHE_PATH" -o -z "$DIB_OFFLINE" ] ; then $CACHE_URL $REPOLOCATION $CACHE_PATH fi tar -C $tmpdir -xzf $CACHE_PATH else echo "Fetching $REPONAME tarball from $REPOLOCATION" curl -f $REPOLOCATION | tar -C $tmpdir -xzf - fi sudo mkdir -p $REPO_DEST # A REPOREF of '.' will select the entire contents of the tarball, # while '*' will select only the contents of its subdirectories. sudo rsync -a --remove-source-files $tmpdir/$REPOREF/. $REPO_DEST rm -rf $tmpdir ;; file) sudo mkdir -p $REPO_SUB_DIRECTORY if [ -n "$CACHE_PATH" ] ; then echo "Caching $REPONAME file from $REPOLOCATION in $CACHE_PATH" if [ ! -f "$CACHE_PATH" -o -z "$DIB_OFFLINE" ] ; then $CACHE_URL $REPOLOCATION $CACHE_PATH fi sudo cp $CACHE_PATH $REPO_DEST else echo "Fetching $REPONAME file from $REPOLOCATION" sudo curl -f $REPOLOCATION -o $REPO_DEST fi ;; *) echo "Unsupported repository type: $REPOTYPE" return 1 ;; esac # Capture the in-instance repository path for later review / other # elements (like a pypi dependency cache). echo "$REPOPATH" | sudo tee -a $TMP_MOUNT_PATH/etc/dib-source-repositories > /dev/null else echo "Couldn't parse '$line' as a source repository" return 1 fi done < $REPO_SOURCES } CACHE_BASE=$DIB_IMAGE_CACHE/source-repositories OLD_CACHE_BASE=$DIB_IMAGE_CACHE/repository-sources make_new_cache $OLD_CACHE_BASE $CACHE_BASE mkdir -p $CACHE_BASE # Use the IMAGE_NAME from the calling script, and make it unique with the temporary path GIT_MANIFEST_NAME=dib-manifest-git-$(basename ${IMAGE_NAME}) GIT_MANIFEST_CACHE_NAME=${GIT_MANIFEST_NAME}_$(dirname ${TMP_MOUNT_PATH##*.}) GIT_MANIFEST=$CACHE_BASE/${GIT_MANIFEST_CACHE_NAME} rm -f $GIT_MANIFEST # Get source repositories for the target for _SOURCEREPO in $(find $TMP_HOOKS_PATH -maxdepth 1 -name "source-repository-*" -not -name '*~'); do repo_flock=$CACHE_BASE/repositories_flock ( echo "Getting $repo_flock: $(date) for $_SOURCEREPO" if ! flock -w 600 9 ; then echo "Did not get $repo_flock: $(date)" exit 1 fi get_repos_for_element $_SOURCEREPO ) 9> $repo_flock done # Copy the manifest into the image if it exists (there may be no git repositories used) if [ -e "$GIT_MANIFEST" ] ; then sudo mv $GIT_MANIFEST $TMP_MOUNT_PATH/${DIB_MANIFEST_IMAGE_DIR}/$GIT_MANIFEST_NAME fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/source-repositories/package-installs.yaml0000664000175000017500000000035015201026231031465 0ustar00zuulzuul# Git isn't a dependency of this element, but is a dependency of pbr # if you are doing pip install on a git cloned directory, because this # looks to be a fairly common pattern it makes sense to have git on the # target image git: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/source-repositories/pkg-map0000664000175000017500000000031015201026231026632 0ustar00zuulzuul{ "family": { "gentoo": { "git": "dev-vcs/git" }, "redhat": { "git": "git-core" }, "suse": { "git": "git-core" } }, "default": { "git": "git" } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4002383 diskimage_builder-3.42.0/diskimage_builder/elements/stable-interface-names/0000775000175000017500000000000015201026275025655 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/stable-interface-names/README.rst0000664000175000017500000000036515201026231027340 0ustar00zuulzuul====================== stable-interface-names ====================== Does the following: * Enables stable network interface naming (em1, em2, etc) by installing the biosdevname and removes any symlinks which may disable udev rules, etc. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/stable-interface-names/element-deps0000664000175000017500000000002115201026231030143 0ustar00zuulzuulpackage-installs ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4002383 diskimage_builder-3.42.0/diskimage_builder/elements/stable-interface-names/install.d/0000775000175000017500000000000015201026275027545 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021600000000000010214 xustar00120 path=diskimage_builder-3.42.0/diskimage_builder/elements/stable-interface-names/install.d/02-stable-interface-names 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/stable-interface-names/install.d/02-stable-inter0000775000175000017500000000042715201026231032276 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # remove softlink to /dev/null which disables these rules NET_NAME_SLOT_FILE="/etc/udev/rules.d/80-net-name-slot.rules" if [ -h $NET_NAME_SLOT_FILE ]; then rm $NET_NAME_SLOT_FILE fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/stable-interface-names/package-installs.yaml0000664000175000017500000000001515201026231031747 0ustar00zuulzuulbiosdevname: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4012382 diskimage_builder-3.42.0/diskimage_builder/elements/svc-map/0000775000175000017500000000000015201026275022712 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/svc-map/README.rst0000664000175000017500000000573415201026231024402 0ustar00zuulzuul======= svc-map ======= Map service names to distro specific services. Provides the following: * bin/svc-map usage: svc-map [-h] SERVICE Translate service name to distro specific name. optional arguments: -h, --help show this help message and exit * Any element may create its own svc-map YAML config file using the one of 3 sections for the distro/family/ and or default. The family is set automatically within svc-map based on the supplied distro name. Families include: + redhat: includes centos, fedora, and rhel distros + debian: includes debian and ubuntu distros + suse: includes the opensuse distro The most specific section takes priority. Example for Nova and Glance (NOTE: default is using the common value for redhat and suse families) The key used for the service name should always be the same name used for the source installation of the service. The svc-map script will check for the source name against systemd and upstart and return that name if it exists instead of the mapped name. Example format for Nova:: nova-api: default: openstack-nova-api debian: nova-api nova-cert: default: openstack-nova-cert debian: nova-cert nova-compute: default: openstack-nova-compute debian: nova-compute nova-conductor: default: openstack-nova-conductor debian: nova-conductor nova-consoleauth: default: openstack-nova-console debian: nova-console Example format for Glance:: glance-api: debian: glance-api default: openstack-glance-api If the distro is of the debian family the combined services file would be:: nova-cert: nova-cert nova-compute: nova-compute glance-api: glance-api nova-conductor: nova-conductor nova-api: nova-api glance-reg: glance-reg nova-consoleauth: nova-console If the distro is of the suse or redhat families the combined services file would be:: nova-cert: openstack-nova-cert nova-compute: openstack-nova-compute glance-reg: openstack-glance-registry nova-conductor: openstack-nova-conductor glance-api: openstack-glance-api nova-consoleauth: openstack-nova-console nova-api: openstack-nova-api Example commands using this format:: svc-map nova-compute Returns: openstack-nova-compute svc-map nova-compute Returns: openstack-nova-compute svc-map nova-compute Returns: nova-compute * This output can be used to filter what other tools actually install (install-services can be modified to use this for example) * If you pass more than one service argument, the result for each service is printed on its own line. * Individual svc-map files live within each element. For example if you have created an Apache element your svc-map YAML file should be created at elements/apache/svc-map. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/svc-map/__init__.py0000664000175000017500000000000015201026231025001 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4012382 diskimage_builder-3.42.0/diskimage_builder/elements/svc-map/bin/0000775000175000017500000000000015201026275023462 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/svc-map/bin/svc-map0000775000175000017500000000275715201026231024761 0ustar00zuulzuul#!/usr/bin/env python3 # Copyright 2012 Hewlett-Packard Development Company, L.P. # Copyright 2014 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import os import sys import yaml def load_service_mapping(filepath="/usr/share/svc-map/services"): if not os.path.isfile(filepath): return {} with open(filepath, 'r') as data_file: return yaml.safe_load(data_file.read()) def main(): for arg in sys.argv[1:]: # We need to support the service name being different when installing # from source vs. packages. So, if the requested service file already # exists, just use that. if os.path.exists('/lib/systemd/system/%s.service' % arg): # systemd print(arg) elif os.path.exists('/etc/init/%s.conf' % arg): # upstart print(arg) else: service_map = load_service_mapping() name = service_map.get(arg, arg) print(name) sys.exit(0) if __name__ == '__main__': main() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/svc-map/element-deps0000664000175000017500000000001315201026231025201 0ustar00zuulzuuldib-python ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4012382 diskimage_builder-3.42.0/diskimage_builder/elements/svc-map/extra-data.d/0000775000175000017500000000000015201026275025166 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/svc-map/extra-data.d/10-merge-svc-map-files0000775000175000017500000000537115201026231031073 0ustar00zuulzuul#!/usr/bin/env python3 # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import os import sys import yaml def os_family(distro): "Given a distribution, returns a operating system family." family = None if distro in ['centos', 'fedora', 'rhel']: family = 'redhat' elif distro in ['debian', 'ubuntu']: family = 'debian' elif distro == 'opensuse': family = 'suse' return family def merge_data(source, destination, distro): """Merges two dictionaries and filters on distro. Merges two dictionaries and filters on distro family, or default (in order) """ result = dict() result.update(destination) family = os_family(distro) for servicename, mapping in source.items(): if servicename in result: raise Exception("%s already found in services list" % servicename) if distro in mapping: result[servicename] = mapping.get(distro) elif family in mapping: result[servicename] = mapping.get(family) elif 'default' in mapping: result[servicename] = mapping.get('default') else: result[servicename] = servicename return result def write_data_to_file(data, service_file_path): """Writes yaml data to a specified path.""" with open(service_file_path, 'w') as destination: yaml.dump(data, destination, default_flow_style=False) def main(): elements = yaml.safe_load(os.environ.get("IMAGE_ELEMENT_YAML")) service_names = dict() for element, path in elements.items(): data_path = os.path.join(path, "svc-map") if os.path.exists(data_path): with open(data_path, 'r') as dataFile: data = yaml.safe_load(dataFile.read()) try: service_names = merge_data( data, service_names, os.environ.get("DISTRO_NAME")) except Exception as err: print("%s. Check %s for duplicate" " service name." % (err, element)) sys.exit(1) write_data_to_file( service_names, os.path.join(os.environ['TMP_MOUNT_PATH'], 'tmp', 'svc-map-services')) if __name__ == "__main__": main() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/svc-map/extra-data.d/11-copy-svc-map-file0000775000175000017500000000031315201026231030553 0ustar00zuulzuul#!/bin/bash if [ "${DIB_DEBUG_TRACE:-1}" -gt 0 ]; then set -x fi set -eu set -o pipefail sudo install -D -m 0644 "$TMP_MOUNT_PATH/tmp/svc-map-services" "$TMP_MOUNT_PATH/usr/share/svc-map/services" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/svc-map/package-installs.yaml0000664000175000017500000000017615201026231027014 0ustar00zuulzuulPyYAML: phase: pre-install.d dib_python_version: 2 python3-PyYAML: phase: pre-install.d dib_python_version: 3 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/svc-map/pkg-map0000664000175000017500000000067415201026231024170 0ustar00zuulzuul{ "family": { "debian": { "PyYAML": "python-yaml", "python3-PyYAML": "python3-yaml" }, "gentoo": { "PyYAML": "dev-python/pyyaml", "python3-PyYAML": "dev-python/pyyaml" }, "redhat": { "PyYAML": "PyYAML", "python3-PyYAML": "python3-pyyaml" }, "suse": { "PyYAML": "python-PyYAML" } }, "default": { "PyYAML": "PyYAML", "python3-PyYAML": "python3-PyYAML" } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4022381 diskimage_builder-3.42.0/diskimage_builder/elements/svc-map/tests/0000775000175000017500000000000015201026275024054 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/svc-map/tests/__init__.py0000664000175000017500000000000015201026231026143 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/svc-map/tests/test_data_merge.py0000664000175000017500000001441115201026231027546 0ustar00zuulzuul# Copyright 2014 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import importlib import os import sys from oslotest import base importlib.machinery.SOURCE_SUFFIXES.append('') file_path = (os.path.dirname(os.path.realpath(__file__)) + '/../extra-data.d/10-merge-svc-map-files') spec = importlib.util.spec_from_file_location('service_map', file_path) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) sys.modules['service_map'] = module service_map = module importlib.machinery.SOURCE_SUFFIXES.pop() class TestDataMerge(base.BaseTestCase): nova_api_services = { u'nova-api': { u'debian': u'nova-api', u'default': u'openstack-nova-api' }, u'nova-cert': { u'debian': u'nova-cert', u'default': u'openstack-nova-cert' }, u'nova-compute': { u'debian': u'nova-compute', u'default': u'openstack-nova-compute' }, u'nova-conductor': { u'debian': u'nova-conductor', u'default': u'openstack-nova-conductor' }, u'nova-consoleauth': { u'debian': u'nova-console', u'default': u'openstack-nova-console' } } glance_api_services = { u'glance-api': { u'debian': u'glance-api', u'default': u'openstack-glance-api' }, } cinder_api_services = { u'cinder-api': { u'debian': u'cinder-api', u'default': u'openstack-cinder-api' }, u'cinder-scheduler': { u'debian': u'cinder-scheduler', u'default': u'openstack-cinder-scheduler' } } def test_merge_data_fedora(self): fedora_nova_api_services = { u'nova-api': u'openstack-nova-api', u'nova-cert': u'openstack-nova-cert', u'nova-compute': u'openstack-nova-compute', u'nova-conductor': u'openstack-nova-conductor', u'nova-consoleauth': u'openstack-nova-console' } fedora_nova_glance_services = { u'nova-api': u'openstack-nova-api', u'nova-cert': u'openstack-nova-cert', u'nova-compute': u'openstack-nova-compute', u'nova-conductor': u'openstack-nova-conductor', u'nova-consoleauth': u'openstack-nova-console', u'glance-api': u'openstack-glance-api', } fedora_nova_glance_cinder_services = { u'nova-api': u'openstack-nova-api', u'nova-cert': u'openstack-nova-cert', u'nova-compute': u'openstack-nova-compute', u'nova-conductor': u'openstack-nova-conductor', u'nova-consoleauth': u'openstack-nova-console', u'glance-api': u'openstack-glance-api', u'cinder-api': u'openstack-cinder-api', u'cinder-scheduler': u'openstack-cinder-scheduler', } result = dict() result = service_map.merge_data(self.nova_api_services, result, "fedora") self.assertDictEqual(result, fedora_nova_api_services, "Merge failed") result = service_map.merge_data(self.glance_api_services, result, "fedora") self.assertDictEqual(result, fedora_nova_glance_services, "Merge failed") result = service_map.merge_data(self.cinder_api_services, result, "fedora") self.assertDictEqual(result, fedora_nova_glance_cinder_services, "Merge failed") def test_merge_data_ubuntu(self): ubuntu_nova_api_services = { u'nova-api': u'nova-api', u'nova-cert': u'nova-cert', u'nova-compute': u'nova-compute', u'nova-conductor': u'nova-conductor', u'nova-consoleauth': u'nova-console' } ubuntu_nova_glance_services = { u'nova-api': u'nova-api', u'nova-cert': u'nova-cert', u'nova-compute': u'nova-compute', u'nova-conductor': u'nova-conductor', u'nova-consoleauth': u'nova-console', u'glance-api': u'glance-api', } ubuntu_nova_glance_cinder_services = { u'nova-api': u'nova-api', u'nova-cert': u'nova-cert', u'nova-compute': u'nova-compute', u'nova-conductor': u'nova-conductor', u'nova-consoleauth': u'nova-console', u'glance-api': u'glance-api', u'cinder-api': u'cinder-api', u'cinder-scheduler': u'cinder-scheduler' } result = dict() result = service_map.merge_data(self.nova_api_services, result, "ubuntu") self.assertDictEqual(result, ubuntu_nova_api_services, "Merge failed") result = service_map.merge_data(self.glance_api_services, result, "ubuntu") self.assertDictEqual(result, ubuntu_nova_glance_services, "Merge failed") result = service_map.merge_data(self.cinder_api_services, result, "ubuntu") self.assertDictEqual(result, ubuntu_nova_glance_cinder_services, "Merge failed") ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4022381 diskimage_builder-3.42.0/diskimage_builder/elements/sysctl/0000775000175000017500000000000015201026275022665 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/sysctl/README.rst0000664000175000017500000000041015201026231024337 0ustar00zuulzuul====== sysctl ====== Add a sysctl-set-value command which can be run from within an element. Running this command will cause the sysctl value to be set on boot (by writing the value to /etc/sysctl.d). Example usage :: sysctl-set-value net.ipv4.ip_forward 1 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4022381 diskimage_builder-3.42.0/diskimage_builder/elements/sysctl/bin/0000775000175000017500000000000015201026275023435 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/sysctl/bin/sysctl-set-value0000775000175000017500000000227015201026231026600 0ustar00zuulzuul#!/bin/bash # # Copied from tripleo-image-element's sysctl element # # Validate and manage setting sysctl settings. # # The script is called with name/value pairs which are stored # in the system default sysctl.d directory. Before adding new # settings a validation is done to ensure that conflicting # sysctl settings have not been requested. Once finished sysctl # is used to activate the changes. if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail NAME=${1:-} VALUE=${2:-} # Optional comment used to describe the setting COMMENT=${3:-"This file was created by diskimage-builder."} if [ -z "$NAME" -o -z "$VALUE" ]; then echo "NAME and VALUE are required." exit 1 fi FILENAME="/etc/sysctl.d/${NAME}.conf" if [ -f $FILENAME ]; then # check to make sure the settings match... otherwise fail if ! grep -q "^$NAME = $VALUE" $FILENAME; then echo "Conflicting sysctl.conf setting for $NAME == $VALUE. Found:" grep "^$NAME" $FILENAME exit 1 fi else if ! sysctl -a | grep -q "^$NAME"; then echo "Invalid sysctl key: $NAME" exit 1 fi sysctl-write-value $NAME "$VALUE" "$COMMENT" sysctl -p $FILENAME fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/sysctl/bin/sysctl-write-value0000775000175000017500000000174315201026231027143 0ustar00zuulzuul#!/bin/bash # # Copied from tripleo-image-element's sysctl element # # Validate and manage setting sysctl settings. # # The script is called with name/value pairs which are stored # in the system default sysctl.d directory. This script performs # no checking, just writing out the file. if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail NAME=${1:-} VALUE=${2:-} # Optional comment used to describe the setting COMMENT=${3:-"This file was created by diskimage-builder."} if [ -z "$NAME" -o -z "$VALUE" ]; then echo "Usage: sysctl-write-value [comment]" exit 1 fi FILENAME="/etc/sysctl.d/${NAME}.conf" if [ -f $FILENAME ]; then # check to make sure the settings match... otherwise fail if ! grep -q "^$NAME = $VALUE" $FILENAME; then echo "Conflicting sysctl.conf setting for $NAME == $VALUE. Found:" grep "^$NAME" $FILENAME exit 1 fi else cat > $FILENAME < $QCOW2_FILE CACHED_IMAGE=$QCOW2_FILE fi qemu-img convert -f qcow2 -O raw $CACHED_IMAGE $RAW_FILE # kpartx fails if no /dev/loop* exists, "losetup -f" prints first unused # loop device and creates it if it doesn't exist LOOPDEV_BASE=$(basename $(sudo losetup -f)) # add partition mappings sudo kpartx -av $RAW_FILE # If running inside Docker, make our nodes manually, because udev will not be working. if [ -f /.dockerenv ]; then sudo dmsetup --noudevsync mknodes fi if ! timeout 5 sh -c "while ! ls /dev/mapper/${LOOPDEV_BASE}p* ; do sleep 1; done"; then echo "Error: Could not find any ${LOOPDEV_BASE} devices" exit 1 fi EACTION="sudo kpartx -d $RAW_FILE ; $EACTION" trap "$EACTION" EXIT ROOT_LOOPDEV="" BOOT_LOOPDEV="" EFI_LOOPDEV="" LOOPDEVS=$(ls /dev/mapper/${LOOPDEV_BASE}p* | sort -r) LOOPDEV_COUNT=$(echo $LOOPDEVS | wc -w) if [ $LOOPDEV_COUNT == "1" ]; then # if there is one partition device, assume it is the root device ROOT_LOOPDEV=${LOOPDEVS} LOOPDEVS="" fi for LOOPDEV in ${LOOPDEVS}; do fstype=$(sudo blkid -o value -s TYPE -p "${LOOPDEV}" 2>/dev/null) label=$(sudo blkid -o value -s LABEL -p "${LOOPDEV}" 2>/dev/null) part_type=$(sudo blkid -o value -s PART_ENTRY_TYPE -p "${LOOPDEV}" 2>/dev/null) if [ -z "${fstype}" ]; then # Ignore block device with no filesystem type continue fi # look for EFI partition to mount at /boot/efi either by GUID or # label convention if [ -z "$EFI_LOOPDEV" ]; then if [[ ${part_type} == ${GUID_EFI} ]]; then EFI_LOOPDEV=$LOOPDEV continue fi fi # look for EFI partition to mount at /boot/efi either by GUID or # label convention. if [ -z "$BOOT_LOOPDEV" ]; then if [[ ${part_type} == ${GUID_LINUX_BOOT} || ${label} == "boot" ]]; then BOOT_LOOPDEV=$LOOPDEV continue fi fi if [ -z "$ROOT_LOOPDEV" ]; then ROOT_LOOPDEV=$LOOPDEV continue fi done # in case where ROOT_LOOPDEV is not set - use BOOT_LOOPDEV for that case # (e.g. CentOS Stream 10) if [ -z "$ROOT_LOOPDEV" ]; then ROOT_LOOPDEV=${BOOT_LOOPDEV} BOOT_LOOPDEV= fi mkdir $WORKING/mnt ROOT_FSTYPE=$(sudo blkid -o value -s TYPE $ROOT_LOOPDEV) if [ "xfs" = "$ROOT_FSTYPE" ]; then # mount xfs with nouuid, just in case that uuid is already mounted # use ro to avoid/workaround xfs uuid issues on older # kernels with newer rhel images which seem to set # flags to generate unique uuid's: # xfs superblock has incompatible features (0x4) # we don't need to worry about this, we just want the data MOUNTOPTS="-o nouuid,ro" elif [ "btrfs" = "$ROOT_FSTYPE" ]; then # Fedora has a btrfs filesystem with a subvolume called root. # For now assume there will be a 'root' subvolume, but in the # future the subvolume layout may need to be discovered for different # images MOUNTOPTS="-o subvol=root" else MOUNTOPTS="" fi sudo mount $MOUNTOPTS $ROOT_LOOPDEV $WORKING/mnt EACTION="sudo umount -f $WORKING/mnt ; $EACTION" trap "$EACTION" EXIT if [ ! -z "$BOOT_LOOPDEV" ]; then # mount to /boot BOOT_FSTYPE=$(sudo blkid -o value -s TYPE $ROOT_LOOPDEV) if [ "xfs" = "$BOOT_FSTYPE" ]; then BOOT_MOUNTOPTS="-o nouuid,ro" # Similar to root filesystem, if the boot filesystem # is XFS and the base OS is the same as the image being # rebuilt, we need to pass "nouuid" to bypass UUID safety # checks and successfully mounts so we can extract the # contents. else BOOT_MOUNTOPTS="" fi sudo mount $BOOT_MOUNTOPTS $BOOT_LOOPDEV $WORKING/mnt/boot EACTION="sudo umount -f $BOOT_LOOPDEV ; $EACTION" trap "$EACTION" EXIT fi if [ ! -z "$EFI_LOOPDEV" ]; then # mount to /boot/efi sudo mount $EFI_LOOPDEV $WORKING/mnt/boot/efi EACTION="sudo umount -f $EFI_LOOPDEV ; $EACTION" trap "$EACTION" EXIT fi # find out if chroot tar has full xattr support if [ 0 == `sudo chroot $WORKING/mnt bin/tar --help | grep -c xattrs-exclude` ]; then TAROPTS="--no-xattrs" else TAROPTS="--xattrs --xattrs-include=* --xattrs-exclude=security.selinux" fi # Chroot in so that we get the correct uid/gid sudo chroot $WORKING/mnt bin/tar $TAROPTS -cz . > $WORKING/tmp.tar mv $WORKING/tmp.tar $CACHED_TAR else echo "Using cached tar from $CACHED_TAR" fi fi # Extract the base image (use --numeric-owner to avoid UID/GID mismatch between # image tarball and host OS e.g. when building Fedora image on an openSUSE host) # Include all xattrs except selinux because the selinux ones cause issues in our # chroot environment, and we restore all of those at the end of the build anyway. echo "Extracting base root image from $CACHED_TAR" sudo tar -C $TARGET_ROOT --numeric-owner --xattrs --xattrs-include='*' --xattrs-exclude='security.selinux' -xzf $CACHED_TAR } ( echo "Getting $TAR_LOCK: $(date)" # Wait up to 20 minutes for another process to download if ! flock -w 1200 9 ; then echo "Did not get $TAR_LOCK: $(date)" exit 1 fi extract_image ) 9> $TAR_LOCK ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4022381 diskimage_builder-3.42.0/diskimage_builder/elements/sysprep/finalise.d/0000775000175000017500000000000015201026275025065 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/sysprep/finalise.d/99-clear-machine-id0000775000175000017500000000126515201026231030330 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [ -e /var/lib/dbus/machine-id ]; then > /var/lib/dbus/machine-id fi # According to documented First Boot Semantics writing "uninitialized" will trigger the full # first boot behaviour. # https://www.freedesktop.org/software/systemd/man/machine-id.html#First%20Boot%20Semantics # On older versions of systemd before first boot semantics were formalised, any non-uuid value # will trigger a new machine-id to be generated, so "uninitialized" also works. # Previously this was done here by truncating /etc/machine-id. if [ -e /etc/machine-id ]; then echo uninitialized > /etc/machine-id fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4032383 diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/0000775000175000017500000000000015201026275023772 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/README.rst0000664000175000017500000000124615201026231025454 0ustar00zuulzuul============= tpm-emulator ============= This element should be used together with keylime-agent element. Keylime can be used with a software TPM emulator for development purposes. Please refer to keylime-agent element for the detailed explanation. This element works with a software TPM 2.0 emulator. The download source of IBM's TPM 2.0 Software TPM can be found here: https://sourceforge.net/projects/ibmswtpm2/ TPM utility prerequisites are installed, including tpm2-tss software stack, tpm2-tools utilities, and the tpm2-abrmd resource manager. **REFERENCES** [1] github.com/keylime/keylime-vagrant-ansible-tpm-emulator [2] ibmswtpm.sourceforge.net/ibmswtpm2.html ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/element-deps0000664000175000017500000000006715201026231026272 0ustar00zuulzuulpackage-installs pip-and-virtualenv source-repositories././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2922359 diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/install.d/0000775000175000017500000000000015201026275025662 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021500000000000010213 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/install.d/tpm-emulator-source-install/ 28 mtime=1778658493.4032383 diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/install.d/tpm-emulator-source-insta0000775000175000017500000000000015201026275032643 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023400000000000010214 xustar00134 path=diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/install.d/tpm-emulator-source-install/10-tcti-emulator.conf 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/install.d/tpm-emulator-source-insta0000664000175000017500000000030215201026231032630 0ustar00zuulzuul[Service] # need to specify ExecStart as empty first to "clear" it: see https://www.freedesktop.org/software/systemd/man/systemd.unit.html ExecStart= ExecStart=/usr/sbin/tpm2-abrmd --tcti=mssim ././@PaxHeader0000000000000000000000000000025500000000000010217 xustar00151 path=diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/install.d/tpm-emulator-source-install/20-remove-conditionpathexistsglob.conf 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/install.d/tpm-emulator-source-insta0000664000175000017500000000003715201026231032635 0ustar00zuulzuul[Unit] ConditionPathExistsGlob=././@PaxHeader0000000000000000000000000000023600000000000010216 xustar00136 path=diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/install.d/tpm-emulator-source-install/78-tpm-emulator-install 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/install.d/tpm-emulator-source-insta0000775000175000017500000000304615201026231032643 0ustar00zuulzuul#!/bin/bash if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail SCRIPTDIR=$(dirname $0) VENVDIR=/opt/keylime KLDIR=/tmp/keylime TPMDIR=/tmp/ibmtpm # create the virtual environment if [ $DIB_PYTHON_VERSION == 3 ]; then $DIB_PYTHON -m venv $VENVDIR else $DIB_PYTHON -m virtualenv $VENVDIR fi # install tpm cd $TPMDIR/src # compile tpm emulator make # install tpm_server install -c -m 0755 $TPMDIR/src/tpm_server /usr/local/bin/tpm_server # install init_tpm_server script install -c -m 0755 $KLDIR/scripts/init_tpm_server /usr/local/bin/init_tpm_server install -d -g root -o root -m 0755 /etc/systemd/system/tpm2-abrmd.service.d/ install -c -g root -o root -m 0644 ${SCRIPTDIR}/10-tcti-emulator.conf /etc/systemd/system/tpm2-abrmd.service.d/ install -c -g root -o root -m 0644 ${SCRIPTDIR}/20-remove-conditionpathexistsglob.conf /etc/systemd/system/tpm2-abrmd.service.d/ # install Keylime-ima-emulator inside the virtual environment $VENVDIR/bin/pip install 'pip>=19.1.1' $VENVDIR/bin/pip install -r $KLDIR/requirements.txt $KLDIR $VENVDIR/bin/pip install dataclasses ln -s $VENVDIR/bin/keylime_ima_emulator /usr/local/bin/keylime_ima_emulator case "$DIB_INIT_SYSTEM" in systemd) install -D -g root -o root -m 0644 ${SCRIPTDIR}/tpm_server.service /usr/lib/systemd/system/tpm_server.service install -D -g root -o root -m 0644 ${SCRIPTDIR}/keylime-ima-emulator.service /usr/lib/systemd/system/keylime-ima-emulator.service ;; *) echo "Unsupported init system" exit 1 ;; esac ././@PaxHeader0000000000000000000000000000024300000000000010214 xustar00141 path=diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/install.d/tpm-emulator-source-install/keylime-ima-emulator.service 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/install.d/tpm-emulator-source-insta0000664000175000017500000000037215201026231032637 0ustar00zuulzuul[Unit] Description=The Keylime ima emulator Wants=tpm2-abrmd.service Before=keylime-agent.service After=network-online.target [Service] ExecStart=/usr/local/bin/keylime_ima_emulator Restart=always RestartSec=30s [Install] WantedBy=multi-user.target././@PaxHeader0000000000000000000000000000023100000000000010211 xustar00131 path=diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/install.d/tpm-emulator-source-install/tpm_server.service 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/install.d/tpm-emulator-source-insta0000664000175000017500000000023015201026231032630 0ustar00zuulzuul[Unit] Description=TPM server [Service] ExecStart=/usr/local/bin/tpm_server -rm Restart=on-failure RestartSec=30s [Install] WantedBy=multi-user.target././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/package-installs.yaml0000664000175000017500000000041015201026231030063 0ustar00zuulzuulswig: tpm2-abrmd: tpm2-tools: tpm2-tss: make: gcc-c++: uninstall: true pkg-config: uninstall: true libtool: uninstall: true libstdc++-devel: uninstall: true git: dbus-devel: glib2-devel: uriparser-devel: libgcrypt-devel: libcurl-devel: libselinux-python3: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4032383 diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/post-install.d/0000775000175000017500000000000015201026275026645 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/post-install.d/89-tpm-emulator0000775000175000017500000000054715201026231031455 0ustar00zuulzuul#!/bin/bash if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail case "$DIB_INIT_SYSTEM" in systemd) systemctl enable tpm_server systemctl enable tpm2-abrmd systemctl enable keylime-ima-emulator ;; *) echo "Unsupported init system $DIB_INIT_SYSTEM" exit 1 ;; esac ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/source-repository-ibmtpm0000664000175000017500000000013315201026231030705 0ustar00zuulzuulibmtpm tar /tmp/ibmtpm http://sourceforge.net/projects/ibmswtpm2/files/ibmtpm1119.tar.gz . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/tpm-emulator/source-repository-keylime0000664000175000017500000000010715201026231031055 0ustar00zuulzuulkeylime git /tmp/keylime https://github.com/keylime/keylime.git v6.2.0 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4042382 diskimage_builder-3.42.0/diskimage_builder/elements/uboot/0000775000175000017500000000000015201026275022474 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/uboot/README.rst0000664000175000017500000000066615201026231024163 0ustar00zuulzuul===== uboot ===== Perform kernel/initrd post-processing for UBoot. This element helps post-process the kernel/initrd for use with uboot. It works with ramdisk images as well as user images. This element needs u-boot-tools to be installed on the host. The load address and entry point for UBoot kernel can be specified as shown in the example below. Example: export UBOOT\_KERNEL\_ADDR=0x80000 export UBOOT\_KERNEL\_EP=0x80000 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4042382 diskimage_builder-3.42.0/diskimage_builder/elements/uboot/cleanup.d/0000775000175000017500000000000015201026275024345 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/uboot/cleanup.d/98-uboot0000775000175000017500000000162415201026231025654 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail function post_process() { mkimage -A $1 -O linux -T kernel -C none -a $UBOOT_KERNEL_ADDR -e $UBOOT_KERNEL_EP -n "Kernel" -d $KERNEL uImage mv uImage $KERNEL mkimage -A $1 -O linux -T ramdisk -a 0 -n "RAMdisk" -C gzip -d $RAMDISK uInitrd mv uInitrd $RAMDISK } UBOOT_KERNEL_ADDR=${UBOOT_KERNEL_ADDR:-0x80000} UBOOT_KERNEL_EP=${UBOOT_KERNEL_EP:-0x80000} [ -n "$TARGET_ROOT" ] # Check if RAMDISK is being built. if [ -f "$TARGET_ROOT/tmp/ramdisk" ] ; then KERNEL="$TARGET_ROOT/tmp/kernel" RAMDISK="$TARGET_ROOT/tmp/ramdisk" else source "$_LIB/img-functions" # Dig up the initrd and kernel to use. select_boot_kernel_initrd "$TARGET_ROOT" KERNEL="$TARGET_ROOT/boot/$KERNEL" RAMDISK="$TARGET_ROOT/boot/$RAMDISK" fi case "$ARCH" in arm*) post_process arm ;; esac ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4042382 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/0000775000175000017500000000000015201026275022666 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/README.rst0000664000175000017500000000270015201026231024344 0ustar00zuulzuul====== ubuntu ====== Use Ubuntu cloud images as the baseline for built disk images. Overrides: * To use a non-default URL for downloading base Ubuntu cloud images, use the environment variable ``DIB_CLOUD_IMAGES`` * To download a non-default release of Ubuntu cloud images, use the environment variable ``DIB_RELEASE``. This element will export the ``DIB_RELEASE`` variable. * Use ``DIB_DISTRIBUTION_MIRROR`` to override the ``sources.list`` with an alternative mirror * Setting ``DIB_DISTRIBUTION_MIRROR_UBUNTU_IGNORE`` to an extended-regexp (i.e. the argument to the ``=~`` bash comparitor) which, when matched, will *not* set that line to the ``DIB_DISTRIBUTION_MIRROR``. For example, if your local mirror does not mirror the universe and multiverse components, set this to ``(universe|multiverse)`` * Setting ``DIB_DISTRIBUTION_MIRROR_UBUNTU_INSECURE`` updates apt settings to allow insecure/unuthenticated repositories. * Setting ``DIB_DISTRIBUTION_MIRROR_VERIFY_HTTPS`` updates apt settings to allow insecure HTTPS repository. * Setting ``DIB_OFFLINE`` will prevent to download again the source image if is already present in to $DIB_IMAGE_CACHE path. * Setting ``DIB_LOCAL_IMAGE`` to use a image from a local source (full path and file name) and not download image from internet. Local source for release Trusty have to be tar.gz format. For other more recent release get the squashfs image. .. element_deps:: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/element-deps0000664000175000017500000000007115201026231025161 0ustar00zuulzuulcache-url cloud-init-datasources dkms dpkg ubuntu-common ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/element-provides0000664000175000017500000000002115201026231026054 0ustar00zuulzuuloperating-system ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4122384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/environment.d/0000775000175000017500000000000015201026275025454 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/environment.d/99-cloud-init-datasources.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/environment.d/99-cloud-init-datasources.b0000664000175000017500000000044015201026231032426 0ustar00zuulzuul# NOTE(adam_g): Until (LP: #1316475) is resolved in Ubuntu, default to only # allowing the Ec2 data source from being queried on first boot, unless # specified otherwise. export DIB_CLOUD_INIT_DATASOURCES=${DIB_CLOUD_INIT_DATASOURCES:-"Ec2"} export DIB_LOCAL_IMAGE=${DIB_LOCAL_IMAGE:-""} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/package-installs.yaml0000664000175000017500000000002515201026231026761 0ustar00zuulzuullinux-image-generic: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4122384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/pre-install.d/0000775000175000017500000000000015201026275025342 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/pre-install.d/00-remove-apt-xapian-index0000775000175000017500000000041515201026231032137 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # This package is broken and causes real issues on update: # https://bugs.launchpad.net/ubuntu/+source/apt-xapian-index/+bug/1227420 apt-get --yes remove apt-xapian-index || : ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/pre-install.d/01-set-ubuntu-mirror0000775000175000017500000000475715201026231031136 0ustar00zuulzuul#!/bin/bash if [[ ${DIB_DEBUG_TRACE:-0} -gt 1 ]]; then set -x fi set -eu set -o pipefail DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-} DIB_DISTRIBUTION_MIRROR_VERIFY_HTTPS=${DIB_DISTRIBUTION_MIRROR_VERIFY_HTTPS:-1} SIGNED_BY=${SIGNED_BY:-} DEB822_SOURCES_FILE=/etc/apt/sources.list.d/ubuntu.sources if [[ -z "$DIB_DISTRIBUTION_MIRROR" ]]; then echo "DIB_DISTRIBUTION_MIRROR is empty" exit 0 fi # ubuntu versions > jammy use https://repolib.readthedocs.io/en/latest/deb822-format.html # check if the sources file is in the sources.list.d directory. if [[ -f "$DEB822_SOURCES_FILE" ]]; then # ubuntu > jammy while IFS= read line do if [[ -n "${DIB_DISTRIBUTION_MIRROR_UBUNTU_IGNORE:-}" && "$line" =~ ${DIB_DISTRIBUTION_MIRROR_UBUNTU_IGNORE:-} ]]; then # append line unmodified echo "$line" | tee --append /etc/apt/sources.list.d/ubuntu.sources.new else if [[ "$line" == URIs:* ]]; then line=$(echo "$line" | sed -e "s&http://\(archive\|security\).ubuntu.com/ubuntu&$DIB_DISTRIBUTION_MIRROR&") elif [[ -n "$SIGNED_BY" && "$line" == Signed-By:* ]]; then line="Signed-By: $SIGNED_BY" fi echo "$line" | tee --append /etc/apt/sources.list.d/ubuntu.sources.new fi done < /etc/apt/sources.list.d/ubuntu.sources mv /etc/apt/sources.list.d/ubuntu.sources.new /etc/apt/sources.list.d/ubuntu.sources else # ubuntu <= jammy while IFS= read line do if [[ -n "${DIB_DISTRIBUTION_MIRROR_UBUNTU_IGNORE:-}" && "$line" =~ ${DIB_DISTRIBUTION_MIRROR_UBUNTU_IGNORE:-} ]]; then # append line unmodified echo "$line" | tee --append /etc/apt/sources.list.new else echo "$line" | \ sed -e "s&http://\(archive\|security\).ubuntu.com/ubuntu&$DIB_DISTRIBUTION_MIRROR&" | \ tee --append /etc/apt/sources.list.new fi done < /etc/apt/sources.list mv /etc/apt/sources.list.new /etc/apt/sources.list fi if [[ -n "${DIB_DISTRIBUTION_MIRROR_UBUNTU_INSECURE:-}" ]]; then echo "APT::Get::AllowUnauthenticated \"true\";" | tee /etc/apt/apt.conf.d/95allow-unauthenticated echo "Acquire::AllowInsecureRepositories \"true\";" | tee -a /etc/apt/apt.conf.d/95allow-unauthenticated fi if [[ "${DIB_DISTRIBUTION_MIRROR_VERIFY_HTTPS}" == "0" && ${DIB_DISTRIBUTION_MIRROR} =~ "https:" ]]; then echo "Acquire::https::Verify-Peer \"false\";" | tee -a /etc/apt/apt.conf.d/95allow-unauthenticated fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4122384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/root.d/0000775000175000017500000000000015201026275024073 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/root.d/10-cache-ubuntu-tarball0000775000175000017500000000557715201026231030247 0ustar00zuulzuul#!/bin/bash # These are useful, or at worst not harmful, for all images we build. if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail [ -n "$ARCH" ] [ -n "$TARGET_ROOT" ] shopt -s extglob DIB_RELEASE=${DIB_RELEASE:-noble} DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://cloud-images.ubuntu.com/$DIB_RELEASE/current} if [ $DIB_RELEASE != "trusty" ] ; then BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$DIB_RELEASE-server-cloudimg-$ARCH.squashfs} else BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$DIB_RELEASE-server-cloudimg-$ARCH-root.tar.gz} fi SHA256SUMS=${SHA256SUMS:-https://${DIB_CLOUD_IMAGES##http?(s)://}/SHA256SUMS} CACHED_FILE=$DIB_IMAGE_CACHE/$BASE_IMAGE_FILE CACHED_FILE_LOCK=$DIB_LOCKFILES/$BASE_IMAGE_FILE.lock CACHED_SUMS=$DIB_IMAGE_CACHE/SHA256SUMS.ubuntu.$DIB_RELEASE.$ARCH function get_ubuntu_tarball() { if [ -n "$DIB_LOCAL_IMAGE" ] ; then echo "Using local image without download" if [ ! -f "$DIB_LOCAL_IMAGE" ] ; then echo "Unable to find image $DIB_LOCAL_IMAGE locally! Check path and file name to source image" exit 1 fi IMAGE_PATH=$DIB_LOCAL_IMAGE BASE_IMAGE_FILE=$(basename $DIB_LOCAL_IMAGE) CACHED_FILE=$IMAGE_PATH else if [ -n "$DIB_OFFLINE" -a -f "$CACHED_FILE" ] ; then echo "Not checking freshness of cached $CACHED_FILE." else echo "Fetching Base Image" $TMP_HOOKS_PATH/bin/cache-url $SHA256SUMS $CACHED_SUMS $TMP_HOOKS_PATH/bin/cache-url \ $DIB_CLOUD_IMAGES/$BASE_IMAGE_FILE $CACHED_FILE pushd $DIB_IMAGE_CACHE if ! grep "${BASE_IMAGE_FILE}$" $CACHED_SUMS | sha256sum --check - ; then $TMP_HOOKS_PATH/bin/cache-url -f \ $DIB_CLOUD_IMAGES/$BASE_IMAGE_FILE $CACHED_FILE grep "${BASE_IMAGE_FILE}$" $CACHED_SUMS | sha256sum --check - fi fi IMAGE_PATH=$DIB_IMAGE_CACHE/$BASE_IMAGE_FILE fi # Extract the base image (use --numeric-owner to avoid UID/GID mismatch between # image tarball and host OS e.g. when building Ubuntu image on an openSUSE host) if [ "$DIB_RELEASE" != "trusty" ] ; then # If image is local, it may not be squashfs. # Fall back to extract-image. { sudo unsquashfs -f -d $TARGET_ROOT $IMAGE_PATH } || { BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz $TMP_HOOKS_PATH/bin/extract-image $BASE_IMAGE_FILE $BASE_IMAGE_TAR $IMAGE_PATH $CACHED_FILE } else sudo tar -C $TARGET_ROOT --numeric-owner -xzf $IMAGE_PATH fi } ( echo "Getting $CACHED_FILE_LOCK: $(date)" # Wait up to 20 minutes for another process to download if ! flock -w 1200 9 ; then echo "Did not get $CACHED_FILE_LOCK: $(date)" exit 1 fi get_ubuntu_tarball ) 9> $CACHED_FILE_LOCK ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.297236 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/0000775000175000017500000000000015201026275025457 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4122384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/0000775000175000017500000000000015201026275031613 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021100000000000010207 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/READM0000664000175000017500000000021515201026231032354 0ustar00zuulzuulVerify we can build a ubuntu image. Note this test includes the vm element to test the bootloader install, and specifies to output a .qcow2 ././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/eleme0000664000175000017500000000005215201026231032612 0ustar00zuulzuulblock-device-mbr openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000022300000000000010212 xustar00119 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/environment.d/ 28 mtime=1778658493.4132385 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/envir0000775000175000017500000000000015201026275032657 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023700000000000010217 xustar00137 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/envir0000664000175000017500000000003215201026231032644 0ustar00zuulzuulexport DIB_RELEASE=bionic ././@PaxHeader0000000000000000000000000000022200000000000010211 xustar00124 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/test-0000664000175000017500000000001115201026231032552 0ustar00zuulzuultar,qcow2././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4132385 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/focal-build-succeeds/0000775000175000017500000000000015201026275031434 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021000000000000010206 xustar00114 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/focal-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/focal-build-succeeds/README0000664000175000017500000000021515201026231032302 0ustar00zuulzuulVerify we can build a ubuntu image. Note this test includes the vm element to test the bootloader install, and specifies to output a .qcow2 ././@PaxHeader0000000000000000000000000000021200000000000010210 xustar00116 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/focal-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/focal-build-succeeds/elemen0000664000175000017500000000005215201026231032611 0ustar00zuulzuulblock-device-mbr openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000022200000000000010211 xustar00118 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/focal-build-succeeds/environment.d/ 28 mtime=1778658493.4132385 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/focal-build-succeeds/enviro0000775000175000017500000000000015201026275032657 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023600000000000010216 xustar00136 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/focal-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/focal-build-succeeds/enviro0000664000175000017500000000003115201026231032643 0ustar00zuulzuulexport DIB_RELEASE=focal ././@PaxHeader0000000000000000000000000000022100000000000010210 xustar00123 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/focal-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/focal-build-succeeds/test-o0000664000175000017500000000001115201026231032552 0ustar00zuulzuultar,qcow2././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4132385 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/0000775000175000017500000000000015201026275031465 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021000000000000010206 xustar00114 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/README0000664000175000017500000000021515201026231032333 0ustar00zuulzuulVerify we can build a ubuntu image. Note this test includes the vm element to test the bootloader install, and specifies to output a .qcow2 ././@PaxHeader0000000000000000000000000000021200000000000010210 xustar00116 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/elemen0000664000175000017500000000005215201026231032642 0ustar00zuulzuulblock-device-mbr openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000022200000000000010211 xustar00118 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/environment.d/ 28 mtime=1778658493.4142385 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/enviro0000775000175000017500000000000015201026275032710 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023600000000000010216 xustar00136 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/enviro0000664000175000017500000000003115201026231032674 0ustar00zuulzuulexport DIB_RELEASE=jammy ././@PaxHeader0000000000000000000000000000022100000000000010210 xustar00123 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/test-o0000664000175000017500000000001115201026231032603 0ustar00zuulzuultar,qcow2././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4142385 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/noble-build-succeeds/0000775000175000017500000000000015201026275031447 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021000000000000010206 xustar00114 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/noble-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/noble-build-succeeds/README0000664000175000017500000000021515201026231032315 0ustar00zuulzuulVerify we can build a ubuntu image. Note this test includes the vm element to test the bootloader install, and specifies to output a .qcow2 ././@PaxHeader0000000000000000000000000000021200000000000010210 xustar00116 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/noble-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/noble-build-succeeds/elemen0000664000175000017500000000005215201026231032624 0ustar00zuulzuulblock-device-mbr openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000022200000000000010211 xustar00118 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/noble-build-succeeds/environment.d/ 28 mtime=1778658493.4142385 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/noble-build-succeeds/enviro0000775000175000017500000000000015201026275032672 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023600000000000010216 xustar00136 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/noble-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/noble-build-succeeds/enviro0000664000175000017500000000003115201026231032656 0ustar00zuulzuulexport DIB_RELEASE=noble ././@PaxHeader0000000000000000000000000000022100000000000010210 xustar00123 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/noble-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/noble-build-succeeds/test-o0000664000175000017500000000001115201026231032565 0ustar00zuulzuultar,qcow2././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4152384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/resolute-build-succeeds/0000775000175000017500000000000015201026275032212 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/resolute-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/resolute-build-succeeds/REA0000664000175000017500000000021515201026231032532 0ustar00zuulzuulVerify we can build a ubuntu image. Note this test includes the vm element to test the bootloader install, and specifies to output a .qcow2 ././@PaxHeader0000000000000000000000000000021500000000000010213 xustar00119 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/resolute-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/resolute-build-succeeds/ele0000664000175000017500000000002515201026231032667 0ustar00zuulzuulblock-device-mbr vm ././@PaxHeader0000000000000000000000000000022500000000000010214 xustar00121 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/resolute-build-succeeds/environment.d/ 28 mtime=1778658493.4152384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/resolute-build-succeeds/env0000775000175000017500000000000015201026275032723 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000024100000000000010212 xustar00139 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/resolute-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/resolute-build-succeeds/env0000664000175000017500000000003415201026231032712 0ustar00zuulzuulexport DIB_RELEASE=resolute ././@PaxHeader0000000000000000000000000000022400000000000010213 xustar00126 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/resolute-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/resolute-build-succeeds/tes0000664000175000017500000000001115201026231032710 0ustar00zuulzuultar,qcow2././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4152384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/trusty-build-succeeds/0000775000175000017500000000000015201026275031722 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021100000000000010207 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/trusty-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/trusty-build-succeeds/READM0000664000175000017500000000004415201026231032463 0ustar00zuulzuulVerify we can build a ubuntu image. ././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/trusty-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/trusty-build-succeeds/eleme0000664000175000017500000000002515201026231032721 0ustar00zuulzuulopenstack-ci-mirrors ././@PaxHeader0000000000000000000000000000022300000000000010212 xustar00119 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/trusty-build-succeeds/environment.d/ 28 mtime=1778658493.4152384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/trusty-build-succeeds/envir0000775000175000017500000000000015201026275032766 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023700000000000010217 xustar00137 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/trusty-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/trusty-build-succeeds/envir0000664000175000017500000000003215201026231032753 0ustar00zuulzuulexport DIB_RELEASE=trusty ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4162385 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/xenial-build-succeeds/0000775000175000017500000000000015201026275031630 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021100000000000010207 xustar00115 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/xenial-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/xenial-build-succeeds/READM0000664000175000017500000000021515201026231032371 0ustar00zuulzuulVerify we can build a ubuntu image. Note this test includes the vm element to test the bootloader install, and specifies to output a .qcow2 ././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/xenial-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/xenial-build-succeeds/eleme0000664000175000017500000000005215201026231032627 0ustar00zuulzuulblock-device-mbr openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000022300000000000010212 xustar00119 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/xenial-build-succeeds/environment.d/ 28 mtime=1778658493.4162385 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/xenial-build-succeeds/envir0000775000175000017500000000000015201026275032674 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023700000000000010217 xustar00137 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/xenial-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/xenial-build-succeeds/envir0000664000175000017500000000003215201026231032661 0ustar00zuulzuulexport DIB_RELEASE=xenial ././@PaxHeader0000000000000000000000000000022200000000000010211 xustar00124 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/xenial-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu/test-elements/xenial-build-succeeds/test-0000664000175000017500000000001115201026231032567 0ustar00zuulzuultar,qcow2././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4042382 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-common/0000775000175000017500000000000015201026275024154 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-common/README.rst0000664000175000017500000000016115201026231025631 0ustar00zuulzuulubuntu-common ============= This element holds configuration and scripts that are common for all Ubuntu images. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-common/element-deps0000664000175000017500000000001015201026231026440 0ustar00zuulzuulsysprep ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4052384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-common/environment.d/0000775000175000017500000000000015201026275026742 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021200000000000010210 xustar00116 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-common/environment.d/10-ubuntu-distro-name.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-common/environment.d/10-ubuntu-distro-nam0000664000175000017500000000103515201026231032467 0ustar00zuulzuulexport DISTRO_NAME=${DISTRO_NAME:-ubuntu} export DIB_RELEASE=${DIB_RELEASE:-noble} export DIB_DEBIAN_COMPONENTS=${DIB_DEBIAN_COMPONENTS:-main,universe} export EFI_BOOT_DIR="EFI/ubuntu" # There are two default distro mirrors depending on architecture ARCH=${ARCH:-} if [[ "arm64 armhf powerpc ppc64el s390x" =~ "$ARCH" ]]; then default_ubuntu_mirror=http://ports.ubuntu.com/ubuntu-ports else default_ubuntu_mirror=http://archive.ubuntu.com/ubuntu fi export DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-$default_ubuntu_mirror} ././@PaxHeader0000000000000000000000000000021200000000000010210 xustar00116 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-common/environment.d/11-ubuntu-init-system.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-common/environment.d/11-ubuntu-init-syste0000664000175000017500000000017015201026231032522 0ustar00zuulzuulif [[ ${DIB_RELEASE} == "trusty" ]]; then export DIB_INIT_SYSTEM=upstart else export DIB_INIT_SYSTEM=systemd fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4052384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-common/install.d/0000775000175000017500000000000015201026275026044 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-common/install.d/80-disable-rfc30410000775000175000017500000000257115201026231030677 0ustar00zuulzuul#!/bin/bash # Copyright 2016, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. # dib-lint: disable=set setu setpipefail indent if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -e # This will disable the privacy extensions for IPv6 (RFC4941) # (RFC4941 obsoletes RFC3041) # # Note that depending on the implementation of how the sysctl # settings are applied there is a race condition: there might be # a small time-frame where the original Ubuntu settings from # /etc/sysctl.d/10-ipv6-privacy.conf are already applied but the # new settings from /etc/sysctl.d/99-cloudimg-ipv6.conf # not yet. # If during this time all started network interfaces will # use the privacy extension. cat > /etc/sysctl.d/99-cloudimg-ipv6.conf <`_ element's ``environment.d`` directory in the variable ``DIB_RELEASE``. If a different release of Ubuntu should be created, the variable ``DIB_RELEASE`` can be set appropriately. Note that this element installs ``systemd-sysv`` as the init system for 18.04+. Environment Variables --------------------- DIB_UBUNTU_KERNEL: :Required: No :Default: ``linux-image-generic`` :Description: Specifies the kernel meta package to install in the image. :Example: ``DIB_UBUNTU_KERNEL=linux-image-kvm`` :Options: ``linux-image-generic``, ``linux-image-kvm``, ``linux-image-virtual`` :Notes: The element must know about the package, otherwise it will select the default. DIB_UBUNTU_MIRROR_DISTS: :Required: No :Default: ``updates,security,backports`` :Description: Allow to manage 'dists' repos :Example: ``DIB_UBUNTU_MIRROR_DISTS=updates,security`` :Notes: For some deployment, is may be required to disable backport|update|etc packages integration. .. element_deps:: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/element-deps0000664000175000017500000000005315201026231026605 0ustar00zuulzuuldebootstrap package-installs ubuntu-common ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/element-provides0000664000175000017500000000002115201026231027500 0ustar00zuulzuuloperating-system ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4052384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/environment.d/0000775000175000017500000000000015201026275027100 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020600000000000010213 xustar00112 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/environment.d/11-ubuntu-kernel.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/environment.d/11-ubuntu-kernel.ba0000664000175000017500000000115115201026231032411 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. export DIB_UBUNTU_KERNEL=${DIB_UBUNTU_KERNEL:-"linux-image-generic"} ././@PaxHeader0000000000000000000000000000021200000000000010210 xustar00116 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/environment.d/12-ubuntu-repo-dists.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/environment.d/12-ubuntu-repo-dist0000664000175000017500000000117515201026231032465 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. export DIB_UBUNTU_MIRROR_DISTS=${DIB_UBUNTU_MIRROR_DISTS:-"updates,security,backports"} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/package-installs.yaml0000664000175000017500000000212015201026231030403 0ustar00zuulzuullinux-image-generic: - not-arch: arm64 when: DIB_UBUNTU_KERNEL = linux-image-generic - arch: arm64 when: - DIB_RELEASE != xenial - DIB_UBUNTU_KERNEL = linux-image-generic # On ARM64/Xenial install the HWE kernel as generic because the base # kernel is very old and causes problems. linux-generic-hwe-16.04: arch: arm64 when: - DIB_RELEASE = xenial - DIB_UBUNTU_KERNEL = linux-image-generic # NOTE: there isn't actually an arm64 linux-image-kvm, but we don't # have a way to error out here. linux-image-kvm: not-arch: arm64 when: DIB_UBUNTU_KERNEL = linux-image-kvm linux-image-virtual: when: DIB_UBUNTU_KERNEL = linux-image-virtual linux-generic-hwe-18.04: when: - DIB_UBUNTU_KERNEL = linux-image-hwe - DIB_RELEASE = bionic linux-generic-hwe-20.04: when: - DIB_UBUNTU_KERNEL = linux-image-hwe - DIB_RELEASE = focal linux-generic-hwe-22.04: when: - DIB_UBUNTU_KERNEL = linux-image-hwe - DIB_RELEASE = jammy linux-generic-hwe-24.04: when: - DIB_UBUNTU_KERNEL = linux-image-hwe - DIB_RELEASE = noble initramfs-tools: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4062383 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/root.d/0000775000175000017500000000000015201026275025517 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/root.d/75-ubuntu-minimal-baseinstall 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/root.d/75-ubuntu-minimal-baseinst0000775000175000017500000000405715201026231032450 0ustar00zuulzuul#!/bin/bash # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # NOTE(SamYaple): Add the keyring deboostrap used if specified if [ -n "${DIB_APT_KEYRING:-${DIB_DEBIAN_KEYRING:-}}" ]; then cat $DIB_APT_KEYRING | sudo chroot $TARGET_ROOT /usr/bin/apt-key add - fi # We should manage this in a betterer way # Add "basic" release dist sudo bash -c "cat << EOF >$TARGET_ROOT/etc/apt/sources.list deb $DIB_DISTRIBUTION_MIRROR $DIB_RELEASE ${DIB_DEBIAN_COMPONENTS//,/ } EOF" # Add any extra dists for dist in ${DIB_UBUNTU_MIRROR_DISTS//,/ } ; do sudo bash -c "cat << EOF >>$TARGET_ROOT/etc/apt/sources.list deb $DIB_DISTRIBUTION_MIRROR $DIB_RELEASE-$dist ${DIB_DEBIAN_COMPONENTS//,/ } EOF" done sudo mount -t proc none $TARGET_ROOT/proc sudo mount -o ro -t sysfs none $TARGET_ROOT/sys trap "sudo umount $TARGET_ROOT/proc; sudo umount $TARGET_ROOT/sys" EXIT apt_get="sudo chroot $TARGET_ROOT /usr/bin/apt-get" # dib-lint: safe_sudo # Need to update to retrieve the signed Release file $apt_get update $apt_get clean $apt_get dist-upgrade -y to_install="" # pre-bionic (18.04) brought this in via debootstrap, but init # dependencies have narrowed in the container world, so now we add it # explicitly here so it's brought in early. if [ $DIB_RELEASE != "trusty" ] && [ $DIB_RELEASE != "xenial" ]; then to_install+="systemd-sysv " fi # default required to_install+="busybox sudo python3 " # dib-lint: safe_sudo $apt_get install -y $to_install ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.294236 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/0000775000175000017500000000000015201026275027103 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022300000000000010212 xustar00119 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-arm64-build-succeeds/ 28 mtime=1778658493.4062383 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-arm64-build-0000775000175000017500000000000015201026275032370 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022700000000000010216 xustar00129 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-arm64-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-arm64-build-0000664000175000017500000000022515201026231032361 0ustar00zuulzuulVerify we can build a ubuntu-minimal image. Note this test includes the vm element to test the bootloader install, and specifies to output a .qcow2 ././@PaxHeader0000000000000000000000000000023100000000000010211 xustar00131 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-arm64-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-arm64-build-0000664000175000017500000000005115201026231032356 0ustar00zuulzuulblock-device-efi openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000024100000000000010212 xustar00133 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-arm64-build-succeeds/environment.d/ 28 mtime=1778658493.4062383 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-arm64-build-0000775000175000017500000000000015201026275032370 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000025500000000000010217 xustar00151 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-arm64-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-arm64-build-0000664000175000017500000000003215201026231032355 0ustar00zuulzuulexport DIB_RELEASE=bionic ././@PaxHeader0000000000000000000000000000024000000000000010211 xustar00138 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-arm64-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-arm64-build-0000664000175000017500000000001115201026231032352 0ustar00zuulzuultar,qcow2././@PaxHeader0000000000000000000000000000021500000000000010213 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-build-succeeds/ 28 mtime=1778658493.4062383 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-build-succee0000775000175000017500000000000015201026275032631 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022100000000000010210 xustar00123 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-build-succee0000664000175000017500000000022515201026231032622 0ustar00zuulzuulVerify we can build a ubuntu-minimal image. Note this test includes the vm element to test the bootloader install, and specifies to output a .qcow2 ././@PaxHeader0000000000000000000000000000022300000000000010212 xustar00125 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-build-succee0000664000175000017500000000005115201026231032617 0ustar00zuulzuulblock-device-mbr openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000023300000000000010213 xustar00127 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-build-succeeds/environment.d/ 28 mtime=1778658493.4062383 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-build-succee0000775000175000017500000000000015201026275032631 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000024700000000000010220 xustar00145 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-build-succee0000664000175000017500000000003215201026231032616 0ustar00zuulzuulexport DIB_RELEASE=bionic ././@PaxHeader0000000000000000000000000000023200000000000010212 xustar00132 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-build-succee0000664000175000017500000000001115201026231032613 0ustar00zuulzuultar,qcow2././@PaxHeader0000000000000000000000000000022200000000000010211 xustar00118 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-arm64-build-succeeds/ 28 mtime=1778658493.4072382 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-arm64-build-s0000775000175000017500000000000015201026275032374 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022600000000000010215 xustar00128 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-arm64-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-arm64-build-s0000664000175000017500000000022515201026231032365 0ustar00zuulzuulVerify we can build a ubuntu-minimal image. Note this test includes the vm element to test the bootloader install, and specifies to output a .qcow2 ././@PaxHeader0000000000000000000000000000023000000000000010210 xustar00130 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-arm64-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-arm64-build-s0000664000175000017500000000005115201026231032362 0ustar00zuulzuulblock-device-efi openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000024000000000000010211 xustar00132 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-arm64-build-succeeds/environment.d/ 28 mtime=1778658493.4072382 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-arm64-build-s0000775000175000017500000000000015201026275032374 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000025400000000000010216 xustar00150 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-arm64-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-arm64-build-s0000664000175000017500000000003115201026231032360 0ustar00zuulzuulexport DIB_RELEASE=focal ././@PaxHeader0000000000000000000000000000023700000000000010217 xustar00137 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-arm64-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-arm64-build-s0000664000175000017500000000001115201026231032356 0ustar00zuulzuultar,qcow2././@PaxHeader0000000000000000000000000000021400000000000010212 xustar00112 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-build-succeeds/ 28 mtime=1778658493.4072382 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-build-succeed0000775000175000017500000000000015201026275032616 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022000000000000010207 xustar00122 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-build-succeed0000664000175000017500000000022515201026231032607 0ustar00zuulzuulVerify we can build a ubuntu-minimal image. Note this test includes the vm element to test the bootloader install, and specifies to output a .qcow2 ././@PaxHeader0000000000000000000000000000022200000000000010211 xustar00124 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-build-succeed0000664000175000017500000000005115201026231032604 0ustar00zuulzuulblock-device-mbr openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000023200000000000010212 xustar00126 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-build-succeeds/environment.d/ 28 mtime=1778658493.4072382 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-build-succeed0000775000175000017500000000000015201026275032616 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000024600000000000010217 xustar00144 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-build-succeed0000664000175000017500000000003115201026231032602 0ustar00zuulzuulexport DIB_RELEASE=focal ././@PaxHeader0000000000000000000000000000023100000000000010211 xustar00131 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/focal-build-succeed0000664000175000017500000000001115201026231032600 0ustar00zuulzuultar,qcow2././@PaxHeader0000000000000000000000000000022200000000000010211 xustar00118 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/ 28 mtime=1778658493.4082384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-s0000775000175000017500000000000015201026275032425 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022600000000000010215 xustar00128 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-s0000664000175000017500000000022515201026231032416 0ustar00zuulzuulVerify we can build a ubuntu-minimal image. Note this test includes the vm element to test the bootloader install, and specifies to output a .qcow2 ././@PaxHeader0000000000000000000000000000023000000000000010210 xustar00130 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-s0000664000175000017500000000005115201026231032413 0ustar00zuulzuulblock-device-efi openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000024000000000000010211 xustar00132 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/environment.d/ 28 mtime=1778658493.4082384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-s0000775000175000017500000000000015201026275032425 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000025400000000000010216 xustar00150 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-s0000664000175000017500000000003115201026231032411 0ustar00zuulzuulexport DIB_RELEASE=jammy ././@PaxHeader0000000000000000000000000000023700000000000010217 xustar00137 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-s0000664000175000017500000000001115201026231032407 0ustar00zuulzuultar,qcow2././@PaxHeader0000000000000000000000000000022200000000000010211 xustar00118 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/noble-arm64-build-succeeds/ 28 mtime=1778658493.4082384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/noble-arm64-build-s0000775000175000017500000000000015201026275032407 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022600000000000010215 xustar00128 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/noble-arm64-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/noble-arm64-build-s0000664000175000017500000000022515201026231032400 0ustar00zuulzuulVerify we can build a ubuntu-minimal image. Note this test includes the vm element to test the bootloader install, and specifies to output a .qcow2 ././@PaxHeader0000000000000000000000000000023000000000000010210 xustar00130 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/noble-arm64-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/noble-arm64-build-s0000664000175000017500000000005115201026231032375 0ustar00zuulzuulblock-device-efi openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000024000000000000010211 xustar00132 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/noble-arm64-build-succeeds/environment.d/ 28 mtime=1778658493.4082384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/noble-arm64-build-s0000775000175000017500000000000015201026275032407 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000025400000000000010216 xustar00150 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/noble-arm64-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/noble-arm64-build-s0000664000175000017500000000003115201026231032373 0ustar00zuulzuulexport DIB_RELEASE=noble ././@PaxHeader0000000000000000000000000000023700000000000010217 xustar00137 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/noble-arm64-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/noble-arm64-build-s0000664000175000017500000000001115201026231032371 0ustar00zuulzuultar,qcow2././@PaxHeader0000000000000000000000000000022500000000000010214 xustar00121 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/resolute-arm64-build-succeeds/ 28 mtime=1778658493.4092383 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/resolute-arm64-buil0000775000175000017500000000000015201026275032546 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023100000000000010211 xustar00131 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/resolute-arm64-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/resolute-arm64-buil0000664000175000017500000000022515201026231032537 0ustar00zuulzuulVerify we can build a ubuntu-minimal image. Note this test includes the vm element to test the bootloader install, and specifies to output a .qcow2 ././@PaxHeader0000000000000000000000000000023300000000000010213 xustar00133 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/resolute-arm64-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/resolute-arm64-buil0000664000175000017500000000002415201026231032534 0ustar00zuulzuulblock-device-efi vm ././@PaxHeader0000000000000000000000000000024300000000000010214 xustar00135 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/resolute-arm64-build-succeeds/environment.d/ 28 mtime=1778658493.4092383 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/resolute-arm64-buil0000775000175000017500000000000015201026275032546 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000025700000000000010221 xustar00153 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/resolute-arm64-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/resolute-arm64-buil0000664000175000017500000000003415201026231032535 0ustar00zuulzuulexport DIB_RELEASE=resolute ././@PaxHeader0000000000000000000000000000024200000000000010213 xustar00140 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/resolute-arm64-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/resolute-arm64-buil0000664000175000017500000000001115201026231032530 0ustar00zuulzuultar,qcow2././@PaxHeader0000000000000000000000000000021500000000000010213 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/trusty-build-succeeds/ 28 mtime=1778658493.4092383 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/trusty-build-succee0000775000175000017500000000000015201026275032740 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022100000000000010210 xustar00123 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/trusty-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/trusty-build-succee0000664000175000017500000000005415201026231032731 0ustar00zuulzuulVerify we can build a ubuntu-minimal image. ././@PaxHeader0000000000000000000000000000022300000000000010212 xustar00125 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/trusty-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/trusty-build-succee0000664000175000017500000000002515201026231032727 0ustar00zuulzuulopenstack-ci-mirrors ././@PaxHeader0000000000000000000000000000023300000000000010213 xustar00127 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/trusty-build-succeeds/environment.d/ 28 mtime=1778658493.4092383 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/trusty-build-succee0000775000175000017500000000000015201026275032740 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000024700000000000010220 xustar00145 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/trusty-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/trusty-build-succee0000664000175000017500000000003215201026231032725 0ustar00zuulzuulexport DIB_RELEASE=trusty ././@PaxHeader0000000000000000000000000000021500000000000010213 xustar00113 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/xenial-build-succeeds/ 28 mtime=1778658493.4092383 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/xenial-build-succee0000775000175000017500000000000015201026275032646 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022100000000000010210 xustar00123 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/xenial-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/xenial-build-succee0000664000175000017500000000022515201026231032637 0ustar00zuulzuulVerify we can build a ubuntu-minimal image. Note this test includes the vm element to test the bootloader install, and specifies to output a .qcow2 ././@PaxHeader0000000000000000000000000000022300000000000010212 xustar00125 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/xenial-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/xenial-build-succee0000664000175000017500000000005115201026231032634 0ustar00zuulzuulblock-device-mbr openstack-ci-mirrors vm ././@PaxHeader0000000000000000000000000000023300000000000010213 xustar00127 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/xenial-build-succeeds/environment.d/ 28 mtime=1778658493.4102383 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/xenial-build-succee0000775000175000017500000000000015201026275032646 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000024700000000000010220 xustar00145 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/xenial-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/xenial-build-succee0000664000175000017500000000003215201026231032633 0ustar00zuulzuulexport DIB_RELEASE=xenial ././@PaxHeader0000000000000000000000000000023200000000000010212 xustar00132 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/xenial-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-minimal/test-elements/xenial-build-succee0000664000175000017500000000001115201026231032630 0ustar00zuulzuultar,qcow2././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4102383 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-signed/0000775000175000017500000000000015201026275024135 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-signed/README.rst0000664000175000017500000000032615201026231025615 0ustar00zuulzuul============= ubuntu-signed ============= The ``ubuntu-signed`` element installs ``linux-signed-image-generic`` that provides signed kernel that can be used for deploy in UEFI secure boot mode. .. element_deps:: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-signed/element-deps0000664000175000017500000000000715201026231026427 0ustar00zuulzuulubuntu ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-signed/package-installs.yaml0000664000175000017500000000003415201026231030230 0ustar00zuulzuullinux-signed-image-generic: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4102383 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-signed/post-install.d/0000775000175000017500000000000015201026275027010 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000020500000000000010212 xustar00111 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-signed/post-install.d/90-get-signed-kernel 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-signed/post-install.d/90-get-signed-kerne0000775000175000017500000000216215201026231032305 0ustar00zuulzuul#!/bin/bash # # Copyright 2015 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail # Get signed kernel version LATEST_SIGNED_KERNEL=$(ls /boot/vmlinu*.efi.signed | sort | tail -1) if [ "$LATEST_SIGNED_KERNEL" == "" ]; then echo "Unable to find a suitable kernel" >>/dev/stderr exit 1 fi SIGNED_KERNEL_VERSION=${LATEST_SIGNED_KERNEL##/boot/vmlinu[zx]-} echo "Found signed ubuntu kernel version $SIGNED_KERNEL_VERSION" cat > /dib-signed-kernel-version << EOF DIB_SIGNED_KERNEL_VERSION=$SIGNED_KERNEL_VERSION EOF ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4102383 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/0000775000175000017500000000000015201026275026334 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/README.rst0000664000175000017500000000145115201026231030014 0ustar00zuulzuul======================== ubuntu-systemd-container ======================== .. note:: As of October 2021 this element is deprecated and unmaintained. The ``ubuntu-systemd-container`` element uses debootstrap for generating a minimal image for use by machine containers. In contrast the ``ubuntu`` element uses the cloud-image as the initial base and the ``ubuntu-minimal`` builds an image to be used for hosts. By default this element creates the latest LTS release. The exact setting can be found in the ``ubuntu-common`` element's ``environment.d`` directory in the variable ``DIB_RELEASE``. If a different release of Ubuntu should be created, the variable ``DIB_RELEASE`` can be set appropriately. Note that this element installs ``systemd-sysv`` as the init system for 18.04+. .. element_deps:: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/element-deps0000664000175000017500000000003215201026231030624 0ustar00zuulzuuldebootstrap ubuntu-common ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/element-provides0000664000175000017500000000002115201026231031522 0ustar00zuulzuuloperating-system ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4102383 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/root.d/0000775000175000017500000000000015201026275027541 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022100000000000010210 xustar00123 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/root.d/75-ubuntu-minimal-baseinstall 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/root.d/75-ubuntu-minima0000775000175000017500000000352515201026231032507 0ustar00zuulzuul#!/bin/bash # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # We should manage this in a betterer way sudo bash -c "cat << EOF >$TARGET_ROOT/etc/apt/sources.list deb $DIB_DISTRIBUTION_MIRROR $DIB_RELEASE ${DIB_DEBIAN_COMPONENTS//,/ } deb $DIB_DISTRIBUTION_MIRROR $DIB_RELEASE-updates ${DIB_DEBIAN_COMPONENTS//,/ } deb $DIB_DISTRIBUTION_MIRROR $DIB_RELEASE-backports ${DIB_DEBIAN_COMPONENTS//,/ } deb $DIB_DISTRIBUTION_MIRROR $DIB_RELEASE-security ${DIB_DEBIAN_COMPONENTS//,/ } EOF" sudo mount -t proc none $TARGET_ROOT/proc sudo mount -o ro -t sysfs none $TARGET_ROOT/sys trap "sudo umount $TARGET_ROOT/proc; sudo umount $TARGET_ROOT/sys" EXIT apt_get="sudo chroot $TARGET_ROOT /usr/bin/apt-get" # dib-lint: safe_sudo # Need to update to retrieve the signed Release file $apt_get update $apt_get clean $apt_get dist-upgrade -y to_install="" # pre-bionic (18.04) brought this in via debootstrap, but init # dependencies have narrowed in the container world, so now we add it # explicitly here so it's brought in early. if [ $DIB_RELEASE != "trusty" ] && [ $DIB_RELEASE != "xenial" ]; then to_install+="systemd-sysv " fi # default required to_install+="sudo python3 " # dib-lint: safe_sudo $apt_get install -y $to_install ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.2952359 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/0000775000175000017500000000000015201026275031125 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000022700000000000010216 xustar00123 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/bionic-build-succeeds/ 28 mtime=1778658493.4112384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/bionic-bu0000775000175000017500000000000015201026275032715 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023300000000000010213 xustar00133 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/bionic-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/bionic-bu0000664000175000017500000000006615201026231032711 0ustar00zuulzuulVerify we can build a ubuntu-systemd-container image. ././@PaxHeader0000000000000000000000000000023500000000000010215 xustar00135 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/bionic-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/bionic-bu0000664000175000017500000000002515201026231032704 0ustar00zuulzuulopenstack-ci-mirrors ././@PaxHeader0000000000000000000000000000024500000000000010216 xustar00137 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/bionic-build-succeeds/environment.d/ 28 mtime=1778658493.4112384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/bionic-bu0000775000175000017500000000000015201026275032715 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000026100000000000010214 xustar00155 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/bionic-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/bionic-bu0000664000175000017500000000003215201026231032702 0ustar00zuulzuulexport DIB_RELEASE=bionic ././@PaxHeader0000000000000000000000000000024400000000000010215 xustar00142 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/bionic-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/bionic-bu0000664000175000017500000000000415201026231032701 0ustar00zuulzuultar ././@PaxHeader0000000000000000000000000000022700000000000010216 xustar00123 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/trusty-build-succeeds/ 28 mtime=1778658493.4112384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/trusty-bu0000775000175000017500000000000015201026275033024 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023300000000000010213 xustar00133 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/trusty-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/trusty-bu0000664000175000017500000000006615201026231033020 0ustar00zuulzuulVerify we can build a ubuntu-systemd-container image. ././@PaxHeader0000000000000000000000000000023500000000000010215 xustar00135 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/trusty-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/trusty-bu0000664000175000017500000000002515201026231033013 0ustar00zuulzuulopenstack-ci-mirrors ././@PaxHeader0000000000000000000000000000024500000000000010216 xustar00137 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/trusty-build-succeeds/environment.d/ 28 mtime=1778658493.4112384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/trusty-bu0000775000175000017500000000000015201026275033024 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000026100000000000010214 xustar00155 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/trusty-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/trusty-bu0000664000175000017500000000003215201026231033011 0ustar00zuulzuulexport DIB_RELEASE=trusty ././@PaxHeader0000000000000000000000000000022700000000000010216 xustar00123 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/xenial-build-succeeds/ 28 mtime=1778658493.4112384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/xenial-bu0000775000175000017500000000000015201026275032732 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000023300000000000010213 xustar00133 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/xenial-build-succeeds/README.rst 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/xenial-bu0000664000175000017500000000006615201026231032726 0ustar00zuulzuulVerify we can build a ubuntu-systemd-container image. ././@PaxHeader0000000000000000000000000000023500000000000010215 xustar00135 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/xenial-build-succeeds/element-deps 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/xenial-bu0000664000175000017500000000002515201026231032721 0ustar00zuulzuulopenstack-ci-mirrors ././@PaxHeader0000000000000000000000000000024500000000000010216 xustar00137 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/xenial-build-succeeds/environment.d/ 28 mtime=1778658493.4122384 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/xenial-bu0000775000175000017500000000000015201026275032732 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000026100000000000010214 xustar00155 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/xenial-build-succeeds/environment.d/10-set-distro.bash 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/xenial-bu0000664000175000017500000000003215201026231032717 0ustar00zuulzuulexport DIB_RELEASE=xenial ././@PaxHeader0000000000000000000000000000024400000000000010215 xustar00142 path=diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/xenial-build-succeeds/test-output-formats 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/ubuntu-systemd-container/test-elements/xenial-bu0000664000175000017500000000000415201026231032716 0ustar00zuulzuultar ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4162385 diskimage_builder-3.42.0/diskimage_builder/elements/vm/0000775000175000017500000000000015201026275021766 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/vm/README.rst0000664000175000017500000000015015201026231023441 0ustar00zuulzuul== vm == Sets up a partitioned disk (rather than building just one filesystem with no partition table). ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/vm/element-deps0000664000175000017500000000003015201026231024254 0ustar00zuulzuulblock-device bootloader ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4162385 diskimage_builder-3.42.0/diskimage_builder/elements/vm/finalise.d/0000775000175000017500000000000015201026275024002 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/vm/finalise.d/50-remove-bogus-udev-links0000775000175000017500000000036215201026231030634 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail if [ $DISTRO_NAME = 'opensuse' ] ; then # workaround for https://bugzilla.novell.com/show_bug.cgi?id=859493 rm -f /dev/mapper/loop*_part1 fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4162385 diskimage_builder-3.42.0/diskimage_builder/elements/yum/0000775000175000017500000000000015201026275022156 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum/README.rst0000664000175000017500000000276515201026231023647 0ustar00zuulzuul=== yum === Provide yum specific image building glue. RHEL/Fedora/CentOS and other yum based distributions need specific yum customizations. Customizations include caching of downloaded yum packages outside of the build chroot so that they can be reused by subsequent image builds. The cache increases image building speed when building multiple images, especially on slow connections. This is more effective than using an HTTP proxy as a yum cache since the same rpm from different mirrors is often requested. Custom yum repository configurations can also be applied by defining `DIB_YUM_REPO_CONF` to a space separated list of repo configuration files. The files will be copied to /etc/yum.repos.d/ during the image build, and then removed at the end of the build. Each repo file should be named differently to avoid a filename collision. The yum repository can also be configured by defining `DIB_YUM_REPO_PACKAGE` as a yum available package or a URL to an rpm file. This package can install repo files with any associated keys and certificates. Environment Variables --------------------- DIB_DNF_MODULE_STREAMS :Required: No :Default: None :Description: The following environment variable is used to select module streams to be enabled during an image build on Yum/DNF based distributions.Any existing stream for the given module is first disabled prior to enabling the specified stream. :Example: ``DIB_DNF_MODULE_STREAMS='virt:8.2 container-tools:3.0'`` ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4182386 diskimage_builder-3.42.0/diskimage_builder/elements/yum/bin/0000775000175000017500000000000015201026275022726 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum/bin/install-packages0000775000175000017500000001133215201026231026066 0ustar00zuulzuul#!/bin/bash # Copyright 2012 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. if [ ${DIB_DEBUG_TRACE:-0} -gt 1 ]; then set -x fi set -eu set -o pipefail EXTRA_ARGS= ACTION=install MAP_ELEMENT= # allow override for dnf, as shipped by default with >=F22 YUM=${YUM:-yum} YUM_FLAGS=${YUM_FLAGS:--y -v} # save global xtrace state _xtrace=$(set +o | grep xtrace) SCRIPTNAME=$(basename $0) function show_options () { echo "Usage: $SCRIPTNAME [package ...]" echo echo "Options:" echo " -u -- update all packages" echo " -d dir -- download the packages to directory" echo " -e -- erase/remove packages" echo " -m map -- use custom element package map (Example: -m nova)" exit 0 } while getopts "hud:em:" opt; do case "$opt" in u) ${YUM} -y update; exit 0 ;; d) ACTION="download" DOWNLOAD_PATH=$OPTARG ;; e) ACTION="remove" ;; m) MAP_ELEMENT=$OPTARG ;; h) show_options ;; *) exit 1 ;; esac done shift $((OPTIND-1)) # Packages that aren't available in the distro but requested for installation # can be ignored by adding them to the exclude list BLACKLIST=$(cat /tmp/yum-blacklist 2>/dev/null || echo "") WHITELIST="" for i in "$@" do PKG_NAME=$i if [ -n "$MAP_ELEMENT" ]; then if ! PKG_NAME=$(pkg-map --element $MAP_ELEMENT $i); then echo "bin/pkg-map error. $PKG_NAME" exit 1 fi fi if [[ ! ${BLACKLIST[*]} =~ $PKG_NAME ]]; then WHITELIST="$WHITELIST $i" else echo "The package $i is not available and will not be installed" fi done if [ -n "$WHITELIST" ]; then if [ -f /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release ]; then rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release fi if [ -n "$MAP_ELEMENT" ]; then if ! PKGS=$(pkg-map --element $MAP_ELEMENT $WHITELIST); then echo "bin/pkg-map error. $PKGS" exit 1 fi else PKGS=$(map-packages $WHITELIST) fi if [ -z "${PKGS}" ]; then echo "Not running install-packages $ACTION with empty packages list" exit 0 fi echo "Running install-packages ${ACTION}." if [ "$ACTION" == "download" ]; then mkdir -p $DOWNLOAD_PATH if [ ${YUM} == "dnf" ]; then dnf download --destdir=$DOWNLOAD_PATH $PKGS else # note; you don't want to use yum --download only here. # Firstly that only puts things in the yum cache # directory, and secondly it acts funny if old versions # are already in the cache. if [ ! -f /usr/bin/yumdownloader ]; then yum install -y yum-utils fi yumdownloader --destdir=$DOWNLOAD_PATH $PKGS fi exit 0 fi # yum & dnf have a feature/bug where missing packages in a list of # packages for install/erase do not raise an error exit [1]. # There is a corner case when specifying just *one* package, where # it will fail if the package is missing. Thus install-packages # follows this behaviour; we may need to re-evaluate this at some # point. # # [1] https://bugzilla.redhat.com/show_bug.cgi?id=965567 set -o xtrace DNF5=$(command -v dnf5 2>/dev/null || true) if [ ${YUM} == 'dnf' ] && [ -n "$DNF5" ]; then # dnf5 does not support debug flag YUM_FLAGS=${YUM_FLAGS//-v} fi ${YUM} $YUM_FLAGS $ACTION $EXTRA_ARGS $PKGS if [ "$ACTION" == "install" ]; then if [ ${YUM} == "dnf" ] && [ -z "$DNF5" ]; then dnf -y mark install $PKGS elif [ ${YUM} == "dnf" ] && [ -n "$DNF5" ]; then dnf -y mark user $PKGS fi fi $_xtrace # probably not the right place for this; but python-pip package on # fedora/rh calls pip "pip-python" while the rest of the work # expects it to be just called "pip" for pkg in "$@"; do if [ "$pkg" = "python-pip" ] ; then alternatives --install /usr/bin/pip pip /usr/bin/pip-python 10 fi done fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4182386 diskimage_builder-3.42.0/diskimage_builder/elements/yum/cleanup.d/0000775000175000017500000000000015201026275024027 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum/cleanup.d/99-remove-yum-repo-conf0000775000175000017500000000062015201026231030175 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail # exit directly if DIB_YUM_REPO_CONF is not defined properly if [ -z "${DIB_YUM_REPO_CONF:-}" ] ; then echo "DIB_YUM_REPO_CONF is not set - no repo configurations will be cleaned up" exit 0 fi for file in $DIB_YUM_REPO_CONF; do sudo rm -f $TMP_MOUNT_PATH/etc/yum.repos.d/$(basename $file) done ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum/element-deps0000664000175000017500000000001415201026231024446 0ustar00zuulzuulinstall-bin ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4182386 diskimage_builder-3.42.0/diskimage_builder/elements/yum/extra-data.d/0000775000175000017500000000000015201026275024432 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum/extra-data.d/99-yum-repo-conf0000775000175000017500000000132715201026231027312 0ustar00zuulzuul#!/bin/bash # Add additional yum repo configuration(s) with $DIB_YUM_REPO_CONF if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail # exit directly if DIB_YUM_REPO_CONF is not defined properly if [ -z "${DIB_YUM_REPO_CONF:-}" ] ; then echo "DIB_YUM_REPO_CONF is not set - no repo configuration will be copied in" exit 0 fi for file in $DIB_YUM_REPO_CONF; do if [ ! -f $file ]; then echo "$file is not a valid yum repo configuration file." echo "You should assign a list of proper yum repo configuration" echo "files in DIB_YUM_REPO_CONF." exit 1 fi # copy the yum repo configuration sudo cp -L -f $file $TMP_MOUNT_PATH/etc/yum.repos.d done ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4182386 diskimage_builder-3.42.0/diskimage_builder/elements/yum/post-install.d/0000775000175000017500000000000015201026275025031 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum/post-install.d/99-reset-yum-conf0000775000175000017500000000050515201026231030063 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail if [[ ${YUM} == "dnf" ]]; then cfg=/etc/dnf/dnf.conf cachedir=/var/cache/dnf else cfg=/etc/yum.conf cachedir=/var/cache/yum fi sed -i "/^keepcache/c\keepcache=0" $cfg sed -i "/^cachedir/c\cachedir=${cachedir}" $cfg ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4192386 diskimage_builder-3.42.0/diskimage_builder/elements/yum/pre-install.d/0000775000175000017500000000000015201026275024632 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum/pre-install.d/00-01-yum-keepcache0000775000175000017500000000065115201026231027725 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [[ ${YUM} == "dnf" ]]; then # dnf is slightly different; doesn't have these by default cfg=/etc/dnf/dnf.conf echo "keepcache=1" >> $cfg echo "cachedir=/tmp/yum" >> $cfg else cfg=/etc/yum.conf sed -i 's/keepcache=0/keepcache=1/' $cfg sed -i 's/cachedir=\/var\/cache\/yum/cachedir=\/tmp\/yum/' $cfg fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum/pre-install.d/00-dnf-update0000775000175000017500000000040515201026231027013 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -eq 22 ]]; then # we need dnf mark command from dnf 1.1.1, which is pretty recent dnf --refresh update -y dnf fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum/pre-install.d/00-install-repo-package0000775000175000017500000000026215201026231030767 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [ -n "${DIB_YUM_REPO_PACKAGE:-}" ] ; then rpm -ivh ${DIB_YUM_REPO_PACKAGE} fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum/pre-install.d/01-00-centos-python30000775000175000017500000000066315201026231030105 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # Ensure the python3 interpreter and YAML libraries are installed # early (even before package-installs, which is written in Python and # uses YAML). if [[ ${DISTRO_NAME} =~ (centos|rhel) ]]; then # Ensure the "user" python3 package is installed # so we have /usr/bin/python3 and pyyaml. dnf install -y python3 python3-pyyaml fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum/pre-install.d/01-module-configuration0000775000175000017500000000101515201026231031115 0ustar00zuulzuul#!/bin/bash # # When building RHEL overcloud images, certain modules may be preferred # or even required. # # For example, container-tools:2.0 is notably a requirement when running # the Train releases on RHEL 8.2. # if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail export DIB_DNF_MODULE_STREAMS=${DIB_DNF_MODULE_STREAMS:-} if [ "${YUM}" == "dnf" ]; then for m in ${DIB_DNF_MODULE_STREAMS}; do ${YUM} -y module disable ${m/:*/} ${YUM} -y module enable ${m} done fi ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4192386 diskimage_builder-3.42.0/diskimage_builder/elements/yum/root.d/0000775000175000017500000000000015201026275023363 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum/root.d/50-yum-cache0000775000175000017500000000041715201026231025400 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail [ -n "$TARGET_ROOT" ] YUM_CACHE_DIR=$DIB_IMAGE_CACHE/yum mkdir -p $YUM_CACHE_DIR sudo mkdir -p $TMP_MOUNT_PATH/tmp/yum sudo mount --bind $YUM_CACHE_DIR $TMP_MOUNT_PATH/tmp/yum ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4172385 diskimage_builder-3.42.0/diskimage_builder/elements/yum-minimal/0000775000175000017500000000000015201026275023602 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum-minimal/README.rst0000664000175000017500000000226715201026231025270 0ustar00zuulzuul=========== yum-minimal =========== Base element for creating minimal yum-based images. This element is incomplete by itself, you'll want to use the centos-minimal or fedora-minimal elements to get an actual base image. Use of this element will require 'yum' and 'yum-utils' to be installed on Ubuntu and Debian. Nothing additional is needed on Fedora or CentOS. If you wish to have DHCP networking setup for eth0 & eth1 via /etc/sysconfig/network-config scripts/ifcfg-eth[0|1], set the environment variable `DIB_YUM_MINIMAL_CREATE_INTERFACES` to `1`. If you wish to build from specific mirrors, set ``DIB_YUM_MINIMAL_BOOTSTRAP_REPOS`` to a directory with the ``.repo`` files to use during bootstrap and build. The repo files should be named with a prefix ``dib-mirror-`` and will be removed from the final image. If you wish to include extra repositories, set ``DIB_YUM_MINIMAL_EXTRA_REPOS`` to a directory with the ``.repo`` files. The repo files will not be removed from the final image. If you are bootstrapping a custom or unsupported OS, and need to install additional packages to setup the base chroot, set ``DIB_YUM_MINIMAL_BOOTSTRAP_PACKAGES`` to the list of additional packages to install. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4172385 diskimage_builder-3.42.0/diskimage_builder/elements/yum-minimal/cleanup.d/0000775000175000017500000000000015201026275025453 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum-minimal/cleanup.d/95-remove-yum-mirror0000775000175000017500000000203415201026231031240 0ustar00zuulzuul#!/bin/bash # # Copyright 2015 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # # dib-lint: disable=safe_sudo if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail # This removes any build-time repos that might be set in 08-yum-chroot if [[ -n ${DIB_YUM_MINIMAL_BOOTSTRAP_REPOS:-} ]]; then sudo rm -f $TMP_MOUNT_PATH/etc/yum.repos.d/dib-mirror*.repo for repo in $TMP_MOUNT_PATH/etc/yum.repos.d/*.USING_MIRROR; do sudo mv $repo ${repo/.USING_MIRROR/} done fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum-minimal/element-deps0000664000175000017500000000003515201026231026075 0ustar00zuulzuulredhat-common rpm-distro yum ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4172385 diskimage_builder-3.42.0/diskimage_builder/elements/yum-minimal/install.d/0000775000175000017500000000000015201026275025472 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum-minimal/install.d/10-base-networking0000775000175000017500000000264715201026231030736 0ustar00zuulzuul#!/bin/bash # # Copyright 2015 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail # allow networking init scripts inside the container to work without extra steps cat << EOF | sudo tee /etc/sysconfig/network > /dev/null NETWORKING=yes NETWORKING_IPV6=yes NOZEROCONF=yes EOF # If you want eth0 and eth1 created as DHCP based interfaces, enable # this. You don't want this if systemd is going to call the # interfaces on the real system something else, or if you're using a # network-manager like cloud-init, glean or network-manager that will # handle the interfaces dynamically. if [[ "${DIB_YUM_MINIMAL_CREATE_INTERFACES:-0}" -eq "1" ]]; then for interface in eth0 eth1; do cat << EOF | tee /etc/sysconfig/network-scripts/ifcfg-$interface > /dev/null DEVICE=$interface BOOTPROTO=dhcp ONBOOT=on EOF done fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum-minimal/install.d/11-ensure-dbus-daemon0000775000175000017500000000157015201026231031327 0ustar00zuulzuul#!/bin/bash # # Copyright 2019 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail # Ensure that dbus-daemon is enabled; fedora 30 and above has switched to # dbus-broker. if [[ ${DISTRO_NAME} == 'fedora' && ${DIB_RELEASE} -eq 29 ]]; then systemctl --no-reload enable dbus-daemon.service fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum-minimal/package-installs.yaml0000664000175000017500000000033215201026231027676 0ustar00zuulzuulaudit: dracut: dracut-config-generic: grubby: kernel: initscripts: man-pages: lsb_release: redhat-rpm-config: linux-firmware: uninstall: true linux-firmware-whence: uninstall: true NetworkManager: dhcp-client: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum-minimal/pkg-map0000664000175000017500000000104215201026231025046 0ustar00zuulzuul{ "release": { "centos": { "9-stream": { "lsb_release": "ed hostname patch postfix tar time" }, "10-stream": { "lsb_release": "python3-distro ed hostname patch postfix tar time", "dhcp-client": "dhcpcd" } } }, "distro": { "openeuler": { "linux-firmware": "", "linux-firmware-whence": "", "lsb_release": "openeuler-lsb", "redhat-rpm-config": "openEuler-rpm-config" } }, "family": { "redhat": { "lsb_release": "redhat-lsb-core" } } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4182386 diskimage_builder-3.42.0/diskimage_builder/elements/yum-minimal/pre-install.d/0000775000175000017500000000000015201026275026256 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum-minimal/pre-install.d/03-yum-cleanup0000775000175000017500000000174015201026231030655 0ustar00zuulzuul#!/bin/bash # # Copyright 2015 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail # effectively: febootstrap-minimize --keep-zoneinfo --keep-rpmdb --keep-services "$target" # docs rm -rf /usr/share/{doc,info,gnome/help} # i18n rm -rf /usr/share/i18n # sln rm -rf /sbin/sln # ldconfig rm -rf /etc/ld.so.cache /var/cache/ldconfig mkdir -p --mode=0755 /var/cache/ldconfig ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4182386 diskimage_builder-3.42.0/diskimage_builder/elements/yum-minimal/root.d/0000775000175000017500000000000015201026275025007 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/yum-minimal/root.d/08-yum-chroot0000775000175000017500000003660715201026231027274 0ustar00zuulzuul#!/bin/bash # # Copyright 2015 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # # dib-lint: disable=safe_sudo if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail source $_LIB/common-functions if [ -f ${TARGET_ROOT}/.extra_settings ] ; then . ${TARGET_ROOT}/.extra_settings fi ARCH=${ARCH:-x86_64} if [ $ARCH = amd64 ]; then ARCH=x86_64 elif [[ "arm64" == "$ARCH" ]]; then ARCH="aarch64" fi # Calling elements will need to set DISTRO_NAME and DIB_RELEASE # TODO Maybe deal with DIB_DISTRIBUTION_MIRROR http_proxy=${http_proxy:-} YUM=${YUM:-yum} WORKING=$(mktemp --tmpdir=${TMP_DIR:-/tmp} -d) EACTION="rm -r $WORKING" trap "$EACTION" EXIT YUM_CACHE=$DIB_IMAGE_CACHE/yum mkdir -p $YUM_CACHE # Debian Bullseye and beyond only has DNF locally HOST_YUM_DOWNLOADER="yumdownloader" HOST_YUM="yum" if ! command -v yumdownloader &> /dev/null then HOST_YUM_DOWNLOADER="dnf download" HOST_YUM="dnf" fi MAJOR_RELEASE=$(echo ${DIB_RELEASE} | cut -d- -f1) if [ ${MAJOR_RELEASE} -ge 10 ]; then RPMDB_PATH=/usr/lib/sysimage/rpm else RPMDB_PATH=/var/lib/rpm fi # Note, on Debian/Ubuntu, %_dbpath is set in the RPM macros as # ${HOME}/.rpmdb/ -- this makes sense as RPM isn't the system # packager. This path is relative to the "--root" argument _RPM="rpm --dbpath=$RPMDB_PATH" # install the [fedora|centos]-[release|repo] packages inside the # chroot, which are needed to bootstrap yum/dnf # # note this runs outside the chroot, where we're assuming the platform # has yum/yumdownloader/dnf download function _install_repos { local packages local rc # pre-install the base system packages via rpm. We previously # just left it up to yum to drag these in when we "yum install # yum" in the chroot in _install_pkg_manager. This raised a small # problem that inside the empty chroot yum went ahead and did a # mkdir for /var/run to put some pid file in, which then messed up # the "filesystem" package making /var/run a symlink to /run # ... which leads to odd issues with a running system. # # TODO: these packages still have some small %posttrans stuff that # depends on other packages (see rhbz#1306489) ... maybe the idea # is that they are only installed in one big transaction with the # rest of the system? but we don't want to use yum to do this # (see above) so ... packages="${DIB_YUM_MINIMAL_BOOTSTRAP_PACKAGES:-} " packages+="basesystem filesystem setup " if [[ ${DISTRO_NAME} = fedora ]]; then packages+="fedora-release-cloud fedora-release-common " packages+="fedora-repos fedora-gpg-keys" elif [[ ${DISTRO_NAME} = centos ]]; then packages+="centos-gpg-keys " if [[ "$DIB_RELEASE" =~ (stream) ]]; then packages+="centos-stream-release centos-stream-repos " else packages+="centos-linux-release centos-linux-repos " fi elif [[ ${DISTRO_NAME} == 'openeuler' ]]; then packages+="openEuler-release " packages+="openEuler-repos openEuler-gpg-keys " fi # By default, parent elements (fedora-minimal, centos-minimal) # have a yum.repos.d directory in the element with a default repo; # this is copied to TMP_HOOK_PATH by the usual hook-copying # routines. In the gate, environment.d files for the funtional # tests will set DIB_YUM_MINIMAL_BOOTSTRAP_REPOS -- this contains # mirrors correct for the region setup by the # dib-setup-gate-mirrors role. local repo=${DIB_YUM_MINIMAL_BOOTSTRAP_REPOS:-} if [[ -z ${repo} ]]; then # take in preference more specific subdirs if [[ -d ${TMP_HOOKS_PATH}/yum.repos.d/${DIB_RELEASE} ]]; then repo=${TMP_HOOKS_PATH}/yum.repos.d/${DIB_RELEASE} else repo=${TMP_HOOKS_PATH}/yum.repos.d fi fi # yumdownloader puts repo xml files and such into a directory # ${TMPDIR}/yum-$USER-random. Since we don't need this once the # initial download happens, redirect TMPDIR for this call so we # can clean it up nicely # # Note that the $releasever for centos-stream is just the major # version. There is another variable "$stream" that we don't pass local temp_tmp temp_tmp=$(mktemp -d) TMPDIR=${temp_tmp} ${HOST_YUM_DOWNLOADER} --verbose \ --releasever=${DIB_RELEASE/-*/} \ --setopt=reposdir=$repo \ --setopt=cachedir=$temp_tmp \ --destdir=$WORKING \ ${packages} && rc=$? || rc=$? rm -rf ${temp_tmp} if [[ ${rc} != 0 ]]; then die "Failed to download initial packages: ${packages}" fi # --nodeps works around these wanting /bin/sh in some fedora # releases, see rhbz#1265873 sudo $_RPM --root $TARGET_ROOT --nodeps -ivh $WORKING/*rpm # install the bootstrap mirror repos over the default ones, if # set. we will remove this at the end so the final image has # regular mirrors if [[ -n ${DIB_YUM_MINIMAL_BOOTSTRAP_REPOS:-} ]]; then for repo in $TARGET_ROOT/etc/yum.repos.d/*.repo; do sudo mv $repo $repo.USING_MIRROR done sudo cp ${DIB_YUM_MINIMAL_BOOTSTRAP_REPOS}/* \ $TARGET_ROOT/etc/yum.repos.d/ fi if [[ -n ${DIB_YUM_MINIMAL_EXTRA_REPOS:-} ]]; then sudo cp ${DIB_YUM_MINIMAL_EXTRA_REPOS}/* \ $TARGET_ROOT/etc/yum.repos.d/ fi # For openEuler, some repos like update are disabled by default. # Ensure all the repo is enabled, so that we get the latest packages. if [[ ${DISTRO_NAME} == 'openeuler' ]]; then sudo sed -i 's/enabled=0/enabled=1/' $TARGET_ROOT/etc/yum.repos.d/*.repo fi } # _install_pkg_manager packages... # # install the package manager packages. This is done outside the chroot # and with yum from the build system. # TODO: one day build systems will be dnf only, but we don't handle # that right now function _install_pkg_manager { # Install into the chroot, using the gpg keys from the release # rpm's installed in the chroot sudo sed -i "s,/etc/pki/rpm-gpg,$TARGET_ROOT/etc/pki/rpm-gpg,g" \ $TARGET_ROOT/etc/yum.repos.d/*repo # See notes on $_RPM variable -- we need to override the # $HOME-based dbpath set on debian/ubuntu here. Unfortunately, # yum does not have a way to override rpm macros from the command # line. So we modify the user's ~/.rpmmacros to set %_dbpath back # to "/var/lib/rpm" (note, this is taken relative to the # --installroot). # # Also note, we only want this done around this call -- this is # the only place we are using yum outside the chroot, and hence # picking up the base-system's default rpm macros. For example, # the yumdownloader calls above in _install_repos want to use # ~/.rpmdb/ ... there is nothing in the build-system /var/lib/rpm! # # Another issue we hit is having to set --releasever here. yum # determines $releasever based on (more or less) "rpm -q # --whatprovides $distroverpkg". By default, this is # "redhat-release" (fedora-release provides redhat-release) but # some platforms like CentOS override it in /etc/yum.conf (to # centos-release in their case). You can't override this (see # [1]), but setting --releasever works around this. # # [1] https://bugzilla.redhat.com/show_bug.cgi?id=1287333 # # Note(gthiemonge): since Centos 10 Stream the dbpath is # /usr/lib/sysimage/rpm ( flock -w 1200 9 || die "Can not lock .rpmmacros" echo "%_dbpath $RPMDB_PATH" >> $HOME/.rpmmacros local _lang_pack="" local _extra_pkgs="" if [[ ${DISTRO_NAME} =~ (centos|fedora) ]]; then # glibc from F24 onwards has split locales into "langpack" # packages. Host yum doesn't understand the # weak-dependencies glibc now uses to get the # minimal-langpack and chooses a random(ish) one that # satisfies the locale dependency (rhbz#1349258). # Work-around this by explicitly requring the minimal and # english (for en_US.UTF-8) pack. _lang_pack="glibc-minimal-langpack glibc-langpack-en" fi # Yum has some issues choosing weak dependencies. It can end # up choosing "coreutils-single" instead of "coreutils" which # causes problems later when a package actually requires # coreutils. For more info see # https://bugzilla.redhat.com/show_bug.cgi?id=1286445 # Really all we can do is pre-install the right thing _extra_pkgs+="coreutils " # Legacy yum reads vars from directory /etc/yum/vars and, unlike dnf, # does not provide setopt=varsdir. So, if $YUM is legacy yum and our # target root is dnf, symlink dnf vars. if [[ ! -d $TARGET_ROOT/etc/yum/vars ]]; then sudo mkdir -p $TARGET_ROOT/etc/yum sudo ln -s $TARGET_ROOT/etc/dnf/vars $TARGET_ROOT/etc/yum/vars fi sudo -E ${HOST_YUM} -y \ --disableexcludes=all \ --setopt=cachedir=$YUM_CACHE/$ARCH/$DIB_RELEASE \ --setopt=reposdir=$TARGET_ROOT/etc/yum.repos.d \ --releasever=${DIB_RELEASE/-*/} \ --installroot $TARGET_ROOT \ install $@ ${_lang_pack} ${_extra_pkgs} && rc=$? || rc=$? # we may have symlinked yum/vars -> dnf/vars, unset if so sudo unset $TARGET_ROOT/etc/yum/vars 2>/dev/null || true # Note we've modified the base system's .rpmmacros. Ensure we # clean it up *always* # sed makes it easy to remove last line, but not last n lines... sed -i '$ d' $HOME/.rpmmacros; sed -i '$ d' $HOME/.rpmmacros; if [ $rc != 0 ]; then die "Initial yum install to chroot failed! Can not continue." fi ) 9>$DIB_LOCKFILES/.rpmmacros.dib.lock # Set gpg path back because subsequent actions will take place in # the chroot sudo sed -i "s,$TARGET_ROOT/etc/pki/rpm-gpg,/etc/pki/rpm-gpg,g" \ $TARGET_ROOT/etc/yum.repos.d/*repo } # Note this is not usually done for root.d elements (see # lib/common-functions:mount_proc_dev_sys) but it's important that # we have things like /dev/urandom around inside the chroot for # the rpm [pre|post]inst scripts within the packages. sudo mkdir -p $TARGET_ROOT/proc $TARGET_ROOT/dev $TARGET_ROOT/sys sudo mount -t proc none $TARGET_ROOT/proc sudo mount --bind /dev $TARGET_ROOT/dev sudo mount -t devpts $(mount_dev_pts_options) devpts $TARGET_ROOT/dev/pts # Mounting /sys as RO indicates to various systemd things # that we are in a container sudo mount -o ro -t sysfs none $TARGET_ROOT/sys # initalize rpmdb if [ ${MAJOR_RELEASE} -ge 10 ]; then # Since Centos 10 Stream, the rpmdb is stored in /usr and # a symlink is added to /var/lib for compatibility. sudo mkdir -p $TARGET_ROOT/var/lib sudo mkdir -p $TARGET_ROOT/usr/lib/sysimage/rpm sudo ln -fs ../../usr/lib/sysimage/rpm $TARGET_ROOT/var/lib/rpm else sudo mkdir -p $TARGET_ROOT/var/lib/rpm fi sudo $_RPM --root $TARGET_ROOT --initdb # this makes sure that running yum/dnf in the chroot it can get # out to download stuff sudo mkdir $TARGET_ROOT/etc sudo cp /etc/resolv.conf $TARGET_ROOT/etc/resolv.conf # Bind mount the external yum cache inside the chroot. Same logic # as in the yum element to provide for yum caching copied here # because the sequencing is wrong otherwise sudo mkdir -p $TMP_MOUNT_PATH/tmp/yum sudo mount --bind $YUM_CACHE $TMP_MOUNT_PATH/tmp/yum _install_repos # Install package manager # We are somewhat fighting against the "yum" version on the host to # get things installed correctly. Fedora 27 onwards has a # "curl-minimal" package that will get pulled in by default for the # initial install (ianw: I think because the yum doesn't understand # weak dependencies correctly). This causes problems later if/when # "curl" gets installed (you need to add --allowerasing to let dnf get # rid of the old package). To avoid this, just install the full curl # and first up. On Centos, it's different again and we need to # specify libcurl as well, or the minimal libcurl packages come in # causing similar problems. *But* -- we can't also do that on Fedora # it seems, as it seems like as part of the Fedora modular updates # (https://docs.fedoraproject.org/en-US/modularity/) we can pick up # seemingly mismatched libraries. if [[ ${DISTRO_NAME} =~ (fedora|openeuler) ]]; then _install_pkg_manager dnf dnf-plugins-core curl elif [[ ${DISTRO_NAME} == centos ]]; then _install_pkg_manager dnf dnf-plugins-core curl libcurl else _install_pkg_manager yum fi # sort of like run_in_target; but we're not in a phase where that # works yet. strip unnecessary external env vars that can cause # problems. function _run_chroot { local cmd="$@" sudo -E chroot $TARGET_ROOT env -u TMPDIR sh -c "$cmd" } # we just installed yum/dnf with "outside" tools (yum/rpm) which # might have created /var/lib/[yum|rpm] (etc) that are slighlty # incompatible. Refresh everything with the in-chroot tools _run_chroot rpm --rebuilddb _run_chroot ${YUM} clean all # populate the lang reduction macro in the chroot echo "%_install_langs C:C.UTF-8:en_US:en_US.UTF-8" | \ sudo tee -a $TARGET_ROOT/etc/rpm/macros.langs > /dev/null _base_packages="systemd passwd findutils sudo util-linux-ng " # This package is split out from systemd on >F24, dracut is # missing the dependency and will fail to make an initrd without # it; see # https://bugzilla.redhat.com/show_bug.cgi?id=1398505 _base_packages+="systemd-udev " # bootstrap the environment within the chroot; bring in new # metadata with an update and install some base packages we need. _run_chroot ${YUM} -y update _run_chroot ${YUM} -y \ --setopt=cachedir=/tmp/yum/$ARCH/$DIB_RELEASE \ install ${_base_packages} # Put in a dummy /etc/resolv.conf over the temporary one we used # to bootstrap. systemd has a bug/feature [1] that it will assume # you want systemd-networkd as the network manager and create a # broken symlink to /run/... if the base image doesn't have one. # This broken link confuses things like dhclient. # [1] https://bugzilla.redhat.com/show_bug.cgi?id=1197204 echo -e "# This file intentionally left blank\n" | \ sudo tee $TARGET_ROOT/etc/resolv.conf # set the most reliable UTF-8 locale echo -e 'LANG="en_US.UTF-8"' | \ sudo tee $TARGET_ROOT/etc/locale.conf # default to UTC _run_chroot ln -sf /usr/share/zoneinfo/UTC \ /etc/localtime # cleanup # TODO : move this into a exit trap; and reconsider how # this integrates with the global exit cleanup path. sudo umount $TMP_MOUNT_PATH/tmp/yum sudo umount $TARGET_ROOT/proc sudo umount $TARGET_ROOT/dev/pts sudo umount $TARGET_ROOT/dev sudo umount $TARGET_ROOT/sys # RPM doesn't know whether files have been changed since install # At this point though, we know for certain that we have changed no # config files, so anything marked .rpmnew is just a bug. for newfile in $(sudo find $TARGET_ROOT -type f -name '*rpmnew') ; do sudo mv $newfile $(echo $newfile | sed 's/.rpmnew$//') done sudo rm -f ${TARGET_ROOT}/.extra_settings ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4202385 diskimage_builder-3.42.0/diskimage_builder/elements/zipl/0000775000175000017500000000000015201026275022322 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zipl/README.rst0000664000175000017500000000104715201026231024003 0ustar00zuulzuul========== zipl ========== Zipl is the bootloader for s390x. This element installs zipl on the base device holding the /boot directory on the system. It's mandatory for building s390x images. It replaces the `bootloader` element (which would install grub2 by default). This element has been tested with `ubuntu` and `ubuntu-minimal` distro. Arguments ========= * ``DIB_ZIPL_DEFAULT_CMDLINE`` sets the CMDLINE parameters that are appended to the zipl.conf parameter configuration. It defaults to 'LANG=en_US.UTF-8 console=ttyS0 console=ttyS1' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zipl/element-deps0000664000175000017500000000002115201026231024610 0ustar00zuulzuulpackage-installs ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zipl/element-provides0000664000175000017500000000001315201026231025511 0ustar00zuulzuulbootloader ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4202385 diskimage_builder-3.42.0/diskimage_builder/elements/zipl/environment.d/0000775000175000017500000000000015201026275025110 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zipl/environment.d/10-zipl-default-cmdline0000664000175000017500000000015415201026231031252 0ustar00zuulzuulexport DIB_ZIPL_DEFAULT_CMDLINE=${DIB_ZIPL_DEFAULT_CMDLINE:-"LANG=en_US.UTF-8 console=ttyS0 console=ttyS1"} ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4202385 diskimage_builder-3.42.0/diskimage_builder/elements/zipl/finalise.d/0000775000175000017500000000000015201026275024336 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zipl/finalise.d/50-zipl0000775000175000017500000000372215201026231025460 0ustar00zuulzuul#!/bin/bash # Copyright (c) 2017 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. # Configure zipl. if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then set -x fi set -eu set -o pipefail # get the device containing the /boot directory base_device=`df /boot --output=source | grep "/dev/*"` cat > /lib/s390-tools/zipl_helper.loop < /etc/zipl.conf <>"$KERNEL_CONF_FILE" ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4202385 diskimage_builder-3.42.0/diskimage_builder/elements/zypper/0000775000175000017500000000000015201026275022675 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zypper/README.rst0000664000175000017500000000113415201026231024353 0ustar00zuulzuul====== zypper ====== This element provides some customizations for zypper based distributions like SLES and openSUSE. It works in a very similar way as the yum element does for yum based distributions. Zypper is reconfigured so that it keeps downloaded packages cached outside of the build chroot so that they can be reused by subsequent image builds. The cache increases image building speed when building multiple images, especially on slow connections. This is more effective than using an HTTP proxy for caching packages since the download servers will often redirect clients to different mirrors. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4212387 diskimage_builder-3.42.0/diskimage_builder/elements/zypper/bin/0000775000175000017500000000000015201026275023445 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zypper/bin/install-packages0000775000175000017500000000407315201026231026611 0ustar00zuulzuul#!/bin/bash # Copyright 2013 SUSE Linux Products GmbH # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail MAP_ELEMENT= ACTION=install ACTION_ARGS="--no-recommends" SCRIPTNAME=$(basename $0) function show_options () { echo "Usage: $SCRIPTNAME [package ...]" echo echo "Options:" echo " -u -- update all packages" echo " -e -- erase/remove packages" echo " -d -- download the packages only" echo " -m -- use custom element package map (Example: -m nova)" exit 0 } function run_zypper() { # TODO: Uncertain if this can ever block wanting input from user zypper --non-interactive --gpg-auto-import-keys "$@" } TEMP=$(getopt -o hudem: -n $SCRIPTNAME -- "$@") if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi eval set -- "$TEMP" while true ; do case "$1" in -u) run_zypper dist-upgrade --no-recommends; exit 0;; -e) ACTION="remove"; ACTION_ARGS="--clean-deps"; shift;; -d) ACTION_ARGS="${ACTION_ARGS} --download-only"; shift;; -m) MAP_ELEMENT=$2; shift 2;; -h) show_options;; --) shift; break ;; *) echo "Error: unsupported option $1."; exit 1;; esac done PKGS=$@ if [ -n "$MAP_ELEMENT" ]; then if ! PKGS=$(pkg-map --element $MAP_ELEMENT $@); then echo "bin/pkg-map error. $PKGS" exit 1 fi fi if [ -z "${PKGS}" ]; then echo "Not running install-packages $ACTION with empty packages list" else run_zypper $ACTION $ACTION_ARGS $PKGS fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zypper/element-deps0000664000175000017500000000001415201026231025165 0ustar00zuulzuulinstall-bin ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4212387 diskimage_builder-3.42.0/diskimage_builder/elements/zypper/install.d/0000775000175000017500000000000015201026275024565 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zypper/install.d/01-login-defs0000775000175000017500000000042715201026231026753 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail if [[ ${DIB_RELEASE} == tumbleweed ]] ; then login_defs=/usr/etc/login.defs else login_defs=/etc/login.defs fi sed -i -e "s,^USERGROUPS_ENAB.*$,USERGROUPS_ENAB yes," $login_defs ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4222386 diskimage_builder-3.42.0/diskimage_builder/elements/zypper/post-install.d/0000775000175000017500000000000015201026275025550 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zypper/post-install.d/10-mkinitrd0000775000175000017500000000131615201026231027526 0ustar00zuulzuul#!/bin/bash # The base image created by kiwi does not contain an initrd so create one # here. if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # This is to tell mkinitrd to include the right tools for the root filesystem # that will actually be used for the final image. This is likely something # different than what the chroot is currently on (which might currently be a # tmpfs even). echo "rootfstype=${DIB_ROOT_FSTYPE}" > /etc/sysconfig/initrd # ToDo: This it not really clear to me. # Let's see which error occurs. # openSuse mkinitrd requires a valid root device be in fstab. ##sed -i 's/vda1/sda1/' /etc/fstab mkinitrd -A -B # And cleanup again rm /etc/sysconfig/initrd ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zypper/post-install.d/98-zypper-clean-cache0000775000175000017500000000022615201026231031376 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # clean all locally cached metadata sudo zypper clean -a ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zypper/post-install.d/99-zypper-no-keep-packages0000775000175000017500000000027515201026231032372 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # Disable caching packages for all repositories sudo zypper modifyrepo --all --no-keep-packages ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4222386 diskimage_builder-3.42.0/diskimage_builder/elements/zypper/pre-install.d/0000775000175000017500000000000015201026275025351 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zypper/pre-install.d/01-zypper-keep-packages0000775000175000017500000000026415201026231031536 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail # Enable caching packages for all repositories zypper modifyrepo --all --keep-packages ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4222386 diskimage_builder-3.42.0/diskimage_builder/elements/zypper/root.d/0000775000175000017500000000000015201026275024102 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zypper/root.d/50-zypper-cache0000775000175000017500000000045115201026231026634 0ustar00zuulzuul#!/bin/bash if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail [ -n "$TARGET_ROOT" ] ZYPPER_CACHE_DIR=$DIB_IMAGE_CACHE/zypper mkdir -p $ZYPPER_CACHE_DIR sudo mkdir -p $TMP_MOUNT_PATH/var/cache/zypp sudo mount --bind $ZYPPER_CACHE_DIR $TMP_MOUNT_PATH/var/cache/zypp ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4212387 diskimage_builder-3.42.0/diskimage_builder/elements/zypper-minimal/0000775000175000017500000000000015201026275024321 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zypper-minimal/README.rst0000664000175000017500000000125515201026231026003 0ustar00zuulzuul============== zypper-minimal ============== Base element for creating minimal SUSE-based images This element is incomplete by itself so you probably want to use it along with the opensuse-minimal one. It requires 'zypper' to be installed on the host. To create a zypper-based image with non-default repositories, set ``DIB_ZYPPER_REPOS`` to a mapping of repository names to URLs, for example:: DIB_ZYPPER_REPOS="update=>http://smt-mirror.example.com/SUSE:/SLE-15-SP1:/Update/standard/ " DIB_ZYPPER_REPOS+="SLE-15-SP1=>http://smt-mirror.example.com/ibs/SUSE:/SLE-15-SP1:/GA/standard/ " DIB_ZYPPER_REPOS+="SLE-15=>http://smt-mirror.example.com/ibs/SUSE:/SLE-15:/GA/standard/ " ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zypper-minimal/element-deps0000664000175000017500000000003015201026231026607 0ustar00zuulzuulpackage-installs zypper ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zypper-minimal/package-installs.yaml0000664000175000017500000000040015201026231030411 0ustar00zuulzuul# kernel kernel-default: # locale support (we need LC_ALL=en_US.utf8) glibc-locale: # And a few useful tools. Some are pulled # as dependencies but that may change so lets # be explicit. bash: ca-certificates-mozilla: lsb-release: openssl: sed: sudo: tar: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4212387 diskimage_builder-3.42.0/diskimage_builder/elements/zypper-minimal/post-install.d/0000775000175000017500000000000015201026275027174 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zypper-minimal/post-install.d/01-locale-cleanup0000775000175000017500000000043515201026231032216 0ustar00zuulzuul#!/bin/bash # Only keep the minimum amount of locales to save disk space # if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail find /usr/lib/locale -mindepth 1 -maxdepth 1 -type d 2>/dev/null | \ grep -Ev '/(C.utf8|en_US|en_US.utf8)$' | xargs rm -rf ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4212387 diskimage_builder-3.42.0/diskimage_builder/elements/zypper-minimal/pre-install.d/0000775000175000017500000000000015201026275026775 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021500000000000010213 xustar00119 path=diskimage_builder-3.42.0/diskimage_builder/elements/zypper-minimal/pre-install.d/00-disable-zypper-recommends 22 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zypper-minimal/pre-install.d/00-disable-zypper-r0000775000175000017500000000064015201026231032321 0ustar00zuulzuul#!/bin/bash # Prevent libsolv/zypper from installing recommended packages if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then set -x fi set -eu set -o pipefail fgrep -qx "solver.onlyRequires = true" /etc/zypp/zypp.conf || { cat >> /etc/zypp/zypp.conf << _EOF_ ## Disable installation of recommended packages, language packages ## and packages which depend on hardware (modalias). solver.onlyRequires = true _EOF_ } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4212387 diskimage_builder-3.42.0/diskimage_builder/elements/zypper-minimal/root.d/0000775000175000017500000000000015201026275025526 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/elements/zypper-minimal/root.d/08-zypper-chroot0000775000175000017500000001354415201026231030525 0ustar00zuulzuul#!/bin/bash # # Copyright 2016 SUSE Linux GmbH # Copyright 2015 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # # dib-lint: disable=safe_sudo if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail source $_LIB/common-functions function cleanup() { sudo umount $TARGET_ROOT/proc sudo umount $TARGET_ROOT/dev/pts sudo umount $TARGET_ROOT/dev sudo umount $TARGET_ROOT/sys sudo umount $TMP_MOUNT_PATH/var/cache/zypp } trap cleanup EXIT ZYPPER_TARGET_OPTS="--non-interactive --gpg-auto-import-keys --root $TARGET_ROOT" ZYPPER_INSTALL_SYSTEM_PYTHON="python3" DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-https://download.opensuse.org} ZYPPER_REPOS=${DIB_ZYPPER_REPOS:-''} if [ -z "${ZYPPER_REPOS}" ] ; then case ${DIB_RELEASE} in # Old Leap releases 42*) ZYPPER_REPOS="update=>${DIB_DISTRIBUTION_MIRROR}/update/leap/${DIB_RELEASE}/oss/ " ZYPPER_REPOS+="oss=>${DIB_DISTRIBUTION_MIRROR}/distribution/leap/${DIB_RELEASE}/repo/oss/" ZYPPER_INSTALL_SYSTEM_PYTHON="python" ;; # New Leap releases 15*) ZYPPER_REPOS="update=>${DIB_DISTRIBUTION_MIRROR}/update/leap/${DIB_RELEASE}/oss/ " ZYPPER_REPOS+="oss=>${DIB_DISTRIBUTION_MIRROR}/distribution/leap/${DIB_RELEASE}/repo/oss/" ;; # Tumbleweed tumbleweed) ZYPPER_REPOS="update=>${DIB_DISTRIBUTION_MIRROR}/update/${DIB_RELEASE}/ " ZYPPER_REPOS+="oss=>${DIB_DISTRIBUTION_MIRROR}/${DIB_RELEASE}/repo/oss/" ;; *) echo "Unsupported openSUSE release: ${DIB_RELEASE}"; exit 1 ;; esac fi for repo in ${ZYPPER_REPOS}; do refresh_repo="" reponame=repo-${repo%%=>*} repouri=${repo##*=>} # Refresh all repos in TW and only the update one for the stable ones. This will ensure that # we always get the latest information from the repo. [[ ${DIB_RELEASE} == tumbleweed ]] || [[ ${reponame} == "repo-update" ]] && refresh_repo="-f" sudo zypper ${ZYPPER_TARGET_OPTS} addrepo --name ${reponame} --keep-packages ${refresh_repo} ${repouri} ${reponame} done # It appears that zypper will clean up the repo's cache when it (re-)adds the # repo so we need to add the cache now, once the repos are added. This is # similar to what the zypper/50-zypper-cache script does ZYPPER_CACHE_DIR=$DIB_IMAGE_CACHE/zypper mkdir -p $ZYPPER_CACHE_DIR sudo mkdir -p $TMP_MOUNT_PATH/var/cache/zypp sudo mount --bind $ZYPPER_CACHE_DIR $TMP_MOUNT_PATH/var/cache/zypp # Refresh it so we get updated data in cased we switched DIB_RELEASE # since last run. sudo zypper ${ZYPPER_TARGET_OPTS} refresh # Note this is not usually done for root.d elements (see # lib/common-functions:mount_proc_dev_sys) but it's important that # we have things like /dev/urandom around inside the chroot for # the rpm [pre|post]inst scripts within the packages. sudo mkdir -p $TARGET_ROOT/proc $TARGET_ROOT/dev $TARGET_ROOT/sys sudo mount -t proc none $TARGET_ROOT/proc sudo mount --bind /dev $TARGET_ROOT/dev sudo mount -t devpts $(mount_dev_pts_options) devpts $TARGET_ROOT/dev/pts sudo mount -o ro -t sysfs none $TARGET_ROOT/sys # Install filesystem, base and useful tools sudo zypper ${ZYPPER_TARGET_OPTS} install --no-recommends filesystem # Install grep before base to avoid pulling in busybox-grep as it conflicts # with rsync installation sudo zypper ${ZYPPER_TARGET_OPTS} install --no-recommends grep # Install gzip before base to avoid pulling in busybox-gzip as it conflicts # with info installation sudo zypper ${ZYPPER_TARGET_OPTS} install --no-recommends gzip # Install xz before base to avoid pulling in busybox-xz # https://bugzilla.opensuse.org/show_bug.cgi?id=1172209 sudo zypper ${ZYPPER_TARGET_OPTS} install --no-recommends xz # Install basic components in order sudo zypper ${ZYPPER_TARGET_OPTS} install \ ${DIB_OPENSUSE_PATTERNS} ${ZYPPER_INSTALL_SYSTEM_PYTHON} \ zypper sudo ca-certificates-mozilla # Remove the installed symlink, otherwise we wipe the resolv.conf # outside the target_root (as the link is not relative) # outside target_root test -L $TARGET_ROOT/etc/resolv.conf && sudo rm -f $TARGET_ROOT/etc/resolv.conf # Put in a dummy /etc/resolv.conf over the temporary one we used # to bootstrap. systemd has a bug/feature [1] that it will assume # you want systemd-networkd as the network manager and create a # broken symlink to /run/... if the base image doesn't have one. # This broken link confuses things like dhclient. # [1] https://bugzilla.redhat.com/show_bug.cgi?id=1197204 echo -e "# This file intentionally left blank\n" | \ sudo tee $TARGET_ROOT/etc/resolv.conf # set the most reliable UTF-8 locale default_lang="C.UTF-8" sudo sed -i -e "s,^RC_LANG=.*,RC_LANG=\"$default_lang\"," \ $TARGET_ROOT/etc/sysconfig/language echo -e "LANG=\"$default_lang\"" | \ sudo tee $TARGET_ROOT/etc/locale.conf # default to UTC sudo chroot $TARGET_ROOT ln -sf /usr/share/zoneinfo/Etc/UTC \ /etc/localtime # RPM doesn't know whether files have been changed since install # At this point though, we know for certain that we have changed no # config files, so anything marked .rpmnew is just a bug. for newfile in $(sudo find $TARGET_ROOT -type f -name '*rpmnew') ; do sudo mv $newfile $(echo $newfile | sed 's/.rpmnew$//') done # Unmounting of all the mount points is handled by the cleanup EXIT # handler so there is nothing else to do here ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4242387 diskimage_builder-3.42.0/diskimage_builder/lib/0000775000175000017500000000000015201026275020276 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/lib/common-defaults0000664000175000017500000000331515201026231023310 0ustar00zuulzuul# Copyright 2012 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. if [ -f /etc/debian_version ]; then _ARCH=$(dpkg --print-architecture) else _ARCH=$(uname -m) # Standardise Architecture names case $_ARCH in "x86_64") _ARCH="amd64" ;; "armv"*) _ARCH="armhf" ;; "aarch64") _ARCH="arm64" ;; esac fi ARCH=${ARCH:-$_ARCH} export ARCH export DIB_CHECKSUM=${DIB_CHECKSUM:-0} export DIB_NO_TMPFS=${DIB_NO_TMPFS:-0} export DIB_MIN_TMPFS=${DIB_MIN_TMPFS:-2} # Set via the CLI normally. # IMAGE_ELEMENT= ELEMENTS_PATH=${ELEMENTS_PATH:+"$ELEMENTS_PATH:$_BASE_ELEMENT_DIR"} export ELEMENTS_PATH=${ELEMENTS_PATH:-$_BASE_ELEMENT_DIR} export DIB_OFFLINE=${DIB_OFFLINE:-''} # /sbin and friends aren't automatically included in $PATH when running sudo # on Fedora/RHEL/SUSE Linux which breaks various pieces of this script in # exciting ways, so inject them into the current $PATH if they're not there. if ! [[ ":$PATH" =~ ":/sbin" ]] ; then export PATH=$PATH:/sbin fi if ! [[ ":$PATH" =~ ":/usr/sbin" ]] ; then export PATH=$PATH:/usr/sbin fi if ! [[ ":$PATH" =~ ":/usr/local/sbin" ]] ; then export PATH=$PATH:/usr/local/sbin fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/lib/common-functions0000664000175000017500000004350515201026231023516 0ustar00zuulzuul# Copyright 2012 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # This is the "internal" verison of dib-run-parts. If you modify # this, be aware that it needs to run both inside and outside the # chroot environment, so it needs to be very generic. DIB_RUN_PARTS=${_LIB}/dib-run-parts function tmpfs_check() { local echo_message=${1:-1} [ "$DIB_NO_TMPFS" == "0" ] || return 1 [ -r /proc/meminfo ] || return 1 total_kB=$(awk '/^MemTotal/ { print $2 }' /proc/meminfo) # tmpfs uses by default 50% of the available RAM, so the RAM should be at least # the double of the minimum tmpfs size required RAM_NEEDED=$(($DIB_MIN_TMPFS * 2)) [ $total_kB -lt $(($RAM_NEEDED*1024*1024)) ] || return 0 if [ $echo_message == '1' ]; then echo "WARNING: Not enough RAM to use tmpfs for build. Using ${TMP_DIR:-/tmp}. ($total_kB < ${RAM_NEEDED}G)" fi return 1 } function mk_build_dir () { TMP_BUILD_DIR=$(mktemp -t -d --tmpdir=${TMP_DIR:-/tmp} dib_build.XXXXXXXX) TMP_IMAGE_DIR=$(mktemp -t -d --tmpdir=${TMP_DIR:-/tmp} dib_image.XXXXXXXX) [ $? -eq 0 ] || die "Failed to create tmp directory" export TMP_BUILD_DIR if tmpfs_check ; then sudo mount -t tmpfs tmpfs $TMP_BUILD_DIR sudo mount -t tmpfs tmpfs $TMP_IMAGE_DIR sudo chown $(id -u):$(id -g) $TMP_BUILD_DIR $TMP_IMAGE_DIR fi trap trap_cleanup EXIT echo Building in $TMP_BUILD_DIR export TMP_IMAGE_DIR export OUT_IMAGE_PATH=$TMP_IMAGE_PATH export TMP_HOOKS_PATH=$TMP_BUILD_DIR/hooks } function finish_image () { if [ -f $1 -a ${OVERWRITE_OLD_IMAGE:-0} -eq 0 ]; then old_image="${1%.*}"-$(date +%Y.%m.%d-%H.%M.%S).${1##*.} echo "Old image found. Renaming it to $old_image" mv "$1" "$old_image" if [ -f "$1.md5" ]; then mv "$1.md5" "$old_image.md5" fi if [ -f "$1.sha256" ]; then mv "$1.sha256" "$old_image.sha256" fi fi mv $OUT_IMAGE_PATH $1 if [[ -n "$DIB_CHECKSUM" && "$DIB_CHECKSUM" != "0" ]]; then # NOTE(pabelanger): Read image into memory once and generate # both checksum files. # NOTE(ianw): we've seen issues with this waiting for # our outfilter.py wrapper when containerised (probably due to # no tty). Waiting for just these processes is a bit of hacky # workaround ... declare -a wait_for [[ "$DIB_CHECKSUM" == "1" ]] && DIB_CHECKSUM="md5,sha256" if [[ "$DIB_CHECKSUM" == *md5* ]]; then md5sum $1 > $1.md5 & wait_for+=($!); fi if [[ "$DIB_CHECKSUM" == *sha256* ]]; then sha256sum $1 > $1.sha256 & wait_for+=($!); fi wait "${wait_for[@]}" fi echo "Image file $1 created..." } function save_image () { finish_image $1 } function copy_hooks_not_overwrite () { _DIR=$(basename $1) test -d $TMP_HOOKS_PATH/$_DIR || mkdir $TMP_HOOKS_PATH/$_DIR for _HOOK in $(ls $1); do if [ ! -f $TMP_HOOKS_PATH/$_DIR/$_HOOK ]; then echo "Copying hooks $1/$_HOOK" cp -t $TMP_HOOKS_PATH/$_DIR -a $1/$_HOOK else echo "There is a duplicated hook in your elements: $_ELEMENT/$_DIR/$_HOOK" exit 1 fi done } function generate_hooks () { local xtrace xtrace=$(set +o | grep xtrace) set +o xtrace local dir local file eval declare -A image_elements=($(get_image_element_array)) mkdir -p $TMP_HOOKS_PATH for i in "${!image_elements[@]}"; do local element=$i local element_dir=${image_elements[$i]} echo "Copying hooks for ${element}" for dir in $(find $element_dir \ -follow -mindepth 1 -maxdepth 1 \ -type d \ -not -name tests \ -not -name __pycache__); do copy_hooks_not_overwrite $dir done for file in $(find $element_dir \ -follow -maxdepth 1 \ -type f \ -not -name '*.pyc'); do cp -t $TMP_HOOKS_PATH -a $file done done $xtrace } # Call the supplied break-in routine if the named point is listed in the break # list. # $1 the break point. # $2.. what to call if a break is needed function check_break () { if echo "${break:-}" | egrep -e "(,|^)$1(,|$)" -q; then echo "Starting debug shell. Exit to resume building." >&2 echo At stage $1 >&2 shift "$@" echo "Resuming" >&2 fi } # Check that a real element has been chosen (prevents foot-guns) function check_element () { [ -d $TMP_HOOKS_PATH ] || generate_hooks } # Run a hook, looking for a regex in its stdout, and eval the matched lines. # $1 is the hook to run # $2 is the regex to look for function eval_run_d () { local run_output=$(mktemp) trap "rm -f $run_output; check_break after-error ${break_cmd:-bash}" ERR run_d $1 $run_output if grep -q "$2" $run_output; then local temp=$(grep "$2" $run_output) eval "$temp" fi rm $run_output trap - ERR } # Get any process that appears to be running in $TMP_BUILD_DIR function _get_chroot_processes () { # Deselect kernel threads, and use a python script to avoid # forking lots and lots of readlink / grep processes on a busy # system. ps --ppid 2 -p 2 --deselect -o pid= | xargs ${DIB_PYTHON_EXEC:-python} -c ' import os import sys for pid in sys.argv[2:]: try: root = os.readlink("/proc/%s/root" % pid) except: continue if sys.argv[1] in root: print("%s" % pid) ' $TMP_BUILD_DIR } function kill_chroot_processes () { local xtrace xtrace=$(set +o | grep xtrace) set +o xtrace local pidname if [ -z "${1}" ]; then echo "ERROR: no chroot directory specified" exit 1 fi for pid in $(_get_chroot_processes); do # If there are open files from the chroot, just kill the process using # these files. This is racy, but good enough pidname=$(cat $piddir/comm 2>/dev/null || echo "unknown") echo "Killing chroot process: '${pidname}($pid)'" sudo kill $pid done $xtrace } function cleanup_build_dir () { if ! timeout 10 sh -c " while ! sudo rm -rf $TMP_BUILD_DIR/built; do sleep 1; done"; then echo "ERROR: unable to cleanly remove $TMP_BUILD_DIR/built" exit 1 fi sudo rm -rf $TMP_BUILD_DIR/mnt kill_chroot_processes $TMP_BUILD_DIR if tmpfs_check 0; then # If kill_chroot_processes did not succeed then we have to wait for # init to reap the orphaned chroot processes if ! timeout 120 sh -c "while ! sudo umount -f $TMP_BUILD_DIR; do sleep 1; done"; then echo "ERROR: failed to umount the $TMP_BUILD_DIR tmpfs mount point" exit 1 fi fi rm -rf --one-file-system $TMP_BUILD_DIR } function cleanup_image_dir () { kill_chroot_processes $TMP_IMAGE_DIR if tmpfs_check 0; then if ! timeout 120 sh -c "while ! sudo umount -f $TMP_IMAGE_DIR; do sleep 1; done"; then echo "ERROR: failed to umount the $TMP_IMAGE_DIR tmpfs mount point" exit 1 fi fi rm -rf --one-file-system $TMP_IMAGE_DIR } # Run a directory of hooks outside the target (that is, no chrooting). function run_d() { check_element check_break before-$1 ${break_cmd:-bash} if [ -d ${TMP_HOOKS_PATH}/$1.d ] ; then echo "Running hooks from ${TMP_HOOKS_PATH}/$1.d" if [ -n "$2" ]; then ${DIB_RUN_PARTS} ${TMP_HOOKS_PATH}/$1.d | tee $2 if [[ ${PIPESTATUS[0]} != 0 ]]; then return 1 fi else ${DIB_RUN_PARTS} ${TMP_HOOKS_PATH}/$1.d fi fi check_break after-$1 bash } function _arg_defaults_hack() { # The block-device configuration looks in all elements for a # "block-device-default.yaml" file. The "vm" element used to # provide the default block-device, which was fine when there was # only one option; but now we have mbr, gpt & efi versions. # # So now the vm element has a dependency on the block-device # element, which several different elements can provide. However, # for backwards compatability we need to ensure you can still # build without specifying it. Thus if we see the vm element, but # no block-device-* element, we will automatically add the old # default MBR. # # Note that you can still override this by setting # DIB_BLOCK_DEVICE_CONFIG; any value there will be taken over the # element defaults. In this case you'd have "block-device-mbr" as # an element, but it wouldn't actually be used for configuration. # # XXX: if this is becoming a common problem, we could have some # sort of "element-defaults" that maps a "element-deps" entry to a # default. local vm_seen local blockdev_seen local elements for arg do if [[ $arg = vm ]]; then vm_seen=1 elif [[ $arg = block-device-* ]]; then blockdev_seen=1 fi elements="$elements $arg" done if [[ -n "${vm_seen}" && -z "${blockdev_seen}" ]]; then if [[ "arm64 aarch64" =~ $ARCH ]] ; then elements="$elements block-device-efi" else elements="$elements block-device-mbr" fi fi echo $elements } function arg_to_elements() { for arg do IMAGE_ELEMENT="$IMAGE_ELEMENT $arg" ; done IMAGE_ELEMENT="$(_arg_defaults_hack $IMAGE_ELEMENT)" if [ "$SKIP_BASE" != "1" ]; then IMAGE_ELEMENT="base $IMAGE_ELEMENT" fi if [ "$IS_RAMDISK" == "1" ]; then IMAGE_ELEMENT="$RAMDISK_ELEMENT $IMAGE_ELEMENT" fi echo "Building elements: $IMAGE_ELEMENT" export IMAGE_ELEMENT # element-info will output bash code to create # * IMAGE_ELEMENT # legacy list of elements # # * IMAGE_ELEMENT_YAML # YAML dictionary with key=element, value=path # # import os # import yaml # yaml.load(os.getenv('IMAGE_ELEMENT_YAML') # # * function get_image_element_array # Function to create Bash associative-array. Since bash can not # export array variables, we provide a function to populate the # variables. # # # we need the eval, it expands the string for the array create # eval declare -A image_elements=($(get_image_element_array)) # for i in ${!image_elements[@]}; do # element=$i # path=${image_elements[$i] # done elinfo_out="$(${DIB_PYTHON_EXEC} ${_LIB}/element-info.py --env ${IMAGE_ELEMENT})" if [ $? -ne 0 ]; then echo "ERROR: element-info failed to expand elements." exit 1 fi eval "$elinfo_out" echo "Expanded element dependencies to: $IMAGE_ELEMENT" } function create_base () { mkdir $TMP_BUILD_DIR/mnt # Make sure the / inside the chroot is owned by root # If it is not owned by root, some Ubuntu bionic packages will fail # path validation at install time. sudo chown root.root $TMP_BUILD_DIR/mnt export TMP_MOUNT_PATH=$TMP_BUILD_DIR/mnt # Copy data in to the root. TARGET_ROOT=$TMP_MOUNT_PATH run_d root if [ -z "$(ls $TMP_MOUNT_PATH | grep -v '^lost+found\|tmp$')" ] ; then # No root element copied in. Note the test above allows # root.d elements to put things in /tmp echo "Failed to deploy the root element." exit 1 fi # Configure Image # Save resolv.conf as created by the initial install. Note the # .ORIG file is an exported interface -- it may be modified and we # will copy it back in during finalisation of the image. # Note that we use -L and -f to test here as test (and bash [[) # return false with -e if the link target does not exist. if [ -L $TMP_MOUNT_PATH/etc/resolv.conf ] || [ -f $TMP_MOUNT_PATH/etc/resolv.conf ] ; then sudo mv $TMP_MOUNT_PATH/etc/resolv.conf $TMP_MOUNT_PATH/etc/resolv.conf.ORIG fi # Recreate resolv.conf sudo touch $TMP_MOUNT_PATH/etc/resolv.conf sudo chmod 777 $TMP_MOUNT_PATH/etc/resolv.conf # use system configured resolv.conf if available to support internal proxy resolving if [ -e /etc/resolv.conf ]; then cat /etc/resolv.conf > $TMP_MOUNT_PATH/etc/resolv.conf else echo nameserver 8.8.8.8 > $TMP_MOUNT_PATH/etc/resolv.conf fi mount_proc_dev_sys } # Get mount options for mounting /dev/pts # Kernel commit https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eedf265aa003b4781de24cfed40a655a664457e6 # introduced in v4.7 allows multiple instances of devpts. However, # some distributions are running older kernels so we need to take # care on what options we use to mount a new instance of devpts # filesystem since it's not completely independent. The best thing # to do is to simply use the existing mount options. function mount_dev_pts_options() { echo "-o $(findmnt --first-only /dev/pts --noheadings --output OPTIONS)" } function mount_proc_dev_sys () { # supporting kernel file systems sudo mount -t proc none $TMP_MOUNT_PATH/proc sudo mount --bind /dev $TMP_MOUNT_PATH/dev sudo mount -t devpts $(mount_dev_pts_options) devpts $TMP_MOUNT_PATH/dev/pts # /sys is mounted RO inside non-privledged containers, thus # mounting this RO in the chroot here is an indication to # systemd/udev and other things that you are inside a container. # This is generically safe and can help avoid issues where things # we don't control like pre/post scripts try to do things that # don't work when building inside a dib container like udevadm # --settle calls, etc. sudo mount -o ro -t sysfs none $TMP_MOUNT_PATH/sys } # Recursively unmount directories under a given directory DIR # usage: # unmount_dir DIR function unmount_dir { local dir="$1" local real_dir local mnts local split_mounts local found_mountpoint if [ ! -d $dir ]; then echo "*** $dir is not a directory" return 0 fi # get rid of any symlink elements in the incoming path, because # /proc/mounts is the real path real_dir=$(readlink -e $dir) # populate the exported mountpoints IFS='|' read -ra split_mounts <<< "$DIB_MOUNTPOINTS" # note the "/" on real_dir ... we are just looking for things # mounted *underneath* this directory. mnts=$(awk '{print $2}' < /proc/mounts | grep "^$real_dir/" | sort -r) for m in $mnts; do # check if suffix is in array found_mountpoint=false for mountpoint in "${split_mounts[@]}"; do if [[ "$mountpoint" != "/" ]]; then if [[ "$m" == *$mountpoint ]]; then echo "Mountpoint $m managed by block device; skipping" found_mountpoint=true break fi fi done if [ $found_mountpoint == false ]; then # unmount the directory as it is not managed by block device echo "Unmount $m" sudo umount -fl $m || true fi done } # Create YAML config file for the block device layer # The order here is: use the one the user provides - if there is # none provided, fall back to the possible one element which # defines a fallback configuration. # Parameters: # - name of the to be created config file function block_device_create_config_file { # nosiy; we manually trace local xtrace xtrace=$(set +o | grep xtrace) set +o xtrace local config_yaml="$1" if [[ ${DIB_BLOCK_DEVICE_CONFIG:-} == file://* ]]; then cp $(echo ${DIB_BLOCK_DEVICE_CONFIG} | cut -c 8-) ${config_yaml} echo "Using file-based block-device config: ${DIB_BLOCK_DEVICE_CONFIG}" $xtrace return fi if [ -n "${DIB_BLOCK_DEVICE_CONFIG:-}" ]; then printf "%s" "${DIB_BLOCK_DEVICE_CONFIG}" >${config_yaml} echo "User specified block-device config from DIB_BLOCK_DEVICE_CONFIG" $xtrace return fi # Search the elements for a matching block-device config. # XXX: first match wins? echo "Searching elements for block-device[-${ARCH}].yaml ..." eval declare -A image_elements=($(get_image_element_array)) for i in ${!image_elements[@]}; do local cfg # look for arch specific version first, then default if [[ "ppc64le ppc64el" =~ $ARCH ]] ; then # NOTE(tonyb): ppc64el and ppc64le are the same archttechture, it's # just different distro's have different names. So if we're either # of them pick the block-device-ppc64el.yaml file cfg=${image_elements[$i]}/block-device-ppc64el.yaml else cfg=${image_elements[$i]}/block-device-${ARCH}.yaml fi if [ -e ${cfg} ]; then cp ${cfg} ${config_yaml} echo "Using block-device config: ${cfg}" $xtrace return else cfg=${image_elements[$i]}/block-device-default.yaml if [ -e ${cfg} ]; then cp ${cfg} ${config_yaml} echo "Using block-device config: ${cfg}" $xtrace return fi fi done echo "... done" # how did this get here? if [ -e ${config_yaml} ]; then die "${config_yaml} exists?" fi echo "Using default block-device fallback config" # If no config is there (until now) use the default config cat >${config_yaml} <&2 function output_prefix { printf "%s " "${name}" >&2 } function output { output_prefix echo $* >&2 } function output_printf { local FORMAT="$1" shift output_prefix printf "${FORMAT}" $@ >&2 } function cleanup { rm -rf ${PROFILE_DIR} } # source the environment files from environment.d # arg : target_dir function source_environment { local dir=$target_dir/../environment.d local env_files local xtrace if [ -d ${dir} ] ; then env_files=$(find ${dir} -maxdepth 1 -xtype f | \ grep -E "/[0-9A-Za-z_\.-]+$" | \ LANG=C sort -n) for env_file in $env_files ; do output "Sourcing environment file ${env_file}" # Set tracing as we import these environment files; it's # nice to see the definitions in the logs xtrace=$(set +o | grep xtrace) set -o xtrace source $env_file $xtrace done fi } if [ $# -lt 1 ] ; then usage fi if [ "$1" == "--list" ] ; then show_list="1" shift fi target_dir="${1:-}" if ! [ -d "$target_dir" ] ; then output "Scripts directory [$target_dir] must exist and be a directory" usage fi # We specifically only want to sort *by the numbers*. # Lexical sorting is not guaranteed, and identical numbers may be # parallelized later # Note: -maxdepth 1 ensures only files in the target directory (but not # subdirectories) are run, which is the way run-parts behaves. targets=$(find $target_dir -maxdepth 1 -xtype f -executable -printf '%f\n' | grep -E "$allowed_regex" | LANG=C sort -n || echo "") if [ "$show_list" == "1" ] ; then for target in $targets ; do echo "${target_dir}/${target}" done exit 0 fi DIB_DEBUG_TRACE=${DIB_DEBUG_TRACE:-0} if [ ${DIB_DEBUG_TRACE} -gt 0 ]; then non_exec=$(find $target_dir -maxdepth 1 -xtype f \! -executable -printf '%f\n') if [ ! -z "$non_exec" ]; then output "Ignoring non-executable files: $non_exec" fi bad_filename=$(find $target_dir -maxdepth 1 -xtype f -executable -printf '%f\n' | grep -v -E "$allowed_regex" || echo "") if [ ! -z "$bad_filename" ]; then output "Ignoring non-conforming filenames: $bad_filename" fi fi PROFILE_DIR=$(mktemp -d --tmpdir profiledir.XXXXXX) trap cleanup EXIT # note, run this in a sub-shell so we don't pollute our # own environment with source_environment ( source_environment for target in $targets ; do output "Running $target_dir/$target" target_tag=${target//\//_} date +%s.%N > $PROFILE_DIR/start_$target_tag $target_dir/$target target_tag=${target//\//_} date +%s.%N > $PROFILE_DIR/stop_$target_tag output "$target completed" done ) output "----------------------- PROFILING -----------------------" output "" output "Target: $(basename $target_dir)" output "" output_printf "%-40s %9s\n" Script Seconds output_printf "%-40s %9s\n" --------------------------------------- ---------- output "" pushd $PROFILE_DIR > /dev/null for target in $(find . -name 'start_*' -printf '%f\n' | env LC_ALL=C sort -n) ; do stop_file=stop_${target##start_} start_seconds=$(cat $target) stop_seconds=$(cat $stop_file) duration=$(echo - | awk "{ print $stop_seconds - $start_seconds }") LC_NUMERIC=C LC_ALL=C output_printf "%-40s %10.3f\n" ${target##start_} $duration done popd > /dev/null rm -rf $PROFILE_DIR output "" output "--------------------- END PROFILING ---------------------" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/lib/die0000664000175000017500000000142015201026231020747 0ustar00zuulzuul# Copyright 2012 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # Prints "message" and exits # Usage: die "message" function die { local exitcode=$? set +o xtrace echo $@ exit $exitcode } export -f die ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/lib/disk-image-create0000775000175000017500000006014415201026231023474 0ustar00zuulzuul#!/bin/bash # # Copyright 2012 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. set -eE # Set/override locale. This ensures consistency in sorting etc. We # need to choose a lowest-common denominator locale, as this is # applied when running in the building chroot too (maybe a bug and we # should prune this?). Note: LC_ALL to really # override this; it overrides LANG and all other LC_ vars export LC_ALL=C # Store our initial environment and command line args for later export DIB_ARGS="$@" export DIB_ENV=$(declare -p $(compgen -v | grep '^DIB_')) SCRIPTNAME=$(basename $0) if [ -z "$_LIB" ]; then echo "_LIB not set!" exit 1 fi _BASE_ELEMENT_DIR=$(${DIB_PYTHON_EXEC:-python} -c ' import diskimage_builder.paths diskimage_builder.paths.show_path("elements")') source $_LIB/die DIB_BLOCK_DEVICE="${DIB_PYTHON_EXEC} ${_LIB}/dib-block-device.py" IS_RAMDISK=0 if [ "$SCRIPTNAME" == "ramdisk-image-create" ]; then IS_RAMDISK=1 fi function show_options () { echo "Usage: ${SCRIPTNAME} [OPTION]... [ELEMENT]..." echo echo "Options:" echo " -a amd64|armhf|arm64 -- set the architecture of the image(default amd64)" echo " -o imagename -- set the imagename of the output image file(default image)" echo " -t qcow2,tar,tgz,squashfs,vhd,docker,aci,raw -- set the image types of the output image files (default qcow2)" echo " File types should be comma separated. VHD outputting requires the vhd-util" echo " executable be in your PATH. ACI outputting requires the ACI_MANIFEST " echo " environment variable be a path to a manifest file." echo " -x -- turn on tracing (use -x -x for very detailed tracing)." echo " -u -- uncompressed; do not compress the image - larger but faster" echo " -c -- clear environment before starting work" echo " --logfile -- save run output to given logfile (implies DIB_QUIET=1)" echo " --checksum -- generate MD5 and SHA256 checksum files for the created image" echo " --image-size size -- image size in GB for the created image" echo " --image-extra-size size -- extra image size in GB for the created image" echo " --image-cache directory -- location for cached images(default ~/.cache/image-create)" echo " --max-online-resize size -- max number of filesystem blocks to support when resizing." echo " Useful if you want a really large root partition when the image is deployed." echo " Using a very large value may run into a known bug in resize2fs." echo " Setting the value to 274877906944 will get you a 1PB root file system." echo " Making this value unnecessarily large will consume extra disk space " echo " on the root partition with extra file system inodes." echo " --min-tmpfs size -- minimum size in GB needed in tmpfs to build the image" echo " --mkfs-journal-size -- filesystem journal size in MB to pass to mkfs." echo " --mkfs-options -- option flags to be passed directly to mkfs." echo " Options should be passed as a single string value." echo " --no-tmpfs -- do not use tmpfs to speed image build" echo " --offline -- do not update cached resources" echo " --qemu-img-options -- option flags to be passed directly to qemu-img." echo " Options need to be comma separated, and follow the key=value pattern." echo " --root-label label -- label for the root filesystem. Defaults to 'cloudimg-rootfs'." echo " --ramdisk-element -- specify the main element to be used for building ramdisks." echo " Defaults to 'ramdisk'. Should be set to 'dracut-ramdisk' for platforms such" echo " as RHEL and CentOS that do not package busybox." echo " --install-type -- specify the default installation type. Defaults to 'source'. Set to 'package' to use package based installations by default." echo " --docker-target -- specify the repo and tag to use if the output type is docker. Defaults to the value of output imagename" if [ "$IS_RAMDISK" == "0" ]; then echo " -n skip the default inclusion of the 'base' element" echo " -p package[,p2...] [-p p3] -- extra packages to install in the image. Runs once, after 'install.d' phase. Can be specified multiple times" fi echo " -h|--help -- display this help and exit" echo " --version -- display version and exit" echo echo "Environment Variables:" echo " (this is not a complete list)" echo echo " * ELEMENTS_PATH: specify external locations for the elements. As for \$PATH" echo " * DIB_NO_TIMESTAMP: no timestamp prefix on output. Useful if capturing output" echo " * DIB_QUIET: 1=do not output log output to stdout; 0=always ouptut to stdout. See --logfile" echo echo "NOTE: At least one distribution root element must be specified." echo echo "NOTE: If using the VHD output format you need to have a patched version of vhd-util installed for the image" echo " to be bootable. The patch is available here: https://github.com/emonty/vhd-util/blob/master/debian/patches/citrix" echo " and a PPA with the patched tool is available here: https://launchpad.net/~openstack-ci-core/+archive/ubuntu/vhd-util" echo echo "Examples:" if [ "$IS_RAMDISK" == "0" ]; then echo " ${SCRIPTNAME} -a amd64 -o ubuntu-amd64 vm ubuntu" echo " export ELEMENTS_PATH=~/source/tripleo-image-elements/elements" echo " ${SCRIPTNAME} -a amd64 -o fedora-amd64-heat-cfntools vm fedora heat-cfntools" else echo " ${SCRIPTNAME} -a amd64 -o fedora-deploy deploy fedora" echo " ${SCRIPTNAME} -a amd64 -o ubuntu-ramdisk ramdisk ubuntu" fi } function show_version() { ${DIB_PYTHON_EXEC:-python} -c "from diskimage_builder import version; print(version.version_info.version_string())" } DIB_DEBUG_TRACE=${DIB_DEBUG_TRACE:-0} INSTALL_PACKAGES="" IMAGE_TYPES=("qcow2") COMPRESS_IMAGE="true" DIB_GZIP_BIN=${DIB_GZIP_BIN:-"gzip"} ROOT_LABEL="${ROOT_LABEL:-}" DIB_DEFAULT_INSTALLTYPE=${DIB_DEFAULT_INSTALLTYPE:-"source"} MKFS_OPTS="" ACI_MANIFEST=${ACI_MANIFEST:-} DOCKER_TARGET="" LOGFILE="" TEMP=`getopt -o a:ho:t:xucnp: -l checksum,no-tmpfs,offline,help,version,min-tmpfs:,image-size:,image-cache:,max-online-resize:,mkfs-options:,qemu-img-options:,ramdisk-element:,root-label:,install-type:,docker-target:,logfile: -n $SCRIPTNAME -- "$@"` if [ $? -ne 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi # Note the quotes around `$TEMP': they are essential! eval set -- "$TEMP" while true ; do case "$1" in -a) export ARCH=$2; shift 2 ;; -o) export IMAGE_NAME=$2; shift 2 ;; -t) IFS="," read -a IMAGE_TYPES <<< "$2"; export IMAGE_TYPES ; shift 2 ;; -h|--help) show_options; exit 0;; --version) show_version; exit 0;; -x) shift; DIB_DEBUG_TRACE=$(( $DIB_DEBUG_TRACE + 1 ));; -u) shift; export COMPRESS_IMAGE="";; -c) shift ; export CLEAR_ENV=1;; -n) shift; export SKIP_BASE="1";; -p) IFS="," read -a _INSTALL_PACKAGES <<< "$2"; export INSTALL_PACKAGES=( ${INSTALL_PACKAGES[@]} ${_INSTALL_PACKAGES[@]} ) ; shift 2 ;; --checksum) shift; export DIB_CHECKSUM=1;; --image-size) export DIB_IMAGE_SIZE=$2; shift 2;; --image-extra-size) export DIB_IMAGE_EXTRA_SIZE=$2; shift 2;; --image-cache) export DIB_IMAGE_CACHE=$2; shift 2;; --max-online-resize) export MAX_ONLINE_RESIZE=$2; shift 2;; --mkfs-journal-size) export DIB_JOURNAL_SIZE=$2; shift 2;; --mkfs-options) MKFS_OPTS=$2; shift 2;; --min-tmpfs) export DIB_MIN_TMPFS=$2; shift 2;; --no-tmpfs) shift; export DIB_NO_TMPFS=1;; --offline) shift; export DIB_OFFLINE=1;; --qemu-img-options) QEMU_IMG_OPTIONS=$2; shift 2;; --root-label) ROOT_LABEL=$2; shift 2;; --ramdisk-element) RAMDISK_ELEMENT=$2; shift 2;; --install-type) DIB_DEFAULT_INSTALLTYPE=$2; shift 2;; --docker-target) export DOCKER_TARGET=$2; shift 2 ;; --logfile) export LOGFILE=$2; shift 2 ;; --) shift ; break ;; *) echo "Internal error!" ; exit 1 ;; esac done export DIB_DEBUG_TRACE # TODO: namespace this under ~/.cache/dib/ for consistency export DIB_IMAGE_CACHE=${DIB_IMAGE_CACHE:-~/.cache/image-create} mkdir -p $DIB_IMAGE_CACHE # We have a couple of critical sections (touching parts of the host # system or download images to common cache) that we use flock around. # Use this directory for lockfiles. export DIB_LOCKFILES=${DIB_LOCKFILES:-~/.cache/dib/lockfiles} mkdir -p $DIB_LOCKFILES if [ "$CLEAR_ENV" = "1" -a "$HOME" != "" ]; then echo "Re-execing to clear environment." echo "(note this will prevent much of the local_config element from working)" exec -c $0 "$@" fi # We send stdout & stderr through "outfilter" which does timestamping, # basic filtering and log file output. _TS_FLAG="" if [[ "${DIB_NO_TIMESTAMP:-0}" -eq 1 ]]; then _TS_FLAG="--no-timestamp" fi # A logfile with *no* DIB_QUIET specified implies we just want output # to the logfile. Explicitly setting DIB_QUIET=0 will overide this # and log both. if [[ -n "${LOGFILE}" && -z "${DIB_QUIET}" ]]; then DIB_QUIET=1 fi _QUIET_FLAG="-v" if [[ "${DIB_QUIET:-0}" -eq 1 ]]; then _QUIET_FLAG="" fi _LOGFILE_FLAG="" if [[ -n "${LOGFILE}" ]]; then echo "Output logs going to: ${LOGFILE}" _LOGFILE_FLAG="-o ${LOGFILE}" fi # Save the existing stdout to fd3 exec 3>&1 exec 1> >( ${DIB_PYTHON_EXEC:-python} $_LIB/outfilter.py ${_TS_FLAG} ${_QUIET_FLAG} ${_LOGFILE_FLAG} ) 2>&1 # Display the current file/function/line in the debug output function _ps4 { IFS=" " called=($(caller 0)) local f=$(readlink -f ${called[2]}) # As we're being run out of the python package's lib/ dir (either # virtualenv or system), we can strip everything before # "site-packages" to significantly shorten the line without really f=${f##*site-packages/} printf "%-80s " "$f:${called[1]}:${called[0]}" } export -f _ps4 export PS4='+ $(_ps4): ' source $_LIB/img-defaults source $_LIB/common-functions source $_LIB/img-functions if [ "$IS_RAMDISK" == "1" ]; then source $_LIB/ramdisk-defaults source $_LIB/ramdisk-functions fi echo "diskimage-builder version $(show_version)" # If no elements are specified theres no way we can succeed if [ -z "$*" ]; then echo "ERROR: At least one distribution root element must be specified" exit 1 fi arg_to_elements "$@" # start tracing after most boilerplate if [ ${DIB_DEBUG_TRACE} -gt 0 ]; then set -x fi if [ "${#IMAGE_TYPES[@]}" = "1" ]; then export IMAGE_NAME=${IMAGE_NAME%%\.${IMAGE_TYPES[0]}} fi # Check for required tools early on for X in ${!IMAGE_TYPES[@]}; do case "${IMAGE_TYPES[$X]}" in qcow2) if ! type qemu-img > /dev/null 2>&1; then echo "qcow2 output format specified but qemu-img executable not found." exit 1 fi ;; tgz) # Force tar to be created. IMAGE_TYPES+=('tar') ;; vhd) if ! type vhd-util > /dev/null 2>&1; then echo "vhd output format specified but no vhd-util executable found." exit 1 fi ;; squashfs) if ! type mksquashfs > /dev/null 2>&1; then echo "squashfs output format specified but no mksquashfs executable found." exit 1 fi ;; docker) if ! type docker > /dev/null 2>&1; then echo "docker output format specified but no docker executable found." exit 1 fi if [ -z "$DOCKER_TARGET" ]; then echo "Please set --docker-target." exit 1 fi ;; esac done # NOTE: fstrim is on most all recent systems. It is provided by the util-linux # package. if ! type fstrim > /dev/null 2>&1; then echo "fstrim utility is not found. This is provided by util-linux package" echo "Please check your PATH variable is set correctly" exit 1 fi # xattr support cannot be relied upon with tmpfs builds # some kernels supoprt it, some don't if [[ -n "${GENTOO_PROFILE}" ]]; then if [[ "${GENTOO_PROFILE}" =~ "hardened" ]]; then echo 'disabling tmpfs for gentoo hardened build' export DIB_NO_TMPFS=1 fi fi mk_build_dir # Create the YAML file with the final and raw configuration for # the block device layer. mkdir -p ${TMP_BUILD_DIR}/block-device BLOCK_DEVICE_CONFIG_YAML=${TMP_BUILD_DIR}/block-device/config.yaml block_device_create_config_file "${BLOCK_DEVICE_CONFIG_YAML}" # Write out the parameter file DIB_BLOCK_DEVICE_PARAMS_YAML=${TMP_BUILD_DIR}/block-device/params.yaml export DIB_BLOCK_DEVICE_PARAMS_YAML cat >${DIB_BLOCK_DEVICE_PARAMS_YAML} < $TMP_HOOKS_PATH/environment.d/11-dib-install-type.bash run_d extra-data # Run pre-install scripts. These do things that prepare the chroot for package installs run_d_in_target pre-install # Call install scripts to pull in the software users want. run_d_in_target install do_extra_package_install run_d_in_target post-install run_d post-root # ensure we do not have a lost+found directory in the root folder # that could cause copy to fail (it will be created again later # when creating the file system, if it needs such directory) if [ -e "$TMP_BUILD_DIR/mnt/lost+found" ]; then sudo rm -rf "$TMP_BUILD_DIR/mnt/lost+found" fi # Free up /mnt unmount_image mv $TMP_BUILD_DIR/mnt $TMP_BUILD_DIR/built # save xtrace state, as we always want to turn it off to avoid # spamming the logs with du output below. xtrace=$(set +o | grep xtrace) # temp file for holding du output du_output=${TMP_BUILD_DIR}/du_output.tmp if [ -n "$DIB_IMAGE_SIZE" ]; then du_size=$(echo "$DIB_IMAGE_SIZE" | awk '{printf("%d\n",$1 * 1024 *1024)}') else set +o xtrace echo "Calculating image size (this may take a minute)..." sudo du -a -c -x ${TMP_BUILD_DIR}/built > ${du_output} # the last line is the total size from "-c". if [ -n "$DIB_IMAGE_EXTRA_SIZE" ]; then # add DIB_IMAGE_EXTRA_SIZE megabytes to create a bigger image as requested du_extra_size=$(echo "$DIB_IMAGE_EXTRA_SIZE" | awk '{printf("%d\n",$1 * 1024)}') du_size_tmp=$(tail -n1 ${du_output} | cut -f1) du_size=$(echo "$du_size_tmp $du_extra_size" | awk '{print int($1 + $2)}') else # scale this by 0.6 to create a slightly bigger image du_size=$(tail -n1 ${du_output} | cut -f1 | awk '{print int($1 / 0.6)}') fi $xtrace fi if [[ "${DIB_SHOW_IMAGE_USAGE:-0}" != 0 ]]; then set +o xtrace if [ ! -f "$du_output" ]; then sudo du -a -c -x ${TMP_BUILD_DIR}/built > ${du_output} fi du_output_show="sort -nr ${du_output} | numfmt --to=iec-i --padding=7 --suffix=B --field=1 --from-unit=1024" # by default show the 10MiB and greater files & directories -- a # dir with lots of little files will still show up, but this helps # signal:noise ratio if [[ ${DIB_SHOW_IMAGE_USAGE_FULL:-0} == 0 ]]; then # numfmt will start giving a decimal place when < 10MiB du_output_show+="| egrep 'MiB|GiB|TiB|PiB' | grep -v '\..MiB'" echo "=================================" echo "Image size report (files > 10MiB)" echo "=================================" else echo "=================" echo "Image size report" echo "=================" fi eval ${du_output_show} echo echo "===== end image size report =====" echo $xtrace fi rm -f ${du_output} if [ -n "$DIB_JOURNAL_SIZE" ]; then journal_size="$DIB_JOURNAL_SIZE" else journal_size=64 fi if [ "$DIB_ROOT_FSTYPE" = "ext4" ] ; then # Very conservative to handle images being resized a lot # We set journal size to 64M so our journal is large enough when we # perform an FS resize. MKFS_OPTS="-i 4096 -J size=$journal_size $MKFS_OPTS" # NOTE(ianw) 2019-12-11 : this is a terrible hack ... if building on # >=Bionic hosts, mkfs sets "metadata_csum" for ext4 filesystems, # which makes broken Trusty images as that era fsck doesn't # understand this flag. The image will stop in early boot # complaining: # # Serious errors were found while checking the disk drive for /. # # We do not really have any suitable hook points where one of the # ubuntu elements or block-device-* could set this override flag for # just Trusty. We probably should, but desire to implement more # code to support the out-of-date trusty at this point is # non-existant. So hack in disabling this here. if [[ ${DIB_RELEASE} == "trusty" ]]; then MKFS_OPTS="-O ^metadata_csum $MKFS_OPTS" fi # Grow the image size to account for the journal, only if the user # has not asked for a specific size. if [ -z "$DIB_IMAGE_SIZE" ]; then du_size=$(( $du_size + ($journal_size * 1024) )) fi fi # EFI system partitions default to be quite large at 512mb for maximum # compatability (see notes in # 7fd52ba84180b4e749ccf4c9db8c49eafff46ea8) . We need to increase the # total size to account for this, or we run out of space creating the # final image. See if we have included the block-device-efi element, # which implies we have a large EFI partition, and then pad the final # image size. if [[ ${IMAGE_ELEMENT} =~ "block-device-efi" ]]; then echo "Expanding disk for EFI partition" du_size=$(( $du_size + (525 * 1024) )) fi # Rounding down size so that is is a multiple of 64, works around a bug in # qemu-img that may occur when compressing raw images that aren't a multiple # of 64k. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1180021 export DIB_IMAGE_SIZE=$(echo "$du_size" | awk ' { if ($1 % 64 != 0) print $1 + 64 - ( $1 % 64); else print $1; } ') if [ -n "$MAX_ONLINE_RESIZE" ]; then MKFS_OPTS="-E resize=$MAX_ONLINE_RESIZE $MKFS_OPTS" fi export TMP_IMAGE_DIR # Try the 'old fashioned' way calling the block device # phase. If this gives no result, use the configuration based approach: eval_run_d block-device "IMAGE_BLOCK_DEVICE=" if [ -z ${IMAGE_BLOCK_DEVICE} ] ; then # For compatibily reasons in addition to the YAML configuration # there is the need to handle the old environment variables. echo "image-size: ${DIB_IMAGE_SIZE}KiB" >> ${DIB_BLOCK_DEVICE_PARAMS_YAML} if [ -n "${MKFS_OPTS}" ] ; then echo "root-fs-opts: '${MKFS_OPTS}'" >> ${DIB_BLOCK_DEVICE_PARAMS_YAML} fi # After changeing the parameters, there is the need to # re-run ${DIB_BLOCK_DEVICE} init because some value might # change based on the new set parameters. ${DIB_BLOCK_DEVICE} init # values to ${DIB_BLOCK_DEVICE}: using the YAML config and ${DIB_BLOCK_DEVICE} create # This is the device (/dev/loopX). It's where to install the # bootloader. IMAGE_BLOCK_DEVICE=$(${DIB_BLOCK_DEVICE} getval image-block-device) export IMAGE_BLOCK_DEVICE # Similar to above, but all mounted devices. This is handy for # some bootloaders that have multi-partition layouts and want to # copy things to different places other than just # IMAGE_BLOCK_DEVICE. "eval" this into an array as needed IMAGE_BLOCK_DEVICES=$(${DIB_BLOCK_DEVICE} getval image-block-devices) export IMAGE_BLOCK_DEVICES # Write the fstab ${DIB_BLOCK_DEVICE} writefstab fi # XXX: needed? LOOPDEV=${IMAGE_BLOCK_DEVICE} # At this point, ${DIB_BLOCK_DEVICE} has created the raw image file # (IMAGE_BLOCK_DEVICE) and mounted all the partitions under # $TMP_BUILD_DIR/mnt for us. We can now copy into the final image. # 'mv' is not usable here - especially when a top level directory # has the same name as a mount point of a partition. If so, 'mv' # will complain: # mv: inter-device move failed: '...' to '...'; \ # unable to remove target: Device or resource busy # therefore a 'cp' and 'rm' approach is used. sudo cp -ra ${TMP_BUILD_DIR}/built/* $TMP_BUILD_DIR/mnt sudo rm -fr ${TMP_BUILD_DIR}/built/* mount_proc_dev_sys run_d pre-finalise run_d_in_target finalise finalise_base for X in ${!IMAGE_TYPES[@]} ; do if [[ " tar aci " =~ "${IMAGE_TYPES[$X]}" ]]; then if [ "${IMAGE_TYPES[$X]}" = "aci" ]; then sudo tar -C ${TMP_BUILD_DIR}/mnt -cf $IMAGE_NAME.aci --exclude ./sys \ --exclude ./proc --xattrs --xattrs-include=\* \ --transform 's,^.,rootfs,S' . if [ -n "$ACI_MANIFEST" ]; then cp $ACI_MANIFEST ${TMP_BUILD_DIR}/manifest sudo tar -C ${TMP_BUILD_DIR} --append -f $IMAGE_NAME.aci manifest else echo "No ACI_MANIFEST specified. An ACI_MANIFEST must be specified for" echo " this image to be usable." fi else sudo tar -C ${TMP_BUILD_DIR}/mnt -cf $IMAGE_NAME.tar --exclude ./sys \ --exclude ./proc --xattrs --xattrs-include=\* . fi sudo chown $USER: $IMAGE_NAME.${IMAGE_TYPES[$X]} unset IMAGE_TYPES[$X] elif [ "${IMAGE_TYPES[$x]}" == "squashfs" ]; then sudo mksquashfs ${TMP_BUILD_DIR}/mnt $IMAGE_NAME.squash -comp xz \ -noappend -root-becomes ${TMP_BUILD_DIR}/mnt \ -wildcards -e "proc/*" -e "sys/*" -no-recovery elif [ "${IMAGE_TYPES[$X]}" == "docker" ]; then sudo tar -C ${TMP_BUILD_DIR}/mnt -cf - --exclude ./sys \ --exclude ./proc --xattrs --xattrs-include=\* . \ | sudo docker import - $DOCKER_TARGET unset IMAGE_TYPES[$X] fi done # Unmount and cleanup the /mnt and /build subdirectories, to save # space before converting the image to some other format. # XXX ? needed? export EXTRA_UNMOUNT="" unmount_image TMP_IMAGE_PATH=$(${DIB_BLOCK_DEVICE} getval image-path) export TMP_IMAGE_PATH # remove all mounts ${DIB_BLOCK_DEVICE} umount ${DIB_BLOCK_DEVICE} cleanup cleanup_build_dir if [[ (! $IMAGE_ELEMENT =~ no-final-image) && "$IS_RAMDISK" == "0" ]]; then has_raw_type= for IMAGE_TYPE in ${IMAGE_TYPES[@]} ; do # We have to do raw last because it is destructive if [ "$IMAGE_TYPE" = "raw" ]; then has_raw_type=1 elif [ "$IMAGE_TYPE" != "squashfs" ]; then compress_and_save_image $IMAGE_NAME.$IMAGE_TYPE fi done if [ -n "$has_raw_type" ]; then IMAGE_TYPE="raw" compress_and_save_image $IMAGE_NAME.$IMAGE_TYPE fi fi # Remove the leftovers, i.e. the temporary image directory. cleanup_image_dir # Restore fd 1&2 from the outfilter.py redirect back to the original # saved fd. Note small hack that we can't really wait properly for # outfilter.py so put in a sleep (might be possible to use coproc for # this...?) # # TODO(ianw): probably better to cleanup the exit handler a bit for # this? We really want some helper functions that append to the exit # handler so we can register multiple things. set +o xtrace echo "Build completed successfully" exec 1>&3 2>&3 sleep 1 # All done! trap EXIT ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/lib/element-info.py0000664000175000017500000000016615201026231023225 0ustar00zuulzuulimport sys from diskimage_builder.element_dependencies import main if __name__ == "__main__": sys.exit(main()) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/lib/img-defaults0000664000175000017500000000153615201026231022577 0ustar00zuulzuul# Copyright 2012 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. source $_LIB/common-defaults # options for create-baremetal-image.sh export FS_TYPE=${FS_TYPE:-ext4} # Used to set the file extension only at this stage. export IMAGE_TYPE=${IMAGE_TYPE:-qcow2} export IMAGE_NAME=${IMAGE_NAME:-image} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/lib/img-functions0000664000175000017500000002241315201026231022775 0ustar00zuulzuul# Copyright 2012 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. function unmount_image () { # Calling sync before helps ensure the mount isn't busy when you unmount it. # Previously observing having disk corruption issues; one possibility is # qemu-nbd not flushing dirty pages on disconnect? # https://bugs.launchpad.net/diskimage-builder/+bug/1214388 sync # unmount from the chroot # Don't use TMP_MOUNT_PATH here, it might not have been set. unmount_dir "$TMP_BUILD_DIR/mnt" if [ -n "$EXTRA_DETACH" ]; then $EXTRA_DETACH fi if [ -n "$EXTRA_UNMOUNT" ]; then $EXTRA_UNMOUNT fi } function trap_cleanup() { exitval=$? cleanup exit $exitval } function cleanup () { unmount_image ${DIB_PYTHON_EXEC} ${_LIB}/dib-block-device.py umount cleanup_build_dir cleanup_image_dir } # Helper function to run a command inside the chroot function run_in_target () { cmd="$@" # -E to preserve http_proxy ORIG_HOME=$HOME export HOME=/root # Force an empty TMPDIR inside the chroot. There is no need to use an user # defined tmp dir which may not exist in the chroot. # Bug: #1330290 # Force the inclusion of a typical set of dirs in PATH, this is needed for guest # distros that have path elements not in the host PATH. sudo -E chroot $TMP_MOUNT_PATH env -u TMPDIR -u VIRTUAL_ENV PATH="\$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" sh -c "$cmd" export HOME=$ORIG_HOME } # Helper function to run a directory of scripts inside the chroot function run_d_in_target () { check_element # If we can find a directory of hooks to run in the target filesystem, bind # mount it into the target and then execute run-parts in a chroot if [ -d ${TMP_HOOKS_PATH}/$1.d ] ; then sudo mkdir $TMP_MOUNT_PATH/tmp/in_target.d # Copy dib-run-parts to be visible inside chroot. Note we leave # this here because in the future we might like to use a # different in-chroot runner that doesn't rely on the chroot # having bash/glibc/etc (containers, micro-images, etc). sudo cp ${DIB_RUN_PARTS} ${TMP_HOOKS_PATH} # Note that bind mounting R/O is a two step process, and it # wasn't until later util-linux that "bind,ro" worked as a # single step, see # https://git.kernel.org/cgit/utils/util-linux/util-linux.git/commit/?id=9ac77b8a78452eab0612523d27fee52159f5016a sudo mount --bind ${TMP_HOOKS_PATH} $TMP_MOUNT_PATH/tmp/in_target.d sudo mount -o remount,ro,bind ${TMP_HOOKS_PATH} $TMP_MOUNT_PATH/tmp/in_target.d check_break before-$1 run_in_target bash [ -z "$break_outside_target" ] && in_target_arg="run_in_target" || in_target_arg= trap "check_break after-error $in_target_arg ${break_cmd:-bash}" ERR run_in_target /tmp/in_target.d/dib-run-parts /tmp/in_target.d/$1.d trap - ERR check_break after-$1 run_in_target bash sudo umount -f $TMP_MOUNT_PATH/tmp/in_target.d if ! timeout 10 sh -c " while ! sudo rmdir $TMP_MOUNT_PATH/tmp/in_target.d; do sleep 1; done"; then echo "ERROR: unable to cleanly remove $TMP_MOUNT_PATH/tmp/in_target.d" exit 1 fi fi } function finalise_base () { TARGET_ROOT=$TMP_MOUNT_PATH run_d cleanup # Finalise resolv.conf # # NOTE(ianw): the /etc/resolv.conf.ORIG file is an # external interface; elements might put a resolv.conf they # want in the final image into this file. # # In create_base() we replaced/created the initial resolv.conf # inside the image with a copy of the "outside" version so that # resolving during the build will work. # # If that file has been replace with a symlink (resolvconf package # can do this), or marked immutable, then don't restore the # original version, just leave it alone. if [ -L $TMP_MOUNT_PATH/etc/resolv.conf ] || \ lsattr $TMP_MOUNT_PATH/etc/resolv.conf | grep '^....i' >/dev/null ; then # We're keeping the contents of resolv.conf set in the elements, # so remove the old saved file sudo rm -f $TMP_MOUNT_PATH/etc/resolv.conf.ORIG else # Remove the resolv.conf we created and put the original (or # perhaps modified) version back. sudo rm -f $TMP_MOUNT_PATH/etc/resolv.conf # Note that we use -L and -f to test here as test (and bash [[) # return false with -e if the link target does not exist. if [ -L $TMP_MOUNT_PATH/etc/resolv.conf.ORIG ] || [ -f $TMP_MOUNT_PATH/etc/resolv.conf.ORIG ] ; then sudo mv $TMP_MOUNT_PATH/etc/resolv.conf.ORIG $TMP_MOUNT_PATH/etc/resolv.conf fi fi # Cleanup /tmp in the guest, so there is less cruft left there unmount_dir $TMP_MOUNT_PATH/tmp find $TMP_MOUNT_PATH/tmp -maxdepth 1 -mindepth 1 | xargs sudo rm -rf --one-file-system # Truncate /var/log files in preparation for first boot sudo find ${TMP_MOUNT_PATH}/var/log -type f -exec cp /dev/null '{}' \; # also /root logs sudo find ${TMP_MOUNT_PATH}/root -name \*.log -type f -delete } function compress_and_save_image () { # Recreate our image to throw away unnecessary data test $IMAGE_TYPE != qcow2 && COMPRESS_IMAGE="" if [ -n "$QEMU_IMG_OPTIONS" ]; then EXTRA_OPTIONS="-o $QEMU_IMG_OPTIONS" else EXTRA_OPTIONS="" fi if [ "$IMAGE_TYPE" = "raw" ]; then mv $TMP_IMAGE_PATH $1-new elif [ "$IMAGE_TYPE" == "tgz" ]; then $DIB_GZIP_BIN -9 < $IMAGE_NAME.tar > $1-new rm $IMAGE_NAME.tar elif [ "$IMAGE_TYPE" == "vhd" ]; then cp $TMP_IMAGE_PATH $1-intermediate vhd-util convert -s 0 -t 1 -i $1-intermediate -o $1-intermediate vhd-util convert -s 1 -t 2 -i $1-intermediate -o $1-new # The previous command creates a .bak file rm $1-intermediate.bak OUT_IMAGE_PATH=$1-new else echo "Converting image using qemu-img convert" qemu-img convert ${COMPRESS_IMAGE:+-c} -f raw -O $IMAGE_TYPE $EXTRA_OPTIONS $TMP_IMAGE_PATH $1-new fi OUT_IMAGE_PATH=$1-new finish_image $1 } function do_extra_package_install () { # Install any packages that were requested with the -p command line option if [ "$INSTALL_PACKAGES" != "" ]; then run_in_target install-packages ${INSTALL_PACKAGES[@]} fi } function copy_elements_lib () { sudo mkdir -p $TMP_MOUNT_PATH/lib/diskimage-builder sudo cp -t $TMP_MOUNT_PATH/lib/diskimage-builder $_LIB/elements-functions } # Dig up the initrd and kernel. function select_boot_kernel_initrd () { TARGET_ROOT=$1 BOOTDIR=$TARGET_ROOT/boot if [ -n "${DIB_BAREMETAL_KERNEL_PATTERN:-}" -a -n "${DIB_BAREMETAL_INITRD_PATTERN:-}" ]; then KERNEL=$(basename $(eval ls -1rv "$BOOTDIR/${DIB_BAREMETAL_KERNEL_PATTERN}" | head -1)) RAMDISK=$(basename $(eval ls -1rv "$BOOTDIR/${DIB_BAREMETAL_INITRD_PATTERN}" | head -1)) elif [ -f $TARGET_ROOT/etc/redhat-release ]; then # Prioritize PAE if present KERNEL=$(ls -1rv $BOOTDIR/vmlinuz* | grep PAE | grep -v debug | head -1 || echo "") KERNEL=${KERNEL:-$(ls -1rv $BOOTDIR/vmlinuz* | grep -v debug | head -1 || echo "")} if [ ! $KERNEL ]; then echo "No suitable kernel found." exit 1 fi KERNEL=$(basename $KERNEL) KERNEL_VERSION=${KERNEL#vmlinuz-} RAMDISK=$(basename $(ls $BOOTDIR/initramfs-$KERNEL_VERSION.img) || echo "") if [ ! $RAMDISK ]; then echo "Can't find an initramfs for the $KERNEL_VERSION version of the kernel." exit 1 fi elif [ -f $TARGET_ROOT/etc/debian_version ]; then KERNEL=$(basename $(ls -1rv $BOOTDIR/vmlinu*generic 2>/dev/null || ls -1rv $BOOTDIR/vmlinu* | head -1)) RAMDISK=$(basename $(ls -1rv $BOOTDIR/initrd*generic 2>/dev/null || ls -1rv $BOOTDIR/initrd* | head -1)) if [ -f $TARGET_ROOT/dib-signed-kernel-version ] ; then . $TARGET_ROOT/dib-signed-kernel-version fi if [ -n "${DIB_SIGNED_KERNEL_VERSION:-}" ]; then echo "Using signed kernel $DIB_SIGNED_KERNEL_VERSION" KERNEL=$(basename $(ls -1rv $BOOTDIR/vmlinu*generic.efi.signed 2>/dev/null)) fi elif [ -f $TARGET_ROOT/etc/SuSE-release ]; then KERNEL=$(basename $(readlink -e $BOOTDIR/vmlinuz)) RAMDISK=$(basename $(readlink -e $BOOTDIR/initrd)) elif [[ -f "${TARGET_ROOT}"/etc/gentoo-release ]]; then KERNEL="$(basename $(ls -1rv $BOOTDIR/vmlinuz-* | head -n 1))" RAMDISK="$(basename $(ls -1rv $BOOTDIR/initramfs-* | head -n 1))" elif [[ $DISTRO_NAME = opensuse ]]; then KERNEL=$(basename $(readlink -e $BOOTDIR/vmlinuz)) RAMDISK=$(basename $(readlink -e $BOOTDIR/initrd)) else echo "ERROR: Unable to detect operating system" exit 1 fi } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/lib/outfilter.py0000775000175000017500000000552715201026231022671 0ustar00zuulzuul#!/usr/bin/env python3 # # Copyright 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # This is an output filter to filter and timestamp the logs from Grenade and # DevStack. Largely our awk filters got beyond the complexity level which were # sustainable, so this provides us much more control in a single place. # # The overhead of running python should be less than execing `date` a million # times during a run. import argparse import datetime import re import sys IGNORE_LINES = re.compile(r'(set \+o|xtrace)') def get_options(): parser = argparse.ArgumentParser( description='Filter output by DevStack and friends') parser.add_argument('-o', '--outfile', help='Output file for content', default=None) parser.add_argument('-v', '--verbose', action='store_true', help='Write to stdout', default=False) parser.add_argument('-b', '--no-timestamp', action='store_true', help='Do not prefix stdout with timestamp (bare)', default=False) return parser.parse_args() def skip_line(line): """Should we skip this line.""" return IGNORE_LINES.search(line) is not None def main(): opts = get_options() outfile = None if opts.outfile: outfile = open(opts.outfile, 'ab', 0) # Otherwise fileinput reprocess args as files sys.argv = [] for line in iter(sys.stdin.readline, ''): # put skip lines here if skip_line(line): continue now = datetime.datetime.now(datetime.timezone.utc) ts_line = ("%s | %s" % ( now.strftime("%Y-%m-%d %H:%M:%S.%f")[:-3], line)) if opts.verbose: sys.stdout.write(line if opts.no_timestamp else ts_line) sys.stdout.flush() if outfile: # We've opened outfile as a binary file to get the # non-buffered behaviour. on python3, sys.stdin was # opened with the system encoding and made the line into # utf-8, so write the logfile out in utf-8 bytes. outfile.write(ts_line.encode('utf-8', errors='surrogateescape')) outfile.flush() if __name__ == '__main__': try: sys.exit(main()) except KeyboardInterrupt: sys.exit(1) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/lib/ramdisk-defaults0000664000175000017500000000165215201026231023454 0ustar00zuulzuul# Copyright 2012 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 NTT DOCOMO, INC. # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # options for ramdisk-image-create export DIB_NO_TMPFS=${DIB_NO_TMPFS:-1} export DIB_MIN_TMPFS=${DIB_MIN_TMPFS:-1} export RAMDISK_ELEMENT=${RAMDISK_ELEMENT:-ramdisk} source $_LIB/common-defaults MODULE_ROOT=${DIB_MODULE_ROOT:-""} LIB_UDEV_ROOT=${DIB_LIB_UDEV_ROOT:-""} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/lib/ramdisk-functions0000664000175000017500000001722115201026231023654 0ustar00zuulzuul# Copyright 2012 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 NTT DOCOMO, INC. # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. function fullpath() { local f=$1 if [ "${f#/}" = "$f" ]; then echo `pwd`/"$f" else echo "$f" fi } function create_ramdisk_base () { echo "Creating base system" mkdir -p "${TMP_MOUNT_PATH}/"{bin,lib/modules,etc/udev} ln -s bin "$TMP_MOUNT_PATH/sbin" # cjk adding for discovery support mkdir -p "${TMP_MOUNT_PATH}/"{lib/udev/rules.d,var/{lib/dhcp,run}} case "$DISTRO_NAME" in fedora|rhel|opensuse) mkdir -p "$TMP_MOUNT_PATH/usr" ln -s ../lib "$TMP_MOUNT_PATH/usr/lib" if [[ "`uname -m`" =~ x86_64|ppc64 ]]; then ln -s lib "$TMP_MOUNT_PATH/lib64" fi ;; esac if [ -e $LIB_UDEV/rules.d/50-firmware.rules ]; then cp -a "$LIB_UDEV/rules.d/50-firmware.rules" "$TMP_MOUNT_PATH/lib/udev/rules.d" fi cp -a "$LIB_UDEV/rules.d/80-drivers.rules" "$TMP_MOUNT_PATH/lib/udev/rules.d" if [ -a $LIB_UDEV/firmware ]; then cp -a "$LIB_UDEV/firmware" "$TMP_MOUNT_PATH/lib/udev" fi # cjk adding dhclient for hwdiscovery support # dhclient scripts on some distros appear in different places, copy any we find for FILE in /sbin/dhclient-script /usr/sbin/dhclient-script /etc/sysconfig/network-scripts/* /etc/rc.d/init.d/functions /etc/init.d/functions ; do if [ -f $FILE ] ; then mkdir -p $(dirname $TMP_MOUNT_PATH/$FILE) cp $FILE $TMP_MOUNT_PATH/$FILE fi done # /var/lib/dhclient is a directory on Fedora if [ -d "/var/lib/dhclient" ] ; then mkdir -p "$TMP_MOUNT_PATH/var/lib/dhclient" fi mkdir -p "$TMP_MOUNT_PATH/etc/modprobe.d" # The directory may or may not exist in the image. If the directory exists in # the image, all the files under it should get copied to the ramdisk. if [ -d "/etc/modprobe.d/" ] ; then find /etc/modprobe.d -name '*.conf' -type f -exec cp -a {} "$TMP_MOUNT_PATH/etc/modprobe.d" \; fi echo "blacklist evbug" > "$TMP_MOUNT_PATH/etc/modprobe.d/blacklist-dib-ramdisk.conf" # cjk adding for hwdiscovery support touch "$TMP_MOUNT_PATH/etc/fstab" mkdir -p "$TMP_MOUNT_PATH/etc/udev" cat >"$TMP_MOUNT_PATH/etc/udev/udev.conf" < /lib/x86_64-linux-gnu/libc.so.6 (0x00007f095e784000) # 2. only path # /lib64/ld-linux-x86-64.so.2 (0x00007f095ef79000) # 3. path to path # /lib64/ld-linux-x86-64.so.2 => /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 (0x00007facff857000) # 4. name to empty (vdso) # linux-vdso.so.1 => (0x00007fff0c5ff000) # or, in some setups: # linux-vdso.so.1 (0x00007fff0c5ff000) for i in `echo "$ldd_out" | sed -e 's/^\t*//'`; do local ref=$( echo "$i" | awk -F '[ ]' '{print $1}') local real=$( echo "$i" | awk -F '[ ]' '$2 == "=>" {print $3} $2 != "=>" {print $1}') if [ -z "$real" ] || [[ "$real" != /* ]]; then continue fi if [ "$ref" = "${ref#/}" ]; then ref=/lib/$ref fi dest=/lib/`basename "$real"` cp -Ln "$real" "$TMP_MOUNT_PATH/$dest" # Create a symbolic link if the shared library is referred # by the different name if [ "$ref" != "$dest" ]; then local link_path=$TMP_MOUNT_PATH/$ref if ! [ -e "$link_path" -o -L "$link_path" ]; then mkdir -p $(dirname "$link_path") ln -s "$dest" "$link_path" fi fi done } function populate_lib () { echo "Populating /lib" # find udevd UDEVD= for f in /sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd \ /usr/lib/systemd/systemd-udevd \ /usr/lib/udev/udevd; do if [ -x "$f" ]; then UDEVD="$f" break fi done UDEV_FIRMWARE= if [ -a $LIB_UDEV/firmware ]; then UDEV_FIRMWARE="$LIB_UDEV/firmware" fi for i in "$BUSYBOX" bash lsmod modprobe udevadm \ wget reboot shutdown $UDEVD $UDEV_FIRMWARE \ $(cat /etc/dib_binary_deps) ; do # Don't take the ip command from busybox, its missing some features if busybox_list | grep -v "^ip$" | grep "^$i\$" >/dev/null; then continue fi path=`type -p $i 2>/dev/null` || path=$i if ! [ -x "$path" ]; then echo "$i is not found in PATH" 2>&1 exit 1 fi cp -L "$path" "$TMP_MOUNT_PATH/bin/" copy_required_libs "$path" done if [ -f /dib-signed-kernel-version ] ; then . /dib-signed-kernel-version fi if [ -n "${DIB_SIGNED_KERNEL_VERSION:-}" ]; then # Secure kernel module directory does not have efi.signed suffix to # kernel version. if echo $KERNEL_VERSION | grep -q 'efi.signed'; then KERNEL_VERSION=`echo "$KERNEL_VERSION" |sed "s/\.efi\.signed//g"` fi fi cp -a "$MODULE_DIR" "$TMP_MOUNT_PATH/lib/modules/$KERNEL_VERSION" echo "Removing kernel framebuffer drivers to enforce text mode consoles..." find $TMP_MOUNT_PATH/lib/modules/$KERNEL_VERSION/kernel/drivers/video -name '*fb.ko' -exec rm -v {} + if [ -d $FIRMWARE_DIR ]; then cp -a "$FIRMWARE_DIR" "$TMP_MOUNT_PATH/lib/firmware" fi } function busybox_list () { # busybox supports --list option since version 1.18 "$BUSYBOX" --list 2> /dev/null && return # for busybox under 1.18 we parse command list from --help output scrlet='{ if (go) { print } } /Currently defined functions:/ { go=1 }' "$BUSYBOX" --help | awk "$scrlet" | tr ',' '\n' | xargs -n1 echo } function populate_busybox () { echo "Creating symlinks for busybox binaries" for i in $( busybox_list ); do if [ -f "$TMP_MOUNT_PATH/bin/$i" ]; then echo "skip $i" continue fi ln -s busybox "$TMP_MOUNT_PATH/bin/$i" done } function populate_init () { echo "Installing init" cp "$INIT" "$TMP_MOUNT_PATH/init" chmod +x $TMP_MOUNT_PATH/init for F in "$FUNCTIONS_D"/* ; do cp "$F" "$TMP_MOUNT_PATH" done # Append /init with any element fragments that are present TARGET_DIR="/tmp/in_target.d/" for _ELEMENT in $(ls $TARGET_DIR/init.d/) ; do _FILE="${TARGET_DIR}/init.d/${_ELEMENT}" if [ -a $_FILE ]; then cat >>$TMP_MOUNT_PATH/init <>$TMP_MOUNT_PATH/init fi done # Add our final steps to /init cat <${INIT}-end >>$TMP_MOUNT_PATH/init } function finalise_image () { echo "Finalising image" (cd "$TMP_MOUNT_PATH"; find . | cpio -o -H newc | gzip > "$TMP_IMAGE_PATH" ) } function populate_udev () { echo "Installing udev rules" TARGET_DIR="/tmp/in_target.d/" for _ELEMENT in $(ls $TARGET_DIR/udev.d/) ; do _FILE="${TARGET_DIR}/udev.d/${_ELEMENT}" if [ -a $_FILE ]; then cp ${_FILE} $TMP_MOUNT_PATH/lib/udev/rules.d/ fi done } function find_kernel_version () { _TMP=$(ls /boot/vmlinu* | sort | tail -1) if [ "$_TMP" == "" ]; then echo "Unable to find a suitable kernel" >>/dev/stderr exit 1 fi echo ${_TMP##/boot/vmlinu[zx]-} } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/lib/ramdisk-image-create0000775000175000017500000006014415201026231024174 0ustar00zuulzuul#!/bin/bash # # Copyright 2012 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. set -eE # Set/override locale. This ensures consistency in sorting etc. We # need to choose a lowest-common denominator locale, as this is # applied when running in the building chroot too (maybe a bug and we # should prune this?). Note: LC_ALL to really # override this; it overrides LANG and all other LC_ vars export LC_ALL=C # Store our initial environment and command line args for later export DIB_ARGS="$@" export DIB_ENV=$(declare -p $(compgen -v | grep '^DIB_')) SCRIPTNAME=$(basename $0) if [ -z "$_LIB" ]; then echo "_LIB not set!" exit 1 fi _BASE_ELEMENT_DIR=$(${DIB_PYTHON_EXEC:-python} -c ' import diskimage_builder.paths diskimage_builder.paths.show_path("elements")') source $_LIB/die DIB_BLOCK_DEVICE="${DIB_PYTHON_EXEC} ${_LIB}/dib-block-device.py" IS_RAMDISK=0 if [ "$SCRIPTNAME" == "ramdisk-image-create" ]; then IS_RAMDISK=1 fi function show_options () { echo "Usage: ${SCRIPTNAME} [OPTION]... [ELEMENT]..." echo echo "Options:" echo " -a amd64|armhf|arm64 -- set the architecture of the image(default amd64)" echo " -o imagename -- set the imagename of the output image file(default image)" echo " -t qcow2,tar,tgz,squashfs,vhd,docker,aci,raw -- set the image types of the output image files (default qcow2)" echo " File types should be comma separated. VHD outputting requires the vhd-util" echo " executable be in your PATH. ACI outputting requires the ACI_MANIFEST " echo " environment variable be a path to a manifest file." echo " -x -- turn on tracing (use -x -x for very detailed tracing)." echo " -u -- uncompressed; do not compress the image - larger but faster" echo " -c -- clear environment before starting work" echo " --logfile -- save run output to given logfile (implies DIB_QUIET=1)" echo " --checksum -- generate MD5 and SHA256 checksum files for the created image" echo " --image-size size -- image size in GB for the created image" echo " --image-extra-size size -- extra image size in GB for the created image" echo " --image-cache directory -- location for cached images(default ~/.cache/image-create)" echo " --max-online-resize size -- max number of filesystem blocks to support when resizing." echo " Useful if you want a really large root partition when the image is deployed." echo " Using a very large value may run into a known bug in resize2fs." echo " Setting the value to 274877906944 will get you a 1PB root file system." echo " Making this value unnecessarily large will consume extra disk space " echo " on the root partition with extra file system inodes." echo " --min-tmpfs size -- minimum size in GB needed in tmpfs to build the image" echo " --mkfs-journal-size -- filesystem journal size in MB to pass to mkfs." echo " --mkfs-options -- option flags to be passed directly to mkfs." echo " Options should be passed as a single string value." echo " --no-tmpfs -- do not use tmpfs to speed image build" echo " --offline -- do not update cached resources" echo " --qemu-img-options -- option flags to be passed directly to qemu-img." echo " Options need to be comma separated, and follow the key=value pattern." echo " --root-label label -- label for the root filesystem. Defaults to 'cloudimg-rootfs'." echo " --ramdisk-element -- specify the main element to be used for building ramdisks." echo " Defaults to 'ramdisk'. Should be set to 'dracut-ramdisk' for platforms such" echo " as RHEL and CentOS that do not package busybox." echo " --install-type -- specify the default installation type. Defaults to 'source'. Set to 'package' to use package based installations by default." echo " --docker-target -- specify the repo and tag to use if the output type is docker. Defaults to the value of output imagename" if [ "$IS_RAMDISK" == "0" ]; then echo " -n skip the default inclusion of the 'base' element" echo " -p package[,p2...] [-p p3] -- extra packages to install in the image. Runs once, after 'install.d' phase. Can be specified multiple times" fi echo " -h|--help -- display this help and exit" echo " --version -- display version and exit" echo echo "Environment Variables:" echo " (this is not a complete list)" echo echo " * ELEMENTS_PATH: specify external locations for the elements. As for \$PATH" echo " * DIB_NO_TIMESTAMP: no timestamp prefix on output. Useful if capturing output" echo " * DIB_QUIET: 1=do not output log output to stdout; 0=always ouptut to stdout. See --logfile" echo echo "NOTE: At least one distribution root element must be specified." echo echo "NOTE: If using the VHD output format you need to have a patched version of vhd-util installed for the image" echo " to be bootable. The patch is available here: https://github.com/emonty/vhd-util/blob/master/debian/patches/citrix" echo " and a PPA with the patched tool is available here: https://launchpad.net/~openstack-ci-core/+archive/ubuntu/vhd-util" echo echo "Examples:" if [ "$IS_RAMDISK" == "0" ]; then echo " ${SCRIPTNAME} -a amd64 -o ubuntu-amd64 vm ubuntu" echo " export ELEMENTS_PATH=~/source/tripleo-image-elements/elements" echo " ${SCRIPTNAME} -a amd64 -o fedora-amd64-heat-cfntools vm fedora heat-cfntools" else echo " ${SCRIPTNAME} -a amd64 -o fedora-deploy deploy fedora" echo " ${SCRIPTNAME} -a amd64 -o ubuntu-ramdisk ramdisk ubuntu" fi } function show_version() { ${DIB_PYTHON_EXEC:-python} -c "from diskimage_builder import version; print(version.version_info.version_string())" } DIB_DEBUG_TRACE=${DIB_DEBUG_TRACE:-0} INSTALL_PACKAGES="" IMAGE_TYPES=("qcow2") COMPRESS_IMAGE="true" DIB_GZIP_BIN=${DIB_GZIP_BIN:-"gzip"} ROOT_LABEL="${ROOT_LABEL:-}" DIB_DEFAULT_INSTALLTYPE=${DIB_DEFAULT_INSTALLTYPE:-"source"} MKFS_OPTS="" ACI_MANIFEST=${ACI_MANIFEST:-} DOCKER_TARGET="" LOGFILE="" TEMP=`getopt -o a:ho:t:xucnp: -l checksum,no-tmpfs,offline,help,version,min-tmpfs:,image-size:,image-cache:,max-online-resize:,mkfs-options:,qemu-img-options:,ramdisk-element:,root-label:,install-type:,docker-target:,logfile: -n $SCRIPTNAME -- "$@"` if [ $? -ne 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi # Note the quotes around `$TEMP': they are essential! eval set -- "$TEMP" while true ; do case "$1" in -a) export ARCH=$2; shift 2 ;; -o) export IMAGE_NAME=$2; shift 2 ;; -t) IFS="," read -a IMAGE_TYPES <<< "$2"; export IMAGE_TYPES ; shift 2 ;; -h|--help) show_options; exit 0;; --version) show_version; exit 0;; -x) shift; DIB_DEBUG_TRACE=$(( $DIB_DEBUG_TRACE + 1 ));; -u) shift; export COMPRESS_IMAGE="";; -c) shift ; export CLEAR_ENV=1;; -n) shift; export SKIP_BASE="1";; -p) IFS="," read -a _INSTALL_PACKAGES <<< "$2"; export INSTALL_PACKAGES=( ${INSTALL_PACKAGES[@]} ${_INSTALL_PACKAGES[@]} ) ; shift 2 ;; --checksum) shift; export DIB_CHECKSUM=1;; --image-size) export DIB_IMAGE_SIZE=$2; shift 2;; --image-extra-size) export DIB_IMAGE_EXTRA_SIZE=$2; shift 2;; --image-cache) export DIB_IMAGE_CACHE=$2; shift 2;; --max-online-resize) export MAX_ONLINE_RESIZE=$2; shift 2;; --mkfs-journal-size) export DIB_JOURNAL_SIZE=$2; shift 2;; --mkfs-options) MKFS_OPTS=$2; shift 2;; --min-tmpfs) export DIB_MIN_TMPFS=$2; shift 2;; --no-tmpfs) shift; export DIB_NO_TMPFS=1;; --offline) shift; export DIB_OFFLINE=1;; --qemu-img-options) QEMU_IMG_OPTIONS=$2; shift 2;; --root-label) ROOT_LABEL=$2; shift 2;; --ramdisk-element) RAMDISK_ELEMENT=$2; shift 2;; --install-type) DIB_DEFAULT_INSTALLTYPE=$2; shift 2;; --docker-target) export DOCKER_TARGET=$2; shift 2 ;; --logfile) export LOGFILE=$2; shift 2 ;; --) shift ; break ;; *) echo "Internal error!" ; exit 1 ;; esac done export DIB_DEBUG_TRACE # TODO: namespace this under ~/.cache/dib/ for consistency export DIB_IMAGE_CACHE=${DIB_IMAGE_CACHE:-~/.cache/image-create} mkdir -p $DIB_IMAGE_CACHE # We have a couple of critical sections (touching parts of the host # system or download images to common cache) that we use flock around. # Use this directory for lockfiles. export DIB_LOCKFILES=${DIB_LOCKFILES:-~/.cache/dib/lockfiles} mkdir -p $DIB_LOCKFILES if [ "$CLEAR_ENV" = "1" -a "$HOME" != "" ]; then echo "Re-execing to clear environment." echo "(note this will prevent much of the local_config element from working)" exec -c $0 "$@" fi # We send stdout & stderr through "outfilter" which does timestamping, # basic filtering and log file output. _TS_FLAG="" if [[ "${DIB_NO_TIMESTAMP:-0}" -eq 1 ]]; then _TS_FLAG="--no-timestamp" fi # A logfile with *no* DIB_QUIET specified implies we just want output # to the logfile. Explicitly setting DIB_QUIET=0 will overide this # and log both. if [[ -n "${LOGFILE}" && -z "${DIB_QUIET}" ]]; then DIB_QUIET=1 fi _QUIET_FLAG="-v" if [[ "${DIB_QUIET:-0}" -eq 1 ]]; then _QUIET_FLAG="" fi _LOGFILE_FLAG="" if [[ -n "${LOGFILE}" ]]; then echo "Output logs going to: ${LOGFILE}" _LOGFILE_FLAG="-o ${LOGFILE}" fi # Save the existing stdout to fd3 exec 3>&1 exec 1> >( ${DIB_PYTHON_EXEC:-python} $_LIB/outfilter.py ${_TS_FLAG} ${_QUIET_FLAG} ${_LOGFILE_FLAG} ) 2>&1 # Display the current file/function/line in the debug output function _ps4 { IFS=" " called=($(caller 0)) local f=$(readlink -f ${called[2]}) # As we're being run out of the python package's lib/ dir (either # virtualenv or system), we can strip everything before # "site-packages" to significantly shorten the line without really f=${f##*site-packages/} printf "%-80s " "$f:${called[1]}:${called[0]}" } export -f _ps4 export PS4='+ $(_ps4): ' source $_LIB/img-defaults source $_LIB/common-functions source $_LIB/img-functions if [ "$IS_RAMDISK" == "1" ]; then source $_LIB/ramdisk-defaults source $_LIB/ramdisk-functions fi echo "diskimage-builder version $(show_version)" # If no elements are specified theres no way we can succeed if [ -z "$*" ]; then echo "ERROR: At least one distribution root element must be specified" exit 1 fi arg_to_elements "$@" # start tracing after most boilerplate if [ ${DIB_DEBUG_TRACE} -gt 0 ]; then set -x fi if [ "${#IMAGE_TYPES[@]}" = "1" ]; then export IMAGE_NAME=${IMAGE_NAME%%\.${IMAGE_TYPES[0]}} fi # Check for required tools early on for X in ${!IMAGE_TYPES[@]}; do case "${IMAGE_TYPES[$X]}" in qcow2) if ! type qemu-img > /dev/null 2>&1; then echo "qcow2 output format specified but qemu-img executable not found." exit 1 fi ;; tgz) # Force tar to be created. IMAGE_TYPES+=('tar') ;; vhd) if ! type vhd-util > /dev/null 2>&1; then echo "vhd output format specified but no vhd-util executable found." exit 1 fi ;; squashfs) if ! type mksquashfs > /dev/null 2>&1; then echo "squashfs output format specified but no mksquashfs executable found." exit 1 fi ;; docker) if ! type docker > /dev/null 2>&1; then echo "docker output format specified but no docker executable found." exit 1 fi if [ -z "$DOCKER_TARGET" ]; then echo "Please set --docker-target." exit 1 fi ;; esac done # NOTE: fstrim is on most all recent systems. It is provided by the util-linux # package. if ! type fstrim > /dev/null 2>&1; then echo "fstrim utility is not found. This is provided by util-linux package" echo "Please check your PATH variable is set correctly" exit 1 fi # xattr support cannot be relied upon with tmpfs builds # some kernels supoprt it, some don't if [[ -n "${GENTOO_PROFILE}" ]]; then if [[ "${GENTOO_PROFILE}" =~ "hardened" ]]; then echo 'disabling tmpfs for gentoo hardened build' export DIB_NO_TMPFS=1 fi fi mk_build_dir # Create the YAML file with the final and raw configuration for # the block device layer. mkdir -p ${TMP_BUILD_DIR}/block-device BLOCK_DEVICE_CONFIG_YAML=${TMP_BUILD_DIR}/block-device/config.yaml block_device_create_config_file "${BLOCK_DEVICE_CONFIG_YAML}" # Write out the parameter file DIB_BLOCK_DEVICE_PARAMS_YAML=${TMP_BUILD_DIR}/block-device/params.yaml export DIB_BLOCK_DEVICE_PARAMS_YAML cat >${DIB_BLOCK_DEVICE_PARAMS_YAML} < $TMP_HOOKS_PATH/environment.d/11-dib-install-type.bash run_d extra-data # Run pre-install scripts. These do things that prepare the chroot for package installs run_d_in_target pre-install # Call install scripts to pull in the software users want. run_d_in_target install do_extra_package_install run_d_in_target post-install run_d post-root # ensure we do not have a lost+found directory in the root folder # that could cause copy to fail (it will be created again later # when creating the file system, if it needs such directory) if [ -e "$TMP_BUILD_DIR/mnt/lost+found" ]; then sudo rm -rf "$TMP_BUILD_DIR/mnt/lost+found" fi # Free up /mnt unmount_image mv $TMP_BUILD_DIR/mnt $TMP_BUILD_DIR/built # save xtrace state, as we always want to turn it off to avoid # spamming the logs with du output below. xtrace=$(set +o | grep xtrace) # temp file for holding du output du_output=${TMP_BUILD_DIR}/du_output.tmp if [ -n "$DIB_IMAGE_SIZE" ]; then du_size=$(echo "$DIB_IMAGE_SIZE" | awk '{printf("%d\n",$1 * 1024 *1024)}') else set +o xtrace echo "Calculating image size (this may take a minute)..." sudo du -a -c -x ${TMP_BUILD_DIR}/built > ${du_output} # the last line is the total size from "-c". if [ -n "$DIB_IMAGE_EXTRA_SIZE" ]; then # add DIB_IMAGE_EXTRA_SIZE megabytes to create a bigger image as requested du_extra_size=$(echo "$DIB_IMAGE_EXTRA_SIZE" | awk '{printf("%d\n",$1 * 1024)}') du_size_tmp=$(tail -n1 ${du_output} | cut -f1) du_size=$(echo "$du_size_tmp $du_extra_size" | awk '{print int($1 + $2)}') else # scale this by 0.6 to create a slightly bigger image du_size=$(tail -n1 ${du_output} | cut -f1 | awk '{print int($1 / 0.6)}') fi $xtrace fi if [[ "${DIB_SHOW_IMAGE_USAGE:-0}" != 0 ]]; then set +o xtrace if [ ! -f "$du_output" ]; then sudo du -a -c -x ${TMP_BUILD_DIR}/built > ${du_output} fi du_output_show="sort -nr ${du_output} | numfmt --to=iec-i --padding=7 --suffix=B --field=1 --from-unit=1024" # by default show the 10MiB and greater files & directories -- a # dir with lots of little files will still show up, but this helps # signal:noise ratio if [[ ${DIB_SHOW_IMAGE_USAGE_FULL:-0} == 0 ]]; then # numfmt will start giving a decimal place when < 10MiB du_output_show+="| egrep 'MiB|GiB|TiB|PiB' | grep -v '\..MiB'" echo "=================================" echo "Image size report (files > 10MiB)" echo "=================================" else echo "=================" echo "Image size report" echo "=================" fi eval ${du_output_show} echo echo "===== end image size report =====" echo $xtrace fi rm -f ${du_output} if [ -n "$DIB_JOURNAL_SIZE" ]; then journal_size="$DIB_JOURNAL_SIZE" else journal_size=64 fi if [ "$DIB_ROOT_FSTYPE" = "ext4" ] ; then # Very conservative to handle images being resized a lot # We set journal size to 64M so our journal is large enough when we # perform an FS resize. MKFS_OPTS="-i 4096 -J size=$journal_size $MKFS_OPTS" # NOTE(ianw) 2019-12-11 : this is a terrible hack ... if building on # >=Bionic hosts, mkfs sets "metadata_csum" for ext4 filesystems, # which makes broken Trusty images as that era fsck doesn't # understand this flag. The image will stop in early boot # complaining: # # Serious errors were found while checking the disk drive for /. # # We do not really have any suitable hook points where one of the # ubuntu elements or block-device-* could set this override flag for # just Trusty. We probably should, but desire to implement more # code to support the out-of-date trusty at this point is # non-existant. So hack in disabling this here. if [[ ${DIB_RELEASE} == "trusty" ]]; then MKFS_OPTS="-O ^metadata_csum $MKFS_OPTS" fi # Grow the image size to account for the journal, only if the user # has not asked for a specific size. if [ -z "$DIB_IMAGE_SIZE" ]; then du_size=$(( $du_size + ($journal_size * 1024) )) fi fi # EFI system partitions default to be quite large at 512mb for maximum # compatability (see notes in # 7fd52ba84180b4e749ccf4c9db8c49eafff46ea8) . We need to increase the # total size to account for this, or we run out of space creating the # final image. See if we have included the block-device-efi element, # which implies we have a large EFI partition, and then pad the final # image size. if [[ ${IMAGE_ELEMENT} =~ "block-device-efi" ]]; then echo "Expanding disk for EFI partition" du_size=$(( $du_size + (525 * 1024) )) fi # Rounding down size so that is is a multiple of 64, works around a bug in # qemu-img that may occur when compressing raw images that aren't a multiple # of 64k. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1180021 export DIB_IMAGE_SIZE=$(echo "$du_size" | awk ' { if ($1 % 64 != 0) print $1 + 64 - ( $1 % 64); else print $1; } ') if [ -n "$MAX_ONLINE_RESIZE" ]; then MKFS_OPTS="-E resize=$MAX_ONLINE_RESIZE $MKFS_OPTS" fi export TMP_IMAGE_DIR # Try the 'old fashioned' way calling the block device # phase. If this gives no result, use the configuration based approach: eval_run_d block-device "IMAGE_BLOCK_DEVICE=" if [ -z ${IMAGE_BLOCK_DEVICE} ] ; then # For compatibily reasons in addition to the YAML configuration # there is the need to handle the old environment variables. echo "image-size: ${DIB_IMAGE_SIZE}KiB" >> ${DIB_BLOCK_DEVICE_PARAMS_YAML} if [ -n "${MKFS_OPTS}" ] ; then echo "root-fs-opts: '${MKFS_OPTS}'" >> ${DIB_BLOCK_DEVICE_PARAMS_YAML} fi # After changeing the parameters, there is the need to # re-run ${DIB_BLOCK_DEVICE} init because some value might # change based on the new set parameters. ${DIB_BLOCK_DEVICE} init # values to ${DIB_BLOCK_DEVICE}: using the YAML config and ${DIB_BLOCK_DEVICE} create # This is the device (/dev/loopX). It's where to install the # bootloader. IMAGE_BLOCK_DEVICE=$(${DIB_BLOCK_DEVICE} getval image-block-device) export IMAGE_BLOCK_DEVICE # Similar to above, but all mounted devices. This is handy for # some bootloaders that have multi-partition layouts and want to # copy things to different places other than just # IMAGE_BLOCK_DEVICE. "eval" this into an array as needed IMAGE_BLOCK_DEVICES=$(${DIB_BLOCK_DEVICE} getval image-block-devices) export IMAGE_BLOCK_DEVICES # Write the fstab ${DIB_BLOCK_DEVICE} writefstab fi # XXX: needed? LOOPDEV=${IMAGE_BLOCK_DEVICE} # At this point, ${DIB_BLOCK_DEVICE} has created the raw image file # (IMAGE_BLOCK_DEVICE) and mounted all the partitions under # $TMP_BUILD_DIR/mnt for us. We can now copy into the final image. # 'mv' is not usable here - especially when a top level directory # has the same name as a mount point of a partition. If so, 'mv' # will complain: # mv: inter-device move failed: '...' to '...'; \ # unable to remove target: Device or resource busy # therefore a 'cp' and 'rm' approach is used. sudo cp -ra ${TMP_BUILD_DIR}/built/* $TMP_BUILD_DIR/mnt sudo rm -fr ${TMP_BUILD_DIR}/built/* mount_proc_dev_sys run_d pre-finalise run_d_in_target finalise finalise_base for X in ${!IMAGE_TYPES[@]} ; do if [[ " tar aci " =~ "${IMAGE_TYPES[$X]}" ]]; then if [ "${IMAGE_TYPES[$X]}" = "aci" ]; then sudo tar -C ${TMP_BUILD_DIR}/mnt -cf $IMAGE_NAME.aci --exclude ./sys \ --exclude ./proc --xattrs --xattrs-include=\* \ --transform 's,^.,rootfs,S' . if [ -n "$ACI_MANIFEST" ]; then cp $ACI_MANIFEST ${TMP_BUILD_DIR}/manifest sudo tar -C ${TMP_BUILD_DIR} --append -f $IMAGE_NAME.aci manifest else echo "No ACI_MANIFEST specified. An ACI_MANIFEST must be specified for" echo " this image to be usable." fi else sudo tar -C ${TMP_BUILD_DIR}/mnt -cf $IMAGE_NAME.tar --exclude ./sys \ --exclude ./proc --xattrs --xattrs-include=\* . fi sudo chown $USER: $IMAGE_NAME.${IMAGE_TYPES[$X]} unset IMAGE_TYPES[$X] elif [ "${IMAGE_TYPES[$x]}" == "squashfs" ]; then sudo mksquashfs ${TMP_BUILD_DIR}/mnt $IMAGE_NAME.squash -comp xz \ -noappend -root-becomes ${TMP_BUILD_DIR}/mnt \ -wildcards -e "proc/*" -e "sys/*" -no-recovery elif [ "${IMAGE_TYPES[$X]}" == "docker" ]; then sudo tar -C ${TMP_BUILD_DIR}/mnt -cf - --exclude ./sys \ --exclude ./proc --xattrs --xattrs-include=\* . \ | sudo docker import - $DOCKER_TARGET unset IMAGE_TYPES[$X] fi done # Unmount and cleanup the /mnt and /build subdirectories, to save # space before converting the image to some other format. # XXX ? needed? export EXTRA_UNMOUNT="" unmount_image TMP_IMAGE_PATH=$(${DIB_BLOCK_DEVICE} getval image-path) export TMP_IMAGE_PATH # remove all mounts ${DIB_BLOCK_DEVICE} umount ${DIB_BLOCK_DEVICE} cleanup cleanup_build_dir if [[ (! $IMAGE_ELEMENT =~ no-final-image) && "$IS_RAMDISK" == "0" ]]; then has_raw_type= for IMAGE_TYPE in ${IMAGE_TYPES[@]} ; do # We have to do raw last because it is destructive if [ "$IMAGE_TYPE" = "raw" ]; then has_raw_type=1 elif [ "$IMAGE_TYPE" != "squashfs" ]; then compress_and_save_image $IMAGE_NAME.$IMAGE_TYPE fi done if [ -n "$has_raw_type" ]; then IMAGE_TYPE="raw" compress_and_save_image $IMAGE_NAME.$IMAGE_TYPE fi fi # Remove the leftovers, i.e. the temporary image directory. cleanup_image_dir # Restore fd 1&2 from the outfilter.py redirect back to the original # saved fd. Note small hack that we can't really wait properly for # outfilter.py so put in a sleep (might be possible to use coproc for # this...?) # # TODO(ianw): probably better to cleanup the exit handler a bit for # this? We really want some helper functions that append to the exit # handler so we can register multiple things. set +o xtrace echo "Build completed successfully" exec 1>&3 2>&3 sleep 1 # All done! trap EXIT ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/logging_config.py0000664000175000017500000000606215201026231023051 0ustar00zuulzuul# Copyright 2016 Andreas Florath (andreas@florath.net) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # Python Logging Configuration for DIB # Usage: # In the main (application) file, do an # import logging_config # ... # logging_config.setup() # It is then possible to use the normal python logging interface, like # logger = logging.getLogger(__name__) # logger.info("Info Message") import json import logging import logging.config import os # A simple formatter to more or less copy oslo.log's ContextFormatter class DibFormatter(logging.Formatter): def __init__(self, *args, **kwargs): self.fmt = kwargs['fmt'] self.debug_suffix = kwargs.pop('debug_suffix') logging.Formatter.__init__(self, *args, **kwargs) def format(self, record): if record.levelno == logging.DEBUG: fmt = self.fmt + self.debug_suffix else: fmt = self.fmt self._style = logging.PercentStyle(fmt) self._fmt = self._style._fmt return logging.Formatter.format(self, record) def setup(): # Check for the DIB_DEBUG_TRACE environment variable # If it is set to something greater then 0, use debug # logging. LOG_LEVEL = "DEBUG" if 'DIB_DEBUG_TRACE' in os.environ \ and int(os.environ['DIB_DEBUG_TRACE']) > 0 else "INFO" # Default logging configuration which can be overwritten # by a config file passed in by a user. PYTHON_LOGGING_CONFIG = { 'version': 1, 'disable_existing_loggers': False, # note that disk-image-create runs stdout through # outfilter.py, which adds the timestamp. this doesn't have a # timestamp to avoid double logging 'formatters': { 'standard': { '()': 'diskimage_builder.logging_config.DibFormatter', 'fmt': '%(levelname)s ' '%(name)s [-] %(message)s', 'debug_suffix': ' %(funcName)s %(pathname)s:%(lineno)d' } }, 'handlers': { 'default': { 'level': LOG_LEVEL, 'class': 'logging.StreamHandler', 'formatter': 'standard', } }, 'loggers': { '': { 'handlers': ['default'], 'level': LOG_LEVEL, 'propagate': True } } } if 'DIB_PYTHON_LOGGING_CONFIG_FILE' in os.environ: with open(os.environ['DIB_PYTHON_LOGGING_CONFIG_FILE']) as fd: PYTHON_LOGGING_CONFIG = json.load(fd) logging.config.dictConfig(PYTHON_LOGGING_CONFIG) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/paths.py0000664000175000017500000000154715201026231021220 0ustar00zuulzuul# Copyright 2016 Ian Wienand (iwienand@redhat.com) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Export paths""" import os import sys def get_path(var): if var in ("lib", "elements"): return os.path.abspath(os.path.join(os.path.dirname(__file__), var)) print("Unknown path request!") sys.exit(1) def show_path(var): print(get_path(var)) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4242387 diskimage_builder-3.42.0/diskimage_builder/tests/0000775000175000017500000000000015201026275020672 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/tests/__init__.py0000664000175000017500000000000015201026231022761 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/tests/base.py0000664000175000017500000000402715201026231022151 0ustar00zuulzuul# Copyright 2014 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # TODO(bnemec): This whole file is a copy-paste of the one in # tripleo-image-elements. That duplication needs to be eliminated. import os import subprocess import sys import tempfile from oslotest import base class ScriptTestBase(base.BaseTestCase): def setUp(self): super(ScriptTestBase, self).setUp() self.tmpdir = tempfile.mkdtemp() self.env = os.environ.copy() self.env['PATH'] = self.tmpdir + ':' + self.env['PATH'] def _stub_script(self, name, contents): filename = os.path.join(self.tmpdir, name) with open(filename, 'w') as f: f.write('#!/bin/bash\n') f.write(contents) f.write('\n') os.chmod(filename, 0o700) def _run_command(self, cmd): try: # check_output doesn't exist in Python < 2.7 if sys.hexversion < 0x02070000: runner = subprocess.check_call else: runner = subprocess.check_output return runner(cmd, stderr=subprocess.STDOUT, env=self.env) # NOTE(bnemec): Handle the exception so we can extract as much # information as possible. except subprocess.CalledProcessError as e: # The check_call exception won't have any data in e.output if sys.hexversion < 0x02070000: self.fail(e) else: self.fail(e.output) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4252386 diskimage_builder-3.42.0/diskimage_builder/tests/functional/0000775000175000017500000000000015201026275023034 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/tests/functional/__init__.py0000664000175000017500000000000015201026231025123 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/tests/test_diskimage_builder.py0000664000175000017500000004467415201026231025755 0ustar00zuulzuul# Copyright 2023 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import os import subprocess import tempfile from unittest import mock import jsonschema import testtools import yaml from diskimage_builder import diskimage_builder as dib class TestDib(testtools.TestCase): def assert_to_argument(self, expected, prop, value): self.assertEqual(expected, prop.to_argument(value)) self.assert_schema_validate(prop, value) def assert_schema_validate(self, prop, value, assert_failure=False): # create a fake dict value and validate the schema against it value_dict = {prop.key: value} schema = {"type": "object", "properties": {}} schema["properties"].update(prop.to_schema()) if assert_failure: self.assertRaises( jsonschema.exceptions.ValidationError, jsonschema.validate, value_dict, schema=schema, ) else: jsonschema.validate(value_dict, schema=schema) def test_schema_property(self): x = dib.SchemaProperty( "the_key", "the description", schema_type="integer" ) self.assertEqual( """\ the_key ------- the description (Value is a string)""", x.to_help(), ) self.assertEqual({"the_key": {"type": "integer"}}, x.to_schema()) def test_env(self): x = dib.Env( "environment", "environment variables to set during the image build", ) self.assertEqual( { "environment": { "additionalProperties": {"type": "string"}, "type": "object", } }, x.to_schema(), ) def test_arg(self): # no arg x = dib.Arg("the-key", "") self.assert_to_argument(["--the-key", "the value"], x, "the value") # with arg x = dib.Arg("the-key", "", arg="--key") self.assert_to_argument(["--key", "the value"], x, "the value") # with empty string value self.assert_to_argument([], x, "") def test_arg_flag(self): x = dib.ArgFlag("doit", "do it", arg="-d") self.assertEqual({"doit": {"type": "boolean"}}, x.to_schema()) # false value self.assert_to_argument([], x, False) # true value self.assert_to_argument(["-d"], x, True) def test_arg_enum(self): x = dib.ArgEnum("choice", "", enum=["one", "two", "three"]) self.assertEqual( {"choice": {"type": "string", "enum": ["one", "two", "three"]}}, x.to_schema(), ) self.assert_to_argument(["--choice", "one"], x, "one") self.assert_schema_validate(x, "two") self.assert_schema_validate(x, "four", assert_failure=True) def test_arg_flag_repeating(self): x = dib.ArgFlagRepeating("log_level", "", arg="-v", max_repeat=3) self.assertEqual( {"log_level": {"type": "integer", "enum": [0, 1, 2, 3]}}, x.to_schema(), ) self.assert_to_argument([], x, 0) self.assert_to_argument(["-v"], x, 1) self.assert_to_argument(["-v", "-v"], x, 2) self.assert_to_argument(["-v", "-v", "-v"], x, 3) def test_arg_int(self): x = dib.ArgInt("size", "") self.assertEqual( {"size": {"type": "integer", "minimum": 1}}, x.to_schema() ) self.assert_to_argument(["--size", "10"], x, 10) self.assert_schema_validate(x, -1, assert_failure=True) def test_arg_list(self): x = dib.ArgList("packages", "", arg="-p") self.assertEqual( {"packages": {"type": "array", "items": {"type": "string"}}}, x.to_schema(), ) self.assert_to_argument( ["-p", "wget,vim-enhanced"], x, ["wget", "vim-enhanced"] ) self.assert_to_argument([], x, []) def test_arg_list_position(self): x = dib.ArgListPositional("elements", "") self.assert_to_argument( ["centos", "vm", "bootloader"], x, ["centos", "vm", "bootloader"] ) def test_arg_enum_list(self): x = dib.ArgEnumList( "types", "", arg="-t", enum=["qcow2", "tar", "raw"] ) self.assertEqual( { "types": { "items": { "enum": ["qcow2", "tar", "raw"], "type": "string", }, "type": "array", } }, x.to_schema(), ) self.assert_to_argument(["-t", "qcow2,raw"], x, ["qcow2", "raw"]) def test_arg_dict_to_string(self): x = dib.ArgDictToString("options", "") self.assertEqual( { "options": { "additionalProperties": {"type": "string"}, "type": "object", } }, x.to_schema(), ) self.assert_to_argument( ["--options", "foo=bar,baz=ingo"], x, {"foo": "bar", "baz": "ingo"}, ) def test_command_merged_env(self): c = dib.Command( "echo", properties=[dib.Env("environment", "")], entry={ "environment": { "ELEMENTS_PATH": "/path/to/elements", "DIB_CLOUD_IMAGES": "/path/to/image.qcow2", } }, ) env = c.merged_env() self.assertEqual("/path/to/elements", env["ELEMENTS_PATH"]) self.assertEqual("/path/to/image.qcow2", env["DIB_CLOUD_IMAGES"]) self.assertIn(needle="_LIB", haystack=env) # this will be merged with the whole environment, so there will be # more than 3 values self.assertGreater(len(env), 3) def test_command(self): c = dib.Command( "echo", properties=[ dib.Env("environment", ""), dib.Arg("the-key", "", arg="--key"), dib.ArgFlag("doit", "do it", arg="-d"), dib.ArgFlagRepeating("verbose", "", arg="-v", max_repeat=3), dib.ArgDictToString("options", ""), dib.ArgListPositional("elements", ""), ], entry={ "environment": { "ELEMENTS_PATH": "/path/to/elements", "DIB_CLOUD_IMAGES": "~/image.qcow2", }, "the-key": "the-value", "doit": True, "verbose": 3, "options": {"foo": "bar"}, "elements": ["centos", "vm"], }, ) self.assertEqual( [ "bash", "echo", "--key", "the-value", "-d", "-v", "-v", "-v", "--options", "foo=bar", "centos", "vm", ], c.command(), ) self.assertEqual( "ELEMENTS_PATH=/path/to/elements " "DIB_CLOUD_IMAGES='~/image.qcow2' " "bash echo --key the-value -d -v -v -v --options foo=bar " "centos vm\n", str(c), ) def test_merge_entry(self): # override normal attributes merged_entry = { "imagename": "image1", "elements": ["one", "two", "three"], "debug-trace": 1, } dib.merge_entry( merged_entry, { "imagename": "image1", "debug-trace": 2, "logfile": "image1.log", }, ) self.assertEqual( { "imagename": "image1", "elements": ["one", "two", "three"], "debug-trace": 2, "logfile": "image1.log", }, merged_entry, ) # append list attributes, update dict attributes merged_entry = { "imagename": "image1", "elements": ["one", "two", "three"], "environment": { "DIB_ONE": "1", "DIB_TWO": "2", }, } dib.merge_entry( merged_entry, { "imagename": "image1", "elements": ["four", "five"], "environment": { "DIB_TWO": "two", "DIB_THREE": "three", }, }, ) self.assertEqual( { "imagename": "image1", "elements": ["one", "two", "three", "four", "five"], "environment": { "DIB_ONE": "1", "DIB_TWO": "two", "DIB_THREE": "three", }, }, merged_entry, ) @mock.patch("diskimage_builder.paths.get_path") def test_build_commands_simple(self, mock_get_path): mock_get_path.return_value = "/lib" commands = dib.build_commands( [ { "imagename": "centos-minimal", "elements": ["centos", "vm"], }, { "imagename": "ironic-python-agent", "ramdisk": True, "elements": [ "ironic-python-agent-ramdisk", "extra-hardware", ], }, ] ) self.assertEqual( [ "bash", "/lib/disk-image-create", "-o", "centos-minimal", "centos", "vm", ], commands[0].command(), ) self.assertEqual( [ "bash", "/lib/ramdisk-image-create", "-o", "ironic-python-agent", "ironic-python-agent-ramdisk", "extra-hardware", ], commands[1].command(), ) @mock.patch("diskimage_builder.paths.get_path") def test_build_commands_merged(self, mock_get_path): mock_get_path.return_value = "/lib" commands = dib.build_commands( [ { # base definition "imagename": "centos-minimal", "elements": ["centos", "vm"], "environment": {"foo": "bar", "zip": "zap"}, }, { # merge with previous when no imagename "elements": ["devuser"], "logfile": "centos-minimal.log", }, { # merge when same imagename "imagename": "centos-minimal", "environment": {"foo": "baz", "one": "two"}, }, ] ) self.assertEqual(1, len(commands)) self.assertEqual( [ "bash", "/lib/disk-image-create", "-o", "centos-minimal", "--logfile", "centos-minimal.log", "centos", "vm", "devuser", ], commands[0].command(), ) @mock.patch("diskimage_builder.paths.get_path") def test_build_commands_all_arguments(self, mock_get_path): mock_get_path.return_value = "/lib" commands = dib.build_commands( [ { "arch": "amd64", "imagename": "everyoption", "types": ["qcow2"], "debug-trace": 2, "uncompressed": True, "clear": True, "logfile": "./logfile.log", "checksum": True, "image-size": 40, "image-extra-size": 1, "image-cache": "~/.cache/dib", "max-online-resize": 1000, "min-tmpfs": 7, "mkfs-journal-size": 1, "mkfs-options": "-D", "no-tmpfs": True, "offline": True, "qemu-img-options": {"size": "10"}, "ramdisk-element": "dracut-ramdisk", "install-type": "package", "root-label": "root", "docker-target": "everyoption:latest", "packages": ["wget", "tmux"], "skip-base": True, "elements": ["centos", "vm"], } ] ) self.assertEqual( [ "bash", "/lib/disk-image-create", "-o", "everyoption", "-a", "amd64", "-t", "qcow2", "-x", "-x", "-u", "-c", "--logfile", "./logfile.log", "--checksum", "--image-size", "40", "--image-extra-size", "1", "--image-cache", "~/.cache/dib", "--max-online-resize", "1000", "--min-tmpfs", "7", "--mkfs-journal-size", "1", "--mkfs-options", "-D", "--no-tmpfs", "--offline", "--qemu-img-options", "size=10", "--root-label", "root", "--ramdisk-element", "dracut-ramdisk", "--install-type", "package", "--docker-target", "everyoption:latest", "-p", "wget,tmux", "-n", "centos", "vm", ], commands[0].command(), ) def write_image_definition(self): image_def = [ { "imagename": "centos-minimal", "elements": ["centos", "vm"], }, { "imagename": "ironic-python-agent", "ramdisk": True, "elements": [ "ironic-python-agent-ramdisk", "extra-hardware", ], }, ] with tempfile.NamedTemporaryFile(delete=False) as deffile: self.addCleanup(os.remove, deffile.name) self.filelist = [deffile.name] with open(deffile.name, "w") as f: f.write(yaml.dump(image_def)) return deffile.name @mock.patch("diskimage_builder.paths.get_path") @mock.patch("diskimage_builder.diskimage_builder.get_args") @mock.patch("subprocess.Popen") def test_main_dry_run(self, mock_popen, mock_get_args, mock_get_path): mock_get_path.return_value = "/lib" mock_get_args.return_value = mock.Mock( dry_run=True, files=[self.write_image_definition()] ) dib.main() mock_popen.assert_not_called() @mock.patch("diskimage_builder.paths.get_path") @mock.patch("diskimage_builder.diskimage_builder.get_args") @mock.patch("subprocess.Popen") def test_main(self, mock_popen, mock_get_args, mock_get_path): mock_get_path.return_value = "/lib" mock_get_args.return_value = mock.Mock( dry_run=False, files=[self.write_image_definition()], stop_on_failure=False, ) process = mock.Mock() process.returncode = 0 mock_popen.return_value = process dib.main() self.assertEqual(2, mock_popen.call_count) mock_popen.assert_has_calls( [ mock.call( [ "bash", "/lib/disk-image-create", "-o", "centos-minimal", "centos", "vm", ], env=mock.ANY, ), mock.call( [ "bash", "/lib/ramdisk-image-create", "-o", "ironic-python-agent", "ironic-python-agent-ramdisk", "extra-hardware", ], env=mock.ANY, ), ], any_order=True, ) @mock.patch("diskimage_builder.paths.get_path") @mock.patch("diskimage_builder.diskimage_builder.get_args") @mock.patch("subprocess.Popen") def test_main_stop_on_failure( self, mock_popen, mock_get_args, mock_get_path ): mock_get_path.return_value = "/lib" mock_get_args.return_value = mock.Mock( dry_run=False, files=[self.write_image_definition()], stop_on_failure=True, ) process = mock.Mock() process.returncode = -1 mock_popen.return_value = process e = self.assertRaises(subprocess.CalledProcessError, dib.main) self.assertEqual(1, mock_popen.call_count) self.assertEqual(-1, e.returncode) @mock.patch("diskimage_builder.paths.get_path") @mock.patch("diskimage_builder.diskimage_builder.get_args") @mock.patch("subprocess.Popen") def test_main_continue_on_failure( self, mock_popen, mock_get_args, mock_get_path ): mock_get_path.return_value = "/lib" mock_get_args.return_value = mock.Mock( dry_run=False, files=[self.write_image_definition()], stop_on_failure=False, ) process = mock.Mock() process.returncode.side_effect = -1 mock_popen.return_value = process self.assertRaises(subprocess.CalledProcessError, dib.main) self.assertEqual(2, mock_popen.call_count) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/tests/test_elementdeps.py0000664000175000017500000002337715201026231024614 0ustar00zuulzuul# Copyright 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging import os import fixtures import testtools from diskimage_builder import element_dependencies logger = logging.getLogger(__name__) data_dir = os.path.abspath( os.path.join(os.path.dirname(__file__), 'test-elements')) def _populate_element(element_dir, element_name, element_deps=[], provides=[]): logger.debug("Populate %s <%s>", element_name, element_dir) element_home = os.path.join(element_dir, element_name) os.mkdir(element_home) deps_path = os.path.join(element_home, 'element-deps') with open(deps_path, 'w') as deps_file: deps_file.write("\n".join(element_deps)) provides_path = os.path.join(element_home, 'element-provides') with open(provides_path, 'w') as provides_file: provides_file.write("\n".join(provides)) class TestElementDeps(testtools.TestCase): def setUp(self): super(TestElementDeps, self).setUp() self.element_root_dir = self.useFixture(fixtures.TempDir()).path self.element_dir = os.path.join(self.element_root_dir, 'elements') self.element_override_dir = os.path.join(self.element_root_dir, 'element-override') os.mkdir(self.element_dir) os.mkdir(self.element_override_dir) self.log_fixture = self.useFixture( fixtures.FakeLogger(level=logging.DEBUG)) _populate_element(self.element_dir, 'requires-foo', ['foo']) _populate_element(self.element_dir, 'foo', [], ['operating-system']) _populate_element(self.element_dir, 'requires-requires-foo', ['requires-foo']) _populate_element(self.element_dir, 'self', ['self']) _populate_element(self.element_dir, 'provides_virtual', [], ['virtual']) _populate_element(self.element_dir, 'also_provides_virtual', [], ['virtual']) _populate_element(self.element_dir, 'requires_virtual', ['virtual'], ['operating-system']) _populate_element(self.element_dir, 'virtual', ['extra_dependency']) _populate_element(self.element_dir, 'extra_dependency', []) _populate_element(self.element_dir, 'circular1', ['circular2'], ['operating-system']) _populate_element(self.element_dir, 'circular2', ['circular1']) _populate_element(self.element_dir, 'provides_new_virtual', [], ['new_virtual', 'operating-system']) _populate_element(self.element_dir, 'requires_new_virtual', ['new_virtual']) # second element should override the first one here _populate_element(self.element_dir, 'override_element', []) _populate_element(self.element_override_dir, 'override_element', []) # This simulates $ELEMENTS_PATH self.element_dirs = "%s:%s" % (self.element_override_dir, self.element_dir) # helper to return an (element, path) tuple from the standard dir def _e(self, element): return (element, os.path.join(self.element_dir, element)) # helper to return an (element, path) tuple from the override dir def _eo(self, element): return (element, os.path.join(self.element_override_dir, element)) def test_non_transitive_deps(self): result = element_dependencies.get_elements(['requires-foo'], self.element_dirs) self.assertCountEqual([self._e('foo'), self._e('requires-foo')], result) def test_missing_deps(self): e = self.assertRaises(element_dependencies.MissingElementException, element_dependencies.get_elements, ['fake'], self.element_dirs) self.assertIn("Element 'fake' not found", str(e)) def test_invalid_element_dir(self): e = self.assertRaises(element_dependencies.InvalidElementDir, element_dependencies.get_elements, ['fake'], self.element_dirs + ":/not/a/dir") self.assertIn("ELEMENTS_PATH entry '/not/a/dir' is not a directory", str(e)) def test_transitive_deps(self): result = element_dependencies.get_elements( ['requires-requires-foo'], self.element_dirs) self.assertCountEqual([self._e('requires-requires-foo'), self._e('requires-foo'), self._e('foo')], result) def test_no_deps(self): result = element_dependencies.get_elements(['foo'], self.element_dirs) self.assertEqual([self._e('foo')], result) def test_self(self): result = element_dependencies.get_elements(['self', 'foo'], self.element_dirs) self.assertCountEqual([self._e('self'), self._e('foo')], result) def test_circular(self): result = element_dependencies.get_elements(['circular1'], self.element_dirs) self.assertCountEqual([self._e('circular1'), self._e('circular2')], result) def test_provide(self): result = element_dependencies.get_elements( ['provides_virtual', 'requires_virtual'], self.element_dirs) self.assertCountEqual([self._e('requires_virtual'), self._e('provides_virtual')], result) def test_provide_conflict(self): self.assertRaises(element_dependencies.AlreadyProvidedException, element_dependencies.get_elements, ['virtual', 'provides_virtual'], self.element_dirs) def test_provide_virtual_ordering(self): result = element_dependencies.get_elements( ['requires_new_virtual', 'provides_new_virtual'], self.element_dirs) self.assertCountEqual( [self._e('requires_new_virtual'), self._e('provides_new_virtual')], result) def test_elements_provide_same(self): msg = r"virtual: already provided by \['provides_virtual'\]" self.assertRaisesRegex(element_dependencies.AlreadyProvidedException, msg, element_dependencies.get_elements, ['provides_virtual', 'also_provides_virtual'], self.element_dirs) def test_no_os_element(self): self.assertRaises(element_dependencies.MissingOSException, element_dependencies.get_elements, ['provides_virtual'], self.element_dirs) def test_duplicated_os_passed_as_element(self): self.assertRaises( element_dependencies.AlreadyProvidedException, element_dependencies.get_elements, ['circular1', 'operating-system'], self.element_dirs) # ensure we get the error message about what's providing the # conflicting package self.assertIn("operating-system : already provided by ['circular1']", self.log_fixture.output) def test_element_override(self): # make sure we picked up "override_element" from the override dir, # not the base dir result = element_dependencies.get_elements(['override_element', 'foo'], self.element_dirs) self.assertCountEqual([self._e('foo'), self._eo('override_element')], result) def test_expand_dependencies_deprecated(self): # test the deprecated expand_dependencies call result = element_dependencies.expand_dependencies( ['foo', 'requires-foo'], self.element_dirs) self.assertCountEqual(['foo', 'requires-foo'], result) def test_output_sanity(self): # very basic output sanity test elements = element_dependencies._get_elements(['foo', 'requires-foo'], self.element_dirs) element_dependencies._output_env_vars(elements) class TestElements(testtools.TestCase): def test_depends_on_env(self): self.useFixture( fixtures.EnvironmentVariable('ELEMENTS_PATH', '/foo/bar')) self.assertEqual('/foo/bar', element_dependencies._get_elements_dir()) def test_env_not_set(self): self.useFixture(fixtures.EnvironmentVariable('ELEMENTS_PATH', '')) self.assertRaises(Exception, element_dependencies._get_elements_dir, ()) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/tests/test_loggingconfig.py0000664000175000017500000000372315201026231025114 0ustar00zuulzuul# Copyright 2016 Andreas Florath (andreas@florath.net) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import fixtures import logging import testtools from diskimage_builder import logging_config class TestLoggingConfig(testtools.TestCase): def test_defaults(self): self.out = self.useFixture(fixtures.StringStream('stdout')) self.useFixture( fixtures.MonkeyPatch('sys.stdout', self.out.stream)) self.err = self.useFixture(fixtures.StringStream('stderr')) self.useFixture( fixtures.MonkeyPatch('sys.stderr', self.err.stream)) self.useFixture(fixtures.EnvironmentVariable('DIB_DEBUG_TRACE', '1')) logging_config.setup() log = logging.getLogger(__name__) log.debug("Debug Message") self.assertIn("Debug Message", self.err._details["stderr"].as_text()) # The follow two are looking for the function name / file name # suffix we log only for debug messages self.assertIn("test_defaults", self.err._details["stderr"].as_text()) self.assertIn("test_loggingconfig.py", self.err._details["stderr"].as_text()) log.info("Info Message") self.assertIn("Info Message", self.err._details["stderr"].as_text()) log.warning("Warning Message") self.assertIn("Warning Message", self.err._details["stderr"].as_text()) log.error("Error Message") self.assertIn("Error Message", self.err._details["stderr"].as_text()) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/tests/test_no_dup_filenames.py0000664000175000017500000000314315201026231025603 0ustar00zuulzuul# Copyright 2014 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import glob import os import testtools class TestNoDupFilenames(testtools.TestCase): def test_no_dup_filenames(self): topdir = os.path.normpath(os.path.dirname(__file__) + '/../../') elements_glob = os.path.join(topdir, "elements", "*") filenames = [] dirs_to_check = ['block-device.d', 'cleanup.d', 'extra-data.d', 'finalise.d', 'install.d', 'post-install.d', 'pre-install.d', 'root.d'] for element_dir in glob.iglob(elements_glob): for dir_to_check in dirs_to_check: target_dir = os.path.join(element_dir, dir_to_check, "*") for target in glob.iglob(target_dir): short_path = target[len(element_dir) + 1:] if not os.path.isdir(target): err_msg = 'Duplicate file name found %s' % short_path self.assertFalse(short_path in filenames, err_msg) filenames.append(short_path) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/diskimage_builder/version.py0000664000175000017500000000131415201026231021556 0ustar00zuulzuul# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import pbr.version version_info = pbr.version.VersionInfo('diskimage-builder') ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4512393 diskimage_builder-3.42.0/diskimage_builder.egg-info/0000775000175000017500000000000015201026275021222 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658493.0 diskimage_builder-3.42.0/diskimage_builder.egg-info/PKG-INFO0000644000175000017500000000576115201026275022326 0ustar00zuulzuulMetadata-Version: 2.4 Name: diskimage-builder Version: 3.42.0 Summary: Golden Disk Image builder. Home-page: https://docs.openstack.org/diskimage-builder/latest/ Author: OpenStack Author-email: openstack-discuss@lists.openstack.org License: Apache License (2.0) Classifier: Development Status :: 5 - Production/Stable Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Environment :: Console Requires-Python: >=3.8 License-File: LICENSE Requires-Dist: networkx>=2.3.0 Requires-Dist: pbr!=2.1.0,>=2.0.0 Requires-Dist: PyYAML>=3.12 Requires-Dist: stevedore>=1.20.0 Requires-Dist: flake8<7.0.0,>=3.6.0 Requires-Dist: jsonschema>=3.0.2 Dynamic: author Dynamic: author-email Dynamic: classifier Dynamic: description Dynamic: home-page Dynamic: license Dynamic: license-file Dynamic: requires-dist Dynamic: requires-python Dynamic: summary ================================== Image building tools for OpenStack ================================== ``diskimage-builder`` is a flexible suite of components for building a wide-range of disk images, filesystem images and ramdisk images for use with OpenStack. This repository has the core functionality for building such images, both virtual and bare metal. Images are composed using `elements`; while fundamental elements are provided here, individual projects have the flexibility to customise the image build with their own elements. For example:: $ DIB_RELEASE=bionic disk-image-create -o ubuntu-bionic.qcow2 vm ubuntu will create a bootable Ubuntu Bionic based ``qcow2`` image. ``diskimage-builder`` is useful to anyone looking to produce customised images for deployment into clouds. They are used extensively to build images for testing OpenStack itself, particularly with `nodepool `__. Platforms supported include AlmaLinux, CentOS Stream, Debian, Fedora, RHEL, Rocky Linux and Ubuntu. Full documentation, the source of which is in ``doc/source/``, is published at: * https://docs.openstack.org/diskimage-builder/latest/ Copyright ========= Copyright 2012 Hewlett-Packard Development Company, L.P. Copyright (c) 2012 NTT DOCOMO, INC. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658493.0 diskimage_builder-3.42.0/diskimage_builder.egg-info/SOURCES.txt0000664000175000017500000024112615201026275023114 0ustar00zuulzuul.stestr.conf AUTHORS ChangeLog LICENSE README.rst bindep.txt pylint.cfg requirements.txt setup.cfg setup.py test-requirements.txt tox.ini .zuul.d/jobs.yaml .zuul.d/project.yaml bin/dib-lint diskimage_builder/__init__.py diskimage_builder/disk_image_create.py diskimage_builder/diskimage_builder.py diskimage_builder/element_dependencies.py diskimage_builder/logging_config.py diskimage_builder/paths.py diskimage_builder/version.py diskimage_builder.egg-info/PKG-INFO diskimage_builder.egg-info/SOURCES.txt diskimage_builder.egg-info/dependency_links.txt diskimage_builder.egg-info/entry_points.txt diskimage_builder.egg-info/not-zip-safe diskimage_builder.egg-info/pbr.json diskimage_builder.egg-info/requires.txt diskimage_builder.egg-info/top_level.txt diskimage_builder/block_device/__init__.py diskimage_builder/block_device/blockdevice.py diskimage_builder/block_device/cmd.py diskimage_builder/block_device/config.py diskimage_builder/block_device/exception.py diskimage_builder/block_device/plugin.py diskimage_builder/block_device/utils.py diskimage_builder/block_device/level0/__init__.py diskimage_builder/block_device/level0/localloop.py diskimage_builder/block_device/level1/__init__.py diskimage_builder/block_device/level1/lvm.py diskimage_builder/block_device/level1/mbr.py diskimage_builder/block_device/level1/partition.py diskimage_builder/block_device/level1/partitioning.py diskimage_builder/block_device/level2/__init__.py diskimage_builder/block_device/level2/mkfs.py diskimage_builder/block_device/level3/__init__.py diskimage_builder/block_device/level3/mount.py diskimage_builder/block_device/level4/__init__.py diskimage_builder/block_device/level4/fstab.py diskimage_builder/block_device/tests/__init__.py diskimage_builder/block_device/tests/test_base.py diskimage_builder/block_device/tests/test_config.py diskimage_builder/block_device/tests/test_gpt.py diskimage_builder/block_device/tests/test_lvm.py diskimage_builder/block_device/tests/test_mbr.py diskimage_builder/block_device/tests/test_mkfs.py diskimage_builder/block_device/tests/test_mount_order.py diskimage_builder/block_device/tests/test_state.py diskimage_builder/block_device/tests/test_utils.py diskimage_builder/block_device/tests/config/bad_edge_graph.yaml diskimage_builder/block_device/tests/config/bad_plugin.yaml diskimage_builder/block_device/tests/config/cmd_create.yaml diskimage_builder/block_device/tests/config/deep_graph.yaml diskimage_builder/block_device/tests/config/deep_tree.yaml diskimage_builder/block_device/tests/config/duplicate_fs_labels.yaml diskimage_builder/block_device/tests/config/duplicate_name.yaml diskimage_builder/block_device/tests/config/gpt_efi.yaml diskimage_builder/block_device/tests/config/lvm_graph.yaml diskimage_builder/block_device/tests/config/lvm_tree.yaml diskimage_builder/block_device/tests/config/lvm_tree_multiple_partitions.yaml diskimage_builder/block_device/tests/config/lvm_tree_multiple_pv.yaml diskimage_builder/block_device/tests/config/lvm_tree_multiple_pv_vg.yaml diskimage_builder/block_device/tests/config/lvm_tree_partition_ordering.yaml diskimage_builder/block_device/tests/config/lvm_tree_spanned_vg.yaml diskimage_builder/block_device/tests/config/lvm_tree_thin_provision.yaml diskimage_builder/block_device/tests/config/multi_key_node.yaml diskimage_builder/block_device/tests/config/multiple_partitions_graph.yaml diskimage_builder/block_device/tests/config/multiple_partitions_tree.yaml diskimage_builder/block_device/tests/config/rollback.yaml diskimage_builder/block_device/tests/config/simple_graph.yaml diskimage_builder/block_device/tests/config/simple_tree.yaml diskimage_builder/block_device/tests/config/too_long_fs_label.yaml diskimage_builder/block_device/tests/plugin/__init__.py diskimage_builder/block_device/tests/plugin/test_a.py diskimage_builder/block_device/tests/plugin/test_b.py diskimage_builder/elements/__init__.py diskimage_builder/elements/almalinux-container/README.rst diskimage_builder/elements/almalinux-container/element-deps diskimage_builder/elements/almalinux-container/package-installs.yaml diskimage_builder/elements/almalinux-container/containerfiles/10 diskimage_builder/elements/almalinux-container/containerfiles/8 diskimage_builder/elements/almalinux-container/containerfiles/9 diskimage_builder/elements/almalinux-container/environment.d/10-01-almalinux-distro-name.bash diskimage_builder/elements/almalinux-container/environment.d/11-yum-dnf.bash diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-aarch64-build-succeeds/README.rst diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-aarch64-build-succeeds/element-deps diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-aarch64-build-succeeds/environment.d/09-set-distro.sh diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-build-succeeds/README.rst diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-build-succeeds/element-deps diskimage_builder/elements/almalinux-container/test-elements/almalinux-10-build-succeeds/environment.d/09-set-distro.sh diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-aarch64-build-succeeds/README.rst diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-aarch64-build-succeeds/element-deps diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-aarch64-build-succeeds/environment.d/09-set-distro.bash diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-build-succeeds/README.rst diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-build-succeeds/element-deps diskimage_builder/elements/almalinux-container/test-elements/almalinux-9-build-succeeds/environment.d/09-set-distro.bash diskimage_builder/elements/almalinux-container/test-elements/build-succeeds/README.rst diskimage_builder/elements/almalinux-container/test-elements/build-succeeds/element-deps diskimage_builder/elements/apt-conf/README.rst diskimage_builder/elements/apt-conf/extra-data.d/99-override-default-apt-conf diskimage_builder/elements/apt-preferences/README.rst diskimage_builder/elements/apt-preferences/extra-data.d/99-set-apt-package-pins diskimage_builder/elements/apt-sources/README.rst diskimage_builder/elements/apt-sources/extra-data.d/99-override-default-apt-sources diskimage_builder/elements/apt-sources/test-elements/test-sources/element-deps diskimage_builder/elements/apt-sources/test-elements/test-sources/environment.d/00-set-apt-sources diskimage_builder/elements/apt-sources/test-elements/test-sources/extra-data.d/00-write-apt-sources diskimage_builder/elements/apt-sources/test-elements/test-sources/pre-install.d/00-test-apt-sources diskimage_builder/elements/autoupdates/README.rst diskimage_builder/elements/autoupdates/element-deps diskimage_builder/elements/autoupdates/package-installs.yaml diskimage_builder/elements/autoupdates/pkg-map diskimage_builder/elements/autoupdates/post-install.d/82-enable-autoupdate diskimage_builder/elements/autoupdates/root.d/61-create-update-config diskimage_builder/elements/baremetal/README.rst diskimage_builder/elements/baremetal/cleanup.d/99-extract-kernel-and-ramdisk diskimage_builder/elements/base/README.rst diskimage_builder/elements/base/element-deps diskimage_builder/elements/base/pkg-map diskimage_builder/elements/base/environment.d/10-base-defaults diskimage_builder/elements/base/install.d/00-baseline-environment diskimage_builder/elements/base/install.d/00-up-to-date diskimage_builder/elements/base/install.d/10-cloud-init diskimage_builder/elements/base/pre-install.d/03-baseline-tools diskimage_builder/elements/block-device-efi/README.rst diskimage_builder/elements/block-device-efi/block-device-default.yaml diskimage_builder/elements/block-device-efi/element-provides diskimage_builder/elements/block-device-efi-4k/README.rst diskimage_builder/elements/block-device-efi-4k/block-device-default.yaml diskimage_builder/elements/block-device-efi-4k/element-provides diskimage_builder/elements/block-device-efi-4k/environment.d/15-block-device.bash diskimage_builder/elements/block-device-efi-lvm/README.rst diskimage_builder/elements/block-device-efi-lvm/block-device-default.yaml diskimage_builder/elements/block-device-efi-lvm/element-provides diskimage_builder/elements/block-device-efi-lvm/environment.d/15-block-device.bash diskimage_builder/elements/block-device-efi/environment.d/15-block-device.bash diskimage_builder/elements/block-device-gpt/README.rst diskimage_builder/elements/block-device-gpt/block-device-default.yaml diskimage_builder/elements/block-device-gpt/block-device-ppc64el.yaml diskimage_builder/elements/block-device-gpt/element-provides diskimage_builder/elements/block-device-gpt/environment.d/15-block-device.bash diskimage_builder/elements/block-device-mbr/README.rst diskimage_builder/elements/block-device-mbr/block-device-default.yaml diskimage_builder/elements/block-device-mbr/block-device-ppc64el.yaml diskimage_builder/elements/block-device-mbr/element-provides diskimage_builder/elements/block-device-mbr/environment.d/15-block-device.bash diskimage_builder/elements/bootloader/README.rst diskimage_builder/elements/bootloader/pkg-map diskimage_builder/elements/bootloader/environment.d/10-bootloader-default-cmdline diskimage_builder/elements/bootloader/finalise.d/50-bootloader diskimage_builder/elements/cache-url/README.rst diskimage_builder/elements/cache-url/__init__.py diskimage_builder/elements/cache-url/element-deps diskimage_builder/elements/cache-url/package-installs.yaml diskimage_builder/elements/cache-url/pkg-map diskimage_builder/elements/cache-url/bin/cache-url diskimage_builder/elements/cache-url/tests/__init__.py diskimage_builder/elements/cache-url/tests/test_cache_url.py diskimage_builder/elements/centos/README.rst diskimage_builder/elements/centos/element-deps diskimage_builder/elements/centos/element-provides diskimage_builder/elements/centos/package-installs.yaml diskimage_builder/elements/centos-minimal/README.rst diskimage_builder/elements/centos-minimal/element-deps diskimage_builder/elements/centos-minimal/element-provides diskimage_builder/elements/centos-minimal/environment.d/10-centos-distro-name.bash diskimage_builder/elements/centos-minimal/test-elements/10-stream-aarch64-build-succeeds/README.rst diskimage_builder/elements/centos-minimal/test-elements/10-stream-aarch64-build-succeeds/element-deps diskimage_builder/elements/centos-minimal/test-elements/10-stream-aarch64-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/centos-minimal/test-elements/10-stream-build-succeeds/README.rst diskimage_builder/elements/centos-minimal/test-elements/10-stream-build-succeeds/element-deps diskimage_builder/elements/centos-minimal/test-elements/10-stream-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/centos-minimal/test-elements/8-stream-aarch64-build-succeeds/README.rst diskimage_builder/elements/centos-minimal/test-elements/8-stream-aarch64-build-succeeds/element-deps diskimage_builder/elements/centos-minimal/test-elements/8-stream-aarch64-build-succeeds/test-output-formats diskimage_builder/elements/centos-minimal/test-elements/8-stream-aarch64-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/centos-minimal/test-elements/8-stream-build-succeeds/README.rst diskimage_builder/elements/centos-minimal/test-elements/8-stream-build-succeeds/element-deps diskimage_builder/elements/centos-minimal/test-elements/8-stream-build-succeeds/environment.d/09-set-distro.bash diskimage_builder/elements/centos-minimal/test-elements/9-stream-aarch64-build-succeeds/README.rst diskimage_builder/elements/centos-minimal/test-elements/9-stream-aarch64-build-succeeds/element-deps diskimage_builder/elements/centos-minimal/test-elements/9-stream-aarch64-build-succeeds/environment.d/09-set-distro.bash diskimage_builder/elements/centos-minimal/test-elements/9-stream-build-succeeds/README.rst diskimage_builder/elements/centos-minimal/test-elements/9-stream-build-succeeds/element-deps diskimage_builder/elements/centos-minimal/test-elements/9-stream-build-succeeds/environment.d/09-set-distro.bash diskimage_builder/elements/centos-minimal/yum.repos.d/10-stream/appstream.repo diskimage_builder/elements/centos-minimal/yum.repos.d/10-stream/base.repo diskimage_builder/elements/centos-minimal/yum.repos.d/8-stream/appstream.repo diskimage_builder/elements/centos-minimal/yum.repos.d/8-stream/base.repo diskimage_builder/elements/centos-minimal/yum.repos.d/9-stream/appstream.repo diskimage_builder/elements/centos-minimal/yum.repos.d/9-stream/base.repo diskimage_builder/elements/centos/environment.d/10-centos-distro-name.bash diskimage_builder/elements/centos/post-install.d/03-reset-bls-entries diskimage_builder/elements/centos/pre-install.d/00-02-set-centos-mirror diskimage_builder/elements/centos/pre-install.d/02-set-machine-id diskimage_builder/elements/centos/root.d/10-centos-cloud-image diskimage_builder/elements/centos/test-elements/10-stream-build-succeeds/README.rst diskimage_builder/elements/centos/test-elements/10-stream-build-succeeds/element-deps diskimage_builder/elements/centos/test-elements/10-stream-build-succeeds/test-output-formats diskimage_builder/elements/centos/test-elements/10-stream-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/centos/test-elements/8-build-succeeds/README.rst diskimage_builder/elements/centos/test-elements/8-build-succeeds/element-deps diskimage_builder/elements/centos/test-elements/8-build-succeeds/test-output-formats diskimage_builder/elements/centos/test-elements/8-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/centos/test-elements/8-stream-build-succeeds/README.rst diskimage_builder/elements/centos/test-elements/8-stream-build-succeeds/element-deps diskimage_builder/elements/centos/test-elements/8-stream-build-succeeds/test-output-formats diskimage_builder/elements/centos/test-elements/8-stream-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/centos/test-elements/9-stream-build-succeeds/README.rst diskimage_builder/elements/centos/test-elements/9-stream-build-succeeds/element-deps diskimage_builder/elements/centos/test-elements/9-stream-build-succeeds/test-output-formats diskimage_builder/elements/centos/test-elements/9-stream-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/cleanup-kernel-initrd/README.rst diskimage_builder/elements/cleanup-kernel-initrd/cleanup.d/99-cleanup-kernel-initrd diskimage_builder/elements/cloud-init/README.rst diskimage_builder/elements/cloud-init/element-deps diskimage_builder/elements/cloud-init/package-installs.yaml diskimage_builder/elements/cloud-init/pkg-map diskimage_builder/elements/cloud-init-datasources/README.rst diskimage_builder/elements/cloud-init-datasources/install.d/05-set-cloud-init-sources diskimage_builder/elements/cloud-init-disable-resizefs/README.rst diskimage_builder/elements/cloud-init-disable-resizefs/post-install.d/50-cloud-init-disable-resizefs diskimage_builder/elements/cloud-init-disable-resizefs/post-install.d/51-cloud-init-disable-growpart diskimage_builder/elements/cloud-init-growpart/README.rst diskimage_builder/elements/cloud-init-growpart/element-deps diskimage_builder/elements/cloud-init-growpart/package-installs.yaml diskimage_builder/elements/cloud-init-growpart/pkg-map diskimage_builder/elements/cloud-init-growpart/post-install.d/55-growpart diskimage_builder/elements/cloud-init-growpart/releasenotes/notes/added_growpart_for_lvm-0ce76ba71710c720.yaml diskimage_builder/elements/cloud-init-nocloud/README.rst diskimage_builder/elements/cloud-init-nocloud/element-deps diskimage_builder/elements/cloud-init-nocloud/environment.d/10-cloud-init-nocloud.bash diskimage_builder/elements/cloud-init-nocloud/install.d/05-inject-local-source-data diskimage_builder/elements/cloud-init/post-install.d/20-enable-cloud-init diskimage_builder/elements/cloud-init/post-install.d/21-cloud-init-allow-password-auth diskimage_builder/elements/cloud-init/post-install.d/22-cloud-init-ssh_genkeytypes diskimage_builder/elements/containerfile/README.rst diskimage_builder/elements/containerfile/element-provides diskimage_builder/elements/containerfile/root.d/08-containerfile diskimage_builder/elements/containerfile/test-elements/jammy-build-succeeds/README.rst diskimage_builder/elements/containerfile/test-elements/jammy-build-succeeds/element-deps diskimage_builder/elements/containerfile/test-elements/jammy-build-succeeds/test-output-formats diskimage_builder/elements/containerfile/test-elements/jammy-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/containerfile/test-elements/jammy-build-succeeds/environment.d/10-set-file.bash diskimage_builder/elements/containerfile/test-elements/jammy-build-succeeds/files/Dockerfile diskimage_builder/elements/debian/README.rst diskimage_builder/elements/debian/element-deps diskimage_builder/elements/debian/package-installs.yaml diskimage_builder/elements/debian-minimal/README.rst diskimage_builder/elements/debian-minimal/element-deps diskimage_builder/elements/debian-minimal/element-provides diskimage_builder/elements/debian-minimal/package-installs.yaml diskimage_builder/elements/debian-minimal/environment.d/10-debian-minimal.bash diskimage_builder/elements/debian-minimal/root.d/75-debian-minimal-baseinstall diskimage_builder/elements/debian-minimal/test-elements/bookworm-arm64-build-succeeds/README.rst diskimage_builder/elements/debian-minimal/test-elements/bookworm-arm64-build-succeeds/element-deps diskimage_builder/elements/debian-minimal/test-elements/bookworm-arm64-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/debian-minimal/test-elements/bullseye-arm64-build-succeeds/README.rst diskimage_builder/elements/debian-minimal/test-elements/bullseye-arm64-build-succeeds/element-deps diskimage_builder/elements/debian-minimal/test-elements/bullseye-arm64-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/debian-systemd/README.rst diskimage_builder/elements/debian-systemd/element-deps diskimage_builder/elements/debian-systemd/root.d/05-debian-systemd diskimage_builder/elements/debian-upstart/README.rst diskimage_builder/elements/debian-upstart/element-deps diskimage_builder/elements/debian-upstart/root.d/05-debian-upstart diskimage_builder/elements/debian-upstart/root.d/20-debian-fix-upstart-jobs diskimage_builder/elements/debian/install.d/10-cloud-opinions diskimage_builder/elements/debian/test-elements/build-succeeds/README.rst diskimage_builder/elements/debian/test-elements/build-succeeds/element-deps diskimage_builder/elements/debian/test-elements/build-succeeds/environment.d/09-debian-stable diskimage_builder/elements/debootstrap/README.rst diskimage_builder/elements/debootstrap/element-deps diskimage_builder/elements/debootstrap/package-installs.yaml diskimage_builder/elements/debootstrap/pkg-map diskimage_builder/elements/debootstrap/cleanup.d/99-clean-up-cache diskimage_builder/elements/debootstrap/environment.d/10-debootstrap-default-locale diskimage_builder/elements/debootstrap/environment.d/20-network-interface-names diskimage_builder/elements/debootstrap/install.d/10-debian-networking diskimage_builder/elements/debootstrap/install.d/12-debian-locale-gen diskimage_builder/elements/debootstrap/install.d/15-cleanup-debootstrap diskimage_builder/elements/debootstrap/root.d/08-debootstrap diskimage_builder/elements/deploy-baremetal/README.rst diskimage_builder/elements/deploy-baremetal/element-deps diskimage_builder/elements/deploy-baremetal/package-installs.yaml diskimage_builder/elements/deploy-baremetal/binary-deps.d/deploy diskimage_builder/elements/deploy-baremetal/init.d/80-deploy diskimage_builder/elements/deploy-kexec/README.rst diskimage_builder/elements/deploy-kexec/element-deps diskimage_builder/elements/deploy-kexec/package-installs.yaml diskimage_builder/elements/deploy-kexec/binary-deps.d/deploy-kexec diskimage_builder/elements/deploy-kexec/init.d/81-deploy-kexec diskimage_builder/elements/deploy-targetcli/README.rst diskimage_builder/elements/deploy-targetcli/element-deps diskimage_builder/elements/deploy-targetcli/package-installs.yaml diskimage_builder/elements/deploy-targetcli/binary-deps.d/deploy-targetcli diskimage_builder/elements/deploy-targetcli/dracut-drivers.d/targetcli-drivers diskimage_builder/elements/deploy-targetcli/extra-data.d/50-add-targetcli-module diskimage_builder/elements/deploy-targetcli/extra-data.d/module/iscsi-func diskimage_builder/elements/deploy-targetcli/extra-data.d/module/module-setup.sh diskimage_builder/elements/deploy-targetcli/extra-data.d/module/targetcli-wrapper diskimage_builder/elements/deploy-tgtadm/README.rst diskimage_builder/elements/deploy-tgtadm/package-installs.yaml diskimage_builder/elements/deploy-tgtadm/binary-deps.d/deploy-tgtadm diskimage_builder/elements/deploy-tgtadm/extra-data.d/50-inject-tgtadm-iscsi-func diskimage_builder/elements/deploy-tgtadm/extra-data.d/scripts/iscsi-func diskimage_builder/elements/devuser/README.rst diskimage_builder/elements/devuser/element-deps diskimage_builder/elements/devuser/package-installs.yaml diskimage_builder/elements/devuser/pkg-map diskimage_builder/elements/devuser/environment.d/50-devuser diskimage_builder/elements/devuser/extra-data.d/50-devuser diskimage_builder/elements/devuser/install.d/50-devuser diskimage_builder/elements/dhcp-all-interfaces/README.rst diskimage_builder/elements/dhcp-all-interfaces/element-deps diskimage_builder/elements/dhcp-all-interfaces/package-installs.yaml diskimage_builder/elements/dhcp-all-interfaces/pkg-map diskimage_builder/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces diskimage_builder/elements/dhcp-all-interfaces/install.d/60-remove-cloud-image-interfaces diskimage_builder/elements/dhcp-all-interfaces/install.d/NetworkManager-conf.d-00-main.conf diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces-udev.rules diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces.conf diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces.init diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces.sh diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-interface@.service diskimage_builder/elements/dib-init-system/README.rst diskimage_builder/elements/dib-init-system/environment.d/99-dib-init-system diskimage_builder/elements/dib-init-system/install.d/20-install-init-scripts diskimage_builder/elements/dib-init-system/post-install.d/10-enable-init-scripts diskimage_builder/elements/dib-init-system/pre-install.d/04-dib-init-system diskimage_builder/elements/dib-python/README.rst diskimage_builder/elements/dib-python/cleanup.d/50-dib-python diskimage_builder/elements/dib-python/environment.d/50-dib-python-version diskimage_builder/elements/dib-python/pre-install.d/01-dib-python diskimage_builder/elements/dib-run-parts/README.rst diskimage_builder/elements/dib-run-parts/package-installs.yaml diskimage_builder/elements/disable-nouveau/README.rst diskimage_builder/elements/disable-nouveau/element-deps diskimage_builder/elements/disable-nouveau/dracut.conf.d/disable-nouveau.conf diskimage_builder/elements/disable-nouveau/modprobe.d/disable-nouveau.conf diskimage_builder/elements/disable-selinux/README.rst diskimage_builder/elements/disable-selinux/post-install.d/15-disable-selinux diskimage_builder/elements/dkms/README.rst diskimage_builder/elements/dkms/element-deps diskimage_builder/elements/dkms/package-installs.yaml diskimage_builder/elements/dkms/post-install.d/97-dkms diskimage_builder/elements/docker/README.rst diskimage_builder/elements/docker/element-provides diskimage_builder/elements/docker/extra-data.d/01-docker-minimal diskimage_builder/elements/docker/root.d/08-docker diskimage_builder/elements/dpkg/README.rst diskimage_builder/elements/dpkg/element-deps diskimage_builder/elements/dpkg/bin/install-packages diskimage_builder/elements/dpkg/cleanup.d/40-unblock-daemons diskimage_builder/elements/dpkg/cleanup.d/50-remove-img-build-proxy diskimage_builder/elements/dpkg/cleanup.d/60-untrim-dpkg diskimage_builder/elements/dpkg/environment.d/10-dpkg.bash diskimage_builder/elements/dpkg/finalise.d/99-clean-up-cache diskimage_builder/elements/dpkg/finalise.d/99-write-dpkg-manifest diskimage_builder/elements/dpkg/pre-install.d/00-disable-apt-recommends diskimage_builder/elements/dpkg/pre-install.d/99-apt-get-update diskimage_builder/elements/dpkg/root.d/09-apt-keyring diskimage_builder/elements/dpkg/root.d/50-block-apt-translations diskimage_builder/elements/dpkg/root.d/50-block-daemons diskimage_builder/elements/dpkg/root.d/50-build-with-http-cache diskimage_builder/elements/dpkg/root.d/50-shared-apt-cache diskimage_builder/elements/dpkg/root.d/50-trim-dpkg diskimage_builder/elements/dracut-network/README.rst diskimage_builder/elements/dracut-ramdisk/README.rst diskimage_builder/elements/dracut-ramdisk/element-deps diskimage_builder/elements/dracut-ramdisk/pkg-map diskimage_builder/elements/dracut-ramdisk/source-repository-dracut diskimage_builder/elements/dracut-ramdisk/binary-deps.d/dracut-ramdisk diskimage_builder/elements/dracut-ramdisk/dracut-drivers.d/base-drivers diskimage_builder/elements/dracut-ramdisk/environment.d/10-dracut-version.bash diskimage_builder/elements/dracut-ramdisk/extra-data.d/scripts/module/deploy-cmdline.sh diskimage_builder/elements/dracut-ramdisk/extra-data.d/scripts/module/module-setup.sh diskimage_builder/elements/dracut-ramdisk/init.d/00-override-troubleshoot diskimage_builder/elements/dracut-ramdisk/install.d/20-install-dracut-deps diskimage_builder/elements/dracut-ramdisk/post-install.d/01-ensure-drivers diskimage_builder/elements/dracut-ramdisk/post-install.d/99-build-dracut-ramdisk diskimage_builder/elements/dracut-regenerate/README.rst diskimage_builder/elements/dracut-regenerate/element-deps diskimage_builder/elements/dracut-regenerate/package-installs.yaml diskimage_builder/elements/dracut-regenerate/pkg-map diskimage_builder/elements/dracut-regenerate/environment.d/10-dracut-regenerate diskimage_builder/elements/dracut-regenerate/extra-data.d/50-dracut-conf diskimage_builder/elements/dracut-regenerate/finalise.d/50-dracut-regenerate diskimage_builder/elements/dynamic-login/README.rst diskimage_builder/elements/dynamic-login/element-deps diskimage_builder/elements/dynamic-login/init-scripts/systemd/dynamic-login.service diskimage_builder/elements/dynamic-login/init-scripts/sysv/dynamic-login.init diskimage_builder/elements/dynamic-login/init-scripts/upstart/dynamic-login.conf diskimage_builder/elements/dynamic-login/install.d/70-enable-dynamic-login-services diskimage_builder/elements/dynamic-login/static/usr/local/bin/dynamic-login diskimage_builder/elements/element-manifest/README.rst diskimage_builder/elements/element-manifest/element-deps diskimage_builder/elements/element-manifest/extra-data.d/75-inject-element-manifest diskimage_builder/elements/elrepo/README.rst diskimage_builder/elements/elrepo/pre-install.d/01-elrepo diskimage_builder/elements/enable-serial-console/README.rst diskimage_builder/elements/enable-serial-console/cleanup.d/99-fix-grub diskimage_builder/elements/enable-serial-console/install.d/20-stty diskimage_builder/elements/enable-serial-console/install.d/serial-console-udev.rules diskimage_builder/elements/enable-serial-console/install.d/ttySx.conf diskimage_builder/elements/ensure-venv/README.rst diskimage_builder/elements/ensure-venv/element-deps diskimage_builder/elements/ensure-venv/package-installs.yaml diskimage_builder/elements/ensure-venv/pkg-map diskimage_builder/elements/epel/README.rst diskimage_builder/elements/epel/element-deps diskimage_builder/elements/epel/package-installs.yaml diskimage_builder/elements/epel/pkg-map diskimage_builder/elements/epel/pre-install.d/05-rpm-epel-release diskimage_builder/elements/fail2ban/README.rst diskimage_builder/elements/fail2ban/element-deps diskimage_builder/elements/fail2ban/package-installs.yaml diskimage_builder/elements/fail2ban/post-install.d/80-enable-fail2ban-service diskimage_builder/elements/fail2ban/root.d/60-copy-fail2ban-config diskimage_builder/elements/fedora/README.rst diskimage_builder/elements/fedora/element-deps diskimage_builder/elements/fedora/element-provides diskimage_builder/elements/fedora/package-installs.yaml diskimage_builder/elements/fedora-container/README.rst diskimage_builder/elements/fedora-container/element-deps diskimage_builder/elements/fedora-container/package-installs.yaml diskimage_builder/elements/fedora-container/pkg-map diskimage_builder/elements/fedora-container/containerfiles/34 diskimage_builder/elements/fedora-container/containerfiles/35 diskimage_builder/elements/fedora-container/containerfiles/36 diskimage_builder/elements/fedora-container/containerfiles/37 diskimage_builder/elements/fedora-container/environment.d/10-01-fedora-distro-name.bash diskimage_builder/elements/fedora-container/environment.d/11-yum-dnf.bash diskimage_builder/elements/fedora-container/test-elements/build-succeeds/README.rst diskimage_builder/elements/fedora-container/test-elements/build-succeeds/element-deps diskimage_builder/elements/fedora-minimal/README.rst diskimage_builder/elements/fedora-minimal/element-deps diskimage_builder/elements/fedora-minimal/element-provides diskimage_builder/elements/fedora-minimal/environment.d/10-fedora-distro-name.bash diskimage_builder/elements/fedora-minimal/environment.d/11-yum-dnf.bash diskimage_builder/elements/fedora-minimal/test-elements/build-succeeds/README.rst diskimage_builder/elements/fedora-minimal/test-elements/build-succeeds/element-deps diskimage_builder/elements/fedora-minimal/yum.repos.d/yum.repo diskimage_builder/elements/fedora/environment.d/10-fedora-distro-name.bash diskimage_builder/elements/fedora/environment.d/11-yum-dnf.bash diskimage_builder/elements/fedora/pre-install.d/00-02-set-fedora-mirror diskimage_builder/elements/fedora/pre-install.d/02-set-machine-id diskimage_builder/elements/fedora/root.d/10-fedora-cloud-image diskimage_builder/elements/fedora/test-elements/build-succeeds/element-deps diskimage_builder/elements/fips/README.rst diskimage_builder/elements/fips/package-installs.yaml diskimage_builder/elements/fips/pre-install.d/01-setup-fips diskimage_builder/elements/gentoo/README.rst diskimage_builder/elements/gentoo/element-deps diskimage_builder/elements/gentoo/element-provides diskimage_builder/elements/gentoo/package-installs.yaml diskimage_builder/elements/gentoo/bin/fix_shm diskimage_builder/elements/gentoo/bin/install-packages diskimage_builder/elements/gentoo/bin/unfix_shm diskimage_builder/elements/gentoo/cleanup.d/05-unmount diskimage_builder/elements/gentoo/environment.d/00-gentoo-envars.bash diskimage_builder/elements/gentoo/extra-data.d/gentoo-releng.gpg diskimage_builder/elements/gentoo/post-install.d/99-cleanup diskimage_builder/elements/gentoo/pre-finalise.d/01-gentoo-cache diskimage_builder/elements/gentoo/pre-install.d/02-gentoo-00-set-profile diskimage_builder/elements/gentoo/pre-install.d/02-gentoo-01-migrate-pax diskimage_builder/elements/gentoo/pre-install.d/02-gentoo-02-flags diskimage_builder/elements/gentoo/pre-install.d/02-gentoo-03-enable-overlays diskimage_builder/elements/gentoo/pre-install.d/02-gentoo-04-install-desired-python diskimage_builder/elements/gentoo/root.d/10-gentoo-image diskimage_builder/elements/gentoo/root.d/50-gentoo-cache diskimage_builder/elements/gentoo/test-elements/build-succeeds/README.rst diskimage_builder/elements/gentoo/test-elements/build-succeeds/element-deps diskimage_builder/elements/growroot/README.rst diskimage_builder/elements/growroot/element-deps diskimage_builder/elements/growroot/package-installs.yaml diskimage_builder/elements/growroot/pkg-map diskimage_builder/elements/growroot/init-scripts/openrc/growroot diskimage_builder/elements/growroot/init-scripts/systemd/growroot.service diskimage_builder/elements/growroot/init-scripts/upstart/growroot.conf diskimage_builder/elements/growroot/post-install.d/80-growroot diskimage_builder/elements/growroot/static/usr/local/sbin/growroot diskimage_builder/elements/growvols/README.rst diskimage_builder/elements/growvols/__init__.py diskimage_builder/elements/growvols/element-deps diskimage_builder/elements/growvols/package-installs.yaml diskimage_builder/elements/growvols/environment.d/15-growvols diskimage_builder/elements/growvols/init-scripts/systemd/growvols.service diskimage_builder/elements/growvols/post-install.d/80-growvols diskimage_builder/elements/growvols/static/usr/local/sbin/growvols diskimage_builder/elements/growvols/tests/__init__.py diskimage_builder/elements/growvols/tests/test_growvols.py diskimage_builder/elements/grub2/README.rst diskimage_builder/elements/grub2/package-installs.yaml diskimage_builder/elements/grub2/pkg-map diskimage_builder/elements/grub2/post-install.d/01-delete-grubenv diskimage_builder/elements/hpdsa/README.rst diskimage_builder/elements/hpdsa/package-installs.yaml diskimage_builder/elements/hpdsa/post-install.d/95-hpdsa diskimage_builder/elements/hpdsa/post-install.d/98-hpdsa-post-dkms diskimage_builder/elements/hpdsa/pre-install.d/06-hpdsa diskimage_builder/elements/hpdsa/root.d/10-hpdsa-check-distro diskimage_builder/elements/hwburnin/README.rst diskimage_builder/elements/hwburnin/binary-deps.d/hwburnin diskimage_builder/elements/hwburnin/init.d/70-hwburnin diskimage_builder/elements/hwdiscovery/README.rst diskimage_builder/elements/hwdiscovery/element-deps diskimage_builder/elements/hwdiscovery/package-installs.yaml diskimage_builder/elements/hwdiscovery/binary-deps.d/hwdiscovery diskimage_builder/elements/hwdiscovery/init.d/60-hwdiscovery diskimage_builder/elements/ibft-interfaces/README.rst diskimage_builder/elements/ibft-interfaces/element-deps diskimage_builder/elements/ibft-interfaces/package-installs.yaml diskimage_builder/elements/ibft-interfaces/pkg-map diskimage_builder/elements/ibft-interfaces/init-scripts/systemd/init-ibft-interfaces.service diskimage_builder/elements/ibft-interfaces/init-scripts/sysv/init-ibft-interfaces.init diskimage_builder/elements/ibft-interfaces/init-scripts/upstart/init-ibft-interfaces.conf diskimage_builder/elements/ibft-interfaces/post-install.d/70-init-ibft-interfaces diskimage_builder/elements/ibft-interfaces/static/etc/modules-load.d/ibft.conf diskimage_builder/elements/ibft-interfaces/static/usr/local/sbin/init-ibft-interfaces.sh diskimage_builder/elements/ilo/README.rst diskimage_builder/elements/ilo/extra-data.d/50-ilo-firmware diskimage_builder/elements/ilo/init.d/50-ilo-firmware diskimage_builder/elements/ilo/ramdisk-install.d/50-ilo-firmware diskimage_builder/elements/install-bin/README.rst diskimage_builder/elements/install-bin/pre-install.d/01-install-bin diskimage_builder/elements/install-static/README.rst diskimage_builder/elements/install-static/element-deps diskimage_builder/elements/install-static/package-installs.yaml diskimage_builder/elements/install-static/pkg-map diskimage_builder/elements/install-static/install.d/10-install-static-files diskimage_builder/elements/install-types/README.rst diskimage_builder/elements/install-types/extra-data.d/99-enable-install-types diskimage_builder/elements/iscsi-boot/README.rst diskimage_builder/elements/iscsi-boot/element-deps diskimage_builder/elements/iscsi-boot/package-installs.yaml diskimage_builder/elements/iscsi-boot/environment.d/open-iscsi-config diskimage_builder/elements/iscsi-boot/extra-data.d/50-check-dracut-regenerate diskimage_builder/elements/iscsi-boot/finalise.d/51-open-iscsi-config diskimage_builder/elements/iscsi-boot/post-install.d/open-iscsi-config diskimage_builder/elements/iso/README.rst diskimage_builder/elements/iso/element-deps diskimage_builder/elements/iso/package-installs.yaml diskimage_builder/elements/iso/pkg-map diskimage_builder/elements/iso/cleanup.d/100-build-iso diskimage_builder/elements/iso/post-install.d/01-copy-bootloaders diskimage_builder/elements/journal-to-console/README.rst diskimage_builder/elements/journal-to-console/post-install.d/30-journal-to-console diskimage_builder/elements/keylime-agent/README.rst diskimage_builder/elements/keylime-agent/element-deps diskimage_builder/elements/keylime-agent/package-installs.yaml diskimage_builder/elements/keylime-agent/source-repository-keylime diskimage_builder/elements/keylime-agent/cleanup.d/98-copy-allowlist diskimage_builder/elements/keylime-agent/environment.d/16-keylime-agent diskimage_builder/elements/keylime-agent/install.d/keylime-agent-source-install/80-keylime-agent-install diskimage_builder/elements/keylime-agent/install.d/keylime-agent-source-install/ima-policy diskimage_builder/elements/keylime-agent/install.d/keylime-agent-source-install/keylime-agent.init diskimage_builder/elements/keylime-agent/install.d/keylime-agent-source-install/keylime-agent.service diskimage_builder/elements/keylime-agent/post-install.d/90-keylime-agent diskimage_builder/elements/local-config/README.rst diskimage_builder/elements/local-config/element-deps diskimage_builder/elements/local-config/environment.d/62-ssh-key diskimage_builder/elements/local-config/extra-data.d/62-ssh-key diskimage_builder/elements/local-config/install.d/62-ssh-key diskimage_builder/elements/local-config/pre-install.d/02-proxy-settings diskimage_builder/elements/lvm/README.rst diskimage_builder/elements/lvm/element-deps diskimage_builder/elements/lvm/package-installs.yaml diskimage_builder/elements/lvm/finalise.d/60-bootloader diskimage_builder/elements/lvm/root.d/10-lvm-check-distro diskimage_builder/elements/manifests/README.rst diskimage_builder/elements/manifests/cleanup.d/01-copy-manifests-dir diskimage_builder/elements/manifests/environment.d/14-manifests diskimage_builder/elements/manifests/extra-data.d/20-manifest-dir diskimage_builder/elements/mellanox/README.rst diskimage_builder/elements/mellanox/element-deps diskimage_builder/elements/mellanox/package-installs.yaml diskimage_builder/elements/mellanox/pkg-map diskimage_builder/elements/mellanox/init.d/01-mellanox diskimage_builder/elements/mellanox/install.d/65-mellanox diskimage_builder/elements/mellanox/install.d/mellanox-rules.udev diskimage_builder/elements/mellanox/udev.d/81-mellanox-drivers.rules diskimage_builder/elements/modprobe/README.rst diskimage_builder/elements/modprobe-blacklist/README.rst diskimage_builder/elements/modprobe-blacklist/install.d/80-modprobe-blacklist diskimage_builder/elements/modprobe/extra-data.d/50-modprobe-blacklist diskimage_builder/elements/modprobe/install.d/80-modprobe-blacklist diskimage_builder/elements/nm-dhcp-ib-interfaces/README.rst diskimage_builder/elements/nm-dhcp-ib-interfaces/install.d/50-dhcp-ib-interfaces diskimage_builder/elements/nm-dhcp-ib-interfaces/install.d/NetworkManager-system-connections-infiniband.nmconnection diskimage_builder/elements/no-final-image/README.rst diskimage_builder/elements/oat-client/README.rst diskimage_builder/elements/oat-client/element-deps diskimage_builder/elements/oat-client/package-installs.yaml diskimage_builder/elements/oat-client/yum.repos.d/fedora-oat.repo diskimage_builder/elements/openeuler-minimal/README.rst diskimage_builder/elements/openeuler-minimal/element-deps diskimage_builder/elements/openeuler-minimal/element-provides diskimage_builder/elements/openeuler-minimal/package-installs.yaml diskimage_builder/elements/openeuler-minimal/environment.d/10-openeuler-distro-name.bash diskimage_builder/elements/openeuler-minimal/environment.d/11-yum-dnf.bash diskimage_builder/elements/openeuler-minimal/pre-install.d/00-setup-mirror diskimage_builder/elements/openeuler-minimal/root.d/00-00-generate-repo diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/README.rst diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/element-deps diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/test-output-formats diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/openssh-server/README.rst diskimage_builder/elements/openssh-server/element-deps diskimage_builder/elements/openssh-server/package-installs.yaml diskimage_builder/elements/openssh-server/pkg-map diskimage_builder/elements/openssh-server/post-install.d/80-enable-sshd-service diskimage_builder/elements/openssh-server/post-install.d/99-harden-sshd-config diskimage_builder/elements/openstack-ci-mirrors/README.rst diskimage_builder/elements/openstack-ci-mirrors/environment.d/11-dib-distribution-mirror.bash diskimage_builder/elements/openstack-ci-mirrors/extra-data.d/75-copy-mirror-info diskimage_builder/elements/openstack-ci-mirrors/root.d/10-apt-disable-gpg diskimage_builder/elements/opensuse/README.rst diskimage_builder/elements/opensuse/element-deps diskimage_builder/elements/opensuse/element-provides diskimage_builder/elements/opensuse/package-installs.yaml diskimage_builder/elements/opensuse-minimal/README.rst diskimage_builder/elements/opensuse-minimal/element-deps diskimage_builder/elements/opensuse-minimal/element-provides diskimage_builder/elements/opensuse-minimal/environment.d/10-opensuse-distro-name.bash diskimage_builder/elements/opensuse-minimal/test-elements/opensuse15-build-succeeds/README.rst diskimage_builder/elements/opensuse-minimal/test-elements/opensuse15-build-succeeds/element-deps diskimage_builder/elements/opensuse-minimal/test-elements/opensuse15-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/opensuse/environment.d/10-opensuse-distro-name.bash diskimage_builder/elements/opensuse/extra-data.d/01-inject-defaults diskimage_builder/elements/opensuse/root.d/10-opensuse-cloud-image diskimage_builder/elements/opensuse/test-elements/build-succeeds/README.rst diskimage_builder/elements/opensuse/test-elements/build-succeeds/element-deps diskimage_builder/elements/opensuse/test-elements/opensuse15-build-succeeds/README.rst diskimage_builder/elements/opensuse/test-elements/opensuse15-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/package-installs/README.rst diskimage_builder/elements/package-installs/__init__.py diskimage_builder/elements/package-installs/element-deps diskimage_builder/elements/package-installs/bin/package-installs diskimage_builder/elements/package-installs/bin/package-installs-squash diskimage_builder/elements/package-installs/bin/package-installs-v2 diskimage_builder/elements/package-installs/bin/package-uninstalls diskimage_builder/elements/package-installs/extra-data.d/99-squash-package-install diskimage_builder/elements/package-installs/install.d/01-package-installs diskimage_builder/elements/package-installs/install.d/99-package-uninstalls diskimage_builder/elements/package-installs/post-install.d/00-package-installs diskimage_builder/elements/package-installs/post-install.d/95-package-uninstalls diskimage_builder/elements/package-installs/pre-install.d/10-package-installs diskimage_builder/elements/package-installs/pre-install.d/99-package-uninstalls diskimage_builder/elements/package-installs/tests/__init__.py diskimage_builder/elements/package-installs/tests/test_package_squash.py diskimage_builder/elements/pip-and-virtualenv/README.rst diskimage_builder/elements/pip-and-virtualenv/element-deps diskimage_builder/elements/pip-and-virtualenv/package-installs.yaml diskimage_builder/elements/pip-and-virtualenv/pkg-map diskimage_builder/elements/pip-and-virtualenv/source-repository-pip-and-virtualenv diskimage_builder/elements/pip-and-virtualenv/environment.d/51-pip-and-virutalenv-default.bash diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip diskimage_builder/elements/pip-and-virtualenv/post-install.d/89-clean-up-pip-cache diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-fedora/element-deps diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-fedora/environment.d/10-source-installtype-pip-and-virtualenv diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-opensuse/element-deps diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-opensuse/environment.d/10-source-installtype-pip-and-virtualenv diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-ubuntu/element-deps diskimage_builder/elements/pip-and-virtualenv/test-elements/source-install-ubuntu/environment.d/10-source-installtype-pip-and-virtualenv diskimage_builder/elements/pip-cache/README.rst diskimage_builder/elements/pip-cache/environment.d/10-pip-cache diskimage_builder/elements/pip-cache/root.d/11-pip-cache diskimage_builder/elements/pkg-map/README.rst diskimage_builder/elements/pkg-map/bin/pkg-map diskimage_builder/elements/pkg-map/extra-data.d/10-create-pkg-map-dir diskimage_builder/elements/posix/README.rst diskimage_builder/elements/posix/element-deps diskimage_builder/elements/posix/package-installs.yaml diskimage_builder/elements/posix/pkg-map diskimage_builder/elements/proliant-tools/README.rst diskimage_builder/elements/proliant-tools/element-deps diskimage_builder/elements/proliant-tools/package-installs.yaml diskimage_builder/elements/proliant-tools/pkg-map diskimage_builder/elements/proliant-tools/install.d/65-proliant-tools-install diskimage_builder/elements/pypi/README.rst diskimage_builder/elements/pypi/extra-data.d/00-mount-pypi-mirror diskimage_builder/elements/pypi/post-install.d/00-unconfigure-pypi-mirror diskimage_builder/elements/pypi/pre-install.d/04-configure-pypi-mirror diskimage_builder/elements/python-brickclient/README.rst diskimage_builder/elements/python-brickclient/element-deps diskimage_builder/elements/python-brickclient/package-installs.yaml diskimage_builder/elements/python-brickclient/pkg-map diskimage_builder/elements/python-brickclient/post-install.d/55-brick-client-install diskimage_builder/elements/python-stow-versions/README.rst diskimage_builder/elements/python-stow-versions/element-deps diskimage_builder/elements/python-stow-versions/package-installs.yaml diskimage_builder/elements/python-stow-versions/pkg-map diskimage_builder/elements/python-stow-versions/source-repository-pyenv diskimage_builder/elements/python-stow-versions/install.d/70-python-build diskimage_builder/elements/python-stow-versions/post-install.d/70-python-build diskimage_builder/elements/python-stow-versions/test-elements/test-python-stow/element-deps diskimage_builder/elements/python-stow-versions/test-elements/test-python-stow/environment.d/70-test-python-stow.bash diskimage_builder/elements/python-stow-versions/test-elements/test-python-stow/install.d/69-test-python-stow diskimage_builder/elements/python-stow-versions/test-elements/test-python-stow/install.d/71-test-python-stow diskimage_builder/elements/ramdisk/README.rst diskimage_builder/elements/ramdisk/element-deps diskimage_builder/elements/ramdisk/pkg-map diskimage_builder/elements/ramdisk-base/README.rst diskimage_builder/elements/ramdisk-base/cleanup.d/99-extract-ramdisk-files diskimage_builder/elements/ramdisk-base/extra-data.d/01-inject-ramdisk-build-files diskimage_builder/elements/ramdisk-base/extra-data.d/scripts/init diskimage_builder/elements/ramdisk-base/extra-data.d/scripts/init-end diskimage_builder/elements/ramdisk-base/extra-data.d/scripts/d/init-func diskimage_builder/elements/ramdisk-base/init.d/20-init-variables diskimage_builder/elements/ramdisk-base/init.d/40-check-network-ready diskimage_builder/elements/ramdisk-base/post-install.d/01-ensure-binaries diskimage_builder/elements/ramdisk-base/udev.d/60-persistent-storage.rules diskimage_builder/elements/ramdisk/binary-deps.d/ramdisk diskimage_builder/elements/ramdisk/init.d/10-start-base-system diskimage_builder/elements/ramdisk/init.d/30-start-network diskimage_builder/elements/ramdisk/install.d/20-install-dhcp-client diskimage_builder/elements/ramdisk/install.d/52-ramdisk-install-busybox diskimage_builder/elements/ramdisk/post-install.d/99-build-ramdisk diskimage_builder/elements/rax-nova-agent/README.rst diskimage_builder/elements/rax-nova-agent/element-deps diskimage_builder/elements/rax-nova-agent/package-installs.yaml diskimage_builder/elements/rax-nova-agent/source-repository-nova-agent diskimage_builder/elements/rax-nova-agent/source-repository-xen-tools diskimage_builder/elements/rax-nova-agent/install.d/05-xen-tools diskimage_builder/elements/rax-nova-agent/install.d/10-nova-agent diskimage_builder/elements/redhat-common/README.rst diskimage_builder/elements/redhat-common/element-deps diskimage_builder/elements/redhat-common/package-installs.yaml diskimage_builder/elements/redhat-common/bin/map-packages diskimage_builder/elements/redhat-common/environment.d/50-redhat-common diskimage_builder/elements/redhat-common/finalise.d/01-clean-old-kernels diskimage_builder/elements/replace-partition/README.rst diskimage_builder/elements/replace-partition/element-deps diskimage_builder/elements/replace-partition/element-provides diskimage_builder/elements/replace-partition-redhat/README.rst diskimage_builder/elements/replace-partition-redhat/element-deps diskimage_builder/elements/replace-partition-redhat/environment.d/09-replace-partition-redhat.bash diskimage_builder/elements/replace-partition/environment.d/10-replace-partition.bash diskimage_builder/elements/replace-partition/root.d/10-local-image-extract diskimage_builder/elements/rhel/README.rst diskimage_builder/elements/rhel/element-deps diskimage_builder/elements/rhel/element-provides diskimage_builder/elements/rhel/package-installs.yaml diskimage_builder/elements/rhel-common/README.rst diskimage_builder/elements/rhel-common/finalise.d/60-unregister diskimage_builder/elements/rhel-common/install.d/10-openstack-selinux-rhel diskimage_builder/elements/rhel-common/os-refresh-config/pre-configure.d/06-rhel-registration diskimage_builder/elements/rhel-common/pre-install.d/00-rhel-registration diskimage_builder/elements/rhel-common/pre-install.d/00-rhsm diskimage_builder/elements/rhel-common/pre-install.d/10-rhel-blacklist diskimage_builder/elements/rhel/environment.d/10-rhel-distro-name.bash diskimage_builder/elements/rhel/post-install.d/03-reset-bls-entries diskimage_builder/elements/rhel/pre-install.d/02-set-machine-id diskimage_builder/elements/rhel/root.d/10-rhel-cloud-image diskimage_builder/elements/rocky-container/README.rst diskimage_builder/elements/rocky-container/element-deps diskimage_builder/elements/rocky-container/package-installs.yaml diskimage_builder/elements/rocky-container/containerfiles/10 diskimage_builder/elements/rocky-container/containerfiles/8 diskimage_builder/elements/rocky-container/containerfiles/9 diskimage_builder/elements/rocky-container/environment.d/10-01-rocky-distro-name.bash diskimage_builder/elements/rocky-container/environment.d/11-yum-dnf.bash diskimage_builder/elements/rocky-container/test-elements/build-succeeds/README.rst diskimage_builder/elements/rocky-container/test-elements/build-succeeds/element-deps diskimage_builder/elements/rocky-container/test-elements/rocky-10-aarch64-build-succeeds/README.rst diskimage_builder/elements/rocky-container/test-elements/rocky-10-aarch64-build-succeeds/element-deps diskimage_builder/elements/rocky-container/test-elements/rocky-10-aarch64-build-succeeds/environment.d/09-set-distro.bash diskimage_builder/elements/rocky-container/test-elements/rocky-10-build-succeeds/README.rst diskimage_builder/elements/rocky-container/test-elements/rocky-10-build-succeeds/element-deps diskimage_builder/elements/rocky-container/test-elements/rocky-10-build-succeeds/environment.d/09-set-distro.bash diskimage_builder/elements/rocky-container/test-elements/rocky-9-aarch64-build-succeeds/README.rst diskimage_builder/elements/rocky-container/test-elements/rocky-9-aarch64-build-succeeds/element-deps diskimage_builder/elements/rocky-container/test-elements/rocky-9-aarch64-build-succeeds/environment.d/09-set-distro.bash diskimage_builder/elements/rocky-container/test-elements/rocky-9-build-succeeds/README.rst diskimage_builder/elements/rocky-container/test-elements/rocky-9-build-succeeds/element-deps diskimage_builder/elements/rocky-container/test-elements/rocky-9-build-succeeds/environment.d/09-set-distro.bash diskimage_builder/elements/rpm-distro/README.rst diskimage_builder/elements/rpm-distro/element-deps diskimage_builder/elements/rpm-distro/post-install.d/06-network-config-nonzeroconf diskimage_builder/elements/rpm-distro/pre-install.d/00-fix-requiretty diskimage_builder/elements/rpm-distro/pre-install.d/00-usr-local-bin-secure-path diskimage_builder/elements/rpm-distro/pre-install.d/01-override-yum-arch diskimage_builder/elements/runtime-ssh-host-keys/README.rst diskimage_builder/elements/runtime-ssh-host-keys/element-deps diskimage_builder/elements/runtime-ssh-host-keys/package-installs.yaml diskimage_builder/elements/runtime-ssh-host-keys/pkg-map diskimage_builder/elements/runtime-ssh-host-keys/cleanup.d/90-remove-ssh-host-keys diskimage_builder/elements/runtime-ssh-host-keys/init-scripts/systemd/ssh-keygen.service diskimage_builder/elements/runtime-ssh-host-keys/init-scripts/upstart/ssh-keygen.conf diskimage_builder/elements/runtime-ssh-host-keys/post-install.d/80-ssh-keygen diskimage_builder/elements/runtime-ssh-host-keys/static/usr/local/sbin/runtime-ssh-host-keys.sh diskimage_builder/elements/select-boot-kernel-initrd/README.rst diskimage_builder/elements/select-boot-kernel-initrd/bin/select-boot-kernel-initrd diskimage_builder/elements/select-boot-kernel-initrd/cleanup.d/99-remove-dib-img-functions diskimage_builder/elements/select-boot-kernel-initrd/extra-data.d/99-copy-dib-img-functions diskimage_builder/elements/selinux-fixfiles-restore/README.rst diskimage_builder/elements/selinux-fixfiles-restore/cleanup.d/99-selinux-fixfiles-restore diskimage_builder/elements/selinux-permissive/README.rst diskimage_builder/elements/selinux-permissive/pre-install.d/11-selinux-permissive diskimage_builder/elements/simple-init/README.rst diskimage_builder/elements/simple-init/element-deps diskimage_builder/elements/simple-init/package-installs.yaml diskimage_builder/elements/simple-init/pkg-map diskimage_builder/elements/simple-init/source-repository-simple-init diskimage_builder/elements/simple-init/environment.d/15-simple-init-networkmanager diskimage_builder/elements/simple-init/environment.d/50-disable-cloud-init diskimage_builder/elements/simple-init/install.d/50-simple-init diskimage_builder/elements/simple-init/install.d/60-simple-init-remove-interfaces diskimage_builder/elements/simple-init/install.d/simple-init-package-install/package-installs-simple-init diskimage_builder/elements/simple-init/install.d/simple-init-repo-install/40-glean diskimage_builder/elements/simple-init/install.d/simple-init-source-install/40-glean diskimage_builder/elements/simple-init/post-install.d/80-simple-init diskimage_builder/elements/source-repositories/README.rst diskimage_builder/elements/source-repositories/element-deps diskimage_builder/elements/source-repositories/package-installs.yaml diskimage_builder/elements/source-repositories/pkg-map diskimage_builder/elements/source-repositories/extra-data.d/98-source-repositories diskimage_builder/elements/stable-interface-names/README.rst diskimage_builder/elements/stable-interface-names/element-deps diskimage_builder/elements/stable-interface-names/package-installs.yaml diskimage_builder/elements/stable-interface-names/install.d/02-stable-interface-names diskimage_builder/elements/svc-map/README.rst diskimage_builder/elements/svc-map/__init__.py diskimage_builder/elements/svc-map/element-deps diskimage_builder/elements/svc-map/package-installs.yaml diskimage_builder/elements/svc-map/pkg-map diskimage_builder/elements/svc-map/bin/svc-map diskimage_builder/elements/svc-map/extra-data.d/10-merge-svc-map-files diskimage_builder/elements/svc-map/extra-data.d/11-copy-svc-map-file diskimage_builder/elements/svc-map/tests/__init__.py diskimage_builder/elements/svc-map/tests/test_data_merge.py diskimage_builder/elements/sysctl/README.rst diskimage_builder/elements/sysctl/bin/sysctl-set-value diskimage_builder/elements/sysctl/bin/sysctl-write-value diskimage_builder/elements/sysprep/README.rst diskimage_builder/elements/sysprep/bin/extract-image diskimage_builder/elements/sysprep/finalise.d/99-clear-machine-id diskimage_builder/elements/tpm-emulator/README.rst diskimage_builder/elements/tpm-emulator/element-deps diskimage_builder/elements/tpm-emulator/package-installs.yaml diskimage_builder/elements/tpm-emulator/source-repository-ibmtpm diskimage_builder/elements/tpm-emulator/source-repository-keylime diskimage_builder/elements/tpm-emulator/install.d/tpm-emulator-source-install/10-tcti-emulator.conf diskimage_builder/elements/tpm-emulator/install.d/tpm-emulator-source-install/20-remove-conditionpathexistsglob.conf diskimage_builder/elements/tpm-emulator/install.d/tpm-emulator-source-install/78-tpm-emulator-install diskimage_builder/elements/tpm-emulator/install.d/tpm-emulator-source-install/keylime-ima-emulator.service diskimage_builder/elements/tpm-emulator/install.d/tpm-emulator-source-install/tpm_server.service diskimage_builder/elements/tpm-emulator/post-install.d/89-tpm-emulator diskimage_builder/elements/uboot/README.rst diskimage_builder/elements/uboot/cleanup.d/98-uboot diskimage_builder/elements/ubuntu/README.rst diskimage_builder/elements/ubuntu/element-deps diskimage_builder/elements/ubuntu/element-provides diskimage_builder/elements/ubuntu/package-installs.yaml diskimage_builder/elements/ubuntu-common/README.rst diskimage_builder/elements/ubuntu-common/element-deps diskimage_builder/elements/ubuntu-common/environment.d/10-ubuntu-distro-name.bash diskimage_builder/elements/ubuntu-common/environment.d/11-ubuntu-init-system.bash diskimage_builder/elements/ubuntu-common/install.d/80-disable-rfc3041 diskimage_builder/elements/ubuntu-common/post-install.d/99-autoremove diskimage_builder/elements/ubuntu-minimal/README.rst diskimage_builder/elements/ubuntu-minimal/element-deps diskimage_builder/elements/ubuntu-minimal/element-provides diskimage_builder/elements/ubuntu-minimal/package-installs.yaml diskimage_builder/elements/ubuntu-minimal/environment.d/11-ubuntu-kernel.bash diskimage_builder/elements/ubuntu-minimal/environment.d/12-ubuntu-repo-dists.bash diskimage_builder/elements/ubuntu-minimal/root.d/75-ubuntu-minimal-baseinstall diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-arm64-build-succeeds/README.rst diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-arm64-build-succeeds/element-deps diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-arm64-build-succeeds/test-output-formats diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-arm64-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-build-succeeds/README.rst diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-build-succeeds/element-deps diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-build-succeeds/test-output-formats diskimage_builder/elements/ubuntu-minimal/test-elements/bionic-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu-minimal/test-elements/focal-arm64-build-succeeds/README.rst diskimage_builder/elements/ubuntu-minimal/test-elements/focal-arm64-build-succeeds/element-deps diskimage_builder/elements/ubuntu-minimal/test-elements/focal-arm64-build-succeeds/test-output-formats diskimage_builder/elements/ubuntu-minimal/test-elements/focal-arm64-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu-minimal/test-elements/focal-build-succeeds/README.rst diskimage_builder/elements/ubuntu-minimal/test-elements/focal-build-succeeds/element-deps diskimage_builder/elements/ubuntu-minimal/test-elements/focal-build-succeeds/test-output-formats diskimage_builder/elements/ubuntu-minimal/test-elements/focal-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/README.rst diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/element-deps diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/test-output-formats diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu-minimal/test-elements/noble-arm64-build-succeeds/README.rst diskimage_builder/elements/ubuntu-minimal/test-elements/noble-arm64-build-succeeds/element-deps diskimage_builder/elements/ubuntu-minimal/test-elements/noble-arm64-build-succeeds/test-output-formats diskimage_builder/elements/ubuntu-minimal/test-elements/noble-arm64-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu-minimal/test-elements/resolute-arm64-build-succeeds/README.rst diskimage_builder/elements/ubuntu-minimal/test-elements/resolute-arm64-build-succeeds/element-deps diskimage_builder/elements/ubuntu-minimal/test-elements/resolute-arm64-build-succeeds/test-output-formats diskimage_builder/elements/ubuntu-minimal/test-elements/resolute-arm64-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu-minimal/test-elements/trusty-build-succeeds/README.rst diskimage_builder/elements/ubuntu-minimal/test-elements/trusty-build-succeeds/element-deps diskimage_builder/elements/ubuntu-minimal/test-elements/trusty-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu-minimal/test-elements/xenial-build-succeeds/README.rst diskimage_builder/elements/ubuntu-minimal/test-elements/xenial-build-succeeds/element-deps diskimage_builder/elements/ubuntu-minimal/test-elements/xenial-build-succeeds/test-output-formats diskimage_builder/elements/ubuntu-minimal/test-elements/xenial-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu-signed/README.rst diskimage_builder/elements/ubuntu-signed/element-deps diskimage_builder/elements/ubuntu-signed/package-installs.yaml diskimage_builder/elements/ubuntu-signed/post-install.d/90-get-signed-kernel diskimage_builder/elements/ubuntu-systemd-container/README.rst diskimage_builder/elements/ubuntu-systemd-container/element-deps diskimage_builder/elements/ubuntu-systemd-container/element-provides diskimage_builder/elements/ubuntu-systemd-container/root.d/75-ubuntu-minimal-baseinstall diskimage_builder/elements/ubuntu-systemd-container/test-elements/bionic-build-succeeds/README.rst diskimage_builder/elements/ubuntu-systemd-container/test-elements/bionic-build-succeeds/element-deps diskimage_builder/elements/ubuntu-systemd-container/test-elements/bionic-build-succeeds/test-output-formats diskimage_builder/elements/ubuntu-systemd-container/test-elements/bionic-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu-systemd-container/test-elements/trusty-build-succeeds/README.rst diskimage_builder/elements/ubuntu-systemd-container/test-elements/trusty-build-succeeds/element-deps diskimage_builder/elements/ubuntu-systemd-container/test-elements/trusty-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu-systemd-container/test-elements/xenial-build-succeeds/README.rst diskimage_builder/elements/ubuntu-systemd-container/test-elements/xenial-build-succeeds/element-deps diskimage_builder/elements/ubuntu-systemd-container/test-elements/xenial-build-succeeds/test-output-formats diskimage_builder/elements/ubuntu-systemd-container/test-elements/xenial-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu/environment.d/99-cloud-init-datasources.bash diskimage_builder/elements/ubuntu/pre-install.d/00-remove-apt-xapian-index diskimage_builder/elements/ubuntu/pre-install.d/01-set-ubuntu-mirror diskimage_builder/elements/ubuntu/root.d/10-cache-ubuntu-tarball diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/README.rst diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/element-deps diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/test-output-formats diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu/test-elements/focal-build-succeeds/README.rst diskimage_builder/elements/ubuntu/test-elements/focal-build-succeeds/element-deps diskimage_builder/elements/ubuntu/test-elements/focal-build-succeeds/test-output-formats diskimage_builder/elements/ubuntu/test-elements/focal-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/README.rst diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/element-deps diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/test-output-formats diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu/test-elements/noble-build-succeeds/README.rst diskimage_builder/elements/ubuntu/test-elements/noble-build-succeeds/element-deps diskimage_builder/elements/ubuntu/test-elements/noble-build-succeeds/test-output-formats diskimage_builder/elements/ubuntu/test-elements/noble-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu/test-elements/resolute-build-succeeds/README.rst diskimage_builder/elements/ubuntu/test-elements/resolute-build-succeeds/element-deps diskimage_builder/elements/ubuntu/test-elements/resolute-build-succeeds/test-output-formats diskimage_builder/elements/ubuntu/test-elements/resolute-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu/test-elements/trusty-build-succeeds/README.rst diskimage_builder/elements/ubuntu/test-elements/trusty-build-succeeds/element-deps diskimage_builder/elements/ubuntu/test-elements/trusty-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/ubuntu/test-elements/xenial-build-succeeds/README.rst diskimage_builder/elements/ubuntu/test-elements/xenial-build-succeeds/element-deps diskimage_builder/elements/ubuntu/test-elements/xenial-build-succeeds/test-output-formats diskimage_builder/elements/ubuntu/test-elements/xenial-build-succeeds/environment.d/10-set-distro.bash diskimage_builder/elements/vm/README.rst diskimage_builder/elements/vm/element-deps diskimage_builder/elements/vm/finalise.d/50-remove-bogus-udev-links diskimage_builder/elements/yum/README.rst diskimage_builder/elements/yum/element-deps diskimage_builder/elements/yum-minimal/README.rst diskimage_builder/elements/yum-minimal/element-deps diskimage_builder/elements/yum-minimal/package-installs.yaml diskimage_builder/elements/yum-minimal/pkg-map diskimage_builder/elements/yum-minimal/cleanup.d/95-remove-yum-mirror diskimage_builder/elements/yum-minimal/install.d/10-base-networking diskimage_builder/elements/yum-minimal/install.d/11-ensure-dbus-daemon diskimage_builder/elements/yum-minimal/pre-install.d/03-yum-cleanup diskimage_builder/elements/yum-minimal/root.d/08-yum-chroot diskimage_builder/elements/yum/bin/install-packages diskimage_builder/elements/yum/cleanup.d/99-remove-yum-repo-conf diskimage_builder/elements/yum/extra-data.d/99-yum-repo-conf diskimage_builder/elements/yum/post-install.d/99-reset-yum-conf diskimage_builder/elements/yum/pre-install.d/00-01-yum-keepcache diskimage_builder/elements/yum/pre-install.d/00-dnf-update diskimage_builder/elements/yum/pre-install.d/00-install-repo-package diskimage_builder/elements/yum/pre-install.d/01-00-centos-python3 diskimage_builder/elements/yum/pre-install.d/01-module-configuration diskimage_builder/elements/yum/root.d/50-yum-cache diskimage_builder/elements/zipl/README.rst diskimage_builder/elements/zipl/element-deps diskimage_builder/elements/zipl/element-provides diskimage_builder/elements/zipl/package-installs.yaml diskimage_builder/elements/zipl/environment.d/10-zipl-default-cmdline diskimage_builder/elements/zipl/finalise.d/50-zipl diskimage_builder/elements/zipl/pre-install.d/kernel_config diskimage_builder/elements/zypper/README.rst diskimage_builder/elements/zypper/element-deps diskimage_builder/elements/zypper-minimal/README.rst diskimage_builder/elements/zypper-minimal/element-deps diskimage_builder/elements/zypper-minimal/package-installs.yaml diskimage_builder/elements/zypper-minimal/post-install.d/01-locale-cleanup diskimage_builder/elements/zypper-minimal/pre-install.d/00-disable-zypper-recommends diskimage_builder/elements/zypper-minimal/root.d/08-zypper-chroot diskimage_builder/elements/zypper/bin/install-packages diskimage_builder/elements/zypper/install.d/01-login-defs diskimage_builder/elements/zypper/post-install.d/10-mkinitrd diskimage_builder/elements/zypper/post-install.d/98-zypper-clean-cache diskimage_builder/elements/zypper/post-install.d/99-zypper-no-keep-packages diskimage_builder/elements/zypper/pre-install.d/01-zypper-keep-packages diskimage_builder/elements/zypper/root.d/50-zypper-cache diskimage_builder/lib/common-defaults diskimage_builder/lib/common-functions diskimage_builder/lib/dib-block-device.py diskimage_builder/lib/dib-run-parts diskimage_builder/lib/die diskimage_builder/lib/disk-image-create diskimage_builder/lib/element-info.py diskimage_builder/lib/img-defaults diskimage_builder/lib/img-functions diskimage_builder/lib/outfilter.py diskimage_builder/lib/ramdisk-defaults diskimage_builder/lib/ramdisk-functions diskimage_builder/lib/ramdisk-image-create diskimage_builder/tests/__init__.py diskimage_builder/tests/base.py diskimage_builder/tests/test_diskimage_builder.py diskimage_builder/tests/test_elementdeps.py diskimage_builder/tests/test_loggingconfig.py diskimage_builder/tests/test_no_dup_filenames.py diskimage_builder/tests/functional/__init__.py doc/requirements.txt doc/lib/element_deps.py doc/source/conf.py doc/source/elements doc/source/elements.rst doc/source/index.rst doc/source/developer/caches.rst doc/source/developer/components.rst doc/source/developer/design.rst doc/source/developer/developing_elements.rst doc/source/developer/dib_lint.rst doc/source/developer/index.rst doc/source/developer/invocation.rst doc/source/developer/stable_interfaces.rst doc/source/developer/vhd_creation.rst doc/source/specs/README.rst doc/source/specs/v1/approved/block-device-lvl1-partitioning.rst doc/source/specs/v1/approved/block-device-overview.rst doc/source/specs/v1/approved/v1-template.rst doc/source/user_guide/building_an_image.rst doc/source/user_guide/index.rst doc/source/user_guide/install_types.rst doc/source/user_guide/installation.rst doc/source/user_guide/supported_distros.rst playbooks/dib-devstack/build-boot-run.yaml playbooks/dib-devstack/pre.yaml playbooks/dib-devstack/files/cpu-level.sh playbooks/dib-functests/post.yaml playbooks/dib-functests/run.yaml releasenotes/notes/1.16.0-updates-bad91fc0b36c1755.yaml releasenotes/notes/1.17.0-ef744f36d277dba4.yaml releasenotes/notes/1.18.0-4433d3076627f10d.yaml releasenotes/notes/1.18.1-ceeb514708dcb731.yaml releasenotes/notes/Add-DIB-UBUNTU-KERNEL-5f75a809f3ce9bab.yaml releasenotes/notes/Fix-ubuntu-minimal-not-running-autoremove-7a4e31de2a525f46.yaml releasenotes/notes/add-4k-block-device-support-8397c2b6122d864c.yaml releasenotes/notes/add-6b94d90caea2895e.yaml releasenotes/notes/add-aarch64-support-for-rhel-c62a0e02b1ad9033.yaml releasenotes/notes/add-autoupdates-element-8225a5d8b19cec74.yaml releasenotes/notes/add-centos-8-support-4fd28eb04e11ba43.yaml releasenotes/notes/add-devuser-group-22dbc2b45271e2fa.yaml releasenotes/notes/add-efi-packages-70a19464d31ab8d7.yaml releasenotes/notes/add-fail2ban-element-2ccdcab027c9abf7.yaml releasenotes/notes/add-fips-element-a5a3e0e3c653f923.yaml releasenotes/notes/add-grub2-efi-x64-modules-for-centos-9-74401ca5ec8201c7.yaml releasenotes/notes/add-modprobe-element-8e3b0287ebb11920.yaml releasenotes/notes/add-openeuler-minimal-element-068dc7d9d94e5098.yaml releasenotes/notes/add-version-less-rhel-element-82fac7f2609e16d3.yaml releasenotes/notes/apt-transport-https-e4856cb9e2f8422c.yaml releasenotes/notes/block-device-efi-lvm-c53272600ccd6d18.yaml releasenotes/notes/block-device-handling-279cddba8a859718.yaml releasenotes/notes/block-device-lvm-c3b8a214952b4db5.yaml releasenotes/notes/block-device-mkfs-mount-fstab-42d7efe28fc2df04.yaml releasenotes/notes/block-device-partitioning-237249e7ed2bad26.yaml releasenotes/notes/block-device-update-partition-table-eb4ff077f90dfb19.yaml releasenotes/notes/bootloader-commandline-d2db7524f1f9ad28.yaml releasenotes/notes/bootloader-disable-serial-console-d6aaa42ef3031d86.yaml releasenotes/notes/bootloader-extlinux-cf5ca0a5c9ef4544.yaml releasenotes/notes/bootloader-gpt-d1047f81f3a0631b.yaml releasenotes/notes/bootloader-strip-source-console-param-b73b603df0b01dc9.yaml releasenotes/notes/bug-2013451-0874e20db0231c56.yaml releasenotes/notes/bug-2016965-f3f35c919081f64c.yaml releasenotes/notes/bump-ubuntu-release-42469e6868ee162b.yaml releasenotes/notes/centos-10-stream-rpm-db-path-d40556b6ff616fc9.yaml releasenotes/notes/centos-default-change-to-9-stream-45a0a88db60d7469.yaml releasenotes/notes/centos-minimal-8-aca6314862741177.yaml releasenotes/notes/centos-minimal-8-stream-97021a2c92463dde.yaml releasenotes/notes/centos-retired-f17ae9f6f03e57e3.yaml releasenotes/notes/cloud-init-resizefs-growpart-e820b8c7f3adb78b.yaml releasenotes/notes/cloud-init-service-name-2b56b8c7f1adb78c.yaml releasenotes/notes/containerfile-host-networking-0691f3be5c6b11b6.yaml releasenotes/notes/containerfile-root-extraction-430148dd669cb3da.yaml releasenotes/notes/create-945440b17d500bf5.yaml releasenotes/notes/dash-p-after-install-58a87549c1c906c3.yaml releasenotes/notes/debian-minimal-confilicts-c139ab0c98e5762f.yaml releasenotes/notes/debian-no-backports-38459be7b11febd1.yaml releasenotes/notes/debian-security-7279855cf464f88b.yaml releasenotes/notes/debian-security-b4f677a148fdf9c9.yaml releasenotes/notes/debian-security-location-bae198f54610fe3f.yaml releasenotes/notes/debian_cloud_init-8d91b34b96c621fe.yaml releasenotes/notes/default_deb_init_per_release-f5a7451b0c2704c9.yaml releasenotes/notes/deprecate-ironic-agent-element.yaml releasenotes/notes/deprecation-of-legacy-deploy-elements-1665af6e87103c5f.yaml releasenotes/notes/dhcp-all-interfaces-add-opt-to-let-NetworkManager-handle-it-f7c7f2d033b7f92d.yaml releasenotes/notes/dhcp-all-interfaces-debian-issue-2ec7f1a5186f0b16.yaml releasenotes/notes/dhcp-all-interfaces-networkmanager-b34f2fc8fb1a678f.yaml releasenotes/notes/dhcp-vlan-interfaces-b34ab224b9431e3a.yaml releasenotes/notes/dib-checksum-3d0d9af8778176be.yaml releasenotes/notes/dib-command-a190f41cbd572b4b.yaml releasenotes/notes/dib-distribution-mirror-8c241c0d3d4a539a.yaml releasenotes/notes/dib-init-system-5647bad17a01c602.yaml releasenotes/notes/dib-init-system_fix_for_debian_jessie-c6f7261ee84dad27.yaml releasenotes/notes/dib-python-deprecate-8401c35a87559076.yaml releasenotes/notes/dib-run-parts-6f67d038aa5a4156.yaml releasenotes/notes/dib-run-parts-e18cc3a6c2d66c24.yaml releasenotes/notes/dibv2-omnibus-b30e0c7ecd76db8d.yaml releasenotes/notes/doc-auto-element-dependency-cb7488c5bb7301a4.yaml releasenotes/notes/dpkg-copy-keys-578e16f7fedd823b.yaml releasenotes/notes/dracut-network-adaabf90da9f6866.yaml releasenotes/notes/efi-bios-images-052283eabba98b90.yaml releasenotes/notes/efi-bootloader-disk-size-4c1a9f18967104fb.yaml releasenotes/notes/element-info-entry-point-448bf622be6061a0.yaml releasenotes/notes/element-override-ccda78c24ab4a4ff.yaml releasenotes/notes/element-vars-c6bf2e6795002f01.yaml releasenotes/notes/elrepo-element-85b32f6f496234d7.yaml releasenotes/notes/ensure-venv-d7c16a2a04fd3b8f.yaml releasenotes/notes/eol-centos7-rhel7-e34abb41caff312e.yaml releasenotes/notes/fedora26-690b9fd9ac3c3d4f.yaml releasenotes/notes/fedora32-9dfa4d9d4dcce1ff.yaml releasenotes/notes/fix-2069956-396eb9f5fb928e2d.yaml releasenotes/notes/fix-and-update-opensuse-15.3-c7fee120b51e3621.yaml releasenotes/notes/fix-config-drive-networking-2a358b2c039d471d.yaml releasenotes/notes/fix-growvols-multipath-partition-delimiter-b93d07653b635a7c.yaml releasenotes/notes/fix-grub-boot-kernel-commandline-1f94e49884c517c0.yaml releasenotes/notes/fix-multipath-issues-with-rhel-centos-17bac22a35a5fe09.yaml releasenotes/notes/fix-resolute-cloudinit-04165133efea5181.yaml releasenotes/notes/fix_rdisc6_loop-32a308a97de99f0f.yaml releasenotes/notes/gentoo-post-install-16514f6d51465c79.yaml releasenotes/notes/gentoo-profile-23.0-99357c919639bd3f.yaml releasenotes/notes/gpt-esp-partition-size-200568cb6fcc8788.yaml releasenotes/notes/grub-timeout-1cdd14a2b1467d89.yaml releasenotes/notes/grub-timeout-style-4bb9b2bde4ff2b02.yaml releasenotes/notes/grub-timeout1-a3e48ac5da970499.yaml releasenotes/notes/grub_style-dfafe48d719f5579.yaml releasenotes/notes/gzip-env-variable-94e61e0c043f4f1f.yaml releasenotes/notes/harden-sshd-config-3f84556136014f95.yaml releasenotes/notes/i386-removed-13fc770dc88e81dc.yaml releasenotes/notes/image-size-padding-24f88d1c4a215221.yaml releasenotes/notes/image-size-padding-mb-574104d40fdd2345.yaml releasenotes/notes/improve-ubuntu-minimal-docs-b4c20a37a4daea2f.yaml releasenotes/notes/incorrect-grub-label-5d2000215c0cc73e.yaml releasenotes/notes/init-ibft-interfaces-9458d97dfcecc3ae.yaml releasenotes/notes/insecure-ubuntu-mirror-2dc80c1c8d1aa20e.yaml releasenotes/notes/jammy-lvm-addition-53165b39e144544d.yaml releasenotes/notes/journal-console-752b46542ec5595e.yaml releasenotes/notes/logfile-quiet-b18f2de4059eecfd.yaml releasenotes/notes/lvm-size-unit-c6b790b87d15c53d.yaml releasenotes/notes/move_tidy_logs_to_main-a8c03427fe1a445c.yaml releasenotes/notes/no-ironic-agent-689e58268e1bf44f.yaml releasenotes/notes/openssh-server-0f6d065748a2fc18.yaml releasenotes/notes/opensuse-150-default-c047033b850d41ec.yaml releasenotes/notes/opensuse-151-default-67ccfffbc134704d.yaml releasenotes/notes/opensuse-423-default-3bc73fff69374cd0.yaml releasenotes/notes/opensuse-minimal-45267f5be1112c22.yaml releasenotes/notes/package-install-arch-38bb5a6e61794fa5.yaml releasenotes/notes/package-installs-when-list-cfc00032271bae75.yaml releasenotes/notes/package-outside-debootstrap-ac93e9ce991819f1.yaml releasenotes/notes/persistent-netifs-fallback-1b861e037dd8a27c.yaml releasenotes/notes/pip-and-virtualenv-args-5d3f2512edd7f3a3.yaml releasenotes/notes/pip-and-virtualenv-platform-removal-52e0d6a22829a3b2.yaml releasenotes/notes/post-root-stage-51da051bcdfbc55f.yaml releasenotes/notes/pre-finalise-stage-574ae7886274bcba.yaml releasenotes/notes/python-venv-d5b04fcf57e460bf.yaml releasenotes/notes/remove-consoles-from-bootloader-element-f96efa2ab5ab41f6.yaml releasenotes/notes/remove-dib-utils-37f70dfad54900a0.yaml releasenotes/notes/remove-qemu-debootstrap-f066e85c1ab0617e.yaml releasenotes/notes/remove-qperf-mellanox-dc433c184c3afee4.yaml releasenotes/notes/remove-solicit-delay-57a035b91922522a.yaml releasenotes/notes/removes-vm-element-from-container-based-distros-607cc59df13921d7.yaml releasenotes/notes/replace-partition-76683c72e23b60b8.yaml releasenotes/notes/repo-package-20fe407795bffd01.yaml releasenotes/notes/rhel-module-selection-e9f6f06ece1fb829.yaml releasenotes/notes/rhel-registration-4d4fe741321e9345.yaml releasenotes/notes/rhel7-element-deprecation-b0c1b57be8cd06ac.yaml releasenotes/notes/root-journal-size-618e064d6681699a.yaml releasenotes/notes/root-pwd-dynamic-login-530adcf15b577e4e.yaml releasenotes/notes/runtime-ssh-host-keys-7a2fc873cc90d33e.yaml releasenotes/notes/selinux-permissive-pre-install-ce19461ef17ec972.yaml releasenotes/notes/simple-init-nm-5d19e249c0a4560b.yaml releasenotes/notes/simple-init-nm-delay-f579e05467785219.yaml releasenotes/notes/simple-init-nm-f0896124dee92a03.yaml releasenotes/notes/simple-init-remove-cloud-init-929b271310e0f774.yaml releasenotes/notes/skip-packages-env-c97e7b4820f9bfda.yaml releasenotes/notes/specify-bootstrap-packages-via-env-22f5c6982c09f16a.yaml releasenotes/notes/squashfs-output-91c1f0dc37474d3c.yaml releasenotes/notes/start-using-reno-446b3d52a467a273.yaml releasenotes/notes/swap_support-9ac267f56a0c0424.yaml releasenotes/notes/sysfs-ro-b127a6df2d78e57c.yaml releasenotes/notes/sysprep-f3fd036bc1d2c405.yaml releasenotes/notes/sysprep-fixes-8890b968a8fa7ac1.yaml releasenotes/notes/thin-provision-c57db8003acec386.yaml releasenotes/notes/timestamp-43015aa5434e8ddb.yaml releasenotes/notes/trusty-testing-removal-51160ee59c5477d8.yaml releasenotes/notes/tty0-d01980dce4ed7786.yaml releasenotes/notes/ubuntu-arbitrary-images-c796f5c6dbd40679.yaml releasenotes/notes/ubuntu-focal-0f54ed4543247b7e.yaml releasenotes/notes/upgrade-pip-before-c-d2443847f9d58c7a.yaml releasenotes/notes/upgrade_openeuler_to_22.03-d67d9bb3c5c97749.yaml releasenotes/notes/virtualenv-activation-6de5738c9db8241d.yaml releasenotes/notes/yum-cache-removal-148c33012515e56e.yaml releasenotes/notes/yum-minimal-dnf-63305c349bcccdd4.yaml releasenotes/notes/yum-minimal-firmware-194846961a6a1cb9.yaml releasenotes/source/conf.py releasenotes/source/index.rst roles/dib-ensure-debootstrap/README.rst roles/dib-ensure-debootstrap/tasks/main.yaml roles/dib-functests/README.rst roles/dib-functests/defaults/main.yaml roles/dib-functests/tasks/main.yaml roles/dib-setup-gate-mirrors/README.rst roles/dib-setup-gate-mirrors/defaults/main.yaml roles/dib-setup-gate-mirrors/tasks/main.yaml roles/dib-setup-gate-mirrors/templates/centos-minimal/7/base.repo.j2 roles/dib-setup-gate-mirrors/templates/centos-minimal/7/extras.repo.j2 roles/dib-setup-gate-mirrors/templates/centos-minimal/7/updates.repo.j2 roles/dib-setup-gate-mirrors/templates/centos-minimal/8-stream/appstream.repo.j2 roles/dib-setup-gate-mirrors/templates/centos-minimal/8-stream/base.repo.j2 roles/dib-setup-gate-mirrors/templates/centos-minimal/9-stream/appstream.repo.j2 roles/dib-setup-gate-mirrors/templates/centos-minimal/9-stream/base.repo.j2 roles/dib-setup-gate-mirrors/templates/openeuler-minimal/22.03-LTS/openEuler.repo.j2 tests/README.rst tests/install_test_deps.sh tests/run_dib_library_tests.sh tests/run_functests.sh tests/run_output_format_test.sh tests/elements/fake-os/README.rst tests/elements/fake-os/element-provides tests/elements/fake-os/root.d/10-fake-os tools/functional-test-check.sh././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658493.0 diskimage_builder-3.42.0/diskimage_builder.egg-info/dependency_links.txt0000664000175000017500000000000115201026275025270 0ustar00zuulzuul ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658493.0 diskimage_builder-3.42.0/diskimage_builder.egg-info/entry_points.txt0000664000175000017500000000144215201026275024521 0ustar00zuulzuul[console_scripts] disk-image-create = diskimage_builder.disk_image_create:main diskimage-builder = diskimage_builder.diskimage_builder:main ramdisk-image-create = diskimage_builder.disk_image_create:main [diskimage_builder.block_device.plugin] fstab = diskimage_builder.block_device.level4.fstab:Fstab local_loop = diskimage_builder.block_device.level0.localloop:LocalLoop lvm = diskimage_builder.block_device.level1.lvm:LVMPlugin mkfs = diskimage_builder.block_device.level2.mkfs:Mkfs mount = diskimage_builder.block_device.level3.mount:Mount partitioning = diskimage_builder.block_device.level1.partitioning:Partitioning [diskimage_builder.block_device.plugin_test] test_a = diskimage_builder.block_device.tests.plugin.test_a:TestA test_b = diskimage_builder.block_device.tests.plugin.test_b:TestB ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658493.0 diskimage_builder-3.42.0/diskimage_builder.egg-info/not-zip-safe0000664000175000017500000000000115201026275023450 0ustar00zuulzuul ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658493.0 diskimage_builder-3.42.0/diskimage_builder.egg-info/pbr.json0000664000175000017500000000005715201026275022702 0ustar00zuulzuul{"git_version": "00b49ecd", "is_release": true}././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658493.0 diskimage_builder-3.42.0/diskimage_builder.egg-info/requires.txt0000664000175000017500000000015115201026275023617 0ustar00zuulzuulnetworkx>=2.3.0 pbr!=2.1.0,>=2.0.0 PyYAML>=3.12 stevedore>=1.20.0 flake8<7.0.0,>=3.6.0 jsonschema>=3.0.2 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658493.0 diskimage_builder-3.42.0/diskimage_builder.egg-info/top_level.txt0000664000175000017500000000002215201026275023746 0ustar00zuulzuuldiskimage_builder ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4252386 diskimage_builder-3.42.0/doc/0000775000175000017500000000000015201026275014632 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4252386 diskimage_builder-3.42.0/doc/lib/0000775000175000017500000000000015201026275015400 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/lib/element_deps.py0000664000175000017500000000445515201026231020416 0ustar00zuulzuul# # Copyright 2017 Andreas Florath (andreas@florath.net) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # # Scan the element directory, looks for element dependencies and # writes them out when the directive # .. element_deps:: # is used. # This was developed only for internal use and must be called # from the source top directory. from diskimage_builder.element_dependencies import _find_all_elements from diskimage_builder.paths import get_path from docutils.parsers.rst import Directive import os all_elements = _find_all_elements(get_path("elements")) def make_dep_list(title, deps): lines = [] lines.append(title) lines.append("+" * len(title)) for dep in sorted(deps): lines.append("* :doc:`../%s/README`" % dep) lines.append('') # careful to end with a blank line return lines class ElementDepsDirective(Directive): # this enables content in the directive has_content = True def run(self): source = self.state_machine.input_lines.source( self.lineno - self.state_machine.input_offset - 1) # Extract the element from the source attribute of the document element_name = os.path.basename(os.path.dirname( self.state_machine.document.attributes['source'])) lines = ["Element Dependencies", "--------------------"] # This should not fail -- sphinx would be finding an element # that dib doesn't know about? element = all_elements[element_name] if element.depends: lines.extend(make_dep_list("Uses", element.depends)) if element.r_depends: lines.extend(make_dep_list("Used by", element.r_depends)) self.state_machine.insert_input(lines, source) return [] def setup(app): app.add_directive('element_deps', ElementDepsDirective) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/requirements.txt0000664000175000017500000000052215201026231020105 0ustar00zuulzuul# The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. openstackdocstheme>=2.2.1 # Apache-2.0 sphinx>=2.0.0,!=2.1.0 # BSD reno>=3.1.0 # Apache-2.0 sphinxcontrib-apidoc>=0.2.0 # BSD ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4252386 diskimage_builder-3.42.0/doc/source/0000775000175000017500000000000015201026275016132 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/conf.py0000664000175000017500000001726015201026231017427 0ustar00zuulzuulimport sys import os # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. sys.path.append(os.path.abspath('../lib')) extensions = ['openstackdocstheme', 'element_deps', 'sphinx.ext.autodoc', 'sphinxcontrib.apidoc' ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'diskimage-builder' copyright = u'2015-2016, Various Authors' # openstackdocstheme options openstackdocs_repo_name = 'openstack/diskimage-builder' openstackdocs_bug_project = 'diskimage-builder' openstackdocs_auto_name = False openstackdocs_bug_tag = '' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build', 'doc/build', '.tox', '.venv', 'elements/*/test-elements'] # The reST default role (used for this markup: `text`) to use for all # documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'native' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. #keep_warnings = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'openstackdocs' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". #html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. #html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. html_sidebars = { '**': ['globaltoc.html', 'relations.html', 'sourcelink.html', 'searchbox.html'], } # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'diskimage-builderdoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ ('index', 'diskimage-builder.tex', u'diskimage-builder Documentation', u'OpenStack', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'diskimage-builder', u'diskimage-builder Documentation', [u'OpenStack'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'diskimage-builder', u'diskimage-builder Documentation', u'OpenStack', 'diskimage-builder', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False # -- sphinxcontrib.apidoc configuration -------------------------------------- apidoc_module_dir = '../../diskimage_builder' apidoc_output_dir = 'developer/api' apidoc_excluded_paths = [ 'tests', 'block_device.tests', 'elements', 'lib', ] ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4262388 diskimage_builder-3.42.0/doc/source/developer/0000775000175000017500000000000015201026275020117 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/developer/caches.rst0000664000175000017500000000252715201026231022075 0ustar00zuulzuulCaches and offline mode ======================= Since retrieving and transforming operating system image files, git repositories, Python or Ruby packages, and so on can be a significant overhead, we cache many of the inputs to the build process. The cache location is read from ``DIB_IMAGE_CACHE``. :ref:`developing-elements` describes the interface within disk-image-builder for caching. When invoking disk-image-builder, the ``--offline`` option will instruct disk-image-builder to not refresh cached resources. Alternatively you can set ``DIB_OFFLINE=1``. Note that we don't maintain operating system package caches, instead depending on your local infrastructure (e.g. Squid cache, or an APT or Yum proxy) to facilitate caching of that layer, so you need to arrange independently for offline mode. Base images ----------- These are cached by the standard elements - :doc:`../elements/fedora/README`, :doc:`../elements/redhat-common/README`, :doc:`../elements/ubuntu/README`, :doc:`../elements/debian/README` and :doc:`../elements/opensuse/README`. source-repositories ------------------- Git repositories and tarballs obtained via the :doc:`../elements/source-repositories/README` element will be cached. PyPI ---- The :doc:`../elements/pypi/README` element will bind mount a PyPI mirror from the cache dir and configure pip and easy-install to use it. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/developer/components.rst0000664000175000017500000000572215201026231023034 0ustar00zuulzuulComponents ========== `disk-image-create [-a amd64|armhf|arm64] -o filename {element} [{element} ...]` Create an image of element {element}, optionally mixing in other elements. Element dependencies are automatically included. Support for other architectures depends on your environment being able to run binaries of that platform and/or packages being available for the architecture. For instance, to enable armhf on Ubuntu install the qemu-user-static package, or to enable arm64 on CentOS setup the RDO aarch64 package repositories. The default output format from disk-image-create is qcow2. To instead output a tarball pass in "-t tar". This tarball could then be used as an image for a linux container(see docs/docker.md). `ramdisk-image-create -o filename {element} [{element} ...]` Create a kernel+ ramdisk pair for running maintenance on bare metal machines (deployment, inventory, burnin etc). To generate kernel+ramdisk pair for use with nova-baremetal, use:: ramdisk-image-create -o deploy.ramdisk deploy-baremetal Ironic no longer supports images created like this. `diskimage-builder [--dry-run] [--stop-on-failure] [--help] filename.yaml [filename2.yaml...]` A YAML defined wrapper over `disk-image-create` and `ramdisk-image-create`. To generate kernel+ramdisk pair for use with nova-baremetal, specify the YAML: .. code-block:: yaml - imagename: deploy.ramdisk ramdisk: true elements: - deploy-baremetal Duplicate `imagename` entries are merged into a single entry, allowing customizations over a base image definition. If an `imagename` is missing, the `imagename` from the previous entry is implied: .. code-block:: yaml # base image definition - imagename: output.qcow elements: - vm - block-device-gpt - ubuntu-minimal debug-trace: 1 environment: DIB_IMAGE_SIZE: '10' # debug logging customization - imagename: output.qcow debug-trace: 2 # adding element customization - elements: - devuser environment: DIB_DEV_USER_USERNAME: 'myuser' DIB_DEV_USER_PWDLESS_SUDO: 'Yes' DIB_DEV_USER_AUTHORIZED_KEYS: '/home/myuser/.ssh/id_rsa.pub' # resulting image entry which will be built - imagename: output.qcow elements: - vm - block-device-gpt - ubuntu-minimal - devuser debug-trace: 2 environment: DIB_DEV_USER_USERNAME: 'myuser' DIB_DEV_USER_PWDLESS_SUDO: 'Yes' DIB_DEV_USER_AUTHORIZED_KEYS: '/home/myuser/.ssh/id_rsa.pub' DIB_IMAGE_SIZE: '10' `element-info` Extract information about elements. `tests/run_functests.sh` This runs a set of functional tests for diskimage-builder. elements can be found in the top level elements directory. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/developer/design.rst0000664000175000017500000000654515201026231022124 0ustar00zuulzuulDesign ====== Images are built using a chroot and bind mounted /proc /sys and /dev. The goal of the image building process is to produce blank slate machines that have all the necessary bits to fulfill a specific purpose in the running of an OpenStack cloud: e.g. a nova-compute node. Images produce either a filesystem image with a label of cloudimg-rootfs, or can be customised to produce whole disk images (but will still contain a filesystem labelled cloudimg-rootfs). Once the file system tree is assembled a loopback device with filesystem (or partition table and file system) is created and the tree copied into it. The file system created is an ext4 filesystem just large enough to hold the file system tree and can be resized up to 1PB in size. To produce the smallest image the utility fstrim is used. When deleting a file the space is simply marked as free on the disk, the file is still there until it is overwritten. fstrim informs the underlying disk to drop those bytes the end result of which is like writting zeros over those sectors. The same effect could be achieved by creating a large file full of zeros and removing that file, however that method is far more IO intensive. An element is a particular set of code that alters how the image is built, or runs within the chroot to prepare the image. E.g. the local-config element copies in the http proxy and ssh keys of the user running the image build process into the image, whereas the vm element makes the image build a regular VM image with partition table and installed grub boot sector. The mellanox element adds support for mellanox infiniband hardware to both the deploy ramdisk and the built images. Images must specify a base distribution image element. Currently base distribution elements exist for fedora, rhel, ubuntu, debian and opensuse. Other distributions may be added in future, the infrastructure deliberately makes few assumptions about the exact operating system in use. The base image has opensshd running (a new key generated on first boot) and accepts keys via the cloud metadata service, loading them into the distribution specific default user account. The goal of a built image is to have any global configuration ready to roll, but nothing that ties it to a specific cloud instance: images should be able to be dropped into a test cloud and validated, and then deployed into a production cloud (usually via bare metal nova) for production use. As such, the image contents can be modelled as three distinct portions: - global content: the actual code, kernel, always-applicable config (like disabling password authentication to sshd). - metadata / config management provided configuration: user ssh keys, network address and routes, configuration management server location and public key, credentials to access other servers in the cloud. These are typically refreshed on every boot. - persistent state: sshd server key, database contents, swift storage areas, nova instance disk images, disk image cache. These would typically be stored on a dedicated partition and not overwritten when re-deploying the image. The goal of the image building tools is to create machine images that contain the correct global content and are ready for 'last-mile' configuration by the nova metadata API, after which a configuration management system can take over (until the next deploy, when it all starts over from scratch). ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/developer/developing_elements.rst0000664000175000017500000004305715201026231024702 0ustar00zuulzuul.. _developing-elements: Developing Elements =================== Conform to the following conventions: * Use the environment for overridable defaults, prefixing environment variable names with ``DIB_``. For example: .. sourcecode:: sh DIB_MYDEFAULT=${DIB_MYDEFAULT:-default} If you do not use the ``DIB`` prefix you may find that your overrides are discarded as the build environment is sanitised. * Consider that your element co-exists with many others and try to guard against undefined behaviours. Some examples: * Two elements use the source-repositories element, but use the same filename for the source-repositories config file. Files such as these (and indeed the scripts in the various .d directories :ref:`listed below `) should be named such that they are unique. If they are not unique, when the combined tree is created by disk-image-builder for injecting into the build environment, one of the files will be overwritten. * Two elements copy different scripts into ``/usr/local/bin`` with the same name. If they both use ``set -e`` and ``cp -n`` then the conflict will be caught and cause the build to fail. * If your element mounts anything into the image build tree (``$TMP_BUILD_DIR``) then it will be automatically unmounted when the build tree is unmounted - and not remounted into the filesystem image - if the mount point is needed again, your element will need to remount it at that point. * If caching is required, elements should use a location under ``$DIB_IMAGE_CACHE``. * Elements should allow for remote data to be cached. When ``$DIB_OFFLINE`` is set, this cached data should be used if possible. See the :ref:`dev-global-image-build-variables` section of this document for more information. * Elements in the upstream diskimage-builder elements should not create executables which run before 10- or after 90- in any of the phases if possible. This is to give downstream elements the ability to easily make executables which run after our upstream ones. .. _phase-subdirectories: Phase Subdirectories ^^^^^^^^^^^^^^^^^^^^ Make as many of the following subdirectories as you need, depending on what part of the process you need to customise. The subdirectories are executed in the order given here. Scripts within the subdirectories should be named with a two-digit numeric prefix, and are executed in numeric order. Only files which are marked executable (+x) will be run, so other files can be stored in these directories if needed. As a convention, we try to only store executable scripts in the phase subdirectories and store data files elsewhere in the element. The phases are: #. ``root.d`` #. ``extra-data.d`` #. ``pre-install.d`` #. ``install.d`` #. ``post-install.d`` #. ``post-root.d`` #. ``block-device.d`` #. ``pre-finalise.d`` #. ``finalise.d`` #. ``cleanup.d`` ``root.d`` Create or adapt the initial root filesystem content. This is where alternative distribution support is added, or customisations such as building on an existing image. Only one element can use this at a time unless particular care is taken not to blindly overwrite but instead to adapt the context extracted by other elements. * runs: **outside chroot** * inputs: * ``$ARCH=amd64|armhf|arm64`` * ``$TARGET_ROOT=/path/to/target/workarea`` ``extra-data.d`` Pull in extra data from the host environment that hooks may need during image creation. This should copy any data (such as SSH keys, http proxy settings and the like) somewhere under ``$TMP_HOOKS_PATH``. * runs: **outside chroot** * inputs: ``$TMP_HOOKS_PATH`` * outputs: None Contents placed under ``$TMP_HOOKS_PATH`` will be available at ``/tmp/in_target.d`` inside the chroot. ``pre-install.d`` Run code in the chroot before customisation or packages are installed. A good place to add apt repositories. * runs: **in chroot** ``install.d`` Runs after ``pre-install.d`` in the chroot. This is a good place to install packages, chain into configuration management tools or do other image specific operations. * runs: **in chroot** ``post-install.d`` Run code in the chroot. This is a good place to perform tasks you want to handle after the OS/application install but before the first boot of the image. Some examples of use would be * Run ``chkconfig`` to disable unneeded services * Clean the cache left by the package manager to reduce the size of the image. * runs: **in chroot** ``post-root.d`` Run code outside the chroot. This is a good place to perform tasks that cannot run inside the chroot and must run after installing things. The root filesystem content is rooted at ``$TMP_BUILD_DIR/mnt``. * runs: **outside chroot** ``block-device.d`` Customise the block device that the image will be made on (for example to make partitions). Runs after the target tree has been fully populated but before the ``cleanup.d`` phase runs. * runs: **outside chroot** * inputs: * ``$IMAGE_BLOCK_DEVICE={path}`` * ``$TARGET_ROOT={path}`` * outputs: ``$IMAGE_BLOCK_DEVICE={path}`` ``pre-finalise.d`` Final tuning of the root filesystem, outside the chroot. Filesystem content has been copied into the final file system which is rooted at ``$TMP_BUILD_DIR/mnt``. You might do things like re-mount a cache directory that was used during the build in this phase (with subsequent unmount in ``cleanup.d``). * runs: **outside chroot** ``finalise.d`` Perform final tuning of the root filesystem. Runs in a chroot after the root filesystem content has been copied into the mounted filesystem: this is an appropriate place to reset SELinux metadata, install grub bootloaders and so on. Because this happens inside the final image, it is important to limit operations here to only those necessary to affect the filesystem metadata and image itself. For most operations, ``post-install.d`` is preferred. * runs: **in chroot** ``cleanup.d`` Perform cleanup of the root filesystem content. For instance, temporary settings to use the image build environment HTTP proxy are removed here in the dpkg element. * runs: **outside chroot** * inputs: * ``$ARCH=amd64|armhf|arm64`` * ``$TARGET_ROOT=/path/to/target/workarea`` Other Subdirectories ^^^^^^^^^^^^^^^^^^^^ Elements may have other subdirectories that are processed by specific elements rather than the diskimage-builder tools themselves. One example of this is the ``bin`` directory. The `rpm-distro`, :doc:`../elements/dpkg/README` and :doc:`../elements/opensuse/README` elements install all files found in the ``bin`` directory into ``/usr/local/bin`` within the image as executable files. Environment Variables ^^^^^^^^^^^^^^^^^^^^^ To set environment variables for other hooks, add a file to your element ``environment.d``. This directory contains bash script snippets that are sourced before running scripts in each phase. Note that because environment includes are sourced together, they should not set global flags like ``set -x`` because they will affect all preceeding imports. Dependencies ^^^^^^^^^^^^ Each element can use the following files to define or affect dependencies: ``element-deps`` A plain text, newline separated list of elements which will be added to the list of elements built into the image at image creation time. ``element-provides`` A plain text, newline separated list of elements which are provided by this element. These elements will be excluded from elements built into the image at image creation time. For example if element A depends on element B and element C includes element B in its ``element-provides`` file and A and C are included when building an image, then B is not used. Operating system elements ^^^^^^^^^^^^^^^^^^^^^^^^^ Some elements define the base structure for an operating system -- for example, the ``opensuse`` element builds a base openSUSE system. Such elements have more requirements than the other elements: * they must have ``operating-system`` in their element-provides, so this indicates they are an "operating system". * they must export the ``DISTRO_NAME`` environment variable with the name of the distribution built, using an environment.d script. For example, the ``opensuse`` element exports ``DISTRO_NAME=opensuse``. Ramdisk Elements ^^^^^^^^^^^^^^^^ Ramdisk elements support the following files in their element directories: ``binary-deps.d`` Text files listing executables required to be fed into the ramdisk. These need to be present in ``$PATH`` in the build chroot (i.e. need to be installed by your elements as described above). ``init.d`` POSIX shell script fragments that will be appended to the default script executed as the ramdisk is booted (``/init``). ``ramdisk-install.d`` Called to copy files into the ramdisk. The variable ``$TMP_MOUNT_PATH`` points to the root of the tree that will be packed into the ramdisk. ``udev.d`` ``udev`` rules files that will be copied into the ramdisk. Element coding standard ^^^^^^^^^^^^^^^^^^^^^^^ - lines should not include trailing whitespace. - there should be no hard tabs in the file. - indents are 4 spaces, and all indentation should be some multiple of them. - `do` and `then` keywords should be on the same line as the if, while or for conditions. .. _dev-global-image-build-variables: Global image-build variables ---------------------------- ``DIB_OFFLINE`` This is always set. When not empty, any operations that perform remote data access should avoid it if possible. If not possible the operation should still be attempted as the user may have an external cache able to keep the operation functional. ``DIB_IMAGE_CACHE`` Path to where cached inputs to the build process are stored. Defaults to ``~/.cache/image_create``. Structure of an element ----------------------- The above-mentioned global content can be further broken down in a way that encourages composition of elements and reusability of their components. One possible approach to this would be to label elements as either a "driver", "service", or "config" element. Below are some examples. - Driver-specific elements should only contain the necessary bits for that driver:: elements/ driver-mellanox/ init - modprobe line install.d/ 10-mlx - package installation - An element that installs and configures Nova might be a bit more complex, containing several scripts across several phases:: elements/ service-nova/ source-repository-nova - register a source repository pre-install.d/ 50-my-ppa - add a PPA install.d/ 10-user - common Nova user accts 50-my-pack - install packages from my PPA 60-nova - install nova and some dependencies - In the general case, configuration should probably be handled either by the meta-data service (eg, o-r-c) or via normal CM tools (eg, salt). That being said, it may occasionally be desirable to create a set of elements which express a distinct configuration of the same software components. In this way, depending on the hardware and in which availability zone it is to be deployed, an image would be composed of: * zero or more driver-elements * one or more service-elements * zero or more config-elements It should be noted that this is merely a naming convention to assist in managing elements. Diskimage-builder is not, and should not be, functionally dependent upon specific element names. diskimage-builder has the ability to retrieve source code for an element and place it into a directory on the target image during the extra-data phase. The default location/branch can then be overridden by the process running diskimage-builder, making it possible to use the same element to track more then one branch of a git repository or to get source for a local cache. See :doc:`../elements/source-repositories/README` for more information. Finding other elements ---------------------- DIB exposes an internal ``$IMAGE_ELEMENT_YAML`` variable which provides elements access to the full set of included elements and their paths. This can be used to process local in-element files across all the elements (``pkg-map`` for example). .. code-block:: python import os import yaml elements = yaml.load(os.getenv('IMAGE_ELEMENT_YAML')) for element, path in elements: ... For elements written in Bash, there is a function ``get_image_element_array`` that can be used to instantiate an associative-array of elements and paths (note arrays can not be exported in bash). .. code-block:: bash # note eval to expand the result of the get function eval declare -A image_elements=($(get_image_element_array)) for i in ${!image_elements[$i]}; do element=$i path=${image_elements[$i]} done Debugging elements ------------------ Export ``break`` to drop to a shell during the image build. Break points can be set either before or after any of the hook points by exporting "break=[before|after]-hook-name". Multiple break points can be specified as a comma-delimited string. Some examples: * ``break=before-block-device-size`` will break before the block device size hooks are called. * ``break=before-pre-install`` will break before the pre-install hooks. * ``break=after-error`` will break after an error during an in target hookpoint. The :doc:`../elements/manifests/README` element will make a range of manifest information generated by other elements available for inspection inside and outside the built image. Environment and command line arguments are captured as described in the documentation and can be useful for debugging. Images are built such that the Linux kernel is instructed not to switch into graphical consoles (i.e. it will not activate KMS). This maximises compatibility with remote console interception hardware, such as HP's iLO. However, you will typically only see kernel messages on the console - init daemons (e.g. upstart) will usually be instructed to output to a serial console so nova's console-log command can function. There is an element in the tripleo-image-elements repository called "remove-serial-console" which will force all boot messages to appear on the main console. Ramdisk images can be debugged at run-time by passing ``troubleshoot`` as a kernel command line argument, or by pressing "t" when an error is reached. This will spawn a shell on the console (this can be extremely useful when network interfaces or disks are not detected correctly). Testing Elements ---------------- An element can have functional tests encapsulated inside the element itself. The tests can be written either as shell or python unit tests. shell """"" In order to create a test case, follow these steps: * Create a directory called ``test-elements`` inside your element. * Inside the test-elements directory, create a directory with the name of your test case. The test case directory should have the same structure as an element. For example:: elements/apt-sources/test-elements/test-case-1 * Assert state during each of the element build phases you would like to test. You can exit 1 to indicate a failure. * To exit early and indicate a success, touch a file ``/tmp/dib-test-should-fail`` in the image chroot, then exit 1. Tests are run with ``tools/run_functests.sh``. Running ``run_functests.sh -l`` will show available tests (the example above would be called ``apt-sources/test-case-1``, for example). Specify your test (or a series of tests as separate arguments) on the command line to run it. If it should not be run as part of the default CI run, you can submit a change with it added to ``DEFAULT_SKIP_TESTS`` in that file. Running the functional tests is time consuming. Multiple parallel jobs can be started by specifying ``-j ``. Each of the jobs uses a lot resources (CPU, disk space, RAM) - therefore the job count must carefully be chosen. python """""" To run functional tests locally, install and start docker, then use the following tox command:: tox -efunc Note that running functional tests requires *sudo* rights, thus you may be asked for your password. To run functional tests for one element, append its name to the command:: tox -efunc ironic-agent Additionally, elements can be tested using python unittests. To create a a python test: * Create a directory called ``tests`` in the element directory. * Create an empty file called ``__init__.py`` to make it into a python package. * Create your test files as ``test\whatever.py``, using regular python test code. To run all the tests use testr - ``testr run``. To run just some tests provide one or more regex filters - tests matching any of them are run - ``testr run apt-proxy``. Third party elements -------------------- Additional elements can be incorporated by setting ``ELEMENTS_PATH``, for example if one were building tripleo-images, the variable would be set like: .. sourcecode:: sh export ELEMENTS_PATH=tripleo-image-elements/elements disk-image-create rhel cinder-api Linting ------- You should always run ``bin/dib-lint`` over your elements. It will warn you of common issues. sudo """" Using ``sudo`` outside the chroot environment can cause breakout issues where you accidentally modify parts of the host system. ``dib-lint`` will warn if it sees ``sudo`` calls that do not use the path arguments given to elements running outside the chroot. To disable the error for a call you know is safe, add :: # dib-lint: safe_sudo to the end of the ``sudo`` command line. To disable the check for an entire file, add :: # dib-lint: disable=safe_sudo ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/developer/dib_lint.rst0000664000175000017500000000332415201026231022427 0ustar00zuulzuuldib-lint ======== dib-lint provides a way to check for common errors in diskimage-builder elements. To use it, simply run the ``dib-lint`` script in a directory containing an ``elements`` directory. The checks will be run against every file found under ``elements``. The following is a list of what is currently caught by dib-lint: * executable: Ensure any files that begin with #! are executable * indent: Ensure that all source code is using an indent of four spaces * element-deps ordering: Ensure all element-deps files are alphabetized * /bin/bash: Ensure all scripts are using bash explicitly * sete: Ensure all scripts are set -e * setu: Ensure all scripts are set -u * setpipefail: Ensure all scripts are set -o pipefail * dibdebugtrace: Ensure all scripts respect the DIB_DEBUG_TRACE variable * tabindent: Ensure no tabs are used for indentation * newline: Ensure that every file ends with a newline * mddocs: Ensure that only markdown-formatted documentation is used * yaml validation: Ensure that any yaml files in the repo have valid syntax Some of the checks can be omitted, either for an entire project or for an individual file. Project exclusions go in tox.ini, using the following section format:: [dib-lint] ignore=sete setpipefail This will cause the set -e and set -o pipefail checks to be ignored. File-specific exclusions are specified as a comment in the relevant file, using the following format:: # dib-lint: disable=sete setpipefail This will exclude the same tests, but only for the file in which the comment appears. Only some of the checks can be disabled. The ones available for exclusion are: * executable * indent * sete * setu * setpipefail * dibdebugtrace * tabindent * newline * mddocs ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/developer/index.rst0000664000175000017500000000232315201026231021750 0ustar00zuulzuulDeveloper Guide =============== .. toctree:: :maxdepth: 1 design components invocation caches developing_elements dib_lint stable_interfaces vhd_creation Module index This documentation explains how to get started with creating your own disk-image-builder elements as well as some high level concepts for element creation. Quickstart ---------- To get started developing with ``diskimage-builder``, install to a ``virtualenv``:: $ mkdir dib $ cd dib $ virtualenv env $ source env/bin/activate $ git clone https://opendev.org/openstack/diskimage-builder $ cd diskimage-builder $ pip install -e . You can now simply use ``disk-image-create`` to start building images and testing your changes. When you are done editing, use ``git review`` to submit changes to the upstream gerrit. Python module documentation --------------------------- For internal documentation on the DIB python components, see the :ref:`modindex`. Finding Work ------------ We maintain a list of low-hanging-fruit tags on launchpad: * `https://bugs.launchpad.net/diskimage-builder/+bugs?field.tag=low-hanging-fruit `_ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/developer/invocation.rst0000664000175000017500000000514315201026231023015 0ustar00zuulzuul.. _dev_install: Developer Installation ====================== Note that for non-development use you can use distribution packages or install the latest release via ``pip`` (usually in a separate ``virtualenv`` environment). For development purposes, you can use ``pip -e`` to install the latest git tree checkout into a local development/testing ``virtualenv``. However, the recommended way is to use provided ``tox`` environments; e.g. .. code-block:: shell-session $ git clone https://opendev.org/openstack/diskimage-builder $ cd diskimage-builder $ tox -e bindep $ sudo apt-get install $ tox -e venv -- disk-image-create ... This will ensure you run with the right requirements. Invocation ---------- The ``image-create`` scripts should be run from the ``$PATH``; this should will be automatically set if using a ``virtualenv`` or ``tox``. A range of options can be set on the command-line. Try ``-h`` for help. Other options can be set by exporting variables; some variables for export are listed in ``lib/img-defaults``. See specific element instructions for other variables that may be obeyed. The image building scripts expect to be able to invoke commands with ``sudo``. Thus if you want them to run non-interactively, you should either run them as root, with ``sudo -E``, or allow your build user to run any ``sudo`` command without password. Element priority ---------------- The variable ``ELEMENTS_PATH`` is a colon (:) separated path list to search for elements. The included ``elements`` tree is used when no path is supplied and is always added to the end of the path if a path is supplied. Earlier elements will override later elements, i.e. with ``ELEMENTS_PATH=foo:bar`` the element ``my-element`` will be chosen from ``foo/my-element`` over ``bar/my-element``, or any in-built element of the same name. Output ------ By default, the image building scripts will not overwrite existing disk images, allowing you to compare the newly built image with the existing one. To change that behaviour, set the variable ``OVERWRITE_OLD_IMAGE`` to any value that isn't ``0``. If this value is zero then any existing image will be moved before the new image is written to the destination. Size reports ------------ Setting the variable ``DIB_SHOW_IMAGE_USAGE`` will print out a summarised disk-usage report for the final image of files and directories over 10MiB in size. Setting ``DIB_SHOW_IMAGE_USAGE_FULL`` will show all files and directories. These settings can be useful additions to the logs in automated build situations where debugging image-growth may be important. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/developer/stable_interfaces.rst0000664000175000017500000000130215201026231024312 0ustar00zuulzuulStable Interfaces ================= diskimage-builder and the elements provide several 'stable' interfaces for both developers and users which we aim to preserve during a major version release. These interfaces consist of: The names and arguments of the executable scripts included with diskimage-builder in the bin directory will remain stable. The environment variables that diskimage-builder provides for elements to use will remain stable. The environment variables documented in each element and the values accepted by these environment variables will remain stable. Required environment variables for an element will not be added. Support for build or target distributions will not be removed. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/developer/vhd_creation.rst0000664000175000017500000002252015201026231023307 0ustar00zuulzuulvhd creation ============ There is currently a hard dependency on the patched version of ``vhd-utils`` to create Xenserver VHD compatible images. The main target for these images is the Rackspace Public Cloud. This note should explain the current issues. The patch to include ``convert`` as an option to ``vhd-utils``, avaialble at https://github.com/citrix-openstack/xenserver-utils/, is built by infra into a PPA available at https://launchpad.net/~openstack-ci-core/+archive/ubuntu/vhd-util. Upstream Xen has actually removed all the code related to ``blktap2`` with https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=5c883cf036cf5ab8b1b79390549e2475f7a568dd. The tools have been removed from Debuntu with https://bugs.debian.org/917907. So this patch is even less trivial to apply; the project has seemingly been split into https://github.com/xapi-project/blktap/ but support status is unclear. It is tempting to use ``qemu-img`` image conversion routines. Indeed this supports converting RAW images to VPC output. However, VPC is a fairly flexible standard across a number of different hypervisors. The main standard is available from Microsoft at https://www.microsoft.com/en-us/download/confirmation.aspx?id=23850 and is what ``qemu-img`` impelements. However, trying to boot an image created with this results in a "resize" error. This is described in https://bugs.launchpad.net/nova/+bug/862653 but comes down to the following in https://github.com/xapi-project/blktap/blob/master/vhd/lib/vhd-util-resize.c#L1055:: if (!vhd_creator_tapdisk(&vhd)) { printf("%s not created by xen; resize not supported\n", name); err = -EINVAL; } It seems that Xen will refuse to grow a image without a creator ``tap\0``. It is tempting to patch ``qemu-img`` to do this (patch follows for those interested). However, if you look at the output with ``vhd-util read -p -n ./.vhd`` you will notice it complains about an invalid ``batmap``. The ``batmap`` appears to be a Xen extension to the VPC standard. Checking ``vhd_has_batmap`` at https://github.com/xen-project/xen/blob/365aabb6e5023cee476adf81106729efd49c644f/tools/blktap2/vhd/lib/libvhd.c#L1193 it seems we can fool Xen by setting the vhd version tags low enough that it thinks the image doesn't have a ``batmap`` (i.e. presumably created with tools before ``batmap``'s existed). Side note: there is a bunch of qemu work to implement overlay VHD disks with https://patchwork.ozlabs.org/project/qemu-devel/list/?submitter=64750 which has never merged. This also seems to include a ``batmap`` implementation. With the full patch applied below, we get images that appear fairly similar from (patched) ``vhd-util`` and ``qemu-img``; generated from the same ``.raw`` file. qemu-img output:: VHD Footer Summary: ------------------- Cookie : conectix Features : (0x00000002) File format version : Major: 1, Minor: 0 Data offset : 512 Timestamp : Wed Oct 30 06:25:41 2019 Creator Application : 'tap' Creator version : Major: 1, Minor: 0 Creator OS : Unknown! Original disk size : 16667 MB (17477591040 Bytes) Current disk size : 16667 MB (17477591040 Bytes) Geometry : Cyl: 33865, Hds: 16, Sctrs: 63 : = 16667 MB (17477591040 Bytes) Disk type : Dynamic hard disk Checksum : 0xffffec8c|0xffffec8c (Good!) UUID : 1bfda481-dd4d-43aa-8f3a-84689b5ab3d7 Saved state : No Hidden : 0 VHD Header Summary: ------------------- Cookie : cxsparse Data offset (unusd) : 18446744073709 Table offset : 1536 Header version : 0x00010000 Max BAT size : 8334 Block size : 2097152 (2 MB) Parent name : Parent UUID : 00000000-0000-0000-0000-000000000000 Parent timestamp : Sat Jan 1 00:00:00 2000 Checksum : 0xfffff3c9|0xfffff3c9 (Good!) vhd-utils output:: VHD Footer Summary: ------------------- Cookie : conectix Features : (0x00000002) File format version : Major: 1, Minor: 0 Data offset : 512 Timestamp : Tue Oct 8 09:18:54 2019 Creator Application : 'tap' Creator version : Major: 1, Minor: 3 Creator OS : Unknown! Original disk size : 16668 MB (17477664768 Bytes) Current disk size : 16668 MB (17477664768 Bytes) Geometry : Cyl: 33865, Hds: 16, Sctrs: 63 : = 16667 MB (17477591040 Bytes) Disk type : Dynamic hard disk Checksum : 0xffffeebb|0xffffeebb (Good!) UUID : 14f2710a-b9b8-48f7-94bb-005ba6d566b2 Saved state : No Hidden : 0 VHD Header Summary: ------------------- Cookie : cxsparse Data offset (unusd) : 18446744073709 Table offset : 1536 Header version : 0x00010000 Max BAT size : 8334 Block size : 2097152 (2 MB) Parent name : Parent UUID : 00000000-0000-0000-0000-000000000000 Parent timestamp : Sat Jan 1 00:00:00 2000 Checksum : 0xfffff3c9|0xfffff3c9 (Good!) VHD Batmap Summary: ------------------- Batmap offset : 35840 Batmap size (secs) : 3 Batmap version : 0x00010002 Checksum : 0xfffbf214|0xfffbf214 (Good!) This does upload and boot in RAX, but the root disk does not appear to grow correctly. Emperically, it also seems that fixed sized disks (generated with ``subformat=fixed``) will not import (at least into Rackspace). I also tried resizing the dynamic ``vhd`` (with ``vhd-util resize --debug -n ./test.vhd -s $((32 * 1024 * 1024 )) -j resize.log``), which looked correct in ``vhd-util`` output (``Current disk size`` grew) but Rackspace would not import this image. qemu patch ========== Applies against qemu at HEAD ``16884391c750d0c5e863f55ad7aaaa146fc5181e`` :: diff --git a/block/vpc.c b/block/vpc.c index a655502..d1716f0 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -60,6 +60,7 @@ enum vhd_type { #define VHD_MAX_GEOMETRY (VHD_CHS_MAX_C * VHD_CHS_MAX_H * VHD_CHS_MAX_S) #define VPC_OPT_FORCE_SIZE "force_size" +#define VPC_OPT_XENSERVER_COMPAT "xenserver_compat" /* always big-endian */ typedef struct vhd_footer { @@ -1042,12 +1043,16 @@ static int coroutine_fn vpc_co_create(BlockdevCreateOptions *opts, memset(buf, 0, 1024); memcpy(footer->creator, "conectix", 8); - if (vpc_opts->force_size) { + if (vpc_opts->xenserver_compat) { + memcpy(footer->creator_app, "tap\0", 4); + memcpy(footer->creator_os, "\0\0\0\0", 4); + } else if (vpc_opts->force_size) { memcpy(footer->creator_app, "qem2", 4); + memcpy(footer->creator_os, "Wi2k", 4); } else { memcpy(footer->creator_app, "qemu", 4); + memcpy(footer->creator_os, "Wi2k", 4); } - memcpy(footer->creator_os, "Wi2k", 4); footer->features = cpu_to_be32(0x02); footer->version = cpu_to_be32(0x00010000); @@ -1058,9 +1063,14 @@ static int coroutine_fn vpc_co_create(BlockdevCreateOptions *opts, } footer->timestamp = cpu_to_be32(time(NULL) - VHD_TIMESTAMP_BASE); - /* Version of Virtual PC 2007 */ - footer->major = cpu_to_be16(0x0005); - footer->minor = cpu_to_be16(0x0003); + if (vpc_opts->xenserver_compat) { + footer->major = cpu_to_be16(0x0001); + footer->minor = cpu_to_be16(0x0000); + } else { + /* Version of Virtual PC 2007 */ + footer->major = cpu_to_be16(0x0005); + footer->minor = cpu_to_be16(0x0003); + } footer->orig_size = cpu_to_be64(total_size); footer->current_size = cpu_to_be64(total_size); footer->cyls = cpu_to_be16(cyls); @@ -1101,6 +1111,7 @@ static int coroutine_fn vpc_co_create_opts(const char *filename, static const QDictRenames opt_renames[] = { { VPC_OPT_FORCE_SIZE, "force-size" }, + { VPC_OPT_XENSERVER_COMPAT, "xenserver-compat" }, { NULL, NULL }, }; @@ -1220,6 +1231,11 @@ static QemuOptsList vpc_create_opts = { "specified, rather than using the nearest CHS-based " "calculation" }, + { + .name = VPC_OPT_XENSERVER_COMPAT, + .type = QEMU_OPT_BOOL, + .help = "Set creator to tap" + }, { /* end of list */ } } }; diff --git a/qapi/block-core.json b/qapi/block-core.json index aa97ee2..68daa3c 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -4669,6 +4669,7 @@ # @force-size Force use of the exact byte size instead of rounding to the # next size that can be represented in CHS geometry # (default: false) +# @xenserver-compat Xenserver comapt # # Since: 2.12 ## @@ -4676,7 +4677,9 @@ 'data': { 'file': 'BlockdevRef', 'size': 'size', '*subformat': 'BlockdevVpcSubformat', - '*force-size': 'bool' } } + '*force-size': 'bool', + '*xenserver-compat': 'bool' + } } ## # @BlockdevCreateOptions: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/elements.rst0000664000175000017500000000042015201026231020464 0ustar00zuulzuulElements ======== Elements are found in the subdirectory elements. Each element is in a directory named after the element itself. Elements *should* have a README.rst in the root of the element directory describing what it is for. .. toctree:: :glob: elements/*/* ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/index.rst0000664000175000017500000000310315201026231017760 0ustar00zuulzuulDiskimage-builder Documentation =============================== ``diskimage-builder`` is a tool for automatically building customized operating-system images for use in clouds and other environments. It includes support for building images based on many major distributions and can produce cloud-images in all common formats (``qcow2``, ``vhd``, ``raw``, etc), bare metal file-system images and ram-disk images. These images are composed from the many included ``elements``; ``diskimage-builder`` acts as a framework to easily add your own elements for even further customization. ``diskimage-builder`` is used extensively by the `TripleO project `__ and within `OpenStack Infrastructure `__. Code ---- Release notes for the latest and previous versions are available at: * `https://docs.openstack.org/releasenotes/diskimage-builder/ `__ The code is available at: * `https://opendev.org/openstack/diskimage-builder/ `__ Issues ------ Issues are tracked on launchpad at: * ``__ Communication ------------- Communication among the diskimage-builder developers happens on IRC in ``#openstack-dib`` on OFTC and on the ``openstack-discuss`` mailing list (``openstack-discuss@lists.openstack.org``). Table of Contents ----------------- .. toctree:: :maxdepth: 2 user_guide/index developer/index elements specs/README ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4262388 diskimage_builder-3.42.0/doc/source/specs/0000775000175000017500000000000015201026275017247 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/specs/README.rst0000664000175000017500000000635115201026231020733 0ustar00zuulzuul================================ diskimage-builder Specifications ================================ Overview ======== This directory is used to hold approved design specifications for changes to the diskimage-builder project. Reviews of the specs are done in gerrit, using a similar workflow to how we review and merge changes to the code itself. For specific policies around specification review, refer to the end of this document. The layout of this directory is:: specs/v/ Where there are two sub-directories: - specs/v/approved: specifications approved but not yet implemented - specs/v/implemented: implemented specifications - specs/v/backlog: unassigned specifications The lifecycle of a specification -------------------------------- Developers proposing a specification should propose a new file in the ``approved`` directory. diskimage-builder-core will review the change in the usual manner for the project, and eventually it will get merged if a consensus is reached. When a specification has been implemented either the developer or someone from diskimage-builder-core will move the implemented specification from the ``approved`` directory to the ``implemented`` directory. It is important to create redirects when this is done so that existing links to the approved specification are not broken. Redirects aren't symbolic links, they are defined in a file which sphinx consumes. An example is at ``specs/v1/redirects``. This directory structure allows you to see what we thought about doing, decided to do, and actually got done. Users interested in functionality in a given release should only refer to the ``implemented`` directory. Example specifications ---------------------- You can find an example spec in :doc:`v1/approved/v1-template` Backlog specifications ---------------------- Additionally, we allow the proposal of specifications that do not have a developer assigned to them. These are proposed for review in the same manner as above, but are added to:: specs/backlog/approved Specifications in this directory indicate the original author has either become unavailable, or has indicated that they are not going to implement the specification. The specifications found here are available as projects for people looking to get involved with diskimage-builder. If you are interested in claiming a spec, start by posting a review for the specification that moves it from this directory to the next active release. Please set yourself as the new `primary assignee` and maintain the original author in the `other contributors` list. Specification review policies ============================= There are some special review policies which diskimage-builder-core will apply when reviewing proposed specifications. They are: Trivial specifications ---------------------- Proposed changes which are trivial (very small amounts of code) and don't change any of our public APIs are sometimes not required to provide a specification. The decision of whether something is trivial or not is a judgement made by the author or by consensus of the project cores, generally trying to err on the side of spec creation. Approved Specifications ======================= .. toctree:: :glob: v1/approved/* ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.301236 diskimage_builder-3.42.0/doc/source/specs/v1/0000775000175000017500000000000015201026275017575 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4272387 diskimage_builder-3.42.0/doc/source/specs/v1/approved/0000775000175000017500000000000015201026275021415 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/specs/v1/approved/block-device-lvl1-partitioning.rst0000664000175000017500000001565115201026231030057 0ustar00zuulzuule. This work is licensed under a Creative Commons Attribution 3.0 Unported License. http://creativecommons.org/licenses/by/3.0/legalcode ======================================== Block Device Setup Level 1: Partitioning ======================================== During the creation of a disk image (e.g. for a VM), there is the need to create, setup, configure and afterwards detach some kind of storage where the newly installed OS can be copied to or directly installed in. Remark ------ The implementation for this proposed changed already exists, was discussed and is currently waiting for reviews [1]. To have a complete overview over the block device setup, this document is provided. The dependencies are not implemented as they should be, because * the spec process is currently in the phase of discussion and not finalized [2], * the implementation was finished and reviewed before the spec process was described. [1] Problem description =================== When setting up a block device there is the need to partitioning the block device. Use Cases --------- User (Actor: End User) wants to create multiple partitions in multiple block devices where the new system is installed in. The user wants to specify if the image should be optimized for speed or for size. The user wants the same behavior independently of the current host or target OS. Proposed change =============== Move the partitioning functionality from `elements/vm/block-device.d/10-partition` to a new block_device python module: `level1/partitioning.py`. Instead of using a program or a library, the data is written directly with the help of python `file.write()` into the disk image. Alternatives ------------ The existing implementation uses the `parted` program (old versions of DIB were using `sfdisk`). The first implementations of this change used the python-parted library. All these approaches have a major drawback: they automatically *optimize* based on information collected on the host system - and not of the target system. Therefore the resulting partitioning layout may lead to a degradation of performance on the target system. A change in these external programs and libraries also lead to errors during a DIB run [4] or there are general issues [7]. Also everything build around GNU parted falls under the GPL2 (not LGPL2) license - which is incompatible with the currently used Apache license in diskimage-builder. API impact ---------- Extends the (optional) environment variable ``DIB_BLOCK_DEVICE_CONFIG``: a JSON structure to configure the (complete) block device setup. For this proposal the second entry in the original list will be used (the first part (as described in [5]) is used by the level 0 modules). The name of this module is `partitioning` (element[0]). The value (element[1]) is a dictionary. For each disk that should be partitioned there exists one entry in the dictionary. The key is the name of the disk (see [5] how to specify names for block device level 0). The value is a dictionary that defines the partitioning of each disk. There are the following key / value pairs to define one disk: label (mandatory) Possible values: 'mbr' This uses the Master Boot Record (MBR) layout for the disk. (Later on this can be extended, e.g. using GPT). align (optional - default value '1MiB') Set the alignment of the partition. This must be a multiple of the block size (i.e. 512 bytes). The default of 1MiB (~ 2048 * 512 bytes blocks) is the default for modern systems and known to perform well on a wide range of targets [6]. For each partition there might be some space that is not used - which is `align` - 512 bytes. For the default of 1MiB exactly 1048064 bytes (= 1 MiB - 512 byte) are not used in the partition itself. Please note that if a boot loader should be written to the disk or partition, there is a need for some space. E.g. grub needs 63 * 512 byte blocks between the MBR and the start of the partition data; this means when grub will be installed, the `align` must be set at least to 64 * 512 byte = 32 KiB. partitions (mandatory) A list of dictionaries. Each dictionary describes one partition. The following key / value pairs can be given for each partition: name (mandatory) The name of the partition. With the help of this name, the partition can later be referenced, e.g. while creating a file system. flags (optional) List of flags for the partition. Default: empty. Possible values: boot Sets the boot flag for the partition size (mandatory) The size of the partition. The size can either be an absolute number using units like `10GiB` or `1.75TB` or relative (percentage) numbers: in the later case the size is calculated based on the remaining free space. Example: .. code-block:: yaml ["partitioning", {"rootdisk": { "label": "mbr", "partitions": [{"name": "part-01", "flags": ["boot"], "size": "100%"}]}}] Security impact --------------- None - functionality stays the same. Other end user impact --------------------- None. Performance Impact ------------------ Measurements showed there is a performance degradation for the target system of the partition table is not correctly aligned: writing takes about three times longer on an incorrect aligned system vs. one that is correctly aligned. Implementation ============== Assignee(s) ----------- Primary assignee: ansreas (andreas@florath.net) Work Items ---------- None - this is already a small part of a bigger change [1]. Dependencies ============ None. Testing ======= The refactoring introduces no new test cases: the functionality is tested during each existing test building VM images. Documentation Impact ==================== End user: the additional environment variable is described. References ========== [1] Refactor: block-device handling (partitioning) https://review.opendev.org/322671 [2] Add specs dir https://review.opendev.org/336109 [3] Old implementation using parted-lib https://review.opendev.org/#/c/322671/1..7/elements/block-device/pylib/block-device/level1/Partitioning.py [4] ERROR: embedding is not possible, but this is required for cross-disk install http://lists.openstack.org/pipermail/openstack-dev/2016-June/097789.html [5] Refactor: block-device handling (local loop) https://review.opendev.org/319591 [6] Proper alignment of partitions on an Advanced Format HDD using Parted http://askubuntu.com/questions/201164/proper-alignment-of-partitions-on-an-advanced-format-hdd-using-parted [7] Red Hat Enterprise Linux 6 - Creating a 7TB Partition Using parted Always Shows "The resulting partition is not properly aligned for best performance" http://h20564.www2.hpe.com/hpsc/doc/public/display?docId=emr_na-c03479326&DocLang=en&docLocale=en_US&jumpid=reg_r11944_uken_c-001_title_r0001 [8] Spec for changing the block device handling https://review.opendev.org/336946 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/specs/v1/approved/block-device-overview.rst0000664000175000017500000001204515201026231026334 0ustar00zuulzuul.. This work is licensed under a Creative Commons Attribution 3.0 Unported License. http://creativecommons.org/licenses/by/3.0/legalcode ================== Block Device Setup ================== During the creation of a disk image (e.g. for a VM), there is the need to create, setup, configure and afterwards detach some kind of storage where the newly installed OS can be copied to or directly installed in. Problem description =================== Currently dib is somewhat limited when it comes to setting up the block device: only one partition that can be used for data. LVM, encryption, multi-device or installation in an already existing block device is not supported. In addition there are several places (main, lib, elements) where the current way of handling the block device is used (spread knowledge and implementation). Also it is not possible, to implement the handling as different elements: it is not possible to pass results of one element in the same phase to another element. Passing results from one phase to dib main is limited. Use Cases --------- Possible use cases are (Actor: End User) #. User wants to use an existing block device to install an system image in (like hd, iSCSI, SAN lun, ...). #. User wants that the system will be installed in multiple partitions. #. User wants that the partitioning is done in a specific way (optimize for speed, optimize for size). #. User wants to use LVM to install the system in (multiple PV, VG and LV). #. User wants to encrypt a partition or a LV where (parts) of the system are installed in. #. User wants specific file systems on specific partitions or LVs. Please note that these are only examples and details are described and implemented by different sub-specs. Proposed change =============== Because of the current way to execute elements, it is not possible to have different elements for each feature. Instead the changes will be implemented in a python module 'block_device' placed in the 'diskimage_builder' directory. The entry-point mechanism is used to create callable python programs. These python programs are directly called from within the dib-main. There is the need to implement some functions or classes that take care about common used new functionality: e.g. storing state between phases, calling python sub-modules and passing arguments around. These functionality is implemented as needed - therefore it is most likely that the first patch implements also big parts of these infrastructure tasks. Alternatives ------------ #. Rewrite DIB in the way that elements can interchange data, even if they are called during one phase. This would influence the way all existing elements are called - and might lead to unpredictable results. #. In addition there is the need to introduce at least two additional phases: because major parts of the block device handling are currently done in main and these must be passed over to elements. #. Another way would be to implement everything in one element: this has the disadvantage, that other elements are not allowed to use the 'block_device' phase any longer and also passing around configuration and results is still not possible (see [3]). API impact ---------- Is described in the sub-elements. Security impact --------------- Is described in the sub-elements. Other end user impact --------------------- Paradigm changes from execute script to configuration for block_device phase. Performance Impact ------------------ Is described in the sub-elements. Implementation ============== Assignee(s) ----------- Primary assignee: ansreas (andreas@florath.net) Would be good, if other people would support this - and specify and implement modules. Work Items ---------- This is an overview over changes in the block device layer. Each level or module needs it's own spec. A first step is to reimplement the existing functionality, this contains: #. Level 0: Local Loop module Use loop device on local image file (This is already implemented: [1]) #. Level 1: partitioning module (This is already implemented: [4]) #. Level 2: Create File System An initial module uses ext4 only #. Level 3: Mounting As a second step the following functionality can be added: * Level 1: LVM module * Level 2: Create File System (swap) * Level 2: Create File System (vfat, needed for UEFI) * Level 2: Create File System (xfs) Of course any other functionality can also be added when needed and wanted. Dependencies ============ Is described in the sub-elements. Testing ======= Is described in the sub-elements. Documentation Impact ==================== Is described in the sub-elements. References ========== [1] Implementation of Level 0: Local Loop module https://review.opendev.org/319591 [2] 'Block Device Setup for Disk-Image-Builder' https://etherpad.openstack.org/p/C80jjsAs4x [3] partitioning-parted This was a first try to implement everything as an element - it shows the limitation. https://review.opendev.org/313938 [4] Implementation of Level 1: partitioning module https://review.opendev.org/322671 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/specs/v1/approved/v1-template.rst0000664000175000017500000001352115201026231024300 0ustar00zuulzuul.. This work is licensed under a Creative Commons Attribution 3.0 Unported License. http://creativecommons.org/licenses/by/3.0/legalcode ============================================== Example Spec - The title of your specification ============================================== Introduction paragraph -- why are we doing anything? A single paragraph of prose that operators can understand. The title and this first paragraph should be used as the subject line and body of the commit message respectively. Some notes about the diskimage-bulider spec process: * Not all changes need a spec. For more information see * The aim of this document is first to define the problem we need to solve, and second agree the overall approach to solve that problem. * This is not intended to be extensive documentation for a new feature. * You should aim to get your spec approved before writing your code. While you are free to write prototypes and code before getting your spec approved, its possible that the outcome of the spec review process leads you towards a fundamentally different solution than you first envisaged. * But, API changes are held to a much higher level of scrutiny. As soon as an API change merges, we must assume it could be in production somewhere, and as such, we then need to support that API change forever. To avoid getting that wrong, we do want lots of details about API changes upfront. Some notes about using this template: * Your spec should be in ReSTructured text, like this template. * Please wrap text at 79 columns. * Please do not delete any of the sections in this template. If you have nothing to say for a whole section, just write: None * For help with syntax, see http://sphinx-doc.org/rest.html * If you would like to provide a diagram with your spec, ascii diagrams are required. http://asciiflow.com/ is a very nice tool to assist with making ascii diagrams. The reason for this is that the tool used to review specs is based purely on plain text. Plain text will allow review to proceed without having to look at additional files which can not be viewed in gerrit. It will also allow inline feedback on the diagram itself. Problem description =================== A detailed description of the problem. What problem is this blueprint addressing? Use Cases --------- What use cases does this address? What impact on actors does this change have? Ensure you are clear about the actors in each use case: Developer, End User, etc. Proposed change =============== Here is where you cover the change you propose to make in detail. How do you propose to solve this problem? If this is one part of a larger effort make it clear where this piece ends. In other words, what's the scope of this effort? At this point, if you would like to just get feedback on if the problem and proposed change fit in diskimage-builder, you can stop here and post this for review to get preliminary feedback. If so please say: Posting to get preliminary feedback on the scope of this spec. Alternatives ------------ What other ways could we do this thing? Why aren't we using those? This doesn't have to be a full literature review, but it should demonstrate that thought has been put into why the proposed solution is an appropriate one. API impact ---------- Describe how this will effect our public interfaces. Will this be adding new environment variables? Deprecating existing ones? Adding a new command line argument? Security impact --------------- Describe any potential security impact on the system. Other end user impact --------------------- Aside from the API, are there other ways a user will interact with this feature? Performance Impact ------------------ Describe any potential performance impact on the system, for example how often will new code be called, does it perform any intense processing or data manipulation. Implementation ============== Assignee(s) ----------- Who is leading the writing of the code? Or is this a blueprint where you're throwing it out there to see who picks it up? If more than one person is working on the implementation, please designate the primary author and contact. Primary assignee: Other contributors: Work Items ---------- Work items or tasks -- break the feature up into the things that need to be done to implement it. Those parts might end up being done by different people, but we're mostly trying to understand the timeline for implementation. Dependencies ============ * Include specific references to specs in diskimage-builder or in other projects, that this one either depends on or is related to. * If this requires functionality of another project that is not currently used by diskimage-builder document that fact. Testing ======= Please discuss the important scenarios needed to test here, as well as specific edge cases we should be ensuring work correctly. For each scenario please specify if this requires specialized hardware, or software. Is this untestable in gate given current limitations (specific hardware / software configurations available)? If so, are there mitigation plans (gate enhancements, etc). Documentation Impact ==================== Which audiences are affected most by this change, and which documentation files need to be changed. Do we need to add information about this change to the developer guide, the user guide, certain elements, etc. References ========== Please add any useful references here. You are not required to have any reference. Moreover, this specification should still make sense when your references are unavailable. Examples of what you could include are: * Links to mailing list or IRC discussions * Links to notes from a summit session * Links to relevant research, if appropriate * Related specifications as appropriate * Anything else you feel it is worthwhile to refer to ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4272387 diskimage_builder-3.42.0/doc/source/user_guide/0000775000175000017500000000000015201026275020265 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/user_guide/building_an_image.rst0000664000175000017500000006223615201026231024435 0ustar00zuulzuulBuilding An Image ================= Now that you have diskimage-builder properly :doc:`installed ` you can get started by building your first disk image. .. note:: diskimage-builder requires a linux machine able to mount filesystems and execute code for the target CPU architecture of the image. (e.g.; building an ARM image requires a linux machine that can run ARM code). VM Image -------- Our first image is going to be a bootable vm image using one of the standard supported distribution :doc:`elements <../elements>` (Ubuntu or Fedora). The following command will start our image build (distro must be either 'ubuntu' or 'fedora'): :: disk-image-create vm This will create a qcow2 file 'image.qcow2' which can then be booted. Images can also be defined with YAML and built with the `diskimage-builder`. With an `image.yaml` file containing: .. code-block:: yaml - elements: - - vm An image is built with: :: diskimage-builder image.yaml Run `diskimage-builder --help` full description of the YAML attributes supported. Elements -------- It is important to note that we are passing in a list of :doc:`elements <../elements>` to disk-image-create in our above command. Elements are how we decide what goes into our image and what modifications will be performed. Some elements provide a root filesystem, such as the ubuntu or fedora element in our example above, which other elements modify to create our image. At least one of these 'distro elements' must be specified when performing an image build. It's worth pointing out that there are many distro elements (you can even create your own), and even multiples for some of the distros. This is because there are often multiple ways to install a distro which are very different. For example: One distro element might use a cloud image while another uses a package installation tool to build a root filesystem for the same distro. Other elements modify our image in some way. The 'vm' element in our example above ensures that our image has a bootloader properly installed. This is only needed for certain use cases and certain output formats and therefore it is not performed by default. Output Formats -------------- By default a qcow2 image is created by the disk-image-create command. Other output formats may be specified using the `-t ` argument. Multiple output formats can also be specified by comma separation. The supported output formats are: * qcow2 * tar * tgz * squashfs * vhd * docker * raw When building a tgz image, note that the `DIB_GZIP_BIN` environment variable can be used to set the path of the gzip executable. Disk Image Layout ----------------- The disk image layout (like number of images, partitions, LVM, disk encryption) is something which should be set up during the initial image build: it is mostly not possible to change these things later on. There are currently two defaults: * When using the ``vm`` element, an element that provides ``block-device`` should be included. Available ``block-device-*`` elements cover the common case of a single partition that fills up the whole disk and used as root device. Currently there are MBR, GPT and EFI versions. For example, to use a GPT disk you could build with :: disk-image-create -o output.qcow vm block-device-gpt ubuntu-minimal Or with `diskimage-builder` YAML .. code-block:: yaml - imagename: output.qcow elements: [vm, block-device-gpt, ubuntu-minimal] * When not using the ``vm`` element a plain filesystem image, without any partitioning, is created. If you wish to customise the top-level ``block-device-default.yaml`` file from one of the ``block-device-*`` elements, set the environment variable `DIB_BLOCK_DEVICE_CONFIG`. This variable must hold YAML structured configuration data or be a ``file://`` URL reference to a on-disk configuration file. There are a lot of different options for the different levels. The following sections describe each level in detail. General Remarks +++++++++++++++ In general each module that depends on another module has a `base` element that points to the depending base. Also each module has a `name` that can be used to reference the module. Tree-Like vs. Complete Digraph Configuration ++++++++++++++++++++++++++++++++++++++++++++ The configuration is specified as a digraph_. Each module is a node; a edge is the relation of the current element to its `base`. Because the general digraph_ approach is somewhat complex when it comes to write it down, the configuration can also be given as a tree_. .. _digraph: https://en.wikipedia.org/wiki/Directed_graph .. _tree: https://en.wikipedia.org/wiki/Tree_(graph_theory) Example: The tree like notation .. code-block:: yaml mkfs: name: root_fs base: root_part mount: mount_point: / is exactly the same as writing .. code-block:: yaml mkfs: name: root_fs base: root_part mount: name: mount_root_fs base: root_fs mount_point: / Non existing `name` and `base` entries in the tree notation are automatically generated: the `name` is the name of the base module prepended by the type-name of the module itself; the `base` element is automatically set to the parent node in the tree. In mostly all cases the much simpler tree notation can be used. Nevertheless there are some use cases when the more general digraph notation is needed. Example: when there is the need to combine two or more modules into one new, like combining a couple of physical volumes into one volume group. Tree and digraph notations can be mixed as needed in a configuration. Limitations +++++++++++ To provide an interface towards the existing elements, there are currently three fixed keys used - which are not configurable: * `root-label`: this is the label of the block device that is mounted at `/`. * `image-block-partition`: if there is a block device with the name `root` this is used else the block device with the name `image0` is used. * `image-path`: the path of the image that contains the root file system is taken from the `image0`. Level 0 +++++++ Module: Local Loop .................. This module generates a local image file and uses the loop device to create a block device from it. The symbolic name for this module is `local_loop`. Configuration options: name (mandatory) The name of the image. This is used as the name for the image in the file system and also as a symbolic name to be able to reference this image (e.g. to create a partition table on this disk). size (optional) The size of the disk. The size can be expressed using unit names like TiB (1024^4 bytes) or GB (1000^3 bytes). Examples: 2.5GiB, 12KB. If the size is not specified here, the size as given to disk-image-create (--image-size) or the automatically computed size is used. directory (optional) The directory where the image is created. block_size (optional) Defaults to 512 bytes. Usable to set a different logical block size, or in loopback context sector size, which will govern how partitioning and filesystem utilities will interact with the device and ultimately the block layout on disk. Examples: 512, 4096. This option is critical if you have block devices which natively operate with 4KiB block sizes and need to craft an image to use boot from those devices using a GPT partition table. This setting can also be asserted using a DIB_BLOCK_SIZE environment variable which may be useful for users who need to craft similar, but different block size images without the need to separately maintain different block device YAML documents. Please keep in mind, with larger block sizes, total disk image sizes *and* partition sizes on the disk image will need to be perfectly divisible by the block size being asserted. Example: .. code-block:: yaml local_loop: name: image0 local_loop: name: data_image size: 7.5GiB directory: /var/tmp This creates two image files and uses the loop device to use them as block devices. One image file called `image0` is created with default size in the default temp directory. The second image has the size of 7.5GiB and is created in the `/var/tmp` folder. Level 1 +++++++ Module: Partitioning .................... This module generates partitions on existing block devices. This means that it is possible to take any kind of block device (e.g. LVM, encrypted, ...) and create partition information in it. The symbolic name for this module is `partitioning`. MBR *** It is possible to create primary or logical partitions or a mix of them. The numbering of the primary partitions will start at 1, e.g. `/dev/vda1`; logical partitions will typically start with `5`, e.g. `/dev/vda5` for the first partition, `/dev/vda6` for the second and so on. The number of logical partitions created by this module is theoretical unlimited and it was tested with more than 1000 partitions inside one block device. Nevertheless the Linux kernel and different tools (like `parted`, `sfdisk`, `fdisk`) have some default maximum number of partitions that they can handle. Please consult the documentation of the appropriate software you plan to use and adapt the number of partitions. Partitions are created in the order they are configured. Primary partitions - if needed - must be first in the list. GPT *** GPT partitioning requires the ``sgdisk`` tool to be available. Options ******* There are the following key / value pairs to define one partition table: base (mandatory) The base device to create the partitions in. label (mandatory) Possible values: 'mbr', 'gpt' Configure use of either the Master Boot Record (MBR) or GUID Partition Table (GPT) formats align (optional - default value '1MiB'; MBR only) Set the alignment of the partition. This must be a multiple of the block size (i.e. 512 bytes). The default of 1MiB (~ 2048 * 512 bytes blocks) is the default for modern systems and known to perform well on a wide range of targets. For each partition there might be some space that is not used - which is `align` - 512 bytes. For the default of 1MiB exactly 1048064 bytes (= 1 MiB - 512 byte) are not used in the partition itself. Please note that if a boot loader should be written to the disk or partition, there is a need for some space. E.g. grub needs 63 * 512 byte blocks between the MBR and the start of the partition data; this means when grub will be installed, the `align` must be set at least to 64 * 512 byte = 32 KiB. partitions (mandatory) A list of dictionaries. Each dictionary describes one partition. The following key / value pairs can be given for each partition: name (mandatory) The name of the partition. With the help of this name, the partition can later be referenced, e.g. when creating a file system. flags (optional) List of flags for the partition. Default: empty. Possible values: boot (MBR only) Sets the boot flag for the partition primary (MBR only) Partition should be a primary partition. If not set a logical partition will be created. size (mandatory) The size of the partition. The size can either be an absolute number using units like `10GiB` or `1.75TB` or relative (percentage) numbers: in the later case the size is calculated based on the remaining free space. type (optional) The partition type stored in the MBR or GPT partition table entry. For MBR the default value is '0x83' (Linux Default partition). Any valid one byte hexadecimal value may be specified here. For GPT the default value is '8300' (Linux Default partition). Any valid two byte hexadecimal value may be specified here. Due to ``sgdisk`` leading '0x' should not be used. Example: .. code-block:: yaml - partitioning: base: image0 label: mbr partitions: - name: part-01 flags: [ boot ] size: 1GiB - name: part-02 size: 100% - partitioning: base: data_image label: mbr partitions: - name: data0 size: 33% - name: data1 size: 50% - name: data2 size: 100% - partitioning: base: gpt_image label: gpt partitions: - name: ESP type: EF00 size: 16MiB - name: data1 size: 1GiB - name: lvmdata type: 8E00 size: 100% On the `image0` two partitions are created. The size of the first is 1GiB, the second uses the remaining free space. On the `data_image` three partitions are created: all are about 1/3 of the disk size. On the `gpt_image` three partitions are created: 16MiB one for EFI bootloader, 1GiB Linux filesystem one and rest of disk will be used for LVM partition. Module: LVM ........... This module generates volumes on existing block devices. This means that it is possible to take any previous created partition, and create volumes information in it. The symbolic name for this module is `lvm`. There are the following key / value pairs to define one set of volumes: pvs (mandatory) A list of dictionaries. Each dictionary describes one physical volume. vgs (mandatory) A list of dictionaries. Each dictionary describes one volume group. lvs (mandatory) A list of dictionaries. Each dictionary describes one logical volume. The following key / value pairs can be given for each `pvs`: name (mandatory) The name of the physical volume. With the help of this name, the physical volume can later be referenced, e.g. when creating a volume group. base (mandatory) The name of the partition where the physical volume needs to be created. options (optional) List of options for the physical volume. It can contain any option supported by the `pvcreate` command. The following key / value pairs can be given for each `vgs`: name (mandatory) The name of the volume group. With the help of this name, the volume group can later be referenced, e.g. when creating a logical volume. base (mandatory) The name(s) of the physical volumes where the volume groups needs to be created. As a volume group can be created on one or more physical volumes, this needs to be a list. options (optional) List of options for the volume group. It can contain any option supported by the `vgcreate` command. The following key / value pairs can be given for each `lvs`: name (mandatory) The name of the logical volume. With the help of this name, the logical volume can later be referenced, e.g. when creating a filesystem. base (mandatory) The name of the volume group where the logical volume needs to be created. size (optional) The exact size of the volume to be created. It accepts the same syntax as the -L flag of the `lvcreate` command. extents (optional) The relative size in extents of the volume to be created. It accepts the same syntax as the -l flag of the `lvcreate` command. Either size or extents need to be passed on the volume creation. options (optional) List of options for the logical volume. It can contain any option supported by the `lvcreate` command. type (optional) When set to `thin-pool` a thin pool volume will be created. When set to `thin` the thin volume will be backed by the thin pool named with the `thin-pool` key. thin-pool (optional) Name of the thin pool to use for this thin volume. Example: .. code-block:: yaml - lvm: name: lvm pvs: - name: pv options: ["--force"] base: root vgs: - name: vg base: ["pv"] options: ["--force"] lvs: - name: lv_root base: vg size: 1800M - name: lv_tmp base: vg size: 100M - name: lv_var base: vg size: 500M - name: lv_log base: vg size: 100M - name: lv_audit base: vg size: 100M - name: lv_home base: vg size: 200M On the `root` partition a physical volume is created. On that physical volume, a volume group is created. On top of this volume group, six logical volumes are created. Please note that in order to build images that are bootable using volumes, your ramdisk image will need to have that support. If the image you are using does not have it, you can add the needed modules and regenerate it, by including the `dracut-regenerate` element when building it. Level 2 +++++++ Module: Mkfs ............ This module creates file systems on the block device given as `base`. The following key / value pairs can be given: base (mandatory) The name of the block device where the filesystem will be created on. name (mandatory) The name of the partition. This can be used to reference (e.g. mounting) the filesystem. type (mandatory) The type of the filesystem, like `ext4` or `xfs`. label (optional - defaults to the name) The label of the filesystem. This can be used e.g. by grub or in the fstab. opts (optional - defaults to empty list) Options that will passed to the mkfs command. uuid (optional - no default / not used if not givem) The UUID of the filesystem. Not all file systems might support this. Currently there is support for `ext2`, `ext3`, `ext4` and `xfs`. Example: .. code-block:: yaml - mkfs: name: mkfs_root base: root type: ext4 label: cloudimage-root uuid: b733f302-0336-49c0-85f2-38ca109e8bdb opts: "-i 16384" Level 3 +++++++ Module: Mount ............. This module mounts a filesystem. The options are: base (mandatory) The name of the filesystem that will be mounted. name (mandatory) The name of the mount point. This can be used for reference the mount (e.g. creating the fstab). mount_point (mandatory) The mount point of the filesystem. There is no need to list the mount points in the correct order: an algorithm will automatically detect the mount order. Example: .. code-block:: yaml - mount: name: root_mnt base: mkfs_root mount_point: / Level 4 +++++++ Module: fstab ............. This module creates fstab entries. The following options exists. For details please consult the fstab man page. base (mandatory) The name of the mount point that will be written to fstab. name (mandatory) The name of the fstab entry. This can be used later on as reference - and is currently unused. options (optional, defaults to `default`) Special mount options can be given. This is used as the fourth field in the fstab entry. dump-freq (optional, defaults to 0 - don't dump) This is passed to dump to determine which filesystem should be dumped. This is used as the fifth field in the fstab entry. fsck-passno (optional, defaults to 2) Determines the order to run fsck. Please note that this should be set to 1 for the root file system. This is used as the sixth field in the fstab entry. Example: .. code-block:: yaml - fstab: name: var_log_fstab base: var_log_mnt options: nodev,nosuid dump-freq: 2 Legacy global filesystem configuration -------------------------------------- The ``disk-image-create`` tool has a number of historic global disk-related command-line options which are maintained for backwards compatibility. These options are merged as necessary by the block-device layer into the active configuration. If you are using more complicated block-device layouts with multiple partitions, you may need to take into account the special behaviour described below. The ``local_loop`` module will take it's default size from the following arguments: ``--image-size`` The size of loopback device which the image will be generated in, in gigabytes. If this is left unset, the size will be calculated from the on-disk size of the image and then scaled up by a fixed 60% factor. Can also set ``DIB_IMAGE_SIZE``. ``--image-extra-size`` Extra space to add when automatically calculating image size, in megabytes. This overrides the default 60% scale up as described above for ``--image-size``. Can also set ``DIB_IMAGE_EXTRA_SIZE``. The special node named ``mkfs_root`` is affected by the following; this reflects that the standard layout has only a single root partition so the options are, in effect, global for the default configuration. Note that if you are using multiple partitions, settings such as ``--mkfs-options`` will *not* apply to other partitions. The file-system type for the ``mkfs_root`` node is set by the ``FS_TYPE`` environment variable, and defaults to ``ext4``. ``xfs`` should also work. There is no command-line argument for this. The following options also affect the ``mkfs_root`` node configuration: ``--mkfs-options`` Options passed to mkfs when making the root partition. For ``ext4`` partitions, this by default sets a 4k byte-to-inode ratio (see below) and a default journal size of 64MiB. Note ``--mkfs-options`` are options passed to the mfks *driver* (i.e. ``mkfs.ext4``) rather than ``mkfs`` itself (i.e. arguments come after the initial ``mkfs -t `` argument). You also need to be careful with quoting. Can also set ``MKFS_OPTS``. By default, ``disk-image-create`` uses a 4k byte-to-inode ratio when creating the filesystem in the image. This allows large 'whole-system' images to utilize several TB disks without exhausting inodes. In contrast, when creating images intended for tenant instances, this ratio consumes more disk space than an end-user would expect (e.g. a 50GB root disk has 47GB available). If the image is intended to run within a tens to hundrededs of gigabyte disk, setting the byte-to-inode ratio to the ext4 default of 16k will allow for more usable space on the instance. The default can be overridden by passing ``'-i 16384'`` as a ``--mkfs-options`` argument. ``--mkfs-journal-size`` Only valid for ``FS_TYPE==ext4``. This value set the filesystem journal size in MB; overriding the default of 64MiB. Note the image size will be grown to fit the journal, unless ``DIB_IMAGE_SIZE`` is explicitly set. Can also set ``DIB_JOURNAL_SIZE``. ``--max-online-resize`` Only valid for ``FS_TYPE==ext4``; this value sets the maximum filesystem blocks when resizing. Can also set ``MAX_ONLINE_RESIZE``. ``--root-label`` The file-system label specified when creating the root file system. Defaults to ``cloudimg-rootfs`` for ``ext4`` and ``img-rootfs`` for ``xfs``. Can also set ``ROOT_LABEL``. Speedups -------- If you have 4GB of available physical RAM (as reported by /proc/meminfo MemTotal), or more, diskimage-builder will create a tmpfs mount to build the image in. This will improve image build time by building it in RAM. By default, the tmpfs file system uses 50% of the available RAM. Therefore, the RAM should be at least the double of the minimum tmpfs size required. For larger images, when no sufficient amount of RAM is available, tmpfs can be disabled completely by passing --no-tmpfs to disk-image-create. ramdisk-image-create builds a regular image and then within that image creates ramdisk. If tmpfs is not used, you will need enough room in /tmp to store two uncompressed cloud images. If tmpfs is used, you would still need /tmp space for one uncompressed cloud image and about 20% of that image for working files. Nameservers ----------- To ensure elements can access the network, ``disk-image-create`` replaces the ``/etc/resolv.conf`` within the chroot with a copy of the host's file early in the image creation process. The final ``/etc/resolv.conf`` can be controlled in a number of ways. If, during the build, the ``/etc/resolv.conf`` file within the chroot is replaced with a symlink, this will be retained in the final image [1]_. If the file is marked immutable, it will also not be touched. .. [1] This somewhat odd case was added for installation of the ``resolvconf`` package, which replaces ``/etc/resolv.conf`` with a symlink to it's version. Depending on its contents, and what comes after the installation in the build, this mostly works. If you would like specific contents within the final ``/etc/resolv.conf`` you can place them into ``/etc/resolv.conf.ORIG`` during the build. As one of the final steps, this file will be ``mv`` to ``/etc/resolv.conf``. Chosing an Architecture ----------------------- If needed you can specify an override the architecture selection by passing a ``-a`` argument like: :: disk-image-create -a ... Notes about PowerPC Architectures +++++++++++++++++++++++++++++++++ PowerPC can operate in either Big or Little Endian mode. ``ppc64`` always refers to Big Endian operation. When running in little endian mode it can be referred to as ``ppc64le`` or ``ppc64el``. Typically ``ppc64el`` refers to a ``.deb`` based distribution architecture, and ``ppc64le`` refers to a ``.rpm`` based distribution. Regardless of the distribution the kernel architecture is always ``ppc64le``. Notes about s390x (z Systems) Architecture ++++++++++++++++++++++++++++++++++++++++++ Images for s390x can only be build on s390x hosts. Trying to build it with the architecture override on other architecture will cause the build to fail. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/user_guide/index.rst0000664000175000017500000000020015201026231022106 0ustar00zuulzuulUser Guide ========== .. toctree:: :maxdepth: 1 supported_distros installation building_an_image install_types ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/user_guide/install_types.rst0000664000175000017500000000337615201026231023712 0ustar00zuulzuulInstall Types ============= Install types permit elements to be installed from different sources, such as git repositories, distribution packages, or pip. The default install type is 'source' but it can be modified on the disk-image-create command line via the --install-type option. For example you can set: --install-type=package to enable package installs by default. Alternately, you can also set DIB\_DEFAULT\_INSTALLTYPE. Many elements expose different install types. The different implementations live under `--install` directories under an element's install.d. The base element enables the chosen install type by symlinking the correct hook scripts under install.d directly. `` can be a string of alphanumeric and '-' characters, but typically corresponds to the element name. For example, the nova element would provide: nova/install.d/nova-package-install/74-nova nova/install.d/nova-source-install/74-nova The following symlink would be created for the package install type: install.d/74-nova -> nova-package-install/74-nova Or, for the source install type: install.d/74-nova -> nova-source-install/74-nova All other scripts that exist under install.d for an element will be executed as normal. This allows common install code to live in a script under install.d. To set the install type for an element define an environment variable `DIB_INSTALLTYPE_`. Note that if you used `-` characters in your install directory prefix, those need to be replaced with `_` in the environment variable. For example, to enable the package install type for the set of nova elements that use `nova` as the install type prefix, define the following: export DIB_INSTALLTYPE_nova=package ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/user_guide/installation.rst0000664000175000017500000000251015201026231023506 0ustar00zuulzuulInstallation ============ If your distribution does not provide packages, you should install ``diskimage-builder`` via ``pip``, mostly likely in a ``virtualenv`` to keep it separate. For details, see the installation section in the :ref:`dev_install`. Once installed, you will be able to :doc:`build images ` using ``disk-image-create`` or ``diskimage-builder`` and the elements included in the main ``diskimage-builder`` repository. Requirements ------------ Most image formats require the ``qemu-img`` tool which is provided by the ``qemu-utils`` package on Ubuntu/Debian or the ``qemu`` package on Fedora/RHEL/opensuse/Gentoo. When generating images with partitions, the ``kpartx`` tool is needed, which is provided by the ``kpartx`` package. Some image formats, such as ``VHD``, may require additional tools. Please see the ``disk-image-create`` help output for more information. Individual elements can also have additional dependencies for the build host. It is recommended you check the documentation for each element you are using to determine if there are any additional dependencies. Of particular note is the need for the `dev-python/pyyaml` package on Gentoo hosts. Package Installation -------------------- On Gentoo you can emerge diskimage-builder directly. :: emerge app-emulation/diskimage-builder ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/doc/source/user_guide/supported_distros.rst0000664000175000017500000001166115201026231024610 0ustar00zuulzuulTested Distributions -------------------- ``diskimage-builder`` can create many different types of targets composed of many different elements. For any release, the project considers the elements tested by the OpenDev gate continuous-integration jobs as stable. Practically, this means a change can not commit unless it has successfully built the elements described below under test. Build Host ========== The build-host is the platform used to create images. Unfortunately there is no concise answer as to the support status of all possible build-hosts. ``diskimage-builder`` has a complex relationship with the build-host depending on which target elements are being built. Image-based elements take an upstream ``.qcow2`` image, extract and customise it. Since ``diskimage-builder`` chroots into an already-complete environment, these elements generally work on any build-host, but there are complexities; for example some images ship an XFS-filesystem with options that some stable-distribution build-hosts can not read (and hence the build-host can not mount and extract the image). As another example, the ``-minimal`` elements run tools such as ``yum``, ``dnf``, ``apt`` on the build-host to create an initial ``chroot`` environment. Thus some combinations will not work; for example ``fedora-minimal`` for the latest versions may require a RPM that is not packaged on current stable versions of Ubuntu. Some versions of Ubuntu ship a ``debootstrap`` that has bugs preventing building other distributions, etc. Finally the ``containerfile`` elements use ``podman`` to extract a container-image and then customise that. Distributions vary in their podman version and various bugs related to this. The images used by the OpenDev's `Zuul `__ system are built by `Nodepool `__. Thus the simplest way to have the most supported build-host environment is to use ``diskimage-buidler`` installed in the `nodepool-builder container image `__. You can run ``disk-image-create`` directly from this container, e.g. :: docker run --rm --privileged --network host \ --env DIB_SHOW_IMAGE_USAGE=1 \ --env TMPDIR=/opt/dib_tmp \ -v nested_var_lib_containers:/var/lib/containers \ -v /var/run/dib_output:/var/run/dib_output \ -v /opt/dib_tmp:/opt/dib_tmp \ quay.io/zuul-ci/nodepool-builder \ disk-image-create -x -t qcow2 \ --no-tmpfs \ -o /var/run/dib_output/image -n The platform this container image is built upon is by extension the most-supported build host. Inspecting the `Dockerfile `__ is a good way to start building customised build-host environments. This is currently based on Debian Bullsye. Other distributions are not tested as build-hosts in the ``diskimage-builder`` gate. Testing and Targets =================== The stable targets are those that are tested; as noted no change can commit which would break this testing. There are two main testing paths: * end-to-end tests build an image, import it to an OpenStack environment, boot it and confirm basic operation. These tests use the ``nodepool-builder`` container environment to build the image to be tested. * functional tests build a complete output image. They do not perform boot tests. These tests run on Debian Bullseye. The canonical list of tests and the elements they build for any releae is kept in `.zuul.yaml/jobs.yaml `__. If this document differs to the defined tests, the Zuul configuration is correct. As of Feburary 2022, the default end-to-end testing covers the following elements on x86-64 * ``centos-minimal``: 8-stream and 9-stream * ``fedora-containerfile``: the latest Fedora. * ``ubuntu-minimal``: Ubuntu Xenial, Bionic and Focal * ``opensuse-minimal``: Leap 15.3 and Tumbleweed (non-voting) * ``gentoo``: (non-voting) * ``debian-minimal``: Bullseye * ``rocky-container``: Rocky Linux 8 We run functional (build-only) tests on the following elements and versions: * ``containerfile``: Ubuntu Focal * ``openeuler-minimal``: 22.03-LTS * ``centos`` : (image-based build) 8-stream and 9-stream * ``fedora`` : (image-based build) latest * ``opensuse`` : 15.5 * ``ubuntu`` : Bionic and Focal For ARM64, we also run functional tests on * ``ubuntu-minimal`` : Bionic and Focal * ``debian-minimal`` : Bullseye * ``centos-minimal`` : 8-stream and 9-stream * ``openeuler-minimal``: 22.03-LTS For additional details, see the ``README`` file of the relevant elements. ``diskimage-builder`` is used in a range of other projects that do their own testing, separate to the ``diskimage-buidler`` CI gate testing. These have different combinations of host/target elements they keep stable. Updates to this document are welcome. ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.301236 diskimage_builder-3.42.0/playbooks/0000775000175000017500000000000015201026275016070 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4272387 diskimage_builder-3.42.0/playbooks/dib-devstack/0000775000175000017500000000000015201026275020430 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/playbooks/dib-devstack/build-boot-run.yaml0000664000175000017500000000770115201026231024153 0ustar00zuulzuul- hosts: all gather_facts: false environment: EVENTLET_TESTS: 1 vars: dib_src_path: "{{ ansible_user_dir }}/{{ zuul['projects']['opendev.org/openstack/diskimage-builder']['src_dir'] }}" DIB_KEY_NAME: "root" DIB_SSH_KEY: "{{ ansible_user_dir }}/.ssh/id_dib" DIB_SSH_PUBKEY: "{{ ansible_user_dir }}/.ssh/id_dib.pub" roles: - name: ensure-dib - name: build-diskimage tasks: - name: Add image to devstack as test-image command: |- openstack --os-cloud devstack image create \ --disk-format '{{ build_diskimage_formats[0] }}' --container-format bare \ --file '{{ build_diskimage_image_root }}/{{ diskimage.base_element }}.{{ build_diskimage_formats[0] }}' \ test-image - name: Create DIB flavor args: executable: /bin/bash shell: | openstack --os-cloud devstack-admin flavor create --ram=1024 --disk=5 --vcpus=1 --id=128 dib1024 - name: Create security groups args: executable: /bin/bash shell: | openstack --os-cloud devstack security group rule create --ingress --protocol tcp --dst-port 1:65535 --remote-ip 0.0.0.0/0 default openstack --os-cloud devstack security group rule create --ingress --protocol udp --dst-port 1:65535 --remote-ip 0.0.0.0/0 default - name: Create nodepool SSH keypair args: executable: /bin/bash shell: | ssh-keygen -f {{ DIB_SSH_KEY }} -P "" openstack --os-cloud=devstack keypair create --public-key="{{ DIB_SSH_PUBKEY }}" "{{ DIB_KEY_NAME }}" - name: Create a floating IP register: floating_ip command: openstack --os-cloud devstack floating ip create public -f json - name: Boot test-image in devstack as test-server command: |- openstack --os-cloud devstack server create \ --flavor dib1024 \ --image test-image \ --use-config-drive \ --key-name "{{ DIB_KEY_NAME }}" \ --network private \ test-server # Give it, up to, another 5 minutes to boot or fail - name: Wait for server to boot or fail command: openstack --os-cloud devstack server show -f json test-server register: server_status until: server_status.stdout|from_json|json_query("status") == "ACTIVE" retries: 100 delay: 3 - name: Convert test-server details from JSON set_fact: server_status: "{{ server_status.stdout|from_json }}" floating_ip: "{{ floating_ip.stdout|from_json }}" - name: Extract IP addresses from server details set_fact: access_ipv4: "{{ server_status|json_query('addresses.private')| ansible.utils.ipv4 | join(' ') }}" # TODO: Uncomment and add IPv6, hostname, routing and ssh-keyscan. # access_ipv6: "{{ server_status|json_query('addresses.private')| ansible.utils.ipv6 | join(' ') }}" - name: Add floating IP to test-server command: openstack --os-cloud devstack server add floating ip --fixed-ip {{ access_ipv4 }} test-server {{ floating_ip.floating_ip_address }} - name: Remove any test-server entries from /etc/hosts become: true lineinfile: regex: ".*test-server.*" path: /etc/hosts state: absent - name: Add entries for test-server entries to /etc/hosts become: true lineinfile: path: /etc/hosts line: "{{ floating_ip.floating_ip_address }}\t\ttest-server" - name: Check for ssh connectivity with log collection on failure block: # Wait a total of 20 mins, this is fairly high as we're probably running in "usermode emulation" QEMU+TCG - name: Wait for SSH to come online command: ssh-keyscan -4 test-server register: keyscan until: keyscan.rc == 0 retries: 120 delay: 10 rescue: - name: Print console logs command: openstack --os-cloud devstack console log show test-server - name: Force failure now that we're in the rescue block fail: msg: SSH connectivity failed - name: Run functional tests command: "{{ dib_src_path }}/tools/functional-test-check.sh" ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4282389 diskimage_builder-3.42.0/playbooks/dib-devstack/files/0000775000175000017500000000000015201026275021532 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/playbooks/dib-devstack/files/cpu-level.sh0000664000175000017500000000145415201026231023756 0ustar00zuulzuul#!/usr/bin/env bash function report_cpu_flags() { local flag for flag; do ## Note, it's important to keep a trailing space case " ${flags} " in *" ${flag} "*) echo " ${flag} Found" ;; *) echo " ${flag} NOT Found" ;; esac done } data=$(< /proc/cpuinfo) flags="" flags=$(grep "^flags[[:space:]]*:" <<< "${data}" | head -n 1) flags="${flags#*:}" flags="${flags## }" echo "${flags}" echo "x86_64-v1" report_cpu_flags lm cmov cx8 fpu fxsr mmx syscall sse2 echo "x86_64-v2" report_cpu_flags cx16 lahf_lm popcnt sse4_1 sse4_2 ssse3 echo "x86_64-v3" report_cpu_flags avx avx2 bmi1 bmi2 f16c fma abm movbe xsave echo "x86_64-v4" report_cpu_flags avx512f avx512bw avx512cd avx512dq avx512vl ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/playbooks/dib-devstack/pre.yaml0000664000175000017500000000101615201026231022070 0ustar00zuulzuul- hosts: all roles: - name: run-devstack tasks: - name: Copy the cpu-level script into place copy: src: cpu-level.sh dest: /tmp/cpu-level.sh mode: - name: Collect CPU flags for node command: bash /tmp/cpu-level.sh # NOTE(tonyb): This is interesting as QEMU gains the ability to emuluate # newer machine types for example 7.2 is needed for haswell. - name: Collect QEMU version ignore_errors: true shell: |- qemu-kvm --version qemu-system-$(arch) --version ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4282389 diskimage_builder-3.42.0/playbooks/dib-functests/0000775000175000017500000000000015201026275020642 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/playbooks/dib-functests/post.yaml0000664000175000017500000000057115201026231022506 0ustar00zuulzuul- hosts: all tasks: - name: Check logs directory exists stat: path='{{ ansible_user_dir }}/logs/' register: check_path - name: Copy log files from {{ ansible_user_dir }} on node synchronize: src: '{{ ansible_user_dir }}/logs/' dest: '{{ zuul.executor.log_root }}/logs' mode: pull when: check_path.stat.exists == true ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/playbooks/dib-functests/run.yaml0000664000175000017500000000027015201026231022321 0ustar00zuulzuul- hosts: all name: Run dib functional tests roles: - ensure-pip - bindep - dib-setup-gate-mirrors - ensure-podman - dib-ensure-debootstrap - dib-functests ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/pylint.cfg0000664000175000017500000000014015201026231016050 0ustar00zuulzuul[MASTER] persistent=no [MESSAGES CONTROL] disable=all enable=bad-indentation, logging-not-lazy ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.301236 diskimage_builder-3.42.0/releasenotes/0000775000175000017500000000000015201026275016556 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4482393 diskimage_builder-3.42.0/releasenotes/notes/0000775000175000017500000000000015201026275017706 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/1.16.0-updates-bad91fc0b36c1755.yaml0000664000175000017500000000130415201026231025235 0ustar00zuulzuul--- fixes: - The ``yum-minimal`` element now correctly strips locale-archive files, but leaves en.US/en.US-UTF8 for compatibility with remote access. Better failure detection has been added to avoid leaving lock files behind if initial installs to the chroot fail. - The ``epel`` element was fixed to not incorrectly install EPEL6 on Centos 7. EPEL is added as a requirement of ``centos-minimal`` (previously, it was tacitly required but not expressed). - The ``dib-lint`` tool is now more verbose, has better documentation and more correctly detects errors in JSON & YAML. - The ``ironic-agent`` element no longer removes the ``sudo`` package in its cleanup phase. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/1.17.0-ef744f36d277dba4.yaml0000664000175000017500000000222315201026231023612 0ustar00zuulzuul--- features: - The ``dib-lint`` tool now has a best-effort sudo check to help flag uses of ``sudo`` outside the chroot environment. This can help avoid some classes of breakout problems that can interfere with the host system. - Running with ``-x`` will give a more verbose log output that includes function and line-numbers. Work is ongoing to further reduce noise in the verbose logs to make it as useful as possible. Feedback is welcome on the new format. - the ``pkg-map`` element can now install different packages based on the distribution release. fixes: - Locale stripping for ``yum-minimal`` has been reworked to be more reliable for Fedora 23 and CentOS. - The Ubuntu Precise kernel is too old to use the online ``growroot`` element, so we returned to using ``cloud-initramfs-growroot`` in the ``debootstrap`` element for it. - The ``dib-lint`` tool now better matches python files. - The ``apt-sources`` element was fixed to work with the ``debian-minimal`` element. - Dependencies for the systemd target in ``dhcp-all-interfaces`` were updated to correctly wait for interfaces. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/1.18.0-4433d3076627f10d.yaml0000664000175000017500000000034715201026231023304 0ustar00zuulzuul--- features: - The ``fedora-minimal`` element now supports Fedora 24 - The ``pkg-map`` element now correctly supports images without python2 in the default install (such as the latest releases from Ubuntu and Fedora). ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/1.18.1-ceeb514708dcb731.yaml0000664000175000017500000000042115201026231023576 0ustar00zuulzuul--- fixes: - Fix issue where ironic-agent did not work on ppc due to missing dmidecode. - Fix issue where we were unable to create empty tempdirs in the target image. - Revert change where we were installing virtualenv on centos with both system and python packages. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/Add-DIB-UBUNTU-KERNEL-5f75a809f3ce9bab.yaml0000664000175000017500000000041315201026231026227 0ustar00zuulzuul--- features: - | Added an environment variable, DIB_UBUNTU_KERNEL, that allows you to specify the kernel meta package to install in the image. It currently supports "linux-image-generic" (The default), "linux-image-kvm", and "linux-image-virtual". ././@PaxHeader0000000000000000000000000000021300000000000010211 xustar00117 path=diskimage_builder-3.42.0/releasenotes/notes/Fix-ubuntu-minimal-not-running-autoremove-7a4e31de2a525f46.yaml 22 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/Fix-ubuntu-minimal-not-running-autoremove-7a4e31de2a525f0000664000175000017500000000015615201026231032015 0ustar00zuulzuul--- fixes: - | Fixed the ubuntu-minimal target to also run autoremove at the end of an image build. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/add-4k-block-device-support-8397c2b6122d864c.yaml0000664000175000017500000000102415201026231027745 0ustar00zuulzuul--- features: - | Adds the ability for diskimage-builder to create images with different block sizes. By default, this remains at the default of 512 bytes, but some newer devices require 4096 bytes to be used, which impacts the overall layout rendering 512 byte images incompatible. This setting can also be asserted and overridden using the ``DIB_BLOCK_SIZE`` environment variable, but alternatively exists as a new ``block_size`` parameter for ``local_loop`` section in block device YAML documents. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/add-6b94d90caea2895e.yaml0000664000175000017500000000017215201026231023620 0ustar00zuulzuul--- features: - | The ``centos`` element supports CentOS 8 Stream builds when run with ``DIB_RELEASE=8-stream`` ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/add-aarch64-support-for-rhel-c62a0e02b1ad9033.yaml0000664000175000017500000000007215201026231030154 0ustar00zuulzuul--- features: - | Add aarch64 support for ''rhel''. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/add-autoupdates-element-8225a5d8b19cec74.yaml0000664000175000017500000000102515201026231027515 0ustar00zuulzuul--- features: - | A new element ``autoupdates`` is added to DIB. This element, with proper configuration, will enable and configure cloud images to have a system that automatically updates the image, from the upstream binaries. To this end, ``DIB_DEB_UPDATES_CONF`` or ``DIB_YUM_UPDATES_CONF`` must be set during build time. other: - | The ``autoupdates`` element has only been tested in Rocky and Ubuntu images. In addition, the element does not check the validity of the configuration files in any way. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/add-centos-8-support-4fd28eb04e11ba43.yaml0000664000175000017500000000042615201026231026745 0ustar00zuulzuul--- features: - Added CentOS 8 support. deprecations: - | The ``centos7`` element is deprecated and is left only for backward compatibility. Use the ``centos`` element instead. Note that you should set ``DIB_RELEASE`` to ``7`` when using the ``centos`` element. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/add-devuser-group-22dbc2b45271e2fa.yaml0000664000175000017500000000025115201026231026374 0ustar00zuulzuul--- features: - | The newly created devuser now can be added to the specified group(s) with new variable ``DIB_DEV_USER_GROUPS``. Groups should already exist. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/add-efi-packages-70a19464d31ab8d7.yaml0000664000175000017500000000020615201026231025760 0ustar00zuulzuul--- upgrade: - | Adds `efibootmgr` and `efivar` packages to ironic-agent, so when building DIB images they will be present. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/add-fail2ban-element-2ccdcab027c9abf7.yaml0000664000175000017500000000032315201026231027117 0ustar00zuulzuul--- features: - | A new fail2ban element has been added which has has been tested on Debian and Rocky images. The usage of a new variable ``DIB_FAIL2BAN_CONF`` is now mandatory during built time. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/add-fips-element-a5a3e0e3c653f923.yaml0000664000175000017500000000076515201026231026121 0ustar00zuulzuul--- features: - | Adds a ``fips`` element which attempts to enable FIPS mode configuration into the disk image being created. fixes: - | Fixes a possible case with a FIPS enabled disk image where the cryptographic policies may be applied for enforcement of FIPS mode, but the underlying kernel command line may be missing. This in particular was discovered when testing on Rocky Linux. We now test, and add the FIPS kernel command line flag if it is otherwise enabled. ././@PaxHeader0000000000000000000000000000021000000000000010206 xustar00114 path=diskimage_builder-3.42.0/releasenotes/notes/add-grub2-efi-x64-modules-for-centos-9-74401ca5ec8201c7.yaml 22 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/add-grub2-efi-x64-modules-for-centos-9-74401ca5ec8201c7.0000664000175000017500000000050715201026231030644 0ustar00zuulzuul--- fixes: - | An issue causing bootloader installation to fail on EFI system was fixed. grub2 could not find the neccecary files, adding the grub2-efi-x64-modules package to the pkg-map for centos-9 in the grub2 element fixes the issue. See bug: `1957169 `_. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/add-modprobe-element-8e3b0287ebb11920.yaml0000664000175000017500000000062715201026231026701 0ustar00zuulzuul--- features: - Add new modprobe element. This element will replace modprobe-blacklist element. It wil still have the blacklist functionality, but it also adds the feature of passing a complete file with settings to the modprobe.d directory. Adding this functionality, that will allow elements that depends on this module, to just copy the specified files to the final directory. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/add-openeuler-minimal-element-068dc7d9d94e5098.yaml0000664000175000017500000000031215201026231030537 0ustar00zuulzuul--- features: - | Add ``openeuler-minimal`` element. OpenEuler is an open source community driven YUM/DNF distro like Fedora. For more info about openEuler, see: https://openeuler.org/en. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/add-version-less-rhel-element-82fac7f2609e16d3.yaml0000664000175000017500000000043415201026231030543 0ustar00zuulzuul--- features: - Adds a new element ``rhel`` to handle all supported RHEL releases, which are currently '7' and '8'. As of now, users of diskimage-builder will still be able to use the 'rhel7' element, or migrate to 'rhel' and specify their respective DIB_RELEASE value. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/apt-transport-https-e4856cb9e2f8422c.yaml0000664000175000017500000000014315201026231026765 0ustar00zuulzuul--- update: - | Add ``apt-transport-https`` package as a base dependency for Debuntu images. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/block-device-efi-lvm-c53272600ccd6d18.yaml0000664000175000017500000000064615201026231026602 0ustar00zuulzuul--- features: - | Element block-device-efi-lvm has been added which is like block-device-efi but defines an LVM logical group in the root partition. Four logical volumes are defined in that group, mounted to /, /tmp, /var, and /home. This volume layout will not meet all requirements, but this is more of an example demonstrating the capability to encourage more usage of this existing feature. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/block-device-handling-279cddba8a859718.yaml0000664000175000017500000000174615201026231027137 0ustar00zuulzuul--- features: - Add new block device handling. Unify and generalize the creation and usage of block device. This release includes setting up the general infrastructure and setting up loop device issues: - Because the implementation of the new block device layer is not complete, some features which are already implemented cannot be used because of limitations of the current environment. deprecations: - The current way of handling block devices is deprecated. The existing block device phase will be called for a limited time. If this phase delivers a result, this is used; if there is no result, the new way of block device handling is used. Please note that the old way of block device handling has some major limitations such as that it is only possible to use one block device. - The element 'partitioning-sfdisk' is deprecated. The new implementation will create the partition tables based on a tool independent description. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/block-device-lvm-c3b8a214952b4db5.yaml0000664000175000017500000000010115201026231026103 0ustar00zuulzuul--- features: - Adds lvm support, allowing to create volumes. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/block-device-mkfs-mount-fstab-42d7efe28fc2df04.yaml0000664000175000017500000000011615201026231030663 0ustar00zuulzuul--- features: - | Adds mkfs, mount and fstab to the block device layer. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/block-device-partitioning-237249e7ed2bad26.yaml0000664000175000017500000000055315201026231030037 0ustar00zuulzuul--- features: - Create partitions with MBR layout optimized for performance and highly configurable. deprecations: - The new partitions are created based on configuration rather than on a list of provided commands for a special partitioning tool. Therefore elements using tools (like partitioning-sfdisk) are deprecated and will be removed. ././@PaxHeader0000000000000000000000000000020500000000000010212 xustar00111 path=diskimage_builder-3.42.0/releasenotes/notes/block-device-update-partition-table-eb4ff077f90dfb19.yaml 22 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/block-device-update-partition-table-eb4ff077f90dfb19.yam0000664000175000017500000000037715201026231031707 0ustar00zuulzuul--- fixes: - Fix cases of 'mkfs' failing because the partitions never showed up. Partition mappings will now be updated instead of just adding them with 'kpartx'. That means that 'kpartx' will also remove devmappings for deleted partitions. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/bootloader-commandline-d2db7524f1f9ad28.yaml0000664000175000017500000000042315201026231027477 0ustar00zuulzuul--- other: - It has been clarified that the ``DIB_BOOTLOADER_DEFAULT_CMDLINE`` variable appends its values to grubs ``GRUB_CMDLINE_LINUX_DEFAULT``, which is used during all normal boots but not rescue boots; as opposed to applying to ``GRUB_CMDLINE_LINUX`` ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/bootloader-disable-serial-console-d6aaa42ef3031d86.yaml0000664000175000017500000000033215201026231031514 0ustar00zuulzuul--- features: - | Adds the ability to disable serial console logging from being setup in the ``bootloader`` element by setting the ``DIB_BOOTLOADER_USE_SERIAL_CONSOLE`` environment variable to ``False``. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/bootloader-extlinux-cf5ca0a5c9ef4544.yaml0000664000175000017500000000021415201026231027144 0ustar00zuulzuul--- deprecations: - | Removed support for ``extlinux`` and ``grub`` (as opposed to ``grub2``) support from the bootloader element.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/bootloader-gpt-d1047f81f3a0631b.yaml0000664000175000017500000000041615201026231025627 0ustar00zuulzuul--- features: - | GPT support is added to the bootloader; see documentation for configuration examples. This should be considered a technology preview; there may be minor behaviour modifications as we enable UEFI and support across more architectures.././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/releasenotes/notes/bootloader-strip-source-console-param-b73b603df0b01dc9.yaml 22 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/bootloader-strip-source-console-param-b73b603df0b01dc9.y0000664000175000017500000000040115201026231031671 0ustar00zuulzuul--- fixes: - | The ``bootloader`` element now strips prior explicit console settings from the ``/etc/default/grub`` file, in order to prevent accidential re-introduction of prior settings when grub configuration is manually updated later. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/bug-2013451-0874e20db0231c56.yaml0000664000175000017500000000141615201026231024217 0ustar00zuulzuul--- features: - | Added environment variable ``REG_SAT_REPO`` to the ``rhel-common`` element. Sets the repository label for Satellite client tools. fixes: - | The ``Satellite Client`` reposotories replaces the ``Satellite Tools`` repository since Satellite 6.11. The default repo labels in the ``rhel-common`` element has been updated to reflect this change. See `Red Hat Satellite 6.11 Release Notes `_. To enable users that need to use the legacy ``Satellite Tools`` repository, the ``REG_SAT_REPO`` environment variable has been added to enable manual override of the Satellite repository. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/bug-2016965-f3f35c919081f64c.yaml0000664000175000017500000000047415201026231024344 0ustar00zuulzuul--- fixes: - | As NetworkManager can't automatically create default connection profiles for InfiniBand interfaces, we are adding nm-dhcp-ib-interfaces element to install NetworkManager-system-connections-infiniband.nmconnection to NetworkManager to create a wildcard InfiniBand connection profile. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/bump-ubuntu-release-42469e6868ee162b.yaml0000664000175000017500000000010315201026231026551 0ustar00zuulzuul--- upgrade: - | Bumped the default Ubuntu release to focal. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/centos-10-stream-rpm-db-path-d40556b6ff616fc9.yaml0000664000175000017500000000026515201026231030130 0ustar00zuulzuul--- fixes: - | Fixed an issue with the RPM DB path in Centos 10 Stream, building Centos images with specific RPMs may have pulled dependencies that broken the RPM DB. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/centos-default-change-to-9-stream-45a0a88db60d7469.yaml0000664000175000017500000000024215201026231031141 0ustar00zuulzuul--- fixes: - | The default release for the ``centos`` element is now "9-stream" instead of "8". This is a result of Centos8 having reached End of Life. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/centos-minimal-8-aca6314862741177.yaml0000664000175000017500000000015415201026231025641 0ustar00zuulzuul--- features: - | The ``centos-minimal`` supports CentOS 8 builds when run with ``DIB_RELEASE=8`` ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/centos-minimal-8-stream-97021a2c92463dde.yaml0000664000175000017500000000017215201026231027272 0ustar00zuulzuul--- features: - | The ``centos-minimal`` supports CentOS 8 Stream builds when run with ``DIB_RELEASE=8-stream`` ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/centos-retired-f17ae9f6f03e57e3.yaml0000664000175000017500000000141215201026231026017 0ustar00zuulzuul--- deprecations: - | The ``centos`` and ``rhel`` elements have been removed. These were building version 6 which is no longer supported (mostly due to a lack of python 2.7). Version 7 support is available via the ``centos7`` and ``rhel7`` elements (which downloads and modifies the upstream cloud images) or via ``centos-minimal`` (which builds the image from a empty chroot; only available for CentOS). ``centos-minimal`` is suggested as this is what OpenStack Infrastructure uses for its elements. Unfortunately, ``centos-minimal`` sets ``DISTRO=centos`` while ``centos7`` sets ``DISTRO=centos7``, despite building the same thing as far as upper levels are concerned. We plan to rectify this in the version 8 time-frame. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/cloud-init-resizefs-growpart-e820b8c7f3adb78b.yaml0000664000175000017500000000020515201026231030702 0ustar00zuulzuul--- upgrade: - | ``cloud-init-disable-resizefs`` will no longer leave ``growpart`` on / partition to enabled in cloud.cfg. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/cloud-init-service-name-2b56b8c7f1adb78c.yaml0000664000175000017500000000035315201026231027566 0ustar00zuulzuul--- fixes: - | Starting from 'cloud-init' version '24.3' service 'cloud-init.service' is splitted in to 'cloud-init-network.service' and 'cloud-init-main.service'. But some distributions are reverted to old service name. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/containerfile-host-networking-0691f3be5c6b11b6.yaml0000664000175000017500000000027415201026231030756 0ustar00zuulzuul--- upgrade: - | The default networking in the ``containerfile`` element is switched to ``host`` as we have found that more reliable in generating the initial chroot images. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/containerfile-root-extraction-430148dd669cb3da.yaml0000664000175000017500000000021715201026231030756 0ustar00zuulzuul--- fixes: - | This release fixes an regression in the ``containerfile`` element that prevented it extracting root images correctly. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/create-945440b17d500bf5.yaml0000664000175000017500000000013215201026231024070 0ustar00zuulzuul--- critical: - | This is the last release of diskimage-builder to support Python 2 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/dash-p-after-install-58a87549c1c906c3.yaml0000664000175000017500000000040615201026231026571 0ustar00zuulzuulother: - The packages specified with the `-p` command-line operation are now installed after the `install.d` phase, not before. This is to give elements priority when installing packages. The flag documentation has been updated to describe this. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/debian-minimal-confilicts-c139ab0c98e5762f.yaml0000664000175000017500000000013115201026231030001 0ustar00zuulzuul--- fixes: - | Fixes an issue with duplicate element files building Debian images. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/debian-no-backports-38459be7b11febd1.yaml0000664000175000017500000000073715201026231026711 0ustar00zuulzuul--- upgrade: - | Debian images built with the debian-minimal element will no longer include the backports repository in sources.list.d by default. This change updates DIB built images to better match the configuration of upstream Debian cloud images. Users who wish to continue to include backports repo sources in their images can set DIB_APT_SOURCES_CONF to include backports or have a custom element add the source configuration to their images. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/debian-security-7279855cf464f88b.yaml0000664000175000017500000000044115201026231025757 0ustar00zuulzuul--- features: - | A new variable ``DIB_DEBIAN_SECURITY_MIRROR`` is added to override the path to the security repositories. Previously this was hard-coded to the upstream repositories, which could get out of sync with mirrors specified with ``DIB_DISTRIBUTION_MIRROR``. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/debian-security-b4f677a148fdf9c9.yaml0000664000175000017500000000040715201026231026172 0ustar00zuulzuul--- features: - | A new variable ``DIB_DEBIAN_SECURITY_SUBPATH`` is added to override the suite subpath of security repositories. Previously this was hard-coded to the upstream repository layout, which may not always match the mirror's layout. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/debian-security-location-bae198f54610fe3f.yaml0000664000175000017500000000067215201026231027765 0ustar00zuulzuul--- upgrade: - | Debian changed locations for its security package repos. We had been accounting for that with specific overrides for some time. Enough time has now passed where all modern Debian releases use a consistent security package repo location so we have dropped the special accounting to make adding new Debian releases simpler. Note, this means DIB no longer supports building Debian older than Bullseye. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/debian_cloud_init-8d91b34b96c621fe.yaml0000664000175000017500000000042115201026231026436 0ustar00zuulzuul--- other: - | Added a ``DIB_DEBIAN_CLOUD_INIT_HELPER`` variable that controls whether ``debian`` element will attempt to pre-create required users and sudoers file for the default cloud-init user. This should not be needed for any modern Debian distro. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/default_deb_init_per_release-f5a7451b0c2704c9.yaml0000664000175000017500000000046215201026231030543 0ustar00zuulzuul--- other: - | Value of ``DIB_DEBIAN_ALT_INIT_PACKAGE`` has been switched to ``systemd-sysv`` for Debian releases older then Jessie. If you still need to build a version of Debian that is relying on ``sysvinit`` please override the ``DIB_DEBIAN_ALT_INIT_PACKAGE`` variable for that. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/deprecate-ironic-agent-element.yaml0000664000175000017500000000026315201026231026523 0ustar00zuulzuul--- deprecations: - The "ironic-agent" element can now be found at ironic-python-agent-builder to build the ramdisk. This element is deprecated from diskimage-builder. ././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/releasenotes/notes/deprecation-of-legacy-deploy-elements-1665af6e87103c5f.yaml 22 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/deprecation-of-legacy-deploy-elements-1665af6e87103c5f.y0000664000175000017500000000056415201026231031504 0ustar00zuulzuul--- deprecations: - | The ``deploy-baremetal``, ``deploy-kexec``, ``deploy-tgtadm``, and ``deploy-targetcli`` elements are deprecated and will be removed in a future release of diskimage-builder. The origins of the elemenets largely dates back to the early efforts to support baremetal deployment, and the methods have been long ago moved away from. ././@PaxHeader0000000000000000000000000000023500000000000010215 xustar00135 path=diskimage_builder-3.42.0/releasenotes/notes/dhcp-all-interfaces-add-opt-to-let-NetworkManager-handle-it-f7c7f2d033b7f92d.yaml 22 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/dhcp-all-interfaces-add-opt-to-let-NetworkManager-handle0000664000175000017500000000116515201026231032334 0ustar00zuulzuul--- features: - | It is now possible to configure the dhcp-all-interfaces element not to install the dhcp-all-interfaces service on systems with NetworkManager. NetworkManager is quite capable to do automatic interface configuration. NetworkManager will by default try to auto-configure any interface with no configuration, it will use DHCP for IPv4 and Router Advertisements to decide how to initialize IPv6. The new environment variable ``DIB_DHCP_NETWORK_MANAGER_AUTO`` (defauls to: ``false``) has been added, when set to ``true`` only the configuration for NetworkManager is written. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/dhcp-all-interfaces-debian-issue-2ec7f1a5186f0b16.yaml0000664000175000017500000000231415201026231031146 0ustar00zuulzuulissues: - | The dhcp-all-interfaces element attempts to work with "predictable interface names". During boot the name of the interfaces is changed from ethX to the new scheme, for example enpXsX; depending on the Linux kernel this move may be captured by udev as an "add" or "move" event. The dhcp-all-interfaces udev rule has been updated to match against both possible events. If you prefer to not use predictable names your image builds can set DIB_BOOTLOADER_DEFAULT_CMDLINE with net.ifnames=0 or mask the default policy with `ln -s /dev/null /etc/systemd/network/99-default.link`. This process is documented by systemd: https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ Note that this update reverts previous changes to disable predictable interface names completely when using dhcp-all-interfaces. Predictable device names were disabled in an effort to make dhcp-all-interfaces function on Debian Bullseye, but this broke any users that wished to use predictable device names. Instaed we make predictable device names work on Debian Bullseye and allow users to disable predictable device names should they choose to. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/dhcp-all-interfaces-networkmanager-b34f2fc8fb1a678f.yaml0000664000175000017500000000067415201026231032004 0ustar00zuulzuul--- fixes: - | Fixes support for the ``dhcp-all-interfaces`` element when the system networking configuration is managed via ``NetworkManager``. - | Fixes ``NetworkManager`` configuration with the ``dhcp-all-interfaces`` element to account for Centos8/RHEL8's default change to the ``NetworkManager`` internal DHCP client, which can introduce different behavior for infrastucture operators such as those using LACP. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/dhcp-vlan-interfaces-b34ab224b9431e3a.yaml0000664000175000017500000000046515201026231026761 0ustar00zuulzuul--- features: - | Add support to run dhclient on vlan interfaces created on top of an Ethernet interface. The vlan interfaces in this case will use the default naming convention of .. See also `__ for further details. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/dib-checksum-3d0d9af8778176be.yaml0000664000175000017500000000074315201026231025357 0ustar00zuulzuul--- features: - | The usage of the ``DIB_CHECKSUM`` variable is extended. Now to be more specific the variable can be set to the ``sha256`` or ``md5`` value to generate only one checksum file. There also can be provided a comma-separated list of the values, but only ``sha256`` and ``md5`` supported. For backward compatibility using ``DIB_CHECKSUM=1`` or option ``--checksum`` in the command line still can be used to generate all supported checksums. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/dib-command-a190f41cbd572b4b.yaml0000664000175000017500000000055315201026231025221 0ustar00zuulzuul--- features: - | A new command ``diskimage-builder`` is now provided (also aliased to ``dib``). It provides a YAML file based interface to ``disk-image-create`` and ``ramdisk-image-create``. All arguments can be specified as yaml dictionary entries, along with environment variable overrides which are applied over the provided environment.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/dib-distribution-mirror-8c241c0d3d4a539a.yaml0000664000175000017500000000063315201026231027553 0ustar00zuulzuul--- deprecations: - The ``DIB_[DISTRO]_DISTRIBUTION_MIRROR`` variables have been removed. These were undocumented ways to set ``DIB_DISTRIBUTION_MIRROR`` for some elements. It was not implemented consistently and causing some confusion. If you need to setup mirrors for testing purposes, the ``openstack-ci-mirrors`` element is a good example that is used by OpenStack gate testing.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/dib-init-system-5647bad17a01c602.yaml0000664000175000017500000000124715201026231025726 0ustar00zuulzuul--- deprecations: - | The ``dib-init-system`` element installs a utility ``/usr/local/bin/dib-init-system`` which would try to guess the init system (systemd, etc.). This was called from ``environment.d`` files, which means that in phases outside the chroot it was attempting to query the init system of the build host. This completely fails in a situation such as running inside a container without a full init system. To avoid this issue, each OS element will set DIB_INIT_SYSTEM directly. The ``dib-init-system`` script was not really intended to be called directly, but will now just report the value of ``DIB_INIT_SYSTEM``. ././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/releasenotes/notes/dib-init-system_fix_for_debian_jessie-c6f7261ee84dad27.yaml 22 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/dib-init-system_fix_for_debian_jessie-c6f7261ee84dad27.y0000664000175000017500000000032115201026231031771 0ustar00zuulzuul--- fixes: - dib-init-system did not correctly find the init system for Debian Jessie and Debian Stretch. This version also looks for /bin/systemctl as as hint for systemd and fixes the problem. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/dib-python-deprecate-8401c35a87559076.yaml0000664000175000017500000000024115201026231026513 0ustar00zuulzuul--- deprecations: - | The ``dib-python`` element is deprecated. In chroot Python tools should use ``#!/usrbin/env python3`` on all distributions now. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/dib-run-parts-6f67d038aa5a4156.yaml0000664000175000017500000000072715201026231025414 0ustar00zuulzuul--- deprecations: - | The ``dib-run-parts`` element is no longer required as ``disk-image-create`` will directly source the internal version for running scripts within the chroot. This element was unintentionally leaving ``/usr/local/bin/dib-run-parts`` in the built image. From code search we do not believe anyone was relying on the presence of this script. If you do require it, you should source the ``dib-utils`` package to install. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/dib-run-parts-e18cc3a6c2d66c24.yaml0000664000175000017500000000061515201026231025544 0ustar00zuulzuul--- deprecations: - | dib no longer exports ``dib-run-parts``. Adding this was an oversight made during v2 development, since ``dib-utils`` already provides this. The ``dib-run-parts`` used internally (``diskimage_builder/lib/dib-run-parts``) is not intended to be used by external tools. If you require ``dib-run-parts``, you should install the ``dib-utils`` package.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/dibv2-omnibus-b30e0c7ecd76db8d.yaml0000664000175000017500000001012515201026231025675 0ustar00zuulzuul--- prelude: >- Version 2.0.0 of diskimage-builder incorporates recent work from the feature/v2 branch. This includes incorporating some largely internal changes to the way it finds and calls elements, enhancements to partitioning and removal of some long-deprecated elements. If you use dib exclusively via the command-line disk-image-create installed from a package or via pypi you are unlikely to notice any difference (if you run it directly from a git-tree checkout, you may be affected). features: - | 2.0.0 includes a new framework for partitioning contributed by Andreas Florath. This should allow for creating multiple partitions, images with encryption, LVM support and flexibility for multiple-devices, all of which are currently not supported. Please check the v2 documentation, specs and reach out if these features interest you (some parts still in review). - | Element override is now supported. If you have an element of the same name earlier in the ``ELEMENTS_PATH``, it will override later instances (previously, the behaviour was undefined). upgrade: - | For purposes of both users and development we want dib to be as "pythonic" as possible and behave like all other projects. Two major visible changes are: - command-line scripts are entry points (i.e. need to be installed) - elements have moved under diskimage_create module The result of the first is that ``./bin/disk-image-create`` from the source tree is no longer there. Like all other projects, you should install dib into a virtualenv (if you're developing, use pip -e) and ``disk-image-create`` will "just work". The second change, moving the inbuilt elements under the ``diskimage_create`` module, is a simplification so we always have a canonical path to our elements. Since we now always know where elements are relative to the imported diskimage_builder module we can drop all the path guessing complexity. This has other good flow-on effects such as ``testr`` being able to find unit-tests for elements in the normal fashion and having imports work as usual. We are aware there are a number of tools that like to take dib elements and do things with them. Reading some of the dib source you may find there is a canonical way to find out the included dib elements path -- ask dib itself, something like .. code-block:: shell DIB_ELEMENTS=$(python -c ' import diskimage_builder.paths; diskimage_builder.paths.show_path("elements")') Note you probably do not want this. As mentioned, another feature of v2 is override elements -- an element that appears first in the element path-list will override any built-in one (just like $PATH). There is a function, ``diskimage_builder.get_elements()``, which will correctly process the element path, calculate overrides and return a canonical list of elements, their dependencies and correct paths. *That* said, you probably do not want this either! There are a number of elements that do things on behalf of other elements -- they look for a file in the included elements, say, and use that as a manifest for something. Previously, these would just have to make up their own element processing via inspection of the command-line arguments. dib now exports pre-computed variables that an element can walk for all the current build elements -- a YAML list for easy python decoding and a function that builds an array for Bash elements. deprecations: - | A number of long-deprecated elements have been removed in v2, which are to the best of our knowledge unused. - ``partitioning-sfdisk`` - ``deploy-ironic-element`` - ``ironc-discovered-ramdisk`` - ``serial-console-element`` - ``map-services`` - | We have removed and deprecated the ``dib-utils`` package. This was intended to be a more generic repository of tools that might be useful outside dib, but that did not eventuate and it has been folded back into dib for simplicity. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/doc-auto-element-dependency-cb7488c5bb7301a4.yaml0000664000175000017500000000020515201026231030246 0ustar00zuulzuul--- features: - Create sphinx directive 'element_deps' that automatically generates dependencies in the element documentation. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/dpkg-copy-keys-578e16f7fedd823b.yaml0000664000175000017500000000023515201026231025744 0ustar00zuulzuul--- upgrade: - | The ``DIB_ADD_APT_KEYS`` argument now copies keys into ``/etc/apt/trusted.gpg.d``, rather than using ``apt-key`` to add them. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/dracut-network-adaabf90da9f6866.yaml0000664000175000017500000000021615201026231026175 0ustar00zuulzuul--- deprecations: - The ``dracut-network`` element has been removed. It has not been functioning for some time due to incorrect paths. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/efi-bios-images-052283eabba98b90.yaml0000664000175000017500000000031215201026231025726 0ustar00zuulzuul--- features: - | The ``bootloader`` element now co-installs a BIOS bootloader for x86-64 when ``DIB_BLOCK_DEVICE=efi`` is set. This makes images that are EFI and BIOS cross-compatiable. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/efi-bootloader-disk-size-4c1a9f18967104fb.yaml0000664000175000017500000000034215201026231027515 0ustar00zuulzuul--- fixes: - | When using the ``block-device-efi`` element to create an EFI based system (most notably, with ARM64), the final disk size is now expanded for the 512MiB system EFI partition introduced with 2.24.0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/element-info-entry-point-448bf622be6061a0.yaml0000664000175000017500000000057615201026231027566 0ustar00zuulzuul--- deprecations: - The ``element-info`` script is now provided by a standard python entry-point, rather than an explicit wrapper script. This may affect you if you were running this script directly out of ``bin`` in the source directory without installing. See developer notes for details on using developer-installs with virtual environments for testing. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/element-override-ccda78c24ab4a4ff.yaml0000664000175000017500000000035615201026231026544 0ustar00zuulzuul--- deprecations: - Element override behavior is now defined, with elements found in earlier entries of ``ELEMENTS_PATH`` overriding later ones (e.g. the same semantics as ``$PATH``). Previously the behavior was undefined.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/element-vars-c6bf2e6795002f01.yaml0000664000175000017500000000033315201026231025314 0ustar00zuulzuul--- features: - Elements that need access to the other elements being used during the build should use the new ``IMAGE_ELEMENT_YAML`` environment variable and it's Bash equivalent ``get_image_element_array``.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/elrepo-element-85b32f6f496234d7.yaml0000664000175000017500000000005615201026231025572 0ustar00zuulzuul--- features: - | Added ELRepo element. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/ensure-venv-d7c16a2a04fd3b8f.yaml0000664000175000017500000000100415201026231025401 0ustar00zuulzuul--- features: - | The `ensure-venv` module is added to ensure that `python3 -m venv` is available on the host. This can be useful if you wish to install non-distribution-packaged Python software on a host during build, but not mix any non-distro installation. This works on all platforms with Python 3 available. depreceations: - | The `simple-init` element now uses `ensure-venv` so is technically Python 3 only. At this stage, all supported platforms have Python 3 available.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/eol-centos7-rhel7-e34abb41caff312e.yaml0000664000175000017500000000036715201026231026364 0ustar00zuulzuul--- upgrade: - | It is no longer possible to build images using CentOS 7 or RHEL 7 as a base image as these reached EOL on 30th June 2024. The centos and centos-minimal elements now default to a ``DIB_RELEASE`` value of ``9-stream``.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/fedora26-690b9fd9ac3c3d4f.yaml0000664000175000017500000000030115201026231024551 0ustar00zuulzuul--- upgrade: - The ``fedora-minimal`` and ``fedora`` elements have been updated to default to Fedora 26. Note if you to pin to specific versions, be sure to specify ``DIB_RELEASE``. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/fedora32-9dfa4d9d4dcce1ff.yaml0000664000175000017500000000013115201026231024770 0ustar00zuulzuul--- features: - | The default for elements building Fedora is updated to Fedora 32 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/fix-2069956-396eb9f5fb928e2d.yaml0000664000175000017500000000033315201026231024531 0ustar00zuulzuul--- fixes: - | Fixes an issue where an image using the ``manifest`` element could fail to build when using a non-root user. See `bug 2069956 `__. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/fix-and-update-opensuse-15.3-c7fee120b51e3621.yaml0000664000175000017500000000040515201026231030015 0ustar00zuulzuul--- upgrade: - | Bumped the default openSUSE Leap release to 15.3 for the opensuse element. deprecations: - | Dropped support for building openSUSE Leap 42.1, 42.2, 42.3, 15.0, 15.1, and 15.2, since all of them have already reached end-of-life. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/fix-config-drive-networking-2a358b2c039d471d.yaml0000664000175000017500000000044715201026231030243 0ustar00zuulzuul--- fixes: - | Fixes an issue where if an operator set a cloud-init data source to ``ConfigDrive``, the host might not properly configure as automatic metadata collection still attempts to operate. We now disable that by default, when ``ConfigDrive`` is passed as an argument. ././@PaxHeader0000000000000000000000000000021400000000000010212 xustar00118 path=diskimage_builder-3.42.0/releasenotes/notes/fix-growvols-multipath-partition-delimiter-b93d07653b635a7c.yaml 22 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/fix-growvols-multipath-partition-delimiter-b93d07653b6350000664000175000017500000000046215201026231032025 0ustar00zuulzuul--- fixes: - | Fixed an issue in the growvols element where a ``partition_delimiter`` inserted between the device name and the partition number for multipath devices was not handled correctly. This fix resolves `bug 2109988 `_. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/fix-grub-boot-kernel-commandline-1f94e49884c517c0.yaml0000664000175000017500000000071715201026231031107 0ustar00zuulzuul--- fixes: - | Fixes the GRUB2 bootloader kernel command line where a prior ``boot`` parameter could cause issues with bootloader configuration when an image is rebuilt and the ``bootloader`` element is utilized. We now remove any prior ``boot`` parameter in */etc/default/grub* when executing the ``bootloader`` element, and then assert a valid entry ``boot`` parameter if a */boot* partition is defined as part of the image build. ././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=diskimage_builder-3.42.0/releasenotes/notes/fix-multipath-issues-with-rhel-centos-17bac22a35a5fe09.yaml 22 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/fix-multipath-issues-with-rhel-centos-17bac22a35a5fe09.y0000664000175000017500000000133115201026231031646 0ustar00zuulzuul--- fixes: - | Fixes an issue on RHEL or Centos based image builds where an initial source image state may have a multipath capible initial ramdisk, but then lack the necessary package to support regeneration of a new ramdisk with multipathing. The end result being that a regenerated or updated ramdisk after the fact is that the ramdisk then fails to boot when multipath devices are present where it previously booted without any issues. This is because the ramdisk build process used by ``dracut`` does not fail if it does not find the necessary multipath components, thus requiring the ``device-mapper-multipath`` package to be present for the ramdisk with the necessary artifacts. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/fix-resolute-cloudinit-04165133efea5181.yaml0000664000175000017500000000013215201026231027240 0ustar00zuulzuul--- fixes: - | Extend support for new cloud-init service names for Ubuntu Resolute. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/fix_rdisc6_loop-32a308a97de99f0f.yaml0000664000175000017500000000022615201026231026101 0ustar00zuulzuul--- fixes: - | The ``dhcp-all-interfaces`` element could not configure network interfaces properly when ``rdisc6`` is present on the system ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/gentoo-post-install-16514f6d51465c79.yaml0000664000175000017500000000045615201026231026517 0ustar00zuulzuulfixes: - | The gentoo element no longer runs finalization actions during finalise phase; these actions now happen in post-install phase. This fixes an issue where the final ``emerge --update @world`` would fail due to limited disk space, due to the environment finalise steps run in. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/gentoo-profile-23.0-99357c919639bd3f.yaml0000664000175000017500000000126115201026231026200 0ustar00zuulzuulfeatures: - Supports Gentoo profile 23.0 and removes support for the nonworking 17.1 and 17.0 profiles. - Gentoo element updated to avoid using testing (~arch) packages. - Gentoo element now uses upstream binary package host by default. fixes: - Fixed an issue where the growroot element on openrc init systems would not function. - Fixed an issue where the devuser element was unable to grant sudo capabilities on gentoo images. - Fixed an issue in Gentoo implmentation for install-packages element where build time would grow linearly with each additional package removal. Now, all removed packages are deselected and removed in a single transaction. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/gpt-esp-partition-size-200568cb6fcc8788.yaml0000664000175000017500000000034615201026231027273 0ustar00zuulzuul--- fixes: - | The size of the ESP partition when building EFI based images is increased considerably from 12MiB to 550MiB, in line with modern guidelines. The existing size was often not enough to update packages. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/grub-timeout-1cdd14a2b1467d89.yaml0000664000175000017500000000036215201026231025420 0ustar00zuulzuul--- features: - The ``bootloader`` element will explicitly set the timeout to ``5`` seconds when using ``grub`` (previously this was undefined, but platform defaults were usually 5 seconds). Set this to ``0`` for faster boots. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/grub-timeout-style-4bb9b2bde4ff2b02.yaml0000664000175000017500000000041315201026231026764 0ustar00zuulzuul--- features: - | The ``bootloader`` element will explicitly set the timeout style to ``hidden`` to hide the menu. Set ``DIB_GRUB_TIMEOUT_STYLE`` to ``menu`` to display the menu and then wait for the timeout expire before booting the default entry. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/grub-timeout1-a3e48ac5da970499.yaml0000664000175000017500000000041515201026231025514 0ustar00zuulzuul--- upgrade: - | DIB_GRUB_TIMEOUT defaulting to 1 second, GRUB_TIMEOUT was duplicated in the /etc/defaults/grub the original intension of DIB_GRUB_TIMEOUT default was to match the typical image default which is one 1 second instead of 5 second today. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/grub_style-dfafe48d719f5579.yaml0000664000175000017500000000042115201026231025262 0ustar00zuulzuul--- upgrade: - | Change default values for ``DIB_GRUB_TIMEOUT_STYLE`` and ``DIB_GRUB_TIMEOUT``. The default value for ``DIB_GRUB_TIMEOUT_STYLE`` will be ``menu`` and for ``DIB_GRUB_TIMEOUT`` will be ``5``. These values are based on current GRUB defaults. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/gzip-env-variable-94e61e0c043f4f1f.yaml0000664000175000017500000000025415201026231026321 0ustar00zuulzuul--- features: - | The `DIB_GZIP_BIN` environment variable enables builders to change the path to `gzip`, such as when an alternate gzip is to be used (ie. pigz). ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/harden-sshd-config-3f84556136014f95.yaml0000664000175000017500000000056015201026231026153 0ustar00zuulzuul--- security: - a new post-install script was added in openssh-server element to ensure KexAlgorithms, Ciphers and MACs for sshd_config will be configured following good pratices on https://infosec.mozilla.org/guidelines/openssh. This option is activated by default, users can set DIB_OPENSSH_SERVER_HARDENING to 0 to disable this sshd configuration ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/i386-removed-13fc770dc88e81dc.yaml0000664000175000017500000000012015201026231025207 0ustar00zuulzuul--- deprecations: - References to building ``i386`` images have been removed. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/image-size-padding-24f88d1c4a215221.yaml0000664000175000017500000000023615201026231026264 0ustar00zuulzuul--- features: - The ``--image-extra-size`` option is provided to override the default 60% padding growth of the image size with a fixed gigabyte value. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/image-size-padding-mb-574104d40fdd2345.yaml0000664000175000017500000000023415201026231026661 0ustar00zuulzuul--- upgrade: - | The ``--image-extra-size`` argument has changed from gigabytes to megabytes to make it more practical for use on smaller images. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/improve-ubuntu-minimal-docs-b4c20a37a4daea2f.yaml0000664000175000017500000000031215201026231030544 0ustar00zuulzuul--- fixes: - | Added a note about a known issue with debootstrap versions when building the ubuntu-minimal element and added a reference to where exactly to find the DIB_RELEASE variable. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/incorrect-grub-label-5d2000215c0cc73e.yaml0000664000175000017500000000023015201026231026667 0ustar00zuulzuul--- fixes: - | This fixes bug 1742170 where the grub root label is different than the file system label when booting from a whole disk image. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/init-ibft-interfaces-9458d97dfcecc3ae.yaml0000664000175000017500000000033015201026231027240 0ustar00zuulzuul--- features: - | Adds a new element ``init-ibft-interfaces`` to initialize network interfaces with configuration provided via iBFT. The new element is now a dependency of the ``ironic-agent`` element. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/insecure-ubuntu-mirror-2dc80c1c8d1aa20e.yaml0000664000175000017500000000033415201026231027562 0ustar00zuulzuul--- features: - | The new variable ``DIB_DISTRIBUTION_MIRROR_VERIFY_HTTPS`` can be set to the "0" value to solve the issue with an insecure HTTPS repository that is "secured" using an insecure certificate. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/jammy-lvm-addition-53165b39e144544d.yaml0000664000175000017500000000010715201026231026260 0ustar00zuulzuul--- features: - | Allow processing 'jammy' ubuntu release in lvm ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/journal-console-752b46542ec5595e.yaml0000664000175000017500000000026515201026231025766 0ustar00zuulzuul--- features: - | The ``journal-to-console`` element is added to allow forwarding systemd output to the host console. This is useful for debugging early boot issues. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/logfile-quiet-b18f2de4059eecfd.yaml0000664000175000017500000000033115201026231025767 0ustar00zuulzuul--- features: - | Setting ``--logfile`` will now imply ``DIB_QUIET=1`` (i.e. logs will not appear on stdout). You can override this with an explicit ``DIB_QUIET=0`` if you want stdout and file logging. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/lvm-size-unit-c6b790b87d15c53d.yaml0000664000175000017500000000133215201026231025526 0ustar00zuulzuul--- other: - | The block device lvm lvs `size` attribute was passed directly to lvcreate, so using units M, G means base 2. All other block device size values are parsed with accepted conventions of M, B being base 10 and MiB, GiB being base 2. lvm lvs `size` attributes are now parsed the same as other size attributes. This improves consistency and makes it practical to calculate volume sizes to fill the partition size. This means existing size values will now create slightly smaller volumes. Previous sizes can be restored by changing the unit to MiB, GiB, or increasing the value for a base 10 unit. Requested sizes will also be rounded down to align with physical extents (4MiB).././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/move_tidy_logs_to_main-a8c03427fe1a445c.yaml0000664000175000017500000000060615201026231027523 0ustar00zuulzuul--- features: - Cleaning logs was split, some was done in the img-functions.finalise_base, some was done in the base element. The version unifies tidy up logs in the lib/img-functions. Especially when building docker container images the base element cannot be used. This patch removes about some hundreds KB of useless logs in cases when the base element is not used.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/no-ironic-agent-689e58268e1bf44f.yaml0000664000175000017500000000023315201026231025733 0ustar00zuulzuul--- upgrade: - | Removes the long deprecated ironic-agent element. Use ironic-python-agent-ramdisk from the ironic-python-agent-builder project. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/openssh-server-0f6d065748a2fc18.yaml0000664000175000017500000000017115201026231025704 0ustar00zuulzuul--- features: - New openssh-server element to ensure that the openssh server is installed and enabled during boot. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/opensuse-150-default-c047033b850d41ec.yaml0000664000175000017500000000054615201026231026476 0ustar00zuulzuul--- deprecations: - | Support in opensuse and opensuse-minimal for openSUSE 13.* has been removed as these are end of life. upgrade: - | The opensuse and opensuse-minimal element are now defaulting to build 15.0. Building for 42.2 and 42.3 is still supported, however requires setting DIB_RELEASE to '42.3' resp. '42.2' explicitly. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/opensuse-151-default-67ccfffbc134704d.yaml0000664000175000017500000000054515201026231026733 0ustar00zuulzuul--- deprecations: - | Support in opensuse and opensuse-minimal for openSUSE 42.2 has been removed as these are end of life. upgrade: - | The opensuse and opensuse-minimal element are now defaulting to build 15.1. Building for 42.3 and 15.0 is still supported, however requires setting DIB_RELEASE to '42.3' resp. '15.0' explicitly. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/opensuse-423-default-3bc73fff69374cd0.yaml0000664000175000017500000000036315201026231026662 0ustar00zuulzuul--- upgrade: - | The opensuse and opensuse-minimal element are now defaulting to 42.3, which is the latest stable openSUSE release. Building for 42.2 is still supported, however requires setting DIB_RELEASE to '42.2' explicitly. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/opensuse-minimal-45267f5be1112c22.yaml0000664000175000017500000000043315201026231026112 0ustar00zuulzuul--- features: - New zypper-minimal and opensuse-minimal elements to create basic openSUSE images. These two new elements are also making use of the existing zypper element which has been extended to include the functionality previously present in the opensuse element. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/package-install-arch-38bb5a6e61794fa5.yaml0000664000175000017500000000043415201026231026761 0ustar00zuulzuul--- features: - The ``package-installs`` element now supports a list of architectures to install the package for in the ``arch`` field and negative matching with a ``not-arch`` field. This allows greater flexibility when installing packages for only some architectures.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/package-installs-when-list-cfc00032271bae75.yaml0000664000175000017500000000017415201026231030112 0ustar00zuulzuul--- features: - | The ``package-installs`` element can now take a list value for the ``when`` environment filter. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/package-outside-debootstrap-ac93e9ce991819f1.yaml0000664000175000017500000000026115201026231030411 0ustar00zuulzuul--- fixes: - The `debian-minimal` and `ubuntu-minimal` elements now install directly from the updates repo, avoiding the need to double-install packages during build. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/persistent-netifs-fallback-1b861e037dd8a27c.yaml0000664000175000017500000000125215201026231030220 0ustar00zuulzuul--- fixes: - | The dhcp-all-interfaces element does not work correctly with the new "predictable names" scheme for network interfaces. During boot the name of the interfaces is changed from ethX to the new scheme, for example enpXsX; this name change is not detected by udev de facto making the udev rule of the dhcp-all-interfaces element useless; this causes the machine booted with the image including the dhcp-all-interfaces element to not get any ip and so being unreachable from the network. This patch includes a workaround to fallback to the "persistent names" scheme allowing the dhcp-all-interfaces element to work again as intended. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/pip-and-virtualenv-args-5d3f2512edd7f3a3.yaml0000664000175000017500000000053015201026231027531 0ustar00zuulzuul--- features: - | The ``pip-and-virtualenv`` element has added variables ``DIB_PYTHON_PIP`` and ``DIB_PYTHON_VIRTUALENV`` to make it more straight forward for other elements to install packages or create virtualenv environment deprecations: - | Source install for ``pip-and-virtualenv`` is deprecated for RHEL 8/CentOS 8././@PaxHeader0000000000000000000000000000020500000000000010212 xustar00111 path=diskimage_builder-3.42.0/releasenotes/notes/pip-and-virtualenv-platform-removal-52e0d6a22829a3b2.yaml 22 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/pip-and-virtualenv-platform-removal-52e0d6a22829a3b2.yam0000664000175000017500000000017615201026231031547 0ustar00zuulzuul--- upgrade: - The ``pip-and-virtualenv`` element does not support Fedora 31 (and greater) or Tumbleweed distributions. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/post-root-stage-51da051bcdfbc55f.yaml0000664000175000017500000000047115201026231026255 0ustar00zuulzuul--- features: - | A ``post-root`` stage is added that runs outside the chroot and before the image size calculation. For example, this may be useful for running things that copy much data into the image and need to be outside of the chroot and after install stages which run inside the chroot. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/pre-finalise-stage-574ae7886274bcba.yaml0000664000175000017500000000053215201026231026466 0ustar00zuulzuul--- features: - | A ``pre-finalise`` stage is added that runs outside the chroot and before the ``finalise`` stage. For example, this may be useful for mounting external resources that are used inside the chroot during the ``finalise`` stage, but do not need to be distributed in the final image such as build-time caches. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/python-venv-d5b04fcf57e460bf.yaml0000664000175000017500000000027415201026231025440 0ustar00zuulzuul--- fixes: - | The ``pip-and-virtualenv`` element also installs ``python3-venv`` on Python-3 Debian-like distributions to ensure ``$DIB_PYTHON_VIRTUALENV`` works as expected.././@PaxHeader0000000000000000000000000000021100000000000010207 xustar00115 path=diskimage_builder-3.42.0/releasenotes/notes/remove-consoles-from-bootloader-element-f96efa2ab5ab41f6.yaml 22 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/remove-consoles-from-bootloader-element-f96efa2ab5ab41f60000664000175000017500000000053315201026231032116 0ustar00zuulzuul--- features: - | Adds logic to permit the removal of consoles when the bootloader element when no configuration has been expressed which requests it, and serial console is disabled. This involves ``DIB_BOOTLOADER_VIRTUAL_TERMINAL`` being set to an empty string and ``DIB_BOOTLOADER_USE_SERIAL_CONSOLE`` is set to ``False``. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/remove-dib-utils-37f70dfad54900a0.yaml0000664000175000017500000000031715201026231026160 0ustar00zuulzuul--- deprecations: - The `dib-utils` requirement has been removed as the `dib-run-parts` script is now shipped from within diskimage-builder. The `dib-utils` project is now considered retired. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/remove-qemu-debootstrap-f066e85c1ab0617e.yaml0000664000175000017500000000026415201026231027565 0ustar00zuulzuul--- fixes: - | Fix cross-architecture builds that use the debootstrap element by removing use of deprecated qemu-debootstrap, in favor of using debootstrap directly. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/remove-qperf-mellanox-dc433c184c3afee4.yaml0000664000175000017500000000013415201026231027356 0ustar00zuulzuul--- deprecations: - | ``qperf`` package has been removed as from the mellanox element ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/remove-solicit-delay-57a035b91922522a.yaml0000664000175000017500000000060015201026231026600 0ustar00zuulzuul--- deprecations: - | The ``DIB_SIMPLE_INIT_NETWORKMANAGER_IPV6_DELAY`` variable is removed as it turned out that increasing this delay increased the odds that NetworkManager would fail to configure IPv6 on an interface. Instead, glean has been updated to not up interfaces and relies on NetworkManager to do this. This results in reliable IPv4 and IPv6 config. ././@PaxHeader0000000000000000000000000000022100000000000010210 xustar00123 path=diskimage_builder-3.42.0/releasenotes/notes/removes-vm-element-from-container-based-distros-607cc59df13921d7.yaml 22 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/removes-vm-element-from-container-based-distros-607cc59d0000664000175000017500000000046215201026231032176 0ustar00zuulzuul--- upgrade: - | The ``vm`` element is no longer included dependency of the ``rocky-container``, ``almalinux-container`` and ``fedora-container`` elements. You will need to update your build configuration to include this element if you still wish to create partitioned disk based images. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/replace-partition-76683c72e23b60b8.yaml0000664000175000017500000000064015201026231026267 0ustar00zuulzuul--- features: - | The new element ``replace-partition`` has been added which allows a diskimage-builder built image to be used as the base image so that it can be copied to a new partition layout. This allows the content to be copied from one image to a new one without making any package changes. The element ``replace-partition-redhat`` has a documented example for redhat family images. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/repo-package-20fe407795bffd01.yaml0000664000175000017500000000037015201026231025335 0ustar00zuulzuul--- features: - | A custom yum repository can now be configured by defining `DIB_YUM_REPO_PACKAGE` as a yum available package or a URL to an rpm file. This package can install repo files with any associated keys and certificates. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/rhel-module-selection-e9f6f06ece1fb829.yaml0000664000175000017500000000023115201026231027352 0ustar00zuulzuul--- features: - | New environment variable enables the ability to select specific module streams prior to RPM installation on RHEL8 and later. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/rhel-registration-4d4fe741321e9345.yaml0000664000175000017500000000014215201026231026301 0ustar00zuulzuul--- fixes: - rhel element fixes trying to install python3 before registering subscriptions. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/rhel7-element-deprecation-b0c1b57be8cd06ac.yaml0000664000175000017500000000037415201026231030152 0ustar00zuulzuul--- deprecations: - | The rhel7 element is deprecated and is left only for backwards compatibility. Use the `rhel` element instead. Note that you should set DIB_RELEASE to 7 to indicate which release you are using. Please read the notes. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/root-journal-size-618e064d6681699a.yaml0000664000175000017500000000020715201026231026201 0ustar00zuulzuul--- features: - The ``--mkfs-journal-size`` option is added to override the default journal size for basic ext4 root partitions. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/root-pwd-dynamic-login-530adcf15b577e4e.yaml0000664000175000017500000000046615201026231027367 0ustar00zuulzuul--- features: - | The password hash provided on the kernel command line for dynamic login can now be base64 encoded and double quotes are no longer required. The same command line can be used for both Syslinux (legacy BIOS) and Grub (UEFI) although their escaping conventions are different. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/runtime-ssh-host-keys-7a2fc873cc90d33e.yaml0000664000175000017500000000045315201026231027266 0ustar00zuulzuul--- features: - New element (runtime-ssh-host-keys) to manage SSH host keys at boot. Since SSH host key generation is not standard across operating systems, add support for both Debian and Ubuntu to handle it. While this is a new element, simple-init has been updated to depend on it. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/selinux-permissive-pre-install-ce19461ef17ec972.yaml0000664000175000017500000000035015201026231031112 0ustar00zuulzuul--- other: - | Setting values with the ``selinux-permissive`` element has been moved from ``install.d`` to ``pre-install.d`` phase to avoid selinux related packages being installed before the settings are applied. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/simple-init-nm-5d19e249c0a4560b.yaml0000664000175000017500000000034715201026231025561 0ustar00zuulzuul--- upgrade: - | The ``simple-init`` element will now default to using NetworkManager for CentOS and Fedora platforms. For CentOS 8 and Fedora, the ``DIB_SIMPLE_INIT_NETWORKMANAGER=0`` option is no longer supported. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/simple-init-nm-delay-f579e05467785219.yaml0000664000175000017500000000077115201026231026470 0ustar00zuulzuul--- fixes: - | The ``DIB_SIMPLE_INIT_NETWORKMANAGER_IPV6_DELAY`` variable is added for the ``simple-init`` element to set the ``net.ipv6.conf.default.router_solicition_delay`` sysctl setting (it defaults to 30s). If you are seeing an extra "blank" interface in ``nmcli con show`` it is likely that NM has not correctly configured itself in the presence of an interface already configured with IPV6 by the kernel. Increasing this value may help work-around the problem. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/simple-init-nm-f0896124dee92a03.yaml0000664000175000017500000000020115201026231025553 0ustar00zuulzuul--- features: - | The `simple-init` element can now use NetworkManager instead of legacy scripts on Red Hat platforms. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/simple-init-remove-cloud-init-929b271310e0f774.yaml0000664000175000017500000000024115201026231030347 0ustar00zuulzuul--- fixes: - | Use of the ``simple-init`` element now removes ``cloud-init``, in order to prevent the two tools from clashing when booting a workload. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/skip-packages-env-c97e7b4820f9bfda.yaml0000664000175000017500000000036515201026231026466 0ustar00zuulzuul--- features: - | The `package-installs` element now supports skipping installation of packages based on an environment variable specified in the config file. See the `package-installs` element documentation for full details. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/specify-bootstrap-packages-via-env-22f5c6982c09f16a.yaml0000664000175000017500000000043715201026231031524 0ustar00zuulzuul--- features: - | Now, users of the ``yum-minimal`` element can specify additional packages to install while creating the initial chroot by setting ``DIB_YUM_MINIMAL_BOOTSTRAP_PACKAGES``. This can be useful for adding support for new linux distributions that use yum. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/squashfs-output-91c1f0dc37474d3c.yaml0000664000175000017500000000006415201026231026170 0ustar00zuulzuul--- features: - New squashfs image output format. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/start-using-reno-446b3d52a467a273.yaml0000664000175000017500000000114315201026231026054 0ustar00zuulzuul--- fixes: - We now use ``fstrim`` rather than ``zerofree`` to reduce final image size. This is considered current best practice. - Fix an occasional failure to build ``centos-minimal`` and ``fedora-minimal`` due to suspected rpmdb failures. The main symptom was ``dnf`` or ``yum`` thinking packages were not installed when they were. - The ``debian-minimal`` element now obeys ``DIB_DEBIAN_COMPONENTS`` for adding components. - Fix some issues with Gentoo, and add to supported distributions. Testing is currently non-voting other: - Start using reno for release notes ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/swap_support-9ac267f56a0c0424.yaml0000664000175000017500000000011415201026231025454 0ustar00zuulzuul--- features: - | Adds swap as a valid "filesystem" for block devices ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/sysfs-ro-b127a6df2d78e57c.yaml0000664000175000017500000000034115201026231024650 0ustar00zuulzuul--- upgrade: - | Base installs now mount ``/sys`` read-only in chroot environemnts. This is a good indication to various tools and scripts that that they are running in a unprivileged/containerised environment. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/sysprep-f3fd036bc1d2c405.yaml0000664000175000017500000000040615201026231024550 0ustar00zuulzuul--- features: - | Adds sysprep element included by all systemd distros fixes: - | Adds default sysprep element clearing /etc/machine-id which prevents duplicated /etc/machine-id by forcing systemd to generate a new id for each booted system. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/sysprep-fixes-8890b968a8fa7ac1.yaml0000664000175000017500000000071315201026231025637 0ustar00zuulzuul--- fixes: - | The sysprep element has been fixed to truncate ``/var/lib/dpkg/machine-id`` (``/etc/machine-id`` was already being truncated). This ensures a machine-id is not packaged in the image and systemd will be forced to generate a new one upon first boot. - | The sysprep element is added as a dependency to the ``debootstrap`` element to ensure that it runs on all Debian builds, including debian-minimal based images. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/thin-provision-c57db8003acec386.yaml0000664000175000017500000000025315201026231026044 0ustar00zuulzuul--- features: - | LVM thin provisioning is now supported in the block device `lvs` node. Thin pools can be defined and thin volumes associated with those pools. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/timestamp-43015aa5434e8ddb.yaml0000664000175000017500000000122515201026231024770 0ustar00zuulzuul--- features: - A ``--logfile`` option is added to save output to a given file. - By default, all ``stdout`` will log with timestamps (this used to be inconsistent; python tools logged with a timestamp, and bash parts did not). If you set ``DIB_NO_TIMESTAMP`` to ``1`` the timestamp prefix will be suppressed (this would be appropriate if you are running diskimage-builder and capturing its output, and adding your own timestamp). Note that output to ``--logfile`` will always be timestamped. - You can set ``DIB_QUIET`` to ``1`` to suppress all output. This is likely only useful when used with the ``--logfile`` command.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/trusty-testing-removal-51160ee59c5477d8.yaml0000664000175000017500000000031315201026231027337 0ustar00zuulzuul--- deprecations: - Trusty testing has been removed; although we have not attempted to disable support in elements, the distribution can be effectively considered deprecated from this release. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/tty0-d01980dce4ed7786.yaml0000664000175000017500000000023615201026231023713 0ustar00zuulzuul--- features: - | The bootloader element now has variable DIB_BOOTLOADER_VIRTUAL_TERMINAL to customize or suppress the console=tty0 kernel argument.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/ubuntu-arbitrary-images-c796f5c6dbd40679.yaml0000664000175000017500000000052315201026231027602 0ustar00zuulzuul--- upgrade: - | You would need to modify your ``DIB_CLOUD_IMAGES`` and possibly ``SHA256SUMS`` variables if you were using them to build Ubuntu with elements/ubuntu: ``DIB_CLOUD_IMAGES`` would need to contain URL with path, and ``SHA256SUMS`` would not now neccesarily point to ``$DIB_RELEASE/current/`` directory. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/ubuntu-focal-0f54ed4543247b7e.yaml0000664000175000017500000000012715201026231025326 0ustar00zuulzuul--- features: - | The ``ubuntu-minimal`` element now supports the Focal release. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/upgrade-pip-before-c-d2443847f9d58c7a.yaml0000664000175000017500000000053015201026231026631 0ustar00zuulzuul--- fixes: - | This fixes bug 1744403 where 60-ironic-agent-install fails to run when DIB_INSTALLTYPE_ironic_agent=source is set. pip installs constraints with the -c argument and this argument is a relatively newer addion. The currently installed pip may not support that option and must be upgraded before proceeding. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/upgrade_openeuler_to_22.03-d67d9bb3c5c97749.yaml0000664000175000017500000000012315201026231027752 0ustar00zuulzuul--- features: - | Upgrade openEuler element from 20.03-LTS-SP2 to 22.03-LTS. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/virtualenv-activation-6de5738c9db8241d.yaml0000664000175000017500000000031515201026231027347 0ustar00zuulzuul--- features: - | This removes automatic detection and activation of virtualenv environments, which is no longer necessary. This fixes installation under Python 3's inbuilt ``venv`` module. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/yum-cache-removal-148c33012515e56e.yaml0000664000175000017500000000074315201026231026072 0ustar00zuulzuul--- deprecations: - The ``DIB_YUMCHROOT_USE_CACHE`` variable has been removed and the Fedora and CentOS ``-minimal`` initial chroot will always be created by the package manager. The default creation of a chroot tarball is stopped for these elements. This unused option was unsafe; there is no guarantee that the base system will not change even between runs. Getting the package manager to reuse the cache for the initial chroot install is future work. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/yum-minimal-dnf-63305c349bcccdd4.yaml0000664000175000017500000000033415201026231026055 0ustar00zuulzuul--- upgrade: - | This includes updates to allow `yum-minimal` elements to work on host platforms that only supply DNF (e.g. Debian Bullseye). Note the `dnf download` plugin is required on these platforms. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/notes/yum-minimal-firmware-194846961a6a1cb9.yaml0000664000175000017500000000022415201026231026714 0ustar00zuulzuul--- fixes: - | The yum-minimal element now removes the linux-firmware and linux-firmware-whence packages to save space in cloud images. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4482393 diskimage_builder-3.42.0/releasenotes/source/0000775000175000017500000000000015201026275020056 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/source/conf.py0000664000175000017500000001665415201026231021361 0ustar00zuulzuul# Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = ['openstackdocstheme', 'reno.sphinxext'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'diskimage-builder' copyright = u'2016, Diskimage-builder contributors' # openstackdocstheme options openstackdocs_repo_name = 'openstack/diskimage-builder' openstackdocs_bug_project = 'diskimage-builder' openstackdocs_auto_name = False openstackdocs_bug_tag = '' # Release notes do not need a version in the title, they span # multiple versions. # The short X.Y version. release = '' # The full version, including alpha/beta/rc tags. version = '' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = [] # The reST default role (used for this markup: `text`) to use for all # documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'native' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. #keep_warnings = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'openstackdocs' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". #html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. #html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'diskimage-builderdoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ ('index', 'diskimage-builder-releasenotes.tex', u'diskimage-builder Documentation', u'OpenStack', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'diskimage-builder', u'diskimage-builder Release Notes', [u'OpenStack'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'diskimage-builder', u'diskimage-builder Release Notes', u'OpenStack', 'diskimage-builder', 'Build disk images for CI and more.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False # -- Options for Internationalization output ------------------------------ locale_dirs = ['locale/'] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/releasenotes/source/index.rst0000664000175000017500000000016415201026231021710 0ustar00zuulzuul=============================== diskimage-builder Release Notes =============================== .. release-notes:: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/requirements.txt0000664000175000017500000000031515201026231017340 0ustar00zuulzuulnetworkx>=2.3.0 # BSD pbr!=2.1.0,>=2.0.0 # Apache-2.0 PyYAML>=3.12 # MIT stevedore>=1.20.0 # Apache-2.0 # NOTE(ianw) in here because dib-lint uses flake8 flake8<7.0.0,>=3.6.0 # MIT jsonschema>=3.0.2 # MIT ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.302236 diskimage_builder-3.42.0/roles/0000775000175000017500000000000015201026275015211 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4482393 diskimage_builder-3.42.0/roles/dib-ensure-debootstrap/0000775000175000017500000000000015201026275021572 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/roles/dib-ensure-debootstrap/README.rst0000664000175000017500000000014315201026231023247 0ustar00zuulzuulUpdate debootstap from debian unstable. This ensures debootstrap is new enough to recognize Noble. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4482393 diskimage_builder-3.42.0/roles/dib-ensure-debootstrap/tasks/0000775000175000017500000000000015201026275022717 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/roles/dib-ensure-debootstrap/tasks/main.yaml0000664000175000017500000000104515201026231024517 0ustar00zuulzuul- name: Install debootstrap/unstable # This is shell because doing it with native ansible modules went nowhere become: yes shell: | set -ex echo "APT::Default-Release: 'stable';" > /etc/apt/apt.conf.d/default-release echo "deb http://deb.debian.org/debian unstable main" > /etc/apt/sources.list.d/unstable-debian.list apt-get update apt-get install -y debootstrap # Remove the use of unstable as it seems to interfere with other tasks rm /etc/apt/sources.list.d/unstable-debian.list apt-get --assume-yes update ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4482393 diskimage_builder-3.42.0/roles/dib-functests/0000775000175000017500000000000015201026275017763 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/roles/dib-functests/README.rst0000664000175000017500000000051515201026231021443 0ustar00zuulzuuldib-functests ------------- Run diskimage-builder functional tests Installs dib and dependencies, and runs functional tests **Role Variables** .. zuul:rolevar:: python_version :default: 2 The python version to run the test under .. zuul:rolevar:: dib_functests :default: [] The list of functional tests to run ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4482393 diskimage_builder-3.42.0/roles/dib-functests/defaults/0000775000175000017500000000000015201026275021572 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/roles/dib-functests/defaults/main.yaml0000664000175000017500000000043615201026231023375 0ustar00zuulzuul--- dib_virtualenv: "{{ ansible_user_dir }}/dib-venv" dib_functests: [] # This is a bit of hack; it allows us to template out jobs where the # base tests are defined in dib_functests, but then add a few extra # tests to run in this variable for a specific test. dib_functests_extra: [] ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4482393 diskimage_builder-3.42.0/roles/dib-functests/tasks/0000775000175000017500000000000015201026275021110 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/roles/dib-functests/tasks/main.yaml0000664000175000017500000000513015201026231022707 0ustar00zuulzuul- name: Install dib extra dependencies command: ./install_test_deps.sh args: chdir: "{{ zuul.project.src_dir }}/tests" become: yes - name: Setup mounted space file: path: '/opt/dib_cache' state: directory mode: ugo+rw become: yes - name: Define upper_constraints set_fact: upper_constraints: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/requirements'].src_dir }}/upper-constraints.txt" - name: Take ourselves out of uppper constraints lineinfile: path: "{{ upper_constraints }}" state: absent regexp: '^diskimage-builder' - name: Install diskimage-builder pip: name: "file://{{ ansible_user_dir }}/{{ zuul.project.src_dir }}" virtualenv: "{{ dib_virtualenv }}" virtualenv_command: "{{ ensure_pip_virtualenv_command }}" extra_args: "-c {{ upper_constraints }}" - name: Setup log output file: path: "{{ ansible_user_dir }}/logs" state: directory mode: ugo+rw # There is a Debian package for dnf-plugins-core but it breaks and replaces # zypper which we also want to install. Prior to dnf-plugins-core existing # in Debian we fetched the content we needed from github. Continue doing # that but pin the version for compatibility with Debian's dnf. # Until Debian fixes its dnf-plugins-core package in bookworm; manually # install "dnf download" for the yum-minimal element. Note version 4.4.4 # is the last version compatible with bookworm's dnf package. - name: Install dnf download shell: | set -x git clone --depth 1 --branch 4.4.4 https://github.com/rpm-software-management/dnf-plugins-core mkdir /usr/lib/python3/dist-packages/dnf-plugins cp -r dnf-plugins-core/plugins/dnfpluginscore /usr/lib/python3/dist-packages cp dnf-plugins-core/plugins/download.py /usr/lib/python3/dist-packages/dnf-plugins rm -rf dnf-plugins-core echo 'pluginpath=/usr/lib/python3/dist-packages/dnf-plugins' >> /etc/dnf/dnf.conf args: executable: /bin/bash become: yes when: ansible_os_family == 'Debian' - name: Run dib functional tests shell: cmd: | source {{ dib_virtualenv }}/bin/activate {{ zuul.project.src_dir }}/tests/run_functests.sh \ -L {{ ansible_user_dir }}/logs {{ dib_functests | join(' ') }} \ {{ dib_functests_extra | join(' ') }} args: executable: /bin/bash environment: DIB_NO_TMPFS: 1 TMPDIR: /opt/dib_cache DIB_OS_CI_YUM_REPOS: "{{ dib_gate_mirror_repos|default(omit) }}" # NOTE(ianw) 2021-10-15 : this might be our bullseye images # having issues with non-root podman. This works for now. DIB_CONTAINERFILE_RUNTIME_ROOT: 1 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4482393 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/0000775000175000017500000000000015201026275021516 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/README.rst0000664000175000017500000000027515201026231023201 0ustar00zuulzuuldib-setup-gate-mirrors ====================== Create customised repository files as required by the openstack-ci-mirrors element. Path to repo files is set into ``dib_gate_mirror_repos`` ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4492393 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/defaults/0000775000175000017500000000000015201026275023325 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/defaults/main.yaml0000664000175000017500000000007015201026231025122 0ustar00zuulzuulmirror_fqdn: "{{ zuul_site_mirror_fqdn|default(omit) }}"././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4492393 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/tasks/0000775000175000017500000000000015201026275022643 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/tasks/main.yaml0000664000175000017500000000307715201026231024452 0ustar00zuulzuul- name: Set repo path set_fact: dib_gate_mirror_repos: "{{ ansible_user_dir }}/dib-mirror" - debug: msg="zuul site mirror {{ zuul_site_mirror_fqdn }}" - debug: msg="mirror_fqdn {{ mirror_fqdn }}" - name: Create centos-minimal 8-stream directory file: path: "{{ dib_gate_mirror_repos }}/centos-minimal/8-stream/yum.repos.d" state: directory mode: 0775 recurse: yes - name: Install centos-minimal 8-stream repo files template: dest: "{{ dib_gate_mirror_repos }}/centos-minimal/8-stream/yum.repos.d/dib-mirror-{{ item }}" mode: 0644 src: "centos-minimal/8-stream/{{ item }}.j2" with_items: - base.repo - appstream.repo - name: Create centos-minimal 9-stream directory file: path: "{{ dib_gate_mirror_repos }}/centos-minimal/9-stream/yum.repos.d" state: directory mode: 0775 recurse: yes - name: Install centos-minimal 9-stream repo files template: dest: "{{ dib_gate_mirror_repos }}/centos-minimal/9-stream/yum.repos.d/dib-mirror-{{ item }}" mode: 0644 src: "centos-minimal/9-stream/{{ item }}.j2" with_items: - base.repo - appstream.repo - name: Create openeuler-minimal 22.03-LTS directory file: path: "{{ dib_gate_mirror_repos }}/openeuler-minimal/22.03-LTS/yum.repos.d" state: directory mode: 0775 recurse: yes - name: Install openeuler-minimal 22.03-LTS repo files template: dest: "{{ dib_gate_mirror_repos }}/openeuler-minimal/22.03-LTS/yum.repos.d/dib-mirror-{{ item }}" mode: 0644 src: "openeuler-minimal/22.03-LTS/{{ item }}.j2" with_items: - openEuler.repo ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.303236 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/0000775000175000017500000000000015201026275023514 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.303236 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/centos-minimal/0000775000175000017500000000000015201026275026433 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4492393 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/centos-minimal/7/0000775000175000017500000000000015201026275026601 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/centos-minimal/7/base.repo.j20000664000175000017500000000016315201026231030704 0ustar00zuulzuul[base] name=CentOS-$releasever - Base baseurl=http://{{ mirror_fqdn }}/centos/$releasever/os/$basearch/ gpgcheck=0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/centos-minimal/7/extras.repo.j20000664000175000017500000000024315201026231031277 0ustar00zuulzuul#additional packages that may be useful [extras] name=CentOS-$releasever - Extras baseurl=http://{{ mirror_fqdn }}/centos/$releasever/extras/$basearch/ gpgcheck=0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/centos-minimal/7/updates.repo.j20000664000175000017500000000022015201026231031431 0ustar00zuulzuul#released updates [updates] name=CentOS-$releasever - Updates baseurl=http://{{ mirror_fqdn }}/centos/$releasever/updates/$basearch/ gpgcheck=0 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4492393 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/centos-minimal/8-stream/0000775000175000017500000000000015201026275030073 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021100000000000010207 xustar00115 path=diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/centos-minimal/8-stream/appstream.repo.j2 22 mtime=1778658457.0 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/centos-minimal/8-stream/appstream.re0000664000175000017500000000021015201026231032400 0ustar00zuulzuul[Stream-AppStream] name=CentOS-Stream - AppStream baseurl=https://{{ mirror_fqdn }}/centos/8-stream/AppStream/$basearch/os/ gpgcheck=0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/centos-minimal/8-stream/base.repo.j20000664000175000017500000000017515201026231032201 0ustar00zuulzuul[Stream-BaseOS] name=CentOS-Stream - Base baseurl=https://{{ mirror_fqdn }}/centos/8-stream/BaseOS/$basearch/os/ gpgcheck=0 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4492393 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/centos-minimal/9-stream/0000775000175000017500000000000015201026275030074 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021100000000000010207 xustar00115 path=diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/centos-minimal/9-stream/appstream.repo.j2 22 mtime=1778658457.0 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/centos-minimal/9-stream/appstream.re0000664000175000017500000000021615201026231032407 0ustar00zuulzuul[Stream-AppStream] name=CentOS-Stream - AppStream baseurl=https://{{ mirror_fqdn }}/centos-stream/9-stream/AppStream/$basearch/os gpgcheck=0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/centos-minimal/9-stream/base.repo.j20000664000175000017500000000020615201026231032175 0ustar00zuulzuul[Stream-BaseOS] name=CentOS-Stream - BaseOS baseurl=https://{{ mirror_fqdn }}/centos-stream/9-stream/BaseOS/$basearch/os/ gpgcheck=0 ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.303236 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/openeuler-minimal/0000775000175000017500000000000015201026275027136 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4502392 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/openeuler-minimal/22.03-LTS/0000775000175000017500000000000015201026275030242 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000021500000000000010213 xustar00119 path=diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/openeuler-minimal/22.03-LTS/openEuler.repo.j2 22 mtime=1778658457.0 diskimage_builder-3.42.0/roles/dib-setup-gate-mirrors/templates/openeuler-minimal/22.03-LTS/openEule0000664000175000017500000000117615201026231031736 0ustar00zuulzuul[OS] name=OS baseurl=http://{{ mirror_fqdn }}/openeuler/openEuler-22.03-LTS/OS/$basearch/ enabled=1 gpgcheck=0 [everything] name=everything baseurl=http://{{ mirror_fqdn }}/openeuler/openEuler-22.03-LTS/everything/$basearch/ enabled=1 gpgcheck=0 [EPOL] name=EPOL baseurl=http://{{ mirror_fqdn }}/openeuler/openEuler-22.03-LTS/EPOL/main/$basearch/ enabled=1 gpgcheck=0 [EPOL-UPDATE] name=EPOL-UPDATE baseurl=http://{{ mirror_fqdn }}/openeuler/openEuler-22.03-LTS/EPOL/update/main/$basearch/ enabled=1 gpgcheck=0 [update] name=update baseurl=http://{{ mirror_fqdn }}/openeuler/openEuler-22.03-LTS/update/$basearch/ enabled=1 gpgcheck=0 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4522393 diskimage_builder-3.42.0/setup.cfg0000664000175000017500000000324015201026275015705 0ustar00zuulzuul[metadata] name = diskimage-builder summary = Golden Disk Image builder. description_file = README.rst author = OpenStack author_email = openstack-discuss@lists.openstack.org license = Apache License (2.0) home_page = https://docs.openstack.org/diskimage-builder/latest/ classifier = Development Status :: 5 - Production/Stable License :: OSI Approved :: Apache Software License Operating System :: POSIX :: Linux Programming Language :: Python :: 3 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.12 Environment :: Console python_requires = >=3.8 [files] packages = diskimage_builder scripts = bin/dib-lint data_files = share/diskimage-builder/scripts = scripts/* [entry_points] console_scripts = disk-image-create = diskimage_builder.disk_image_create:main ramdisk-image-create = diskimage_builder.disk_image_create:main diskimage-builder = diskimage_builder.diskimage_builder:main diskimage_builder.block_device.plugin = local_loop = diskimage_builder.block_device.level0.localloop:LocalLoop partitioning = diskimage_builder.block_device.level1.partitioning:Partitioning lvm = diskimage_builder.block_device.level1.lvm:LVMPlugin mkfs = diskimage_builder.block_device.level2.mkfs:Mkfs mount = diskimage_builder.block_device.level3.mount:Mount fstab = diskimage_builder.block_device.level4.fstab:Fstab diskimage_builder.block_device.plugin_test = test_a = diskimage_builder.block_device.tests.plugin.test_a:TestA test_b = diskimage_builder.block_device.tests.plugin.test_b:TestB [egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/setup.py0000664000175000017500000000127115201026231015570 0ustar00zuulzuul# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import setuptools setuptools.setup( setup_requires=['pbr>=2.0.0'], pbr=True) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/test-requirements.txt0000664000175000017500000000027215201026231020317 0ustar00zuulzuulpylint>=1.7.1 #GPLv2 fixtures>=3.0.0 # Apache-2.0/BSD oslotest>=3.2.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0 testtools>=2.2.0 # MIT coverage!=4.4,>=4.0 # Apache-2.0 yamllint>=1.23.0 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4502392 diskimage_builder-3.42.0/tests/0000775000175000017500000000000015201026275015227 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/tests/README.rst0000664000175000017500000000052415201026231016707 0ustar00zuulzuulDIB Testing =========== There are several interfaces for testing various parts of DIB * run_dib_library_tests.sh : run unit-tests for internal diskimage-builder library functions * run_functests.sh : run functional testing provided by elements * run_output_format_test.sh : run a test of image conversion (requires docker) ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1778658493.303236 diskimage_builder-3.42.0/tests/elements/0000775000175000017500000000000015201026275017043 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4502392 diskimage_builder-3.42.0/tests/elements/fake-os/0000775000175000017500000000000015201026275020370 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/tests/elements/fake-os/README.rst0000664000175000017500000000024015201026231022043 0ustar00zuulzuulfake-os ======= This is not the element you are looking for. This element does not provide an operating system, it provides a fake for testing purposes only. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/tests/elements/fake-os/element-provides0000664000175000017500000000002115201026231023556 0ustar00zuulzuuloperating-system ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4512393 diskimage_builder-3.42.0/tests/elements/fake-os/root.d/0000775000175000017500000000000015201026275021575 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/tests/elements/fake-os/root.d/10-fake-os0000775000175000017500000000053215201026231023256 0ustar00zuulzuul#!/bin/bash set -eux set -o pipefail sudo touch $TARGET_ROOT/fake-os for DIR in etc mnt proc dev sys tmp; do sudo mkdir -p ${TARGET_ROOT}/${DIR} done # We need some size so the mkfs does not fail when making an fs of size 0 # We also need to account for the journal size on the FS dd if=/dev/zero of=$TARGET_ROOT/fake-data bs=1M count=42 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/tests/install_test_deps.sh0000775000175000017500000000105315201026231021275 0ustar00zuulzuul#!/bin/bash set -eux set -o pipefail sudo apt-get update || true sudo apt-get install -y --force-yes \ docker.io || \ sudo yum -y install --enablerepo=epel \ yum-utils \ debootstrap \ dpkg \ docker || \ sudo zypper -n install \ docker || \ sudo emerge \ app-arch/bzip2 \ app-emulation/qemu \ dev-python/pyyaml \ sys-block/parted \ sys-apps/gptfdisk \ sys-fs/multipath-tools \ sys-fs/dosfstools \ qemu-img \ yum-utils ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/tests/run_dib_library_tests.sh0000775000175000017500000000257515201026231022157 0ustar00zuulzuul#!/bin/bash # unit testing for some of the common-functions # # This is fairly invasive and *may* leave behind mounts, etc, that # need a human in the loop. Thus it's mostly useful for developers # during testing, but not so great for CI source ../diskimage_builder/lib/common-functions # # Directory mounting and unmounting # # make mount points TMP_DIR=$(mktemp -d) cd $TMP_DIR mkdir mnt mkdir mnt/proc mnt/dev mnt/dev/pts mnt/sysfs mnt/sys # for extra complexity, simulate the path being behind a symlink ln -s mnt mnt-symlink TMP_MOUNT_PATH=$TMP_DIR/mnt-symlink # mount devices mount_proc_dev_sys if [ $(grep "$TMP_DIR" /proc/mounts | wc -l) -ne 4 ]; then echo "*** FAILED to mount all directories" # we might be in an unclean state here, but something is broken... # we don't want to delete mounted system directories return 1 else echo "*** PASS : mounted all directories" fi # umount devices unmount_dir $TMP_MOUNT_PATH if grep -q "$TMP_DIR" /proc/mounts; then echo "*** FAILED due to mounts being left behind" return 1 else echo "*** PASS all directories unmounted" fi # unmount missing dir if unmount_dir /this/path/does/not/exist/but/this/should/not/fail; then echo "*** PASS unmount_dir ignored a missing path" else echo "*** FAILED unmount_dir should ignore missing paths" return 1 fi # cleanup rm -rf $TMP_DIR ### TODO more tests here ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/tests/run_functests.sh0000775000175000017500000003135715201026231020471 0ustar00zuulzuul#!/bin/bash set -eu set -o pipefail BASE_DIR=$(cd $(dirname "$0")/.. && pwd) # then execute tests for elements export DIB_CMD="diskimage-builder" export DIB_ELEMENTS=$(python -c ' import diskimage_builder.paths diskimage_builder.paths.show_path("elements")') # Setup sane locale defaults, because this information is leaked into DIB. export LANG=en_US.utf8 export LC_ALL= # # Default skip tests # # For time reasons, we do not run these tests by default; i.e. these # tests are not run by "tox -e func" in the gate. # DEFAULT_SKIP_TESTS=( ## These are part of the "extras-nv" job # These require "zypper" on the host which is not available on # all platforms opensuse-minimal/build-succeeds opensuse-minimal/opensuse15-build-succeeds # non-voting; not used by infra currently gentoo/build-succeeds # Needs infra mirroring to move to voting job debian-minimal/stable-build-succeeds debian-minimal/stable-vm ## # These download base images which has shown to be very unreliable # in the gate. Keep them in a -nv job until we can figure out # better caching for the images opensuse/build-succeeds opensuse/opensuse15-build-succeeds debian/build-succeeds fedora/build-succeeds ubuntu/trusty-build-succeeds ubuntu/xenial-build-succeeds ubuntu/bionic-build-succeeds # No longer reasonable to test upstream (lacks a mirror in infra) # Note this is centos6 and should probably be removed centos/build-succeeds # This job is a bit unreliable, even if we get mirroring debian-minimal/testing-build-succeeds # Old and no longer supported in a default test env ubuntu-minimal/trusty-build-succeeds ubuntu-minimal/xenial-build-succeeds ubuntu-minimal/bionic-build-succeeds ) # The default output formats (specified to disk-image-create's "-t" # command. Elements can override with a test-output-formats file DEFAULT_OUTPUT_FORMATS="tar" function log_with_prefix { local pr=$1 local log while read a; do log="[$pr] $a" # note: dib logs have timestamp by default now echo "${log}" done } # Log job control messages function log_jc { local msg="$1" local log="[JOB-CONTROL] ${msg}" if [[ ${LOG_DATESTAMP} -ne 0 ]]; then log="$(date +"%Y%m%d-%H%M%S.%N") ${log}" fi echo "${log}" } function job_cnt { running_jobs=$(jobs -p) echo ${running_jobs} | wc -w } # This is needed, because the better 'wait -n' is # available since bash 4.3 only. function wait_minus_n { if [ "${BASH_VERSINFO[0]}" -gt 4 \ -o "${BASH_VERSINFO[0]}" = 4 \ -a "${BASH_VERSINFO[1]}" -ge 3 ]; then # Good way: wait on any job wait -n return $? else # Not that good way: wait on one specific job # (others may be finished in the mean time) local wait_for_pid=$(jobs -p | head -1) wait ${wait_for_pid} return $? fi } # This takes the status and the "$logfile" argument passed to # disk-image-create and renames the file, so you can quickly see # in results which tests have failed. function logfile_status { local status="$1" local filename="$2" if [[ -z "${filename}" ]]; then return fi echo "Moving ${filename} to ${filename/.log/.$status.log}" mv "$filename" ${filename/.log/.$status.log} } # run_disk_element_test # Run a disk-image-build build of ELEMENT including any elements # specified by TEST_ELEMENT. Pass OUTPUT_FORMAT to "-t" function run_disk_element_test() { local test_element=$1 local element=$2 local dont_use_tmp=$3 local output_format="$4" local logfile="$5" local dest_dir=$(mktemp -d) if [[ ${KEEP_OUTPUT} -ne 1 ]]; then trap "rm -rf $dest_dir" EXIT fi cat >> $dest_dir/image.yaml << EOF - imagename: $dest_dir/image debug-trace: 1 types: [$output_format] no-tmpfs: $dont_use_tmp logfile: $logfile skip-base: yes elements: - $element - $test_element environment: DIB_SHOW_IMAGE_USAGE: "1" EOF if break="after-error" break_outside_target=1 \ break_cmd="cp -v \$TMP_MOUNT_PATH/tmp/dib-test-should-fail ${dest_dir} || true" \ ELEMENTS_PATH=$DIB_ELEMENTS/$element/test-elements \ $DIB_CMD $dest_dir/image.yaml 2>&1 \ | log_with_prefix "${element}/${test_element}"; then if [[ "qcow2" =~ "$output_format" ]]; then if ! [ -f "$dest_dir/image.qcow2" ]; then echo "Error: qcow2 build failed for element: $element, test-element: $test_element." echo "No image $dest_dir/image.qcow2 found!" logfile_status "FAIL" "${logfile}" exit 1 fi fi if [[ "tar" =~ "$output_format" ]]; then # check inside the tar for sentinel files if ! [ -f "$dest_dir/image.tar" ]; then echo "Error: Build failed for element: $element, test-element: $test_element." echo "No image $dest_dir/image.tar found!" logfile_status "FAIL" "${logfile}" exit 1 else if tar -tf $dest_dir/image.tar | grep -q /tmp/dib-test-should-fail; then echo "Error: Element: $element, test-element $test_element should have failed, but passed." logfile_status "FAIL" "${logfile}" exit 1 fi fi fi # if we got here, the test passed echo "PASS: Element $element, test-element: $test_element" logfile_status "PASS" "${logfile}" else if [ -f "${dest_dir}/dib-test-should-fail" ]; then echo "PASS: Element $element, test-element: $test_element" logfile_status "PASS" "${logfile}" else echo "Error: Build failed for element: $element, test-element: $test_element." logfile_status "FAIL" "${logfile}" exit 1 fi fi rm -f /tmp/dib-test-should-fail if [[ ${KEEP_OUTPUT} -ne 1 ]]; then # reset trap and cleanup trap EXIT rm -rf $dest_dir fi } # run_ramdisk_element_test # Run a disk-image-builder default build of ELEMENT including any # elements specified by TEST_ELEMENT function run_ramdisk_element_test() { local test_element=$1 local element=$2 local dont_use_tmp=$3 local output_format="$4" # ignored here local logfile="$5" local dest_dir=$(mktemp -d) cat >> $dest_dir/image.yaml << EOF - imagename: $dest_dir/image debug-trace: 1 no-tmpfs: $dont_use_tmp logfile: $logfile elements: - $element - $test_element EOF if ELEMENTS_PATH=$DIB_ELEMENTS/$element/test-elements \ $DIB_CMD $dest_dir/image.yaml 2>&1 \ | log_with_prefix "${element}/${test_element}"; then # TODO(dtantsur): test also kernel presence once we sort out its naming # problem (vmlinuz vs kernel) if ! [ -f "$dest_dir/image.initramfs" ]; then echo "Error: Build failed for element: $element, test-element: $test_element." echo "No image $dest_dir/image.initramfs found!" logfile_status "FAIL" "${logfile}" exit 1 else echo "PASS: Element $element, test-element: $test_element" logfile_status "PASS" "${logfile}" fi else echo "Error: Build failed for element: $element, test-element: $test_element." logfile_status "FAIL" "${logfile}" exit 1 fi } # # run_functests.sh # run the functional tests for dib elements # # find elements that have functional test elements. TESTS will be an # array with each value being "element/test-element" TESTS=() for e in $DIB_ELEMENTS/*/test-elements/*; do test_element=$(echo $e | awk 'BEGIN {FS="/"}{print $NF}') element=$(echo $e | awk 'BEGIN {FS="/"}{print $(NF-2)}') TESTS+=("$element/$test_element") done # # Default values # JOB_MAX_CNT=1 LOG_DATESTAMP=0 KEEP_OUTPUT=0 LOG_DIRECTORY='' # # Parse args # while getopts ":hlj:tL:" opt; do case $opt in h) echo "run_functests.sh [-h] [-l] ..." echo " -h : show this help" echo " -l : list available tests" echo " -j : parallel job count (default to 1)" echo " -t : prefix log messages with timestamp" echo " -k : keep output directories" echo " -L : output logs into this directory" echo " : functional test to run" echo " Special test 'all' will run all tests" exit 0 ;; l) echo "The available functional tests are:" echo for t in ${TESTS[@]}; do echo -n " $t" if [[ " ${DEFAULT_SKIP_TESTS[@]} " =~ " ${t} " ]]; then echo " [skip]" else echo " [run]" fi done echo exit 0 ;; j) JOB_MAX_CNT=${OPTARG} echo "Running parallel - using [${JOB_MAX_CNT}] jobs" ;; t) LOG_DATESTAMP=1 ;; k) KEEP_OUTPUT=1 ;; L) LOG_DIRECTORY=${OPTARG} ;; \?) echo "Invalid option: -$OPTARG" exit 1 ;; esac done shift $((OPTIND-1)) DONT_USE_TMP="no" if [ "${JOB_MAX_CNT}" -gt 1 ]; then # switch off using tmp dir for image building # (The mem check using the tmp dir is currently done # based on the available memory - and not on the free. # See #1618124 for more details) DONT_USE_TMP="yes" fi # cull the list of tests to run into TESTS_TO_RUN TESTS_TO_RUN=() title="" if [[ -z "$@" ]]; then # remove the skipped tests title="Running default tests:" for test in "${TESTS[@]}"; do if [[ " ${DEFAULT_SKIP_TESTS[@]} " =~ " ${test} " ]]; then continue else TESTS_TO_RUN+=("${test}") fi done elif [[ $1 == "all" ]]; then title="Running all tests:" TESTS_TO_RUN=("${TESTS[@]}") else title="Running specified tests:" for test in $@; do if [[ ! " ${TESTS[@]} " =~ " ${test} " ]]; then echo "${test} : not a known test (see -l)" exit 1 fi TESTS_TO_RUN+=("${test}") done fi if [[ -n "${LOG_DIRECTORY}" ]]; then mkdir -p "${LOG_DIRECTORY}" export DIB_QUIET=1 fi # print a little status info echo "------" echo ${title} for test in "${TESTS_TO_RUN[@]}"; do echo " ${test}" done echo "------" function wait_and_exit_on_failure { local pid=$1 wait ${pid} result=$? if [ "${result}" -ne 0 ]; then exit ${result} fi return 0 } EXIT_CODE=0 for test in "${TESTS_TO_RUN[@]}"; do running_jobs_cnt=$(job_cnt) log_jc "Number of running jobs [${running_jobs_cnt}] max jobs [${JOB_MAX_CNT}]" if [ "${running_jobs_cnt}" -ge "${JOB_MAX_CNT}" ]; then log_jc "Waiting for job to finish" wait_minus_n result=$? if [ "${result}" -ne 0 ]; then EXIT_CODE=1 # If a job fails, do not start any new ones. break fi fi log_jc "Starting new job" # from above; each array value is element/test_element. split it # back up element=${test%/*} test_element=${test#*/} element_dir=$DIB_ELEMENTS/${element}/test-elements/${test_element}/ # tests default to disk-based, but "element-type" can optionally # override that element_type=disk element_type_override=${element_dir}/element-type if [ -f ${element_type_override} ]; then element_type=$(cat ${element_type_override}) fi # override the output format if specified element_output=${DEFAULT_OUTPUT_FORMATS} element_output_override=${element_dir}/test-output-formats if [ -f $element_output_override ]; then element_output=$(cat ${element_output_override}) fi log_argument='' if [[ -n "${LOG_DIRECTORY}" ]]; then log_argument="${LOG_DIRECTORY}/${element}_${test_element}.log" fi echo "Running $test ($element_type)" run_${element_type}_element_test \ $test_element $element \ ${DONT_USE_TMP} "${element_output}" "$log_argument" & done # Wait for the rest of the jobs while true; do running_jobs_cnt=$(job_cnt) log_jc "Number of running jobs left [${running_jobs_cnt}]" if [ "${running_jobs_cnt}" -eq 0 ]; then break; fi wait_minus_n result=$? if [ "${result}" -ne 0 ]; then EXIT_CODE=1 fi done if [ "${EXIT_CODE}" -eq 0 ]; then echo "Tests passed!" exit 0 else echo "At least one test failed" exit 1 fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/tests/run_output_format_test.sh0000775000175000017500000000403015201026231022406 0ustar00zuulzuul#!/bin/bash set -eu set -o pipefail # # run_output_format_test.sh # # Use docker to test generation of various output formats. # BASE_DIR=$(cd $(dirname "$0")/.. && pwd) export DIB_ELEMENTS=$BASE_DIR/elements export TEST_ELEMENTS=$BASE_DIR/tests/elements export DIB_CMD=$BASE_DIR/bin/disk-image-create function build_test_image() { format=${1:-} if [ -n "$format" ]; then type_arg="-t $format" else type_arg= format="qcow2" fi dest_dir=$(mktemp -d) base_dest=$(basename $dest_dir) trap "rm -rf $dest_dir; sudo docker rmi $base_dest/image" EXIT ELEMENTS_PATH=$DIB_ELEMENTS:$TEST_ELEMENTS \ $DIB_CMD -x $type_arg --docker-target=$base_dest/image \ -o $dest_dir/image -n fake-os format=$(echo $format | tr ',' ' ') for format in $format; do if [ $format != 'docker' ]; then img_path="$dest_dir/image.$format" if ! [ -f "$img_path" ]; then echo "Error: No image with name $img_path found!" exit 1 else echo "Found image $img_path." fi else if ! sudo docker images | grep $base_dest/image ; then echo "Error: No docker image with name $base_dest/image found!" exit 1 else echo "Found docker image $base_dest/image" fi fi done trap EXIT rm -rf $dest_dir if sudo docker images | grep $base_dest/image ; then sudo docker rmi $base_dest/image fi } test_formats="tar tgz squashfs raw qcow2 docker aci" for binary in qemu-img docker mksquashfs; do if [ -z "$(type $binary)" ]; then echo "Warning: No $binary binary found, cowardly refusing to run tests." exit 1 fi done for format in '' $test_formats; do build_test_image $format echo "Test passed for output formats '$format'." done combined_format=$(echo $test_formats | tr ' ' ',') build_test_image $combined_format echo "Test passed for output format '$combined_format'." ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1778658493.4512393 diskimage_builder-3.42.0/tools/0000775000175000017500000000000015201026275015225 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1778658457.0 diskimage_builder-3.42.0/tools/functional-test-check.sh0000775000175000017500000001145315201026231021752 0ustar00zuulzuul#!/bin/bash -ex LOGDIR=/home/zuul/zuul-output/logs # Set to indiciate an error return RETURN=0 FAILURE_REASON="" cat > /tmp/ssh_wrapper <