blob: ead3efd6437a2bbeddff89e37f7fe2cb8bd54f97 [file] [log] [blame]
Jan Kundráta2e48a82023-05-10 10:47:41 +02001#!/bin/bash
2
3set -ex
4
5URL=https://download.fedoraproject.org/pub/fedora/linux/releases/38/Cloud/x86_64/images/Fedora-Cloud-Base-38-1.6.x86_64.raw.xz
6UNCOMPRESSED_ORIGINAL=$(basename -s .xz ${URL})
7IMAGE=f38.raw
8
9if [[ ! -f ${UNCOMPRESSED_ORIGINAL} ]]; then
10 wget ${URL}
11 unxz $(basename ${URL})
12fi
13
14rm -f ${IMAGE}
Jan Kundrát7d61c672023-05-18 13:39:02 +020015truncate -s +1G -r ${UNCOMPRESSED_ORIGINAL} ${IMAGE}
Jan Kundráta2e48a82023-05-10 10:47:41 +020016virt-resize --expand /dev/sda5 ${UNCOMPRESSED_ORIGINAL} ${IMAGE}
17
18cat > cloud-init-default-user.cfg <<EOF
19system_info:
20 default_user:
21 name: ci
22EOF
23
24virt-customize -a ${IMAGE} \
25 --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 \
26 --edit '/etc/sysconfig/selinux:s/SELINUX=.*/SELINUX=disabled/' \
27 --selinux-relabel \
28 --root-password disabled \
29 --copy-in $(pwd)/cloud-init-default-user.cfg:/etc/cloud/cloud.cfg.d/ \
30 --run-command 'dnf debuginfo-install -y glibc libgcc gcc libstdc++' \
31 --run-command 'systemctl enable cloud-init' \
Jan Kundrát7d61c672023-05-18 13:39:02 +020032 --run-command 'update-crypto-policies --set DEFAULT:FEDORA32' \
33 --run-command 'git config --system protocol.file.allow always'