Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] mingetty: add package
@ 2011-11-23 21:14 Trevor Woerner
  2011-11-26 13:53 ` Trevor Woerner
  2011-11-26 20:28 ` Peter Korsgaard
  0 siblings, 2 replies; 4+ messages in thread
From: Trevor Woerner @ 2011-11-23 21:14 UTC (permalink / raw)
  To: buildroot

---
 package/Config.in            |    1 +
 package/mingetty/Config.in   |    7 +++++++
 package/mingetty/inittab     |   32 ++++++++++++++++++++++++++++++++
 package/mingetty/mingetty.mk |   28 ++++++++++++++++++++++++++++
 target/generic/Makefile.in   |    9 ++++++++-
 5 files changed, 76 insertions(+), 1 deletions(-)
 create mode 100644 package/mingetty/Config.in
 create mode 100644 package/mingetty/inittab
 create mode 100644 package/mingetty/mingetty.mk

diff --git a/package/Config.in b/package/Config.in
index 4b5e5d8..9d01d0b 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -528,6 +528,7 @@ source "package/bootutils/Config.in"
 endif
 source "package/htop/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
+source "package/mingetty/Config.in"
 source "package/module-init-tools/Config.in"
 source "package/procps/Config.in"
 source "package/psmisc/Config.in"
diff --git a/package/mingetty/Config.in b/package/mingetty/Config.in
new file mode 100644
index 0000000..adc95a8
--- /dev/null
+++ b/package/mingetty/Config.in
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_MINGETTY
+	bool "mingetty"
+	help
+	  mingetty is a minimal getty for use on virtual consoles and is not
+	  suitable for use on serial lines.
+
+	  http://sourceforge.net/projects/mingetty/
diff --git a/package/mingetty/inittab b/package/mingetty/inittab
new file mode 100644
index 0000000..b59fc12
--- /dev/null
+++ b/package/mingetty/inittab
@@ -0,0 +1,32 @@
+# /etc/inittab
+#
+# This inittab is a basic inittab sample for mingetty,
+# which mimics sysvinit's inittab,
+# which mimics Buildroot's inittab for Busybox.
+id:1:initdefault:
+
+proc::sysinit:/bin/mount -t proc proc /proc
+rwmo::sysinit:/bin/mount -o remount,rw / # REMOUNT_ROOTFS_RW
+dpts::sysinit:/bin/mkdir -p /dev/pts
+moun::sysinit:/bin/mount -a
+host::sysinit:/bin/hostname -F /etc/hostname
+init::sysinit:/etc/init.d/rcS
+
+1:1:respawn:/sbin/mingetty --noclear tty1
+2:1:respawn:/sbin/mingetty --noclear tty2
+
+# S0:1:respawn:/sbin/getty -L ttyS0 115200 vt100 # GENERIC_SERIAL
+
+# Logging junk
+mess::sysinit:/bin/touch /var/log/messages
+sysl:1:respawn:/sbin/syslogd -n -m 0
+klog:1:respawn:/sbin/klogd -n
+
+# Stuff to do for the 3-finger salute
+rebo::ctrlaltdel:/sbin/reboot
+
+# Stuff to do before rebooting
+sklo:6:wait:/usr/bin/killall klogd
+ssys:6:wait:/usr/bin/killall syslogd
+umou:6:wait:/bin/umount -a -r
+swap:6:wait:/sbin/swapoff -a
diff --git a/package/mingetty/mingetty.mk b/package/mingetty/mingetty.mk
new file mode 100644
index 0000000..d2ec924
--- /dev/null
+++ b/package/mingetty/mingetty.mk
@@ -0,0 +1,28 @@
+#############################################################
+#
+# mingetty
+#
+#############################################################
+MINGETTY_VERSION = 1.08
+MINGETTY_SOURCE  = mingetty-$(MINGETTY_VERSION).tar.gz
+MINGETTY_SITE    = http://downloads.sourceforge.net/project/mingetty/mingetty/$(MINGETTY_VERSION)
+
+# Override sysvinit's implementations if it is enabled.
+ifeq ($(BR2_PACKAGE_SYSVINIT),y)
+MINGETTY_DEPENDENCIES = sysvinit
+endif
+
+define MINGETTY_BUILD_CMDS
+	$(MAKE) CC=$(TARGET_CC) -C $(@D)
+endef
+
+define MINGETTY_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/mingetty $(TARGET_DIR)/sbin
+	$(INSTALL) -D -m 0644 package/mingetty/inittab $(TARGET_DIR)/etc/inittab
+endef
+
+define MINGETTY_CLEAN_CMDS
+	$(MAKE) -C $(@D) clean
+endef
+
+$(eval $(call GENTARGETS))
diff --git a/target/generic/Makefile.in b/target/generic/Makefile.in
index 4185202..5ce1447 100644
--- a/target/generic/Makefile.in
+++ b/target/generic/Makefile.in
@@ -23,6 +23,11 @@ target-generic-getty-sysvinit:
 	$(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(shell echo $(TARGET_GENERIC_GETTY) | tail -c+4)::respawn:/sbin/getty -L $(TARGET_GENERIC_GETTY) $(TARGET_GENERIC_GETTY_BAUDRATE) vt100 #~' \
 		$(TARGET_DIR)/etc/inittab
 
+# Set the getty to mingetty
+target-generic-getty-mingetty:
+	$(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(shell echo $(TARGET_GENERIC_GETTY) | tail -c+4)::respawn:/sbin/mingetty --noclear $(TARGET_GENERIC_GETTY) #~' \
+		$(TARGET_DIR)/etc/inittab
+
 # Find commented line, if any, and remove leading '#'s
 target-generic-do-remount-rw:
 	$(SED) '/^#.*# REMOUNT_ROOTFS_RW$$/s~^#\+~~' $(TARGET_DIR)/etc/inittab
@@ -40,7 +45,9 @@ TARGETS += target-generic-issue
 endif
 
 ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT),y)
