Package: release.debian.org
Severity: normal
Tags: trixie
X-Debbugs-Cc: [email protected]
Control: affects -1 + src:debvm
User: [email protected]
Usertags: pu

[ Reason ]
debvm is supposed to work with unstable, but sometimes it does not
anticipate the ways in which unstable changes. Stable users should be
able to use stable debvm to create an unstable machine. The reason to
issue an update is adapting to two systemd changes.

[ Impact ]
The update contains six changes all of which are cherry-picked from
unstable. Decreasing importance:

 * Install systemd-resolved. Without this change virtual machines
   do not have a working resolver by default. It can be worked around
   by passing --include=systemd-resolved.
 * The autologin hook was adapted to changes in systemd and util-linux.
   Without this change, automatic login ceases to work in forky and
   later.
 * Fix uninitialized variable in debefivm-run in graphical mode.
   Graphical mode does not work at all in debefivm-run without this
   change.
 * Skip console setup when running in graphical mode. In graphical mode,
   the system console may be invisible to the user.
 * Tests: Record buster as archived. Buster tests fail without this.
 * Skip riscv64 in autopkgtests. Those tests fail due to workers being
   too slow.

[ Tests ]
debvm has significant autopkgtests. The autologin issue was detected by
them. I manually tested name resolution and graphical mode of
debefivm-create.

[ Risks ]
The proposed changes are targeted and well understood. No refactoring is
included. All of them were cleanly cherry-picked from unstable.
Additionally, many of the changes affect particular branches, so the
risk of affecting other operation is low.

[ Checklist ]
  [x] *all* changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in (old)stable
  [x] the issue is verified as fixed in unstable

[ Changes ]
Most changes are described in the impact section. A more notable one is
the addition of the target_apt_get function in customize-resolved.sh.
While it may look like a lot of code being introduced, the invocation
also resides in share/customize-kernel.sh already and had to be copied.

[ Other info ]
I have not yet uploaded the package and request pre-approval given the
attached debdiff.

If you prefer using git,
https://salsa.debian.org/helmutg/debvm/-/compare/debian%2F0.4.5...debian%2Ftrixie?from_project_id=79331

Helmut
diff --git a/bin/debefivm-run b/bin/debefivm-run
index 50e87de..66053e8 100755
--- a/bin/debefivm-run
+++ b/bin/debefivm-run
@@ -344,8 +344,6 @@ fi
 set -- \
        -no-user-config \
        -nodefaults \
-       -chardev stdio,id=console,mux=on,signal=off \
-       -serial chardev:console \
        -name "debefivm-run $IMAGE" \
        -m 1G \
        -drive "if=pflash,format=raw,unit=0,read-only=on,file=$(comma_escape 
"$BIOSCODE")" \
@@ -371,9 +369,13 @@ if ! check_skip rngdev; then
 fi
 
 if test -z "$GRAPHICAL"; then
-       set -- -nographic "$@"
+       set -- \
+               -nographic \
+               -chardev stdio,id=console,mux=on,signal=off \
+               -serial chardev:console \
+               "$@"
 else
-       case "$KERNELARCH" in
+       case "$IMAGE_ARCH" in
                amd64|i386)
                        set -- -vga virtio "$@"
                ;;
diff --git a/debian/changelog b/debian/changelog
index 5608f61..39d1c5e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,19 @@
+debvm (0.4.5+deb13u1) UNRELEASED; urgency=medium
+
+  [ Jochen Sprickerhof ]
+  * debefivm-run: fix variable name
+  * debefivm-run: only use the console in nographics mode
+
+  [ Helmut Grohne ]
+  * tests: buster has been archived
+  * customize-resolved.sh: explicitly install systemd-resolved
+  * autopkgtest: skip riscv64 as the emulation is too slow
+
+  [ Luca Boccassi ]
+  * autologin: prefer credentials to monkey patching unit
+
+ -- Helmut Grohne <[email protected]>  Tue, 27 Jan 2026 12:12:38 +0100
+
 debvm (0.4.5) unstable; urgency=medium
 
   * debefivm-create: clean up unreproducible files (Closes: #1107719)
diff --git a/debian/tests/control b/debian/tests/control
index b61e26b..f7bdf9a 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -2,23 +2,23 @@ Features: test-name=debvm-root
 Test-Command: setsid ./tests/create-and-run.sh $(dpkg --print-architecture) ""
 Depends: debian-archive-keyring, debvm, expect, file, openssh-client, seabios 
[ppc64el], qemu-system-native
 Restrictions: allow-stderr, needs-internet, needs-root
-# Skip armel and armhf: Emulation too slow.
+# Skip armel, armhf, and riscv64: Emulation too slow.
 # Skip i386: No kernel.
 # Skip loong64:
 #   unable to handle EFI zboot image with "zstd" compression
 #   qemu-system-loongarch64: could not load kernel '/proc/self/fd/3': Failed 
to load ELF
-Architecture: !armel !armhf !i386 !loong64
+Architecture: !armel !armhf !i386 !loong64 !riscv64
 
 Features: test-name=debvm-unshare
 Test-Command: unshare -U -m -p -f -r --mount-proc true || exit 77; 
./tests/create-and-run.sh $(dpkg --print-architecture) ""
 Depends: debian-archive-keyring, debvm, expect, file, openssh-client, seabios 
[ppc64el], uidmap, qemu-system-native
 Restrictions: allow-stderr, needs-internet, skippable
-# Skip armel and armhf: Emulation too slow.
+# Skip armel, armhf, and riscv64: Emulation too slow.
 # Skip i386: No kernel.
 # Skip loong64:
 #   unable to handle EFI zboot image with "zstd" compression
 #   qemu-system-loongarch64: could not load kernel '/proc/self/fd/3': Failed 
to load ELF
-Architecture: !armel !armhf !i386 !loong64
+Architecture: !armel !armhf !i386 !riscv64 !loong64
 
 Features: test-name=debefivm-root
 Test-Command: setsid ./tests/efi-create-and-run.sh $(dpkg 
--print-architecture) ""
diff --git a/share/customize-autologin.sh b/share/customize-autologin.sh
index a6fc1d2..fd78330 100755
--- a/share/customize-autologin.sh
+++ b/share/customize-autologin.sh
@@ -35,10 +35,17 @@ if test "$(dpkg-query --root "$TARGET" -f 
'${db:Status-Status}' -W systemd-sysv
                echo '[Service]'
                printf '%s\n' 'ExecStartPre=/bin/sed -n -e "s/^\\(.* 
\\)\\?\\(TERM=[^ ]*\\).*/\\2/w/run/debvmterm" /proc/cmdline'
                echo 'EnvironmentFile=-/run/debvmterm'
