Skip to contentSkip to conversation

nodm: new package

PATCH Superseded Ezequiel Garcia 2 participants 4 messages Jun 21, 2016 – Jun 29, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nodm: new package

---
I don't have much experience with PAM, so feel free to suggest a better PAM file.

Tested on Minnowboard Turbot, using the minnowboard_max-graphical defconfig.

 package/Config.in      |  1 +
 package/nodm/Config.in | 14 ++++++++++++++
 package/nodm/S90nodm   | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++
 package/nodm/nodm.hash |  1 +
 package/nodm/nodm.mk   | 28 +++++++++++++++++++++++++++
 package/nodm/nodm.pam  | 14 ++++++++++++++
 6 files changed, 109 insertions(+)
 create mode 100644 package/nodm/Config.in
 create mode 100644 package/nodm/S90nodm
 create mode 100644 package/nodm/nodm.hash
 create mode 100644 package/nodm/nodm.mk
 create mode 100644 package/nodm/nodm.pam
package/Config.in +1 -0
index ce71afb7816a..0f5d1c07dc7d 100644
@@ -307,6 +307,7 @@ comment "X applications"
 	source "package/gtkperf/Config.in"
 	source "package/leafpad/Config.in"
 	source "package/midori/Config.in"
+	source "package/nodm/Config.in"
 	source "package/pcmanfm/Config.in"
 	source "package/qt-webkit-kiosk/Config.in"
 	source "package/rdesktop/Config.in"
package/nodm/Config.in new file +14 -0
new file mode 100644
index 000000000000..e6231076b1ee
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_NODM
+	bool "nodm"
+	depends on BR2_PACKAGE_XORG7
+	select BR2_PACKAGE_LINUX_PAM
+
+	help
+	  nodm is a minimal display manager that simply logs in
+	  as a given user and starts an X session, without asking
+	  for username or password.
+
+	  For those cases where automatic login is needed (and
+	  does not imply a security issue), nodm is simple to setup,
+	  lightweight, and it should do exactly the right thing.
+
package/nodm/S90nodm new file +51 -0

51 lines not on this page · raw message

package/nodm/nodm.hash new file +1 -0
new file mode 100644
index 000000000000..84de255946db
@@ -0,0 +1 @@
+sha256	77a002928e832eb6737fb92ad6b3477fce68167b4bc86eba5586868cc1337524	nodm_0.12-1.tar.gz
package/nodm/nodm.mk new file +28 -0
new file mode 100644
index 000000000000..0cad9c623960
@@ -0,0 +1,28 @@
+################################################################################
+#
+# nodm
+#
+################################################################################
+
+NODM_VERSION = 0.12
+NODM_SOURCE = nodm_$(NODM_VERSION)-1.tar.gz
+NODM_SITE = http://http.debian.net/debian/pool/main/n/nodm
+NODM_LICENSE = GPLv2+
+NODM_LICENSE_FILES = COPYING
+NODM_AUTORECONF=YES
+
+NODM_DEPENDENCIES = xlib_libX11 linux-pam
+
+define NODM_INSTALL_PAM
+	$(INSTALL) -D -m 0644 package/nodm/nodm.pam \
+		$(TARGET_DIR)/etc/pam.d/nodm
+endef
+
+NODM_POST_INSTALL_TARGET_HOOKS += NODM_INSTALL_PAM
+
+define NODM_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 package/nodm/S90nodm \
+		$(TARGET_DIR)/etc/init.d/S90nodm
+endef
+
+$(eval $(autotools-package))
package/nodm/nodm.pam new file +14 -0
new file mode 100644
index 000000000000..f2cf43217a23
@@ -0,0 +1,14 @@
+# Log service and allow promiscuously
+#
+auth		required	pam_warn.so
+auth		required	pam_unix.so
+
+account		required	pam_warn.so
+account		required	pam_permit.so
+
+password	required	pam_warn.so
+password	required	pam_permit.so
+
+session		required	pam_warn.so
+session		required	pam_permit.so
+session		required	pam_env.so
Signature · 1 line
2.7.0
#1 lore raw

PATCH 1/1 nodm: new package

Quoted 40 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Ezequiel" == Ezequiel Garcia <[email protected]> writes:

---
I don't have much experience with PAM, so feel free to suggest a better PAM file.

