]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fs: make binfmt support for #! scripts modular and removable
authorJosh Triplett <josh@joshtriplett.org>
Tue, 30 Apr 2013 22:27:44 +0000 (15:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 May 2013 00:04:04 +0000 (17:04 -0700)
Add a new configuration option CONFIG_BINFMT_SCRIPT to configure support
for interpreted scripts starting with "#!"; allow compiling out that
support, or building it as a module.  Embedded systems running exclusively
compiled binaries could leave this support out, and systems that don't
need scripts before mounting the root filesystem can build this as a
module.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/Kconfig.binfmt
fs/Makefile

index 0efd1524b9770844cf74899f067686073a1c730d..370b24cee4d84b08a9855cf9598bb156dd41ffec 100644 (file)
@@ -65,6 +65,20 @@ config CORE_DUMP_DEFAULT_ELF_HEADERS
          This config option changes the default setting of coredump_filter
          seen at boot time.  If unsure, say Y.
 
+config BINFMT_SCRIPT
+       tristate "Kernel support for scripts starting with #!"
+       default y
+       help
+         Say Y here if you want to execute interpreted scripts starting with
+         #! followed by the path to an interpreter.
+
+         You can build this support as a module; however, until that module
+         gets loaded, you cannot run scripts.  Thus, if you want to load this
+         module from an initramfs, the portion of the initramfs before loading
+         this module must consist of compiled binaries only.
+
+         Most systems will not boot if you say M or N here.  If unsure, say Y.
+
 config BINFMT_FLAT
        bool "Kernel support for flat binaries"
        depends on !MMU && (!FRV || BROKEN)
index 3b2c76759ec9dcd7389b5dbdb02399a2726d464c..5e67e57b59dcb730d18a75b7edcdaa3f4632f1a7 100644 (file)
@@ -34,10 +34,7 @@ obj-$(CONFIG_COMPAT)         += compat.o compat_ioctl.o
 obj-$(CONFIG_BINFMT_AOUT)      += binfmt_aout.o
 obj-$(CONFIG_BINFMT_EM86)      += binfmt_em86.o
 obj-$(CONFIG_BINFMT_MISC)      += binfmt_misc.o
-
-# binfmt_script is always there
-obj-y                          += binfmt_script.o
-
+obj-$(CONFIG_BINFMT_SCRIPT)    += binfmt_script.o
 obj-$(CONFIG_BINFMT_ELF)       += binfmt_elf.o
 obj-$(CONFIG_COMPAT_BINFMT_ELF)        += compat_binfmt_elf.o
 obj-$(CONFIG_BINFMT_ELF_FDPIC) += binfmt_elf_fdpic.o