From 1d7266d3b59be361763dab61f680103bbb70f3e9 Mon Sep 17 00:00:00 2001 From: Jeremie Koenig Date: Mon, 19 Jul 2010 00:44:56 +0200 Subject: mark Linux-specific configuration options PLATFORM_LINUX is used as a dependency for applets or features which require Linux-specific interfaces. Signed-off-by: Jeremie Koenig Signed-off-by: Denys Vlasenko --- init/Config.src | 2 ++ init/bootchartd.c | 1 + 2 files changed, 3 insertions(+) (limited to 'init') diff --git a/init/Config.src b/init/Config.src index 590e29890..a5e76be6a 100644 --- a/init/Config.src +++ b/init/Config.src @@ -10,6 +10,7 @@ INSERT config INIT bool "init" default y + depends on PLATFORM_LINUX select FEATURE_SYSLOG help init is the first program run when the system boots. @@ -92,6 +93,7 @@ config FEATURE_INITRD config HALT bool "poweroff, halt, and reboot" default y + depends on PLATFORM_LINUX help Stop all processes and either halt, reboot, or power off the system. diff --git a/init/bootchartd.c b/init/bootchartd.c index dae2fe6e9..a1c01641b 100644 --- a/init/bootchartd.c +++ b/init/bootchartd.c @@ -6,6 +6,7 @@ //config:config BOOTCHARTD //config: bool "bootchartd" //config: default y +//config: depends on PLATFORM_LINUX //config: help //config: bootchartd is commonly used to profile the boot process //config: for the purpose of speeding it up. In this case, it is started -- cgit v1.2.3-55-g6feb From f812eace1863feeac64dc8af27f4ab0f98119618 Mon Sep 17 00:00:00 2001 From: Jeremie Koenig Date: Thu, 27 May 2010 15:37:32 +0200 Subject: init,loginutils: termios portability fixes Signed-off-by: Jeremie Koenig Signed-off-by: Denys Vlasenko --- init/init.c | 17 ++++++++++++++++- loginutils/Config.src | 2 -- loginutils/getty.c | 27 ++++++++++++++------------- loginutils/login.c | 2 +- 4 files changed, 31 insertions(+), 17 deletions(-) (limited to 'init') diff --git a/init/init.c b/init/init.c index 2eb8f1a54..1388c75cc 100644 --- a/init/init.c +++ b/init/init.c @@ -14,11 +14,19 @@ #include #include #include +#ifdef __linux__ #include +#endif #if ENABLE_FEATURE_UTMP # include /* DEAD_PROCESS */ #endif +/* Used only for sanitizing purposes in set_sane_term() below. On systems where + * the baud rate is stored in a separate field, we can safely disable them. */ +#ifndef CBAUD +# define CBAUD 0 +# define CBAUDEX 0 +#endif /* Was a CONFIG_xxx option. A lot of people were building * not fully functional init by switching it on! */ @@ -166,7 +174,9 @@ static void message(int where, const char *fmt, ...) static void console_init(void) { +#ifdef VT_OPENQRY int vtno; +#endif char *s; s = getenv("CONSOLE"); @@ -190,6 +200,7 @@ static void console_init(void) } s = getenv("TERM"); +#ifdef VT_OPENQRY if (ioctl(STDIN_FILENO, VT_OPENQRY, &vtno) != 0) { /* Not a linux terminal, probably serial console. * Force the TERM setting to vt102 @@ -198,7 +209,9 @@ static void console_init(void) putenv((char*)"TERM=vt102"); if (!ENABLE_FEATURE_INIT_SYSLOG) log_console = NULL; - } else if (!s) + } else +#endif + if (!s) putenv((char*)"TERM=linux"); } @@ -220,8 +233,10 @@ static void set_sane_term(void) tty.c_cc[VSTOP] = 19; /* C-s */ tty.c_cc[VSUSP] = 26; /* C-z */ +#ifdef __linux__ /* use line discipline 0 */ tty.c_line = 0; +#endif /* Make it be sane */ tty.c_cflag &= CBAUD | CBAUDEX | CSIZE | CSTOPB | PARENB | PARODD; diff --git a/loginutils/Config.src b/loginutils/Config.src index 425d041b9..6ec289355 100644 --- a/loginutils/Config.src +++ b/loginutils/Config.src @@ -179,7 +179,6 @@ config DELUSER config GETTY bool "getty" default y - depends on PLATFORM_LINUX select FEATURE_SYSLOG help getty lets you log in on a tty, it is normally invoked by init. @@ -187,7 +186,6 @@ config GETTY config LOGIN bool "login" default y - depends on PLATFORM_LINUX select FEATURE_SUID select FEATURE_SYSLOG help diff --git a/loginutils/getty.c b/loginutils/getty.c index a5e8e906a..7f04d33fb 100644 --- a/loginutils/getty.c +++ b/loginutils/getty.c @@ -282,10 +282,8 @@ static void termios_init(struct termios *tp, int speed, struct options *op) * reads will be done in raw mode anyway. Errors will be dealt with * later on. */ -#ifdef __linux__ /* flush input and output queues, important for modems! */ - ioctl(0, TCFLSH, TCIOFLUSH); /* tcflush(0, TCIOFLUSH)? - same */ -#endif + tcflush(0, TCIOFLUSH); ispeed = ospeed = speed; if (speed == B0) { /* Speed was specified as "0" on command line. @@ -299,10 +297,13 @@ static void termios_init(struct termios *tp, int speed, struct options *op) cfsetispeed(tp, ispeed); cfsetospeed(tp, ospeed); - tp->c_iflag = tp->c_lflag = tp->c_line = 0; + tp->c_iflag = tp->c_lflag = 0; tp->c_oflag = OPOST | ONLCR; tp->c_cc[VMIN] = 1; tp->c_cc[VTIME] = 0; +#ifdef __linux__ + tp->c_line = 0; +#endif /* Optionally enable hardware flow control */ #ifdef CRTSCTS @@ -360,10 +361,8 @@ static void auto_baud(char *buf, unsigned size_buf, struct termios *tp) for (bp = buf; bp < buf + nread; bp++) { if (isdigit(*bp)) { speed = bcode(bp); - if (speed > 0) { - tp->c_cflag &= ~CBAUD; - tp->c_cflag |= speed; - } + if (speed > 0) + cfsetspeed(tp, speed); break; } } @@ -417,7 +416,7 @@ static char *get_logname(char *logname, unsigned size_logname, /* Flush pending input (esp. after parsing or switching the baud rate). */ sleep(1); - ioctl(0, TCFLSH, TCIFLUSH); /* tcflush(0, TCIOFLUSH)? - same */ + tcflush(0, TCIOFLUSH); /* Prompt for and read a login name. */ logname[0] = '\0'; @@ -526,7 +525,9 @@ static void termios_final(struct options *op, struct termios *tp, struct chardat tp->c_cc[VQUIT] = DEF_QUIT; /* default quit */ tp->c_cc[VEOF] = DEF_EOF; /* default EOF character */ tp->c_cc[VEOL] = DEF_EOL; +#ifdef VSWTC tp->c_cc[VSWTC] = DEF_SWITCH; /* default switch character */ +#endif /* Account for special characters seen in input. */ if (cp->eol == CR) { @@ -572,8 +573,8 @@ static void termios_final(struct options *op, struct termios *tp, struct chardat #endif /* Finally, make the new settings effective */ - /* It's tcsetattr_stdin_TCSANOW() + error check */ - ioctl_or_perror_and_die(0, TCSETS, tp, "%s: TCSETS", op->tty); + if (tcsetattr_stdin_TCSANOW(tp) < 0) + bb_perror_msg_and_die("%s: tcsetattr", op->tty); } int getty_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; @@ -650,8 +651,8 @@ int getty_main(int argc UNUSED_PARAM, char **argv) * by patching the SunOS kernel variable "zsadtrlow" to a larger value; * 5 seconds seems to be a good value. */ - /* tcgetattr() + error check */ - ioctl_or_perror_and_die(0, TCGETS, &termios, "%s: TCGETS", options.tty); + if (tcgetattr(0, &termios) < 0) + bb_perror_msg_and_die("%s: tcgetattr", options.tty); pid = getpid(); #ifdef __linux__ diff --git a/loginutils/login.c b/loginutils/login.c index 88ed0af78..10012486f 100644 --- a/loginutils/login.c +++ b/loginutils/login.c @@ -264,7 +264,7 @@ int login_main(int argc UNUSED_PARAM, char **argv) while (1) { /* flush away any type-ahead (as getty does) */ - ioctl(0, TCFLSH, TCIFLUSH); + tcflush(0, TCIFLUSH); if (!username[0]) get_username_or_die(username, sizeof(username)); -- cgit v1.2.3-55-g6feb From 714674e4da3d92c5dd14e00ab30794a895b91eb4 Mon Sep 17 00:00:00 2001 From: Jeremie Koenig Date: Thu, 27 May 2010 15:38:44 +0200 Subject: init,halt: portability improvements * make init and halt use the same RB_* constants for reboot() * conditionalize the Linux-specific code Inspired by init.init.diff from the Debian kFreeBSD patches at: http://svn.debian.org/viewsvn/d-i/people/slackydeb/kfreebsd/busybox/1.14/debian Signed-off-by: Jeremie Koenig Signed-off-by: Denys Vlasenko --- init/Config.src | 2 -- init/halt.c | 14 +------------- init/init.c | 16 ++++++++-------- init/reboot.h | 31 +++++++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 23 deletions(-) create mode 100644 init/reboot.h (limited to 'init') diff --git a/init/Config.src b/init/Config.src index a5e76be6a..590e29890 100644 --- a/init/Config.src +++ b/init/Config.src @@ -10,7 +10,6 @@ INSERT config INIT bool "init" default y - depends on PLATFORM_LINUX select FEATURE_SYSLOG help init is the first program run when the system boots. @@ -93,7 +92,6 @@ config FEATURE_INITRD config HALT bool "poweroff, halt, and reboot" default y - depends on PLATFORM_LINUX help Stop all processes and either halt, reboot, or power off the system. diff --git a/init/halt.c b/init/halt.c index f1bb2c4a8..abd801fda 100644 --- a/init/halt.c +++ b/init/halt.c @@ -8,7 +8,7 @@ */ #include "libbb.h" -#include +#include "reboot.h" #if ENABLE_FEATURE_WTMP #include @@ -36,18 +36,6 @@ static void write_wtmp(void) #define write_wtmp() ((void)0) #endif -#ifndef RB_HALT_SYSTEM -#define RB_HALT_SYSTEM RB_HALT -#endif - -#ifndef RB_POWERDOWN -/* Stop system and switch power off if possible. */ -# define RB_POWERDOWN 0x4321fedc -#endif -#ifndef RB_POWER_OFF -# define RB_POWER_OFF RB_POWERDOWN -#endif - int halt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int halt_main(int argc UNUSED_PARAM, char **argv) diff --git a/init/init.c b/init/init.c index 1388c75cc..d8bf15894 100644 --- a/init/init.c +++ b/init/init.c @@ -12,7 +12,6 @@ #include "libbb.h" #include #include -#include #include #ifdef __linux__ #include @@ -20,6 +19,7 @@ #if ENABLE_FEATURE_UTMP # include /* DEAD_PROCESS */ #endif +#include "reboot.h" /* reboot() constants */ /* Used only for sanitizing purposes in set_sane_term() below. On systems where * the baud rate is stored in a separate field, we can safely disable them. */ @@ -97,13 +97,6 @@ static const char *log_console = VC_5; enum { L_LOG = 0x1, L_CONSOLE = 0x2, -#ifndef RB_HALT_SYSTEM - RB_HALT_SYSTEM = 0xcdef0123, /* FIXME: this overflows enum */ - RB_ENABLE_CAD = 0x89abcdef, - RB_DISABLE_CAD = 0, - RB_POWER_OFF = 0x4321fedc, - RB_AUTOBOOT = 0x01234567, -#endif }; /* Print a message to the specified device. @@ -724,10 +717,12 @@ static void restart_handler(int sig UNUSED_PARAM) run_shutdown_and_kill_processes(); +#ifdef RB_ENABLE_CAD /* Allow Ctrl-Alt-Del to reboot the system. * This is how kernel sets it up for init, we follow suit. */ reboot(RB_ENABLE_CAD); /* misnomer */ +#endif if (open_stdio_to_tty(a->terminal)) { dbg_message(L_CONSOLE, "Trying to re-exec %s", a->command); @@ -870,9 +865,11 @@ int init_main(int argc UNUSED_PARAM, char **argv) ) { bb_show_usage(); } +#ifdef RB_DISABLE_CAD /* Turn off rebooting via CTL-ALT-DEL - we get a * SIGINT on CAD so we can shut things down gracefully... */ reboot(RB_DISABLE_CAD); /* misnomer */ +#endif } /* Figure out where the default console should be */ @@ -895,6 +892,8 @@ int init_main(int argc UNUSED_PARAM, char **argv) message(L_CONSOLE | L_LOG, "init started: %s", bb_banner); #endif +/* struct sysinfo is linux-specific */ +#ifdef __linux__ /* Make sure there is enough memory to do something useful. */ if (ENABLE_SWAPONOFF) { struct sysinfo info; @@ -910,6 +909,7 @@ int init_main(int argc UNUSED_PARAM, char **argv) run_actions(SYSINIT); /* wait and removing */ } } +#endif /* Check if we are supposed to be in single user mode */ if (argv[1] diff --git a/init/reboot.h b/init/reboot.h new file mode 100644 index 000000000..ff045fdd1 --- /dev/null +++ b/init/reboot.h @@ -0,0 +1,31 @@ +/* + * Definitions related to the reboot() system call, + * shared between init.c and halt.c. + */ + +#include + +#ifndef RB_HALT_SYSTEM +# if defined(__linux__) +# define RB_HALT_SYSTEM 0xcdef0123 +# define RB_ENABLE_CAD 0x89abcdef +# define RB_DISABLE_CAD 0 +# define RB_POWER_OFF 0x4321fedc +# define RB_AUTOBOOT 0x01234567 +# elif defined(RB_HALT) +# define RB_HALT_SYSTEM RB_HALT +# endif +#endif + +/* Stop system and switch power off if possible. */ +#ifndef RB_POWER_OFF +# if defined(RB_POWERDOWN) +# define RB_POWER_OFF RB_POWERDOWN +# elif defined(__linux__) +# define RB_POWER_OFF 0x4321fedc +# else +# warning "poweroff unsupported, using halt as fallback" +# define RB_POWER_OFF RB_HALT_SYSTEM +# endif +#endif + -- cgit v1.2.3-55-g6feb From 1c05303fdc302725093294eb0305adc003d52bcb Mon Sep 17 00:00:00 2001 From: Jeremie Koenig Date: Thu, 27 May 2010 15:46:07 +0200 Subject: init: make the initial $TERM value configurable Signed-off-by: Jeremie Koenig Signed-off-by: Denys Vlasenko --- init/Config.src | 12 ++++++++++++ init/init.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'init') diff --git a/init/Config.src b/init/Config.src index 590e29890..2cac3573e 100644 --- a/init/Config.src +++ b/init/Config.src @@ -89,6 +89,18 @@ config FEATURE_INITRD This does not apply to initramfs, which runs /init as PID 1 and requires no special support. +config INIT_TERMINAL_TYPE + string "Initial terminal type" + default "linux" + depends on INIT + help + This is the initial value set by init for the TERM environment + variable. This variable is used by programs which make use of + extended terminal capabilities. + + Note that on Linux, init attempts to detect serial terminal and + sets TERM to "vt102" if one is found. + config HALT bool "poweroff, halt, and reboot" default y diff --git a/init/init.c b/init/init.c index d8bf15894..fa1af6d7c 100644 --- a/init/init.c +++ b/init/init.c @@ -205,7 +205,7 @@ static void console_init(void) } else #endif if (!s) - putenv((char*)"TERM=linux"); + putenv((char*)"TERM=" CONFIG_INIT_TERMINAL_TYPE); } /* Set terminal settings to reasonable defaults. -- cgit v1.2.3-55-g6feb From ba2dcccd799963ac74ee92300df494947820608b Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 26 Jul 2010 01:49:12 +0200 Subject: *: trailing empty lines removed Signed-off-by: Denys Vlasenko --- archival/libunarchive/unxz/README | 1 - debianutils/Config.src | 1 - docs/busybox_footer.pod | 1 - docs/cgi/cl.html | 2 +- docs/cgi/env.html | 2 +- docs/cgi/in.html | 2 +- docs/cgi/interface.html | 2 +- docs/cgi/out.html | 2 +- docs/contributing.txt | 2 -- docs/posix_conformance.txt | 1 - e2fsprogs/old_e2fsprogs/e2fsck.h | 2 -- e2fsprogs/old_e2fsprogs/e2p/ostype.c | 2 -- examples/bootfloppy/display.txt | 1 - examples/bootfloppy/etc/fstab | 1 - examples/bootfloppy/etc/inittab | 1 - examples/bootfloppy/etc/profile | 1 - examples/bootfloppy/mkrootfs.sh | 1 - examples/inittab | 1 - init/reboot.h | 1 - libbb/README | 1 - libbb/selinux_common.c | 1 - networking/libiproute/ll_proto.c | 1 - scripts/Makefile.host | 1 - scripts/Makefile.lib | 2 -- scripts/basic/docproc.c | 1 - scripts/find_stray_empty_lines | 10 ++++++++++ scripts/kconfig/check.sh | 1 - scripts/kconfig/lex.zconf.c_shipped | 1 - scripts/kconfig/menu.c | 1 - scripts/kconfig/util.c | 1 - scripts/kconfig/zconf.hash.c_shipped | 1 - scripts/kconfig/zconf.tab.c_shipped | 2 -- scripts/showasm | 1 - selinux/Config.src | 1 - shell/hush_test/hush-misc/break1.tests | 1 - sysklogd/Config.src | 1 - testsuite/basename/basename-works | 1 - testsuite/dirname/dirname-works | 1 - testsuite/expr/expr-works | 1 - testsuite/ln/ln-preserves-soft-links | 1 - testsuite/readlink.tests | 1 - testsuite/uptime/uptime-works | 1 - 42 files changed, 15 insertions(+), 46 deletions(-) (limited to 'init') diff --git a/archival/libunarchive/unxz/README b/archival/libunarchive/unxz/README index f79b0a404..c5972f6b8 100644 --- a/archival/libunarchive/unxz/README +++ b/archival/libunarchive/unxz/README @@ -133,4 +133,3 @@ Specifying the calling convention For example, on Windows, you may make all functions use the stdcall calling convention by defining XZ_FUNC=__stdcall when building and using the functions from XZ Embedded. - diff --git a/debianutils/Config.src b/debianutils/Config.src index 838d8f00c..cbc09b5ce 100644 --- a/debianutils/Config.src +++ b/debianutils/Config.src @@ -83,4 +83,3 @@ config WHICH print out their pathnames. endmenu - diff --git a/docs/busybox_footer.pod b/docs/busybox_footer.pod index 5ed937991..47eabaeeb 100644 --- a/docs/busybox_footer.pod +++ b/docs/busybox_footer.pod @@ -253,4 +253,3 @@ Tito Ragusa devfsd and size optimizations in strings, openvt and deallocvt. =cut - diff --git a/docs/cgi/cl.html b/docs/cgi/cl.html index 5779d623e..4f8faae9f 100644 --- a/docs/cgi/cl.html +++ b/docs/cgi/cl.html @@ -43,4 +43,4 @@ CGI - Common Gateway Interface

