From 5e594043cec3760ea3347a4b84929c63f69143ed Mon Sep 17 00:00:00 2001 From: vdahiya12 <67608553+vdahiya12@users.noreply.github.com> Date: Tue, 3 Aug 2021 09:39:39 -0700 Subject: [PATCH] [pmon] create and mount firmware directory on PMON for firmware upgrade support on muxcable (#8283) This PR creates a directory firmware on the HOST with the path /usr/share/sonic/firmware, as well as this is mounted on PMON container with the same path /usr/share/sonic/firmware. This is required for firmware upgrade support for muxcable as currently by design all Y-Cable API's are called by xcvrd. As such if CLI has to transfer a file to PMON we need to mount a directory from host to PMON just for getting the firmware files. Hence we require this change. Signed-off-by: vaibhav-dahiya --- files/build_templates/docker_image_ctl.j2 | 3 +++ files/build_templates/sonic_debian_extension.j2 | 2 ++ 2 files changed, 5 insertions(+) diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 109e431f8e73..0a03ca3bcb0d 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -374,6 +374,9 @@ start() { -v /var/run/docker-syncd$DEV:/var/run/sswsyncd \ {%- endif %} {%- endif %} +{%- if docker_container_name == "pmon" %} + -v /usr/share/sonic/firmware:/usr/share/sonic/firmware:rw \ +{%- endif %} {%- if docker_container_name == "swss" %} -e ASIC_VENDOR=$ASIC_VENDOR \ {%- endif -%} diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 1bc1471da1e2..018dd1fe2aea 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -45,6 +45,7 @@ FILESYSTEM_ROOT_USR_SHARE="$FILESYSTEM_ROOT_USR/share" FILESYSTEM_ROOT_USR_SHARE_SONIC="$FILESYSTEM_ROOT_USR_SHARE/sonic" FILESYSTEM_ROOT_USR_SHARE_SONIC_SCRIPTS="$FILESYSTEM_ROOT_USR_SHARE_SONIC/scripts" FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES="$FILESYSTEM_ROOT_USR_SHARE_SONIC/templates" +FILESYSTEM_ROOT_USR_SHARE_SONIC_FIRMWARE="$FILESYSTEM_ROOT_USR_SHARE_SONIC/firmware" FILESYSTEM_ROOT_ETC="$FILESYSTEM_ROOT/etc" FILESYSTEM_ROOT_ETC_SONIC="$FILESYSTEM_ROOT_ETC/sonic" @@ -85,6 +86,7 @@ sudo mkdir -p $FILESYSTEM_ROOT/etc/sonic/ sudo mkdir -p $FILESYSTEM_ROOT/etc/modprobe.d/ sudo mkdir -p $FILESYSTEM_ROOT/var/cache/sonic/ sudo mkdir -p $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ +sudo mkdir -p $FILESYSTEM_ROOT_USR_SHARE_SONIC_FIRMWARE/ # This is needed for Stretch and might not be needed for Buster where Linux create this directory by default. # Keeping it generic. It should not harm anyways. sudo mkdir -p $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM