mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-09 01:18:35 +03:00
prepare-root: Fix compilation with --with-static-compiler
Closes: https://github.com/ostreedev/ostree/issues/1845 Closes: #1846 Approved by: akiernan
This commit is contained in:
parent
586cc2deee
commit
304abee9eb
@ -45,7 +45,7 @@ if BUILDOPT_USE_STATIC_COMPILER
|
|||||||
ostree_boot_SCRIPTS = ostree-prepare-root
|
ostree_boot_SCRIPTS = ostree-prepare-root
|
||||||
|
|
||||||
ostree-prepare-root : $(ostree_prepare_root_SOURCES)
|
ostree-prepare-root : $(ostree_prepare_root_SOURCES)
|
||||||
$(STATIC_COMPILER) -o $@ -static $(top_srcdir)/src/switchroot/ostree-prepare-root.c $(ostree_prepare_root_CPPFLAGS) $(AM_CFLAGS) $(DEFAULT_INCLUDES)
|
$(STATIC_COMPILER) -o $@ -static $(top_srcdir)/src/switchroot/ostree-prepare-root.c $(ostree_prepare_root_CPPFLAGS) $(AM_CFLAGS) $(DEFAULT_INCLUDES) -DOSTREE_PREPARE_ROOT_STATIC=1
|
||||||
else
|
else
|
||||||
ostree_boot_PROGRAMS += ostree-prepare-root
|
ostree_boot_PROGRAMS += ostree-prepare-root
|
||||||
ostree_prepare_root_CFLAGS = $(AM_CFLAGS) -Isrc/switchroot
|
ostree_prepare_root_CFLAGS = $(AM_CFLAGS) -Isrc/switchroot
|
||||||
|
@ -47,7 +47,11 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBSYSTEMD
|
#if defined(HAVE_LIBSYSTEMD) && !defined(OSTREE_PREPARE_ROOT_STATIC)
|
||||||
|
#define USE_LIBSYSTEMD
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_LIBSYSTEMD
|
||||||
#include <systemd/sd-journal.h>
|
#include <systemd/sd-journal.h>
|
||||||
#define OSTREE_PREPARE_ROOT_DEPLOYMENT_MSG SD_ID128_MAKE(71,70,33,6a,73,ba,46,01,ba,d3,1a,f8,88,aa,0d,f7)
|
#define OSTREE_PREPARE_ROOT_DEPLOYMENT_MSG SD_ID128_MAKE(71,70,33,6a,73,ba,46,01,ba,d3,1a,f8,88,aa,0d,f7)
|
||||||
#endif
|
#endif
|
||||||
@ -79,7 +83,7 @@ resolve_deploy_path (const char * root_mountpoint)
|
|||||||
if (stat (deploy_path, &stbuf) < 0)
|
if (stat (deploy_path, &stbuf) < 0)
|
||||||
err (EXIT_FAILURE, "stat(%s) failed", deploy_path);
|
err (EXIT_FAILURE, "stat(%s) failed", deploy_path);
|
||||||
/* Quiet logs if there's no journal */
|
/* Quiet logs if there's no journal */
|
||||||
#ifdef HAVE_LIBSYSTEMD
|
#ifdef USE_LIBSYSTEMD
|
||||||
const char *resolved_path = deploy_path + strlen (root_mountpoint);
|
const char *resolved_path = deploy_path + strlen (root_mountpoint);
|
||||||
sd_journal_send ("MESSAGE=Resolved OSTree target to: %s", deploy_path,
|
sd_journal_send ("MESSAGE=Resolved OSTree target to: %s", deploy_path,
|
||||||
"MESSAGE_ID=" SD_ID128_FORMAT_STR,
|
"MESSAGE_ID=" SD_ID128_FORMAT_STR,
|
||||||
|
Loading…
Reference in New Issue
Block a user