canonical / canonical/core-base

System files are swapped in latest core24

Open
#415 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
37
Forks
53
Avg merge
1d 19h
Merged PRs (30d)
12

Description

When debugging an issue my coworker was facing, **I realized that certain system files defined in the `core24` repository were swapped out on the version published to the Snap Store and do not match those in this repository.** On it's face, it looks as if a package was upgraded and the "upstream" version of that file was used instead of that defined in this repository as part of a post-build package upgrade via `dpkg`.

In particular, I noticed that the `/etc/issue` and `/etc/issue.net` files (found in the [`/static/etc/` directory in this repo](https://github.com/canonical/core-base/tree/main/static/etc) have been replaced by the vanilla Ubuntu versions, or more accurately, have been moved to `issue.dpkg-old` and `issue.net.dpkg-old` (respectively). To my knowledge (and with the help of `find` & `fzf`) only `/etc/issue` and `/etc/issue.net` have been replaced with dpkg, but I could imagine that there needs to be a more general mechanism implemented to ensure that the files layed out in this repo are not overwritten in the future.

The working revision of the core24 snap is rev. 1349. Both the `latest/stable` (rev. 1499) and `latest/beta` (rev. 1587) channels are affected by this bug.

Downloading the snap file with `snap download` and decompressing with `unsquashfs`, one can see observe differences w.r.t. this repo.

### A few more details on my findings

Here I `unsquashfs`'ed both the `latest/stable` and working rev. 1349 snaps into a "`old`" and "`new`" directory (respectively). Doing a very basic `ls`->`grep` in `squashfs-root` you can see the `dpkg-old` artifacts (the files in this repo) laying around in the "new" directory that are not present in the "old" (rev. 1349) directory.

```
# ls new/squashfs-root/etc | grep issue
issue
issue.dpkg-old
issue.net
issue.net.dpkg-old

# ls old/squashfs-root/etc | grep issue
issue
issue.net
```

As for the file contents difference, on the older rev. 1349 of core24, we only have `etc/issue` and `etc/issue.net`, with the contents of `etc/issue` being:
```
Ubuntu Core 24 on \4 (\l)
```

On the latest rev. 1499 and rev. 1587, the contents of `etc/issue` is:
```
Ubuntu 24.04.4 LTS \n \l
```
with a `etc/issue.dpkg-old` contents of:
```
Ubuntu Core 24 on \4 (\l)
```

### Next steps?

For the Ubuntu Core systems I'm developing right now, I'll have to try to pin the older revision of `core24` since I rely on the IP address being displayed by `/etc/issue` for initial system setup. It would be great if a new release could be drafted soon with the Core `/etc/issue` file preserved so I can unpin the older version of core24.

On the repo build side of things, I'm still familiarizing myself with this codebase but I don't see any mechanism for ensuring that dpkg isn't overriding files layed out here during the build process. I'm hoping that it was _through the build process_ that the config files were swapped out and not that someone was upgrading an existing installation outside of the typical build process that was pushed to the Snap Store -- that would be spooky.

Thanks for all your help!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.