#!/bin/bash

set -e
set -x

# ---pretend-input-tty (with 3 dashes) is an undocumented feature of parted
parted /dev/xvda ---pretend-input-tty resizepart 1 yes 100%
resize2fs /dev/xvda1

chmod 755 /home/fedora

dnf -y -v update
dnf -y -v groupinstall "Development Tools" "C Development Tools and Libraries"
# systemd-container only available in newer versions of Fedora
dnf -y -v install systemd-container || true
dnf -y -v install java || true
dnf -y -v install iptables || true
dnf -y -v install systemd-devel || true
dnf -y -v install iptables intltool || true
dnf -y -v distro-sync
dnf -y -v install wget squashfs-tools patch glibc-static gnupg golang libacl-devel file openssl-devel bc
dnf -y -v builddep systemd

groupadd rkt || true
gpasswd -a fedora rkt || true
