Skip to contentSkip to conversation

Consolidate binfmt choices in Kconfig

PATCH In review Matthew Wilcox 2 participants 3 messages Jun 12, 2003 exec and binfmt

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Consolidate binfmt choices in Kconfig

The full patch is around 60k, and is available from
http://ftp.linux.org.uk/pub/linux/willy/patches/binfmt-Kconfig.diff

 21 files changed, 117 insertions(+), 922 deletions(-)

It's very repetitive, so to give a flavour for it, here's i386, m68knommu and fs/Kconfig.binfmt. I rewrote the BINFMT_AOUT helptext to bring it into this decade.

Comments welcomed; I'll send it to Linus tomorrow if I don't hear anything.

Index: arch/i386/Kconfig
===================================================================
RCS file: /var/cvs/linux-2.5/arch/i386/Kconfig,v
retrieving revision 1.22

i386/Kconfig +1 -75
diff -u -p -r1.22 Kconfig
@@ -1176,81 +1176,7 @@ config KCORE_AOUT
 
 endchoice
 
-config BINFMT_AOUT
-	tristate "Kernel support for a.out binaries"
-	---help---
-	  A.out (Assembler.OUTput) is a set of formats for libraries and
-	  executables used in the earliest versions of UNIX. Linux used the
-	  a.out formats QMAGIC and ZMAGIC until they were replaced with the
-	  ELF format.
-
-	  As more and more programs are converted to ELF, the use for a.out
-	  will gradually diminish. If you disable this option it will reduce
-	  your kernel by one page. This is not much and by itself does not
-	  warrant removing support. However its removal is a good idea if you
-	  wish to ensure that absolutely none of your programs will use this
-	  older executable format. If you don't know what to answer at this
-	  point then answer Y. If someone told you "You need a kernel with
-	  QMAGIC support" then you'll have to say Y here. You may answer M to
-	  compile a.out support as a module and later load the module when you
-	  want to use a program or library in a.out format. The module will be
-	  called binfmt_aout. Saying M or N here is dangerous though,
-	  because some crucial programs on your system might still be in A.OUT
-	  format.
-
-config BINFMT_ELF
-	tristate "Kernel support for ELF binaries"
-	---help---
-	  ELF (Executable and Linkable Format) is a format for libraries and
-	  executables used across different architectures and operating
-	  systems. Saying Y here will enable your kernel to run ELF binaries
-	  and enlarge it by about 13 KB. ELF support under Linux has now all
-	  but replaced the traditional Linux a.out formats (QMAGIC and ZMAGIC)
-	  because it is portable (this does *not* mean that you will be able
-	  to run executables from different architectures or operating systems
-	  however) and makes building run-time libraries very easy. Many new
-	  executables are distributed solely in ELF format. You definitely
-	  want to say Y here.
-
-	  Information about ELF is contained in the ELF HOWTO available from
-	  <http://www.tldp.org/docs.html#howto>.
-
-	  If you find that after upgrading from Linux kernel 1.2 and saying Y
-	  here, you still can't run any ELF binaries (they just crash), then
-	  you'll have to install the newest ELF runtime libraries, including
-	  ld.so (check the file <file:Documentation/Changes> for location and
-	  latest version).
-
-	  If you want to compile this as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want),
-	  say M here and read <file:Documentation/modules.txt>.  The module
-	  will be called binfmt_elf. Saying M or N here is dangerous because
-	  some crucial programs on your system might be in ELF format.
-
-config BINFMT_MISC
-	tristate "Kernel support for MISC binaries"
-	---help---
-	  If you say Y here, it will be possible to plug wrapper-driven binary
-	  formats into the kernel. You will like this especially when you use
-	  programs that need an interpreter to run like Java, Python or
-	  Emacs-Lisp. It's also useful if you often run DOS executables under
-	  the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from
-	  <http://www.tldp.org/docs.html#howto>). Once you have
-	  registered such a binary class with the kernel, you can start one of
-	  those programs simply by typing in its name at a shell prompt; Linux
-	  will automatically feed it to the correct interpreter.
-
-	  You can do other nice things, too. Read the file
-	  <file:Documentation/binfmt_misc.txt> to learn how to use this
-	  feature, and <file:Documentation/java.txt> for information about how
-	  to include Java support.
-
-	  You must say Y to "/proc file system support" (CONFIG_PROC_FS) to
-	  use this part of the kernel.
-
-	  You may say M here for module support and later load the module when
-	  you have use for it; the module is called binfmt_misc. If you
-	  don't know what to answer at this point, say Y.
+source "fs/Kconfig.binfmt"
 
 endmenu
 

Index: arch/m68knommu/Kconfig
===================================================================
RCS file: /var/cvs/linux-2.5/arch/m68knommu/Kconfig,v retrieving revision 1.10

m68knommu/Kconfig +1 -10
diff -u -p -r1.10 Kconfig
@@ -501,16 +501,7 @@ config KCORE_AOUT
 config KCORE_ELF
 	default y
 
-config BINFMT_FLAT
-	tristate "Kernel support for flat binaries"
-	help
-	  Support uClinux FLAT format binaries.
-
-config BINFMT_ZFLAT
-	bool "  Enable ZFLAT support"
-	depends on BINFMT_FLAT
-	help
-	  Supoprt FLAT format compressed binaries
+source "fs/Kconfig.binfmt"
 
 endmenu
 

Index: fs/Kconfig.binfmt
===================================================================
RCS file: fs/Kconfig.binfmt

Kconfig.binfmt new file +96 -0

96 lines not on this page · raw message

Signature · 3 lines
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
#1 lore raw
Quoted 10 lines · Matthew Wilcox

The full patch is around 60k, and is available from
http://ftp.linux.org.uk/pub/linux/willy/patches/binfmt-Kconfig.diff

 21 files changed, 117 insertions(+), 922 deletions(-)

It's very repetitive, so to give a flavour for it, here's i386, m68knommu and fs/Kconfig.binfmt. I rewrote the BINFMT_AOUT helptext to bring it into this decade.

Comments welcomed; I'll send it to Linus tomorrow if I don't hear anything.

Just a nit:

Quoted 2 lines

Index: fs/Kconfig.binfmt
===================================================================

[snip]

Kconfig.binfmt line 42

Quoted 11 lines
Kconfig.binfmt new file +11 -0
+config BINFMT_FLAT
+	tristate "Kernel support for flat binaries"
+	depends on !MMU
+	help
+	  Support uClinux FLAT format binaries.
+
+config BINFMT_ZFLAT
+	bool "  Enable ZFLAT support"
+	depends on BINFMT_FLAT
+	help
+	  Support FLAT format compressed binaries

Shouldn't that just be:
bool "Enable ZFLAT support"
as the config bits take care of indentation now?

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#2 lore raw
Quoted 7 lines · Tom Rini

Just a nit:

Kconfig.binfmt line 39

Quoted 2 lines
Kconfig.binfmt new file +2 -0
+config BINFMT_ZFLAT
+	bool "  Enable ZFLAT support"

Shouldn't that just be:
bool "Enable ZFLAT support"
as the config bits take care of indentation now?

Yep, thanks, updated patch uploaded.

Signature · 3 lines
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk