focal chroots broken due to change in sources.list
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sbuild-launchpad-chroot (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Eoan |
Won't Fix
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
High
|
Unassigned | ||
Groovy |
Fix Released
|
High
|
Unassigned |
Bug Description
----- Begin SRU info -----
[Impact]
Users of sbuild-
sbuild-
An attempt to do so fails during 'apt-get update' as the
/etc/apt/
To recreate failure just try build and usage.
$ sudo apt-get update
$ sudo apt-get install sbuild-
$ sudo sbuild-
--
Then get a dsc file to build. Any dsc will show the issue, this is only
to have a complete example.
$ dget https:/
$ sbuild --dist=focal --arch=amd64 --arch-all cloud-utils_
...
+----
| Update chroot |
+----
E: Type 'main' is not known on line 5 in source list /etc/apt/
E: The list of sources could not be read.
E: apt-get update failed
[Test Case]
To test:
* install sbuild-
* Create chroots for bionic (old format) and focal (new format).
* build a package in the chroot.
Because the mirror differs between amd64 and other arches, you should
also build for a non-amd64 arch.
The attached script will do all of the above.
I suggest running like:
* manually enable -proposed
* get a .dsc and associated files to build into current working dir.
* ./test-
Note that sbuild likely wont work properly in a container, so the
script will exit failure if detected.
[Regression Potential]
The most likely scenario for regression is in uers with custom scripts in
/etc/schroot.
/etc/apt/
A user could have:
1. added a script that ran *before* 90apt-sources that wrote or edited
the /etc/apt/
Since we have changed the code to no longer attempt to edit
sources.list the changes in 1 would likely be destroyed.
2. added a script that ran *after* 90apt-sources that made similar changes
and made assumption of the state of that file.
Assumptions made about the format of this file may be broken and cause
breakage of such scripts.
Lastly, a user could have relied on 90apt-sources to edit
/etc/apt/
sbuild-
desired this, but the change will no longer modify those schroots at all.
That is generally a safer/focused behavior. sbuild-
will now only modify schroots that it created (determined by
presense of launchpad.series in the schroot config).
Ultimately... it is somewhat unlikely that user-added scripts would have
worked with focal or groovy schroots.
[Other Info]
The change that caused this failure was in the /etc/apt/
is present in the launchpad schroot.
A summary of how sbuild-
following happens:
1. The packagd file /etc/schroot/
will query launchpad for a tarball to use as chroot, and possibly update
the existing one.
2. /etc/schroot/
exixting /etc/apt/
to enable the requested combination of
suite (release, security, ... ) and
component (main, restricted, universe ...)
The existing code is only able to handle a "one line" version of
/etc/apt/
deb http://
Focal and groovy chroots now a have a "complete" /etc/apt/
file as you would see in a lxc container or an installed system.
The change made was to more fully "own" the writing of
/etc/apt/
format of /etc/apt/
on that assumption. When the format of the file changed, its ability to
edit the file failed.
The new code just declares the settings, which makes it much simpler.
The new code is not expected to be "general purpose". In order to
avoid breaking other schroot's, it is only enabled if this schroot
was set up by launchpad-schroot.
-- precise support --
The change upstream also dropped support for *running on* precise.
Ability to build for precise should not be changed.
-- feature added --
There is one feature added in this patch, now the user can
set the mirror that they would like to use by adding a setting:
apt.default.mirror
To the /etc/schroot/
For example:
$ grep apt /etc/schroot.
apt.enable=true
apt.default.
If no value is set there, then code will use the mirror specified in the
first 'deb' line of /etc/apt/
----- End SRU info -----
At some stage fairly recently my Focal schroots have broken due to the sources.list file that is now included. I will attach this file, however it looks like the standard distro source.list file vs the single liner version I have in my eoan schroots.
Reverting to a single liner similar to Eoan fixes this issue.
Not sure if this is an issue with this tool or with the downloaded chroot from launchpad changing
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: sbuild-
ProcVersionSign
Uname: Linux 5.4.0-21-generic x86_64
ApportVersion: 2.20.11-0ubuntu26
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: GNOME
Date: Sat Apr 11 15:58:45 2020
InstallationDate: Installed on 2016-05-27 (1414 days ago)
InstallationMedia: Ubuntu-GNOME 16.04 LTS "Xenial Xerus" - Release amd64 (20160509)
PackageArchitec
SourcePackage: sbuild-
UpgradeStatus: Upgraded to focal on 2019-11-18 (145 days ago)
Related branches
- Chad Smith (community): Approve
- Paride Legovini: Approve
- MOTU: Pending requested
-
Diff: 210 lines (+69/-107)2 files modifieddebian/changelog (+7/-0)
etc/schroot/setup.d/90apt-sources (+62/-107)
- Scott Moser: Needs Fixing
-
Diff: 65 lines (+28/-0)3 files modifiedbin/sbuild-launchpad-chroot (+6/-0)
debian/changelog (+7/-0)
etc/schroot/setup.d/90apt-sources (+15/-0)
tags: | added: patch |
Changed in sbuild-launchpad-chroot (Ubuntu Bionic): | |
status: | New → Confirmed |
Changed in sbuild-launchpad-chroot (Ubuntu Eoan): | |
status: | New → Confirmed |
Changed in sbuild-launchpad-chroot (Ubuntu Focal): | |
status: | New → Confirmed |
Changed in sbuild-launchpad-chroot (Ubuntu Groovy): | |
status: | Confirmed → In Progress |
importance: | Undecided → High |
description: | updated |
description: | updated |
tags: |
added: verification-done-focal removed: verification-needed-focal |
Status changed to 'Confirmed' because the bug affects multiple users.