Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 159636 - nash should clean out initramfs before switching to real rootfs
Summary: nash should clean out initramfs before switching to real rootfs
Keywords:
Status: CLOSED DUPLICATE of bug 153069
Alias: None
Product: Fedora
Classification: Fedora
Component: mkinitrd
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Peter Jones
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-06-06 13:31 UTC by Jeff Layton
Modified: 2014-06-18 07:34 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-06-06 20:06:04 UTC


Attachments (Terms of Use)
patch to make nash clean out initramfs prior to switchrooting (deleted)
2005-06-06 13:31 UTC, Jeff Layton
no flags Details | Diff
updated patch, recursiveRemove shouldn't cross mountpoints (deleted)
2005-06-06 15:05 UTC, Jeff Layton
no flags Details | Diff

Description Jeff Layton 2005-06-06 13:31:06 UTC
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 13:31:07 UTC
Created attachment 115164 [details]
patch to make nash clean out initramfs prior to switchrooting

Comment 2 Jeff Layton 2005-06-06 14:42:12 UTC
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 15:05:03 UTC
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 20:06:04 UTC
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.