Bug 159636

Summary: nash should clean out initramfs before switching to real rootfs
Product: [Fedora] Fedora Reporter: Jeff Layton <jlayton>
Component: mkinitrdAssignee: Peter Jones <pjones>
Status: CLOSED DUPLICATE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: mitr, steved
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-06-06 20:06:04 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 Flags
patch to make nash clean out initramfs prior to switchrooting
none
updated patch, recursiveRemove shouldn't cross mountpoints none

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 ***