config/global/ct-behave.in
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Thu Jan 10 22:38:48 2013 +0100 (2013-01-10)
changeset 3163 06938bc1c6e7
parent 3083 3a7b2eee9dcd
permissions -rw-r--r--
scripts: check for running as root

Running as root is really, really dangerous.

Add a runtime-check that refuses to build if running as root.
Can be overriden with a double switch in the menuconfig.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
     1 # Options specific to crosstool-NG overall behavior
     2 
     3 comment "crosstool-NG behavior"
     4 
     5 config OBSOLETE
     6     bool
     7     prompt "Use obsolete features"
     8     help
     9       If you set this to Y, you will be able to select obsolete features.
    10       
    11       Such obsolete features are the use of old kernel headers, old gcc
    12       versions, etc... for which maintaining support in crosstool-NG
    13       would be very costly.
    14       
    15       It does not however mean that the specific feature or version has been
    16       marked obsolete by the upstream team.
    17 
    18 config EXPERIMENTAL
    19     bool
    20     prompt "Try features marked as EXPERIMENTAL"
    21     help
    22       If you set this to Y, then you will be able to try very experimental
    23       features.
    24       
    25       Experimental features can be one of:
    26         - working, in which case you should tell me it is!
    27         - buggy, in which case you could try patching and send me the result
    28         - unfinished, in which case you could try hacking it and send me the result
    29         - non-existant, in which case you could also try hacking it in and send me
    30           the result
    31 
    32 config ALLOW_BUILD_AS_ROOT
    33     bool
    34     prompt "Allow building as root user (READ HELP!)"
    35     depends on EXPERIMENTAL
    36     help
    37       You normally do *not* need to be root to build a toolchain using
    38       crosstool-NG. In fact, it is *VERY* dangerous to run as root, as
    39       crosstool-NG will, as part of the build process, remove a few
    40       directories. If anything goes wrong, running as root can ruin
    41       your host distribution.
    42       
    43       I can't stress it enough:  DO  NOT  RUN  AS  ROOT  !!
    44       
    45       Do not run as root, you've been warned.
    46       Do not come whining, if it nukes your host system.
    47       Do not come whining, if you lose any data.
    48       Do not run as root.
    49       
    50       Do not run as root, you've been warned.
    51       Do not come whining, if the Earth stops rotating.
    52       Do not come whining, if kittens are smashed.
    53       Do not run as root.
    54       
    55       Do not run as root, do not run as root!
    56       (ad libitum)
    57 
    58 config ALLOW_BUILD_AS_ROOT_SURE
    59     bool
    60     prompt "Are you sure?"
    61     depends on ALLOW_BUILD_AS_ROOT
    62 
    63 config DEBUG_CT
    64     bool
    65     prompt "Debug crosstool-NG"
    66     depends on ! BACKEND
    67     help
    68       Say 'y' here to get some options regarding debugging crosstool-NG.
    69 
    70 if DEBUG_CT
    71 
    72 config DEBUG_PAUSE_STEPS
    73     bool
    74     prompt "Pause between every steps"
    75     help
    76       Say 'y' if you intend to attend the build, and want to investigate
    77       the result of each steps before running the next one.
    78 
    79 config DEBUG_CT_SAVE_STEPS
    80     bool
    81     prompt "Save intermediate steps"
    82     help
    83       If you say 'y' here, then you will be able to restart crosstool-NG at
    84       any step.
    85       
    86       It is not currently possible to restart at any of the debug facilities.
    87       They are treated as a whole.
    88       
    89       To get the full list os steps, run: ct-ng list-steps
    90 
    91 config DEBUG_CT_SAVE_STEPS_GZIP
    92     bool
    93     prompt "gzip saved states"
    94     default y
    95     depends on DEBUG_CT_SAVE_STEPS
    96     help
    97       If you are tight on space, then you can ask to gzip the saved states
    98       tarballs. On the other hand, this takes some longer time...
    99       
   100       To lose as less time as possible, the gzip process is done with a low
   101       compression ratio (-3), which gives roughly 70% gain in size. Going
   102       further doesn't gain much, and takes far more time (believe me, I've
   103       got figures here! :-) ).
   104 
   105 config NO_OVERIDE_LC_MESSAGES
   106     bool
   107     prompt "Do *not* overide LC_MESSAGES (EXPERIMENTAL)"
   108     depends on EXPERIMENTAL
   109     help
   110       By default, crosstool-NG sets and exports LC_ALL=C so that the
   111       build.log file contains english messages, that can be read by
   112       people most likely to help interpret the logs. If you say N here,
   113       and your locale is not an english language, then dissecting your
   114       log file will be difficult for most people but you.
   115       
   116       If you say Y here, then your current locale settings will be used
   117       to print messages, instead of plain english.
   118       
   119       Say N, please.
   120 
   121 config DEBUG_INTERACTIVE
   122     bool
   123     prompt "Interactive shell on failed commands"
   124     help
   125       If you say 'y' here, then an interactive shell will be spawned for
   126       each failed command.
   127       
   128       This shell will have the same environment that the failed command
   129       was run with, and the working directory will be set to the directory
   130       the failed command was run in.
   131       
   132       After you fix the issue, you can exit the interactive shell with any
   133       of these exit codes:
   134         1  the issue was fixed, continue the build with the next command
   135         2  the issue was fixed, re-run the failed command
   136         3  abort the build
   137       
   138       Note: '2' is only possible for commands run via CT_DoExecLog, though.
   139 
   140 endif