Bug 159636 - nash should clean out initramfs before switching to real rootfs
nash should clean out initramfs before switching to real rootfs
Status: CLOSED DUPLICATE of bug 153069
Product: Fedora
Classification: Fedora
Component: mkinitrd (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Jones
David Lawrence
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-06 09:31 EDT by Jeff Layton
Modified: 2014-06-18 03:34 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-06-06 16:06:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to make nash clean out initramfs prior to switchrooting (1.74 KB, patch)
2005-06-06 09:31 EDT, Jeff Layton
no flags Details | Diff
updated patch, recursiveRemove shouldn't cross mountpoints (1.99 KB, patch)
2005-06-06 11:05 EDT, Jeff Layton
no flags Details | Diff

  None (edit)
Description Jeff Layton 2005-06-06 09:31:06 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
aware of.

Again, this patch compiles cleanly, but is untested.
Comment 1 Jeff Layton 2005-06-06 09:31:07 EDT
Created attachment 115164 [details]
patch to make nash clean out initramfs prior to switchrooting
Comment 2 Jeff Layton 2005-06-06 10:42:12 EDT
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!
Comment 3 Jeff Layton 2005-06-06 11:05:03 EDT
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.
Comment 4 Peter Jones 2005-06-06 16:06:04 EDT
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 ***

Note You need to log in before you can comment on or make changes to this bug.