Bug 153069
Summary: | Files left in rootfs | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Kasper Dupont <bugzilla> | ||||||||
Component: | mkinitrd | Assignee: | Peter Jones <pjones> | ||||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | David Lawrence <dkl> | ||||||||
Severity: | medium | Docs Contact: | |||||||||
Priority: | medium | ||||||||||
Version: | 3 | CC: | jlayton, j | ||||||||
Target Milestone: | --- | ||||||||||
Target Release: | --- | ||||||||||
Hardware: | All | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | 5.0.0 | Doc Type: | Bug Fix | ||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2006-02-03 22:39:44 UTC | Type: | --- | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Attachments: |
|
Description
Kasper Dupont
2005-04-01 11:15:28 UTC
Created attachment 112575 [details]
Kernel module to help debugging the problem
Compile and load the module, then type "echo </dev/hack" to chdir into the
hidden directory. No guarantees - this module mess with VFS data structures.
Yeah, I saw this when I put in the changes to fix the /sys,/proc, and /dev mounts. The solution is to make a "cleanup rootfs" function in nash, and make switchrootCommand() call it. But at 1.2M, that's a very low priority right now. Created attachment 113084 [details]
Patch as suggested by pjones
Here is my suggestion for at patch solving this problem. It follows the
principle suggested by Peter Jones in the previous comment. It works for me,
though it may require additional filenames for other scenarios.
It really needs to remove *everything* on the filesystem except the directories being used as mountpoints... My patch removes everything except directories. At least in the configuration where I tested it, it does. Is it infeasible to include a list of all filenames to remove? The alternative would be something similar to rm -rf, which I was afraid would be too error prone. Well, if we're to include it, then mkinitrd needs to generate it -- the users can add whatever kernel modules they'd like, so we have to be able to handle that. In general, a dynamic solution would be best (be it dynamic at boot time or during mkinitrd) would be best, as maintaining a list of files is a nightmare. Created attachment 115174 [details]
recursiveRemove()
Patch from #159636 by Jeff Layton (jlayton)
*** Bug 159636 has been marked as a duplicate of this bug. *** Tried out the new mkinitrd (4.2.16) on a test box today, and hacked some small changes into it for testing. I enabled -DDEBUG in the build process and added this just after the recursiveRemove(): lsdir("/",""); After that, I booted to an initramfs with my test nash, and it showed this: Switching to new root //proc/ //sys/ //sysroot/ unmounting old /proc unmounting old /sys So it looks like only /proc,/sys, and /sysroot were still in the root directory just before switching roots. I suppose this means we can call the recursiveRemove() a (tentative) success. |