Hey josch,

On 29.08.24 14:47, Johannes Schauer Marin Rodrigues wrote:
Hi Lee,

there seems to be some confusion (also from my end) -- read further below.

Quoting Lee Garrett (2024-08-28 20:35:06)
when creating a bookworm schroot e.g. with sbuild-createchroot --merged-usr
bookworm /var/lib/schroot/schroots/bookworm-amd64-sbuild
http://localhost:3142/deb.debian.org/debian/

the resulting schroot has an unmerged /usr. This creates some interesting
problems, like upgrade tests failing. Or in theory it's possible to successfully
build and test packages that would be broken when installed on a "real"
bookworm.

Is there a reason for this? At least for me this break user expectation, as a
merged /usr is required per release notes [0]. I've tentatively set this to
severity serious, as I believe this could have been an oversight. If this is by
design, I think it's best if sbuild-createchroot would very prominently say so
on the end of the build run.

Thanks in advance!

Regards,
Lee

[0] 
https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.en.html#a-merged-usr-is-now-required

-- System Information:
Debian Release: 12.7
   APT prefers stable-updates
   APT policy: (990, 'stable-updates'), (990, 'stable-security'), (990, 
'proposed-updates'), (990, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.9.7+bpo-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages sbuild depends on:
ii  adduser         3.134
ii  libsbuild-perl  0.85.0
ii  perl            5.36.0-7+deb12u1

Versions of packages sbuild recommends:
ii  autopkgtest  5.39
ii  debootstrap  1.0.128+nmu2+deb12u1
ii  schroot      1.6.13-3+b2
ii  uidmap       1:4.13+dfsg1-1+b1

Versions of packages sbuild suggests:
pn  deborphan  <none>
ii  e2fsprogs  1.47.0-2
ii  kmod       30+20221128-1
ii  wget       1.21.3-1+b2

-- no debconf information

Your package selection suggests that you are on bookworm. I am as well. As far
as I can see, I have the same package versions installed for sbuild and
debootstrap as you do.

$ apt-cache policy sbuild debootstrap
sbuild:
   Installed: 0.85.0
[...]
debootstrap:
   Installed: 1.0.128+nmu2+deb12u1



But I am unable to reproduce this. It seems that
debootstrap should indeed respect the --merged-usr flag even when building
bookworm buildd chroots. I'm running this and I fail to reproduce your issue:

$ sudo sbuild-createchroot --merged-usr bookworm tmp/debian-bookworm
[...]
$ ls -lha ~/tmp/debian-bookworm
total 144K
drwxr-xr-x  18 root   root   4.0K Aug 29 14:40 .
drwxrwxrwt 156 josch  josch   72K Aug 29 14:37 ..
lrwxrwxrwx   1 root   root      7 Aug 29 14:39 bin -> usr/bin
drwxr-xr-x   2 root   root   4.0K Mar 29 18:20 boot
drwxrws---   2 sbuild sbuild 4.0K Aug 29 14:40 build
drwxr-xr-x   4 root   root   4.0K Aug 29 14:39 dev
drwxr-xr-x  31 root   root   4.0K Aug 29 14:40 etc
drwxr-xr-x   2 root   root   4.0K Mar 29 18:20 home
lrwxrwxrwx   1 root   root      7 Aug 29 14:39 lib -> usr/lib
drwxr-xr-x   2 root   root   4.0K Aug 29 14:39 media
drwxr-xr-x   2 root   root   4.0K Aug 29 14:39 mnt
drwxr-xr-x   2 root   root   4.0K Aug 29 14:39 opt
drwxr-xr-x   2 root   root   4.0K Mar 29 18:20 proc
drwx------   2 root   root   4.0K Aug 29 14:39 root
drwxr-xr-x   4 root   root   4.0K Aug 29 14:39 run
lrwxrwxrwx   1 root   root      8 Aug 29 14:39 sbin -> usr/sbin
drwxr-xr-x   2 root   root   4.0K Aug 29 14:39 srv
drwxr-xr-x   2 root   root   4.0K Mar 29 18:20 sys
drwxrwxrwt   2 root   root   4.0K Aug 29 14:40 tmp
drwxr-xr-x  11 root   root   4.0K Aug 29 14:39 usr
drwxr-xr-x  11 root   root   4.0K Aug 29 14:39 var

This seems to be the intended behaviour. Can you try again?

Oof, indeed! What a hell of a mistake of mine. It seems that I did a copy/paste mistake in the original bug report. To clarify: I had an issue with

sbuild-createchroot bookworm /var/lib/schroot/schroots/bookworm-amd64-sbuild http://localhost:3142/deb.debian.org/debian/

creating an unmerged /usr by default. After some discussion here and on #debian-devel I understand that it is intended behaviour. It is indeed documented in the man page of sbuild-createchroot that it is the default. However, the tripfall is that my expectation (and likely of other's not aware of the background) is bookworm being merged /usr, as that's enforced on "normal" installations, so I didn't check this specific flag. There is also no command output hinting at it. As such I'll downgrade the bug, and send a PR for sbuild-createchroot to output prominently that it builds a non-default unmerged /usr.

Thanks!

Lee

Reply via email to