original lsb-release file should be preserved for classic mode

Bug #1650207 reported by Oliver Grawert
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
snapd
Confirmed
Undecided
Unassigned
livecd-rootfs (Ubuntu)
Confirmed
Medium
Oliver Grawert

Bug Description

when installing the classic snap the modified /etc/lsb-release and /etc/os-release are used inside the tarball. when compiling code that uses the content of these files at build time they get the wrong info:

DISTRIB_ID="Ubuntu Core"
DISTRIB_RELEASE=16
DISTRIB_DESCRIPTION="Ubuntu Core 16"

vs:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"

we should preserve the original data for these two files and use it inside the classic container when the classic snap is installed, so build environments can match against the correct data.

Revision history for this message
Dan Kegel (dank) wrote :

/etc/issue, too, plz :-)

Revision history for this message
Dan Kegel (obdank) wrote :

And /etc/os-release. Symptom: 'pip install' aborts with

  File "/home/buildbot/master-state/sandbox/local/lib/python2.7/site-packages/pip/_vendor/distro.py", line 876, in _parse_os_release_content
    tokens = list(lexer)
  File "/usr/lib/python2.7/shlex.py", line 269, in next
    token = self.get_token()
  File "/usr/lib/python2.7/shlex.py", line 96, in get_token
    raw = self.read_token()
  File "/usr/lib/python2.7/shlex.py", line 172, in read_token
    raise ValueError, "No closing quotation"

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Yeah, hit this today:

$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import lsb_release
>>> lsb_release.get_distro_information()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/lsb_release.py", line 383, in get_distro_information
    distinfo = guess_debian_release()
  File "/usr/lib/python3/dist-packages/lsb_release.py", line 281, in guess_debian_release
    get_distro_info(distinfo['ID'])
  File "/usr/lib/python3/dist-packages/lsb_release.py", line 41, in get_distro_info
    RELEASES_ORDER.sort(key=lambda n: float(n[0]))
  File "/usr/lib/python3/dist-packages/lsb_release.py", line 41, in <lambda>
    RELEASES_ORDER.sort(key=lambda n: float(n[0]))
ValueError: could not convert string to float: '8.04 LTS'

Although that's just due to the fact that it's missing the DISTRIB_CODENAME. Add that back and I think I'll be happy.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in livecd-rootfs (Ubuntu):
status: New → Confirmed
Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Note that snapcraft doesn't exclude libraries correctly when that file is different than xenial's either.

Oliver Grawert (ogra)
Changed in livecd-rootfs (Ubuntu):
importance: Undecided → Medium
assignee: nobody → Oliver Grawert (ogra)
Revision history for this message
Frédéric Bolduc (ferdbold) wrote :

I've been hitting the same bug as kyrofa when running add-apt-repository, although my /etc/lsb-release/ seems to look fine:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="GalliumOS 2.0"

Could this be another issue entirely?

Revision history for this message
Oliver Grawert (ogra) wrote :

fixed in the latest edge core snap: http://paste.ubuntu.com/23874513/

note that you need to snap remove classic/snap install --devmode --edge classic && sudo classic
to re-generate the chroot on existing installs for the fix to apply.

Changed in livecd-rootfs (Ubuntu):
status: Confirmed → Fix Committed
Changed in snappy:
status: New → Fix Committed
Revision history for this message
Kyle Fazzari (kyrofa) wrote :

I've not tested anywhere else, but this bug is _not_ fixed on arm64, running core from edge:

$ snap --version
snap 2.23~201702241616.git.9d8157d~ubuntu16.04.1
snapd 2.23~201702241616.git.9d8157d~ubuntu16.04.1
series 16
kernel 4.4.0-1032-snapdragon

$ snap list
Name Version Rev Developer Notes
classic 16.04 17 canonical devmode
core 16-2 1316 canonical -
dragonboard 16.04-0.18 24 canonical -
dragonboard-kernel 4.4.0-1032-3 16 canonical -

(classic)kyrofa@localhost:~$ cat /etc/os-release
NAME="Ubuntu Core"
VERSION="16"
ID=ubuntu-core
PRETTY_NAME="Ubuntu Core 16"
VERSION_ID="16""
HOME_URL="http://www.snapcraft.io/"
BUG_REPORT_URL="http://bugs.launchpad.net/snappy/"

Changed in livecd-rootfs (Ubuntu):
status: Fix Committed → Confirmed
Changed in snappy:
status: Fix Committed → Confirmed
Michael Vogt (mvo)
affects: snappy → snapd
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.