Recreate device nodes in chroot after shutdown
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
topmb.chroot.mount.crete_device_nodes
- don't call it in
pmb.chroot.init()
anymore, but inpmb.chroot.mount_dev_tmpfs()
- Create the
null
device as well (apk --initdb
also creates it oninit
, but we don't call it aftershutdown
)
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)