Re: [PATCH] Use /dev/.oldtmp instead of /oldtmp when moving around initrd /tmp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2011-02-22 at 07:48 +0100, Ales Kozumplik wrote:
> Hi Will,
> 
> On 02/21/2011 08:58 PM, Will Woods wrote:
> >       /* we want our /tmp to be tmpfs, but we also want to let people hack
> >        * their initrds to add things like a ks.cfg, so this has to be a little
> >        * tricky */
> > -    rename("/tmp", "/oldtmp");
> > +    copyDirectory("/tmp", "/dev/.oldtmp", copyErrorFn, copyErrorFn);
> >       mkdir("/tmp", 0755);
> 
> Shouldn't there be step that recursively removes /tmp after you've 
> copied it, because this way the files that were in /tmp originally will 
> stay there and the mkdir below fails (or is it what you intended)?

Oh shoot, you're right. Probably there needs to be an unlink("/tmp")[1]
before the mkdir()...

...except that wouldn't make sense if / was readonly, which is part of
the goal of this patch. Hmm.

> Or we can drop this altogether and tell people who want to tweak the 
> initrds they need to put their stuff in /cantbelieveitsnottmp.

Well, one of the things my in-progress squashfs patch does is put the
extra contents of initramfs at /initramfs (which is also a tmpfs). So in
that case we could just do:

copyDirectory("/initramfs/tmp", "/tmp", copyErrorFn, copyErrorFn);
unlink("/initramfs/tmp");

*after* mount tmpfs at /tmp. This seems much cleaner to me.

So: ignore this patch for now, and we'll revisit if/when I actually post
the squashfs patchset.

-w

[1] we're already depending on the OS-specific implementation of unlink
allowing unlink("directory"), so I don't feel bad about using that here.

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux