From 18614bfb5c1efcf2c6fcaa2cb065002b55f5dd69 Mon Sep 17 00:00:00 2001 From: Prince George Date: Fri, 29 Dec 2023 23:43:39 +0000 Subject: [PATCH 1/2] Update smartmontool version to v7.4 --- files/build_templates/sonic_debian_extension.j2 | 5 ++++- files/image_config/smartmontools/smartmontools | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 files/image_config/smartmontools/smartmontools diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 73564c03cd5b..81f1b51f5ad2 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -359,7 +359,10 @@ sudo chmod 755 $FILESYSTEM_ROOT/usr/bin/restart_service # Installed smartmontools version should match installed smartmontools in docker-platform-monitor Dockerfile # TODO: are mismatching versions fine for bookworm? -sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install smartmontools +echo "deb http://deb.debian.org/debian bookworm-backports main" | sudo tee -a $FILESYSTEM_ROOT/etc/apt/sources.list > /dev/null +sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get update +sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -t bookworm-backports smartmontools=7.4-2~bpo12+1 +sudo cp $IMAGE_CONFIGS/smartmontools/smartmontools $FILESYSTEM_ROOT/etc/default/smartmontools # Install custom-built openssh sshd sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/openssh-server_${OPENSSH_VERSION}_*.deb $debs_path/openssh-client_${OPENSSH_VERSION}_*.deb $debs_path/openssh-sftp-server_${OPENSSH_VERSION}_*.deb diff --git a/files/image_config/smartmontools/smartmontools b/files/image_config/smartmontools/smartmontools new file mode 100644 index 000000000000..443322992096 --- /dev/null +++ b/files/image_config/smartmontools/smartmontools @@ -0,0 +1,8 @@ +# Defaults for smartmontools initscript (/etc/init.d/smartmontools) +# This is a POSIX shell fragment + +# List of devices you want to explicitly enable S.M.A.R.T. for +# Not needed (and not recommended) if the device is monitored by smartd +#enable_smart="/dev/hda /dev/hdb" + +smartd_opts="-q nodev0" \ No newline at end of file From 0ac947b4767fe09f1dba921d0cd2dee47b5bd4e2 Mon Sep 17 00:00:00 2001 From: Prince George Date: Thu, 25 Jan 2024 18:39:33 +0000 Subject: [PATCH 2/2] Address review comments --- files/build_templates/sonic_debian_extension.j2 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 81f1b51f5ad2..fe3133980a03 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -359,9 +359,7 @@ sudo chmod 755 $FILESYSTEM_ROOT/usr/bin/restart_service # Installed smartmontools version should match installed smartmontools in docker-platform-monitor Dockerfile # TODO: are mismatching versions fine for bookworm? -echo "deb http://deb.debian.org/debian bookworm-backports main" | sudo tee -a $FILESYSTEM_ROOT/etc/apt/sources.list > /dev/null -sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get update -sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -t bookworm-backports smartmontools=7.4-2~bpo12+1 +sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -t bookworm-backports smartmontools sudo cp $IMAGE_CONFIGS/smartmontools/smartmontools $FILESYSTEM_ROOT/etc/default/smartmontools # Install custom-built openssh sshd