/dev not mounted inside chroot
Bug #1842305 reported by
Egil Moeller
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-initramfs-tools |
New
|
Undecided
|
Unassigned |
Bug Description
The list of filesystems bind-mounted from the outside at https:/
Example failure:
gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2012) <email address hidden>"
/usr/bin/apt-key: 624: /usr/bin/apt-key: cannot create /dev/null: Permission denied
To post a comment you must log in.
In addition to `/dev`, I found that `/dev/pts` also needed to be mounted otherwise `apt` complained. To solve this I added both `/dev` and `/dev/pts` to the list of directories to be bind mounted. This led to another problem that `/dev` could not be unmounted first because `/dev/pts` was still bind mounted. I solved this by prepending the directories to the `mounts` variable rather than appending so that the bind mounts get unmounted in reverse order. Instead of doing:
mounts="$mounts $lowerdir/$d"
I changed it to:
mounts= "$lowerdir/ $d $mounts"
FWIW, this was on Ubuntu 22.04 (Jammy Jellyfish) with version "0.47ubuntu1" of the `overlayroot` package.