Re: Fw: [2.6.5] A bunch of various minor bugs not fixed since 2.6.4

From: Sam Ravnborg
Date: Fri Apr 09 2004 - 12:48:49 EST


In general - do not use the kernel headers from userland.
Most of the problems described here is due to wrong usage
of kernel header files.

If you need to use the kernel header files for normal day-to-day
work you have a misconfigured system.

And DO NOT put kernel src in /usr/src/linux - this is only asking
for trouble.
Put it in /usr/src/linux-2.6.5 for example - with no symlinks to
/usr/src/linux

Some individual comments follows:

> 2. Platform-specific 'asm' symlink doesn't get created by 'make *config'
> I have got no idea how this could have slipped everyone's attention, but
> here it is:

make *config shall do minimal work, and is only supposed to create
.config. No side-effects such as crating a symlink.

> 3. 'make clean' seems to remove too much
> It seems some people cannot be satisfied... Before I complained about
> leftover junk, now I'm complaining about too few leftovers! Anyway, what
> goes away with 'clean' which I believe should only go away with
> 'mrproper':
> - the include/asm symlink
> - include/linux/autoconf.h
> Maybe there are more, but these are the two I have already found to
> cause software compilation errors when not present.

Point taken here. New cleaning style is:

clean: Leave enough to build external modules
mrproper: delete all generated files, including .config
distclean: Delete editor and patch backup files

If one needs to do the old trick:
save .config
make mrproper
restore .config

Then something is broken and needs fixing.

Sam

--- linux-2.6.5/Makefile 2004-04-09 14:03:35.000000000 +0200
+++ mm3/Makefile 2004-04-09 19:39:02.000000000 +0200
@@ -767,36 +767,34 @@ endef

###
# Cleaning is done on three levels.
-# make clean Delete all automatically generated files, including
-# tools and firmware.
-# make mrproper Delete the current configuration, and related files
-# Any core files spread around are deleted as well
+# make clean Delete most generated files
+# Leave enough to build external modules
+# make mrproper Delete the current configuration, and all generated files
# make distclean Remove editor backup files, patch leftover files and the like

# Directories & files removed with 'make clean'
-CLEAN_DIRS += $(MODVERDIR) include/config include2
-CLEAN_FILES += vmlinux System.map \
- include/linux/autoconf.h include/linux/version.h \
- include/asm include/linux/modversions.h \
- kernel.spec .tmp*
+CLEAN_DIRS += $(MODVERDIR)
+CLEAN_FILES += vmlinux System.map kernel.spec .tmp*

-# Files removed with 'make mrproper'
-MRPROPER_FILES += .version .config .config.old tags TAGS cscope*
+# Directories & files removed with 'make mrproper'
+MRPROPER_DIRS += include/config include2
+MRPROPER_FILES += .version .config .config.old tags TAGS cscope* \
+ include/linux/autoconf.h include/linux/version.h \
+ include/asm include/linux/modversions.h \

# clean - Delete all intermediate files
#
-clean-dirs += $(addprefix _clean_,$(ALL_SUBDIRS) Documentation/DocBook scripts)
-.PHONY: $(clean-dirs) clean archclean mrproper archmrproper distclean
+clean-dirs = $(addprefix _clean_,$(ALL_SUBDIRS))
+.PHONY: $(clean-dirs) clean archclean
$(clean-dirs):
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)

clean: rm-dirs := $(wildcard $(CLEAN_DIRS))
-mrproper: rm-dirs := $(wildcard $(MRPROPER_DIRS))
quiet_cmd_rmdirs = $(if $(rm-dirs),CLEAN $(rm-dirs))
cmd_rmdirs = rm -rf $(rm-dirs)

+
clean: rm-files := $(wildcard $(CLEAN_FILES))
-mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
quiet_cmd_rmfiles = $(if $(rm-files),CLEAN $(rm-files))
cmd_rmfiles = rm -rf $(rm-files)

@@ -810,10 +808,23 @@ clean: archclean $(clean-dirs)

# mrproper
#
-distclean: mrproper
-mrproper: clean archmrproper
+mrproper: rm-dirs := $(wildcard $(MRPROPER_DIRS))
+mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
+
+mrproper-dirs = $(addprefix _mrproper_,Documentation/DocBook scripts)
+.PHONY: $(mrproper-dirs) mrproper archmrproper
+$(mrproper-dirs):
+ $(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@)
+
+mrproper: clean archmrproper $(mrproper-dirs)
$(call cmd,rmdirs)
$(call cmd,rmfiles)
+
+# distclean
+#
+.PHONY: distclean
+
+distclean: mrproper
@find . $(RCS_FIND_IGNORE) \
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/