diff --git a/setup b/setup index c691ad93..90604b66 100755 --- a/setup +++ b/setup @@ -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 @@ -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 @@ -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" } diff --git a/tools/qm-storage-settings b/tools/qm-storage-settings index 738e8b8a..0c1d75d4 100755 --- a/tools/qm-storage-settings +++ b/tools/qm-storage-settings @@ -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 @@ -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 @@ -38,7 +37,7 @@ exec_command() { fi # print the output of QM ROOTFS - echo $($COMMAND) + echo "$COMMAND" } setup_init() { @@ -46,10 +45,12 @@ setup_init() { # 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 + cp -p "${ROOTFS}"/usr/share/containers/storage.conf "${ROOTFS}"/etc/containers/storage.conf + else 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 @@ -59,7 +60,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 } @@ -146,4 +147,4 @@ EOF # main setup_init update_storage_conf -exit 0 +exit 0