dual-image: Add alt-rwfs-dir config
Add alt-rwfs-dir in meson config to specify the alt-rwfs dir, and set to
ALT_RWFS in config.h
Then sync-manager will sync files to expected directory for the
secondary flash.
Tested: Verify the /etc/hostname is synced to
/run/media/rwfs-alt/cow/etc/hostname when it is changed.
Note: the sync-manager only sync files when it's updated.
Ideally it should sync files once before the service starts to
make sure the files are always in sync.
Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I4aee549d339d17529d17e1ec2d9f100ec6b36f07
diff --git a/meson.build b/meson.build
index 51f0aba..f1d0792 100644
--- a/meson.build
+++ b/meson.build
@@ -52,8 +52,6 @@
conf.set_quoted('UPDATEABLE_REV_ASSOCIATION', 'software_version')
# Filesystem files and directories
-# The path of the alt rwfs overlay
-conf.set_quoted('ALT_RWFS', '/media/alt/var/persist')
# The prefix path for the versioned read-only bmc partitions
conf.set_quoted('BMC_ROFS_PREFIX', get_option('media-dir') + '/rofs-')
# The name of the BMC table of contents file
@@ -100,6 +98,9 @@
if get_option('bmc-static-dual-image').enabled()
conf.set('BMC_STATIC_DUAL_IMAGE', get_option('bmc-static-dual-image').enabled())
conf.set_quoted('ALT_ROFS_DIR', get_option('alt-rofs-dir'))
+ conf.set_quoted('ALT_RWFS', get_option('alt-rwfs-dir'))
+else
+ conf.set_quoted('ALT_RWFS', '/media/alt/var/persist')
endif
configure_file(output: 'config.h', configuration: conf)
diff --git a/meson_options.txt b/meson_options.txt
index 8144241..bdbec09 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -123,3 +123,9 @@
value: '/run/media/rofs-alt',
description: 'The base dir where all read-only partitions are mounted.',
)
+
+option(
+ 'alt-rwfs-dir', type: 'string',
+ value: '/run/media/rwfs-alt/cow',
+ description: 'The dir for alt-rwfs partition.',
+)