diff -urN linux-2.4.32-bootdev/fs/proc/proc_misc.c linux-2.4.32-opmode/fs/proc/proc_misc.c --- linux-2.4.32-bootdev/fs/proc/proc_misc.c 2005-11-22 10:17:03.000000000 +0100 +++ linux-2.4.32-opmode/fs/proc/proc_misc.c 2005-11-22 10:17:30.000000000 +0100 @@ -467,6 +467,16 @@ return proc_calc_metrics(page, start, off, count, eof, len); } +static int boot_opmode_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + extern int saved_opmode; + int len = 0; + + proc_sprintf(page, &off, &len, "%d\n", saved_opmode); + return proc_calc_metrics(page, start, off, count, eof, len); +} + #ifdef CONFIG_SGI_DS1286 static int ds1286_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -639,6 +649,8 @@ create_proc_read_entry("bootdev", S_IRUGO, proc_boot, \ boot_bootdev_read_proc, NULL); + create_proc_read_entry("opmode", S_IRUGO, proc_boot, \ + boot_opmode_read_proc, NULL); proc_symlink("mounts", NULL, "self/mounts"); diff -urN linux-2.4.32-bootdev/init/main.c linux-2.4.32-opmode/init/main.c --- linux-2.4.32-bootdev/init/main.c 2005-11-22 10:29:35.000000000 +0100 +++ linux-2.4.32-opmode/init/main.c 2005-11-22 10:29:54.000000000 +0100 @@ -238,6 +238,17 @@ } __setup("bootdev=", parse_bootdev); +/* let's define this as 0:production, 1:debug in prod, 2:debug in dev */ +int saved_opmode = 0; +static int __init parse_opmode(char *str) +{ + int par; + if (get_option(&str,&par)) + saved_opmode = par; + return 1; +} +__setup("opmode=", parse_opmode); + /* * This is a simple kernel command line parsing function: it parses * the command line, and fills in the arguments/environment to init