blob: 0faf7d349ba4ab17a3cf5350355f580e809b20d6 [file] [log] [blame]
Adriana Kobylak0af80a42020-05-05 13:32:10 -05001project('phosphor-bmc-code-mgmt', 'cpp',
2 default_options: [
3 'warning_level=3',
4 'werror=true',
5 'cpp_std=c++17'
6 ],
7 license: 'Apache-2.0',
8 version: '1.0')
9
10conf = configuration_data()
11
12# DBus information
13conf.set_quoted('BMC_INVENTORY_INTERFACE', 'xyz.openbmc_project.Inventory.Item.Bmc')
14conf.set_quoted('BUSNAME_UPDATER', 'xyz.openbmc_project.Software.BMC.Updater')
15conf.set_quoted('DOWNLOAD_BUSNAME', 'xyz.openbmc_project.Software.Download')
16conf.set_quoted('FILEPATH_IFACE', 'xyz.openbmc_project.Common.FilePath')
17conf.set_quoted('INVENTORY_PATH', '/xyz/openbmc_project/inventory/')
18conf.set_quoted('MAPPER_BUSNAME', 'xyz.openbmc_project.ObjectMapper')
19conf.set_quoted('MAPPER_INTERFACE', 'xyz.openbmc_project.ObjectMapper')
20conf.set_quoted('MAPPER_PATH', '/xyz/openbmc_project/object_mapper')
21conf.set_quoted('SOFTWARE_OBJPATH', '/xyz/openbmc_project/software')
22conf.set_quoted('SYSTEMD_BUSNAME', 'org.freedesktop.systemd1')
23conf.set_quoted('SYSTEMD_PATH', '/org/freedesktop/systemd1')
24conf.set_quoted('SYSTEMD_INTERFACE', 'org.freedesktop.systemd1.Manager')
25conf.set_quoted('VERSION_BUSNAME', 'xyz.openbmc_project.Software.Version')
26conf.set_quoted('VERSION_IFACE', 'xyz.openbmc_project.Software.Version')
27
28# Names of the forward and reverse associations
29conf.set_quoted('ACTIVATION_FWD_ASSOCIATION', 'inventory')
30conf.set_quoted('ACTIVATION_REV_ASSOCIATION', 'activation')
31conf.set_quoted('ACTIVE_FWD_ASSOCIATION', 'active')
32conf.set_quoted('ACTIVE_REV_ASSOCIATION', 'software_version')
33conf.set_quoted('FUNCTIONAL_FWD_ASSOCIATION', 'functional')
34conf.set_quoted('FUNCTIONAL_REV_ASSOCIATION', 'software_version')
35conf.set_quoted('UPDATEABLE_FWD_ASSOCIATION', 'updateable')
36conf.set_quoted('UPDATEABLE_REV_ASSOCIATION', 'software_version')
37
38# Filesystem files and directories
39# The path of the alt rwfs overlay
40conf.set_quoted('ALT_RWFS', '/media/alt/var/persist')
41# The prefix path for the versioned read-only bmc partitions
42conf.set_quoted('BMC_ROFS_PREFIX', get_option('media-dir') + '/rofs-')
43# The name of the BMC table of contents file
44conf.set_quoted('OS_RELEASE_FILE', '/etc/os-release')
45# The dir where activation data is stored in files
46conf.set_quoted('PERSIST_DIR', '/var/lib/phosphor-bmc-code-mgmt/')
47
48# Supported BMC layout types
49conf.set('STATIC_LAYOUT', get_option('bmc-layout').contains('static'))
50conf.set('UBIFS_LAYOUT', get_option('bmc-layout').contains('ubi'))
51
52# Configurable features
53conf.set('HOST_BIOS_UPGRADE', get_option('host-bios-upgrade').enabled())
54conf.set('WANT_SIGNATURE_VERIFY', get_option('verify-signature').enabled())
55
56# Configurable variables
57conf.set('ACTIVE_BMC_MAX_ALLOWED', get_option('active-bmc-max-allowed'))
58conf.set_quoted('HASH_FILE_NAME', get_option('hash-file-name'))
59conf.set_quoted('IMG_UPLOAD_DIR', get_option('img-upload-dir'))
60conf.set_quoted('MANIFEST_FILE_NAME', get_option('manifest-file-name'))
61conf.set_quoted('MEDIA_DIR', get_option('media-dir'))
62conf.set_quoted('PUBLICKEY_FILE_NAME', get_option('publickey-file-name'))
63conf.set_quoted('SIGNATURE_FILE_EXT', get_option('signature-file-ext'))
64conf.set_quoted('SIGNED_IMAGE_CONF_PATH', get_option('signed-image-conf-path'))
65conf.set_quoted('SYNC_LIST_DIR_PATH', get_option('sync-list-dir-path'))
66conf.set_quoted('SYNC_LIST_FILE_NAME', get_option('sync-list-file-name'))
67
68configure_file(output: 'config.h', configuration: conf)
Adriana Kobylak113492e2020-05-05 13:45:45 -050069
Adriana Kobylake0aa7802020-05-05 13:54:49 -050070deps = [
71 dependency('phosphor-dbus-interfaces'),
72 dependency('phosphor-logging'),
73 dependency('sdbusplus')
74]
75
76ssl = dependency('openssl')
77
Adriana Kobylak113492e2020-05-05 13:45:45 -050078sdbuspp = find_program('sdbus++')
79subdir('xyz/openbmc_project/Software/Image')
Adriana Kobylake0aa7802020-05-05 13:54:49 -050080
81image_updater_sources = files(
82 'activation.cpp',
83 'item_updater.cpp',
84 'item_updater_main.cpp',
85 'serialize.cpp',
86 'version.cpp',
87 'utils.cpp'
88)
89
90if get_option('bmc-layout').contains('static')
91 subdir('static')
92endif
93if get_option('bmc-layout').contains('ubi')
94 subdir('ubi')
95endif
96
97if get_option('sync-bmc-files').enabled()
98 executable(
99 'phosphor-sync-software-manager',
100 'sync_manager.cpp',
101 'sync_manager_main.cpp',
102 'sync_watch.cpp',
103 dependencies: deps,
104 install: true
105 )
Adriana Kobylak817209f2020-05-07 09:52:03 -0500106
107 install_data('synclist',
108 install_dir: get_option('sysconfdir')
109 )
Adriana Kobylake0aa7802020-05-05 13:54:49 -0500110endif
111
112if get_option('verify-signature').enabled()
113 image_updater_sources += files(
114 'image_verify.cpp',
115 'openssl_alloc.cpp'
116 )
117endif
118
119executable(
120 'phosphor-download-manager',
121 'download_manager.cpp',
122 'download_manager_main.cpp',
123 dependencies: deps,
124 install: true
125)
126
127executable(
128 'phosphor-image-updater',
129 image_error_cpp,
130 image_error_hpp,
131 image_updater_sources,
132 dependencies: [deps, ssl],
133 install: true
134)
135
136executable(
137 'phosphor-version-software-manager',
138 image_error_cpp,
139 image_error_hpp,
140 'image_manager.cpp',
141 'image_manager_main.cpp',
142 'version.cpp',
143 'watch.cpp',
144 dependencies: [deps, ssl],
145 install: true
146)
Adriana Kobylak817209f2020-05-07 09:52:03 -0500147
148install_data('obmc-flash-bmc',
149 install_mode: 'rwxr-xr-x',
150 install_dir: get_option('bindir')
151)
152
153install_data('software.conf',
154 install_dir: '/usr/lib/tmpfiles.d/'
155)