summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authordir <dir@ableton.com>2018-01-02 17:10:24 (GMT)
committerdir <dir@ableton.com>2018-08-13 15:54:03 (GMT)
commite9a80817647b5ac556519822251abd0346b6d468 (patch)
tree95464aabbd0a023604794d6116a90add4389b2f4 /package
parent07c3b1bf959087d37b7746189d93b929500855eb (diff)
Add simple autologin program to be started by getty
@upstream
Diffstat (limited to 'package')
-rw-r--r--package/autologin/Makefile33
-rw-r--r--package/autologin/src/autologin.c10
-rw-r--r--package/base-files/Makefile7
-rw-r--r--package/base-files/files/inittab.serial2
4 files changed, 51 insertions, 1 deletions
diff --git a/package/autologin/Makefile b/package/autologin/Makefile
new file mode 100644
index 0000000..cc6fdb6
--- /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 0000000..14c7eeb
--- /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 <unistd.h>
+#include <stdio.h>
+
+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 8a8a26e..e9dd3d9 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 dcb09e4..ef31f15 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@