-               echo 'ExecStart='
-               sed -n 's,^ExecStart=-/sbin/agetty ,&-a root ,p' 
"$TARGET/lib/systemd/system/$UNIT"
+               echo 'SetCredential=agetty.autologin:root'
        ) > "$TARGET/etc/systemd/system/$UNIT.d/autologin.conf"
 
+       if dpkg --compare-versions "$(dpkg-query --root "$TARGET" -f 
'${Version}' -W util-linux)" lt 2.40 || \
+                       dpkg --compare-versions "$(dpkg-query --root "$TARGET" 
-f '${Version}' -W systemd)" lt 247; then
+               (
+                       echo 'ExecStart='
+                       sed -n 's,^ExecStart=-/sbin/agetty ,&-a root ,p' 
"$TARGET/lib/systemd/system/$UNIT"
+               ) >> "$TARGET/etc/systemd/system/$UNIT.d/autologin.conf"
+       fi
+
        exit 0
 fi
 
diff --git a/share/customize-resolved.sh b/share/customize-resolved.sh
index ee9d0c3..c3535fb 100755
--- a/share/customize-resolved.sh
+++ b/share/customize-resolved.sh
@@ -11,6 +11,23 @@ TARGET=$1
 
 LIBNSS_RESOLVE_VERSION=$(dpkg-query --root "$TARGET" -f '${Version}' -W 
libnss-resolve 2>/dev/null) || :
 
+target_apt_get() {
+       if test "${MMDEBSTRAP_MODE:-}" = chrootless; then
+               APT_CONFIG="$MMDEBSTRAP_APT_CONFIG" \
+                       apt-get \
+                       -oDPkg::Options::=--force-not-root \
+                       -oDPkg::Options::=--force-script-chrootless \
+                       -oDPkg::Options::=--root="$TARGET" \
+                       -oDPkg::Options::=--log="$TARGET/var/log/dpkg.log"
+                       "$@"
+       else
+               APT_CONFIG="$MMDEBSTRAP_APT_CONFIG" \
+                       apt-get \
+                       -oDPkg::Chroot-Directory="$TARGET" \
+                       "$@"
+       fi
+}
+
 link_resolv_conf() {
        if ! test -e "$TARGET$1" -o -h "$TARGET/etc/resolv.conf"; then
                # To avoid breaking network during mmdebstrap via a dead link, 
take a copy.
@@ -32,6 +49,7 @@ if dpkg --compare-versions "$LIBNSS_RESOLVE_VERSION" lt 
251.3-2~exp1; then
                link_resolv_conf /run/systemd/resolve/stub-resolv.conf
        fi
 else
+       target_apt_get --yes install systemd-resolved
        if test -h "$TARGET/etc/resolv.conf" && ! test -e 
"$TARGET/etc/resolv.conf"; then
                resolvconftarget=$(readlink "$TARGET/etc/resolv.conf")
                if test "${resolvconftarget#../run/}" != "$resolvconftarget"; 
then
diff --git a/tests/create-and-run.sh b/tests/create-and-run.sh
index 9788790..553955b 100755
--- a/tests/create-and-run.sh
+++ b/tests/create-and-run.sh
@@ -39,7 +39,7 @@ if test "$ARCHITECTURE" = i386; then
        esac
 fi
 case "$RELEASE" in
-       jessie|stretch)
+       jessie|stretch|buster)
                MIRROR=http://archive.debian.org/debian
        ;;
 esac

Reply via email to