cgi@ncsa.uiuc.edu
- \ No newline at end of file + diff --git a/docs/cgi/env.html b/docs/cgi/env.html index 924026b3e..b83c750bf 100644 --- a/docs/cgi/env.html +++ b/docs/cgi/env.html @@ -146,4 +146,4 @@ interface specification

CGI - Common Gateway Interface

cgi@ncsa.uiuc.edu
- \ No newline at end of file + diff --git a/docs/cgi/in.html b/docs/cgi/in.html index 679306aaa..7ee5fe601 100644 --- a/docs/cgi/in.html +++ b/docs/cgi/in.html @@ -30,4 +30,4 @@ interface specification

CGI - Common Gateway Interface

cgi@ncsa.uiuc.edu
- \ No newline at end of file + diff --git a/docs/cgi/interface.html b/docs/cgi/interface.html index ea73ce3a2..0be016b4c 100644 --- a/docs/cgi/interface.html +++ b/docs/cgi/interface.html @@ -26,4 +26,4 @@ the following is a hotlink to graphic detail.

CGI - Common Gateway Interface

cgi@ncsa.uiuc.edu
- \ No newline at end of file + diff --git a/docs/cgi/out.html b/docs/cgi/out.html index 2203ee5a0..5266985b5 100644 --- a/docs/cgi/out.html +++ b/docs/cgi/out.html @@ -123,4 +123,4 @@ interface specification

