From 526120305d7a1639529f108364412721f8d82ed4 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Thu, 12 Dec 2019 01:11:31 +0000 Subject: [PATCH 1/2] Change the dpkg default behavior in slave, and docker-base, in order to prevent prompt --- dockers/docker-base-stretch/dpkg_01_drop | 8 ++++++++ dockers/docker-base/dpkg_01_drop | 8 ++++++++ sonic-slave-stretch/Dockerfile.j2 | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/dockers/docker-base-stretch/dpkg_01_drop b/dockers/docker-base-stretch/dpkg_01_drop index e75ef3147158..d749943797d9 100644 --- a/dockers/docker-base-stretch/dpkg_01_drop +++ b/dockers/docker-base-stretch/dpkg_01_drop @@ -20,3 +20,11 @@ path-exclude /usr/share/pyshared/twisted/test* path-exclude /usr/lib/python*/dist-packages/twisted/test* path-exclude /usr/share/pyshared/twisted/*/test* path-exclude /usr/lib/python*/dist-packages/twisted/*/test* + +## install the configuration file if it’s currently missing +force-confmiss +## combined with confold: overwrite configuration files that you have not modified +force-confdef +## do not modify the current configuration file, the new version is installed with a .dpkg-dist suffix +force-confold + diff --git a/dockers/docker-base/dpkg_01_drop b/dockers/docker-base/dpkg_01_drop index e75ef3147158..d749943797d9 100644 --- a/dockers/docker-base/dpkg_01_drop +++ b/dockers/docker-base/dpkg_01_drop @@ -20,3 +20,11 @@ path-exclude /usr/share/pyshared/twisted/test* path-exclude /usr/lib/python*/dist-packages/twisted/test* path-exclude /usr/share/pyshared/twisted/*/test* path-exclude /usr/lib/python*/dist-packages/twisted/*/test* + +## install the configuration file if it’s currently missing +force-confmiss +## combined with confold: overwrite configuration files that you have not modified +force-confdef +## do not modify the current configuration file, the new version is installed with a .dpkg-dist suffix +force-confold + diff --git a/sonic-slave-stretch/Dockerfile.j2 b/sonic-slave-stretch/Dockerfile.j2 index f52bd943b0a7..72cd46fbb142 100644 --- a/sonic-slave-stretch/Dockerfile.j2 +++ b/sonic-slave-stretch/Dockerfile.j2 @@ -32,6 +32,14 @@ RUN echo "deb [arch=arm64] http://deb.debian.org/debian stretch main contrib non echo 'deb [arch=arm64] http://ftp.debian.org/debian stretch-backports main' >> /etc/apt/sources.list {%- endif %} +## Config dpkg +## install the configuration file if it’s currently missing +RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confmiss" +## combined with confold: overwrite configuration files that you have not modified +RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confdef" +## do not modify the current configuration file, the new version is installed with a .dpkg-dist suffix +RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confold" + ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive From 087cc33085f8ecdb9426c3ca28f3daacf2202d12 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Thu, 12 Dec 2019 01:52:43 +0000 Subject: [PATCH 2/2] Move to right place Signed-off-by: Qi Luo --- sonic-slave-stretch/Dockerfile.j2 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sonic-slave-stretch/Dockerfile.j2 b/sonic-slave-stretch/Dockerfile.j2 index 72cd46fbb142..133238622f76 100644 --- a/sonic-slave-stretch/Dockerfile.j2 +++ b/sonic-slave-stretch/Dockerfile.j2 @@ -32,14 +32,6 @@ RUN echo "deb [arch=arm64] http://deb.debian.org/debian stretch main contrib non echo 'deb [arch=arm64] http://ftp.debian.org/debian stretch-backports main' >> /etc/apt/sources.list {%- endif %} -## Config dpkg -## install the configuration file if it’s currently missing -RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confmiss" -## combined with confold: overwrite configuration files that you have not modified -RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confdef" -## do not modify the current configuration file, the new version is installed with a .dpkg-dist suffix -RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confold" - ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive @@ -301,6 +293,14 @@ RUN apt-get update && apt-get install -y \ # For kdump-tools liblzo2-dev +## Config dpkg +## install the configuration file if it’s currently missing +RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confmiss" +## combined with confold: overwrite configuration files that you have not modified +RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confdef" +## do not modify the current configuration file, the new version is installed with a .dpkg-dist suffix +RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confold" + # For smartmontools 6.6-1 RUN apt-get -t stretch-backports install -y debhelper