Tested on Minnowboard Turbot, using the minnowboard_max-graphical defconfig.

 package/Config.in      |  1 +
 package/nodm/Config.in | 14 ++++++++++++++
 package/nodm/S90nodm   | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++
 package/nodm/nodm.hash |  1 +
 package/nodm/nodm.mk   | 28 +++++++++++++++++++++++++++
 package/nodm/nodm.pam  | 14 ++++++++++++++
 6 files changed, 109 insertions(+)
 create mode 100644 package/nodm/Config.in
 create mode 100644 package/nodm/S90nodm
 create mode 100644 package/nodm/nodm.hash
 create mode 100644 package/nodm/nodm.mk
 create mode 100644 package/nodm/nodm.pam
package/Config.in +1 -0
index ce71afb7816a..0f5d1c07dc7d 100644
@@ -307,6 +307,7 @@ comment "X applications"
 	source "package/gtkperf/Config.in"
 	source "package/leafpad/Config.in"
 	source "package/midori/Config.in"
+	source "package/nodm/Config.in"
 	source "package/pcmanfm/Config.in"
 	source "package/qt-webkit-kiosk/Config.in"
 	source "package/rdesktop/Config.in"
package/nodm/Config.in new file +0 -0
new file mode 100644
index 000000000000..e6231076b1ee

package/nodm/Config.in line 4

Quoted 4 lines
package/nodm/Config.in new file +4 -0
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_NODM
+	bool "nodm"
+	depends on BR2_PACKAGE_XORG7
+	select BR2_PACKAGE_LINUX_PAM

You forgot BR2_PACKAGE_XLIB_LIBX11

package/nodm/Config.in line 6

Quoted 2 lines
package/nodm/Config.in new file +2 -0
+
+	help

No empty line before help.

package/nodm/Config.in line 14

Quoted 8 lines
package/nodm/Config.in new file +8 -0
+	  nodm is a minimal display manager that simply logs in
+	  as a given user and starts an X session, without asking
+	  for username or password.
+
+	  For those cases where automatic login is needed (and
+	  does not imply a security issue), nodm is simple to setup,
+	  lightweight, and it should do exactly the right thing.
+

Upstream URL?

Quoted 7 lines

+++ b/package/nodm/nodm.mk

package/nodm/Config.in new file +5 -0
@@ -0,0 +1,28 @@
+################################################################################
+#
+# nodm
+#
+################################################################################

package/nodm/Config.in line 15

Quoted 10 lines
package/nodm/Config.in new file +10 -0
+
+NODM_VERSION = 0.12
+NODM_SOURCE = nodm_$(NODM_VERSION)-1.tar.gz
+NODM_SITE = http://http.debian.net/debian/pool/main/n/nodm
+NODM_LICENSE = GPLv2+
+NODM_LICENSE_FILES = COPYING
+NODM_AUTORECONF=YES
+
+NODM_DEPENDENCIES = xlib_libX11 linux-pam
+

Googling around, upstream seems to be:

https://github.com/spanezz/nodm

Any reason why we use Debian instead of upstream directly?

package/nodm/S90nodm line 6

Quoted 12 lines
package/nodm/S90nodm new file +6 -0
new file mode 100644
index 000000000000..66bb0ca8565b
@@ -0,0 +1,51 @@
+#!/bin/sh
+#
+# Starts nodm
+#
+
+NODM_XINIT=/usr/bin/xinit

According to the upstream readme, this is no longer used:

NODM_XINIT Was used by older versions of nodm as the path to the xinit program, but it is now ignored.

package/nodm/S90nodm line 15

Quoted 9 lines
package/nodm/S90nodm new file +9 -0
+NODM_FIRST_VT=7
+NODM_XSESSION=/etc/X11/Xsession
+NODM_OPTIONS=
+NODM_X_OPTIONS="-nolisten tcp"
+NODM_USER=root
+NODM_MIN_SESSION_TIME=60
+NODM_X_TIMEOUT=300
+
+[ -r /etc/nodm.conf ] && . /etc/nodm.conf

Elsewhere we use /etc/default/nodm (which is also what the upstream init script uses).

package/nodm/S90nodm line 1

Quoted 3 lines
package/nodm/S90nodm new file +2 -0
+++ b/package/nodm/nodm.hash
@@ -0,0 +1 @@
+sha256	77a002928e832eb6737fb92ad6b3477fce68167b4bc86eba5586868cc1337524	nodm_0.12-1.tar.gz

Please add a comment about where this hash comes from (E.G. locally calculated if that is what you did).

Quoted 1 line

+NODM_AUTORECONF=YES

Space around '=' please.

