/dev not mounted inside chroot

Bug #1842305 reported by Egil Moeller
6
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://git.launchpad.net/cloud-initramfs-tools/tree/overlayroot/usr/sbin/overlayroot-chroot#n72 should include /dev so that installing apt-packages that touches /users device files (null, zero, ttyX) in their postinstall scripts works, as well as just plain apt-get update.

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

Revision history for this message
David MacMahon (david-macmahon) wrote :

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.

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.