I'm using switch_root from busybox 1.28 on a fairly generic Linux 4.14 embedded system.
I have two issues that I'm looking for advice on. Up until now I've been running out of initramfs, but it's getting kind of big and I'm trying to reduce the memory usage. So, I created a block-based root disk and started using switch_root early in boot. So far, so good. However, I see almost no difference in memory usage after the switch_root (looking at slabtop and /proc/meminfo). I was hoping to see a dramatic decrease in memory usage just freeing up all the contents of the initramfs. All the stats I've seen make me think little or none of the initramfs contents have actually been deleted. I haven't come up with a good way to debug in that environment. Any thoughts about this would be appreciated. Also, I'm wondering about the proper way to deal with the pseudo filesystems (devfs, procfs, tmpfs, etc) when using switch_root. As far as I can tell, none of these filesystems are accessible after the switch_root. I've been unmounting them before switch_root, then re-mounting them after switch_root and that seems to work fine, but I'm wondering if I'm doing the right thing. I read one post that indicated that all these were left mounted and were still accessible after the switch_root. I tried that, but no luck. Am I correct in unmounting/switch_root/re-mounting for these filesystems? Thanks for any help. _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
