Skip to content

Commit 37032d1

Browse files
Grippy98igorpecovnik
authored andcommitted
fix(chroot): add Dpkg conffile options to prevent interactive prompts
When a cached rootfs contains a modified conffile (e.g. ubuntu-pro-client's /etc/apt/apt.conf.d/20apt-esm-hook.conf), dpkg prompts during apt-get install. In a non-interactive chroot stdin is closed, so dpkg reads EOF and exits with error 1 -- causing the build to fail after 3 retries. DEBIAN_FRONTEND=noninteractive alone is insufficient: the conffile prompt is driven by dpkg's own logic and is not suppressed by the frontend var when stdin is a closed pipe rather than a terminal. Fix: pass --force-confdef and --force-confold as Dpkg options in the central chroot_sdcard_apt_get function so all apt-get invocations in chroot builds resolve conffile conflicts without prompting. This resolves the Beaglebadge_resolute_vendor_6.18.y_gnome_desktop failure where ubuntu-pro-client and its 9 dependent packages all failed to configure because of this conffile prompt.
1 parent a7f3a94 commit 37032d1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

lib/functions/logging/runners.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ function chroot_sdcard_apt_get() {
7070

7171
apt_params+=(-o "Dpkg::Use-Pty=0") # Please be quiet
7272

73+
# Prevent dpkg from prompting about modified conffiles in non-interactive chroot builds.
74+
# Without this, packages like ubuntu-pro-client that ship modified conffiles (e.g.
75+
# /etc/apt/apt.conf.d/20apt-esm-hook.conf) will prompt on stdin, get EOF, and fail.
76+
# --force-confdef: use dpkg's default action (no prompt)
77+
# --force-confold: if the default is ambiguous, keep the existing conffile
78+
apt_params+=(-o "Dpkg::Options::=--force-confdef")
79+
apt_params+=(-o "Dpkg::Options::=--force-confold")
80+
7381
# --list-cleanup
7482
# This option is on by default; use --no-list-cleanup to turn it off. When it is on, apt-get will
7583
# automatically manage the contents of /var/lib/apt/lists to ensure that obsolete files are erased. The only

0 commit comments

Comments
 (0)