| URL=https://download.fedoraproject.org/pub/fedora/linux/releases/38/Cloud/x86_64/images/Fedora-Cloud-Base-38-1.6.x86_64.raw.xz |
| UNCOMPRESSED_ORIGINAL=$(basename -s .xz ${URL}) |
| if [[ ! -f ${UNCOMPRESSED_ORIGINAL} ]]; then |
| truncate -s +1G -r ${UNCOMPRESSED_ORIGINAL} ${IMAGE} |
| virt-resize --expand /dev/sda5 ${UNCOMPRESSED_ORIGINAL} ${IMAGE} |
| cat > cloud-init-default-user.cfg <<EOF |
| virt-customize -a ${IMAGE} \ |
| --install cloud-init,qemu-guest-agent,cloud-utils-growpart,bash,coreutils,procps-ng,systemd,sudo,dnf,rsync,python3-libselinux,openssh-server,hostname,iproute,jq,cmake,git,gcc-c++,make,ninja-build,tree,flex,bison,pcre-devel,libev-devel,libcmocka-devel,libssh-devel,openssl-devel,systemd-devel,gdb,strace,swig,c-ares-devel,autoconf,automake,libtool,libasan,liblsan,libtsan,libubsan,clang,libcxx-devel,libcxx-static,clang-analyzer,git-clang-format,llvm,doxygen,patch,wget,bzip2,bc,unzip,zip,perl-ExtUtils-MakeMaker,python3-devel,python3-pytest,gcovr,lcov,zstd,expat-devel,clang-tools-extra,spdlog-devel,boost-devel,python3-pybind11,npm,hugo,pcre2-devel,pam-devel,openssl-perl,json-devel,libnl3-devel,libxml2-devel,date-devel,libdate-tz \ |
| --edit '/etc/sysconfig/selinux:s/SELINUX=.*/SELINUX=disabled/' \ |
| --root-password disabled \ |
| --copy-in $(pwd)/cloud-init-default-user.cfg:/etc/cloud/cloud.cfg.d/ \ |
| --run-command 'dnf debuginfo-install -y glibc libgcc gcc libstdc++' \ |
| --run-command 'systemctl enable cloud-init' \ |
| --run-command 'update-crypto-policies --set DEFAULT:FEDORA32' \ |
| --run-command 'git config --system protocol.file.allow always' |