From patchwork Wed Mar 5 21:13:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez X-Patchwork-Id: 14003384 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A27B01A5BB2 for ; Wed, 5 Mar 2025 21:13:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741209209; cv=none; b=X5rIqqPk5eRN21/pHXQ9wDGWzDmF4y9ad7lxJhBWpRt+pGmqczKVqgX4n4i6MHXwy+No/VQ1/rjYD8uF8eDsW8wDrKhCuBc77nveMu0WsWMYQQ4gcKK0pin6j3iqu+/FQxm5+UcjPkF4aYCfAiq11NCL8wOStJ700ziEAcXMVrk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741209209; c=relaxed/simple; bh=5Xa1lNBd9wOH1hwPDNma2DqCWSlng8zIDaWTXD9rYLM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=nrY97SAKg48WG50hG5aKN/HEXeo4WgwkP85udQOjc2/QL092DkNLrXPXzLRVe5jTTb1L6Fm5DN6hg//+SzLBQJF7gLFoyOghvF1+QdEVTqVhXsWGKF3AO/TGJtg+3tUrx6AN2g2hKeQvnqTLyJPn8XUg9ualLvhFIViLA1KWKKM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dUBNOoiY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dUBNOoiY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E433C4CED1; Wed, 5 Mar 2025 21:13:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741209209; bh=5Xa1lNBd9wOH1hwPDNma2DqCWSlng8zIDaWTXD9rYLM=; h=From:Date:Subject:To:Cc:From; b=dUBNOoiY2JCUUA2Ol1DOR7gnpazqtURjhaJgmb7yHkQt9YWEDRpwqNJNx7sJLutYU a3nHmudLk21qemASi3eBkQtTm/7JIxzpyERCCgPhbygNJ641eU1AhVg2QFDKhSkufx Jpiu5/XnyAVcjoyp40jfrjBTSt65FWb0SvHjJtd38eCraJisNIWV7puBisp0fX8QaT xGmhbarSioSibnpY8LJ/Yr+Zx03x1zIQzQnmbz7TKxsfU7KlVlVEYyqoqQD4cVQAi2 o8vAs6EihN5Mb5iTB89Q4ZmgsuNWDKFPpo1U8N4GBQfJZ1eNXhV2I+hg34ErcfOSRV hFA4LbIMWTnSg== From: da.gomez@kernel.org Date: Wed, 05 Mar 2025 22:13:19 +0100 Subject: [PATCH] Revert "bringup: devconfig: fix python3-apt debian issue" Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250305-fix-debian-apt-v1-1-09acd002b2f5@samsung.com> X-B4-Tracking: v=1; b=H4sIAG6+yGcC/x2MQQqAIBAAvyJ7bsEMI/tKdFDbai8mGhGIf086D sxMgUyJKcMsCiR6OPMVGvSdAH/acBDy1hiUVFoOUuPOL27k2Aa08cZh8sZ5Z7R1I7QoJmrGP1z WWj/BRYj9YAAAAA== X-Change-ID: 20250305-fix-debian-apt-38c9bcb95ab6 To: kdevops@lists.linux.dev, Luis Chamberlain Cc: Daniel Gomez X-Mailer: b4 0.14.2 From: Daniel Gomez This reverts commit bcea53d0710cc0722520430277c80279e90e0863 Commit bcea53d0710cc0722520430277c80279e90e0863 ("bringup: devconfig: fix python3-apt debian issue") was introduced as workaround to fix a Debian python3-apt issue. We now know this was the actual problem [2] [3]: "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." Ensuring distro and especially apt package is uptodate we align always packages versions to their latest available. Do this at bringup when image is firstboot. In addition, add a new firstconfig target, to make sure we have the system upgraded even if the image has already been booted and we have an outdated system. [1] https://github.com/linux-kdevops/linux-mm-kpd/actions/runs/13677761684/job/38242628757 [2] https://lore.kernel.org/kdevops/20250208134034.GA4079710@debian.org/T/#u [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1095111 Reported-by: Luis Chamberlain Signed-off-by: Daniel Gomez Acked-by: Luis Chamberlain --- Revert python3-apt workaround and fix issue by upgrading apt and distro packages. More details in Debian bug report [1]. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1095111 This also fixes: https://github.com/linux-kdevops/linux-mm-kpd/actions/runs/13677761684/job/38242628757 --- Makefile | 1 + .../devconfig/tasks/install-deps/debian/main.yml | 51 +++------------------- scripts/bringup_guestfs.sh | 1 + scripts/firstconfig.Makefile | 15 +++++++ 4 files changed, 22 insertions(+), 46 deletions(-) --- base-commit: b22f5e838593b7c4577a308a5d0de13db1eae220 change-id: 20250305-fix-debian-apt-38c9bcb95ab6 Best regards, diff --git a/Makefile b/Makefile index e0e5d8f962d2f33be1c91a66aeaf4f5829f044d5..5ee7db7d988b9271fed7cb470f807bb9e9ce3cb6 100644 --- a/Makefile +++ b/Makefile @@ -95,6 +95,7 @@ LOCALHOST_SETUP_WORK := ANSIBLE_EXTRA_ARGS += $(LOCAL_DEVELOPMENT_ARGS) include scripts/provision.Makefile +include scripts/firstconfig.Makefile include scripts/systemd-timesync.Makefile include scripts/journal-server.Makefile include scripts/update_etc_hosts.Makefile diff --git a/playbooks/roles/devconfig/tasks/install-deps/debian/main.yml b/playbooks/roles/devconfig/tasks/install-deps/debian/main.yml index 36ff92c5719f0753dd209d10e3b4a2fe7db42a08..22fe396b3c3a531571cfc6dea5a3250564fa853d 100644 --- a/playbooks/roles/devconfig/tasks/install-deps/debian/main.yml +++ b/playbooks/roles/devconfig/tasks/install-deps/debian/main.yml @@ -1,51 +1,10 @@ --- -- name: Update package lists - become: true - become_method: sudo - ansible.builtin.shell: - cmd: > - DEBIAN_FRONTEND=noninteractive apt - -o Acquire::Check-Valid-Until=false update - when: - - ansible_os_family == "Debian" - - ansible_distribution_release == "trixie" - tags: vars_simple - register: apt_update_result - retries: 5 - delay: 10 - until: apt_update_result.rc == 0 - -- name: Install required packages - become: true - become_method: sudo - ansible.builtin.shell: - cmd: > - DEBIAN_FRONTEND=noninteractive apt install -y - python3-setuptools libapt-pkg-dev python3-pip git - when: - - ansible_os_family == "Debian" - - ansible_distribution_release == "trixie" - tags: vars_simple - -- name: Install python-apt from Git with pip3 - become: true - become_method: sudo - ansible.builtin.shell: - cmd: > - pip3 install - git+https://salsa.debian.org/apt-team/python-apt.git@2.9.6 - --break-system-packages - when: - - ansible_os_family == "Debian" - - ansible_distribution_release == "trixie" - tags: vars_simple - -- name: Hold python3-apt package version +- name: Upgrade Packages become: yes - ansible.builtin.command: apt-mark hold python3-apt - when: - - ansible_os_family == "Debian" - tags: vars_simple + become_method: sudo + ansible.builtin.apt: + upgrade: full + tags: firstconfig - name: Remove unattended-upgrades package become: yes diff --git a/scripts/bringup_guestfs.sh b/scripts/bringup_guestfs.sh index 08c868c467077f118668a18028ba6cbefa74665b..32ffe3f037de16a724aa66741a99efa4e5eedcf0 100755 --- a/scripts/bringup_guestfs.sh +++ b/scripts/bringup_guestfs.sh @@ -222,6 +222,7 @@ append-line /etc/network/interfaces.d/enp1s0:iface enp1s0 inet dhcp firstboot-command systemctl stop ssh firstboot-command DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true dpkg-reconfigure -p low --force openssh-server firstboot-command systemctl start ssh +firstboot-command apt update && apt upgrade --yes _EOT # CONFIG_GUESTFS_COPY_SOURCES_FROM_HOST_TO_GUEST will not work # if /etc/nsswitch.conf has a line like this: diff --git a/scripts/firstconfig.Makefile b/scripts/firstconfig.Makefile new file mode 100644 index 0000000000000000000000000000000000000000..808975027ef475f07cb34fbf270dd404b7cbacf3 --- /dev/null +++ b/scripts/firstconfig.Makefile @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: copyleft-next-0.3.1 + +firstconfig: + $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -l baseline,dev \ + -f 30 -i hosts \ + --extra-vars '{ kdevops_cli_install: True }' \ + --tags vars_simple,firstconfig \ + $(KDEVOPS_PLAYBOOKS_DIR)/devconfig.yml + +KDEVOPS_BRING_UP_DEPS_EARLY += firstconfig + +firstconfig-help: + @echo "firstconfig - Setup firstconfig" + +HELP_TARGETS += firstconfig-help