From 6ffa4d43382fe8187a0b336b091d1c400a4a7081 Mon Sep 17 00:00:00 2001 From: dir Date: Thu, 30 Nov 2017 14:48:41 +0100 Subject: Implement mdev logging output on demand @upstream --- package/base-files/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'package/base-files/Makefile') diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 78da71657..8a8a26e5e 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -21,6 +21,12 @@ CONFIG_STYLE:= manual BUILD_STYLE:= manual INSTALL_STYLE:= manual +ifeq ($(ADK_RUNTIME_DEV_MDEV_LOGGING),y) +ADK_RUNTIME_DEV_MDEV_LOGGING_LINE:='echo >/dev/mdev.log' +else +ADK_RUNTIME_DEV_MDEV_LOGGING_LINE:='' +endif + do-install: $(CP) ./src/* $(IDIR_BASE_FILES) mkdir -p $(IDIR_BASE_FILES)/{etc,dev,boot,root,sys,proc,tmp,run,var,mnt,media} @@ -55,9 +61,11 @@ endif endif ifeq ($(ADK_RUNTIME_DEV_MDEV),y) $(CP) ./files/rcdev.mdev $(IDIR_BASE_FILES)/etc/init.d/rcdev + $(SED) "s#@ADK_RUNTIME_DEV_MDEV_LOGGING@#"$(ADK_RUNTIME_DEV_MDEV_LOGGING_LINE)"#g" $(IDIR_BASE_FILES)/etc/init.d/rcdev $(CP) ./files/mdev.conf $(IDIR_BASE_FILES)/etc $(CP) ./files/mdev $(IDIR_BASE_FILES)/etc endif + ifeq ($(ADK_RUNTIME_DEV_UDEV),y) $(CP) ./files/rcdev.udev $(IDIR_BASE_FILES)/etc/init.d/rcdev endif -- cgit v1.2.3 From e9a80817647b5ac556519822251abd0346b6d468 Mon Sep 17 00:00:00 2001 From: dir Date: Tue, 2 Jan 2018 18:10:24 +0100 Subject: Add simple autologin program to be started by getty @upstream --- package/autologin/Makefile | 33 +++++++++++++++++++++++++++++++++ package/autologin/src/autologin.c | 10 ++++++++++ package/base-files/Makefile | 7 +++++++ package/base-files/files/inittab.serial | 2 +- target/config/Config.in.runtime | 5 +++++ 5 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 package/autologin/Makefile create mode 100644 package/autologin/src/autologin.c (limited to 'package/base-files/Makefile') diff --git a/package/autologin/Makefile b/package/autologin/Makefile new file mode 100644 index 000000000..cc6fdb66a --- /dev/null +++ b/package/autologin/Makefile @@ -0,0 +1,33 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(ADK_TOPDIR)/rules.mk + +PKG_NAME:= autologin +PKG_VERSION:= 1.0 +PKG_RELEASE:= 1 +PKG_DESCR:= tool to automatically login a user with getty +PKG_SECTION:= sys/misc + +PKG_NOPARALLEL:= 1 +NO_DISTFILES:= 1 + +include $(ADK_TOPDIR)/mk/package.mk + +$(eval $(call PKG_template,AUTOLOGIN,autologin,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) + +CONFIG_STYLE:= manual +BUILD_STYLE:= manual +INSTALL_STYLE:= manual + +TARGET_CPPFLAGS+= -I../autologin +TARGET_CPPFLAGS+= -D_GNU_SOURCE + +do-build: + $(CC) src/autologin.c -o $(WRKBUILD)/autologin + +autologin-install: + $(INSTALL_DIR) $(IDIR_AUTOLOGIN)/bin + $(INSTALL_BIN) $(WRKBUILD)/autologin $(IDIR_AUTOLOGIN)/bin + +include ${ADK_TOPDIR}/mk/pkg-bottom.mk diff --git a/package/autologin/src/autologin.c b/package/autologin/src/autologin.c new file mode 100644 index 000000000..14c7eeb56 --- /dev/null +++ b/package/autologin/src/autologin.c @@ -0,0 +1,10 @@ +// This file is part of the OpenADK project. OpenADK is copyrighted +// material, please see the LICENCE file in the top-level directory. + +#include +#include + +int main() +{ + return execlp("login\0","login\0","-f\0", "root\0" ,0); +} diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 8a8a26e5e..e9dd3d9cc 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -27,6 +27,12 @@ else ADK_RUNTIME_DEV_MDEV_LOGGING_LINE:='' endif +ifeq ($(ADK_RUNTIME_GETTY_SERIAL_AUTOLOGIN),y) +ADK_RUNTIME_GETTY_SERIAL_AUTOLOGIN_STANZA:= -n -l autologin +else +ADK_RUNTIME_GETTY_SERIAL_AUTOLOGIN_STANZA:= +endif + do-install: $(CP) ./src/* $(IDIR_BASE_FILES) mkdir -p $(IDIR_BASE_FILES)/{etc,dev,boot,root,sys,proc,tmp,run,var,mnt,media} @@ -83,6 +89,7 @@ endif cat ./files/inittab.serial >> $(IDIR_BASE_FILES)/etc/inittab $(SED) 's#@DEVICE@#$(ADK_RUNTIME_CONSOLE_SERIAL_DEVICE)#g' $(IDIR_BASE_FILES)/etc/inittab $(SED) 's#@SPEED@#$(ADK_RUNTIME_CONSOLE_SERIAL_SPEED)#' $(IDIR_BASE_FILES)/etc/inittab + $(SED) 's#@AUTOLOGIN@#$(ADK_RUNTIME_GETTY_SERIAL_AUTOLOGIN_STANZA)#' $(IDIR_BASE_FILES)/etc/inittab endif ifeq ($(ADK_RUNTIME_INIT_SYSVINIT),y) cp ./files/inittab.sysvinit $(IDIR_BASE_FILES)/etc/inittab diff --git a/package/base-files/files/inittab.serial b/package/base-files/files/inittab.serial index dcb09e438..ef31f1599 100644 --- a/package/base-files/files/inittab.serial +++ b/package/base-files/files/inittab.serial @@ -1 +1 @@ -@DEVICE@::respawn:/sbin/getty -i -L @DEVICE@ @SPEED@ vt100 +@DEVICE@::respawn:/sbin/getty -i -L @DEVICE@ @SPEED@ vt100 @AUTOLOGIN@ diff --git a/target/config/Config.in.runtime b/target/config/Config.in.runtime index 35f65b48d..7697bcaf9 100644 --- a/target/config/Config.in.runtime +++ b/target/config/Config.in.runtime @@ -367,6 +367,11 @@ config ADK_RUNTIME_GETTY_SERIAL help Start getty on serial console. +config ADK_RUNTIME_GETTY_SERIAL_AUTOLOGIN + bool "run autologin on serial getty" + depends on ADK_RUNTIME_GETTY_SERIAL + select ADK_PACKAGE_AUTOLOGIN + config ADK_RUNTIME_CONSOLE_VGA_DEVICE string "VGA console device" depends on ADK_TARGET_WITH_VGA || ADK_TARGET_GENERIC -- cgit v1.2.3 From 70a42f6597b06f9be12db1bd32bb6a97d4a2e182 Mon Sep 17 00:00:00 2001 From: dir Date: Wed, 28 Feb 2018 21:03:58 +0100 Subject: Add option to mount debugfs at startup @upstream --- package/base-files/Makefile | 4 ++++ target/config/Config.in.runtime | 6 ++++++ 2 files changed, 10 insertions(+) (limited to 'package/base-files/Makefile') diff --git a/package/base-files/Makefile b/package/base-files/Makefile index e9dd3d9cc..95f22f6f0 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -93,6 +93,10 @@ endif endif ifeq ($(ADK_RUNTIME_INIT_SYSVINIT),y) cp ./files/inittab.sysvinit $(IDIR_BASE_FILES)/etc/inittab +endif +ifeq ($(ADK_RUNTIME_MOUNT_DEBUGFS),y) + echo debugfs /sys/kernel/debug debugfs defaults 0 0 >> $(IDIR_BASE_FILES)/etc/fstab + echo null::sysinit:/bin/mount -a -t debugfs >> $(IDIR_BASE_FILES)/etc/inittab endif test -z $(ADK_RUNTIME_HOSTNAME) || \ echo $(ADK_RUNTIME_HOSTNAME) > $(IDIR_BASE_FILES)/etc/hostname; \ diff --git a/target/config/Config.in.runtime b/target/config/Config.in.runtime index 7697bcaf9..9c9b9cd49 100644 --- a/target/config/Config.in.runtime +++ b/target/config/Config.in.runtime @@ -188,6 +188,12 @@ config ADK_RUNTIME_USER_SHELL help Set the shell to use. +config ADK_RUNTIME_MOUNT_DEBUGFS + bool "mount debugfs" + depends on !ADK_RUNTIME_INIT_SYSTEMD + help + mount debugfs under /sys/kernel/debug + config ADK_RUNTIME_START_SERVICES bool "start services by default" default n -- cgit v1.2.3