From 9a6ab331a670d4b1d0feec901360f4a786389eb7 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 22 Jun 2015 13:30:44 +0200 Subject: [PATCH] Refactor: Move rest of finit.h settings to configure script. Signed-off-by: Joachim Nilsson --- configure | 21 ++++++++++++++++++--- finit.h | 13 ------------- tty.c | 1 + 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/configure b/configure index 047b34b0..a10ebe81 100755 --- a/configure +++ b/configure @@ -346,13 +346,25 @@ echo >> config.m echo "export libdir plugindir incdir CPPFLAGS LDFLAGS LDLIBS STATIC" >> config.mk ############################################################################## -echo "/* Generated by finit configure script. */" > config.h - +echo "/* Generated by finit configure script. */" > config.h +echo >> config.h +echo "#ifndef FINIT_CONFIG_H_" >> config.h +echo "#define FINIT_CONFIG_H_" >> config.h +echo >> config.h echo "#define INIT_HEADING $heading" >> config.h echo "#define VERBOSE_MODE $verbose" >> config.h echo "#define KERNEL_QUIET $kernel_quiet" >> config.h if [ $embedded -eq 1 ]; then - echo "#define EMBEDDED_SYSTEM 1" >> config.h + echo "#define EMBEDDED_SYSTEM 1" >> config.h + echo "#define SETUP_DEVFS \"/sbin/mdev -s\"" >> config.h + echo "#define GETTY \"/sbin/getty -L\"" >> config.h + echo "#define GETTY_BUSYBOX 1" >> config.h + echo "#define BAUDRATE 115200" >> config.h +else + echo "#define SETUP_DEVFS \"/sbin/udevd --daemon\"" >> config.h + echo "#define GETTY \"/sbin/getty -8\"" >> config.h + echo "#define GETTY_AGETTY 1" >> config.h + echo "#define BAUDRATE 38400" >> config.h fi if [ $remount -eq 1 ]; then echo "#define REMOUNT_ROOTFS 1" >> config.h @@ -378,3 +390,6 @@ fi echo "#define DEFUSER \"$defuser\"" >> config.h echo "#define DEFHOST \"$defhost\"" >> config.h echo "#define RUNLEVEL $runlevel" >> config.h + +echo >> config.h +echo "#endif /* FINIT_CONFIG_H_ */" >> config.h diff --git a/finit.h b/finit.h index 79f6a76b..fd903c61 100644 --- a/finit.h +++ b/finit.h @@ -36,19 +36,6 @@ #include #include -/* Distribution specific configuration */ -#if defined EMBEDDED_SYSTEM -# define SETUP_DEVFS "/sbin/mdev -s" -# define GETTY "/sbin/getty -L" -# define GETTY_BUSYBOX /* Tell tty.c about the getty argument order */ -# define BAUDRATE 115200 -#else /* Debian/Ubuntu based distributions */ -# define SETUP_DEVFS "/sbin/udevd --daemon" -# define GETTY "/sbin/getty -8" -# define GETTY_AGETTY /* Tell tty.c about the getty argument order */ -# define BAUDRATE 38400 -#endif - /* If the user configures us to not know about any getty use the system * defined /bin/sh (or similar) as fallback for TTYs. */ #ifndef FALLBACK_SHELL diff --git a/tty.c b/tty.c index cd7cfa00..55660a6f 100644 --- a/tty.c +++ b/tty.c @@ -25,6 +25,7 @@ #include #include +#include "config.h" /* Generated by configure script */ #include "finit.h" #include "conf.h" #include "helpers.h"