Hi,

I ran into this issue with salt. salt failed to determine its codename
grain after a fresh boot.

In case /usr/lib/os-release sets VERSION_CODENAME or
/etc/debian_version specifies only one codename, lsb-release takes the
information from there. base-files 11 don't set these values (and
therefore trigger this bug), but base-files 11.1 does set these values
(and therefore does not trigger this bug). Once bullseye is released,
base-files will be updated and trigger the bug again.

This issue can be easily reproduced using mmdebstrap/bdebstrap (because
mmdebstap clears the apt cache) by following the "Debian live system"
example: https://github.com/bdrung/bdebstrap#debian-live-system
The only difference to the example is to use `bullseye` or `unstable`
as suite and to install lsb-release as additional package.

```
bdebstrap -c /usr/share/doc/bdebstrap/examples/Debian-buster-live.yaml \
  -n example2 --package lsb-release --suite bullseye
python3 -m http.server -b localhost --directory example2 8080 &
cd example2
qemu-system-x86_64 -machine accel=kvm -m 1G -device virtio-net-pci,netdev=net0 
-monitor vc \
    -netdev 
user,id=net0,hostfwd=tcp::2222-:22,guestfwd=tcp:10.0.2.252:8080-tcp:localhost:8080,hostname=debian-live
 \
    -kernel ./vmlinuz -initrd ./initrd.img -append "boot=live 
fetch=http://10.0.2.252:8080/root.squashfs quiet"
```

Then you have a running live system VM where you can ssh into:

```
ssh -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -p 2222 
root@localhost
```

Inside the VM you have to restore the values from base-file 11:

```
sed -i '/VERSION/d' /usr/lib/os-release
sed -i 's@PRETTY_NAME=.*$@PRETTY_NAME="Debian GNU/Linux bullseye/sid"@' 
/usr/lib/os-release
echo 'bullseye/sid' > /etc/debian_version
```

Then running lsb_release will show the issue:

```
root@debian-live:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux bullseye/sid
Release:        testing/unstable
Codename:       n/a
```

Running `apt update` will "solve" it:

```
root@debian-live:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux bullseye/sid
Release:        testing
Codename:       bullseye
```

-- 
Benjamin Drung

Senior DevOps Engineer and Debian & Ubuntu Developer
Compute Platform Operations

1&1 IONOS SE | Greifswalder Str. 207 | 10405 Berlin | Deutschland
E-Mail: benjamin.dr...@ionos.com | Web: www.ionos.de

Hauptsitz Montabaur, Amtsgericht Montabaur, HRB 24498

Vorstand: Hüseyin Dogan, Dr. Martin Endreß, Claudia Frese, Henning
Kettler, Arthur Mai, Matthias Steinberg, Achim Weiß
Aufsichtsratsvorsitzender: Markus Kadelke


Member of United Internet

Reply via email to