2013-12-22 04:41:30 +04:00
# Copyright (C) 2013 Colin Walters <walters@verbum.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
2014-01-29 23:37:44 +04:00
bin_PROGRAMS += rpm-ostree
2013-12-22 04:41:30 +04:00
2015-04-07 03:18:50 +03:00
rpm_ostree_SOURCES = src/app/main.c \
2015-04-28 04:22:58 +03:00
rpm-ostreed-generated.h \
rpm-ostreed-generated.c \
2015-04-07 03:18:50 +03:00
src/app/rpmostree-builtins.h \
src/app/rpmostree-db-builtins.h \
src/app/rpmostree-compose-builtins.h \
src/app/rpmostree-builtin-upgrade.c \
src/app/rpmostree-builtin-rollback.c \
2015-10-21 16:50:26 +03:00
src/app/rpmostree-builtin-deploy.c \
2016-08-06 16:07:56 +03:00
src/app/rpmostree-builtin-reload.c \
2015-04-07 03:18:50 +03:00
src/app/rpmostree-builtin-rebase.c \
2017-12-06 01:14:18 +03:00
src/app/rpmostree-builtin-cancel.c \
2019-02-23 21:46:59 +03:00
src/app/rpmostree-builtin-cliwrap.c \
2017-02-09 01:38:49 +03:00
src/app/rpmostree-builtin-cleanup.c \
2017-02-10 20:33:08 +03:00
src/app/rpmostree-builtin-initramfs.c \
Introduce `ex livefs`
There are a few different use cases here. First, for layering new packages,
there's no good reason for us to force a reboot. Second, we want some support
for cherry-picking security updates and allowing admins to restart services. Finally,
at some point we should offer support for entirely replacing the running tree
if that's what the user wants.
Until now we've been very conservative, but there's a spectrum here. In
particular, this patch changes things so we push a rollback before we start
doing anything live. I think in practice, many use cases would be totally fine
with doing most changes live, and falling back to the rollback if something went
wrong.
This initial code drop *only* supports live layering of new packages. However,
a lot of the base infrastructure is laid for future work.
For now, this will be classified as an experimental feature, hence `ex livefs`.
Part of: https://github.com/projectatomic/rpm-ostree/issues/639
Closes: #652
Approved by: jlebon
2017-03-01 01:16:48 +03:00
src/app/rpmostree-builtin-livefs.c \
2018-02-06 22:44:48 +03:00
src/app/rpmostree-builtin-usroverlay.c \
2017-06-05 19:37:56 +03:00
src/app/rpmostree-builtin-override.c \
2017-10-04 18:20:16 +03:00
src/app/rpmostree-builtin-refresh-md.c \
2018-06-26 17:30:32 +03:00
src/app/rpmostree-builtin-reset.c \
2016-06-23 04:14:27 +03:00
src/app/rpmostree-pkg-builtins.c \
2015-04-07 03:18:50 +03:00
src/app/rpmostree-builtin-status.c \
2017-03-16 04:05:14 +03:00
src/app/rpmostree-builtin-ex.c \
2019-09-25 14:52:44 +03:00
src/app/rpmostree-builtin-coreos-rootfs.c \
2019-12-13 20:19:56 +03:00
src/app/rpmostree-builtin-testutils.c \
2016-01-26 22:40:51 +03:00
src/app/rpmostree-builtin-container.c \
2018-02-27 23:16:28 +03:00
src/app/rpmostree-ex-builtin-commit2rojig.c \
2018-02-27 23:23:59 +03:00
src/app/rpmostree-ex-builtin-rojig2commit.c \
2015-04-07 03:18:50 +03:00
src/app/rpmostree-builtin-db.c \
2017-02-10 20:33:08 +03:00
src/app/rpmostree-builtin-start-daemon.c \
2019-04-19 00:27:09 +03:00
src/app/rpmostree-builtin-finalize-deployment.c \
2015-04-07 03:18:50 +03:00
src/app/rpmostree-db-builtin-diff.c \
src/app/rpmostree-db-builtin-list.c \
src/app/rpmostree-db-builtin-version.c \
2015-06-13 03:19:16 +03:00
src/app/rpmostree-dbus-helpers.c \
src/app/rpmostree-dbus-helpers.h \
2016-01-26 22:40:51 +03:00
src/app/rpmostree-container-builtins.h \
src/app/rpmostree-container-builtins.c \
2017-06-05 19:37:56 +03:00
src/app/rpmostree-override-builtins.h \
src/app/rpmostree-override-builtins.c \
2015-04-19 16:36:53 +03:00
src/app/rpmostree-libbuiltin.c \
src/app/rpmostree-libbuiltin.h \
2017-07-25 19:59:56 +03:00
src/app/rpmostree-polkit-agent.c \
src/app/rpmostree-polkit-agent.h \
2017-09-25 19:05:24 +03:00
src/app/rpmostree-builtin-kargs.c \
2015-04-07 03:18:50 +03:00
src/app/rpmostree-compose-builtin-tree.c \
2018-09-18 15:48:38 +03:00
src/app/rpmostree-compose-builtin-rojig.c \
2018-09-19 16:48:04 +03:00
src/app/rpmostree-composeutil.c \
src/app/rpmostree-composeutil.h \
2015-04-07 03:18:50 +03:00
src/app/rpmostree-builtin-compose.c \
2014-01-29 23:37:44 +04:00
$(NULL)
2014-09-17 05:45:30 +04:00
2016-05-27 21:46:46 +03:00
rpm_ostree_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/app -I$(srcdir)/src/daemon \
-I$(srcdir)/src/lib -I$(srcdir)/src/libpriv -I$(libglnx_srcpath) \
2018-03-28 17:08:16 +03:00
-fvisibility=hidden -DPKGLIBDIR=\"$(pkglibdir)\" $(PKGDEP_RPMOSTREE_CFLAGS)
2016-05-27 21:46:46 +03:00
rpm_ostree_LDADD = $(PKGDEP_RPMOSTREE_LIBS) librpmostreepriv.la librpmostree-1.la librpmostreed.la
2014-01-16 16:26:54 +04:00
2013-12-22 04:41:30 +04:00
privdatadir=$(pkglibdir)
2016-06-15 23:30:11 +03:00
privdata_DATA = src/app/rpm-ostree-0-integration.conf
2016-10-19 21:24:40 +03:00
2018-09-26 17:23:48 +03:00
# Propagate automake verbose mode
cargo_build = $(cargo) build $(if $(subst 0,,$(V)),--verbose,)
2018-09-22 01:02:18 +03:00
if !HAVE_PREBUILT_CBINDGEN
if !HAVE_EXTERNAL_CBINDGEN
rpmostree-bindgen: bindgen/Cargo.toml bindgen/src/main.rs
cd $(top_srcdir)/bindgen && \
export CARGO_TARGET_DIR=@abs_top_builddir@/bindgen-target && \
2018-11-15 19:33:54 +03:00
if test -d "$${CARGO_TARGET_DIR}" && [ "$$(stat -c '%u' $${CARGO_TARGET_DIR})" != "$$(id -u)" ]; then echo "mismatched uids on build"; exit 1; fi && \
2018-09-26 17:23:48 +03:00
$(cargo_build) && \
2018-09-22 01:02:18 +03:00
ln -sf $${CARGO_TARGET_DIR}/debug/rpmostree-bindgen $(abs_top_builddir)/rpmostree-bindgen
endif
endif
2018-11-15 19:43:08 +03:00
GITIGNOREFILES += bindgen-target/ rpmostree-bindgen
2018-09-22 01:02:18 +03:00
2018-07-04 21:50:40 +03:00
librpmostree_rust_path = @abs_top_builddir@/target/@RUST_TARGET_SUBDIR@/librpmostree_rust.a
2018-10-12 20:40:56 +03:00
# If the target directory exists, and isn't owned by our uid, then
# we exit with a fatal error, since someone probably did `make && sudo make install`,
# and in this case cargo will download into ~/.root which we don't want.
2019-02-23 21:46:59 +03:00
LIBRPMOSTREE_RUST_SRCS = $(shell find rust/src/ -name '*.rs') rust/cbindgen.toml
2018-07-04 21:50:40 +03:00
$(librpmostree_rust_path): Makefile $(LIBRPMOSTREE_RUST_SRCS)
2018-05-31 23:31:22 +03:00
cd $(top_srcdir)/rust && \
2018-07-04 22:13:25 +03:00
export CARGO_TARGET_DIR=@abs_top_builddir@/target && \
2018-09-16 23:32:47 +03:00
target_subdir=@abs_top_builddir@/target/@RUST_TARGET_SUBDIR@; \
2018-10-12 20:40:56 +03:00
if test -d "$${target_subdir}" && [ "$$(stat -c '%u' $${target_subdir})" != "$$(id -u)" ]; then echo "mismatched uids on build"; exit 1; fi && \
$(cargo_build) $(CARGO_RELEASE_ARGS)
2018-07-04 21:50:40 +03:00
EXTRA_DIST += $(LIBRPMOSTREE_RUST_SRCS) rust/Cargo.lock
2018-05-31 23:31:22 +03:00
2018-09-22 01:02:18 +03:00
# Generate bindings from Rust to C
if !HAVE_PREBUILT_CBINDGEN
if HAVE_EXTERNAL_CBINDGEN
2018-11-05 21:04:45 +03:00
rpmostree-rust.h:
2018-09-22 01:02:18 +03:00
$(AM_V_GEN) cbindgen -c rust/cbindgen.toml -o $@ $(top_srcdir)/rust
else
2018-11-05 21:04:45 +03:00
rpmostree-rust.h: rpmostree-bindgen
2018-09-22 01:02:18 +03:00
$(AM_V_GEN) ./rpmostree-bindgen $(top_srcdir)/rust
endif
2018-08-24 17:42:31 +03:00
BUILT_SOURCES += rpmostree-rust.h
2018-09-22 01:02:18 +03:00
endif
2018-08-24 17:42:31 +03:00
rpm_ostree_CFLAGS += $(PKGDEP_RPMOSTREE_RS_CFLAGS)
2018-08-18 00:34:02 +03:00
rpm_ostree_LDADD += $(librpmostree_rust_path) $(PKGDEP_RPMOSTREE_RS_LIBS)
2018-09-26 17:43:18 +03:00
# Wraps `cargo test`. This is always a debug non-release build;
# the main thing here is we still drop the `target` dir in our build
# directory, since we nominally support srcdir != builddir.
rust-test:
cd $(top_srcdir)/rust && CARGO_TARGET_DIR=@abs_top_builddir@/target cargo test
.PHONY: rust-test