neil / rpms / anaconda

Forked from rpms/anaconda a year ago
Clone
Michel Alexandre Salim 1a1252
#!/bin/sh -eux
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
# Prepare test work directory
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
WORK_DIR=$(mktemp -d /var/tmp/dirinstall.XXXXXX)
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
# Create kickstart
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
KICKSTART_PATH=${WORK_DIR}/ks.cfg
Michel Alexandre Salim 1a1252
source ./repositories
Michel Alexandre Salim 1a1252
TEST_KICKSTART=./ks.dirinstall.cfg
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
# Dump URLs of installation repositories found in local repositories whose names are configured in 'repositories' file
Michel Alexandre Salim 1a1252
echo "url --url=$(dnf repoinfo $BASE_REPO | grep ^Repo-baseurl | cut -d: -f2- | sed 's/^ *//')" > ${KICKSTART_PATH}
Michel Alexandre Salim 1a1252
for repo in $REPOS; do
Michel Alexandre Salim 1a1252
    echo "repo --name=$repo --baseurl=$(dnf repoinfo $repo | grep ^Repo-baseurl | cut -d: -f2- | sed 's/^ *//')" >> ${KICKSTART_PATH}
Michel Alexandre Salim 1a1252
done
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
cat ${TEST_KICKSTART} >> ${KICKSTART_PATH}
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
# Log the kickstart
Michel Alexandre Salim 1a1252
cat ${KICKSTART_PATH}
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
# Run dirinstall
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
INSTALL_DIR=${WORK_DIR}/install_dir
Michel Alexandre Salim 1a1252
mkdir ${INSTALL_DIR}
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
anaconda --dirinstall ${INSTALL_DIR} --kickstart ${KICKSTART_PATH} --${ANACONDA_UI_MODE} --noninteractive 2>&1
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
# Remove test work directory
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
rm -rf ${WORK_DIR}
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
# Show and remove the logs for this anaconda run
Michel Alexandre Salim 1a1252
Michel Alexandre Salim 1a1252
./show_logs.sh