Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add qm-is-ostree script installation and RPM packaging #614

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,4 @@ install: man all ## - Install QM files (including selinux)
install -D -m 644 qm_file_contexts ${DESTDIR}${DATADIR}/qm/file_contexts
install -D -m 644 containers.conf ${DESTDIR}${DATADIR}/qm/containers.conf
install -D -m 644 qm.container ${DESTDIR}${DATADIR}/containers/systemd/qm.container
install -D -m 755 tools/qm-is-ostree ${DESTDIR}${DATADIR}/qm/qm-is-ostree
2 changes: 2 additions & 0 deletions rpm/qm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ install -d %{buildroot}%{_sysconfdir}/qm/containers/containers.conf.d
# Execute the script to create seccomp rules after the package is installed
/usr/share/qm/create-seccomp-rules
/usr/share/qm/comment-tz-local # FIX-ME GH-issue: 367
/usr/share/qm/qm-is-ostree

%preun
if [ $1 = 0 ]; then
Expand Down Expand Up @@ -328,6 +329,7 @@ fi
%{_datadir}/qm/qm-rootfs
%{_datadir}/qm/qm-storage-settings
%{_datadir}/qm/comment-tz-local
%{_datadir}/qm/qm-is-ostree
%ghost %dir %{_datadir}/containers
%ghost %dir %{_datadir}/containers/systemd
%{_datadir}/containers/systemd/qm.container
Expand Down
34 changes: 34 additions & 0 deletions tools/qm-is-ostree
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

# Simple tool to check if the system is running under OSTree
# Determines if the system is using OSTree by checking for the
# existence of the directory /run/ostree
# Returns:
# 0 (success) if the directory path exists, indicating the system is
# running under OSTree.
# 1 (failure) if the directory does not exist, indicating the
# system is not running under OSTree

OSTREE_PATH="/run/ostree"

if [ -d "${OSTREE_PATH}" ] || command -v ostree >/dev/null 2>&1; then
dougsland marked this conversation as resolved.
Show resolved Hide resolved
echo "QM is running on an OSTree-based system."
exit 0
else
echo "QM is not running on an OSTree-based system."
exit 1
fi
Loading