Skip to content

Commit

Permalink
Fix setup script
Browse files Browse the repository at this point in the history
Also remove gh cli,
it's repo retuns 443 lately

Signed-off-by: Yariv Rachmani <[email protected]>
  • Loading branch information
Yarboa committed May 26, 2024
1 parent d5a4668 commit a21bee0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
6 changes: 3 additions & 3 deletions setup
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ QM_ROOTFS_TOOL="${INSTALLDIR}/qm-rootfs"
ROOTFS="/usr/lib/qm/rootfs"
RWETCFS="/etc/qm"
RWVARFS="/var/qm"
TMP_QM_IMG_DIR="tmp.images"
AGENT_HOSTNAME="$(hostname)"
AGENTCONF="/etc/bluechi/agent.conf.d/agent.conf"
QM_CONTAINER_IDS=1000000000:1500000000
Expand Down Expand Up @@ -150,8 +149,8 @@ install() {
cmd_dnf_install="dnf -y install --releasever=${VERSION_ID} --installroot ${ROOTFS} ${PACKAGES_TO_INSTALL}"
${cmd_dnf_install}

if dnf --installroot "${ROOTFS}" list installed "${PACKAGE_TO_REMOVE}" > /dev/null 2>&1; then
dnf --installroot ${ROOTFS} remove ${PACKAGES_TO_REMOVE} -y
if dnf --installroot "${ROOTFS}" list installed "${PACKAGES_TO_REMOVE}" > /dev/null 2>&1; then
dnf --installroot "${ROOTFS}" remove "${PACKAGES_TO_REMOVE}" -y
fi

# check if "${ROOTFS}"/etc/yum.repos.d
Expand Down Expand Up @@ -186,6 +185,7 @@ EOF
/etc/systemd/system/multi-user.target.wants/bluechi-agent.service
fi

bash -x "${INSTALLDIR}/qm-storage-settings"
restorecon -R "${ROOTFS}"
umount "${ROOTFS}/var" "${ROOTFS}/etc"
}
Expand Down
2 changes: 0 additions & 2 deletions tests/e2e/lib/ContainerFile.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ RUN dnf install -y \
epel-release

RUN dnf config-manager -y --set-enabled crb
RUN dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo

RUN dnf install -y \
clang-tools-extra \
Expand All @@ -16,7 +15,6 @@ RUN dnf install -y \
gcc \
dbus-devel \
g++ \
gh \
go-toolset \
fpaste \
lcov \
Expand Down
13 changes: 6 additions & 7 deletions tools/qm-storage-settings
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

# Global vars
TMP_QM_IMG_DIR="tmp.images"
QM_ROOTFS_TOOL="/usr/share/qm/qm-rootfs"
STORAGE_CONFIG=""

# exec_command will try to find the command before execute, it will try first in a regular
Expand All @@ -28,7 +27,7 @@ exec_command() {
COMMAND="/run/osbuild/tree$1"
if [ -f "${COMMAND}" ]; then
# FIXME: support this in qm-rootfs and remove this if condition
# it's a deploy/install moment in ostree
# it's a deploy/install moment in ostree
echo "/run/osbuild/tree/usr/lib/qm/rootfs"
return
else
Expand All @@ -38,18 +37,18 @@ exec_command() {
fi

# print the output of QM ROOTFS
echo $($COMMAND)
$COMMAND
}

setup_init() {
ROOTFS=$(exec_command "/usr/share/qm/qm-rootfs")

# containers/storage.conf
STORAGE_CONFIG="${ROOTFS}/etc/containers/storage.conf"
if [ ! -f "${STORAGE_CONFIG}" ]; then # no path, let's try ostree approach
if [ -d /run/osbiuild/ostree ]; then # osbuild exist, let's try ostree approach
STORAGE_CONFIG="/run/osbuild/tree/${STORAGE_CONFIG}"
if [ ! -f "${STORAGE_CONFIG}" ]; then
echo "Exiting /etc/containers/storage.conf in the ROOTFS"
echo "Exiting /etc/containers/storage.conf in the ROOTFS"
exit 255
fi
fi
Expand All @@ -59,7 +58,7 @@ additional_images_storages() {
if ! grep -q "/var/lib/shared" "${STORAGE_CONFIG}"; then
awk -i inplace '
BEGIN {
# Initialize insideBlock to 0 to track when we are inside the 'additionalimagestores' block
# Initialize insideBlock to 0 to track when we are inside the "additionalimagestores" block
insideBlock = 0
}
Expand Down Expand Up @@ -146,4 +145,4 @@ EOF
# main
setup_init
update_storage_conf
exit 0
exit 0

0 comments on commit a21bee0

Please sign in to comment.