From e76209e961b8576207bc30bdc48ffddc56fa5f0f Mon Sep 17 00:00:00 2001 From: vaibhav-dahiya Date: Thu, 29 Jul 2021 00:50:29 +0000 Subject: [PATCH 1/3] [sonic-buildimage] create and mount fwfiles directory on pmon for firmware upgrade support on PMON 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 e4dd02826e63..b5e1e08f3678 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -404,6 +404,9 @@ start() { -v /var/run/docker-syncd$DEV:/var/run/sswsyncd \ {%- endif %} {%- endif %} +{%- if docker_container_name == "pmon" %} + -v /usr/share/sonic/fwfiles:/usr/share/sonic/fwfiles: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 36bc0e121286..b08afb14fb04 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -50,6 +50,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_FWFILES="$FILESYSTEM_ROOT_USR_SHARE_SONIC/fwfiles" FILESYSTEM_ROOT_ETC="$FILESYSTEM_ROOT/etc" FILESYSTEM_ROOT_ETC_SONIC="$FILESYSTEM_ROOT_ETC/sonic" @@ -92,6 +93,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_FWFILES/ # 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 From a784e636d88a6d82185e622f335e8c3d05d278e1 Mon Sep 17 00:00:00 2001 From: vaibhav-dahiya Date: Fri, 30 Jul 2021 02:16:09 +0000 Subject: [PATCH 2/3] fix comments Signed-off-by: vaibhav-dahiya --- files/build_templates/docker_image_ctl.j2 | 2 +- files/build_templates/sonic_debian_extension.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index b5e1e08f3678..7a3ba77760a2 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -405,7 +405,7 @@ start() { {%- endif %} {%- endif %} {%- if docker_container_name == "pmon" %} - -v /usr/share/sonic/fwfiles:/usr/share/sonic/fwfiles:rw \ + -v /usr/share/sonic/firmware:/usr/share/sonic/firmware:rw \ {%- endif %} {%- if docker_container_name == "swss" %} -e ASIC_VENDOR=$ASIC_VENDOR \ diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index b08afb14fb04..691ecf3c4f9c 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -50,7 +50,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_FWFILES="$FILESYSTEM_ROOT_USR_SHARE_SONIC/fwfiles" +FILESYSTEM_ROOT_USR_SHARE_SONIC_FWFILES="$FILESYSTEM_ROOT_USR_SHARE_SONIC/firmware" FILESYSTEM_ROOT_ETC="$FILESYSTEM_ROOT/etc" FILESYSTEM_ROOT_ETC_SONIC="$FILESYSTEM_ROOT_ETC/sonic" From 3d2c980a92119d21359e74b5aa238a9d5438f6cc Mon Sep 17 00:00:00 2001 From: vaibhav-dahiya Date: Fri, 30 Jul 2021 02:20:03 +0000 Subject: [PATCH 3/3] fix macro Signed-off-by: vaibhav-dahiya --- files/build_templates/sonic_debian_extension.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 691ecf3c4f9c..e58cb9174e71 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -50,7 +50,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_FWFILES="$FILESYSTEM_ROOT_USR_SHARE_SONIC/firmware" +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" @@ -93,7 +93,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_FWFILES/ +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