Care to fixup these issues and resend? Thanks!

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH v2 1/1 nodm: new package

In reply to Ezequiel Garcia

--
Changes from v1:
* Add missing select BR2_PACKAGE_XLIB_LIBX11
* Add upstream URL to Config.in
* Use upstream instead of debian to get the sources.
* Get rid of deprecated NODM_XINIT
* Use /etc/default/nodm.conf
* Cosmetic changes

 package/Config.in      |  1 +
 package/nodm/Config.in | 15 +++++++++++++++
 package/nodm/S90nodm   | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 package/nodm/nodm.hash |  2 ++
 package/nodm/nodm.mk   | 28 ++++++++++++++++++++++++++++
 package/nodm/nodm.pam  | 14 ++++++++++++++
 6 files changed, 109 insertions(+)
 create mode 100644 package/nodm/Config.in
 create mode 100644 package/nodm/S90nodm
 create mode 100644 package/nodm/nodm.hash
 create mode 100644 package/nodm/nodm.mk
 create mode 100644 package/nodm/nodm.pam
package/Config.in +1 -0
index a2a02a8c5e35..1d28efff7f52 100644
@@ -307,6 +307,7 @@ comment "X applications"
 	source "package/gtkperf/Config.in"
 	source "package/leafpad/Config.in"
 	source "package/midori/Config.in"
+	source "package/nodm/Config.in"
 	source "package/pcmanfm/Config.in"
 	source "package/qt-webkit-kiosk/Config.in"
 	source "package/rdesktop/Config.in"
package/nodm/Config.in new file +15 -0
new file mode 100644
index 000000000000..3e71f2dd603d
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_NODM
+	bool "nodm"
+	depends on BR2_PACKAGE_XORG7
+	select BR2_PACKAGE_XLIB_LIBX11
+	select BR2_PACKAGE_LINUX_PAM
+	help
+	  nodm is a minimal display manager that simply logs in
+	  as a given user and starts an X session, without asking
+	  for username or password.
+
+	  For those cases where automatic login is needed (and
+	  does not imply a security issue), nodm is simple to setup,
+	  lightweight, and it should do exactly the right thing.
+
+	  https://github.com/spanezz/nodm/
package/nodm/S90nodm new file +49 -0

49 lines not on this page · raw message

package/nodm/nodm.hash new file +2 -0
new file mode 100644
index 000000000000..682206527928
@@ -0,0 +1,2 @@
+# locally calculated
+sha256  840939d27d3d9b02ad09e1cffce24729bcdeee6cea6b3f0037d8ae76b49feecd  0.12-1.tar.gz
package/nodm/nodm.mk new file +28 -0
new file mode 100644
index 000000000000..246c73e104a8
@@ -0,0 +1,28 @@
+################################################################################
+#
+# nodm
+#
+################################################################################
+
+NODM_VERSION = 0.12
+NODM_SITE = $(call github,spanezz,nodm,debian)
+NODM_SOURCE = $(NODM_VERSION)-1.tar.gz
+NODM_LICENSE = GPLv2+
+NODM_LICENSE_FILES = COPYING
+NODM_AUTORECONF = YES
+
+NODM_DEPENDENCIES = xlib_libX11 linux-pam
+
+define NODM_INSTALL_PAM
+	$(INSTALL) -D -m 0644 package/nodm/nodm.pam \
+		$(TARGET_DIR)/etc/pam.d/nodm
+endef
+
+NODM_POST_INSTALL_TARGET_HOOKS += NODM_INSTALL_PAM
+
+define NODM_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 package/nodm/S90nodm \
+		$(TARGET_DIR)/etc/init.d/S90nodm
+endef
+
+$(eval $(autotools-package))
package/nodm/nodm.pam new file +14 -0
new file mode 100644
index 000000000000..f2cf43217a23
@@ -0,0 +1,14 @@
+# Log service and allow promiscuously
+#
+auth		required	pam_warn.so
+auth		required	pam_unix.so
+
+account		required	pam_warn.so
+account		required	pam_permit.so
+
+password	required	pam_warn.so
+password	required	pam_permit.so
+
+session		required	pam_warn.so
+session		required	pam_permit.so
+session		required	pam_env.so
Signature · 1 line
2.9.0
#3 lore raw

PATCH v2 1/1 nodm: new package

Quoted 43 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Ezequiel" == Ezequiel Garcia <[email protected]> writes:

--
Changes from v1:
* Add missing select BR2_PACKAGE_XLIB_LIBX11
* Add upstream URL to Config.in
* Use upstream instead of debian to get the sources.
* Get rid of deprecated NODM_XINIT
* Use /etc/default/nodm.conf
* Cosmetic changes

 package/Config.in      |  1 +
 package/nodm/Config.in | 15 +++++++++++++++
 package/nodm/S90nodm   | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 package/nodm/nodm.hash |  2 ++
 package/nodm/nodm.mk   | 28 ++++++++++++++++++++++++++++
 package/nodm/nodm.pam  | 14 ++++++++++++++
 6 files changed, 109 insertions(+)
 create mode 100644 package/nodm/Config.in
 create mode 100644 package/nodm/S90nodm
 create mode 100644 package/nodm/nodm.hash
 create mode 100644 package/nodm/nodm.mk
 create mode 100644 package/nodm/nodm.pam
package/Config.in +1 -0
index a2a02a8c5e35..1d28efff7f52 100644
@@ -307,6 +307,7 @@ comment "X applications"
 	source "package/gtkperf/Config.in"
 	source "package/leafpad/Config.in"
 	source "package/midori/Config.in"
+	source "package/nodm/Config.in"
 	source "package/pcmanfm/Config.in"
 	source "package/qt-webkit-kiosk/Config.in"
 	source "package/rdesktop/Config.in"
package/nodm/Config.in new file +0 -0
new file mode 100644
index 000000000000..3e71f2dd603d

package/nodm/Config.in line 5

Quoted 5 lines
package/nodm/Config.in new file +5 -0
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_NODM
+	bool "nodm"
+	depends on BR2_PACKAGE_XORG7
+	select BR2_PACKAGE_XLIB_LIBX11
+	select BR2_PACKAGE_LINUX_PAM

You forgot to propagate the dependencies of linux-pam and the comment when not available.

There is also an #include <wordexp.h>, and our uClibc config doesn't support that so it also needs to be disabled for uClibc.

Quoted 20 lines
package/nodm/Config.in new file +10 -0
+	help
+	  nodm is a minimal display manager that simply logs in
+	  as a given user and starts an X session, without asking
+	  for username or password.
+
+	  For those cases where automatic login is needed (and
+	  does not imply a security issue), nodm is simple to setup,
+	  lightweight, and it should do exactly the right thing.
+
+	  https://github.com/spanezz/nodm/
package/nodm/S90nodm new file +4 -0
new file mode 100644
index 000000000000..a546b3e5d3cf
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# Starts nodm
+#

package/nodm/S90nodm line 14

Quoted 10 lines
package/nodm/S90nodm new file +10 -0
+
+NODM_FIRST_VT=7
+NODM_XSESSION=/etc/X11/Xsession
+NODM_OPTIONS=
+NODM_X_OPTIONS="-nolisten tcp"
+NODM_USER=root
+NODM_MIN_SESSION_TIME=60
+NODM_X_TIMEOUT=300
+
+[ -r /etc/default/nodm.conf ] && . /etc/default/nodm.conf

The other /etc/default files don't use the .conf suffix, so I've removed it here as well.

Quoted 8 lines
package/nodm/S90nodm new file +2 -0
+# locally calculated
+sha256  840939d27d3d9b02ad09e1cffce24729bcdeee6cea6b3f0037d8ae76b49feecd  0.12-1.tar.gz
package/nodm/nodm.mk new file +0 -0
new file mode 100644
index 000000000000..246c73e104a8

package/nodm/nodm.mk line 9

Quoted 9 lines
package/nodm/nodm.mk new file +9 -0
@@ -0,0 +1,28 @@
+################################################################################
+#
+# nodm
+#
+################################################################################
+
+NODM_VERSION = 0.12
+NODM_SITE = $(call github,spanezz,nodm,debian)
+NODM_SOURCE = $(NODM_VERSION)-1.tar.gz

That is not how I suggested on IRC, so I've changed it to:

NODM_VERSION = 0.12-1
NODM_SITE = $(call github,spanezz,nodm,debian/$(NODM_VERSION)) (and no _SOURCE)

That way we don't end up with an anonymous 0.12-1.tar.gz in the downloads dir / sources mirror.

When building it is hardcoded to use help2man to generate a man page, which isn't good (people might not have help2man, and it doesn't work when cross compiling), so I've added a post-patch hook to disable it.

Committed with these fixes, thanks.

Signature · 1 line
Bye, Peter Korsgaard