Skip to content

Commit 3f52d93

Browse files
committed
Revert "bringup: devconfig: fix python3-apt debian issue"
This reverts commit bcea53d Reverting fixes [1] but we need to ensure APT packages are always uptodate: Commit bcea53d ("bringup: devconfig: fix python3-apt debian issue") was originally added as a workaround for a Debian python3-apt problem. However, in the Debian bug report thread [2][3] was revealed that the real problem was: "APT has a fluctuating ABI that depends on which std:: symbols it calls, and which of those calls the compiler inlines and omits the symbols for, so it can change with every update to APT or the compiler." To address the problem, we ensure that the distribution and especially the apt packages, are always updated to the latest available versions. This update is performed during bringup, when the image is first booted (firstboot). Additionally, a new firstconfig target has been added to upgrade the system even if it has already booted with an outdated image. [1] https://github.com/linux-kdevops/linux-mm-kpd/actions/runs/13677761684/job/38242628757 [2] https://lore.kernel.org/kdevops/[email protected]/T/#u [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1095111 Reported-by: Luis Chamberlain <[email protected]> Acked-by: Luis Chamberlain <[email protected]> Signed-off-by: Daniel Gomez <[email protected]>
1 parent b22f5e8 commit 3f52d93

File tree

4 files changed

+22
-46
lines changed

4 files changed

+22
-46
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ LOCALHOST_SETUP_WORK :=
9595
ANSIBLE_EXTRA_ARGS += $(LOCAL_DEVELOPMENT_ARGS)
9696

9797
include scripts/provision.Makefile
98+
include scripts/firstconfig.Makefile
9899
include scripts/systemd-timesync.Makefile
99100
include scripts/journal-server.Makefile
100101
include scripts/update_etc_hosts.Makefile

playbooks/roles/devconfig/tasks/install-deps/debian/main.yml

Lines changed: 5 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,10 @@
11
---
2-
- name: Update package lists
3-
become: true
4-
become_method: sudo
5-
ansible.builtin.shell:
6-
cmd: >
7-
DEBIAN_FRONTEND=noninteractive apt
8-
-o Acquire::Check-Valid-Until=false update
9-
when:
10-
- ansible_os_family == "Debian"
11-
- ansible_distribution_release == "trixie"
12-
tags: vars_simple
13-
register: apt_update_result
14-
retries: 5
15-
delay: 10
16-
until: apt_update_result.rc == 0
17-
18-
- name: Install required packages
19-
become: true
20-
become_method: sudo
21-
ansible.builtin.shell:
22-
cmd: >
23-
DEBIAN_FRONTEND=noninteractive apt install -y
24-
python3-setuptools libapt-pkg-dev python3-pip git
25-
when:
26-
- ansible_os_family == "Debian"
27-
- ansible_distribution_release == "trixie"
28-
tags: vars_simple
29-
30-
- name: Install python-apt from Git with pip3
31-
become: true
32-
become_method: sudo
33-
ansible.builtin.shell:
34-
cmd: >
35-
pip3 install
36-
git+https://salsa.debian.org/apt-team/[email protected]
37-
--break-system-packages
38-
when:
39-
- ansible_os_family == "Debian"
40-
- ansible_distribution_release == "trixie"
41-
tags: vars_simple
42-
43-
- name: Hold python3-apt package version
2+
- name: Upgrade Packages
443
become: yes
45-
ansible.builtin.command: apt-mark hold python3-apt
46-
when:
47-
- ansible_os_family == "Debian"
48-
tags: vars_simple
4+
become_method: sudo
5+
ansible.builtin.apt:
6+
upgrade: full
7+
tags: firstconfig
498

509
- name: Remove unattended-upgrades package
5110
become: yes

scripts/bringup_guestfs.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ append-line /etc/network/interfaces.d/enp1s0:iface enp1s0 inet dhcp
222222
firstboot-command systemctl stop ssh
223223
firstboot-command DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true dpkg-reconfigure -p low --force openssh-server
224224
firstboot-command systemctl start ssh
225+
firstboot-command apt update && apt upgrade --yes
225226
_EOT
226227
# CONFIG_GUESTFS_COPY_SOURCES_FROM_HOST_TO_GUEST will not work
227228
# if /etc/nsswitch.conf has a line like this:

scripts/firstconfig.Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-License-Identifier: copyleft-next-0.3.1
2+
3+
firstconfig:
4+
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) -l baseline,dev \
5+
-f 30 -i hosts \
6+
--extra-vars '{ kdevops_cli_install: True }' \
7+
--tags vars_simple,firstconfig \
8+
$(KDEVOPS_PLAYBOOKS_DIR)/devconfig.yml
9+
10+
KDEVOPS_BRING_UP_DEPS_EARLY += firstconfig
11+
12+
firstconfig-help:
13+
@echo "firstconfig - Setup firstconfig"
14+
15+
HELP_TARGETS += firstconfig-help

0 commit comments

Comments
 (0)