Skip to content

Recreate device nodes in chroot after shutdown

Administrator requested to merge fix/missing-dev-nodes-after-shutdown into master

Created by: ollieparanoid

Device nodes in the chroots get created in a tmpfs, so they can be created even if the filesystem where the chroot resides does not support device nodes (#1317). In "pmbootstrap shutdown" we umount the dev folder, which means all device nodes that were created inside this folder are gone. This commit changes the code to actually recreate the device nodes when using the chroot again.

Details

  • move pmb.chroot.init.create_device_nodes to pmb.chroot.mount.crete_device_nodes
  • don't call it in pmb.chroot.init() anymore, but in pmb.chroot.mount_dev_tmpfs()
  • Create the null device as well (apk --initdb also creates it on init, but we don't call it after shutdown)

How to test

With this PR, the /dev folder should be the same after init and after shutdown and entering the chroot again. Without this PR the latter version is empty.

$ pmbootstrap -y zap
$ pmbootstrap chroot -- ls -la /dev
$ pmbootstrap shutdown
$ pmbootstrap chroot -- ls -la /dev

Fixes #1443 (closed).


[x] Merge on GitHub (see https://postmarketos.org/merge)

Merge request reports

Loading