Jan Kundrát | a2e48a8 | 2023-05-10 10:47:41 +0200 | [diff] [blame] | 1 | #!/bin/bash |
2 | |||||
3 | set -ex | ||||
4 | |||||
5 | URL=https://download.fedoraproject.org/pub/fedora/linux/releases/38/Cloud/x86_64/images/Fedora-Cloud-Base-38-1.6.x86_64.raw.xz | ||||
6 | UNCOMPRESSED_ORIGINAL=$(basename -s .xz ${URL}) | ||||
7 | IMAGE=f38.raw | ||||
8 | |||||
9 | if [[ ! -f ${UNCOMPRESSED_ORIGINAL} ]]; then | ||||
10 | wget ${URL} | ||||
11 | unxz $(basename ${URL}) | ||||
12 | fi | ||||
13 | |||||
14 | rm -f ${IMAGE} | ||||
Jan Kundrát | 7d61c67 | 2023-05-18 13:39:02 +0200 | [diff] [blame] | 15 | truncate -s +1G -r ${UNCOMPRESSED_ORIGINAL} ${IMAGE} |
Jan Kundrát | a2e48a8 | 2023-05-10 10:47:41 +0200 | [diff] [blame] | 16 | virt-resize --expand /dev/sda5 ${UNCOMPRESSED_ORIGINAL} ${IMAGE} |
17 | |||||
18 | cat > cloud-init-default-user.cfg <<EOF | ||||
19 | system_info: | ||||
20 | default_user: | ||||
21 | name: ci | ||||
22 | EOF | ||||
23 | |||||
24 | virt-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át | 7d61c67 | 2023-05-18 13:39:02 +0200 | [diff] [blame] | 32 | --run-command 'update-crypto-policies --set DEFAULT:FEDORA32' \ |
33 | --run-command 'git config --system protocol.file.allow always' |