blob: abe18fb588e8017dbc55f951d9403c501f25acff [file] [log] [blame]
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -08001conf = configuration_data()
2
3# DBus information
Patrick Williamsec807fc2025-02-03 14:13:00 -05004conf.set_quoted(
5 'BMC_INVENTORY_INTERFACE',
6 'xyz.openbmc_project.Inventory.Item.Bmc',
7)
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -08008conf.set_quoted('BUSNAME_UPDATER', 'xyz.openbmc_project.Software.BMC.Updater')
9conf.set_quoted('DOWNLOAD_BUSNAME', 'xyz.openbmc_project.Software.Download')
10conf.set_quoted('FILEPATH_IFACE', 'xyz.openbmc_project.Common.FilePath')
11conf.set_quoted('INVENTORY_PATH', '/xyz/openbmc_project/inventory/')
12conf.set_quoted('MAPPER_BUSNAME', 'xyz.openbmc_project.ObjectMapper')
13conf.set_quoted('MAPPER_INTERFACE', 'xyz.openbmc_project.ObjectMapper')
14conf.set_quoted('MAPPER_PATH', '/xyz/openbmc_project/object_mapper')
15conf.set_quoted('SOFTWARE_OBJPATH', '/xyz/openbmc_project/software')
16conf.set_quoted('SYSTEMD_BUSNAME', 'org.freedesktop.systemd1')
17conf.set_quoted('SYSTEMD_PATH', '/org/freedesktop/systemd1')
18conf.set_quoted('SYSTEMD_INTERFACE', 'org.freedesktop.systemd1.Manager')
19conf.set_quoted('VERSION_BUSNAME', 'xyz.openbmc_project.Software.Version')
20conf.set_quoted('VERSION_IFACE', 'xyz.openbmc_project.Software.Version')
Patrick Williamsec807fc2025-02-03 14:13:00 -050021conf.set_quoted(
22 'EXTENDED_VERSION_IFACE',
23 'xyz.openbmc_project.Software.ExtendedVersion',
24)
25conf.set_quoted(
26 'COMPATIBLE_IFACE',
27 'xyz.openbmc_project.Inventory.Decorator.Compatible',
28)
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -080029
30# Names of the forward and reverse associations
31conf.set_quoted('ACTIVATION_FWD_ASSOCIATION', 'inventory')
32conf.set_quoted('ACTIVATION_REV_ASSOCIATION', 'activation')
33conf.set_quoted('ACTIVE_FWD_ASSOCIATION', 'active')
34conf.set_quoted('ACTIVE_REV_ASSOCIATION', 'software_version')
35conf.set_quoted('FUNCTIONAL_FWD_ASSOCIATION', 'functional')
36conf.set_quoted('FUNCTIONAL_REV_ASSOCIATION', 'software_version')
37conf.set_quoted('UPDATEABLE_FWD_ASSOCIATION', 'updateable')
38conf.set_quoted('UPDATEABLE_REV_ASSOCIATION', 'software_version')
39
40# Filesystem files and directories
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'))
51conf.set('MMC_LAYOUT', get_option('bmc-layout').contains('mmc'))
52
53# Configurable features
54conf.set('HOST_BIOS_UPGRADE', get_option('host-bios-upgrade').allowed())
55conf.set('WANT_SIGNATURE_VERIFY', get_option('verify-signature').allowed())
Patrick Williamsec807fc2025-02-03 14:13:00 -050056conf.set(
57 'START_UPDATE_DBUS_INTEFACE',
58 get_option('software-update-dbus-interface').allowed(),
59)
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -080060
61# Configurable variables
62conf.set('ACTIVE_BMC_MAX_ALLOWED', get_option('active-bmc-max-allowed'))
63conf.set_quoted('HASH_FILE_NAME', get_option('hash-file-name'))
64conf.set_quoted('IMG_UPLOAD_DIR', get_option('img-upload-dir'))
65conf.set_quoted('MANIFEST_FILE_NAME', get_option('manifest-file-name'))
66conf.set_quoted('MEDIA_DIR', get_option('media-dir'))
67optional_array = get_option('optional-images')
68optional_images = ''
69foreach optiona_image : optional_array
70 optional_images = ' '.join([optional_images, optiona_image])
71endforeach
72conf.set_quoted('OPTIONAL_IMAGES', optional_images)
73conf.set_quoted('PUBLICKEY_FILE_NAME', get_option('publickey-file-name'))
74conf.set_quoted('SIGNATURE_FILE_EXT', get_option('signature-file-ext'))
75conf.set_quoted('SIGNED_IMAGE_CONF_PATH', get_option('signed-image-conf-path'))
76conf.set_quoted('SYNC_LIST_DIR_PATH', get_option('sync-list-dir-path'))
77conf.set_quoted('SYNC_LIST_FILE_NAME', get_option('sync-list-file-name'))
78conf.set_quoted('BMC_MSL', get_option('bmc-msl'))
79conf.set_quoted('REGEX_BMC_MSL', get_option('regex-bmc-msl'))
80
81if get_option('host-bios-upgrade').allowed()
82 conf.set_quoted('BIOS_OBJPATH', get_option('bios-object-path'))
83endif
84
85if get_option('bmc-static-dual-image').allowed()
Patrick Williamsec807fc2025-02-03 14:13:00 -050086 conf.set(
87 'BMC_STATIC_DUAL_IMAGE',
88 get_option('bmc-static-dual-image').allowed(),
89 )
90 conf.set_quoted('ALT_ROFS_DIR', get_option('alt-rofs-dir'))
91 conf.set_quoted('ALT_RWFS', get_option('alt-rwfs-dir'))
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -080092else
Patrick Williamsec807fc2025-02-03 14:13:00 -050093 conf.set_quoted('ALT_RWFS', '/media/alt/var/persist')
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -080094endif
95
96configure_file(output: 'config.h', configuration: conf)
97
98unit_files = [
99 'obmc-flash-bmc-setenv@.service.in',
100 'reboot-guard-disable.service.in',
101 'reboot-guard-enable.service.in',
102 'force-reboot.service.in',
103 'usr-local.mount.in',
104 'xyz.openbmc_project.Software.Download.service.in',
Patrick Williamsec807fc2025-02-03 14:13:00 -0500105 'xyz.openbmc_project.Software.Sync.service.in',
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800106]
107
Patrick Williamsec807fc2025-02-03 14:13:00 -0500108image_updater_sources = files('activation.cpp', 'images.cpp', 'item_updater.cpp', 'msl_verify.cpp', 'serialize.cpp', 'update_manager.cpp'
109, 'utils.cpp', 'version.cpp')
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800110
111if get_option('bmc-layout').contains('static')
112 image_updater_sources += files(
113 'static/flash.cpp',
Patrick Williamsec807fc2025-02-03 14:13:00 -0500114 'static/item_updater_helper.cpp',
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800115 )
116elif get_option('bmc-layout').contains('ubi')
117 image_updater_sources += files(
118 'ubi/flash.cpp',
Patrick Williamsec807fc2025-02-03 14:13:00 -0500119 'ubi/item_updater_helper.cpp',
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800120 )
121
122 unit_files += [
123 'ubi/obmc-flash-bmc-cleanup.service.in',
124 'ubi/obmc-flash-bmc-mirroruboot.service.in',
125 'ubi/obmc-flash-bmc-ubiremount.service.in',
126 'ubi/obmc-flash-bmc-ubiro@.service.in',
127 'ubi/obmc-flash-bmc-ubiro-remove@.service.in',
128 'ubi/obmc-flash-bmc-ubirw.service.in',
129 'ubi/obmc-flash-bmc-ubirw-remove.service.in',
Patrick Williamsec807fc2025-02-03 14:13:00 -0500130 'ubi/obmc-flash-bmc-updateubootvars@.service.in',
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800131 ]
132elif get_option('bmc-layout').contains('mmc')
133 image_updater_sources += files(
134 'mmc/flash.cpp',
Patrick Williamsec807fc2025-02-03 14:13:00 -0500135 'mmc/item_updater_helper.cpp',
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800136 )
137
138 unit_files += [
139 'mmc/obmc-flash-mmc@.service.in',
140 'mmc/obmc-flash-mmc-mount.service.in',
141 'mmc/obmc-flash-mmc-remove@.service.in',
142 'mmc/obmc-flash-mmc-setprimary@.service.in',
143 'mmc/obmc-flash-mmc-umount.service.in',
144 'mmc/obmc-flash-mmc-mirroruboot.service.in',
145 ]
146endif
147
148if get_option('host-bios-upgrade').allowed()
149 unit_files += 'obmc-flash-host-bios@.service.in'
150endif
151
152if get_option('bmc-static-dual-image').allowed()
153 unit_files += [
154 'static/obmc-flash-bmc-alt@.service.in',
155 'static/obmc-flash-bmc-static-mount-alt.service.in',
156 'static/obmc-flash-bmc-prepare-for-sync.service.in',
157 ]
158endif
159
160if get_option('sync-bmc-files').allowed()
161 executable(
162 'phosphor-sync-software-manager',
163 'sync_manager.cpp',
164 'sync_manager_main.cpp',
165 'sync_watch.cpp',
166 dependencies: deps,
Patrick Williamsec807fc2025-02-03 14:13:00 -0500167 install: true,
Patrick Williams089a4a32025-04-19 12:39:38 -0400168 install_dir: get_option('libexecdir') / 'phosphor-code-mgmt',
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800169 )
170
Patrick Williamsec807fc2025-02-03 14:13:00 -0500171 install_data('synclist', install_dir: get_option('sysconfdir'))
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800172
Patrick Williamsec807fc2025-02-03 14:13:00 -0500173 install_data(
174 'sync-once.sh',
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800175 install_mode: 'rwxr-xr-x',
Patrick Williamsec807fc2025-02-03 14:13:00 -0500176 install_dir: get_option('bindir'),
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800177 )
178endif
179
180if (get_option('verify-signature').allowed())
Patrick Williamsec807fc2025-02-03 14:13:00 -0500181 image_updater_sources += files('image_verify.cpp', 'openssl_alloc.cpp'
182 , 'utils.cpp')
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800183endif
184
185executable(
186 'phosphor-download-manager',
187 'download_manager.cpp',
188 'download_manager_main.cpp',
189 dependencies: deps,
Patrick Williamsec807fc2025-02-03 14:13:00 -0500190 install: true,
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800191)
192
Patrick Williamsec807fc2025-02-03 14:13:00 -0500193software_common_sources = files('software_utils.cpp')
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800194
195if get_option('software-update-dbus-interface').allowed()
196 executable(
197 'phosphor-software-manager',
198 'software_manager.cpp',
199 image_updater_sources,
200 software_common_sources,
201 dependencies: [deps, ssl],
Patrick Williamsec807fc2025-02-03 14:13:00 -0500202 install: true,
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800203 )
Patrick Williamsec807fc2025-02-03 14:13:00 -0500204 unit_files += ['xyz.openbmc_project.Software.Manager.service.in']
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800205else
Patrick Williamsec807fc2025-02-03 14:13:00 -0500206 unit_files += [
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800207 'xyz.openbmc_project.Software.BMC.Updater.service.in',
Patrick Williamsec807fc2025-02-03 14:13:00 -0500208 'xyz.openbmc_project.Software.Version.service.in',
209 ]
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800210endif
211
212executable(
213 'phosphor-image-updater',
214 image_updater_sources,
215 software_common_sources,
216 'item_updater_main.cpp',
217 dependencies: [deps, ssl, boost_dep],
Patrick Williamsec807fc2025-02-03 14:13:00 -0500218 install: true,
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800219)
220
221executable(
222 'phosphor-version-software-manager',
223 'image_manager.cpp',
224 'image_manager_main.cpp',
225 'version.cpp',
226 'watch.cpp',
227 software_common_sources,
228 dependencies: [deps, ssl],
Patrick Williamsec807fc2025-02-03 14:13:00 -0500229 install: true,
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800230)
231
Patrick Williamsec807fc2025-02-03 14:13:00 -0500232install_data(
233 'obmc-flash-bmc',
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800234 install_mode: 'rwxr-xr-x',
Patrick Williamsec807fc2025-02-03 14:13:00 -0500235 install_dir: get_option('bindir'),
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800236)
237
Patrick Williamsec807fc2025-02-03 14:13:00 -0500238install_data(
239 'detect-slot-aspeed',
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800240 install_mode: 'rwxr-xr-x',
Patrick Williamsec807fc2025-02-03 14:13:00 -0500241 install_dir: get_option('bindir'),
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800242)
243
Patrick Williamsec807fc2025-02-03 14:13:00 -0500244install_data(
245 'reset-cs0-aspeed',
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800246 install_mode: 'rwxr-xr-x',
Patrick Williamsec807fc2025-02-03 14:13:00 -0500247 install_dir: get_option('bindir'),
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800248)
249
Patrick Williamsec807fc2025-02-03 14:13:00 -0500250install_data('software.conf', install_dir: '/usr/lib/tmpfiles.d/')
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800251
252foreach u : unit_files
253 configure_file(
254 input: u,
255 output: '@BASENAME@',
256 configuration: conf,
257 install: true,
258 install_dir: systemd_system_unit_dir,
259 )
260endforeach
261
262# If test coverage of source files within the root directory are wanted,
263# need to define and build the tests from here
Patrick Williams726e1002025-01-30 17:47:20 -0500264if build_tests.allowed()
Patrick Williamsec807fc2025-02-03 14:13:00 -0500265 gtest = dependency(
266 'gtest',
267 main: true,
268 disabler: true,
269 required: build_tests,
270 )
271 include_srcs = declare_dependency(
272 sources: ['utils.cpp', 'image_verify.cpp', 'images.cpp', 'version.cpp'],
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800273 )
274
Patrick Williamsec807fc2025-02-03 14:13:00 -0500275 test(
276 'utest',
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800277 executable(
278 'utest',
279 './test/utest.cpp',
Patrick Williamsec807fc2025-02-03 14:13:00 -0500280 dependencies: [deps, gtest, include_srcs, ssl],
281 ),
282 )
Jagpal Singh Gillcab87e92025-01-02 16:33:46 -0800283endif
284
285if get_option('usb-code-update').allowed()
286 subdir('usb')
287endif
288
289if get_option('side-switch-on-boot').allowed()
290 subdir('side-switch')
291endif