CGI - Common Gateway Interface

cgi@ncsa.uiuc.edu
- \ No newline at end of file + diff --git a/docs/contributing.txt b/docs/contributing.txt index d06e4a2da..39aaef1b5 100644 --- a/docs/contributing.txt +++ b/docs/contributing.txt @@ -426,5 +426,3 @@ you're having difficulty following some of the steps outlined in this document don't worry, the folks on the Busybox mailing list are a fairly good-natured bunch and will work with you to help get your patches into shape or help you make contributions. - - diff --git a/docs/posix_conformance.txt b/docs/posix_conformance.txt index d9fa116b8..5b616d701 100644 --- a/docs/posix_conformance.txt +++ b/docs/posix_conformance.txt @@ -739,4 +739,3 @@ xargs Busybox specific options: zcat POSIX options: None zcat Busybox specific options: None - diff --git a/e2fsprogs/old_e2fsprogs/e2fsck.h b/e2fsprogs/old_e2fsprogs/e2fsck.h index 73d398ff4..fdfa2d84a 100644 --- a/e2fsprogs/old_e2fsprogs/e2fsck.h +++ b/e2fsprogs/old_e2fsprogs/e2fsck.h @@ -636,5 +636,3 @@ static inline int tid_geq(tid_t x, tid_t y) int difference = (x - y); return (difference >= 0); } - - diff --git a/e2fsprogs/old_e2fsprogs/e2p/ostype.c b/e2fsprogs/old_e2fsprogs/e2p/ostype.c index 1abe2ba91..6a2f178f3 100644 --- a/e2fsprogs/old_e2fsprogs/e2p/ostype.c +++ b/e2fsprogs/old_e2fsprogs/e2p/ostype.c @@ -70,5 +70,3 @@ int main(int argc, char **argv) exit(0); } #endif - - diff --git a/examples/bootfloppy/display.txt b/examples/bootfloppy/display.txt index 399d326d9..7cae48bb3 100644 --- a/examples/bootfloppy/display.txt +++ b/examples/bootfloppy/display.txt @@ -1,4 +1,3 @@ This boot floppy is made with Busybox, uClibc, and the Linux kernel. Hit RETURN to boot or enter boot parameters at the prompt below. - diff --git a/examples/bootfloppy/etc/fstab b/examples/bootfloppy/etc/fstab index ef14ca2cc..b31f60217 100644 --- a/examples/bootfloppy/etc/fstab +++ b/examples/bootfloppy/etc/fstab @@ -1,2 +1 @@ proc /proc proc defaults 0 0 - diff --git a/examples/bootfloppy/etc/inittab b/examples/bootfloppy/etc/inittab index eb3e979ce..1ac9f68ce 100644 --- a/examples/bootfloppy/etc/inittab +++ b/examples/bootfloppy/etc/inittab @@ -2,4 +2,3 @@ ::respawn:-/bin/sh tty2::askfirst:-/bin/sh ::ctrlaltdel:/bin/umount -a -r - diff --git a/examples/bootfloppy/etc/profile b/examples/bootfloppy/etc/profile index 8a7c77d78..cf68d3393 100644 --- a/examples/bootfloppy/etc/profile +++ b/examples/bootfloppy/etc/profile @@ -5,4 +5,3 @@ echo -n "Processing /etc/profile... " # no-op echo "Done" echo - diff --git a/examples/bootfloppy/mkrootfs.sh b/examples/bootfloppy/mkrootfs.sh index 5cdff21a0..a7fc48b13 100755 --- a/examples/bootfloppy/mkrootfs.sh +++ b/examples/bootfloppy/mkrootfs.sh @@ -102,4 +102,3 @@ then rmdir $TARGET_DIR gzip -9 rootfs fi - diff --git a/examples/inittab b/examples/inittab index 64fc4fce1..c4e0af514 100644 --- a/examples/inittab +++ b/examples/inittab @@ -87,4 +87,3 @@ tty5::respawn:/sbin/getty 38400 tty6 ::ctrlaltdel:/sbin/reboot ::shutdown:/bin/umount -a -r ::shutdown:/sbin/swapoff -a - diff --git a/init/reboot.h b/init/reboot.h index ff045fdd1..949763949 100644 --- a/init/reboot.h +++ b/init/reboot.h @@ -28,4 +28,3 @@ # define RB_POWER_OFF RB_HALT_SYSTEM # endif #endif - diff --git a/libbb/README b/libbb/README index 4f28f7e34..6e63dc5f2 100644 --- a/libbb/README +++ b/libbb/README @@ -8,4 +8,3 @@ that you wrote that is mis-attributed, do let me know so we can fix that up. Erik Andersen - diff --git a/libbb/selinux_common.c b/libbb/selinux_common.c index 7b5696754..2acb50e96 100644 --- a/libbb/selinux_common.c +++ b/libbb/selinux_common.c @@ -53,4 +53,3 @@ void FAST_FUNC selinux_preserve_fcontext(int fdesc) setfscreatecon_or_die(context); freecon(context); } - diff --git a/networking/libiproute/ll_proto.c b/networking/libiproute/ll_proto.c index 145902b2e..1cd576f1d 100644 --- a/networking/libiproute/ll_proto.c +++ b/networking/libiproute/ll_proto.c @@ -126,4 +126,3 @@ int FAST_FUNC ll_proto_a2n(unsigned short *id, char *buf) *id = htons(i); return 0; } - diff --git a/scripts/Makefile.host b/scripts/Makefile.host index 23bd9ff10..2e628508d 100644 --- a/scripts/Makefile.host +++ b/scripts/Makefile.host @@ -153,4 +153,3 @@ $(host-cshlib): %: $(host-cshobjs) FORCE targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\ $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs) - diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index be679b624..3e54ea712 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -168,5 +168,3 @@ cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@ quiet_cmd_gzip = GZIP $@ cmd_gzip = gzip -f -9 < $< > $@ - - diff --git a/scripts/basic/docproc.c b/scripts/basic/docproc.c index 50ef37157..db30019d8 100644 --- a/scripts/basic/docproc.c +++ b/scripts/basic/docproc.c @@ -397,4 +397,3 @@ int main(int argc, char **argv) fflush(stdout); return exitstatus; } - diff --git a/scripts/find_stray_empty_lines b/scripts/find_stray_empty_lines index 58daf2f0c..60873dac1 100755 --- a/scripts/find_stray_empty_lines +++ b/scripts/find_stray_empty_lines @@ -5,3 +5,13 @@ grep -n -A1 -r $'^\t*{$' . | grep -B1 '.[ch]-[0-9]*-$' # or (less surefire ones): grep -n -B1 -r $'^\t*}' . | grep -A1 '.[ch]-[0-9]*-$' grep -n -A1 -r $'^\t*{' . | grep -B1 '.[ch]-[0-9]*-$' + +# find trailing empty lines +find -type f | xargs tail -1 | while read file; do + test x"$file" = x"" && continue + read lastline + #echo "|$file|$lastline" + if test x"$lastline" = x""; then + echo "$file" + fi +done diff --git a/scripts/kconfig/check.sh b/scripts/kconfig/check.sh index fa59cbf9d..15fc29421 100755 --- a/scripts/kconfig/check.sh +++ b/scripts/kconfig/check.sh @@ -11,4 +11,3 @@ EOF if [ ! "$?" -eq "0" ]; then echo -DKBUILD_NO_NLS; fi - diff --git a/scripts/kconfig/lex.zconf.c_shipped b/scripts/kconfig/lex.zconf.c_shipped index 5fc323de3..4837bbf64 100644 --- a/scripts/kconfig/lex.zconf.c_shipped +++ b/scripts/kconfig/lex.zconf.c_shipped @@ -2322,4 +2322,3 @@ char *zconf_curname(void) { return current_pos.file ? current_pos.file->name : ""; } - diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 0fce20cb7..14cf2ead0 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -394,4 +394,3 @@ struct menu *menu_get_parent_menu(struct menu *menu) } return menu; } - diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c index ef4c83228..263091945 100644 --- a/scripts/kconfig/util.c +++ b/scripts/kconfig/util.c @@ -112,4 +112,3 @@ const char *str_get(struct gstr *gs) { return gs->s; } - diff --git a/scripts/kconfig/zconf.hash.c_shipped b/scripts/kconfig/zconf.hash.c_shipped index 345f0fc07..d39cf189a 100644 --- a/scripts/kconfig/zconf.hash.c_shipped +++ b/scripts/kconfig/zconf.hash.c_shipped @@ -228,4 +228,3 @@ kconf_id_lookup (register const char *str, register unsigned int len) } return 0; } - diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped index b62724da0..a27d256d6 100644 --- a/scripts/kconfig/zconf.tab.c_shipped +++ b/scripts/kconfig/zconf.tab.c_shipped @@ -2169,5 +2169,3 @@ void zconfdump(FILE *out) #include "expr.c" #include "symbol.c" #include "menu.c" - - diff --git a/scripts/showasm b/scripts/showasm index 046442653..dc2cd705d 100755 --- a/scripts/showasm +++ b/scripts/showasm @@ -18,4 +18,3 @@ then fi objdump -d $1 | sed -n -e '/./{H;$!d}' -e "x;/^.[0-9a-fA-F]* <$2>:/p" - diff --git a/selinux/Config.src b/selinux/Config.src index 64a99203e..47d15b6af 100644 --- a/selinux/Config.src +++ b/selinux/Config.src @@ -122,4 +122,3 @@ config SESTATUS Displays the status of SELinux. endmenu - diff --git a/shell/hush_test/hush-misc/break1.tests b/shell/hush_test/hush-misc/break1.tests index 912f149c1..3a6b060d9 100755 --- a/shell/hush_test/hush-misc/break1.tests +++ b/shell/hush_test/hush-misc/break1.tests @@ -1,3 +1,2 @@ while true; do echo A; break; echo B; done echo OK:$? - diff --git a/sysklogd/Config.src b/sysklogd/Config.src index bfe2d1cc3..41c0d286b 100644 --- a/sysklogd/Config.src +++ b/sysklogd/Config.src @@ -128,4 +128,3 @@ config LOGGER problems that occur within programs and scripts. endmenu - diff --git a/testsuite/basename/basename-works b/testsuite/basename/basename-works index 38907d4c1..7140e9988 100644 --- a/testsuite/basename/basename-works +++ b/testsuite/basename/basename-works @@ -1,2 +1 @@ test x$(basename $(pwd)) = x$(busybox basename $(pwd)) - diff --git a/testsuite/dirname/dirname-works b/testsuite/dirname/dirname-works index f339c8f73..d673dd937 100644 --- a/testsuite/dirname/dirname-works +++ b/testsuite/dirname/dirname-works @@ -1,2 +1 @@ test x$(dirname $(pwd)) = x$(busybox dirname $(pwd)) - diff --git a/testsuite/expr/expr-works b/testsuite/expr/expr-works index af49ac4d5..5a0fffbdc 100644 --- a/testsuite/expr/expr-works +++ b/testsuite/expr/expr-works @@ -56,4 +56,3 @@ busybox expr 0 \>= 1 if [ $? != 1 ] ; then exit 1; fi; - diff --git a/testsuite/ln/ln-preserves-soft-links b/testsuite/ln/ln-preserves-soft-links index a8123ece3..3a49bedf4 100644 --- a/testsuite/ln/ln-preserves-soft-links +++ b/testsuite/ln/ln-preserves-soft-links @@ -6,4 +6,3 @@ if [ $? != 0 ] ; then exit 0; fi exit 1; - diff --git a/testsuite/readlink.tests b/testsuite/readlink.tests index e6822dff1..ecc3ad03e 100755 --- a/testsuite/readlink.tests +++ b/testsuite/readlink.tests @@ -29,4 +29,3 @@ testing "readlink -f on a wierd dir" "readlink -f $TESTDIR/../$TESTFILE" "$PWD/$ # clean up rm -r "$TESTLINK" "$TESTDIR" - diff --git a/testsuite/uptime/uptime-works b/testsuite/uptime/uptime-works index 80e578778..6b168ab0e 100644 --- a/testsuite/uptime/uptime-works +++ b/testsuite/uptime/uptime-works @@ -1,2 +1 @@ busybox uptime - -- cgit v1.2.3-55-g6feb From e7a0632b7b38f635853a08c276dad2fbd395ba92 Mon Sep 17 00:00:00 2001 From: Jeremie Koenig Date: Thu, 29 Jul 2010 04:29:53 +0200 Subject: bootchartd: mounting tmpfs is Linux-specific Signed-off-by: Jeremie Koenig Signed-off-by: Denys Vlasenko --- init/bootchartd.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'init') diff --git a/init/bootchartd.c b/init/bootchartd.c index a1c01641b..465a34979 100644 --- a/init/bootchartd.c +++ b/init/bootchartd.c @@ -6,7 +6,6 @@ //config:config BOOTCHARTD //config: bool "bootchartd" //config: default y -//config: depends on PLATFORM_LINUX //config: help //config: bootchartd is commonly used to profile the boot process //config: for the purpose of speeding it up. In this case, it is started @@ -46,12 +45,15 @@ #include "libbb.h" /* After libbb.h, since it needs sys/types.h on some systems */ #include -#include -#ifndef MS_SILENT -# define MS_SILENT (1 << 15) -#endif -#ifndef MNT_DETACH -# define MNT_DETACH 0x00000002 + +#ifdef __linux__ +# include +# ifndef MS_SILENT +# define MS_SILENT (1 << 15) +# endif +# ifndef MNT_DETACH +# define MNT_DETACH 0x00000002 +# endif #endif #define BC_VERSION_STR "0.8" @@ -175,6 +177,7 @@ static char *make_tempdir(void) char template[] = "/tmp/bootchart.XXXXXX"; char *tempdir = xstrdup(mkdtemp(template)); if (!tempdir) { +#ifdef __linux__ /* /tmp is not writable (happens when we are used as init). * Try to mount a tmpfs, them cd and lazily unmount it. * Since we unmount it at once, we can mount it anywhere. @@ -192,6 +195,9 @@ static char *make_tempdir(void) if (umount2(try_dir, MNT_DETACH) != 0) { bb_perror_msg_and_die("can't %smount tmpfs", "un"); } +#else + bb_perror_msg_and_die("can't create temporary directory"); +#endif } else { xchdir(tempdir); } -- cgit v1.2.3-55-g6feb