-ifeq ($(BR2_PACKAGE_SYSVINIT),y)
+ifeq ($(BR2_PACKAGE_MINGETTY),y)
+TARGETS += target-generic-getty-mingetty
+else ifeq ($(BR2_PACKAGE_SYSVINIT),y)
 TARGETS += target-generic-getty-sysvinit
 else
 TARGETS += target-generic-getty-busybox
-- 
1.7.6.233.gd79bc

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] mingetty: add package
  2011-11-23 21:14 [Buildroot] [PATCH] mingetty: add package Trevor Woerner
@ 2011-11-26 13:53 ` Trevor Woerner
  2011-11-26 20:28 ` Peter Korsgaard
  1 sibling, 0 replies; 4+ messages in thread
From: Trevor Woerner @ 2011-11-26 13:53 UTC (permalink / raw)
  To: buildroot

Is there any interest in this patch?

On Wed, Nov 23, 2011 at 4:14 PM, Trevor Woerner <twoerner@gmail.com> wrote:
> ---
> ?package/Config.in ? ? ? ? ? ?| ? ?1 +
> ?package/mingetty/Config.in ? | ? ?7 +++++++
> ?package/mingetty/inittab ? ? | ? 32 ++++++++++++++++++++++++++++++++
> ?package/mingetty/mingetty.mk | ? 28 ++++++++++++++++++++++++++++
> ?target/generic/Makefile.in ? | ? ?9 ++++++++-
> ?5 files changed, 76 insertions(+), 1 deletions(-)
> ?create mode 100644 package/mingetty/Config.in
> ?create mode 100644 package/mingetty/inittab
> ?create mode 100644 package/mingetty/mingetty.mk
>
> diff --git a/package/Config.in b/package/Config.in
> index 4b5e5d8..9d01d0b 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -528,6 +528,7 @@ source "package/bootutils/Config.in"
> ?endif
> ?source "package/htop/Config.in"
> ?if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
> +source "package/mingetty/Config.in"
> ?source "package/module-init-tools/Config.in"
> ?source "package/procps/Config.in"
> ?source "package/psmisc/Config.in"
> diff --git a/package/mingetty/Config.in b/package/mingetty/Config.in
> new file mode 100644
> index 0000000..adc95a8
> --- /dev/null
> +++ b/package/mingetty/Config.in
> @@ -0,0 +1,7 @@
> +config BR2_PACKAGE_MINGETTY
> + ? ? ? bool "mingetty"
> + ? ? ? help
> + ? ? ? ? mingetty is a minimal getty for use on virtual consoles and is not
> + ? ? ? ? suitable for use on serial lines.
> +
> + ? ? ? ? http://sourceforge.net/projects/mingetty/
> diff --git a/package/mingetty/inittab b/package/mingetty/inittab
> new file mode 100644
> index 0000000..b59fc12
> --- /dev/null
> +++ b/package/mingetty/inittab
> @@ -0,0 +1,32 @@
> +# /etc/inittab
> +#
> +# This inittab is a basic inittab sample for mingetty,
> +# which mimics sysvinit's inittab,
> +# which mimics Buildroot's inittab for Busybox.
> +id:1:initdefault:
> +
> +proc::sysinit:/bin/mount -t proc proc /proc
> +rwmo::sysinit:/bin/mount -o remount,rw / # REMOUNT_ROOTFS_RW
> +dpts::sysinit:/bin/mkdir -p /dev/pts
> +moun::sysinit:/bin/mount -a
> +host::sysinit:/bin/hostname -F /etc/hostname
> +init::sysinit:/etc/init.d/rcS
> +
> +1:1:respawn:/sbin/mingetty --noclear tty1
> +2:1:respawn:/sbin/mingetty --noclear tty2
> +
> +# S0:1:respawn:/sbin/getty -L ttyS0 115200 vt100 # GENERIC_SERIAL
> +
> +# Logging junk
> +mess::sysinit:/bin/touch /var/log/messages
> +sysl:1:respawn:/sbin/syslogd -n -m 0
> +klog:1:respawn:/sbin/klogd -n
> +
> +# Stuff to do for the 3-finger salute
> +rebo::ctrlaltdel:/sbin/reboot
> +
> +# Stuff to do before rebooting
> +sklo:6:wait:/usr/bin/killall klogd
> +ssys:6:wait:/usr/bin/killall syslogd
> +umou:6:wait:/bin/umount -a -r
> +swap:6:wait:/sbin/swapoff -a
> diff --git a/package/mingetty/mingetty.mk b/package/mingetty/mingetty.mk
> new file mode 100644
> index 0000000..d2ec924
> --- /dev/null
> +++ b/package/mingetty/mingetty.mk
> @@ -0,0 +1,28 @@
> +#############################################################
> +#
> +# mingetty
> +#
> +#############################################################
> +MINGETTY_VERSION = 1.08
> +MINGETTY_SOURCE ?= mingetty-$(MINGETTY_VERSION).tar.gz
> +MINGETTY_SITE ? ?= http://downloads.sourceforge.net/project/mingetty/mingetty/$(MINGETTY_VERSION)
> +
> +# Override sysvinit's implementations if it is enabled.
> +ifeq ($(BR2_PACKAGE_SYSVINIT),y)
> +MINGETTY_DEPENDENCIES = sysvinit
> +endif
> +
> +define MINGETTY_BUILD_CMDS
> + ? ? ? $(MAKE) CC=$(TARGET_CC) -C $(@D)
> +endef
> +
> +define MINGETTY_INSTALL_TARGET_CMDS
> + ? ? ? $(INSTALL) -D -m 0755 $(@D)/mingetty $(TARGET_DIR)/sbin
> + ? ? ? $(INSTALL) -D -m 0644 package/mingetty/inittab $(TARGET_DIR)/etc/inittab
> +endef
> +
> +define MINGETTY_CLEAN_CMDS
> + ? ? ? $(MAKE) -C $(@D) clean
> +endef
> +
> +$(eval $(call GENTARGETS))
> diff --git a/target/generic/Makefile.in b/target/generic/Makefile.in
> index 4185202..5ce1447 100644
> --- a/target/generic/Makefile.in
> +++ b/target/generic/Makefile.in
> @@ -23,6 +23,11 @@ target-generic-getty-sysvinit:
> ? ? ? ?$(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(shell echo $(TARGET_GENERIC_GETTY) | tail -c+4)::respawn:/sbin/getty -L $(TARGET_GENERIC_GETTY) $(TARGET_GENERIC_GETTY_BAUDRATE) vt100 #~' \
> ? ? ? ? ? ? ? ?$(TARGET_DIR)/etc/inittab
>
> +# Set the getty to mingetty
> +target-generic-getty-mingetty:
> + ? ? ? $(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(shell echo $(TARGET_GENERIC_GETTY) | tail -c+4)::respawn:/sbin/mingetty --noclear $(TARGET_GENERIC_GETTY) #~' \
> + ? ? ? ? ? ? ? $(TARGET_DIR)/etc/inittab
> +
> ?# Find commented line, if any, and remove leading '#'s
> ?target-generic-do-remount-rw:
> ? ? ? ?$(SED) '/^#.*# REMOUNT_ROOTFS_RW$$/s~^#\+~~' $(TARGET_DIR)/etc/inittab
> @@ -40,7 +45,9 @@ TARGETS += target-generic-issue
> ?endif
>
> ?ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT),y)
> -ifeq ($(BR2_PACKAGE_SYSVINIT),y)
> +ifeq ($(BR2_PACKAGE_MINGETTY),y)
> +TARGETS += target-generic-getty-mingetty
> +else ifeq ($(BR2_PACKAGE_SYSVINIT),y)
> ?TARGETS += target-generic-getty-sysvinit
> ?else
> ?TARGETS += target-generic-getty-busybox
> --
> 1.7.6.233.gd79bc
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] mingetty: add package
  2011-11-23 21:14 [Buildroot] [PATCH] mingetty: add package Trevor Woerner
  2011-11-26 13:53 ` Trevor Woerner
@ 2011-11-26 20:28 ` Peter Korsgaard
  2011-11-28 15:39   ` Trevor Woerner
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Korsgaard @ 2011-11-26 20:28 UTC (permalink / raw)
  To: buildroot

>>>>> "Trevor" == Trevor Woerner <twoerner@gmail.com> writes:

 Trevor> ---
 Trevor>  package/Config.in            |    1 +
 Trevor>  package/mingetty/Config.in   |    7 +++++++
 Trevor>  package/mingetty/inittab     |   32 ++++++++++++++++++++++++++++++++
 Trevor>  package/mingetty/mingetty.mk |   28 ++++++++++++++++++++++++++++
 Trevor>  target/generic/Makefile.in   |    9 ++++++++-
 Trevor>  5 files changed, 76 insertions(+), 1 deletions(-)
 Trevor>  create mode 100644 package/mingetty/Config.in
 Trevor>  create mode 100644 package/mingetty/inittab
 Trevor>  create mode 100644 package/mingetty/mingetty.mk

 Trevor> +++ b/package/mingetty/mingetty.mk
 Trevor> @@ -0,0 +1,28 @@
 Trevor> +#############################################################
 Trevor> +#
 Trevor> +# mingetty
 Trevor> +#
 Trevor> +#############################################################
 Trevor> +MINGETTY_VERSION = 1.08
 Trevor> +MINGETTY_SOURCE  = mingetty-$(MINGETTY_VERSION).tar.gz
 Trevor> +MINGETTY_SITE    = http://downloads.sourceforge.net/project/mingetty/mingetty/$(MINGETTY_VERSION)

Use the mirror support we have, E.G.

http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/mingetty

 Trevor> +
 Trevor> +# Override sysvinit's implementations if it is enabled.

sysvinit doesn't contain a getty implementation. What you mean is that
you want to run after sysvinit so it doesn't overwrite your inittab.

 Trevor> +ifeq ($(BR2_PACKAGE_SYSVINIT),y)
 Trevor> +MINGETTY_DEPENDENCIES = sysvinit
 Trevor> +endif
 Trevor> +
 Trevor> +define MINGETTY_BUILD_CMDS
 Trevor> +	$(MAKE) CC=$(TARGET_CC) -C $(@D)
 Trevor> +endef
 Trevor> +
 Trevor> +define MINGETTY_INSTALL_TARGET_CMDS
 Trevor> +	$(INSTALL) -D -m 0755 $(@D)/mingetty $(TARGET_DIR)/sbin
 Trevor> +	$(INSTALL) -D -m 0644 package/mingetty/inittab $(TARGET_DIR)/etc/inittab

Please don't do that. People might have a custom inittab (I know
sysvinit does so as well, but as the syntax is different than busybox's
there isn't really much else it can do).

The nicest thing would be instead to replace /sbin/getty with
/sbin/mingetty in the existing inittab, but as mingetty doesn't handle
the same arguments as busybox getty, this gets quite tricky.

Perhaps the best would just do nothing and let people tweak their
inittab themselves if they want.

 Trevor> diff --git a/target/generic/Makefile.in b/target/generic/Makefile.in
 Trevor> index 4185202..5ce1447 100644
 Trevor> --- a/target/generic/Makefile.in
 Trevor> +++ b/target/generic/Makefile.in

And drop this.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] mingetty: add package
  2011-11-26 20:28 ` Peter Korsgaard
