pax_global_header00006660000000000000000000000064147447005230014520gustar00rootroot0000000000000052 comment=1c7169c67ad66d46706ff6db94450a37459e7291 image-garden-0.1.1/000077500000000000000000000000001474470052300140375ustar00rootroot00000000000000image-garden-0.1.1/.dockerignore000066400000000000000000000002521474470052300165120ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki *.img *.iso *.log *.qcow2 *.run .git .reuse LICENSE LICENSES image-garden.mk spread-demo image-garden-0.1.1/.gitignore000066400000000000000000000002401474470052300160230ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki *.img *.iso *.lock *.log *.meta-data *.qcow2 *.run *.user-data image-garden.mk image-garden-0.1.1/.gitlab-ci.yml000066400000000000000000000203031474470052300164710ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki # Use two standard templates from GitLab: # - branch pipelines # - docker # # See: https://gitlab.com/gitlab-org/gitlab/-/tree/master/lib/gitlab/ci/templates include: - template: Workflows/Branch-Pipelines.gitlab-ci.yml - template: Docker.gitlab-ci.yml stages: - compliance - test - build - release reuse: interruptible: true stage: compliance tags: [gitlab-org] image: name: fsfe/reuse:latest entrypoint: [""] script: - reuse lint .deps: image: ubuntu:latest variables: DEBIAN_FRONTEND: noninteractive before_script: - printf '\e[0K%s:%s:%s[collapsed=true]\r\e[0K%s\n' section_start "$(date +%s)" install_deps "Installing dependencies..." - apt update - apt install --no-install-recommends -y ca-certificates genisoimage make ovmf qemu-system-arm qemu-system-x86 qemu-utils tar wget whois xz-utils - printf '\e[0K%s:%s:%s\r\e[0K\n' section_end "$(date +%s)" install_deps - make - make install dry-run: extends: .deps rules: - if: $CI_COMMIT_TAG - if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH changes: - Makefile - image-garden - mk/*.mk interruptible: true stage: test parallel: matrix: - GOAL: - all - fetch script: - image-garden make --dry-run "$GOAL" .test: interruptible: true stage: test extends: .deps needs: - job: dry-run parallel: matrix: - GOAL: - all - fetch variables: TRANSFER_METER_FREQUENCY: "2s" # Don't compress cache heavily since it's all just images. CACHE_COMPRESSION_LEVEL: "fastest" # Keep images in the workspace so that they can be cached. GARDEN_DL_DIR: dl cache: key: dl-$GARDEN_SYSTEM.$ARCH paths: - dl/ when: always test-x86_64: extends: .test rules: - if: $CI_COMMIT_TAG - if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH changes: - Makefile - image-garden - mk/*.mk tags: - linux - x86_64 - kvm variables: ARCH: x86_64 QEMU_SMP_OPTION: -smp 1 QEMU_MEM_OPTION: -m 1024 parallel: matrix: - GARDEN_SYSTEM: - almalinux-cloud-8 - almalinux-cloud-9 - alpine-cloud-3 - archlinux-cloud - centos-cloud-10 - centos-cloud-9 - debian-cloud-10 - debian-cloud-11 - debian-cloud-12 - debian-cloud-13 - fedora-cloud-38 - fedora-cloud-39 - fedora-cloud-40 - fedora-cloud-41 - opensuse-cloud-15.4 - opensuse-cloud-15.5 - opensuse-cloud-15.6 - opensuse-cloud-tumbleweed - oracle-cloud-8 - oracle-cloud-9 - rocky-cloud-8 - rocky-cloud-9 # FIXME: https://gitlab.com/zygoon/image-garden/-/issues/3 # - ubuntu-cloud-14.04 - ubuntu-cloud-16.04 - ubuntu-cloud-18.04 - ubuntu-cloud-20.04 - ubuntu-cloud-22.04 - ubuntu-cloud-24.04 - ubuntu-cloud-24.10 - ubuntu-cloud-25.04 script: - image-garden make "$GARDEN_SYSTEM"."$ARCH".run spread-x86_64: extends: test-x86_64 rules: - if: $CI_COMMIT_TAG - if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH changes: - Makefile - image-garden - mk/*.mk - spread-demo/**/task.yaml - spread-demo/.image-garden.mk - spread-demo/spread.yaml variables: SPREAD_GITLAB_PROJECT_ID: "65375371" # Git revision of spread to install. # This must have been built via spread-dist. # TODO: switch to upstream 1.0 release when available. SPREAD_REV: ec9dc6171fa32ae68a78de0fdce53d6a1548bcfd SPREAD_GOARCH: amd64 needs: - job: dry-run parallel: matrix: - GOAL: - all - fetch script: - mkdir -p dl - cd spread-demo - ln -s ../dl # Prepare the image. - printf '\e[0K%s:%s:%s[collapsed=true]\r\e[0K%s\n' section_start "$(date +%s)" prepare_image "Prepare image" - image-garden make "$GARDEN_SYSTEM.$ARCH.run" - printf '\e[0K%s:%s:%s\r\e[0K\n' section_end "$(date +%s)" prepare_image # Install the selected revision of spread. - printf '\e[0K%s:%s:%s[collapsed=true]\r\e[0K%s\n' section_start "$(date +%s)" install_spread "Installing spread..." - | wget --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --output-document spread \ "${CI_API_V4_URL}/projects/${SPREAD_GITLAB_PROJECT_ID}/packages/generic/spread/${SPREAD_REV}/spread.${SPREAD_GOARCH}" - chmod +x spread - printf '\e[0K%s:%s:%s\r\e[0K\n' section_end "$(date +%s)" install_spread # Run spread - printf '\e[0K%s:%s:%s\r\e[0K%s\n' section_start "$(date +%s)" run_spread "Running spread for $GARDEN_SYSTEM..." - ./spread -v -artifacts artifacts garden:"$GARDEN_SYSTEM" - printf '\e[0K%s:%s:%s\r\e[0K\n' section_end "$(date +%s)" run_spread cache: # Cache the base system. - key: dl-$GARDEN_SYSTEM.$ARCH paths: - dl/ when: always # Cache the customized system. This cache depends on .image-garden.mk file # so that any customization updates are immediately acted upon. - key: prefix: image-garden-custom-${GARDEN_SYSTEM}.${ARCH}- files: - spread-demo/.image-garden.mk policy: $POLICY when: always paths: - $GARDEN_SYSTEM.* artifacts: when: on_success access: all expire_in: "30 days" paths: - spread-demo/artifacts/ dist-tarball: stage: release image: ubuntu:latest rules: - if: $CI_COMMIT_TAG - if: $CI_COMMIT_BRANCH when: never variables: DEBIAN_FRONTEND: noninteractive before_script: - printf '\e[0K%s:%s:%s[collapsed=true]\r\e[0K%s\n' section_start "$(date +%s)" install_deps "Installing dependencies..." - apt update - apt install --no-install-recommends -y make - printf '\e[0K%s:%s:%s\r\e[0K\n' section_end "$(date +%s)" install_deps script: - make dist - | printf '$(info VERSION=$(VERSION))\n.PHONY: none\nnone:\n' | make -f Makefile -f - none -q >>dist-tarball.env - echo "DIST_TARBALL_CI_JOB_ID=$CI_JOB_ID" >>dist-tarball.env artifacts: paths: - image-garden-*.tar.gz reports: dotenv: dist-tarball.env release: stage: release image: registry.gitlab.com/gitlab-org/release-cli:latest rules: - if: $CI_COMMIT_TAG - if: $CI_COMMIT_BRANCH when: never needs: - job: dist-tarball artifacts: true script: - echo 'Creating the release for version ${VERSION}' release: name: "Image Garden ${VERSION}" tag_name: "$CI_COMMIT_TAG" description: "$CI_COMMIT_TAG" assets: links: - name: "image-garden (source tarball)" url: "https://gitlab.com/zygoon/image-garden/-/jobs/${DIST_TARBALL_CI_JOB_ID}/artifacts/file/image-garden-${VERSION}.tar.gz" docker-build: rules: - if: $CI_COMMIT_TAG - if: $CI_COMMIT_BRANCH when: never image-garden-0.1.1/Dockerfile000066400000000000000000000013711474470052300160330ustar00rootroot00000000000000# syntax=docker/dockerfile:1 # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki # Use ubuntu:rolling to get latest qemu. It does matter a lot in practice. FROM ubuntu:rolling ARG DEBIAN_FRONTEND=noninteractive RUN apt update \ && apt install --no-install-recommends -y \ ca-certificates \ curl \ genisoimage \ git \ make \ ovmf \ qemu-efi-aarch64 \ qemu-system-arm \ qemu-system-x86 \ qemu-utils \ wget \ whois \ xz-utils \ && apt clean WORKDIR /src ADD . /src/image-garden WORKDIR /src/image-garden RUN make --warn-undefined-variables && make install --warn-undefined-variables ENV GARDEN_DL_DIR=/src/image-garden/dl image-garden-0.1.1/LICENSE000066400000000000000000000240501474470052300150450ustar00rootroot00000000000000Apache 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. image-garden-0.1.1/LICENSES/000077500000000000000000000000001474470052300152445ustar00rootroot00000000000000image-garden-0.1.1/LICENSES/Apache-2.0.txt000066400000000000000000000240501474470052300174640ustar00rootroot00000000000000Apache 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. image-garden-0.1.1/Makefile000066400000000000000000000034341474470052300155030ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki VERSION = 0.1.1 DESTDIR ?= prefix ?= /usr/local exec_prefix ?= $(prefix) bindir ?= $(exec_prefix)/bin datarootdir ?= $(prefix)/share datadir ?= $(datarootdir) includedir ?= $(prefix)/include mandir ?= $(datarootdir)/man man1dir ?= $(mandir)/man1 .PHONY: all all:: image-garden.mk .PHONY: clean clean:: rm -f image-garden.mk .PHONY: install install:: README.md image-garden image-garden.mk image-garden.1 $(if $(DESTDIR),| $(DESTDIR)) install -m 755 -d $(DESTDIR)$(bindir) install -m 755 -t $(DESTDIR)$(bindir) image-garden sed -i -e 's,INCLUDEDIR=\.,INCLUDEDIR=$(includedir),' -e 's,@VERSION@,$(VERSION),' $(DESTDIR)$(bindir)/image-garden install -m 755 -d $(DESTDIR)$(includedir) install -m 644 -t $(DESTDIR)$(includedir) image-garden.mk install -m 755 -d $(DESTDIR)$(datarootdir) install -m 755 -d $(DESTDIR)$(datarootdir)/doc install -m 755 -d $(DESTDIR)$(datarootdir)/doc/image-garden install -m 644 -t $(DESTDIR)$(datarootdir)/doc/image-garden README.md NEWS NEWS.license install -m 755 -d $(DESTDIR)$(man1dir) install -m 644 -t $(DESTDIR)$(man1dir) image-garden.1 image-garden.mk: $(wildcard mk/*.mk) cat $(sort $^)>$@ ifneq (,$(DESTDIR)) $(DESTDIR): mkdir -p $(DESTDIR) endif .PHONY: check check: SHELLCHECK ?= $(or $(shell command -v shellcheck),$(error program shellcheck is required)) check: image-garden $(SHELLCHECK) $^ .PHONY: fmt fmt: SHFMT ?= $(or $(shell command -v shfmt),$(error program shfmt is required)) fmt: image-garden $(SHFMT) -w $^ dist: image-garden-$(VERSION).tar.gz image-garden-$(VERSION).tar.gz: Makefile image-garden image-garden.1 LICENSE LICENSES/Apache-2.0.txt REUSE.toml NEWS NEWS.license README.md $(wildcard mk/*.mk) tar --transform=s,^,image-garden-$(VERSION)/, -zcf $@ $^ image-garden-0.1.1/NEWS000066400000000000000000000012601474470052300145350ustar00rootroot00000000000000Changes in 0.1.1: * Presence of `.image-garden.mk` file is now correctly reflected in dependencies of the `*.user-data` files, so that editing the local makefile automatically causes all the disk images to become outdated. * Using `image-garden make -B` should no longer re-download everything, as `wget` is now called with `--no-clobber` and is smart enough to notice that re-downloading complete images is not required. * Image garden now comes with a manual page. See `man image-garden` to learn about all the documented features. * Oracle Cloud release 8 is now supported. * SSH service is configured with "UsePAM yes" by default. Changes in 0.1: * Initial release. image-garden-0.1.1/NEWS.license000066400000000000000000000001151474470052300161540ustar00rootroot00000000000000SPDX-License-Identifier: Apache-2.0 SPDX-FileCopyrightText: Zygmunt Krynicki image-garden-0.1.1/README.md000066400000000000000000000075051474470052300153250ustar00rootroot00000000000000 # Image Garden Image garden is a project that aims to provide the following properties together: ## Obtain test images for operating systems We want to make getting commonly used images easy and accessible. If you can name it it should be simple to get and run locally on your system. At present we focus mostly on Linux distributions and their cloud images, but we want to expose access to installable images, server and desktop alike. The images we prepare are intended for use in full-system tests. They are not general-purpose images destined for production workflows. They compromise on security for ease of use and convenience in testing. ## Use commonly available tools We want to provide access to all the systems from all the systems, without requiring distribution-specific tooling to be pre-installed. In practice we don't want to build images, we want to fetch and run them. Each OS has complex tooling for building their images that makes this problem more confusing. ## Use simple, insecure access methods Our images are pre-configured with network, ssh access with simple password (the distribution name), interactive login on the serial port and anything else that may be handy for testing. ## Simplicity You can run `image-garden make -n all` to see the exact commands that are needed to create and prepare all the images. Each machine image comes with a script that runs the exact `qemu` incantation required to boot it correctly. You can use this to learn and copy relevant parts to your own project. # Usage and examples All the images can be built with `make`. You will need the following additional programs: `wget`, `qemu-system-x86_64`, `qemu-system-aarch64`, `qemu-img`, `genisoimage`, and `mkpasswd` (usually in the `whois` package). You should be able to install them on your system of choice, even if that's MacOS. Note that all the targets need to be run as `image-garden make TARGET`. ## fetch Downloads all the images to the cache structure under `$XDG_CACHE_HOME/image-garden/dl`. ## all Builds all the virtual machine images for the same CPU architecture as the host. Building for cross-CPU architecture may work but is slow and not recommended. ## clean Removes all of the images, intermediate images, log files and other support files without removing the original source images downloaded from the Internet. ## distclean Like clean, but also removes images downloaded from the Internet. Unless you need space you should not need to run this target. # Local cloud-init templates If the directory where `image-garden` is invoked contains the file `.image-garden.mk` then that file is loaded by `make` and used as additional set of build rules. While somewhat technical this is sufficient to define arbitrary new build goals, operating systems or initialization logic. At present it is strongly recommended to constrain oneself to `cloud-init` user-data templates though. Using this technique well can drastically speed up test iteration, as the cached image can contain arbitrary customizations that are local to the project. There are two forms available, one that is specific to a given operating system and release, and one that is shared across a family of systems. Both are shown below: ```make # This defines the cloud-init profile for Debian 13 (Trixie). # The definition extends the standard profile provided by image-garden. define DEBIAN_13_CLOUD_INIT_USER_DATA_TEMPLATE $(CLOUD_INIT_USER_DATA_TEMPLATE) packages: - build-essential - docker - virtualbox - snapd endef # This defines the cloud-init profile for all versions of Ubuntu. # The definition extends the standard profile provided by image-garden. define UBUNTU_CLOUD_INIT_USER_DATA_TEMPLATE $(CLOUD_INIT_USER_DATA_TEMPLATE) packages: - build-essential - docker - virtualbox - snapd endef ``` image-garden-0.1.1/REUSE.toml000066400000000000000000000004221474470052300156150ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki version = 1 SPDX-PackageName = "Image Garden" SPDX-PackageSupplier = "Zygmunt Krynicki " SPDX-PackageDownloadLocation = "https://gitlab.com/zygoon/image-garden" annotations = [] image-garden-0.1.1/image-garden000077500000000000000000000117201474470052300163060ustar00rootroot00000000000000#!/bin/sh # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki set -eu case "${1:-}" in '' | -h | -? | --help) echo "Usage: image-garden make GOAL" echo "" echo " image-garden allocate IMAGE" echo " image-garden discard ADDRESS" echo "" echo "Typically GOAL is 'SYSTEM.qcow2' or 'SYSTEM.run'." echo "Use 'image-garden make list-systems' to see all defined systems." ;; version) echo "image-garden @VERSION@" ;; make) shift # This variable is updated when the package is installed so it always points # to the actual installation prefix of image-garden. INCLUDEDIR=. # Use special, local makefile or /dev/null as input to avoid including any # GNUMakefile, Makefile or makefile if one is present. for mk in .image-garden.mk /dev/null; do if [ -r "$mk" ]; then MAKEFILES="$INCLUDEDIR"/image-garden.mk exec make --warn-undefined-variables -f "$mk" "$@" fi done ;; allocate) shift while [ $# -gt 0 ]; do case "$1" in --premade) premade=1 shift ;; --nice) nice="nice" shift ;; -*) echo "image-garden: unknown option: $1" >&2 shift ;; *) break ;; esac done SPREAD_SYSTEM="$1" SPREAD_SYSTEM_PROPER="$(echo "$SPREAD_SYSTEM" | sed -e 's/x86-64/x86_64/g')" shift if [ "${premade:=0}" -eq 0 ]; then echo "Making $SPREAD_SYSTEM_PROPER..." >&2 # Lock on a per-system lock file since parallel-invocations of make should # not attempt to download the same file over and over again. flock "$SPREAD_SYSTEM_PROPER".lock "$0" make "$SPREAD_SYSTEM_PROPER".run "$SPREAD_SYSTEM_PROPER".qcow2 >&2 fi # Lock on spread.yaml as we need to prevent port numbers from clashing. # This artificially limits virtual machine construction but it is better # than having qemu racing to allocate the same port. exec 4<>spread.yaml echo "Looking available TCP port for $SPREAD_SYSTEM_PROPER..." >&2 while ! flock --exclusive -n 4; do sleep 1 done # Find an unused port to give to qemu as the local version of port 22 in the # virtual machine. This is not really very good but it's better than nothing. mkdir -p "${XDG_RUNTIME_DIR:=/run}/image-garden/" PORT= for MAYBE_PORT in $(seq 5000 5999); do if [ ! -e "${XDG_RUNTIME_DIR}/image-garden/port.$MAYBE_PORT.pid" ]; then PORT=$MAYBE_PORT # NOTE: we are not touching the pid file anymore. # QEMU's -pidfile option does this, utilizing flock internally. break fi done if [ -z "$PORT" ]; then echo "Cannot find available port for qemu forwarding" >&2 exit 1 fi # Disable display unless the user wants to have something custom. export QEMU_DISPLAY_OPTION="${QEMU_DISPLAY_OPTION:=-display none}" # Forward tcp port $PORT to port 22 in the virtual machine so that spread can connect. export QEMU_NETDEV_USER_EXTRA=",hostfwd=tcp:127.0.0.1:$PORT-:22" # Run qemu redirecting serial port to a file, disabling parallel port, # disabling QEMU monitor and daemonizing with a pidfile. parent=$$ # this shell parent_parent="$(cut -f 4 -d ' ' &2 if ${nice:-} ./"$SPREAD_SYSTEM_PROPER".run \ -snapshot \ -parallel none \ -monitor none \ -serial file:"$SPREAD_SYSTEM_PROPER"."$PORT".serial.log \ -pidfile "${XDG_RUNTIME_DIR:=/run}"/image-garden/port."$PORT".pid \ -daemonize \ "$@" \ >"$SPREAD_SYSTEM_PROPER"."$PORT".stdout.log 2>"$SPREAD_SYSTEM_PROPER"."$PORT".stderr.log \ 4<&-; then # Print the address where spread can connect. If spread is the parent # process of the bash process then implement ADDRESS directly. # Otherwise fall back to legacy mode where we just print the value. # Parent of parent - bash invoked by spread (unconditionally) # Parent of parent of parent - possibly spread if [ "$parent_parent_parent_comm" = spread ]; then echo "
" else echo "localhost:$PORT" fi exit else rm -f "${XDG_RUNTIME_DIR:=/run}"/image-garden/port."$PORT".pid # Parent of parent - bash invoked by spread (unconditionally) # Parent of parent of parent - possibly spread if [ "$parent_parent_parent_comm" = spread ]; then echo "" exit 213 else echo "Allocation failed, see $SPREAD_SYSTEM_PROPER.$PORT.stderr.log" >&2 exit 1 fi fi ;; discard) shift SPREAD_SYSTEM_ADDRESS="$1" shift case "$SPREAD_SYSTEM_ADDRESS" in localhost:*) PORT="$(echo "$SPREAD_SYSTEM_ADDRESS" | sed -e 's/localhost://')" if [ -f "${XDG_RUNTIME_DIR:=/run}/image-garden/port.$PORT.pid" ]; then PID="$(cat "$XDG_RUNTIME_DIR/image-garden/port.$PORT.pid")" if [ -n "$PID" ]; then kill "$PID" || true fi rm -f "$XDG_RUNTIME_DIR/image-garden/port.$PORT.pid" fi ;; *) exit 1 ;; esac ;; *) exit 1 ;; esac image-garden-0.1.1/image-garden.1000066400000000000000000000267551474470052300164600ustar00rootroot00000000000000.\" SPDX-FileCopyrightText: 2024 Zygmunt Krynicki .\" SPDX-License-Identifier: Apache-2.0 .Dd Jan 23, 2025 .Os image-garden 0.1.1 .Dt image-garden 1 PRM .Sh NAME .Nm image-garden .Nd construct and operate test virtual machines .Sh SYNOPSIS .Nm image-garden .Cm make .Op Fl n .Op Ar GOAL .Nm image-garden Cm allocate .Op Fl -premade .Op Fl -nice .Ar SYSTEM.ARCH .Nm image-garden Cm discard Ar ADDRESS .Nm image-garden Cm version .Sh DESCRIPTION .Nm image-garden downloads, initializes and optionally operates virtual machine images for popular operating systems. All the systems are designed for .Em testing and come configured with .Em well-known username and password , usually matching the name of the system. .Pp Options recognized by .Nm image-garden make .Bl -tag -width Ds .It Fl n Display commands instead of executing them. This option is useful for learning how to make individual disk images. .El .Pp Options recognized by .Nm image-garden allocate .Bl -tag -width Ds .It Fl -premade Assume presence of pre-made disk images and do not re-generate them even if they are out-of-date. This option is useful for ensuring that CI/CD jobs do not re-build disk images even if timestamps would suggest they should. .It Fl -nice Wrap execution of virtual machines with .Nm nice , so that it does not compete for CPU with other applications. .El .Ss Make Goals The .Nm image-garden make sub-command allows building one or more .Em goals corresponding to virtual machine images and their support files. .Pp The following goals are documented. Note that .Em ARCH and .Em SYSTEM are placeholders for CPU architecture as named by the Linux kernel and standardized distribution name, respectively. Please see the table for a complete list of valid SYSTEM-ARCH combinations. .Bl -tag -width $SYSTEM.$ARCH.qcow2.log .It help Display help message specific to the set of make rules contained within .Nm .It all Build all of the images for the native CPU architecture. .It fetch Fetch all the base cloud images or installers, so that further work can be done .Em mostly offline. The only exception is installation if packages described by per-project .Em cloud-init profiles. .It clean Remove all the generated disk images from the current directory. .It distclean Remove all the base cloud images and installer images from the per-user cache directory. .It Pa $SYSTEM.$ARCH.qcow2 .Em qemu disk image of operating system .Em $SYSTEM for CPU architecture .Em $ARCH . Cloud disks contain internal reference to base image stored in per-user cache directory. Both files are required at runtime. .It Pa $SYSTEM.$ARCH.qcow2.log Serial console output collected during first boot of the machine. .It Pa $SYSTEM.$ARCH.run Shell script for running the virtual machine. This script supports extensive customization through environment variables and command line arguments. Command line arguments are passed directly to .Nm qemu-system-$ARCH . Recognized environment variables are described in a dedicated section below. .It Pa $SYSTEM.$ARCH.efi-code.img Symbolic link to efi-code.$ARCH.img. .It Pa $SYSTEM.$ARCH.efi-vars.img Disk image with current state of the boot firmware corresponding to .Pa $SYSTEM.$ARCH.qcow2 . .It Pa $SYSTEM.seed.iso ISO 9660 disk image with cloud-init files used during first boot. .It Pa $SYSTEM.user-data Text of the cloud-init user data. This file exists briefly as a prerequisite for .Pa $SYSTEM.seed.iso . .It Pa $SYSTEM.meta-data Text of the cloud-init meta data. This file exists briefly as a prerequisite for .Pa $SYSTEM.seed.iso . .It Pa efi-code.aarch64.img Disk image of EFI firmware for .Em aarch64 CPU architecture. .It Pa efi-vars.aarch64.img Disk image of with the unmodified state of EFI firmware for the .Em aarch64 CPU architecture. .It Pa efi-code.x86_64.img Disk image of EFI firmware for the .Em x86_64 CPU architecture. .It Pa efi-vars.x86_64.img Disk image of with the unmodified state of EFI firmware for the .Em x86_64 CPU architecture. .El .Ss System Names Systems are identifiers for a particular operating system, variant, release and CPU architecture. The following list contains all the systems recognized by .Nm . .Bl -tag -width Ds .It almalinux-cloud-{8,9} Alma Linux cloud images. .It alpine-cloud-3 Alpine Linux cloud image. .It archlinux-cloud Arch Linux cloud image. This system is only supported on the .Em x86_64 CPU architecture. .It centos-cloud-{9,10} CentOS cloud images (usually CentOS stream). .It debian-cloud-{10,11,12,13} Debian cloud images. .It fedora-cloud-{38,39,40,41} Fedora cloud images. .It opensuse-cloud-{15.4,15.5,15.16,tumbleweed} openSUSE cloud images. .It oracle-cloud-{8,9} Oracle Linux cloud images. .It rocky-cloud-{8,9} Rocky Linux cloud images. .It ubuntu-cloud-14.04 This system fails to boot correctly. .It ubuntu-cloud-{16,18,20,22,24}.04 Ubuntu Long Term Support (LTS) cloud images. .It ubuntu-cloud-{24.10,25.04} Ubuntu development releases cloud images. .El .Sh FILES .Bl -tag -width $HOME/.cache/image-garden/dl .It Pa .image-garden.mk Makefile implicitly included by .Nm image-garden make . This file is designed for defining .Em cloud-init user-data templates with project-specific build and test dependencies. .It Pa $HOME/.cache/image-garden/dl Directory with downloaded, unmodified virtual machine images. The files are organized into sub-directories specific to each distribution. Inside symbolic links provide an unified naming scheme regardless of the naming scheme used by a particular distributor. .El .Sh ENVIRONMENT Environment variables are split into sections to indicate which of the sub-commands uses them. .Ss Environment for image-garden make .Bl -tag -width QEMU_SYSTEM_AARCH64 .It Ev XDG_CACHE_HOME Directory with per-user cache files that may be safely deleted. According to the specification the default value is .Qq Pa $HOME/.cache . .It Ev GARDEN_CACHE_DIR Directory with non-essential files that can be reused across projects. The default value is .Qq Pa $XDG_CACHE_HOME/image-garden . .It Ev GARDEN_DL_DIR Directory where downloaded operating system images are stored. Those images may be sizable so care needs to be taken to avoid using excessive amount of disk space. All the images stored here are used in read-only mode and are automatically shared by different project developed by the same user. The default value is .Qq Pa $GARDEN_CACHE_DIR/dl . .It Ev QEMU_MEM_SIZE Amount of memory, in megabytes, to provide to each virtual machine. This value is copied into the generated .Em $SYSTEM.run scripts. The default value is .Qq 2048 , for 2GB of runtime memory. Not to be confused with similarly-named .Ev QEMU_MEM_OPTION . .It Ev QEMU_IMG_SIZE Size of the virtual disk image created by .Xr qemu-img 1 when invoked from .Nm . The default value is .Qq 64G . Note that images use a format with internal representation of sparse areas. The required disk space is much smaller than this size. .It Ev QEMU_SMP_X86_64 The number of virtual CPU cores for virtual machines emulating the .Em x86_64 CPU architecture. The default value is .Qq 4 when the CPU architecture of the host and the guest are the same or .Qq 1 otherwise. Not to be confused with similarly-named .Ev QEMU_SMP_OPTION . .It Ev QEMU_SMP_AARCH64 The number of virtual CPU cores for virtual machines emulating the .Em aarch64 CPU architecture. The default value is .Qq 4 when the CPU architecture of the host and the guest are the same or .Qq 1 otherwise. Not to be confused with similarly-named .Ev QEMU_SMP_OPTION . .It Ev QEMU_SYSTEM_X86_64 Full path of the .Nm qemu-system-x86_64 program to use instead of the one found on PATH. .It Ev QEMU_SYSTEM_AARCH64 Full path of the .Nm qemu-system-aarch64 program to use instead of the one found on PATH. .It Ev QEMU_IMG Full path of the .Nm qemu-img program to use instead of the one found on PATH. .It Ev MKPASSWD Full path of the .Nm mkpasswd program to use instead of the one found on PATH. .It Ev GENISOIMAGE Full path of the .Nm genisoimage program to use instead of the one found on PATH. .It Ev WGET Full path of the .Nm wget program to use instead of the one found on PATH. .El .Ss Environment for image-garden allocate .Bl -tag -width XDG_RUNTIME_DIR .It Ev XDG_RUNTIME_DIR Directory with per-user runtime files that do not persist across reboots. According to the specification the default value is .Qq Pa /run/user/$UID . The .Nm program, when used as a back-end for the .Xr spread 1 test system uses this directory to keep track of running virtual machines and their TCP port numbers. .El .Ss Environment for .run scripts. .Pp The following environment variables are used by generated .run scripts. .Bl -tag -width QEMU_BOOT_FIRMWARE_OPTION .It Ev QEMU_MEM_OPTION Memory configuration options to pass to qemu. Example value is .Qq -m 1024 . .Pp .It Ev QEMU_SMP_OPTION CPU topology options to pass to qemu. When unset the default value is .Qq -smp $QEMU_SMP_$(uname -m) . Example value is .Qq -smp $(nproc) . .It Ev QEMU_DISPLAY_OPTION Graphical display options to pass to qemu. When unset the default value is .Qq -nographic . Example value is .Qq -display gtk . .It Ev QEMU_BOOT_FIRMWARE_OPTION Boot firmware options to pass to qemu. The default value depends on the requirement of the booted system. For systems booting with EFI a pair of .Qq -drive pflash arguments is used for representing EFI code and EFI variables. For systems booting with legacy BIOS no options are provided. .It Ev QEMU_RNG_OPTION Random-number configuration options to pass to qemu. When unset the default value is .Qq -device virtio-rng-pci .It Ev QEMU_NET_OPTION Network configuration options to pass to qemu. When unset the default value is .Qq -netdev user,id=netdev0${QEMU_NETDEV_USER_EXTRA:-} -device virtio-net-pci,netdev=netdev0,id=net0 -smbios type=41,designation=Virtual-LAN,instance=1,kind=ethernet,pcidev=net0 .El .Sh EXAMPLES To create a bootable image of cloud variant of Debian 13 (trixie) for x86_64 architecture run: .Bd -literal image-garden make debian-cloud-13.x86_64.run .Ed .Pp To use .Nm image-garden together with .Xr spread 1 put the following snippet into your .Pa spread.yaml file. Note that using .Em exec allows image-garden to automatically perform the equivalent of calling spread shell functions .Em ADDRESS , .Em FATAL or .Em ERROR . .Bd -literal backends: garden: type: adhoc allocate: exec image-garden allocate "$SPREAD_SYSTEM"."$(uname -m)" discard: exec image-garden discard "$SPREAD_SYSTEM_ADDRESS" systems: - debian-cloud-13: username: debian password: debian .Ed .Pp To customize the virtual machine to a particular project create a .Pa .image-garden.mk file in the root of the project and define one or more .Em cloud-init user-data templates which contain list of packages to install or commands to run. Make sure to include the default template that is essential for .Nm image-garden operation. You can assume that the default template ends with a section that runs one or more commands and append your commands as a YAML list. Other cloud-init features must be used explicitly. .Bd -literal # Cloud-init template for Debian 13 (Trixie). define DEBIAN_13_CLOUD_INIT_USER_DATA_TEMPLATE $(CLOUD_INIT_USER_DATA_TEMPLATE) packages: - build-essential - libfoo-dev endef # Cloud-init user-data template for all versions of Ubuntu. define UBUNTU_CLOUD_INIT_USER_DATA_TEMPLATE $(CLOUD_INIT_USER_DATA_TEMPLATE) packages: - build-essential - libfoo-dev endef .Ed .Sh SEE ALSO .Xr qemu 1 .Sh HISTORY Image garden was developed in stages throughout late 2023, with first commits appearing in early 2024. .Sh BUGS Known bugs can be listed by looking at .Lk https://gitlab.com/zygoon/image-garden/-/issues "GitLab issues" . .Sh AUTHORS .An "Zygmunt Krynicki" Aq Mt me@zygoon.pl image-garden-0.1.1/mk/000077500000000000000000000000001474470052300144465ustar00rootroot00000000000000image-garden-0.1.1/mk/000-garden.mk000066400000000000000000000032321474470052300165340ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki XDG_CACHE_HOME ?= $(HOME)/.cache GARDEN_CACHE_DIR ?= $(XDG_CACHE_HOME)/image-garden GARDEN_DL_DIR ?= $(GARDEN_CACHE_DIR)/dl GARDEN_SHARE_DIR = $(or $(wildcard $(abspath $(dir $(filter %/image-garden.mk,$(MAKEFILE_LIST)))/../share/image-garden/)),.)/ GARDEN_ARCH ?= $(shell uname -m) GARDEN_ARCH := $(GARDEN_ARCH) MKPASSWD ?= $(or $(shell command -v mkpasswd),$(error program mkpasswd is required)) GENISOIMAGE ?= $(or $(shell command -v genisoimage),$(error program genisoimage is required)) WGET ?= $(or $(shell command -v wget),$(error wget is required))$(if $(value CI), --quiet) comma=, nothing= space:=$(nothing) $(nothing) map_to_debian_arch=$(or $(value debian_arch_$1),$1) debian_arch_x86_64=amd64 debian_arch_aarch64=arm64 .DEFAULT_GOAL := help .PHONY: all .PHONY: fetch .PHONY: clean clean:: rm -f *.log .PHONY: distclean:: clean $(GARDEN_DL_DIR): mkdir -p $@ $(GARDEN_DL_DIR)/%: | $(GARDEN_DL_DIR) mkdir -p $@ %: %.xz unxz --keep $< GARDEN_SYSTEMS ?= .PHONY: help help: RANDOM_SYSTEM=$(word $(shell sh -c 'expr $$RANDOM % $(words $(GARDEN_SYSTEMS))'),$(GARDEN_SYSTEMS)) help: @echo "Usage: image-garden make .{run,qcow2}" @echo "" @echo "Each SYSTEM has a disk image (.qcow2) and a boot script (.run)." @echo "Run 'image-garden make list-systems' for a complete list of systems." @echo "" @echo "To create a disk image and boot script for an example system use:" @echo "" @echo " image-garden make $(RANDOM_SYSTEM).run" @echo "" @echo "Note that this image was selected at random." .PHONY: list-systems list-systems: @$(foreach i,$(GARDEN_SYSTEMS),echo $i;) image-garden-0.1.1/mk/010-qemu.mk000066400000000000000000000153351474470052300162530ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki QEMU_IMG ?= $(or $(shell command -v qemu-img),$(error program qemu-img is required)) QEMU_SYSTEM_X86_64 ?= $(or $(shell command -v qemu-system-x86_64),$(error program qemu-system-x86_64 is required)) QEMU_SYSTEM_AARCH64 ?= $(or $(shell command -v qemu-system-aarch64),$(error program qemu-system-aarch64 is required)) QEMU_SYSTEM_VERSION = $(subst ., ,$(word 4,$(shell $(or $(shell command -v $(QEMU_SYSTEM_X86_64),$(shell command -v QEMU_SYSTEM_AARCH64)) --version))) # Version of qemu as a triplet major, minor, micro. QEMU_SYSTEM_VERSION = $(subst ., ,$(word 4,$(shell $(QEMU_SYSTEM_X86_64) --version))) QEMU_SYSTEM_MAJOR_VERSION = $(firstword $(QEMU_SYSTEM_VERSION)) QEMU_SYSTEM_X86_64_MACHINE = $(or $(QEMU_SYSTEM_X86_64_MACHINE_FOR_VERSION_$(QEMU_SYSTEM_MAJOR_VERSION)),$(error please define QEMU_SYSTEM_X86_64_MACHINE_FOR_VERSION_$(QEMU_SYSTEM_MAJOR_VERSION))) QEMU_SYSTEM_X86_64_MACHINE_FOR_VERSION_6 = q35 QEMU_SYSTEM_X86_64_MACHINE_FOR_VERSION_8 = q35 QEMU_SYSTEM_X86_64_MACHINE_FOR_VERSION_9 = q35 QEMU_SYSTEM_AARCH64_MACHINE = $(or $(QEMU_SYSTEM_AARCH64_MACHINE_FOR_VERSION_$(QEMU_SYSTEM_MAJOR_VERSION)),$(error please define QEMU_SYSTEM_AARCH64_MACHINE_FOR_VERSION_$(QEMU_SYSTEM_MAJOR_VERSION))) QEMU_SYSTEM_AARCH64_MACHINE_FOR_VERSION_6 = virt QEMU_SYSTEM_AARCH64_MACHINE_FOR_VERSION_8 = virt QEMU_SYSTEM_AARCH64_MACHINE_FOR_VERSION_9 = virt QEMU_SMP_X86_64 = 1 QEMU_SMP_AARCH64 = 1 QEMU_SMP_$(shell uname -m | tr a-z- A-Z_) = 4 QEMU_IMG_SIZE = 64G QEMU_MEM_SIZE = 2048 # Full command line for running QEMU with a given EFI firmware. QEMU_SYSTEM_X86_64_EFI_CMDLINE = \ $(QEMU_SYSTEM_X86_64) \ -cpu max \ -machine $(QEMU_SYSTEM_X86_64_MACHINE)$${QEMU_ACCEL_MACHINE_PROP=,accel=`$(QEMU_SYSTEM_X86_64) -accel help | tail -n +2 | sort | paste -sd :`} \ $${QEMU_MEM_OPTION=-m $(QEMU_MEM_SIZE)} \ $${QEMU_SMP_OPTION=-smp $(QEMU_SMP_X86_64)} \ $${QEMU_DISPLAY_OPTION=-nographic} \ $${QEMU_BOOT_FIRMWARE_OPTION=-drive if=pflash,format=raw,unit=0,file=$(2),readonly=on \ -drive if=pflash,format=raw,unit=1,file=$(3)} \ $${QEMU_STORAGE_OPTION=-drive file=$(1),if=none,format=qcow2,id=drive0,media=disk,cache=writeback \ -device virtio-blk,drive=drive0,bootindex=0} \ $${QEMU_RNG_OPTION=-device virtio-rng-pci} \ $${QEMU_NET_OPTION=-netdev user,id=netdev0$${QEMU_NETDEV_USER_EXTRA:-} \ -device virtio-net-pci,netdev=netdev0,id=net0 \ -smbios type=41,designation=Virtual-LAN,instance=1,kind=ethernet,pcidev=net0} # Full command line for running QEMU with legacy BIOS. QEMU_SYSTEM_X86_64_BIOS_CMDLINE = \ $(QEMU_SYSTEM_X86_64) \ -cpu max \ -machine $(QEMU_SYSTEM_X86_64_MACHINE)$${QEMU_ACCEL_MACHINE_PROP=,accel=`$(QEMU_SYSTEM_X86_64) -accel help | tail -n +2 | sort | paste -sd :`} \ $${QEMU_MEM_OPTION=-m $(QEMU_MEM_SIZE)} \ $${QEMU_SMP_OPTION=-smp $(QEMU_SMP_X86_64)} \ $${QEMU_DISPLAY_OPTION=-nographic} \ $${QEMU_STORAGE_OPTION=-drive file=$(1),if=none,format=qcow2,id=drive0,media=disk,cache=writeback \ -device virtio-blk,drive=drive0,bootindex=0} \ $${QEMU_RNG_OPTION=-device virtio-rng-pci} \ $${QEMU_NET_OPTION=-netdev user,id=netdev0$${QEMU_NETDEV_USER_EXTRA:-} \ -device virtio-net-pci,netdev=netdev0,id=net0 \ -smbios type=41,designation=Virtual-LAN,instance=1,kind=ethernet,pcidev=net0} QEMU_SYSTEM_AARCH64_EFI_CMDLINE = \ $(QEMU_SYSTEM_AARCH64) \ -cpu max \ -machine $(QEMU_SYSTEM_AARCH64_MACHINE)$${QEMU_ACCEL_MACHINE_PROP=,accel=`$(QEMU_SYSTEM_AARCH64) -accel help | tail -n +2 | sort | paste -sd :`} \ $${QEMU_MEM_OPTION=-m $(QEMU_MEM_SIZE)} \ $${QEMU_SMP_OPTION=-smp $(QEMU_SMP_AARCH64)} \ $${QEMU_DISPLAY_OPTION=-nographic} \ $${QEMU_BOOT_FIRMWARE_OPTION=-drive if=pflash,format=raw,unit=0,file=$(2),readonly=on \ -drive if=pflash,format=raw,unit=1,file=$(3)} \ $${QEMU_STORAGE_OPTION=-drive file=$(1),if=none,format=qcow2,id=drive0,media=disk,cache=writeback \ -device virtio-blk,drive=drive0,bootindex=0} \ $${QEMU_RNG_OPTION=-device virtio-rng-pci} \ $${QEMU_NET_OPTION=-netdev user,id=netdev0$${QEMU_NETDEV_USER_EXTRA:-} \ -device virtio-net-pci,netdev=netdev0,id=net0} efi-code.x86_64.img: $(or $(firstword $(wildcard /usr/share/OVMF/OVMF_CODE.fd /usr/share/OVMF/OVMF_CODE_4M.fd)),$(error please install ovmf firmware)) dd if=$< of=$@ conv=notrunc efi-vars.x86_64.img: $(or $(firstword $(wildcard /usr/share/OVMF/OVMF_VARS.fd /usr/share/OVMF/OVMF_VARS_4M.fd)),$(error please install ovmf firmware)) dd if=$< of=$@ conv=notrunc efi-code.aarch64.img: /usr/share/AAVMF/AAVMF_CODE.fd dd if=$< of=$@ conv=notrunc efi-vars.aarch64.img: /usr/share/AAVMF/AAVMF_VARS.fd dd if=$< of=$@ conv=notrunc # UEFI firmware code and state. %.aarch64.efi-code.img: | efi-code.aarch64.img ln -sf $(firstword $|) $@ %.aarch64.efi-vars.img: efi-vars.aarch64.img cp $< $@ %.x86_64.efi-code.img: | efi-code.x86_64.img ln -sf $(firstword $|) $@ %.x86_64.efi-vars.img: efi-vars.x86_64.img cp $< $@ define CLOUD_INIT_META_DATA_TEMPLATE #cloud-config instance-iid: iid-$1 local-hostname: $(subst .,-,$1) endef define CLOUD_INIT_USER_DATA_TEMPLATE #cloud-config timezone: Europe/Warsaw power_state: delay: now mode: poweroff message: Powering off timeout: 0 condition: true hostname: $(subst .,-,$1) ssh_pwauth: true users: - name: $2 groups: users gecos: $2 User # Both the username and the password is "$2" hashed_passwd: '$(shell echo -n $2 | $(MKPASSWD) --method=SHA-512 --rounds=4096 -s)' sudo: ["ALL=(ALL) NOPASSWD:ALL"] lock_passwd: false shell: /bin/bash runcmd: # This fixes ssh authentication on openSUSE Tumbleweed. - echo 'UsePAM yes' >> /etc/ssh/sshd_config - touch /etc/cloud/cloud-init.disabled endef # Seed ISOs with cloud-init files. # The switch -graft-points allows us to have different (fixed) name in the ISO # and different (variable) names in the local file system. See the manual page # of genisoimage for details. %.seed.iso: %.user-data %.meta-data $(GENISOIMAGE) \ -input-charset utf-8 \ -output $@ \ -volid CIDATA \ -joliet \ -rock \ -graft-points \ user-data=$(word 1,$^) \ meta-data=$(word 2,$^) # Pick one of the three templates, in order of priority: # - $(DISTRO)_$(VERSION)_CLOUD_INIT_USER_DATA_TEMPLATE # - $(DISTRO)_CLOUD_INIT_USER_DATA_TEMPLATE # - CLOUD_INIT_USER_DATA_TEMPLATE # This evaluates the name of the template. Use $(call $(call ...)...) to # evaluate the resulting template. PICK_CLOUD_INIT_USER_DATA_TEMPLATE_FOR = $(or $(if $(value $1_$2_CLOUD_INIT_USER_DATA_TEMPLATE),$1_$2_CLOUD_INIT_USER_DATA_TEMPLATE),$(if $(value $1_CLOUD_INIT_USER_DATA_TEMPLATE),$1_CLOUD_INIT_USER_DATA_TEMPLATE),CLOUD_INIT_USER_DATA_TEMPLATE) .PHONY: clean clean:: rm -f $(foreach a,x86_64 aarch64,efi-code.$a.img efi-vars.$a.img) rm -f $(foreach a,x86_64 aarch64,*.$a.qcow2 *.$a.efi-code.img *.$a.efi-vars.img) rm -f *.seed.iso *.meta-data *.user-data image-garden-0.1.1/mk/050-almalinux-8.mk000066400000000000000000000024271474470052300174450ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki ALMALINUX_RELEASES += 8 .PHONY: all all:: almalinux-cloud-8.$(GARDEN_ARCH).qcow2 almalinux-cloud-8.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/almalinux/AlmaLinux-8-GenericCloud-latest.$(GARDEN_ARCH).qcow2 $(GARDEN_DL_DIR)/almalinux/AlmaLinux-8-GenericCloud-latest.x86_64.qcow2 $(GARDEN_DL_DIR)/almalinux/AlmaLinux-8-GenericCloud-latest.aarch64.qcow2: $(GARDEN_DL_DIR)/almalinux/AlmaLinux-8-GenericCloud-latest.%.qcow2: | $(GARDEN_DL_DIR)/almalinux $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://repo.almalinux.org/almalinux/8/cloud/$*/images/AlmaLinux-8-GenericCloud-latest.$*.qcow2) $(GARDEN_DL_DIR)/almalinux/almalinux-cloud-8.x86_64.qcow2: | $(GARDEN_DL_DIR)/almalinux/ $(GARDEN_DL_DIR)/almalinux/AlmaLinux-8-GenericCloud-latest.x86_64.qcow2 ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/almalinux/almalinux-cloud-8.aarch64.qcow2: | $(GARDEN_DL_DIR)/almalinux/ $(GARDEN_DL_DIR)/almalinux/AlmaLinux-8-GenericCloud-latest.aarch64.qcow2 ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/almalinux/almalinux-cloud-8.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/almalinux/AlmaLinux-8-GenericCloud-latest.*.qcow2 image-garden-0.1.1/mk/050-almalinux-9.mk000066400000000000000000000024271474470052300174460ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki ALMALINUX_RELEASES += 9 .PHONY: all all:: almalinux-cloud-9.$(GARDEN_ARCH).qcow2 almalinux-cloud-9.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/almalinux/AlmaLinux-9-GenericCloud-latest.$(GARDEN_ARCH).qcow2 $(GARDEN_DL_DIR)/almalinux/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2 $(GARDEN_DL_DIR)/almalinux/AlmaLinux-9-GenericCloud-latest.aarch64.qcow2: $(GARDEN_DL_DIR)/almalinux/AlmaLinux-9-GenericCloud-latest.%.qcow2: | $(GARDEN_DL_DIR)/almalinux $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://repo.almalinux.org/almalinux/9/cloud/$*/images/AlmaLinux-9-GenericCloud-latest.$*.qcow2) $(GARDEN_DL_DIR)/almalinux/almalinux-cloud-9.x86_64.qcow2: | $(GARDEN_DL_DIR)/almalinux/ $(GARDEN_DL_DIR)/almalinux/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2 ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/almalinux/almalinux-cloud-9.aarch64.qcow2: | $(GARDEN_DL_DIR)/almalinux/ $(GARDEN_DL_DIR)/almalinux/AlmaLinux-9-GenericCloud-latest.aarch64.qcow2 ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/almalinux/almalinux-cloud-9.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/almalinux/AlmaLinux-9-GenericCloud-latest.*.qcow2 image-garden-0.1.1/mk/050-almalinux.mk000066400000000000000000000055571474470052300173070ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki ALMALINUX_RELEASES ?= GARDEN_SYSTEMS += $(foreach r,$(ALMALINUX_RELEASES),$(foreach a,x86_64 aarch64,almalinux-cloud-$r.$a)) $(foreach R,$(ALMALINUX_RELEASES),almalinux-cloud-$R.x86_64.run): almalinux-cloud-%.x86_64.run: $(MAKEFILE_LIST) | almalinux-cloud-%.x86_64.qcow2 almalinux-cloud-%.x86_64.efi-code.img almalinux-cloud-%.x86_64.efi-vars.img echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/almalinux" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_X86_64_EFI_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ $(foreach R,$(ALMALINUX_RELEASES),almalinux-cloud-$R.aarch64.run): almalinux-cloud-%.aarch64.run: $(MAKEFILE_LIST) | almalinux-cloud-%.aarch64.qcow2 almalinux-cloud-%.aarch64.efi-code.img almalinux-cloud-%.aarch64.efi-vars.img echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/almalinux" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ $(foreach R,$(ALMALINUX_RELEASES),almalinux-cloud-$R.x86_64.qcow2): almalinux-cloud-%.x86_64.qcow2: $(GARDEN_DL_DIR)/almalinux/almalinux-cloud-%.x86_64.qcow2 almalinux-cloud-%.seed.iso almalinux-cloud-%.x86_64.efi-code.img almalinux-cloud-%.x86_64.efi-vars.img $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_X86_64_EFI_CMDLINE,$@,$(word 3,$^),$(word 4,$^)) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) $(foreach R,$(ALMALINUX_RELEASES),almalinux-cloud-$R.aarch64.qcow2): almalinux-cloud-%.aarch64.qcow2: $(GARDEN_DL_DIR)/almalinux/almalinux-cloud-%.aarch64.qcow2 almalinux-cloud-%.seed.iso almalinux-cloud-%.aarch64.efi-code.img almalinux-cloud-%.aarch64.efi-vars.img $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$@,$(word 3,$^),$(word 4,$^)) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) $(GARDEN_DL_DIR)/almalinux: | $(GARDEN_DL_DIR) mkdir -p $@ almalinux-cloud-%.meta-data: export META_DATA = $(call CLOUD_INIT_META_DATA_TEMPLATE,almalinux-$*) almalinux-cloud-%.meta-data: $(MAKEFILE_LIST) echo "$${META_DATA}" | tee $@ almalinux-cloud-%.user-data: export USER_DATA = $(call $(call PICK_CLOUD_INIT_USER_DATA_TEMPLATE_FOR,ALMALINUX,$*),almalinux-$*,almalinux) almalinux-cloud-%.user-data: $(MAKEFILE_LIST) $(wildcard .image-garden.mk) echo "$${USER_DATA}" | tee $@ .PHONY: clean clean:: rm -f $(foreach R,$(ALMALINUX_RELEASES),$(foreach A,x86_64 aarch64,almalinux-cloud-$R.$A.qcow2 almalinux-cloud-$R.$A.run)) image-garden-0.1.1/mk/050-alpine-3.mk000066400000000000000000000027231474470052300167150ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki ALPINE_RELEASES += 3 ALPINE_3_SUBVER = 21.2 .PHONY: all all:: alpine-cloud-3.$(GARDEN_ARCH).qcow2 alpine-cloud-3.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/alpine/generic_alpine-3.$(ALPINE_3_SUBVER)-$(GARDEN_ARCH)-uefi-cloudinit-r0.qcow2 $(GARDEN_DL_DIR)/alpine/generic_alpine-3.$(ALPINE_3_SUBVER)-x86_64-uefi-cloudinit-r0.qcow2 $(GARDEN_DL_DIR)/alpine/generic_alpine-3.$(ALPINE_3_SUBVER)-aarch64-uefi-cloudinit-r0.qcow2: $(GARDEN_DL_DIR)/alpine/generic_alpine-3.$(ALPINE_3_SUBVER)-%-uefi-cloudinit-r0.qcow2: | $(GARDEN_DL_DIR)/alpine $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://dl-cdn.alpinelinux.org/alpine/v3.$(firstword $(subst ., ,$(ALPINE_3_SUBVER)))/releases/cloud/generic_alpine-3.$(ALPINE_3_SUBVER)-$*-uefi-cloudinit-r0.qcow2) $(GARDEN_DL_DIR)/alpine/alpine-cloud-3.x86_64.qcow2: | $(GARDEN_DL_DIR)/alpine/ $(GARDEN_DL_DIR)/alpine/generic_alpine-3.$(ALPINE_3_SUBVER)-x86_64-uefi-cloudinit-r0.qcow2 ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/alpine/alpine-cloud-3.aarch64.qcow2: | $(GARDEN_DL_DIR)/alpine/ $(GARDEN_DL_DIR)/alpine/generic_alpine-3.$(ALPINE_3_SUBVER)-aarch64-uefi-cloudinit-r0.qcow2 ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/alpine/alpine-cloud-3.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/alpine/generic_alpine-3.$(ALPINE_3_SUBVER)-*-uefi-cloudinit-r0.qcow2 image-garden-0.1.1/mk/050-alpine.mk000066400000000000000000000053501474470052300165540ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki ALPINE_RELEASES ?= GARDEN_SYSTEMS += $(foreach r,$(ALPINE_RELEASES),$(foreach a,x86_64 aarch64,alpine-cloud-$r.$a)) $(foreach R,$(ALPINE_RELEASES),alpine-cloud-$R.x86_64.run): alpine-cloud-%.x86_64.run: $(MAKEFILE_LIST) | alpine-cloud-%.x86_64.qcow2 alpine-cloud-%.x86_64.efi-code.img alpine-cloud-%.x86_64.efi-vars.img echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/alpine" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_X86_64_EFI_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ $(foreach R,$(ALPINE_RELEASES),alpine-cloud-$R.aarch64.run): alpine-cloud-%.aarch64.run: $(MAKEFILE_LIST) | alpine-cloud-%.aarch64.qcow2 alpine-cloud-%.aarch64.efi-code.img alpine-cloud-%.aarch64.efi-vars.img echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/alpine" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ $(foreach R,$(ALPINE_RELEASES),alpine-cloud-$R.x86_64.qcow2): alpine-cloud-%.x86_64.qcow2: $(GARDEN_DL_DIR)/alpine/alpine-cloud-%.x86_64.qcow2 alpine-cloud-%.seed.iso alpine-cloud-%.x86_64.efi-code.img alpine-cloud-%.x86_64.efi-vars.img $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_X86_64_EFI_CMDLINE,$@,$(word 3,$^),$(word 4,$^)) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) $(foreach R,$(ALPINE_RELEASES),alpine-cloud-$R.aarch64.qcow2): alpine-cloud-%.aarch64.qcow2: $(GARDEN_DL_DIR)/alpine/alpine-cloud-%.aarch64.qcow2 alpine-cloud-%.seed.iso alpine-cloud-%.aarch64.efi-code.img alpine-cloud-%.aarch64.efi-vars.img $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$@,$(word 3,$^),$(word 4,$^)) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) $(GARDEN_DL_DIR)/alpine: | $(GARDEN_DL_DIR) mkdir -p $@ alpine-cloud-%.meta-data: export META_DATA = $(call CLOUD_INIT_META_DATA_TEMPLATE,alpine-$*) alpine-cloud-%.meta-data: $(MAKEFILE_LIST) echo "$${META_DATA}" | tee $@ alpine-cloud-%.user-data: export USER_DATA = $(call $(call PICK_CLOUD_INIT_USER_DATA_TEMPLATE_FOR,ALPINE,$*),alpine-$*,alpine) alpine-cloud-%.user-data: $(MAKEFILE_LIST) $(wildcard .image-garden.mk) echo "$${USER_DATA}" | tee $@ .PHONY: clean clean:: rm -f $(foreach R,$(ALPINE_RELEASES),$(foreach A,x86_64 aarch64,alpine-cloud-$R.$A.qcow2 alpine-cloud-$R.$A.run)) image-garden-0.1.1/mk/050-archlinux.mk000066400000000000000000000045031474470052300173000ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki ifeq ($(GARDEN_ARCH),x86_64) .PHONY: all all:: archlinux-cloud.$(GARDEN_ARCH).qcow2 archlinux-cloud.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/archlinux/Arch-Linux-$(GARDEN_ARCH)-cloudimg.qcow2 endif GARDEN_SYSTEMS += archlinux-cloud.x86_64 archlinux-cloud.x86_64.qcow2: $(GARDEN_DL_DIR)/archlinux/archlinux-cloud.x86_64.qcow2 archlinux-cloud.seed.iso archlinux-cloud.x86_64.efi-code.img archlinux-cloud.x86_64.efi-vars.img $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_X86_64_EFI_CMDLINE,$@,$(word 3,$^),$(word 4,$^)) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) $(GARDEN_DL_DIR)/archlinux/Arch-Linux-x86_64-cloudimg.qcow2: | $(GARDEN_DL_DIR)/archlinux $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://geo.mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-cloudimg.qcow2) $(GARDEN_DL_DIR)/archlinux/archlinux-cloud.x86_64.qcow2: | $(GARDEN_DL_DIR)/archlinux/ $(GARDEN_DL_DIR)/archlinux/Arch-Linux-x86_64-cloudimg.qcow2 ln -sf $(notdir $(word 2,$|)) $@ archlinux-cloud.x86_64.run: $(MAKEFILE_LIST) | archlinux-cloud.x86_64.qcow2 archlinux-cloud.x86_64.efi-code.img archlinux-cloud.x86_64.efi-vars.img echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/archlinux" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_X86_64_EFI_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ $(GARDEN_DL_DIR)/archlinux: | $(GARDEN_DL_DIR) mkdir -p $@ archlinux-cloud.meta-data: export META_DATA = $(call CLOUD_INIT_META_DATA_TEMPLATE,archlinux) archlinux-cloud.meta-data: $(MAKEFILE_LIST) echo "$${META_DATA}" | tee $@ archlinux-cloud.user-data: export USER_DATA = $(call $(call PICK_CLOUD_INIT_USER_DATA_TEMPLATE_FOR,ARCHLINUX,),archlinux,archlinux) archlinux-cloud.user-data: $(MAKEFILE_LIST) $(wildcard .image-garden.mk) echo "$${USER_DATA}" | tee $@ .PHONY: clean clean:: rm -f archlinux-cloud.x86_64.qcow2 archlinux-cloud.x86_64.run rm -f $(GARDEN_DL_DIR)/archlinux/archlinux-cloud.x86_64.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/archlinux/Arch-Linux-x86_64-cloudimg.qcow2 image-garden-0.1.1/mk/050-centos-10.mk000066400000000000000000000024111474470052300170100ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki CENTOS_RELEASES += 10 .PHONY: all all:: centos-cloud-10.$(GARDEN_ARCH).qcow2 centos-cloud-10.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/centos/CentOS-Stream-GenericCloud-10-latest.$(GARDEN_ARCH).qcow2 $(GARDEN_DL_DIR)/centos/CentOS-Stream-GenericCloud-10-latest.aarch64.qcow2 $(GARDEN_DL_DIR)/centos/CentOS-Stream-GenericCloud-10-latest.x86_64.qcow2: $(GARDEN_DL_DIR)/centos/CentOS-Stream-GenericCloud-10-latest.%.qcow2: | $(GARDEN_DL_DIR)/centos $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://cloud.centos.org/centos/10-stream/$*/images/CentOS-Stream-GenericCloud-10-latest.$*.qcow2) $(GARDEN_DL_DIR)/centos/centos-cloud-10.x86_64.qcow2: | $(GARDEN_DL_DIR)/centos/ $(GARDEN_DL_DIR)/centos/CentOS-Stream-GenericCloud-10-latest.x86_64.qcow2 ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/centos/centos-cloud-10.aarch64.qcow2: | $(GARDEN_DL_DIR)/centos/ $(GARDEN_DL_DIR)/centos/CentOS-Stream-GenericCloud-10-latest.aarch64.qcow2 ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/centos/centos-cloud-10.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/centos/CentOS-Stream-GenericCloud-10-latest.*.qcow2 image-garden-0.1.1/mk/050-centos-9.mk000066400000000000000000000024411474470052300167430ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki CENTOS_RELEASES += 9 .PHONY: all all:: centos-cloud-9.$(GARDEN_ARCH).qcow2 centos-cloud-9.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/centos/CentOS-Stream-GenericCloud-9-latest.$(GARDEN_ARCH).qcow2 # FIXME: x86-64 image is BIOS, not EFI $(GARDEN_DL_DIR)/centos/CentOS-Stream-GenericCloud-9-latest.aarch64.qcow2 $(GARDEN_DL_DIR)/centos/CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2: $(GARDEN_DL_DIR)/centos/CentOS-Stream-GenericCloud-9-latest.%.qcow2: | $(GARDEN_DL_DIR)/centos $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://cloud.centos.org/centos/9-stream/$*/images/CentOS-Stream-GenericCloud-9-latest.$*.qcow2) $(GARDEN_DL_DIR)/centos/centos-cloud-9.x86_64.qcow2: | $(GARDEN_DL_DIR)/centos/ $(GARDEN_DL_DIR)/centos/CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2 ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/centos/centos-cloud-9.aarch64.qcow2: | $(GARDEN_DL_DIR)/centos/ $(GARDEN_DL_DIR)/centos/CentOS-Stream-GenericCloud-9-latest.aarch64.qcow2 ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/centos/centos-cloud-9.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/centos/CentOS-Stream-GenericCloud-9-latest.*.qcow2 image-garden-0.1.1/mk/050-centos.mk000066400000000000000000000051041474470052300165740ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki CENTOS_RELEASES ?= GARDEN_SYSTEMS += $(foreach r,$(CENTOS_RELEASES),$(foreach a,x86_64 aarch64,centos-cloud-$r.$a)) $(foreach R,$(CENTOS_RELEASES),centos-cloud-$R.x86_64.run): centos-cloud-%.x86_64.run: $(MAKEFILE_LIST) | centos-cloud-%.x86_64.qcow2 echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/centos" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_X86_64_BIOS_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ $(foreach R,$(CENTOS_RELEASES),centos-cloud-$R.aarch64.run): centos-cloud-%.aarch64.run: $(MAKEFILE_LIST) | centos-cloud-%.aarch64.qcow2 centos-cloud-%.aarch64.efi-code.img centos-cloud-%.aarch64.efi-vars.img echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/centos" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ $(foreach R,$(CENTOS_RELEASES),centos-cloud-$R.x86_64.qcow2): centos-cloud-%.x86_64.qcow2: $(GARDEN_DL_DIR)/centos/centos-cloud-%.x86_64.qcow2 centos-cloud-%.seed.iso $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_X86_64_BIOS_CMDLINE,$@) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) $(foreach R,$(CENTOS_RELEASES),centos-cloud-$R.aarch64.qcow2): centos-cloud-%.aarch64.qcow2: $(GARDEN_DL_DIR)/centos/centos-cloud-%.aarch64.qcow2 centos-cloud-%.seed.iso centos-cloud-%.aarch64.efi-code.img centos-cloud-%.aarch64.efi-vars.img $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$@,$(word 3,$^),$(word 4,$^)) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) $(GARDEN_DL_DIR)/centos: | $(GARDEN_DL_DIR) mkdir -p $@ centos-cloud-%.meta-data: export META_DATA = $(call CLOUD_INIT_META_DATA_TEMPLATE,centos-$*) centos-cloud-%.meta-data: $(MAKEFILE_LIST) echo "$${META_DATA}" | tee $@ centos-cloud-%.user-data: export USER_DATA = $(call $(call PICK_CLOUD_INIT_USER_DATA_TEMPLATE_FOR,CENTOS,$*),centos-$*,centos) centos-cloud-%.user-data: $(MAKEFILE_LIST) $(wildcard .image-garden.mk) echo "$${USER_DATA}" | tee $@ .PHONY: clean clean:: rm -f $(foreach R,$(CENTOS_RELEASES),$(foreach A,x86_64 aarch64,centos-cloud-$R.$A.qcow2 centos-cloud-$R.$A.run)) image-garden-0.1.1/mk/050-debian-10.mk000066400000000000000000000023411474470052300167410ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki DEBIAN_RELEASES += 10 DEBIAN_10_CODENAME = buster .PHONY: all all:: debian-cloud-10.$(GARDEN_ARCH).qcow2 debian-cloud-10.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/debian/debian-10-generic-$(call map_to_debian_arch,$(GARDEN_ARCH))-daily.qcow2 $(GARDEN_DL_DIR)/debian/debian-10-generic-amd64-daily.qcow2 $(GARDEN_DL_DIR)/debian/debian-10-generic-arm64-daily.qcow2: $(GARDEN_DL_DIR)/debian/debian-10-generic-%-daily.qcow2: | $(GARDEN_DL_DIR)/debian $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://cloud.debian.org/images/cloud/$(DEBIAN_10_CODENAME)/daily/latest/debian-10-generic-$*-daily.qcow2) $(GARDEN_DL_DIR)/debian/debian-cloud-10.x86_64.qcow2: | $(GARDEN_DL_DIR)/debian/ $(GARDEN_DL_DIR)/debian/debian-10-generic-amd64-daily.qcow2 ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/debian/debian-cloud-10.aarch64.qcow2: | $(GARDEN_DL_DIR)/debian/ $(GARDEN_DL_DIR)/debian/debian-10-generic-arm64-daily.qcow2 ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/debian/debian-cloud-10.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/debian/debian-10-generic-*.qcow2 image-garden-0.1.1/mk/050-debian-11.mk000066400000000000000000000024131474470052300167420ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki DEBIAN_RELEASES += 11 DEBIAN_11_CODENAME = bullseye .PHONY: all all:: debian-cloud-11.$(GARDEN_ARCH).qcow2 debian-cloud-11.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/debian/debian-11-genericcloud-$(call map_to_debian_arch,$(GARDEN_ARCH))-daily.qcow2 $(GARDEN_DL_DIR)/debian/debian-11-genericcloud-amd64-daily.qcow2 $(GARDEN_DL_DIR)/debian/debian-11-genericcloud-arm64-daily.qcow2: $(GARDEN_DL_DIR)/debian/debian-11-genericcloud-%-daily.qcow2: | $(GARDEN_DL_DIR)/debian $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://cloud.debian.org/images/cloud/$(DEBIAN_11_CODENAME)/daily/latest/debian-11-genericcloud-$*-daily.qcow2) $(GARDEN_DL_DIR)/debian/debian-cloud-11.x86_64.qcow2: | $(GARDEN_DL_DIR)/debian/ $(GARDEN_DL_DIR)/debian/debian-11-genericcloud-amd64-daily.qcow2 ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/debian/debian-cloud-11.aarch64.qcow2: | $(GARDEN_DL_DIR)/debian/ $(GARDEN_DL_DIR)/debian/debian-11-genericcloud-arm64-daily.qcow2 ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/debian/debian-cloud-11.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/debian/debian-11-genericcloud-*.qcow2 image-garden-0.1.1/mk/050-debian-12.mk000066400000000000000000000024131474470052300167430ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki DEBIAN_RELEASES += 12 DEBIAN_12_CODENAME = bookworm .PHONY: all all:: debian-cloud-12.$(GARDEN_ARCH).qcow2 debian-cloud-12.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/debian/debian-12-genericcloud-$(call map_to_debian_arch,$(GARDEN_ARCH))-daily.qcow2 $(GARDEN_DL_DIR)/debian/debian-12-genericcloud-amd64-daily.qcow2 $(GARDEN_DL_DIR)/debian/debian-12-genericcloud-arm64-daily.qcow2: $(GARDEN_DL_DIR)/debian/debian-12-genericcloud-%-daily.qcow2: | $(GARDEN_DL_DIR)/debian $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://cloud.debian.org/images/cloud/$(DEBIAN_12_CODENAME)/daily/latest/debian-12-genericcloud-$*-daily.qcow2) $(GARDEN_DL_DIR)/debian/debian-cloud-12.x86_64.qcow2: | $(GARDEN_DL_DIR)/debian/ $(GARDEN_DL_DIR)/debian/debian-12-genericcloud-amd64-daily.qcow2 ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/debian/debian-cloud-12.aarch64.qcow2: | $(GARDEN_DL_DIR)/debian/ $(GARDEN_DL_DIR)/debian/debian-12-genericcloud-arm64-daily.qcow2 ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/debian/debian-cloud-12.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/debian/debian-12-genericcloud-*.qcow2 image-garden-0.1.1/mk/050-debian-13.mk000066400000000000000000000024111474470052300167420ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki DEBIAN_RELEASES += 13 DEBIAN_13_CODENAME = trixie .PHONY: all all:: debian-cloud-13.$(GARDEN_ARCH).qcow2 debian-cloud-13.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/debian/debian-13-genericcloud-$(call map_to_debian_arch,$(GARDEN_ARCH))-daily.qcow2 $(GARDEN_DL_DIR)/debian/debian-13-genericcloud-amd64-daily.qcow2 $(GARDEN_DL_DIR)/debian/debian-13-genericcloud-arm64-daily.qcow2: $(GARDEN_DL_DIR)/debian/debian-13-genericcloud-%-daily.qcow2: | $(GARDEN_DL_DIR)/debian $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://cloud.debian.org/images/cloud/$(DEBIAN_13_CODENAME)/daily/latest/debian-13-genericcloud-$*-daily.qcow2) $(GARDEN_DL_DIR)/debian/debian-cloud-13.x86_64.qcow2: | $(GARDEN_DL_DIR)/debian/ $(GARDEN_DL_DIR)/debian/debian-13-genericcloud-amd64-daily.qcow2 ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/debian/debian-cloud-13.aarch64.qcow2: | $(GARDEN_DL_DIR)/debian/ $(GARDEN_DL_DIR)/debian/debian-13-genericcloud-arm64-daily.qcow2 ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/debian/debian-cloud-13.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/debian/debian-13-genericcloud-*.qcow2 image-garden-0.1.1/mk/050-debian.mk000066400000000000000000000060661474470052300165330ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki DEBIAN_RELEASES ?= GARDEN_SYSTEMS += $(foreach r,$(DEBIAN_RELEASES),$(foreach a,x86_64 aarch64,debian-cloud-$r.$a)) $(foreach R,$(DEBIAN_RELEASES),debian-cloud-$R.x86_64.run): debian-cloud-%.x86_64.run: $(MAKEFILE_LIST) | debian-cloud-%.x86_64.qcow2 debian-cloud-%.x86_64.efi-code.img debian-cloud-%.x86_64.efi-vars.img echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/debian" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_X86_64_EFI_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ $(foreach R,$(DEBIAN_RELEASES),debian-cloud-$R.aarch64.run): debian-cloud-%.aarch64.run: $(MAKEFILE_LIST) | debian-cloud-%.aarch64.qcow2 debian-cloud-%.aarch64.efi-code.img debian-cloud-%.aarch64.efi-vars.img echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/debian" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ # Debian cloud images do not contain a standalone installer that you only need # during the setup process. Instead each image can be used as a read-only base # for a read-write template. $(foreach R,$(DEBIAN_RELEASES),debian-cloud-$R.x86_64.qcow2): debian-cloud-%.x86_64.qcow2: $(GARDEN_DL_DIR)/debian/debian-cloud-%.x86_64.qcow2 debian-cloud-%.seed.iso debian-cloud-%.x86_64.efi-code.img debian-cloud-%.x86_64.efi-vars.img $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_X86_64_EFI_CMDLINE,$@,$(word 3,$^),$(word 4,$^)) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) # Replicated because we have more releases than architectures and architecture-specific quirks are easier to express. $(foreach R,$(DEBIAN_RELEASES),debian-cloud-$R.aarch64.qcow2): debian-cloud-%.aarch64.qcow2: $(GARDEN_DL_DIR)/debian/debian-cloud-%.aarch64.qcow2 debian-cloud-%.seed.iso debian-cloud-%.aarch64.efi-code.img debian-cloud-%.aarch64.efi-vars.img $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$@,$(word 3,$^),$(word 4,$^)) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) # Debian specific downloads. $(GARDEN_DL_DIR)/debian: | $(GARDEN_DL_DIR) mkdir -p $@ debian-cloud-%.meta-data: export META_DATA = $(call CLOUD_INIT_META_DATA_TEMPLATE,debian-$*) debian-cloud-%.meta-data: $(MAKEFILE_LIST) echo "$${META_DATA}" | tee $@ debian-cloud-%.user-data: export USER_DATA = $(call $(call PICK_CLOUD_INIT_USER_DATA_TEMPLATE_FOR,DEBIAN,$*),debian-$*,debian) debian-cloud-%.user-data: $(MAKEFILE_LIST) $(wildcard .image-garden.mk) echo "$${USER_DATA}" | tee $@ .PHONY: clean clean:: rm -f $(foreach R,$(DEBIAN_RELEASES),$(foreach A,x86_64 aarch64,debian-cloud-$R.$A.qcow2 debian-cloud-$R.$A.run)) image-garden-0.1.1/mk/050-fedora-38.mk000066400000000000000000000022151474470052300167710ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki FEDORA_RELEASES += 38 FEDORA_38_SUBVER = 1.6 .PHONY: all all:: fedora-cloud-38.$(GARDEN_ARCH).qcow2 fedora-cloud-38.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-38-$(FEDORA_38_SUBVER).$(GARDEN_ARCH).qcow2 $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-38-$(FEDORA_38_SUBVER).x86_64.qcow2 $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-38-$(FEDORA_38_SUBVER).aarch64.qcow2: $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-38-$(FEDORA_38_SUBVER).%.qcow2: | $(GARDEN_DL_DIR)/fedora $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://download.fedoraproject.org/pub/fedora/linux/releases/38/Cloud/$*/images/Fedora-Cloud-Base-38-$(FEDORA_38_SUBVER).$*.qcow2) $(GARDEN_DL_DIR)/fedora/fedora-cloud-base-38.%.qcow2: $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-38-$(FEDORA_38_SUBVER).%.qcow2 | $(GARDEN_DL_DIR)/fedora ln -sf $(notdir $<) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/fedora/fedora-cloud-base-38.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-38-$(FEDORA_38_SUBVER).*.qcow2 image-garden-0.1.1/mk/050-fedora-39.mk000066400000000000000000000022151474470052300167720ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki FEDORA_RELEASES += 39 FEDORA_39_SUBVER = 1.5 .PHONY: all all:: fedora-cloud-39.$(GARDEN_ARCH).qcow2 fedora-cloud-39.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-39-$(FEDORA_39_SUBVER).$(GARDEN_ARCH).qcow2 $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-39-$(FEDORA_39_SUBVER).x86_64.qcow2 $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-39-$(FEDORA_39_SUBVER).aarch64.qcow2: $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-39-$(FEDORA_39_SUBVER).%.qcow2: | $(GARDEN_DL_DIR)/fedora $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://download.fedoraproject.org/pub/fedora/linux/releases/39/Cloud/$*/images/Fedora-Cloud-Base-39-$(FEDORA_39_SUBVER).$*.qcow2) $(GARDEN_DL_DIR)/fedora/fedora-cloud-base-39.%.qcow2: $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-39-$(FEDORA_39_SUBVER).%.qcow2 | $(GARDEN_DL_DIR)/fedora ln -sf $(notdir $<) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/fedora/fedora-cloud-base-39.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-39-$(FEDORA_39_SUBVER).*.qcow2 image-garden-0.1.1/mk/050-fedora-40.mk000066400000000000000000000023061474470052300167630ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki FEDORA_RELEASES += 40 FEDORA_40_SUBVER = 1.14 .PHONY: all all:: fedora-cloud-40.$(GARDEN_ARCH).qcow2 fedora-cloud-40.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-Generic.$(GARDEN_ARCH)-40-$(FEDORA_40_SUBVER).qcow2 $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-Generic.x86_64-40-$(FEDORA_40_SUBVER).qcow2 $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-Generic.aarch64-40-$(FEDORA_40_SUBVER).qcow2: $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-Generic.%-40-$(FEDORA_40_SUBVER).qcow2: | $(GARDEN_DL_DIR)/fedora $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/$*/images/Fedora-Cloud-Base-Generic.$*-40-$(FEDORA_40_SUBVER).qcow2) $(GARDEN_DL_DIR)/fedora/fedora-cloud-base-40.%.qcow2: $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-Generic.%-40-$(FEDORA_40_SUBVER).qcow2 | $(GARDEN_DL_DIR)/fedora ln -sf $(notdir $<) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/fedora/fedora-cloud-base-40.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-Generic.*-40-$(FEDORA_40_SUBVER).qcow2 image-garden-0.1.1/mk/050-fedora-41.mk000066400000000000000000000023051474470052300167630ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki FEDORA_RELEASES += 41 FEDORA_41_SUBVER = 1.4 .PHONY: all all:: fedora-cloud-41.$(GARDEN_ARCH).qcow2 fedora-cloud-41.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-Generic-41-$(FEDORA_41_SUBVER).$(GARDEN_ARCH).qcow2 $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-Generic-41-$(FEDORA_41_SUBVER).x86_64.qcow2 $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-Generic-41-$(FEDORA_41_SUBVER).aarch64.qcow2: $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-Generic-41-$(FEDORA_41_SUBVER).%.qcow2: | $(GARDEN_DL_DIR)/fedora $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://download.fedoraproject.org/pub/fedora/linux/releases/41/Cloud/$*/images/Fedora-Cloud-Base-Generic-41-$(FEDORA_41_SUBVER).$*.qcow2) $(GARDEN_DL_DIR)/fedora/fedora-cloud-base-41.%.qcow2: $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-Generic-41-$(FEDORA_41_SUBVER).%.qcow2 | $(GARDEN_DL_DIR)/fedora ln -sf $(notdir $<) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/fedora/fedora-cloud-base-41.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/fedora/Fedora-Cloud-Base-Generic.*-41-$(FEDORA_41_SUBVER).qcow2 image-garden-0.1.1/mk/050-fedora.mk000066400000000000000000000061001474470052300165360ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki FEDORA_RELEASES ?= GARDEN_SYSTEMS += $(foreach r,$(FEDORA_RELEASES),$(foreach a,x86_64 aarch64,fedora-cloud-$r.$a)) $(foreach R,$(FEDORA_RELEASES),fedora-cloud-$R.x86_64.run): fedora-cloud-%.x86_64.run: $(MAKEFILE_LIST) | fedora-cloud-%.x86_64.qcow2 fedora-cloud-%.x86_64.efi-code.img fedora-cloud-%.x86_64.efi-vars.img echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/fedora" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_X86_64_EFI_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ $(foreach R,$(FEDORA_RELEASES),fedora-cloud-$R.aarch64.run): fedora-cloud-%.aarch64.run: $(MAKEFILE_LIST) | fedora-cloud-%.aarch64.qcow2 fedora-cloud-%.aarch64.efi-code.img fedora-cloud-%.aarch64.efi-vars.img echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/fedora" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ # Fedora cloud images do not contain a standalone installer that you only need # during the setup process. Instead each image can be used as a read-only base # for a read-write template. $(foreach R,$(FEDORA_RELEASES),fedora-cloud-$R.x86_64.qcow2): fedora-cloud-%.x86_64.qcow2: $(GARDEN_DL_DIR)/fedora/fedora-cloud-base-%.x86_64.qcow2 fedora-cloud-%.seed.iso fedora-cloud-%.x86_64.efi-code.img fedora-cloud-%.x86_64.efi-vars.img $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_X86_64_EFI_CMDLINE,$@,$(word 3,$^),$(word 4,$^)) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) # Replicated because we have more releases than architectures and architecture-specific quirks are easier to express. $(foreach R,$(FEDORA_RELEASES),fedora-cloud-$R.aarch64.qcow2): fedora-cloud-%.aarch64.qcow2: $(GARDEN_DL_DIR)/fedora/fedora-cloud-base-%.aarch64.qcow2 fedora-cloud-%.seed.iso fedora-cloud-%.aarch64.efi-code.img fedora-cloud-%.aarch64.efi-vars.img $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$@,$(word 3,$^),$(word 4,$^)) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) # Fedora specific downloads. $(GARDEN_DL_DIR)/fedora: | $(GARDEN_DL_DIR) mkdir -p $@ fedora-cloud-%.meta-data: export META_DATA = $(call CLOUD_INIT_META_DATA_TEMPLATE,fedora-$*) fedora-cloud-%.meta-data: $(MAKEFILE_LIST) echo "$${META_DATA}" | tee $@ fedora-cloud-%.user-data: export USER_DATA = $(call $(call PICK_CLOUD_INIT_USER_DATA_TEMPLATE_FOR,FEDORA,$*),fedora-$*,fedora) fedora-cloud-%.user-data: $(MAKEFILE_LIST) $(wildcard .image-garden.mk) echo "$${USER_DATA}" | tee $@ .PHONY: clean clean:: rm -f $(foreach R,$(FEDORA_RELEASES),$(foreach A,x86_64 aarch64,fedora-cloud-$R.$A.qcow2 fedora-cloud-$R.$A.run)) image-garden-0.1.1/mk/050-opensuse-leap-15.4.mk000066400000000000000000000024021474470052300204440ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki OPENSUSE_RELEASES += 15.4 .PHONY: all all:: opensuse-cloud-15.4.$(GARDEN_ARCH).qcow2 opensuse-cloud-15.4.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.4.$(GARDEN_ARCH)-NoCloud.qcow2 $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.4.x86_64-NoCloud.qcow2 $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.4.aarch64-NoCloud.qcow2: $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.4.%-NoCloud.qcow2: | $(GARDEN_DL_DIR)/opensuse $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://download.opensuse.org/repositories/Cloud:/Images:/Leap_15.4/images/openSUSE-Leap-15.4.$*-NoCloud.qcow2) $(GARDEN_DL_DIR)/opensuse/opensuse-cloud-15.4.x86_64.qcow2: | $(GARDEN_DL_DIR)/opensuse/ $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.4.x86_64-NoCloud.qcow2 ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/opensuse/opensuse-cloud-15.4.aarch64.qcow2: | $(GARDEN_DL_DIR)/opensuse/ $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.4.aarch64-NoCloud.qcow2 ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/opensuse/opensuse-cloud-15.4.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.4.*-NoCloud.qcow2 image-garden-0.1.1/mk/050-opensuse-leap-15.5.mk000066400000000000000000000024021474470052300204450ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki OPENSUSE_RELEASES += 15.5 .PHONY: all all:: opensuse-cloud-15.5.$(GARDEN_ARCH).qcow2 opensuse-cloud-15.5.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.5.$(GARDEN_ARCH)-NoCloud.qcow2 $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.5.x86_64-NoCloud.qcow2 $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.5.aarch64-NoCloud.qcow2: $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.5.%-NoCloud.qcow2: | $(GARDEN_DL_DIR)/opensuse $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://download.opensuse.org/repositories/Cloud:/Images:/Leap_15.5/images/openSUSE-Leap-15.5.$*-NoCloud.qcow2) $(GARDEN_DL_DIR)/opensuse/opensuse-cloud-15.5.x86_64.qcow2: | $(GARDEN_DL_DIR)/opensuse/ $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.5.x86_64-NoCloud.qcow2 ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/opensuse/opensuse-cloud-15.5.aarch64.qcow2: | $(GARDEN_DL_DIR)/opensuse/ $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.5.aarch64-NoCloud.qcow2 ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/opensuse/opensuse-cloud-15.5.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.5.*-NoCloud.qcow2 image-garden-0.1.1/mk/050-opensuse-leap-15.6.mk000066400000000000000000000024021474470052300204460ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki OPENSUSE_RELEASES += 15.6 .PHONY: all all:: opensuse-cloud-15.6.$(GARDEN_ARCH).qcow2 opensuse-cloud-15.6.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.6.$(GARDEN_ARCH)-NoCloud.qcow2 $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.6.x86_64-NoCloud.qcow2 $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.6.aarch64-NoCloud.qcow2: $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.6.%-NoCloud.qcow2: | $(GARDEN_DL_DIR)/opensuse $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://download.opensuse.org/repositories/Cloud:/Images:/Leap_15.6/images/openSUSE-Leap-15.6.$*-NoCloud.qcow2) $(GARDEN_DL_DIR)/opensuse/opensuse-cloud-15.6.x86_64.qcow2: | $(GARDEN_DL_DIR)/opensuse/ $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.6.x86_64-NoCloud.qcow2 ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/opensuse/opensuse-cloud-15.6.aarch64.qcow2: | $(GARDEN_DL_DIR)/opensuse/ $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.6.aarch64-NoCloud.qcow2 ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/opensuse/opensuse-cloud-15.6.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/opensuse/openSUSE-Leap-15.6.*-NoCloud.qcow2 image-garden-0.1.1/mk/050-opensuse-tumbleweed.mk000066400000000000000000000031711474470052300212770ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki OPENSUSE_RELEASES += tumbleweed .PHONY: all all:: opensuse-cloud-tumbleweed.$(GARDEN_ARCH).qcow2 opensuse-cloud-tumbleweed.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/opensuse/openSUSE-Tumbleweed-Minimal-VM.$(GARDEN_ARCH)-Cloud.qcow2 $(GARDEN_DL_DIR)/opensuse/openSUSE-Tumbleweed-Minimal-VM.aarch64-Cloud.qcow2: | $(GARDEN_DL_DIR)/opensuse $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://download.opensuse.org/repositories/Virtualization:/Appliances:/Images:/openSUSE-Tumbleweed/openSUSE_Tumbleweed_ARM/openSUSE-Tumbleweed-Minimal-VM.aarch64-Cloud.qcow2) $(GARDEN_DL_DIR)/opensuse/openSUSE-Tumbleweed-Minimal-VM.x86_64-Cloud.qcow2: | $(GARDEN_DL_DIR)/opensuse $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://download.opensuse.org/repositories/Virtualization:/Appliances:/Images:/openSUSE-Tumbleweed/openSUSE_Tumbleweed/openSUSE-Tumbleweed-Minimal-VM.x86_64-Cloud.qcow2) $(GARDEN_DL_DIR)/opensuse/opensuse-cloud-tumbleweed.x86_64.qcow2: | $(GARDEN_DL_DIR)/opensuse/ $(GARDEN_DL_DIR)/opensuse/openSUSE-Tumbleweed-Minimal-VM.x86_64-Cloud.qcow2 ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/opensuse/opensuse-cloud-tumbleweed.aarch64.qcow2: | $(GARDEN_DL_DIR)/opensuse/ $(GARDEN_DL_DIR)/opensuse/openSUSE-Tumbleweed-Minimal-VM.aarch64-Cloud.qcow2 ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/opensuse/opensuse-cloud-tumbleweed.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/opensuse/openSUSE-Tumbleweed-Minimal-VM.*-Cloud.qcow2 image-garden-0.1.1/mk/050-opensuse.mk000066400000000000000000000061631474470052300171500ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki OPENSUSE_RELEASES ?= GARDEN_SYSTEMS += $(foreach r,$(OPENSUSE_RELEASES),$(foreach a,x86_64 aarch64,opensuse-cloud-$r.$a)) $(foreach R,$(OPENSUSE_RELEASES),opensuse-cloud-$R.x86_64.run): opensuse-cloud-%.x86_64.run: $(MAKEFILE_LIST) | opensuse-cloud-%.x86_64.qcow2 opensuse-cloud-%.x86_64.efi-code.img opensuse-cloud-%.x86_64.efi-vars.img echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/opensuse" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_X86_64_EFI_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ $(foreach R,$(OPENSUSE_RELEASES),opensuse-cloud-$R.aarch64.run): opensuse-cloud-%.aarch64.run: $(MAKEFILE_LIST) | opensuse-cloud-%.aarch64.qcow2 opensuse-cloud-%.aarch64.efi-code.img opensuse-cloud-%.aarch64.efi-vars.img echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/opensuse" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ # Debian cloud images do not contain a standalone installer that you only need # during the setup process. Instead each image can be used as a read-only base # for a read-write template. $(foreach R,$(OPENSUSE_RELEASES),opensuse-cloud-$R.x86_64.qcow2): opensuse-cloud-%.x86_64.qcow2: $(GARDEN_DL_DIR)/opensuse/opensuse-cloud-%.x86_64.qcow2 opensuse-cloud-%.seed.iso opensuse-cloud-%.x86_64.efi-code.img opensuse-cloud-%.x86_64.efi-vars.img $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_X86_64_EFI_CMDLINE,$@,$(word 3,$^),$(word 4,$^)) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) # Replicated because we have more releases than architectures and architecture-specific quirks are easier to express. $(foreach R,$(OPENSUSE_RELEASES),opensuse-cloud-$R.aarch64.qcow2): opensuse-cloud-%.aarch64.qcow2: $(GARDEN_DL_DIR)/opensuse/opensuse-cloud-%.aarch64.qcow2 opensuse-cloud-%.seed.iso opensuse-cloud-%.aarch64.efi-code.img opensuse-cloud-%.aarch64.efi-vars.img $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$@,$(word 3,$^),$(word 4,$^)) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) $(GARDEN_DL_DIR)/opensuse: | $(GARDEN_DL_DIR) mkdir -p $@ opensuse-cloud-%.meta-data: export META_DATA = $(call CLOUD_INIT_META_DATA_TEMPLATE,opensuse-$*) opensuse-cloud-%.meta-data: $(MAKEFILE_LIST) echo "$${META_DATA}" | tee $@ opensuse-cloud-%.user-data: export USER_DATA = $(call $(call PICK_CLOUD_INIT_USER_DATA_TEMPLATE_FOR,OPENSUSE,$*),opensuse-$*,opensuse) opensuse-cloud-%.user-data: $(MAKEFILE_LIST) $(wildcard .image-garden.mk) echo "$${USER_DATA}" | tee $@ .PHONY: clean clean:: rm -f $(foreach R,$(OPENSUSE_RELEASES),$(foreach A,x86_64 aarch64,opensuse-cloud-$R.$A.qcow2 opensuse-cloud-$R.$A.run)) image-garden-0.1.1/mk/050-oracle-8.mk000066400000000000000000000026501474470052300167160ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki ORACLE_RELEASES += 8 .PHONY: all all:: oracle-cloud-8.$(GARDEN_ARCH).qcow2 oracle-cloud-8.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/oracle/OL8U10_x86_64-kvm-b237.qcow2 fetch: $(GARDEN_DL_DIR)/oracle/OL8U10_aarch64-kvm-cloud-b100.qcow2 $(GARDEN_DL_DIR)/oracle/OL8U10_x86_64-kvm-b237.qcow2: | $(GARDEN_DL_DIR)/oracle $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://yum.oracle.com/templates/OracleLinux/OL8/u10/x86_64/OL8U10_x86_64-kvm-b237.qcow2) $(GARDEN_DL_DIR)/oracle/OL8U10_aarch64-kvm-cloud-b100.qcow2: | $(GARDEN_DL_DIR)/oracle $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://yum.oracle.com/templates/OracleLinux/OL8/u10/aarch64/OL8U10_aarch64-kvm-cloud-b100.qcow2) $(GARDEN_DL_DIR)/oracle/oracle-cloud-8.x86_64.qcow2: $(MAKEFILE_LIST) | $(GARDEN_DL_DIR)/oracle/ $(GARDEN_DL_DIR)/oracle/OL8U10_x86_64-kvm-b237.qcow2 ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/oracle/oracle-cloud-8.aarch64.qcow2: $(MAKEFILE_LIST) | $(GARDEN_DL_DIR)/oracle/ $(GARDEN_DL_DIR)/oracle/OL8U10_aarch64-kvm-cloud-b100.qcow2 ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/oracle/oracle-cloud-8.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/oracle/OL8U10_x86_64-kvm-b*.qcow2 $(GARDEN_DL_DIR)/oracle/OL8U10_aarch64-kvm-cloud-b*.qcow2 image-garden-0.1.1/mk/050-oracle-9.mk000066400000000000000000000026341474470052300167210ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki ORACLE_RELEASES += 9 .PHONY: all all:: oracle-cloud-9.$(GARDEN_ARCH).qcow2 oracle-cloud-9.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/oracle/OL9U5_aarch64-kvm-cloud-b117.qcow2 fetch: $(GARDEN_DL_DIR)/oracle/OL9U5_x86_64-kvm-b253.qcow2 $(GARDEN_DL_DIR)/oracle/OL9U5_x86_64-kvm-b253.qcow2: | $(GARDEN_DL_DIR)/oracle $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://yum.oracle.com/templates/OracleLinux/OL9/u5/x86_64/OL9U5_x86_64-kvm-b253.qcow2) $(GARDEN_DL_DIR)/oracle/OL9U5_aarch64-kvm-cloud-b117.qcow2: | $(GARDEN_DL_DIR)/oracle $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://yum.oracle.com/templates/OracleLinux/OL9/u5/aarch64/OL9U5_aarch64-kvm-cloud-b117.qcow2) $(GARDEN_DL_DIR)/oracle/oracle-cloud-9.x86_64.qcow2: $(MAKEFILE_LIST) | $(GARDEN_DL_DIR)/oracle/ $(GARDEN_DL_DIR)/oracle/OL9U5_x86_64-kvm-b253.qcow2 ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/oracle/oracle-cloud-9.aarch64.qcow2: $(MAKEFILE_LIST) | $(GARDEN_DL_DIR)/oracle/ $(GARDEN_DL_DIR)/oracle/OL9U5_aarch64-kvm-cloud-b117.qcow2 ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/oracle/oracle-cloud-9.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/oracle/OL9U5_x86_64-kvm-b*.qcow2 $(GARDEN_DL_DIR)/oracle/OL9U5_aarch64-kvm-cloud-b*.qcow2 image-garden-0.1.1/mk/050-oracle.mk000066400000000000000000000051041474470052300165460ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki ORACLE_RELEASES ?= GARDEN_SYSTEMS += $(foreach r,$(ORACLE_RELEASES),$(foreach a,x86_64 aarch64,oracle-cloud-$r.$a)) $(foreach R,$(ORACLE_RELEASES),oracle-cloud-$R.x86_64.run): oracle-cloud-%.x86_64.run: $(MAKEFILE_LIST) | oracle-cloud-%.x86_64.qcow2 echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/oracle" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_X86_64_BIOS_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ $(foreach R,$(ORACLE_RELEASES),oracle-cloud-$R.aarch64.run): oracle-cloud-%.aarch64.run: $(MAKEFILE_LIST) | oracle-cloud-%.aarch64.qcow2 oracle-cloud-%.aarch64.efi-code.img oracle-cloud-%.aarch64.efi-vars.img echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/oracle" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ $(foreach R,$(ORACLE_RELEASES),oracle-cloud-$R.x86_64.qcow2): oracle-cloud-%.x86_64.qcow2: $(GARDEN_DL_DIR)/oracle/oracle-cloud-%.x86_64.qcow2 oracle-cloud-%.seed.iso $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_X86_64_BIOS_CMDLINE,$@) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) $(foreach R,$(ORACLE_RELEASES),oracle-cloud-$R.aarch64.qcow2): oracle-cloud-%.aarch64.qcow2: $(GARDEN_DL_DIR)/oracle/oracle-cloud-%.aarch64.qcow2 oracle-cloud-%.seed.iso oracle-cloud-%.aarch64.efi-code.img oracle-cloud-%.aarch64.efi-vars.img $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$@,$(word 3,$^),$(word 4,$^)) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) $(GARDEN_DL_DIR)/oracle: | $(GARDEN_DL_DIR) mkdir -p $@ oracle-cloud-%.meta-data: export META_DATA = $(call CLOUD_INIT_META_DATA_TEMPLATE,oracle-$*) oracle-cloud-%.meta-data: $(MAKEFILE_LIST) echo "$${META_DATA}" | tee $@ oracle-cloud-%.user-data: export USER_DATA = $(call $(call PICK_CLOUD_INIT_USER_DATA_TEMPLATE_FOR,ORACLE,$*),oracle-$*,oracle) oracle-cloud-%.user-data: $(MAKEFILE_LIST) $(wildcard .image-garden.mk) echo "$${USER_DATA}" | tee $@ .PHONY: clean clean:: rm -f $(foreach R,$(ORACLE_RELEASES),$(foreach A,x86_64 aarch64,oracle-cloud-$R.$A.qcow2 oracle-cloud-$R.$A.run)) image-garden-0.1.1/mk/050-rocky-8.mk000066400000000000000000000023171474470052300166000ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki ROCKY_RELEASES += 8 .PHONY: all all:: rocky-cloud-8.$(GARDEN_ARCH).qcow2 rocky-cloud-8.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/rocky/Rocky-8-GenericCloud-Base.latest.$(GARDEN_ARCH).qcow2 $(GARDEN_DL_DIR)/rocky/Rocky-8-GenericCloud-Base.latest.x86_64.qcow2 $(GARDEN_DL_DIR)/rocky/Rocky-8-GenericCloud-Base.latest.aarch64.qcow2: $(GARDEN_DL_DIR)/rocky/Rocky-8-GenericCloud-Base.latest.%.qcow2 : | $(GARDEN_DL_DIR)/rocky $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://dl.rockylinux.org/pub/rocky/8/images/$*/Rocky-8-GenericCloud-Base.latest.$*.qcow2) $(GARDEN_DL_DIR)/rocky/rocky-cloud-8.x86_64.qcow2: | $(GARDEN_DL_DIR)/rocky/ $(GARDEN_DL_DIR)/rocky/Rocky-8-GenericCloud-Base.latest.x86_64.qcow2 ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/rocky/rocky-cloud-8.aarch64.qcow2: | $(GARDEN_DL_DIR)/rocky/ $(GARDEN_DL_DIR)/rocky/Rocky-8-GenericCloud-Base.latest.aarch64.qcow2 ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/rocky/rocky-cloud-8.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/rocky/Rocky-8-GenericCloud-Base.latest.*.qcow2 image-garden-0.1.1/mk/050-rocky-9.mk000066400000000000000000000023171474470052300166010ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki ROCKY_RELEASES += 9 .PHONY: all all:: rocky-cloud-9.$(GARDEN_ARCH).qcow2 rocky-cloud-9.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/rocky/Rocky-9-GenericCloud-Base.latest.$(GARDEN_ARCH).qcow2 $(GARDEN_DL_DIR)/rocky/Rocky-9-GenericCloud-Base.latest.x86_64.qcow2 $(GARDEN_DL_DIR)/rocky/Rocky-9-GenericCloud-Base.latest.aarch64.qcow2: $(GARDEN_DL_DIR)/rocky/Rocky-9-GenericCloud-Base.latest.%.qcow2 : | $(GARDEN_DL_DIR)/rocky $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://dl.rockylinux.org/pub/rocky/9/images/$*/Rocky-9-GenericCloud-Base.latest.$*.qcow2) $(GARDEN_DL_DIR)/rocky/rocky-cloud-9.x86_64.qcow2: | $(GARDEN_DL_DIR)/rocky/ $(GARDEN_DL_DIR)/rocky/Rocky-9-GenericCloud-Base.latest.x86_64.qcow2 ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/rocky/rocky-cloud-9.aarch64.qcow2: | $(GARDEN_DL_DIR)/rocky/ $(GARDEN_DL_DIR)/rocky/Rocky-9-GenericCloud-Base.latest.aarch64.qcow2 ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/rocky/rocky-cloud-9.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/rocky/Rocky-9-GenericCloud-Base.latest.*.qcow2 image-garden-0.1.1/mk/050-rocky.mk000066400000000000000000000052731474470052300164370ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki ROCKY_RELEASES ?= GARDEN_SYSTEMS += $(foreach r,$(ROCKY_RELEASES),$(foreach a,x86_64 aarch64,rocky-cloud-$r.$a)) $(foreach R,$(ROCKY_RELEASES),rocky-cloud-$R.x86_64.run): rocky-cloud-%.x86_64.run: $(MAKEFILE_LIST) | rocky-cloud-%.x86_64.qcow2 rocky-cloud-%.x86_64.efi-code.img rocky-cloud-%.x86_64.efi-vars.img echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/rocky" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_X86_64_EFI_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ $(foreach R,$(ROCKY_RELEASES),rocky-cloud-$R.aarch64.run): rocky-cloud-%.aarch64.run: $(MAKEFILE_LIST) | rocky-cloud-%.aarch64.qcow2 rocky-cloud-%.aarch64.efi-code.img rocky-cloud-%.aarch64.efi-vars.img echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/rocky" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ $(foreach R,$(ROCKY_RELEASES),rocky-cloud-$R.x86_64.qcow2): rocky-cloud-%.x86_64.qcow2: $(GARDEN_DL_DIR)/rocky/rocky-cloud-%.x86_64.qcow2 rocky-cloud-%.seed.iso rocky-cloud-%.x86_64.efi-code.img rocky-cloud-%.x86_64.efi-vars.img $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_X86_64_EFI_CMDLINE,$@,$(word 3,$^),$(word 4,$^)) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) $(foreach R,$(ROCKY_RELEASES),rocky-cloud-$R.aarch64.qcow2): rocky-cloud-%.aarch64.qcow2: $(GARDEN_DL_DIR)/rocky/rocky-cloud-%.aarch64.qcow2 rocky-cloud-%.seed.iso rocky-cloud-%.aarch64.efi-code.img rocky-cloud-%.aarch64.efi-vars.img $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$@,$(word 3,$^),$(word 4,$^)) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) $(GARDEN_DL_DIR)/rocky: | $(GARDEN_DL_DIR) mkdir -p $@ rocky-cloud-%.meta-data: export META_DATA = $(call CLOUD_INIT_META_DATA_TEMPLATE,rocky-$*) rocky-cloud-%.meta-data: $(MAKEFILE_LIST) echo "$${META_DATA}" | tee $@ rocky-cloud-%.user-data: export USER_DATA = $(call $(call PICK_CLOUD_INIT_USER_DATA_TEMPLATE_FOR,ROCKY,$*),rocky-$*,rocky) rocky-cloud-%.user-data: $(MAKEFILE_LIST) $(wildcard .image-garden.mk) echo "$${USER_DATA}" | tee $@ .PHONY: clean clean:: rm -f $(foreach R,$(ROCKY_RELEASES),$(foreach A,x86_64 aarch64,rocky-cloud-$R.$A.qcow2 rocky-cloud-$R.$A.run)) image-garden-0.1.1/mk/050-ubuntu-14.04.mk000066400000000000000000000024321474470052300172700ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki UBUNTU_RELEASES += 14.04 # FIXME: https://gitlab.com/zygoon/image-garden/-/issues/3 # .PHONY: all # all:: ubuntu-cloud-14.04.$(GARDEN_ARCH).qcow2 ubuntu-cloud-14.04.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/ubuntu/trusty-server-cloudimg-$(call map_to_debian_arch,$(GARDEN_ARCH))-uefi1.img $(GARDEN_DL_DIR)/ubuntu/trusty-server-cloudimg-amd64-uefi1.img $(GARDEN_DL_DIR)/ubuntu/trusty-server-cloudimg-arm64-uefi1.img: $(GARDEN_DL_DIR)/ubuntu/trusty-server-cloudimg-%-uefi1.img: | $(GARDEN_DL_DIR)/ubuntu $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-$*-uefi1.img) $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-14.04.x86_64.qcow2: | $(GARDEN_DL_DIR)/ubuntu/ $(GARDEN_DL_DIR)/ubuntu/trusty-server-cloudimg-amd64-uefi1.img ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-14.04.aarch64.qcow2: | $(GARDEN_DL_DIR)/ubuntu/ $(GARDEN_DL_DIR)/ubuntu/trusty-server-cloudimg-arm64-uefi1.img ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-14.04.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/ubuntu/trusty-server-cloudimg-*-uefi1.img image-garden-0.1.1/mk/050-ubuntu-16.04.mk000066400000000000000000000023331474470052300172720ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki UBUNTU_RELEASES += 16.04 .PHONY: all all:: ubuntu-cloud-16.04.$(GARDEN_ARCH).qcow2 ubuntu-cloud-16.04.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/ubuntu/xenial-server-cloudimg-$(call map_to_debian_arch,$(GARDEN_ARCH))-uefi1.img $(GARDEN_DL_DIR)/ubuntu/xenial-server-cloudimg-amd64-uefi1.img $(GARDEN_DL_DIR)/ubuntu/xenial-server-cloudimg-arm64-uefi1.img: $(GARDEN_DL_DIR)/ubuntu/xenial-server-cloudimg-%-uefi1.img: | $(GARDEN_DL_DIR)/ubuntu $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-$*-uefi1.img) $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-16.04.x86_64.qcow2: | $(GARDEN_DL_DIR)/ubuntu/ $(GARDEN_DL_DIR)/ubuntu/xenial-server-cloudimg-amd64-uefi1.img ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-16.04.aarch64.qcow2: | $(GARDEN_DL_DIR)/ubuntu/ $(GARDEN_DL_DIR)/ubuntu/xenial-server-cloudimg-arm64-uefi1.img ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-16.04.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/ubuntu/xenial-server-cloudimg-*-uefi1.img image-garden-0.1.1/mk/050-ubuntu-18.04.mk000066400000000000000000000022531474470052300172750ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki UBUNTU_RELEASES += 18.04 .PHONY: all all:: ubuntu-cloud-18.04.$(GARDEN_ARCH).qcow2 ubuntu-cloud-18.04.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/ubuntu/bionic-server-cloudimg-$(call map_to_debian_arch,$(GARDEN_ARCH)).img $(GARDEN_DL_DIR)/ubuntu/bionic-server-cloudimg-amd64.img $(GARDEN_DL_DIR)/ubuntu/bionic-server-cloudimg-arm64.img: $(GARDEN_DL_DIR)/ubuntu/bionic-server-cloudimg-%.img: | $(GARDEN_DL_DIR)/ubuntu $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-$*.img) $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-18.04.x86_64.qcow2: | $(GARDEN_DL_DIR)/ubuntu/ $(GARDEN_DL_DIR)/ubuntu/bionic-server-cloudimg-amd64.img ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-18.04.aarch64.qcow2: | $(GARDEN_DL_DIR)/ubuntu/ $(GARDEN_DL_DIR)/ubuntu/bionic-server-cloudimg-arm64.img ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-18.04.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/ubuntu/bionic-server-cloudimg-*.img image-garden-0.1.1/mk/050-ubuntu-20.04.mk000066400000000000000000000022421474470052300172640ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki UBUNTU_RELEASES += 20.04 .PHONY: all all:: ubuntu-cloud-20.04.$(GARDEN_ARCH).qcow2 ubuntu-cloud-20.04.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/ubuntu/focal-server-cloudimg-$(call map_to_debian_arch,$(GARDEN_ARCH)).img $(GARDEN_DL_DIR)/ubuntu/focal-server-cloudimg-amd64.img $(GARDEN_DL_DIR)/ubuntu/focal-server-cloudimg-arm64.img: $(GARDEN_DL_DIR)/ubuntu/focal-server-cloudimg-%.img: | $(GARDEN_DL_DIR)/ubuntu $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-$*.img) $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-20.04.x86_64.qcow2: | $(GARDEN_DL_DIR)/ubuntu/ $(GARDEN_DL_DIR)/ubuntu/focal-server-cloudimg-amd64.img ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-20.04.aarch64.qcow2: | $(GARDEN_DL_DIR)/ubuntu/ $(GARDEN_DL_DIR)/ubuntu/focal-server-cloudimg-arm64.img ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-20.04.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/ubuntu/focal-server-cloudimg-*.img image-garden-0.1.1/mk/050-ubuntu-22.04.mk000066400000000000000000000022421474470052300172660ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki UBUNTU_RELEASES += 22.04 .PHONY: all all:: ubuntu-cloud-22.04.$(GARDEN_ARCH).qcow2 ubuntu-cloud-22.04.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/ubuntu/jammy-server-cloudimg-$(call map_to_debian_arch,$(GARDEN_ARCH)).img $(GARDEN_DL_DIR)/ubuntu/jammy-server-cloudimg-amd64.img $(GARDEN_DL_DIR)/ubuntu/jammy-server-cloudimg-arm64.img: $(GARDEN_DL_DIR)/ubuntu/jammy-server-cloudimg-%.img: | $(GARDEN_DL_DIR)/ubuntu $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-$*.img) $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-22.04.x86_64.qcow2: | $(GARDEN_DL_DIR)/ubuntu/ $(GARDEN_DL_DIR)/ubuntu/jammy-server-cloudimg-amd64.img ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-22.04.aarch64.qcow2: | $(GARDEN_DL_DIR)/ubuntu/ $(GARDEN_DL_DIR)/ubuntu/jammy-server-cloudimg-arm64.img ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-22.04.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/ubuntu/jammy-server-cloudimg-*.img image-garden-0.1.1/mk/050-ubuntu-24.04.mk000066400000000000000000000022421474470052300172700ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki UBUNTU_RELEASES += 24.04 .PHONY: all all:: ubuntu-cloud-24.04.$(GARDEN_ARCH).qcow2 ubuntu-cloud-24.04.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/ubuntu/noble-server-cloudimg-$(call map_to_debian_arch,$(GARDEN_ARCH)).img $(GARDEN_DL_DIR)/ubuntu/noble-server-cloudimg-amd64.img $(GARDEN_DL_DIR)/ubuntu/noble-server-cloudimg-arm64.img: $(GARDEN_DL_DIR)/ubuntu/noble-server-cloudimg-%.img: | $(GARDEN_DL_DIR)/ubuntu $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-$*.img) $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-24.04.x86_64.qcow2: | $(GARDEN_DL_DIR)/ubuntu/ $(GARDEN_DL_DIR)/ubuntu/noble-server-cloudimg-amd64.img ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-24.04.aarch64.qcow2: | $(GARDEN_DL_DIR)/ubuntu/ $(GARDEN_DL_DIR)/ubuntu/noble-server-cloudimg-arm64.img ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-24.04.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/ubuntu/noble-server-cloudimg-*.img image-garden-0.1.1/mk/050-ubuntu-24.10.mk000066400000000000000000000022751474470052300172730ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki UBUNTU_RELEASES += 24.10 .PHONY: all all:: ubuntu-cloud-24.10.$(GARDEN_ARCH).qcow2 ubuntu-cloud-24.10.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/ubuntu/oracular-server-cloudimg-$(call map_to_debian_arch,$(GARDEN_ARCH)).img $(GARDEN_DL_DIR)/ubuntu/oracular-server-cloudimg-amd64.img $(GARDEN_DL_DIR)/ubuntu/oracular-server-cloudimg-arm64.img: $(GARDEN_DL_DIR)/ubuntu/oracular-server-cloudimg-%.img: | $(GARDEN_DL_DIR)/ubuntu $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://cloud-images.ubuntu.com/oracular/current/oracular-server-cloudimg-$*.img) $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-24.10.x86_64.qcow2: | $(GARDEN_DL_DIR)/ubuntu/ $(GARDEN_DL_DIR)/ubuntu/oracular-server-cloudimg-amd64.img ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-24.10.aarch64.qcow2: | $(GARDEN_DL_DIR)/ubuntu/ $(GARDEN_DL_DIR)/ubuntu/oracular-server-cloudimg-arm64.img ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-24.10.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/ubuntu/oracular-server-cloudimg-*.img image-garden-0.1.1/mk/050-ubuntu-25.04.mk000066400000000000000000000022531474470052300172730ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki UBUNTU_RELEASES += 25.04 .PHONY: all all:: ubuntu-cloud-25.04.$(GARDEN_ARCH).qcow2 ubuntu-cloud-25.04.$(GARDEN_ARCH).run .PHONY: fetch fetch: $(GARDEN_DL_DIR)/ubuntu/plucky-server-cloudimg-$(call map_to_debian_arch,$(GARDEN_ARCH)).img $(GARDEN_DL_DIR)/ubuntu/plucky-server-cloudimg-amd64.img $(GARDEN_DL_DIR)/ubuntu/plucky-server-cloudimg-arm64.img: $(GARDEN_DL_DIR)/ubuntu/plucky-server-cloudimg-%.img: | $(GARDEN_DL_DIR)/ubuntu $(strip $(WGET) \ --no-clobber \ --directory-prefix=$(firstword $|)/ \ https://cloud-images.ubuntu.com/plucky/current/plucky-server-cloudimg-$*.img) $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-25.04.x86_64.qcow2: | $(GARDEN_DL_DIR)/ubuntu/ $(GARDEN_DL_DIR)/ubuntu/plucky-server-cloudimg-amd64.img ln -sf $(notdir $(word 2,$|)) $@ $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-25.04.aarch64.qcow2: | $(GARDEN_DL_DIR)/ubuntu/ $(GARDEN_DL_DIR)/ubuntu/plucky-server-cloudimg-arm64.img ln -sf $(notdir $(word 2,$|)) $@ .PHONY: clean clean:: rm -f $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-25.04.*.qcow2 .PHONY: distclean distclean:: rm -f $(GARDEN_DL_DIR)/ubuntu/plucky-server-cloudimg-*.img image-garden-0.1.1/mk/050-ubuntu.mk000066400000000000000000000060661474470052300166330ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki UBUNTU_RELEASES ?= GARDEN_SYSTEMS += $(foreach r,$(UBUNTU_RELEASES),$(foreach a,x86_64 aarch64,ubuntu-cloud-$r.$a)) $(foreach R,$(UBUNTU_RELEASES),ubuntu-cloud-$R.x86_64.run): ubuntu-cloud-%.x86_64.run: $(MAKEFILE_LIST) | ubuntu-cloud-%.x86_64.qcow2 ubuntu-cloud-%.x86_64.efi-code.img ubuntu-cloud-%.x86_64.efi-vars.img echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/ubuntu" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_X86_64_EFI_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ $(foreach R,$(UBUNTU_RELEASES),ubuntu-cloud-$R.aarch64.run): ubuntu-cloud-%.aarch64.run: $(MAKEFILE_LIST) | ubuntu-cloud-%.aarch64.qcow2 ubuntu-cloud-%.aarch64.efi-code.img ubuntu-cloud-%.aarch64.efi-vars.img echo "#!/bin/sh" >$@ echo 'set -xeu' >>$@ echo "# WARNING: The .qcow2 file refers to a file in $(GARDEN_DL_DIR)/ubuntu" >>$@ echo '$(strip exec $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$(word 1,$|),$(word 2,$|),$(word 3,$|)) "$$@")' >>$@ chmod +x $@ # Ubuntu cloud images do not contain a standalone installer that you only need # during the setup process. Instead each image can be used as a read-only base # for a read-write template. $(foreach R,$(UBUNTU_RELEASES),ubuntu-cloud-$R.x86_64.qcow2): ubuntu-cloud-%.x86_64.qcow2: $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-%.x86_64.qcow2 ubuntu-cloud-%.seed.iso ubuntu-cloud-%.x86_64.efi-code.img ubuntu-cloud-%.x86_64.efi-vars.img $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_X86_64_EFI_CMDLINE,$@,$(word 3,$^),$(word 4,$^)) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) # Replicated because we have more releases than architectures and architecture-specific quirks are easier to express. $(foreach R,$(UBUNTU_RELEASES),ubuntu-cloud-$R.aarch64.qcow2): ubuntu-cloud-%.aarch64.qcow2: $(GARDEN_DL_DIR)/ubuntu/ubuntu-cloud-%.aarch64.qcow2 ubuntu-cloud-%.seed.iso ubuntu-cloud-%.aarch64.efi-code.img ubuntu-cloud-%.aarch64.efi-vars.img $(strip $(QEMU_IMG) create -f qcow2 -b $< -F qcow2 $@ $(QEMU_IMG_SIZE)) $(strip $(call QEMU_SYSTEM_AARCH64_EFI_CMDLINE,$@,$(word 3,$^),$(word 4,$^)) \ -drive file=$(word 2,$^),format=raw,id=drive1,if=none,readonly=true,media=cdrom \ -device virtio-blk,drive=drive1 \ -no-reboot | tee $@.log) # Ubuntu specific downloads. $(GARDEN_DL_DIR)/ubuntu: | $(GARDEN_DL_DIR) mkdir -p $@ ubuntu-cloud-%.meta-data: export META_DATA = $(call CLOUD_INIT_META_DATA_TEMPLATE,ubuntu-$*) ubuntu-cloud-%.meta-data: $(MAKEFILE_LIST) echo "$${META_DATA}" | tee $@ ubuntu-cloud-%.user-data: export USER_DATA = $(call $(call PICK_CLOUD_INIT_USER_DATA_TEMPLATE_FOR,UBUNTU,$*),ubuntu-$*,ubuntu) ubuntu-cloud-%.user-data: $(MAKEFILE_LIST) $(wildcard .image-garden.mk) echo "$${USER_DATA}" | tee $@ .PHONY: clean clean:: rm -f $(foreach R,$(UBUNTU_RELEASES),$(foreach A,x86_64 aarch64,ubuntu-cloud-$R.$A.qcow2 ubuntu-cloud-$R.$A.run)) image-garden-0.1.1/mk/README.md000066400000000000000000000005341474470052300157270ustar00rootroot00000000000000 # The make directory This directory contains a number of makefiles that are all concatenated and installed as `image-garden.mk` to system include directory `/usr/local/include` or `/usr/include`. The `make` program searches that directory when importing files. image-garden-0.1.1/spread-demo/000077500000000000000000000000001474470052300162375ustar00rootroot00000000000000image-garden-0.1.1/spread-demo/.gitignore000066400000000000000000000002141474470052300202240ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki *.img *.iso *.lock *.log *.qcow2 *.run *.spread-reuse.yaml image-garden-0.1.1/spread-demo/.image-garden.mk000066400000000000000000000004241474470052300211660ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki # For compatibility with spread, pre-install sudo and bash, xz and GNU tar. define ALPINE_CLOUD_INIT_USER_DATA_TEMPLATE $(CLOUD_INIT_USER_DATA_TEMPLATE) packages: - bash - sudo - tar - xz endef image-garden-0.1.1/spread-demo/Makefile000066400000000000000000000002461474470052300177010ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki .PHONY: check: for x in $$(spread -list :tests/smoke/uname); do spread "$$x"; done image-garden-0.1.1/spread-demo/README.md000066400000000000000000000007111474470052300175150ustar00rootroot00000000000000 # Demonstration spread project This directory contains a demonstration full-system test setup using spread and image-garden to create, allocate and discarad systems. It can be used to model actually useful tests in other projects. Note that you must first install image-garden on your system. For more information about spread, see https://github.com/canonical/spread image-garden-0.1.1/spread-demo/spread.yaml000066400000000000000000000077351474470052300204150ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki project: demo backends: garden: type: adhoc allocate: QEMU_SMP_OPTION="-smp 1" QEMU_MEM_OPTION="-m 1024" exec image-garden allocate "$SPREAD_SYSTEM"."$(uname -m)" discard: image-garden discard "$SPREAD_SYSTEM_ADDRESS" systems: # Debian systems - debian-cloud-10: username: debian password: debian - debian-cloud-11: username: debian password: debian - debian-cloud-12: username: debian password: debian - debian-cloud-13: username: debian password: debian # Ubuntu systems - ubuntu-cloud-16.04: username: ubuntu password: ubuntu - ubuntu-cloud-18.04: username: ubuntu password: ubuntu - ubuntu-cloud-20.04: username: ubuntu password: ubuntu - ubuntu-cloud-22.04: username: ubuntu password: ubuntu - ubuntu-cloud-24.04: username: ubuntu password: ubuntu - ubuntu-cloud-24.10: username: ubuntu password: ubuntu - ubuntu-cloud-25.04: username: ubuntu password: ubuntu # Arch Linux system - archlinux-cloud: username: archlinux password: archlinux # Arch is only available on x86_64 so it is marked as manual. manual: true # Alma Linux systems - almalinux-cloud-8: username: almalinux password: almalinux - almalinux-cloud-9: username: almalinux password: almalinux # Alpine Linux system - alpine-cloud-3: username: alpine password: alpine # Oracle systems - oracle-cloud-8: username: oracle password: oracle - oracle-cloud-9: username: oracle password: oracle # Fedora systems - fedora-cloud-38: username: fedora password: fedora manual: true - fedora-cloud-39: username: fedora password: fedora manual: true - fedora-cloud-40: username: fedora password: fedora manual: true - fedora-cloud-41: username: fedora password: fedora workers: 2 # CentOS systems - centos-cloud-9: username: centos password: centos - centos-cloud-10: username: centos password: centos # Rocky Linux systems - rocky-cloud-8: username: rocky password: rocky - rocky-cloud-9: username: rocky password: rocky # openSUSE systems - opensuse-cloud-15.4: username: opensuse password: opensuse - opensuse-cloud-15.5: username: opensuse password: opensuse - opensuse-cloud-15.6: username: opensuse password: opensuse - opensuse-cloud-tumbleweed: username: opensuse password: opensuse path: /tmp/demo exclude: - .git - "*.qcow2" - "*.iso" - "*.img" - "*.log" - "*.run" - "*.pid" suites: tests/smoke/: summary: Smoke tests image-garden-0.1.1/spread-demo/tests/000077500000000000000000000000001474470052300174015ustar00rootroot00000000000000image-garden-0.1.1/spread-demo/tests/smoke/000077500000000000000000000000001474470052300205175ustar00rootroot00000000000000image-garden-0.1.1/spread-demo/tests/smoke/os-release/000077500000000000000000000000001474470052300225565ustar00rootroot00000000000000image-garden-0.1.1/spread-demo/tests/smoke/os-release/task.yaml000066400000000000000000000003171474470052300244050ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki summary: Look for /etc/os-release artifacts: - os-release execute: | test -f /etc/os-release cp /etc/os-release . image-garden-0.1.1/spread-demo/tests/smoke/uname/000077500000000000000000000000001474470052300216245ustar00rootroot00000000000000image-garden-0.1.1/spread-demo/tests/smoke/uname/task.yaml000066400000000000000000000002541474470052300234530ustar00rootroot00000000000000# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki summary: Just run uname artifacts: - uname.txt execute: | uname -a | tee uname.txt