Red Hat Bugzilla – Bug 159636
nash should clean out initramfs before switching to real rootfs
Last modified: 2014-06-18 03:34:58 EDT
The attached (untested) patch is a first stab at having nash clean out the
initramfs prior to switchrooting. I essentially used doFind as a template and
made changes to make it remove all entities under a given directory.
One big question is whether this patch calls recursiveRemove in the right place
in the switchroot function. It looks correct to me, but may have gotchas I'm not
Again, this patch compiles cleanly, but is untested.
Created attachment 115164 [details]
patch to make nash clean out initramfs prior to switchrooting
Eek! Just realized that this patch will clean out the real root filesystem as
well. I'll need to add some way to make this not traverse mountpoints.
Don't use the above patch!
Created attachment 115167 [details]
updated patch, recursiveRemove shouldn't cross mountpoints
Ok, new patch that should prevent the recursiveRemove from crossing
mountpoints. If the stat.st_dev of a directory does not match that of the
parent directory, then we don't descend into that directory.
I've copied your patch over to #153069, I'm closing this as a dupe.
*** This bug has been marked as a duplicate of 153069 ***