@ 2011-11-28 15:39   ` Trevor Woerner
  0 siblings, 0 replies; 4+ messages in thread
From: Trevor Woerner @ 2011-11-28 15:39 UTC (permalink / raw)
  To: buildroot

Thanks for having a look at my patch.

On Sat, Nov 26, 2011 at 3:28 PM, Peter Korsgaard <jacmet@uclibc.org> wrote:
> ?Trevor> +MINGETTY_SITE ? ?= http://downloads.sourceforge.net/project/mingetty/mingetty/$(MINGETTY_VERSION)
>
> Use the mirror support we have

Thanks, I wasn't sure how to use it.

> ?Trevor> +
> ?Trevor> +# Override sysvinit's implementations if it is enabled.
>
> sysvinit doesn't contain a getty implementation. What you mean is that
> you want to run after sysvinit so it doesn't overwrite your inittab.

Yes, that's correct.

> ?Trevor> +define MINGETTY_INSTALL_TARGET_CMDS
> ?Trevor> + ? ? ?$(INSTALL) -D -m 0755 $(@D)/mingetty $(TARGET_DIR)/sbin
> ?Trevor> + ? ? ?$(INSTALL) -D -m 0644 package/mingetty/inittab $(TARGET_DIR)/etc/inittab
>
> Please don't do that. People might have a custom inittab (I know
> sysvinit does so as well, but as the syntax is different than busybox's
> there isn't really much else it can do).

Okay, no problem. [I had actually used inittab as the template upon
which I based this new package, so that's why I was doing the same as
it was doing.]

> The nicest thing would be instead to replace /sbin/getty with
> /sbin/mingetty in the existing inittab, but as mingetty doesn't handle
> the same arguments as busybox getty, this gets quite tricky.
>
> ?Trevor> diff --git a/target/generic/Makefile.in b/target/generic/Makefile.in
> ?Trevor> index 4185202..5ce1447 100644
> ?Trevor> --- a/target/generic/Makefile.in
> ?Trevor> +++ b/target/generic/Makefile.in
>
> And drop this.

I'm confused by this last request. If the nicest thing to do would be
to replace /sbin/getty with /sbin/mingetty wouldn't my modification to
target/generic/Makefile.in be the way to go about it?

I have copied my original modifications to target/generic/Makefile.in below:

diff --git a/target/generic/Makefile.in b/target/generic/Makefile.in
index 4185202..5ce1447 100644
--- a/target/generic/Makefile.in
+++ b/target/generic/Makefile.in
@@ -23,6 +23,11 @@ target-generic-getty-sysvinit:
       $(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(shell echo
$(TARGET_GENERIC_GETTY) | tail -c+4)::respawn:/sbin/getty -L
$(TARGET_GENERIC_GETTY) $(TARGET_GENERIC_GETTY_BAUDRATE) vt100 #~' \
               $(TARGET_DIR)/etc/inittab

+# Set the getty to mingetty
+target-generic-getty-mingetty:
+       $(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(shell echo
$(TARGET_GENERIC_GETTY) | tail -c+4)::respawn:/sbin/mingetty --noclear
$(TARGET_GENERIC_GETTY) #~' \
+               $(TARGET_DIR)/etc/inittab
+
 # Find commented line, if any, and remove leading '#'s
 target-generic-do-remount-rw:
       $(SED) '/^#.*# REMOUNT_ROOTFS_RW$$/s~^#\+~~' $(TARGET_DIR)/etc/inittab
@@ -40,7 +45,9 @@ TARGETS += target-generic-issue
 endif

 ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT),y)
-ifeq ($(BR2_PACKAGE_SYSVINIT),y)
+ifeq ($(BR2_PACKAGE_MINGETTY),y)
+TARGETS += target-generic-getty-mingetty
+else ifeq ($(BR2_PACKAGE_SYSVINIT),y)
 TARGETS += target-generic-getty-sysvinit
 else
 TARGETS += target-generic-getty-busybox

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-28 15:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-23 21:14 [Buildroot] [PATCH] mingetty: add package Trevor Woerner
2011-11-26 13:53 ` Trevor Woerner
2011-11-26 20:28 ` Peter Korsgaard
2011-11-28 15:39   ` Trevor Woerner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox