* [PATCH] make distclean tries to delete dirs in tmpfs
@ 2001-05-09 18:44 Ingo Oeser
2001-05-09 22:29 ` H. Peter Anvin
0 siblings, 1 reply; 3+ messages in thread
From: Ingo Oeser @ 2001-05-09 18:44 UTC (permalink / raw)
To: linux-kernel
Hi there,
make distclean deletes anything with size 0. This includes
directories, while making the kernel in tmpfs or ramfs.
This patch solves it, by not deleting directories in this rule.
Patch applies to any official kernel and with offsets even to
recent ac series.
--- linux-2.4.2-ac19/Makefile.orig Wed May 9 10:47:04 2001
+++ linux-2.4.2-ac19/Makefile Wed May 9 10:51:04 2001
@@ -415,7 +415,8 @@
$(MAKE) -C Documentation/DocBook mrproper
distclean: mrproper
- rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
+ rm -f core `find . \( -not -type d \) -and \
+ \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -print` TAGS tags
Regards
Ingo Oeser
--
10.+11.03.2001 - 3. Chemnitzer LinuxTag <http://www.tu-chemnitz.de/linux/tag>
<<<<<<<<<<<< been there and had much fun >>>>>>>>>>>>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] make distclean tries to delete dirs in tmpfs 2001-05-09 18:44 [PATCH] make distclean tries to delete dirs in tmpfs Ingo Oeser @ 2001-05-09 22:29 ` H. Peter Anvin 2001-05-10 7:33 ` Ingo Oeser 0 siblings, 1 reply; 3+ messages in thread From: H. Peter Anvin @ 2001-05-09 22:29 UTC (permalink / raw) To: linux-kernel Followup to: <20010509204434.Q754@nightmaster.csn.tu-chemnitz.de> By author: Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de> In newsgroup: linux.dev.kernel > > make distclean deletes anything with size 0. This includes > directories, while making the kernel in tmpfs or ramfs. > Wouldn't it be better to fix tmpfs/ramfs to report something sensible, even if it's artificial? Perhaps reporting the cardinality of the directory, if that happens to be easily available. N.B.: X/KDE will not run on a ramfs, because it reports as a size-zero filesystem in "df". Switching to tmpfs solved that for me. -hpa -- <hpa@transmeta.com> at work, <hpa@zytor.com> in private! "Unix gives you enough rope to shoot yourself in the foot." http://www.zytor.com/~hpa/puzzle.txt ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] make distclean tries to delete dirs in tmpfs 2001-05-09 22:29 ` H. Peter Anvin @ 2001-05-10 7:33 ` Ingo Oeser 0 siblings, 0 replies; 3+ messages in thread From: Ingo Oeser @ 2001-05-10 7:33 UTC (permalink / raw) To: H. Peter Anvin; +Cc: linux-kernel On Wed, May 09, 2001 at 03:29:28PM -0700, H. Peter Anvin wrote: > By author: Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de> > > make distclean deletes anything with size 0. This includes > > directories, while making the kernel in tmpfs or ramfs. > Wouldn't it be better to fix tmpfs/ramfs to report something sensible, > even if it's artificial? No, because it gives it as arguments to "rm" (which only deletes files by defintion) and not to "rm -rf" (which also deletes directories). Not excluding directories from the arguments to "rm" is the BUG. All my scripts always do that, just the kernel Makefile doesn't. And it might even be faster, because we don't have to do all the other tests, if it's not an directory ;-) > N.B.: X/KDE will not run on a ramfs, because it reports as a size-zero > filesystem in "df". Switching to tmpfs solved that for me. This is partially a ramfs BUG, because filesystems are supposed to do accounting ;-) OTOH, querying the available space before transfers says NOTHING about the sucess of an operation. kfm is not the only application running and the fs might do delayed allocation. Applications should not check for free space, they should try to allocate it (and maybe touch it, if we are not IO bound) and watch for ENOSPC instead. Then we truncate all written stuff to the extend, where it made sense, delete the whole file if it has become size 0 and emit an error telling the user, that we had not enough disk space at this time to succeed. We don't check for available memory either, so why do it on disk? It made sense in DOS times, but doesn't do anymore. It's only relevant to the administrator to tell him, that we need a bigger disk ;-) Regards Ingo Oeser -- 10.+11.03.2001 - 3. Chemnitzer LinuxTag <http://www.tu-chemnitz.de/linux/tag> <<<<<<<<<<<< been there and had much fun >>>>>>>>>>>> ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-05-10 12:06 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2001-05-09 18:44 [PATCH] make distclean tries to delete dirs in tmpfs Ingo Oeser 2001-05-09 22:29 ` H. Peter Anvin 2001-05-10 7:33 ` Ingo Oeser
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.