All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [RFC, PATCH 4/8] package/powerpc-utils: Add powerpc hardware utilities
  2014-01-16  8:52 [Buildroot] [RFC, PATCH 0/8] Enable a buildroot-based petitboot bootloader Jeremy Kerr
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 7/8] package/iprutils: Add IBM Power RAID utilities Jeremy Kerr
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 1/8] package/busybox: Add facility for DHCP hooks Jeremy Kerr
@ 2014-01-16  8:52 ` Jeremy Kerr
  2014-01-16  9:30   ` Baruch Siach
                     ` (2 more replies)
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 2/8] package/dropbear: Add separate configuration options for client and server Jeremy Kerr
                   ` (5 subsequent siblings)
  8 siblings, 3 replies; 38+ messages in thread
From: Jeremy Kerr @ 2014-01-16  8:52 UTC (permalink / raw)
  To: buildroot

This change adds a package definition for the powerpc-utils project,
containing a set of powerpc-specific hardware management utilities.

We're using a git tag from upstream, which contains a few build-system
fixes. We also add a patch to use `reboot` instead of `shutdown -r`,
allowing compatibility with busybox.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

---
 package/Config.in                                                                             |    1 
 package/powerpc-utils/Config.in                                                               |    5 +
 package/powerpc-utils/powerpc-utils-scripts-update_flash-Use-reboot-instead-of-shutdown.patch |   42 ++++++++++
 package/powerpc-utils/powerpc-utils.mk                                                        |   14 +++
 4 files changed, 62 insertions(+)

diff --git a/package/Config.in b/package/Config.in
index 78c0e066..61f4c9e0 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1006,6 +1006,7 @@ source "package/monit/Config.in"
 source "package/ncdu/Config.in"
 source "package/numactl/Config.in"
 source "package/nut/Config.in"
+source "package/powerpc-utils/Config.in"
 source "package/polkit/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 source "package/procps/Config.in"
diff --git a/package/powerpc-utils/Config.in b/package/powerpc-utils/Config.in
new file mode 100644
index 00000000..c919094a
--- /dev/null
+++ b/package/powerpc-utils/Config.in
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_POWERPC_UTILS
+	bool "powerpc-utils"
+	select BR2_PACKAGE_ZLIB
+	help
+	  System utilities for powerpc machines
diff --git a/package/powerpc-utils/powerpc-utils-scripts-update_flash-Use-reboot-instead-of-shutdown.patch b/package/powerpc-utils/powerpc-utils-scripts-update_flash-Use-reboot-instead-of-shutdown.patch
new file mode 100644
index 00000000..f3db5338
--- /dev/null
+++ b/package/powerpc-utils/powerpc-utils-scripts-update_flash-Use-reboot-instead-of-shutdown.patch
@@ -0,0 +1,42 @@
+From 673507f4163ed313f66fa2c120e7074f8bb3d7c7 Mon Sep 17 00:00:00 2001
+From: Jeremy Kerr <jk@ozlabs.org>
+Date: Wed, 11 Dec 2013 11:54:49 +0800
+Subject: [PATCH] scripts/update_flash: Use reboot instead of shutdown
+
+We don't have shutdown on busybox.
+
+Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
+---
+ scripts/update_flash    |    2 +-
+ scripts/update_flash_nv |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/scripts/update_flash b/scripts/update_flash
+index a566a627..32801c64 100755
+--- a/scripts/update_flash
++++ b/scripts/update_flash
+@@ -317,7 +317,7 @@ update_flash_from_file() {
+ 	fi
+ 
+ 	#XXX
+-	shutdown -r now
++	reboot
+ 
+ 	return 0;
+ }
+diff --git a/scripts/update_flash_nv b/scripts/update_flash_nv
+index ead29ef8..e72f01fd 100644
+--- a/scripts/update_flash_nv
++++ b/scripts/update_flash_nv
+@@ -304,7 +304,7 @@ update_flash_from_file() {
+ 	echo_update_return_status "$output"
+ 
+ 	# Reboot system, so that we can flash new image
+-	shutdown -r now
++	reboot
+ 
+ 	exit $E_SUCCESS
+ }
+-- 
+1.7.10.4
+
diff --git a/package/powerpc-utils/powerpc-utils.mk b/package/powerpc-utils/powerpc-utils.mk
new file mode 100644
index 00000000..15deb2e9
--- /dev/null
+++ b/package/powerpc-utils/powerpc-utils.mk
@@ -0,0 +1,14 @@
+#############################################################
+#
+# powerpc-utils
+#
+#############################################################
+
+POWERPC_UTILS_VERSION = aeb32757
+POWERPC_UTILS_SITE = git://git.code.sf.net/p/powerpc-utils/powerpc-utils
+POWERPC_UTILS_AUTORECONF = YES
+POWERPC_UTILS_DEPENDENCIES = zlib
+
+POWERPC_UTILS_CONF_OPT += --without-librtas
+
+$(eval $(autotools-package))

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

* [Buildroot] [RFC, PATCH 0/8] Enable a buildroot-based petitboot bootloader
@ 2014-01-16  8:52 Jeremy Kerr
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 7/8] package/iprutils: Add IBM Power RAID utilities Jeremy Kerr
                   ` (8 more replies)
  0 siblings, 9 replies; 38+ messages in thread
From: Jeremy Kerr @ 2014-01-16  8:52 UTC (permalink / raw)
  To: buildroot

Hi all,

The following series allows us to build a petitboot-based bootloader
using buildroot.

Petitboot is a kexec-based bootloader; by plumbing together a few linux
utilities, we can implement a bootloader in userspace, using standard
Linux drivers for hardware support. There's a bit of background of
petitboot in my recent linux.conf.au talk:

 http://mirror.linux.org.au/linux.conf.au/2014/Thursday/89-Petitboot_doing_interesting_things_in_your_bootloader_-_Jeremy_Kerr.mp4
 
And the project homepage:

 https://www.kernel.org/pub/linux/kernel/people/geoff/petitboot/petitboot.html

My primary target here is powerpc machines (and this series adds a
defconfig to do a powerpc petitboot build), but I've also been able to
get most of petitboot working when built as an EFI stub on x86 machines
(we still need some platform-specific bits in petitboot for proper
configuration persistence).

While most of this series is fairly straightforward, there are a few
items that might need a little more attention:

 - At the moment, I'm using my local repo for petitboot sources; it may
   be better to wait until everything is merged upstream. Upstream is
   still active, and I don't think this should take long.

 - We add wide-char support for ncurses; this seems to be working okay,
   but could do with a little review.

 - I still need a couple of tweaks to the target system (/etc/locale and
   /etc/inittab). At the moment, I'm carrying a change that introduces
   an overlay for these two files, but that's not suitable for upstream
   use:

     http://git.ozlabs.org/?p=buildroot;a=commitdiff;h=d50bd74b
   
   Is there any way I can provide updates to these files? The changes
   aren't board-specific; they're due to petitboot expecting to own
   the default consoles for UIs. Or is there a better way to do this?

This series is also available in my git tree, at:

  git://git.ozlabs.org/~jk/buildroot/

- in the petitboot branch. Note that that branch includes the overlay
too, which isn't intended for upstream.

Also, I'd like to give a big thanks to the buildroot developers; being
able to re-roll an entire system with one command has made petitboot
development *significantly* easier. Also, thanks to Thomas for the nudge
to send these changes upstream!

Please let me know if you have questions/comments/etc.

Cheers,


Jeremy

---
Jeremy Kerr (8):
      package/busybox: Add facility for DHCP hooks
      package/dropbear: Add separate configuration options for client and server
      package/ncurses: Allow building wide char support
      package/powerpc-utils: Add powerpc hardware utilities
      package/kexec-lite: Add a package for the kexec-lite tools
      package/petitboot: Add petitboot, the userspace bootloader
      package/iprutils: Add IBM Power RAID utilities
      Add powerpc petitboot defconfig

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

* [Buildroot] [RFC, PATCH 3/8] package/ncurses: Allow building wide char support
  2014-01-16  8:52 [Buildroot] [RFC, PATCH 0/8] Enable a buildroot-based petitboot bootloader Jeremy Kerr
                   ` (6 preceding siblings ...)
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 6/8] package/petitboot: Add petitboot, the userspace bootloader Jeremy Kerr
@ 2014-01-16  8:52 ` Jeremy Kerr
  2014-01-30 19:44   ` Thomas Petazzoni
  2014-01-17  2:16 ` [Buildroot] [RFC, PATCH 0/8] Enable a buildroot-based petitboot bootloader Jeremy Kerr
  8 siblings, 1 reply; 38+ messages in thread
From: Jeremy Kerr @ 2014-01-16  8:52 UTC (permalink / raw)
  To: buildroot

Allow ncurses to be configured with wide char support; this causes the
libraries to be built with the 'w' suffix (eg libncursesw.so,
libmenuw.so, etc), so we need to create a few symlinks.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

---
 package/ncurses/Config.in  |    5 +++
 package/ncurses/ncurses.mk |   50 +++++++++++++++++++++++++++++++++----
 2 files changed, 50 insertions(+), 5 deletions(-)

diff --git a/package/ncurses/Config.in b/package/ncurses/Config.in
index e8ab7102..337b0160 100644
--- a/package/ncurses/Config.in
+++ b/package/ncurses/Config.in
@@ -9,6 +9,11 @@ config BR2_PACKAGE_NCURSES
 	  http://www.gnu.org/software/ncurses/
 
 if BR2_PACKAGE_NCURSES
+config BR2_PACKAGE_NCURSES_WIDEC
+	bool "enable wide char support"
+	depends on BR2_PACKAGE_NCURSES
+	help
+	  Enable wide char & UTF-8 support in ncurses libraries
 
 config BR2_PACKAGE_NCURSES_TARGET_PANEL
 	bool "ncurses libpanel in target"
diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
index f3319763..ba4cacd1 100644
--- a/package/ncurses/ncurses.mk
+++ b/package/ncurses/ncurses.mk
@@ -12,7 +12,7 @@ HOST_NCURSES_DEPENDENCIES =
 NCURSES_PROGS = clear infocmp tabs tic toe tput tset
 NCURSES_LICENSE = MIT with advertising clause
 NCURSES_LICENSE_FILES = README
-NCURSES_CONFIG_SCRIPTS = ncurses5-config
+NCURSES_CONFIG_SCRIPTS = ncurses$(W)5-config
 
 NCURSES_CONF_OPT = \
 	$(if $(BR2_PREFER_STATIC_LIB),--without-shared,--with-shared) \
@@ -36,6 +36,15 @@ ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 	NCURSES_DEPENDENCIES += busybox
 endif
 
+ifeq ($(BR2_PACKAGE_NCURSES_WIDEC),y)
+NCURSES_CONF_OPT += --enable-widec
+W=w
+W_LINK=ln -sf
+else
+W=
+W_LINK=:
+endif
+
 ifneq ($(BR2_ENABLE_DEBUG),y)
 NCURSES_CONF_OPT += --without-debug
 endif
@@ -48,19 +57,22 @@ ifneq ($(BR2_PREFER_STATIC_LIB),y)
 
 ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PANEL),y)
 define NCURSES_INSTALL_TARGET_PANEL
-	cp -dpf $(NCURSES_DIR)/lib/libpanel.so* $(TARGET_DIR)/usr/lib/
+	cp -dpf $(NCURSES_DIR)/lib/libpanel$(W).so* $(TARGET_DIR)/usr/lib/
+	$(W_LINK) libpanelw.so $(TARGET_DIR)/usr/lib/libpanel.so
 endef
 endif
 
 ifeq ($(BR2_PACKAGE_NCURSES_TARGET_FORM),y)
 define NCURSES_INSTALL_TARGET_FORM
-	cp -dpf $(NCURSES_DIR)/lib/libform.so* $(TARGET_DIR)/usr/lib/
+	cp -dpf $(NCURSES_DIR)/lib/libform$(W).so* $(TARGET_DIR)/usr/lib/
+	$(W_LINK) libformw.so $(TARGET_DIR)/usr/lib/libform.so
 endef
 endif
 
 ifeq ($(BR2_PACKAGE_NCURSES_TARGET_MENU),y)
 define NCURSES_INSTALL_TARGET_MENU
-	cp -dpf $(NCURSES_DIR)/lib/libmenu.so* $(TARGET_DIR)/usr/lib/
+	cp -dpf $(NCURSES_DIR)/lib/libmenu$(W).so* $(TARGET_DIR)/usr/lib/
+	$(W_LINK) libmenuw.so $(TARGET_DIR)/usr/lib/libmenu.so
 endef
 endif
 
@@ -78,7 +90,8 @@ endif
 
 define NCURSES_INSTALL_TARGET_CMDS
 	mkdir -p $(TARGET_DIR)/usr/lib
-	$(if $(BR2_PREFER_STATIC_LIB),,cp -dpf $(NCURSES_DIR)/lib/libncurses.so* $(TARGET_DIR)/usr/lib/)
+	$(if $(BR2_PREFER_STATIC_LIB),,cp -dpf $(NCURSES_DIR)/lib/libncurses$(W).so* $(TARGET_DIR)/usr/lib/)
+	$(W_LINK) libncursesw.so $(TARGET_DIR)/usr/lib/libncurses.so
 	$(NCURSES_INSTALL_TARGET_PANEL)
 	$(NCURSES_INSTALL_TARGET_FORM)
 	$(NCURSES_INSTALL_TARGET_MENU)
@@ -101,6 +114,33 @@ define NCURSES_INSTALL_TARGET_CMDS
 	cp -dpf $(STAGING_DIR)/usr/share/terminfo/s/screen $(TARGET_DIR)/usr/share/terminfo/s
 endef # NCURSES_INSTALL_TARGET_CMDS
 
+define NCURSES_POST_INSTALL_SYMLINK
+	$(W_LINK) libncursesw.so $(STAGING_DIR)/usr/lib/libncurses.so
+endef
+NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_POST_INSTALL_SYMLINK
+
+ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PANEL),y)
+define NCURSES_POST_INSTALL_SYMLINK_PANEL
+	$(W_LINK) libpanelw.so $(STAGING_DIR)/usr/lib/libpanel.so
+endef
+NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_POST_INSTALL_SYMLINK_PANEL
+endif
+
+ifeq ($(BR2_PACKAGE_NCURSES_TARGET_FORM),y)
+define NCURSES_POST_INSTALL_SYMLINK_FORM
+	$(W_LINK) libformw.so $(STAGING_DIR)/usr/lib/libform.so
+endef
+NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_POST_INSTALL_SYMLINK_FORM
+endif
+
+ifeq ($(BR2_PACKAGE_NCURSES_TARGET_MENU),y)
+define NCURSES_POST_INSTALL_SYMLINK_MENU
+	$(W_LINK) libmenuw.so $(STAGING_DIR)/usr/lib/libmenu.so
+endef
+NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_POST_INSTALL_SYMLINK_MENU
+endif
+
+
 #
 # On systems with an older version of tic, the installation of ncurses hangs
 # forever. To resolve the problem, build a static version of tic on host

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

* [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools
  2014-01-16  8:52 [Buildroot] [RFC, PATCH 0/8] Enable a buildroot-based petitboot bootloader Jeremy Kerr
                   ` (4 preceding siblings ...)
  2014-01-16  8:52 ` [Buildroot] [RFC,PATCH 8/8] Add powerpc petitboot defconfig Jeremy Kerr
@ 2014-01-16  8:52 ` Jeremy Kerr
  2014-01-16  9:36   ` Baruch Siach
                     ` (3 more replies)
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 6/8] package/petitboot: Add petitboot, the userspace bootloader Jeremy Kerr
                   ` (2 subsequent siblings)
  8 siblings, 4 replies; 38+ messages in thread
From: Jeremy Kerr @ 2014-01-16  8:52 UTC (permalink / raw)
  To: buildroot

Kexec-lite is a tiny impementation of kexec for devicetree-based
platforms.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

---
 package/Config.in                                 |    1 
 package/kexec-lite/Config.in                      |    9 +++
 package/kexec-lite/kexec-lite-clean-restart.patch |   34 ++++++++++++++
 package/kexec-lite/kexec-lite.mk                  |   20 ++++++++
 4 files changed, 64 insertions(+)

diff --git a/package/Config.in b/package/Config.in
index 61f4c9e0..f5161475 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -52,6 +52,7 @@ source "package/fio/Config.in"
 source "package/gdb/Config.in"
 source "package/iozone/Config.in"
 source "package/kexec/Config.in"
+source "package/kexec-lite/Config.in"
 source "package/ktap/Config.in"
 source "package/latencytop/Config.in"
 source "package/lmbench/Config.in"
diff --git a/package/kexec-lite/Config.in b/package/kexec-lite/Config.in
new file mode 100644
index 00000000..0dc05155
--- /dev/null
+++ b/package/kexec-lite/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_KEXEC_LITE
+	bool "kexec-lite"
+	depends on BR2_powerpc
+	select BR2_PACKAGE_LIBELF
+	select BR2_PACKAGE_DTC
+	select BR2_PACKAGE_DTC_PROGRAMS
+	help
+	  Kexec is a user space utiltity for loading another kernel
+	  and asking the currently running kernel to do something with it.
diff --git a/package/kexec-lite/kexec-lite-clean-restart.patch b/package/kexec-lite/kexec-lite-clean-restart.patch
new file mode 100644
index 00000000..faaa93a0
--- /dev/null
+++ b/package/kexec-lite/kexec-lite-clean-restart.patch
@@ -0,0 +1,34 @@
+From 0a654c20e1b9324c57ba4116b52fb6ab33847e1d Mon Sep 17 00:00:00 2001
+From: Jeremy Kerr <jk@ozlabs.org>
+Date: Thu, 8 Aug 2013 17:16:31 +0800
+Subject: [PATCH] kexec: Implement clean restart for busybox init
+
+Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
+---
+ kexec.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/kexec.c b/kexec.c
+index 2edb7df..b2a0c42 100644
+--- a/kexec.c
++++ b/kexec.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <syscall.h>
++#include <signal.h>
+ #include <libfdt.h>
+ #include <getopt.h>
+ #include <sys/types.h>
+@@ -818,7 +819,7 @@ int main(int argc, char *argv[])
+ 			sync();
+ 			exec_kexec();
+ 		} else {
+-			execlp("shutdown", "shutdown", "-r", "now", NULL);
++			kill(1, SIGQUIT);
+ 		}
+ 
+ 		return -1;
+-- 
+1.7.10.4
+
diff --git a/package/kexec-lite/kexec-lite.mk b/package/kexec-lite/kexec-lite.mk
new file mode 100644
index 00000000..4d844f43
--- /dev/null
+++ b/package/kexec-lite/kexec-lite.mk
@@ -0,0 +1,20 @@
+################################################################################
+#
+# kexec
+#
+################################################################################
+
+KEXEC_LITE_VERSION = 6c762a7
+KEXEC_LITE_SITE = git://github.com/antonblanchard/kexec-lite
+KEXEC_LITE_LICENSE = GPL
+KEXEC_LITE_DEPENDENCIES = libelf dtc
+
+define KEXEC_LITE_BUILD_CMDS
+	$(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D) all
+endef
+
+define KEXEC_LITE_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 755 $(@D)/kexec $(TARGET_DIR)/usr/sbin/
+endef
+
+$(eval $(generic-package))

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

* [Buildroot] [RFC, PATCH 2/8] package/dropbear: Add separate configuration options for client and server
  2014-01-16  8:52 [Buildroot] [RFC, PATCH 0/8] Enable a buildroot-based petitboot bootloader Jeremy Kerr
                   ` (2 preceding siblings ...)
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 4/8] package/powerpc-utils: Add powerpc hardware utilities Jeremy Kerr
@ 2014-01-16  8:52 ` Jeremy Kerr
  2014-03-03 23:46   ` Yann E. MORIN
  2014-03-04  0:14   ` Gustavo Zacarias
  2014-01-16  8:52 ` [Buildroot] [RFC,PATCH 8/8] Add powerpc petitboot defconfig Jeremy Kerr
                   ` (4 subsequent siblings)
  8 siblings, 2 replies; 38+ messages in thread
From: Jeremy Kerr @ 2014-01-16  8:52 UTC (permalink / raw)
  To: buildroot

Currently, the dropbear package installs both client and server
components. For example, this means that when we only want the
client binaries, we also get the server run from init.

Even though it's a multi-call binary (the client and server
exist in the same executable), we'd like to selectively install the
links and init scripts. This change introduces separate configuration
options (both 'default y') for the client and server bits.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

---
 package/dropbear/Config.in   |   12 ++++++++++++
 package/dropbear/dropbear.mk |    9 ++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/package/dropbear/Config.in b/package/dropbear/Config.in
index 68c3b71a..4a7327b7 100644
--- a/package/dropbear/Config.in
+++ b/package/dropbear/Config.in
@@ -8,6 +8,18 @@ config BR2_PACKAGE_DROPBEAR
 
 if BR2_PACKAGE_DROPBEAR
 
+config BR2_PACKAGE_DROPBEAR_SERVER
+	bool "dropbear ssh server"
+	default y
+	help
+	  Enable the dropbear ssh server, run from init
+
+config BR2_PACKAGE_DROPBEAR_CLIENT
+	bool "dropbear ssh client"
+	default y
+	help
+	  Enable the dropbear ssh client, scp and utilities
+
 config BR2_PACKAGE_DROPBEAR_DISABLE_REVERSEDNS
 	bool "disable reverse DNS lookups"
 	help
diff --git a/package/dropbear/dropbear.mk b/package/dropbear/dropbear.mk
index 3ef6c8da..a1cc5691 100644
--- a/package/dropbear/dropbear.mk
+++ b/package/dropbear/dropbear.mk
@@ -7,7 +7,7 @@
 DROPBEAR_VERSION = 2013.62
 DROPBEAR_SITE = http://matt.ucc.asn.au/dropbear/releases
 DROPBEAR_SOURCE = dropbear-$(DROPBEAR_VERSION).tar.bz2
-DROPBEAR_TARGET_BINS = dbclient dropbearkey dropbearconvert scp ssh
+DROPBEAR_TARGET_BINS = dropbearkey dropbearconvert
 DROPBEAR_MAKE =	$(MAKE) MULTI=1 SCPPROGRESS=1 \
 		PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
 
@@ -43,6 +43,7 @@ define DROPBEAR_DISABLE_STANDALONE
 	$(SED) 's:\(#define NON_INETD_MODE\):/*\1 */:' $(@D)/options.h
 endef
 
+ifeq ($(BR2_PACKAGE_DROPBEAR_SERVER),y)
 define DROPBEAR_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/dropbear/dropbear.service \
 		$(TARGET_DIR)/etc/systemd/system/dropbear.service
@@ -60,6 +61,12 @@ else
 DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_DISABLE_STANDALONE
 endif
 
+endif
+
+ifeq ($(BR2_PACKAGE_DROPBEAR_CLIENT),y)
+DROPBEAR_TARGET_BINS += dbclient scp ssh
+endif
+
 ifeq ($(BR2_PACKAGE_DROPBEAR_DISABLE_REVERSEDNS),)
 DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_ENABLE_REVERSE_DNS
 endif

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

* [Buildroot] [RFC, PATCH 6/8] package/petitboot: Add petitboot, the userspace bootloader
  2014-01-16  8:52 [Buildroot] [RFC, PATCH 0/8] Enable a buildroot-based petitboot bootloader Jeremy Kerr
                   ` (5 preceding siblings ...)
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools Jeremy Kerr
@ 2014-01-16  8:52 ` Jeremy Kerr
  2014-01-30 20:51   ` Thomas Petazzoni
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 3/8] package/ncurses: Allow building wide char support Jeremy Kerr
  2014-01-17  2:16 ` [Buildroot] [RFC, PATCH 0/8] Enable a buildroot-based petitboot bootloader Jeremy Kerr
  8 siblings, 1 reply; 38+ messages in thread
From: Jeremy Kerr @ 2014-01-16  8:52 UTC (permalink / raw)
  To: buildroot

This change adds the petitboot package, a bootloader that exists in
userspace, and uses the kexec facility to boot into a new kernel.

We add a little extra infrastructure to get things integrated into a
buildroot environment:

 - scripts to make kexec work with busybox init, for a clean shutdown

 - udev rules to get removable event notifications, and start the
   petitboot UI processes

 - startup scripts for the device-discovery process

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

---
 package/Config.in                            |    1 
 package/petitboot/Config.in                  |   10 +++
 package/petitboot/S14silence-console         |    9 +++
 package/petitboot/S15pb-discover             |   23 +++++++
 package/petitboot/kexec-restart              |    8 ++
 package/petitboot/petitboot-console-ui.rules |    5 +
 package/petitboot/petitboot.mk               |   57 +++++++++++++++++++
 package/petitboot/removable-event-poll.rules |    4 +
 8 files changed, 117 insertions(+)

diff --git a/package/Config.in b/package/Config.in
index f5161475..f650476c 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1007,6 +1007,7 @@ source "package/monit/Config.in"
 source "package/ncdu/Config.in"
 source "package/numactl/Config.in"
 source "package/nut/Config.in"
+source "package/petitboot/Config.in"
 source "package/powerpc-utils/Config.in"
 source "package/polkit/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
diff --git a/package/petitboot/Config.in b/package/petitboot/Config.in
new file mode 100644
index 00000000..2f587c06
--- /dev/null
+++ b/package/petitboot/Config.in
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_PETITBOOT
+	bool "petitboot"
+	depends on BR2_PACKAGE_KEXEC || BR2_PACKAGE_KEXEC_LITE
+	select BR2_PACKAGE_NCURSES
+	select BR2_PACKAGE_UDEV
+	select BR2_PACKAGE_POWERPC_UTILS if BR2_powerpc
+	help
+	  Petitboot is a small kexec-based bootloader
+
+	  http://www.kernel.org/pub/linux/kernel/people/geoff/petitboot/petitboot.html
diff --git a/package/petitboot/S14silence-console b/package/petitboot/S14silence-console
new file mode 100755
index 00000000..65702005
--- /dev/null
+++ b/package/petitboot/S14silence-console
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+case "$1" in
+    start)
+        echo 0 0 7 0 > /proc/sys/kernel/printk
+        ;;
+esac
+
+exit 0
diff --git a/package/petitboot/S15pb-discover b/package/petitboot/S15pb-discover
new file mode 100755
index 00000000..ebdf9449
--- /dev/null
+++ b/package/petitboot/S15pb-discover
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+LOGFILE=/var/log/petitboot/pb-discover.log
+PIDFILE=/var/run/petitboot.pid
+
+case "$1" in
+    start)
+        ulimit -c unlimited
+        mkdir -p $(dirname $LOGFILE)
+        PATH=/usr/bin:/usr/sbin:/bin:/sbin pb-discover -l $LOGFILE &
+        echo $! > $PIDFILE
+        ;;
+    stop)
+        pid=$(cat $PIDFILE)
+        [ -n "$pid" ] && kill -TERM $pid
+        ;;
+    *)
+        echo "Usage: $0 {start|stop}"
+        exit 1
+        ;;
+esac
+
+exit 0
diff --git a/package/petitboot/kexec-restart b/package/petitboot/kexec-restart
new file mode 100755
index 00000000..0175e76d
--- /dev/null
+++ b/package/petitboot/kexec-restart
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+/usr/sbin/kexec -f -e
+
+while :
+do
+    sleep 1
+done
diff --git a/package/petitboot/petitboot-console-ui.rules b/package/petitboot/petitboot-console-ui.rules
new file mode 100644
index 00000000..74648562
--- /dev/null
+++ b/package/petitboot/petitboot-console-ui.rules
@@ -0,0 +1,5 @@
+
+# spawn a petitboot UI on common user-visible interface devices
+SUBSYSTEM=="tty", KERNEL=="hvc*", RUN+="/usr/libexec/petitboot/pb-console --getty --detach -- -n -i 0 $name vt100"
+SUBSYSTEM=="tty", KERNEL=="tty0", RUN+="/usr/libexec/petitboot/pb-console --getty --detach -- -n -i 0 $name vt100"
+SUBSYSTEM=="tty", KERNEL=="ttyS*", RUN+="/usr/libexec/petitboot/pb-console --getty --detach -- -n -i 0 $name vt100"
diff --git a/package/petitboot/petitboot.mk b/package/petitboot/petitboot.mk
new file mode 100644
index 00000000..b8a2179d
--- /dev/null
+++ b/package/petitboot/petitboot.mk
@@ -0,0 +1,57 @@
+#############################################################
+#
+# petitboot
+#
+#############################################################
+PETITBOOT_VERSION = af805399
+PETITBOOT_SITE = git://git.ozlabs.org/home/jk/git/petitboot
+PETITBOOT_DEPENDENCIES = ncurses udev
+PETITBOOT_LICENSE = GPLv2
+PETITBOOT_LICENSE_FILES = COPYING
+
+PETITBOOT_CONF_OPT += --with-ncurses --without-twin-x11 --without-twin-fbdev \
+		      --localstatedir=/var --with-tftp=busybox \
+		      HOST_PROG_KEXEC=/usr/sbin/kexec \
+		      HOST_PROG_SHUTDOWN=/usr/libexec/petitboot/bb-kexec-reboot
+
+ifdef PETITBOOT_DEBUG
+PETITBOOT_CONF_OPT += --enable-debug
+endif
+
+ifeq ($(BR2_PACKAGE_NCURSES_WIDEC),y)
+PETITBOOT_CONF_OPT += --with-ncursesw MENU_LIB=-lmenuw FORM_LIB=-lformw
+endif
+
+define PETITBOOT_PRE_CONFIGURE_BOOTSTRAP
+	(cd $(@D) && ./bootstrap $(PETITBOOT_VERSION))
+endef
+
+PETITBOOT_PRE_CONFIGURE_HOOKS += PETITBOOT_PRE_CONFIGURE_BOOTSTRAP
+
+define PETITBOOT_POST_INSTALL
+	$(INSTALL) -D -m 0755 $(@D)/utils/bb-kexec-reboot \
+		$(TARGET_DIR)/usr/libexec/petitboot
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/petitboot/boot.d
+	$(INSTALL) -D -m 0755 $(@D)/utils/hooks/01-create-default-dtb \
+		$(TARGET_DIR)/etc/petitboot/boot.d/
+	$(INSTALL) -D -m 0755 $(@D)/utils/hooks/20-set-stdout \
+		$(TARGET_DIR)/etc/petitboot/boot.d/
+
+	$(INSTALL) -D -m 0755 package/petitboot/S14silence-console \
+		$(TARGET_DIR)/etc/init.d/
+	$(INSTALL) -D -m 0755 package/petitboot/S15pb-discover \
+		$(TARGET_DIR)/etc/init.d/
+	$(INSTALL) -D -m 0755 package/petitboot/kexec-restart \
+		$(TARGET_DIR)/usr/sbin/
+	$(INSTALL) -D -m 0755 package/petitboot/petitboot-console-ui.rules \
+		$(TARGET_DIR)/etc/udev/rules.d/
+	$(INSTALL) -D -m 0755 package/petitboot/removable-event-poll.rules \
+		$(TARGET_DIR)/etc/udev/rules.d/
+
+	ln -sf /usr/sbin/pb-udhcpc \
+		$(TARGET_DIR)/usr/share/udhcpc/default.script.d/
+endef
+
+PETITBOOT_POST_INSTALL_TARGET_HOOKS += PETITBOOT_POST_INSTALL
+
+$(eval $(autotools-package))
diff --git a/package/petitboot/removable-event-poll.rules b/package/petitboot/removable-event-poll.rules
new file mode 100644
index 00000000..b736aef6
--- /dev/null
+++ b/package/petitboot/removable-event-poll.rules
@@ -0,0 +1,4 @@
+
+# petitboot needs notification for media change events on removable devices,
+# which we only get if we've set the poll_msecs sysfs attribute.
+ACTION!="remove", ATTR{removable}=="1", ATTR{events_poll_msecs}="2000"

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

* [Buildroot] [RFC,PATCH 8/8] Add powerpc petitboot defconfig
  2014-01-16  8:52 [Buildroot] [RFC, PATCH 0/8] Enable a buildroot-based petitboot bootloader Jeremy Kerr
                   ` (3 preceding siblings ...)
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 2/8] package/dropbear: Add separate configuration options for client and server Jeremy Kerr
@ 2014-01-16  8:52 ` Jeremy Kerr
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools Jeremy Kerr
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 38+ messages in thread
From: Jeremy Kerr @ 2014-01-16  8:52 UTC (permalink / raw)
  To: buildroot

A simple defconfig for building a petitboot-based bootloader for powerpc
machines.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

---
 configs/powerpc_petitboot_defconfig |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/configs/powerpc_petitboot_defconfig b/configs/powerpc_petitboot_defconfig
new file mode 100644
index 00000000..8470c2f9
--- /dev/null
+++ b/configs/powerpc_petitboot_defconfig
@@ -0,0 +1,22 @@
+BR2_powerpc=y
+BR2_TOOLCHAIN_BUILDROOT_LARGEFILE=y
+BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
+BR2_GENERATE_LOCALE="en_US.utf8"
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV=y
+BR2_TARGET_GENERIC_GETTY_PORT="hvc0"
+BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+BR2_PACKAGE_KEXEC_LITE=y
+BR2_PACKAGE_LINUX_FIRMWARE=y
+BR2_PACKAGE_LINUX_FIRMWARE_BNX2X=y
+BR2_PACKAGE_LINUX_FIRMWARE_CXGB4=y
+BR2_PACKAGE_NCURSES_WIDEC=y
+BR2_PACKAGE_NCURSES_TARGET_FORM=y
+BR2_PACKAGE_NCURSES_TARGET_MENU=y
+BR2_PACKAGE_DROPBEAR=y
+# BR2_PACKAGE_DROPBEAR_SERVER is not set
+BR2_PACKAGE_ETHTOOL=y
+BR2_PACKAGE_NETCAT=y
+BR2_PACKAGE_RSYNC=y
+BR2_PACKAGE_PETITBOOT=y
+BR2_TARGET_ROOTFS_CPIO=y
+BR2_TARGET_ROOTFS_CPIO_GZIP=y

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

* [Buildroot] [RFC, PATCH 7/8] package/iprutils: Add IBM Power RAID utilities
  2014-01-16  8:52 [Buildroot] [RFC, PATCH 0/8] Enable a buildroot-based petitboot bootloader Jeremy Kerr
@ 2014-01-16  8:52 ` Jeremy Kerr
  2014-01-16 13:24   ` Jerzy Grzegorek
  2014-01-30 20:54   ` Thomas Petazzoni
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 1/8] package/busybox: Add facility for DHCP hooks Jeremy Kerr
                   ` (7 subsequent siblings)
  8 siblings, 2 replies; 38+ messages in thread
From: Jeremy Kerr @ 2014-01-16  8:52 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

---
 package/Config.in                                |    1 
 package/iprutils/Config.in                       |   10 +++++
 package/iprutils/iprutils-dont-use-gettext.patch |   30 +++++++++++++++
 package/iprutils/iprutils.mk                     |   27 +++++++++++++
 4 files changed, 68 insertions(+)

diff --git a/package/Config.in b/package/Config.in
index f650476c..a9fc035f 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1000,6 +1000,7 @@ endif
 source "package/cpuload/Config.in"
 source "package/dsp-tools/Config.in"
 source "package/htop/Config.in"
+source "package/iprutils/Config.in"
 source "package/keyutils/Config.in"
 source "package/kmod/Config.in"
 source "package/lxc/Config.in"
diff --git a/package/iprutils/Config.in b/package/iprutils/Config.in
new file mode 100644
index 00000000..d72688f2
--- /dev/null
+++ b/package/iprutils/Config.in
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_IPRUTILS
+	bool "iprutils"
+	select BR2_PACKAGE_NCURSES
+	select BR2_PACKAGE_NCURSES_TARGET_PANEL
+	select BR2_PACKAGE_NCURSES_TARGET_FORM
+	select BR2_PACKAGE_NCURSES_TARGET_MENU
+	select BR2_PACKAGE_LIBSYSFS
+	select BR2_PACKAGE_PCIUTILS
+	help
+	  System utilities for IBM Power RAID devices
diff --git a/package/iprutils/iprutils-dont-use-gettext.patch b/package/iprutils/iprutils-dont-use-gettext.patch
new file mode 100644
index 00000000..8d3d5dd9
--- /dev/null
+++ b/package/iprutils/iprutils-dont-use-gettext.patch
@@ -0,0 +1,30 @@
+From 0aa3952890e14f5447147ae4d0d37c515e4fefea Mon Sep 17 00:00:00 2001
+From: Jeremy Kerr <jk@ozlabs.org>
+Date: Fri, 26 Jul 2013 13:07:22 +0800
+Subject: [PATCH] iprconfig: Don't use gettext
+
+... since we don't have any translations.
+
+Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
+---
+ iprconfig.h |    4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/iprconfig.h b/iprconfig.h
+index 867b5ac..a9cdf5e 100644
+--- a/iprconfig.h
++++ b/iprconfig.h
+@@ -11,9 +11,7 @@
+  *
+  **/
+ 
+-#include <libintl.h>
+-
+-#define _(string) gettext(string)
++#define _(string) (string)
+ #define __(string) (string)
+ #define EXIT_FLAG		0x8000	/* stops at given screen on exit call */
+ #define CANCEL_FLAG		0x4000	/* stops at given screen on quit call */
+-- 
+1.7.10.4
+
diff --git a/package/iprutils/iprutils.mk b/package/iprutils/iprutils.mk
new file mode 100644
index 00000000..0aa94f38
--- /dev/null
+++ b/package/iprutils/iprutils.mk
@@ -0,0 +1,27 @@
+#############################################################
+#
+# iprutils
+#
+#############################################################
+
+IPRUTILS_VERSION = 2.3.15
+IPRUTILS_SITE = http://downloads.sourceforge.net/project/iprdd/iprutils%20for%202.6%20kernels/$(IPRUTILS_VERSION)
+IPRUTILS_SOURCE=iprutils-$(IPRUTILS_VERSION)-src.tgz
+IPRUTILS_DEPENDENCIES = ncurses libsysfs pciutils
+IPRUTILS_LICENSE = Common Public License Version 1.0
+IPRUTILS_LICENSE_FILES = LICENSE
+
+define IPRUTILS_BUILD_CMDS
+	$(MAKE) CC=$(TARGET_CC) LD=$(TARGET_LD) -C $(@D) all
+endef
+
+define IPRUTILS_INSTALL_TARGET_CMDS
+        $(INSTALL) -d $(TARGET_DIR)/sbin
+        $(INSTALL) -D --mode=755 $(@D)/iprconfig $(TARGET_DIR)/sbin/
+        $(INSTALL) -D --mode=755 $(@D)/iprupdate $(TARGET_DIR)/sbin/
+        $(INSTALL) -D --mode=755 $(@D)/iprdump $(TARGET_DIR)/sbin/
+        $(INSTALL) -D --mode=755 $(@D)/iprinit $(TARGET_DIR)/sbin/
+        $(INSTALL) -D --mode=700 $(@D)/iprdbg $(TARGET_DIR)/sbin/
+endef
+
+$(eval $(generic-package))

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

* [Buildroot] [RFC, PATCH 1/8] package/busybox: Add facility for DHCP hooks
  2014-01-16  8:52 [Buildroot] [RFC, PATCH 0/8] Enable a buildroot-based petitboot bootloader Jeremy Kerr
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 7/8] package/iprutils: Add IBM Power RAID utilities Jeremy Kerr
@ 2014-01-16  8:52 ` Jeremy Kerr
  2014-03-04 20:01   ` Yann E. MORIN
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 4/8] package/powerpc-utils: Add powerpc hardware utilities Jeremy Kerr
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 38+ messages in thread
From: Jeremy Kerr @ 2014-01-16  8:52 UTC (permalink / raw)
  To: buildroot

The (u)dhcpc hook installed by the busybox package configures the
network and exits. If we want to do anything further with a DHCP lease,
we'd have to replace the script entirely.

This change introduces a .d directory for hooks (based on the script
filename), which are executed after the interface configuration. This
allows packages to drop a script file in the .d directory to perform
actions on DHCP events.

We'll use this in a later change to notify petitboot of DHCP boot
information.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

---
 package/busybox/busybox.mk    |    2 ++
 package/busybox/udhcpc.script |    9 +++++++++
 2 files changed, 11 insertions(+)

diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index f6f542e2..6ff5f3da 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -200,6 +200,8 @@ define BUSYBOX_INSTALL_TARGET_CMDS
 	if [ ! -f $(TARGET_DIR)/usr/share/udhcpc/default.script ]; then \
 		$(INSTALL) -m 0755 -D package/busybox/udhcpc.script \
 			$(TARGET_DIR)/usr/share/udhcpc/default.script; \
+		$(INSTALL) -m 755 -d \
+			$(TARGET_DIR)/usr/share/udhcpc/default.script.d; \
 	fi
 	$(BUSYBOX_INSTALL_MDEV_SCRIPT)
 	$(BUSYBOX_INSTALL_MDEV_CONF)
diff --git a/package/busybox/udhcpc.script b/package/busybox/udhcpc.script
index 43742fbd..8930d4a8 100755
--- a/package/busybox/udhcpc.script
+++ b/package/busybox/udhcpc.script
@@ -63,4 +63,13 @@ case "$1" in
 		;;
 esac
 
+HOOK_DIR="$0.d"
+if [ -d "$HOOK_DIR" ]
+then
+	for HOOK in $HOOK_DIR/*; do
+		$HOOK "$@"
+	done
+fi
+
+
 exit 0

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

* [Buildroot] [RFC, PATCH 4/8] package/powerpc-utils: Add powerpc hardware utilities
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 4/8] package/powerpc-utils: Add powerpc hardware utilities Jeremy Kerr
@ 2014-01-16  9:30   ` Baruch Siach
  2014-01-16 13:11   ` Jerzy Grzegorek
  2014-01-29  8:12   ` Thomas Petazzoni
  2 siblings, 0 replies; 38+ messages in thread
From: Baruch Siach @ 2014-01-16  9:30 UTC (permalink / raw)
  To: buildroot

Hi Jeremy,

On Thu, Jan 16, 2014 at 04:52:18PM +0800, Jeremy Kerr wrote:
> This change adds a package definition for the powerpc-utils project,
> containing a set of powerpc-specific hardware management utilities.
> 
> We're using a git tag from upstream, which contains a few build-system
> fixes. We also add a patch to use `reboot` instead of `shutdown -r`,
> allowing compatibility with busybox.
> 
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

[...]

> diff --git a/package/powerpc-utils/powerpc-utils.mk 
> b/package/powerpc-utils/powerpc-utils.mk
> new file mode 100644
> index 00000000..15deb2e9
> --- /dev/null
> +++ b/package/powerpc-utils/powerpc-utils.mk
> @@ -0,0 +1,14 @@
> +#############################################################
> +#
> +# powerpc-utils
> +#
> +#############################################################
> +
> +POWERPC_UTILS_VERSION = aeb32757

Please use the full 40-char commit id.

> +POWERPC_UTILS_SITE = git://git.code.sf.net/p/powerpc-utils/powerpc-utils
> +POWERPC_UTILS_AUTORECONF = YES
> +POWERPC_UTILS_DEPENDENCIES = zlib
> +
> +POWERPC_UTILS_CONF_OPT += --without-librtas
> +
> +$(eval $(autotools-package))

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

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

* [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools Jeremy Kerr
@ 2014-01-16  9:36   ` Baruch Siach
  2014-01-17  1:51     ` Jeremy Kerr
  2014-01-16 13:17   ` Jerzy Grzegorek
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 38+ messages in thread
From: Baruch Siach @ 2014-01-16  9:36 UTC (permalink / raw)
  To: buildroot

Hi Jeremy,

On Thu, Jan 16, 2014 at 04:52:18PM +0800, Jeremy Kerr wrote:
> Kexec-lite is a tiny impementation of kexec for devicetree-based
> platforms.
> 
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

[...]

> diff --git a/package/kexec-lite/Config.in b/package/kexec-lite/Config.in
> new file mode 100644
> index 00000000..0dc05155
> --- /dev/null
> +++ b/package/kexec-lite/Config.in
> @@ -0,0 +1,9 @@
> +config BR2_PACKAGE_KEXEC_LITE
> +	bool "kexec-lite"
> +	depends on BR2_powerpc
> +	select BR2_PACKAGE_LIBELF
> +	select BR2_PACKAGE_DTC
> +	select BR2_PACKAGE_DTC_PROGRAMS
> +	help
> +	  Kexec is a user space utiltity for loading another kernel
> +	  and asking the currently running kernel to do something with it.

This looks like a description of the generic kexec. You should mention that 
this is a special version as the commit log says.

[...]

> diff --git a/package/kexec-lite/kexec-lite.mk 
> b/package/kexec-lite/kexec-lite.mk
> new file mode 100644
> index 00000000..4d844f43
> --- /dev/null
> +++ b/package/kexec-lite/kexec-lite.mk
> @@ -0,0 +1,20 @@
> +################################################################################
> +#
> +# kexec
> +#
> +################################################################################
> +
> +KEXEC_LITE_VERSION = 6c762a7

Full commit id.

> +KEXEC_LITE_SITE = git://github.com/antonblanchard/kexec-lite

Please use the github helper. See docs/manual/adding-packages-tips.txt.

> +KEXEC_LITE_LICENSE = GPL
> +KEXEC_LITE_DEPENDENCIES = libelf dtc
> +
> +define KEXEC_LITE_BUILD_CMDS
> +	$(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D) all
> +endef
> +
> +define KEXEC_LITE_INSTALL_TARGET_CMDS
> +	$(INSTALL) -D -m 755 $(@D)/kexec $(TARGET_DIR)/usr/sbin/
> +endef
> +
> +$(eval $(generic-package))

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

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

* [Buildroot] [RFC, PATCH 4/8] package/powerpc-utils: Add powerpc hardware utilities
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 4/8] package/powerpc-utils: Add powerpc hardware utilities Jeremy Kerr
  2014-01-16  9:30   ` Baruch Siach
@ 2014-01-16 13:11   ` Jerzy Grzegorek
  2014-01-29  8:12   ` Thomas Petazzoni
  2 siblings, 0 replies; 38+ messages in thread
From: Jerzy Grzegorek @ 2014-01-16 13:11 UTC (permalink / raw)
  To: buildroot


Hi Jeremy,

> This change adds a package definition for the powerpc-utils project,
> containing a set of powerpc-specific hardware management utilities.
>
> We're using a git tag from upstream, which contains a few build-system
> fixes. We also add a patch to use `reboot` instead of `shutdown -r`,
> allowing compatibility with busybox.
>
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
>
> ---
>   package/Config.in                                                                             |    1
>   package/powerpc-utils/Config.in                                                               |    5 +
>   package/powerpc-utils/powerpc-utils-scripts-update_flash-Use-reboot-instead-of-shutdown.patch |   42 ++++++++++

powerpc-utils-01-scripts-update_flash-Use-reboot-instead-of-shutdown.patch


>   package/powerpc-utils/powerpc-utils.mk                                                        |   14 +++
>   4 files changed, 62 insertions(+)

[...]

> diff --git a/package/powerpc-utils/powerpc-utils.mk b/package/powerpc-utils/powerpc-utils.mk
> new file mode 100644
> index 00000000..15deb2e9
> --- /dev/null
> +++ b/package/powerpc-utils/powerpc-utils.mk
> @@ -0,0 +1,14 @@
> +#############################################################

80 of # signs

> +#
> +# powerpc-utils
> +#
> +#############################################################

ditto

Regards,
Jerzy

> +
> +POWERPC_UTILS_VERSION = aeb32757
> +POWERPC_UTILS_SITE = git://git.code.sf.net/p/powerpc-utils/powerpc-utils
> +POWERPC_UTILS_AUTORECONF = YES
> +POWERPC_UTILS_DEPENDENCIES = zlib
> +
> +POWERPC_UTILS_CONF_OPT += --without-librtas
> +
> +$(eval $(autotools-package))
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>

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

* [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools Jeremy Kerr
  2014-01-16  9:36   ` Baruch Siach
@ 2014-01-16 13:17   ` Jerzy Grzegorek
  2014-01-30 19:46   ` Thomas Petazzoni
  2014-01-30 19:47   ` Thomas Petazzoni
  3 siblings, 0 replies; 38+ messages in thread
From: Jerzy Grzegorek @ 2014-01-16 13:17 UTC (permalink / raw)
  To: buildroot


Hi Jeremy,

> Kexec-lite is a tiny impementation of kexec for devicetree-based
> platforms.
>
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
>
> ---
>   package/Config.in                                 |    1
>   package/kexec-lite/Config.in                      |    9 +++
>   package/kexec-lite/kexec-lite-clean-restart.patch |   34 ++++++++++++++

kexec-lite-01-clean-restart.patch


>   package/kexec-lite/kexec-lite.mk                  |   20 ++++++++
>   4 files changed, 64 insertions(+)

[...]

> diff --git a/package/kexec-lite/kexec-lite.mk b/package/kexec-lite/kexec-lite.mk
> new file mode 100644
> index 00000000..4d844f43
> --- /dev/null
> +++ b/package/kexec-lite/kexec-lite.mk
> @@ -0,0 +1,20 @@
> +################################################################################
> +#
> +# kexec

# kexec-lite

Regards,
Jerzy

> +#
> +################################################################################
> +
> +KEXEC_LITE_VERSION = 6c762a7
> +KEXEC_LITE_SITE = git://github.com/antonblanchard/kexec-lite
> +KEXEC_LITE_LICENSE = GPL
> +KEXEC_LITE_DEPENDENCIES = libelf dtc
> +
> +define KEXEC_LITE_BUILD_CMDS
> +	$(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D) all
> +endef
> +
> +define KEXEC_LITE_INSTALL_TARGET_CMDS
> +	$(INSTALL) -D -m 755 $(@D)/kexec $(TARGET_DIR)/usr/sbin/
> +endef
> +
> +$(eval $(generic-package))
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>

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

* [Buildroot] [RFC, PATCH 7/8] package/iprutils: Add IBM Power RAID utilities
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 7/8] package/iprutils: Add IBM Power RAID utilities Jeremy Kerr
@ 2014-01-16 13:24   ` Jerzy Grzegorek
  2014-01-17  1:58     ` Jeremy Kerr
  2014-01-30 20:54   ` Thomas Petazzoni
  1 sibling, 1 reply; 38+ messages in thread
From: Jerzy Grzegorek @ 2014-01-16 13:24 UTC (permalink / raw)
  To: buildroot


Hi Jeremy,

> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
>
> ---
>   package/Config.in                                |    1
>   package/iprutils/Config.in                       |   10 +++++
>   package/iprutils/iprutils-dont-use-gettext.patch |   30 +++++++++++++++

iprutils-01-dont-use-gettext.patch


>   package/iprutils/iprutils.mk                     |   27 +++++++++++++
>   4 files changed, 68 insertions(+)

[...]

> diff --git a/package/iprutils/iprutils.mk b/package/iprutils/iprutils.mk
> new file mode 100644
> index 00000000..0aa94f38
> --- /dev/null
> +++ b/package/iprutils/iprutils.mk
> @@ -0,0 +1,27 @@
> +#############################################################

80 of # signs

> +#
> +# iprutils
> +#
> +#############################################################

ditto

> +
> +IPRUTILS_VERSION = 2.3.15
> +IPRUTILS_SITE = http://downloads.sourceforge.net/project/iprdd/iprutils%20for%202.6%20kernels/$(IPRUTILS_VERSION)
> +IPRUTILS_SOURCE=iprutils-$(IPRUTILS_VERSION)-src.tgz

IPRUTILS_SOURCE = iprutils-$(IPRUTILS_VERSION)-src.tgz


Regards,
Jerzy

> +IPRUTILS_DEPENDENCIES = ncurses libsysfs pciutils
> +IPRUTILS_LICENSE = Common Public License Version 1.0
> +IPRUTILS_LICENSE_FILES = LICENSE
> +
> +define IPRUTILS_BUILD_CMDS
> +	$(MAKE) CC=$(TARGET_CC) LD=$(TARGET_LD) -C $(@D) all
> +endef
> +
> +define IPRUTILS_INSTALL_TARGET_CMDS
> +        $(INSTALL) -d $(TARGET_DIR)/sbin
> +        $(INSTALL) -D --mode=755 $(@D)/iprconfig $(TARGET_DIR)/sbin/
> +        $(INSTALL) -D --mode=755 $(@D)/iprupdate $(TARGET_DIR)/sbin/
> +        $(INSTALL) -D --mode=755 $(@D)/iprdump $(TARGET_DIR)/sbin/
> +        $(INSTALL) -D --mode=755 $(@D)/iprinit $(TARGET_DIR)/sbin/
> +        $(INSTALL) -D --mode=700 $(@D)/iprdbg $(TARGET_DIR)/sbin/
> +endef
> +
> +$(eval $(generic-package))
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>

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

* [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools
  2014-01-16  9:36   ` Baruch Siach
@ 2014-01-17  1:51     ` Jeremy Kerr
  0 siblings, 0 replies; 38+ messages in thread
From: Jeremy Kerr @ 2014-01-17  1:51 UTC (permalink / raw)
  To: buildroot

Hi Baruch,

Thanks for taking a look at the patches.

>> +++ b/package/kexec-lite/Config.in
>> @@ -0,0 +1,9 @@
>> +config BR2_PACKAGE_KEXEC_LITE
>> +	bool "kexec-lite"
>> +	depends on BR2_powerpc
>> +	select BR2_PACKAGE_LIBELF
>> +	select BR2_PACKAGE_DTC
>> +	select BR2_PACKAGE_DTC_PROGRAMS
>> +	help
>> +	  Kexec is a user space utiltity for loading another kernel
>> +	  and asking the currently running kernel to do something with it.
> 
> This looks like a description of the generic kexec. You should mention that 
> this is a special version as the commit log says.

Yep, shamelessly stolen from kexec.mk. :) I've updated this with a
description similar to the changelog.

>> --- /dev/null
>> +++ b/package/kexec-lite/kexec-lite.mk
>> @@ -0,0 +1,20 @@
>> +################################################################################
>> +#
>> +# kexec
>> +#
>> +################################################################################
>> +
>> +KEXEC_LITE_VERSION = 6c762a7
> 
> Full commit id.

Fixed, along with the other git version strings you've mentioned in this
series.

>> +KEXEC_LITE_SITE = git://github.com/antonblanchard/kexec-lite
> 
> Please use the github helper. See docs/manual/adding-packages-tips.txt.

Ah, that's pretty neat. Updated to use $(call github  ...).

I've updated my series with these changes, but will see if there's any
more feedback before reposting.

Cheers,


Jeremy

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

* [Buildroot] [RFC, PATCH 7/8] package/iprutils: Add IBM Power RAID utilities
  2014-01-16 13:24   ` Jerzy Grzegorek
@ 2014-01-17  1:58     ` Jeremy Kerr
  0 siblings, 0 replies; 38+ messages in thread
From: Jeremy Kerr @ 2014-01-17  1:58 UTC (permalink / raw)
  To: buildroot

Hi Jerzy,

Thanks for the review. Comments inline:

>>   package/Config.in                                |    1
>>   package/iprutils/Config.in                       |   10 +++++
>>   package/iprutils/iprutils-dont-use-gettext.patch |   30 +++++++++++++++
> 
> iprutils-01-dont-use-gettext.patch

Makes sense. Fixed, along with the other patches introduced in this series.

>> diff --git a/package/iprutils/iprutils.mk b/package/iprutils/iprutils.mk
>> new file mode 100644
>> index 00000000..0aa94f38
>> --- /dev/null
>> +++ b/package/iprutils/iprutils.mk
>> @@ -0,0 +1,27 @@
>> +#############################################################
> 
> 80 of # signs

Fixed, including other new .mk files in this series

>> +
>> +IPRUTILS_VERSION = 2.3.15
>> +IPRUTILS_SITE =
>> http://downloads.sourceforge.net/project/iprdd/iprutils%20for%202.6%20kernels/$(IPRUTILS_VERSION)
>>
>> +IPRUTILS_SOURCE=iprutils-$(IPRUTILS_VERSION)-src.tgz
> 
> IPRUTILS_SOURCE = iprutils-$(IPRUTILS_VERSION)-src.tgz

Fixed.

I've updated my git tree based on your feedback, I'll repost after a
little while, in case there are any more changes requested.

Cheers,


Jeremy

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

* [Buildroot] [RFC, PATCH 0/8] Enable a buildroot-based petitboot bootloader
  2014-01-16  8:52 [Buildroot] [RFC, PATCH 0/8] Enable a buildroot-based petitboot bootloader Jeremy Kerr
                   ` (7 preceding siblings ...)
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 3/8] package/ncurses: Allow building wide char support Jeremy Kerr
@ 2014-01-17  2:16 ` Jeremy Kerr
  8 siblings, 0 replies; 38+ messages in thread
From: Jeremy Kerr @ 2014-01-17  2:16 UTC (permalink / raw)
  To: buildroot

Hi all,

> While most of this series is fairly straightforward, there are a few
> items that might need a little more attention:

Also, the way I'm doing the kexec could use a sanity check. Currently,
it goes like this:

- we configure busybox init (permanently through inittab) to use
  /usr/sbin/kexec-restart as the "restart" handler.

- when petitboot is told to boot a new kernel, it loads it (along with
  optional initrd and device-tree blob) into the running kernel
  with the kexec command. This only loads the new kernel through the
  kexec_load syscall, it doesn't initiate any boot process.

- next, petitboot runs its shutdown command, which we've configured
  as /usr/libexec/petitboot/bb-kexec-reboot. This is a busybox-
  init-specific script that simply sends a SIGQUIT to bb init to
  invoke the restart.

- bb init starts the shutdown procedure, and terminates running
  processes, then finally executes the restart handler (which we
  configured earlier to /usr/sbin/kexec-restart).

- /usr/sbin/kexec-restart simply calls the reboot() syscall, with
  the correct magic value to execute the kernel we loaded earlier.

The reason we're using the restart handler here is that busybox init
doesn't know about the reboot()'s magic value to perform a kexec, and
the busybox folks would rather that this *isn't* handled by init (which
makes sense).

Feedback welcome!

Cheers,


Jeremy

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

* [Buildroot] [RFC, PATCH 4/8] package/powerpc-utils: Add powerpc hardware utilities
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 4/8] package/powerpc-utils: Add powerpc hardware utilities Jeremy Kerr
  2014-01-16  9:30   ` Baruch Siach
  2014-01-16 13:11   ` Jerzy Grzegorek
@ 2014-01-29  8:12   ` Thomas Petazzoni
  2014-01-30  1:51     ` Jeremy Kerr
  2 siblings, 1 reply; 38+ messages in thread
From: Thomas Petazzoni @ 2014-01-29  8:12 UTC (permalink / raw)
  To: buildroot

Dear Jeremy Kerr,

Hey, thanks for posting this! Nice to see that our short discussion at
LCA after your talk was useful :-)

On Thu, 16 Jan 2014 16:52:18 +0800, Jeremy Kerr wrote:

> diff --git a/package/powerpc-utils/powerpc-utils.mk b/package/powerpc-utils/powerpc-utils.mk
> new file mode 100644
> index 00000000..15deb2e9
> --- /dev/null
> +++ b/package/powerpc-utils/powerpc-utils.mk
> @@ -0,0 +1,14 @@
> +#############################################################
> +#
> +# powerpc-utils
> +#
> +#############################################################
> +
> +POWERPC_UTILS_VERSION = aeb32757
> +POWERPC_UTILS_SITE = git://git.code.sf.net/p/powerpc-utils/powerpc-utils
> +POWERPC_UTILS_AUTORECONF = YES
> +POWERPC_UTILS_DEPENDENCIES = zlib

In addition to the comments that were made by others, it would be good
to add POWERPC_UTILS_LICENSE and POWERPC_UTILS_LICENSE_FILES.

> +POWERPC_UTILS_CONF_OPT += --without-librtas

Nitpick: a = is sufficient here.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [RFC, PATCH 4/8] package/powerpc-utils: Add powerpc hardware utilities
  2014-01-29  8:12   ` Thomas Petazzoni
@ 2014-01-30  1:51     ` Jeremy Kerr
  0 siblings, 0 replies; 38+ messages in thread
From: Jeremy Kerr @ 2014-01-30  1:51 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

>> diff --git a/package/powerpc-utils/powerpc-utils.mk b/package/powerpc-utils/powerpc-utils.mk
>> new file mode 100644
>> index 00000000..15deb2e9
>> --- /dev/null
>> +++ b/package/powerpc-utils/powerpc-utils.mk
>> @@ -0,0 +1,14 @@
>> +#############################################################
>> +#
>> +# powerpc-utils
>> +#
>> +#############################################################
>> +
>> +POWERPC_UTILS_VERSION = aeb32757
>> +POWERPC_UTILS_SITE = git://git.code.sf.net/p/powerpc-utils/powerpc-utils
>> +POWERPC_UTILS_AUTORECONF = YES
>> +POWERPC_UTILS_DEPENDENCIES = zlib
> 
> In addition to the comments that were made by others, it would be good
> to add POWERPC_UTILS_LICENSE and POWERPC_UTILS_LICENSE_FILES.
> 
>> +POWERPC_UTILS_CONF_OPT += --without-librtas
> 
> Nitpick: a = is sufficient here.

Both sound good; I've implemented both changes.

Thanks for the review - I'll post a new series shortly.


Jeremy

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

* [Buildroot] [RFC, PATCH 3/8] package/ncurses: Allow building wide char support
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 3/8] package/ncurses: Allow building wide char support Jeremy Kerr
@ 2014-01-30 19:44   ` Thomas Petazzoni
  2014-02-28  2:53     ` Jeremy Kerr
  0 siblings, 1 reply; 38+ messages in thread
From: Thomas Petazzoni @ 2014-01-30 19:44 UTC (permalink / raw)
  To: buildroot

Dear Jeremy Kerr,

On Thu, 16 Jan 2014 16:52:18 +0800, Jeremy Kerr wrote:

>  if BR2_PACKAGE_NCURSES
> +config BR2_PACKAGE_NCURSES_WIDEC

One empty line between the if line and the config line.

> +	bool "enable wide char support"
> +	depends on BR2_PACKAGE_NCURSES

dependency not needed since you're inside a if BR2_PACKAGE_NCURSES.

I believe this option most likely depends on BR2_USE_WCHAR.

Also, maybe name the option BR2_PACKAGE_NCURSES_WCHAR, to match the
BR2_USE_WCHAR name we're already using in Buildroot to talk about wide
char support.

> +	help
> +	  Enable wide char & UTF-8 support in ncurses libraries
>  
>  config BR2_PACKAGE_NCURSES_TARGET_PANEL
>  	bool "ncurses libpanel in target"
> diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
> index f3319763..ba4cacd1 100644
> --- a/package/ncurses/ncurses.mk
> +++ b/package/ncurses/ncurses.mk
> @@ -12,7 +12,7 @@ HOST_NCURSES_DEPENDENCIES =
>  NCURSES_PROGS = clear infocmp tabs tic toe tput tset
>  NCURSES_LICENSE = MIT with advertising clause
>  NCURSES_LICENSE_FILES = README
> -NCURSES_CONFIG_SCRIPTS = ncurses5-config
> +NCURSES_CONFIG_SCRIPTS = ncurses$(W)5-config
>  
>  NCURSES_CONF_OPT = \
>  	$(if $(BR2_PREFER_STATIC_LIB),--without-shared,--with-shared) \
> @@ -36,6 +36,15 @@ ifeq ($(BR2_PACKAGE_BUSYBOX),y)
>  	NCURSES_DEPENDENCIES += busybox
>  endif
>  
> +ifeq ($(BR2_PACKAGE_NCURSES_WIDEC),y)
> +NCURSES_CONF_OPT += --enable-widec
> +W=w
> +W_LINK=ln -sf
> +else
> +W=
> +W_LINK=:
> +endif

We really don't want to have variables named W and W_LINK. The variable
namespace in Buildroot is global. So if one package defines W, and
another package uses it, we screwed. So all variables should be
prefixed by the name of the package.

> +
>  ifneq ($(BR2_ENABLE_DEBUG),y)
>  NCURSES_CONF_OPT += --without-debug
>  endif
> @@ -48,19 +57,22 @@ ifneq ($(BR2_PREFER_STATIC_LIB),y)
>  
>  ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PANEL),y)
>  define NCURSES_INSTALL_TARGET_PANEL
> -	cp -dpf $(NCURSES_DIR)/lib/libpanel.so* $(TARGET_DIR)/usr/lib/
> +	cp -dpf $(NCURSES_DIR)/lib/libpanel$(W).so* $(TARGET_DIR)/usr/lib/
> +	$(W_LINK) libpanelw.so $(TARGET_DIR)/usr/lib/libpanel.so
>  endef
>  endif
>  
>  ifeq ($(BR2_PACKAGE_NCURSES_TARGET_FORM),y)
>  define NCURSES_INSTALL_TARGET_FORM
> -	cp -dpf $(NCURSES_DIR)/lib/libform.so* $(TARGET_DIR)/usr/lib/
> +	cp -dpf $(NCURSES_DIR)/lib/libform$(W).so* $(TARGET_DIR)/usr/lib/
> +	$(W_LINK) libformw.so $(TARGET_DIR)/usr/lib/libform.so
>  endef
>  endif
>  
>  ifeq ($(BR2_PACKAGE_NCURSES_TARGET_MENU),y)
>  define NCURSES_INSTALL_TARGET_MENU
> -	cp -dpf $(NCURSES_DIR)/lib/libmenu.so* $(TARGET_DIR)/usr/lib/
> +	cp -dpf $(NCURSES_DIR)/lib/libmenu$(W).so* $(TARGET_DIR)/usr/lib/
> +	$(W_LINK) libmenuw.so $(TARGET_DIR)/usr/lib/libmenu.so
>  endef
>  endif
>  
> @@ -78,7 +90,8 @@ endif
>  
>  define NCURSES_INSTALL_TARGET_CMDS
>  	mkdir -p $(TARGET_DIR)/usr/lib
> -	$(if $(BR2_PREFER_STATIC_LIB),,cp -dpf $(NCURSES_DIR)/lib/libncurses.so* $(TARGET_DIR)/usr/lib/)
> +	$(if $(BR2_PREFER_STATIC_LIB),,cp -dpf $(NCURSES_DIR)/lib/libncurses$(W).so* $(TARGET_DIR)/usr/lib/)
> +	$(W_LINK) libncursesw.so $(TARGET_DIR)/usr/lib/libncurses.so
>  	$(NCURSES_INSTALL_TARGET_PANEL)
>  	$(NCURSES_INSTALL_TARGET_FORM)
>  	$(NCURSES_INSTALL_TARGET_MENU)
> @@ -101,6 +114,33 @@ define NCURSES_INSTALL_TARGET_CMDS
>  	cp -dpf $(STAGING_DIR)/usr/share/terminfo/s/screen $(TARGET_DIR)/usr/share/terminfo/s
>  endef # NCURSES_INSTALL_TARGET_CMDS
>  
> +define NCURSES_POST_INSTALL_SYMLINK
> +	$(W_LINK) libncursesw.so $(STAGING_DIR)/usr/lib/libncurses.so
> +endef
> +NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_POST_INSTALL_SYMLINK
> +
> +ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PANEL),y)
> +define NCURSES_POST_INSTALL_SYMLINK_PANEL
> +	$(W_LINK) libpanelw.so $(STAGING_DIR)/usr/lib/libpanel.so
> +endef
> +NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_POST_INSTALL_SYMLINK_PANEL
> +endif
> +
> +ifeq ($(BR2_PACKAGE_NCURSES_TARGET_FORM),y)
> +define NCURSES_POST_INSTALL_SYMLINK_FORM
> +	$(W_LINK) libformw.so $(STAGING_DIR)/usr/lib/libform.so
> +endef
> +NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_POST_INSTALL_SYMLINK_FORM
> +endif
> +
> +ifeq ($(BR2_PACKAGE_NCURSES_TARGET_MENU),y)
> +define NCURSES_POST_INSTALL_SYMLINK_MENU
> +	$(W_LINK) libmenuw.so $(STAGING_DIR)/usr/lib/libmenu.so
> +endef
> +NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_POST_INSTALL_SYMLINK_MENU
> +endif

Pffiou, that's a lot of things. Maybe we could refactor this a little
with the target installation to do something a bit smarter like:

NCURSES_LIBS-y += libncurses
NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_MENU) += libmenu
NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_PANEL) += libpanel
NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_FORM) += libform

and then use $(NCURSES_LIBS-y) and some loops in target installation
and in a staging post installation hook to create the appropriate
symbolic links.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools Jeremy Kerr
  2014-01-16  9:36   ` Baruch Siach
  2014-01-16 13:17   ` Jerzy Grzegorek
@ 2014-01-30 19:46   ` Thomas Petazzoni
  2014-02-03  5:37     ` Jeremy Kerr
  2014-01-30 19:47   ` Thomas Petazzoni
  3 siblings, 1 reply; 38+ messages in thread
From: Thomas Petazzoni @ 2014-01-30 19:46 UTC (permalink / raw)
  To: buildroot

Dear Jeremy Kerr,

On Thu, 16 Jan 2014 16:52:18 +0800, Jeremy Kerr wrote:

> +	select BR2_PACKAGE_LIBELF
> +	select BR2_PACKAGE_DTC
> +	select BR2_PACKAGE_DTC_PROGRAMS

I have no idea how kexec-lite works, but I'm a bit surprised by the
dependency on dtc. Does it builds the Device Tree source at runtime on
the target?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools Jeremy Kerr
                     ` (2 preceding siblings ...)
  2014-01-30 19:46   ` Thomas Petazzoni
@ 2014-01-30 19:47   ` Thomas Petazzoni
  3 siblings, 0 replies; 38+ messages in thread
From: Thomas Petazzoni @ 2014-01-30 19:47 UTC (permalink / raw)
  To: buildroot

Dear Jeremy Kerr,

On Thu, 16 Jan 2014 16:52:18 +0800, Jeremy Kerr wrote:

> +KEXEC_LITE_VERSION = 6c762a7
> +KEXEC_LITE_SITE = git://github.com/antonblanchard/kexec-lite
> +KEXEC_LITE_LICENSE = GPL

This should be GPLv2+

It would be nice if the license text was added to the upstream project.
Maybe something that you can suggest to Anton :-)

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [RFC, PATCH 6/8] package/petitboot: Add petitboot, the userspace bootloader
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 6/8] package/petitboot: Add petitboot, the userspace bootloader Jeremy Kerr
@ 2014-01-30 20:51   ` Thomas Petazzoni
  2014-02-28  5:39     ` Jeremy Kerr
  0 siblings, 1 reply; 38+ messages in thread
From: Thomas Petazzoni @ 2014-01-30 20:51 UTC (permalink / raw)
  To: buildroot

Dear Jeremy Kerr,

On Thu, 16 Jan 2014 16:52:18 +0800, Jeremy Kerr wrote:

> diff --git a/package/petitboot/Config.in b/package/petitboot/Config.in
> new file mode 100644
> index 00000000..2f587c06
> --- /dev/null
> +++ b/package/petitboot/Config.in
> @@ -0,0 +1,10 @@
> +config BR2_PACKAGE_PETITBOOT
> +	bool "petitboot"
> +	depends on BR2_PACKAGE_KEXEC || BR2_PACKAGE_KEXEC_LITE

I don't think we want a dependency here, as it's not necessarily
obvious that this needs a kexec implementation. Therefore, I think we
should have something like:

	select BR2_PACKAGE_KEXEC_LITE if !BR2_PACKAGE_KEXEC

So that at least one implementation is guaranteed to be selected.

> +	select BR2_PACKAGE_NCURSES
> +	select BR2_PACKAGE_UDEV

This has to be a "depends on", and actually should depend on
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV. See
http://git.buildroot.net/buildroot/tree/package/modem-manager/Config.in
for an example of a package that requires udev support to be available.

> +	select BR2_PACKAGE_POWERPC_UTILS if BR2_powerpc
> +	help
> +	  Petitboot is a small kexec-based bootloader
> +
> +	  http://www.kernel.org/pub/linux/kernel/people/geoff/petitboot/petitboot.html
> diff --git a/package/petitboot/S14silence-console b/package/petitboot/S14silence-console
> new file mode 100755
> index 00000000..65702005
> --- /dev/null
> +++ b/package/petitboot/S14silence-console
> @@ -0,0 +1,9 @@
> +#!/bin/sh
> +
> +case "$1" in
> +    start)
> +        echo 0 0 7 0 > /proc/sys/kernel/printk
> +        ;;
> +esac
> +
> +exit 0
> diff --git a/package/petitboot/S15pb-discover b/package/petitboot/S15pb-discover
> new file mode 100755
> index 00000000..ebdf9449
> --- /dev/null
> +++ b/package/petitboot/S15pb-discover
> @@ -0,0 +1,23 @@
> +#!/bin/sh
> +
> +LOGFILE=/var/log/petitboot/pb-discover.log
> +PIDFILE=/var/run/petitboot.pid
> +
> +case "$1" in
> +    start)
> +        ulimit -c unlimited
> +        mkdir -p $(dirname $LOGFILE)
> +        PATH=/usr/bin:/usr/sbin:/bin:/sbin pb-discover -l $LOGFILE &
> +        echo $! > $PIDFILE
> +        ;;
> +    stop)
> +        pid=$(cat $PIDFILE)
> +        [ -n "$pid" ] && kill -TERM $pid
> +        ;;
> +    *)
> +        echo "Usage: $0 {start|stop}"
> +        exit 1
> +        ;;
> +esac
> +
> +exit 0
> diff --git a/package/petitboot/kexec-restart b/package/petitboot/kexec-restart
> new file mode 100755
> index 00000000..0175e76d
> --- /dev/null
> +++ b/package/petitboot/kexec-restart
> @@ -0,0 +1,8 @@
> +#!/bin/sh
> +
> +/usr/sbin/kexec -f -e
> +
> +while :
> +do
> +    sleep 1
> +done
> diff --git a/package/petitboot/petitboot-console-ui.rules b/package/petitboot/petitboot-console-ui.rules
> new file mode 100644
> index 00000000..74648562
> --- /dev/null
> +++ b/package/petitboot/petitboot-console-ui.rules
> @@ -0,0 +1,5 @@
> +
> +# spawn a petitboot UI on common user-visible interface devices
> +SUBSYSTEM=="tty", KERNEL=="hvc*", RUN+="/usr/libexec/petitboot/pb-console --getty --detach -- -n -i 0 $name vt100"
> +SUBSYSTEM=="tty", KERNEL=="tty0", RUN+="/usr/libexec/petitboot/pb-console --getty --detach -- -n -i 0 $name vt100"
> +SUBSYSTEM=="tty", KERNEL=="ttyS*", RUN+="/usr/libexec/petitboot/pb-console --getty --detach -- -n -i 0 $name vt100"
> diff --git a/package/petitboot/petitboot.mk b/package/petitboot/petitboot.mk
> new file mode 100644
> index 00000000..b8a2179d
> --- /dev/null
> +++ b/package/petitboot/petitboot.mk
> @@ -0,0 +1,57 @@
> +#############################################################
> +#
> +# petitboot
> +#
> +#############################################################

80 # signs.

Empty new line needed after comment header.

> +PETITBOOT_VERSION = af805399

We want full git hashes.

> +PETITBOOT_SITE = git://git.ozlabs.org/home/jk/git/petitboot
> +PETITBOOT_DEPENDENCIES = ncurses udev

If kexec is only a runtime dependency (and not a build dependency),
then there should be a comment above the "select" of kexec in the
Config.in that says it's only a runtime dependency.

Same thing for powerpc-utils.

> +PETITBOOT_LICENSE = GPLv2
> +PETITBOOT_LICENSE_FILES = COPYING
> +
> +PETITBOOT_CONF_OPT += --with-ncurses --without-twin-x11 --without-twin-fbdev \
> +		      --localstatedir=/var --with-tftp=busybox \

The --with-tftp=busybox seems to implies that Busybox is used.
Technically speaking, Buildroot allows to build a root filesystem
without Busybox. So either you should support both Busybox-based and
non-Busybox based filesystems, or depend/select Busybox.

> +		      HOST_PROG_KEXEC=/usr/sbin/kexec \
> +		      HOST_PROG_SHUTDOWN=/usr/libexec/petitboot/bb-kexec-reboot
> +
> +ifdef PETITBOOT_DEBUG

Where is PETITBOOT_DEBUG defined?

> +PETITBOOT_CONF_OPT += --enable-debug
> +endif
> +
> +ifeq ($(BR2_PACKAGE_NCURSES_WIDEC),y)
> +PETITBOOT_CONF_OPT += --with-ncursesw MENU_LIB=-lmenuw FORM_LIB=-lformw
> +endif
> +
> +define PETITBOOT_PRE_CONFIGURE_BOOTSTRAP
> +	(cd $(@D) && ./bootstrap $(PETITBOOT_VERSION))
> +endef
> +
> +PETITBOOT_PRE_CONFIGURE_HOOKS += PETITBOOT_PRE_CONFIGURE_BOOTSTRAP

It's unfortunate that we can't use the normal <pkg>_AUTORECONF = YES
logic, due to how configure.ac is generated from configure.ac.in.
Anyway, if you do want to call the bootstrap script, you need to make
this package depend on host-autoconf, host-automake and maybe
host-libtool if you're using libtool.

Also, I see in your configure.ac.in that you use Lex and Yacc.
Therefore, your package should depend on host-bison and host-flex.
These are not mandatory dependencies of Buildroot.

> +
> +define PETITBOOT_POST_INSTALL
> +	$(INSTALL) -D -m 0755 $(@D)/utils/bb-kexec-reboot \
> +		$(TARGET_DIR)/usr/libexec/petitboot
> +	$(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/petitboot/boot.d
> +	$(INSTALL) -D -m 0755 $(@D)/utils/hooks/01-create-default-dtb \
> +		$(TARGET_DIR)/etc/petitboot/boot.d/
> +	$(INSTALL) -D -m 0755 $(@D)/utils/hooks/20-set-stdout \
> +		$(TARGET_DIR)/etc/petitboot/boot.d/
> +
> +	$(INSTALL) -D -m 0755 package/petitboot/S14silence-console \
> +		$(TARGET_DIR)/etc/init.d/
> +	$(INSTALL) -D -m 0755 package/petitboot/S15pb-discover \
> +		$(TARGET_DIR)/etc/init.d/
> +	$(INSTALL) -D -m 0755 package/petitboot/kexec-restart \
> +		$(TARGET_DIR)/usr/sbin/
> +	$(INSTALL) -D -m 0755 package/petitboot/petitboot-console-ui.rules \
> +		$(TARGET_DIR)/etc/udev/rules.d/
> +	$(INSTALL) -D -m 0755 package/petitboot/removable-event-poll.rules \
> +		$(TARGET_DIR)/etc/udev/rules.d/
> +
> +	ln -sf /usr/sbin/pb-udhcpc \
> +		$(TARGET_DIR)/usr/share/udhcpc/default.script.d/
> +endef
> +
> +PETITBOOT_POST_INSTALL_TARGET_HOOKS += PETITBOOT_POST_INSTALL
> +
> +$(eval $(autotools-package))
> diff --git a/package/petitboot/removable-event-poll.rules b/package/petitboot/removable-event-poll.rules
> new file mode 100644
> index 00000000..b736aef6
> --- /dev/null
> +++ b/package/petitboot/removable-event-poll.rules
> @@ -0,0 +1,4 @@
> +
> +# petitboot needs notification for media change events on removable devices,
> +# which we only get if we've set the poll_msecs sysfs attribute.
> +ACTION!="remove", ATTR{removable}=="1", ATTR{events_poll_msecs}="2000"

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [RFC, PATCH 7/8] package/iprutils: Add IBM Power RAID utilities
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 7/8] package/iprutils: Add IBM Power RAID utilities Jeremy Kerr
  2014-01-16 13:24   ` Jerzy Grzegorek
@ 2014-01-30 20:54   ` Thomas Petazzoni
  1 sibling, 0 replies; 38+ messages in thread
From: Thomas Petazzoni @ 2014-01-30 20:54 UTC (permalink / raw)
  To: buildroot

Dear Jeremy Kerr,

On Thu, 16 Jan 2014 16:52:18 +0800, Jeremy Kerr wrote:

> +define IPRUTILS_INSTALL_TARGET_CMDS
> +        $(INSTALL) -d $(TARGET_DIR)/sbin
> +        $(INSTALL) -D --mode=755 $(@D)/iprconfig $(TARGET_DIR)/sbin/
> +        $(INSTALL) -D --mode=755 $(@D)/iprupdate $(TARGET_DIR)/sbin/
> +        $(INSTALL) -D --mode=755 $(@D)/iprdump $(TARGET_DIR)/sbin/
> +        $(INSTALL) -D --mode=755 $(@D)/iprinit $(TARGET_DIR)/sbin/
> +        $(INSTALL) -D --mode=700 $(@D)/iprdbg $(TARGET_DIR)/sbin/

We generally do:

	$(INSTALL) -D -m 0755 $(@D)/iprconfig $(TARGET_DIR)/sbin/iprconfig

this also avoids the need to create $(TARGET_DIR)/sbin in the first line.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools
  2014-01-30 19:46   ` Thomas Petazzoni
@ 2014-02-03  5:37     ` Jeremy Kerr
  2014-02-03  7:04       ` Thomas Petazzoni
  2014-02-28  7:11       ` Jeremy Kerr
  0 siblings, 2 replies; 38+ messages in thread
From: Jeremy Kerr @ 2014-02-03  5:37 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

>> +	select BR2_PACKAGE_LIBELF
>> +	select BR2_PACKAGE_DTC
>> +	select BR2_PACKAGE_DTC_PROGRAMS
> 
> I have no idea how kexec-lite works, but I'm a bit surprised by the
> dependency on dtc. Does it builds the Device Tree source at runtime on
> the target?

Yes; if no device-tree blob is provided on the command-line, it will
invoke dtc to generate one from the current system (ie, from
/proc/device-tree).

Cheers,


Jeremy

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

* [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools
  2014-02-03  5:37     ` Jeremy Kerr
@ 2014-02-03  7:04       ` Thomas Petazzoni
  2014-02-28  7:11       ` Jeremy Kerr
  1 sibling, 0 replies; 38+ messages in thread
From: Thomas Petazzoni @ 2014-02-03  7:04 UTC (permalink / raw)
  To: buildroot

Dear Jeremy Kerr,

On Mon, 03 Feb 2014 13:37:29 +0800, Jeremy Kerr wrote:

> >> +	select BR2_PACKAGE_LIBELF
> >> +	select BR2_PACKAGE_DTC
> >> +	select BR2_PACKAGE_DTC_PROGRAMS
> > 
> > I have no idea how kexec-lite works, but I'm a bit surprised by the
> > dependency on dtc. Does it builds the Device Tree source at runtime on
> > the target?
> 
> Yes; if no device-tree blob is provided on the command-line, it will
> invoke dtc to generate one from the current system (ie, from
> /proc/device-tree).

Ok, then in this kind of case, we like to do:

	# run-time dependency only
	select BR2_PACKAGE_DTC
	select BR2_PACKAGE_DTC_PROGRAMS

so that we remember why this dependency is expressed in the Config.in,
but not in the package .mk file.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [RFC, PATCH 3/8] package/ncurses: Allow building wide char support
  2014-01-30 19:44   ` Thomas Petazzoni
@ 2014-02-28  2:53     ` Jeremy Kerr
  0 siblings, 0 replies; 38+ messages in thread
From: Jeremy Kerr @ 2014-02-28  2:53 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

>> +	bool "enable wide char support"
>> +	depends on BR2_PACKAGE_NCURSES
> 
> dependency not needed since you're inside a if BR2_PACKAGE_NCURSES.
> 
> I believe this option most likely depends on BR2_USE_WCHAR.
> 
> Also, maybe name the option BR2_PACKAGE_NCURSES_WCHAR, to match the
> BR2_USE_WCHAR name we're already using in Buildroot to talk about wide
> char support.

OK, makes sense, fixed.

> Pffiou, that's a lot of things. Maybe we could refactor this a little
> with the target installation to do something a bit smarter like:
> 
> NCURSES_LIBS-y += libncurses
> NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_MENU) += libmenu
> NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_PANEL) += libpanel
> NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_FORM) += libform
> 
> and then use $(NCURSES_LIBS-y) and some loops in target installation
> and in a staging post installation hook to create the appropriate
> symbolic links.

That looks much better. I'll split this change into two stages: one to
implement NCURSES_LIBS-y, and one to add BR2_PACKAGE_NCURSES_WCHAR.

Cheers,


jeremy

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

* [Buildroot] [RFC, PATCH 6/8] package/petitboot: Add petitboot, the userspace bootloader
  2014-01-30 20:51   ` Thomas Petazzoni
@ 2014-02-28  5:39     ` Jeremy Kerr
  0 siblings, 0 replies; 38+ messages in thread
From: Jeremy Kerr @ 2014-02-28  5:39 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

> I don't think we want a dependency here, as it's not necessarily
> obvious that this needs a kexec implementation. Therefore, I think we
> should have something like:
> 
> 	select BR2_PACKAGE_KEXEC_LITE if !BR2_PACKAGE_KEXEC
> 
> So that at least one implementation is guaranteed to be selected.

OK, done.

>> +PETITBOOT_SITE = git://git.ozlabs.org/home/jk/git/petitboot
>> +PETITBOOT_DEPENDENCIES = ncurses udev
> 
> If kexec is only a runtime dependency (and not a build dependency),
> then there should be a comment above the "select" of kexec in the
> Config.in that says it's only a runtime dependency.
> 
> Same thing for powerpc-utils.

I've noted this in the Config.in file now.

>> +PETITBOOT_LICENSE = GPLv2
>> +PETITBOOT_LICENSE_FILES = COPYING
>> +
>> +PETITBOOT_CONF_OPT += --with-ncurses --without-twin-x11 --without-twin-fbdev \
>> +		      --localstatedir=/var --with-tftp=busybox \
> 
> The --with-tftp=busybox seems to implies that Busybox is used.
> Technically speaking, Buildroot allows to build a root filesystem
> without Busybox. So either you should support both Busybox-based and
> non-Busybox based filesystems, or depend/select Busybox.

Petitboot supports both busybox tftp and tftp-hpa, but by specifying
this to configure allows petitboot to skip a check at runtime. It's just
a little optimisation, and I'll make it conditional on BR2_PACKAGE_BUSYBOX.

>> +		      HOST_PROG_KEXEC=/usr/sbin/kexec \
>> +		      HOST_PROG_SHUTDOWN=/usr/libexec/petitboot/bb-kexec-reboot
>> +
>> +ifdef PETITBOOT_DEBUG
> 
> Where is PETITBOOT_DEBUG defined?

This is a little hack I use to build petitboot with debug enabled (so we
get more verbose log output), by specifying PETITBOOT_DEBUG=1 on the
make invocation. If this isn't acceptable, I can work around it :)

>> +PETITBOOT_CONF_OPT += --enable-debug
>> +endif
>> +
>> +ifeq ($(BR2_PACKAGE_NCURSES_WIDEC),y)
>> +PETITBOOT_CONF_OPT += --with-ncursesw MENU_LIB=-lmenuw FORM_LIB=-lformw
>> +endif
>> +
>> +define PETITBOOT_PRE_CONFIGURE_BOOTSTRAP
>> +	(cd $(@D) && ./bootstrap $(PETITBOOT_VERSION))
>> +endef
>> +
>> +PETITBOOT_PRE_CONFIGURE_HOOKS += PETITBOOT_PRE_CONFIGURE_BOOTSTRAP
> 
> It's unfortunate that we can't use the normal <pkg>_AUTORECONF = YES
> logic, due to how configure.ac is generated from configure.ac.in.
> Anyway, if you do want to call the bootstrap script, you need to make
> this package depend on host-autoconf, host-automake and maybe
> host-libtool if you're using libtool.
> 
> Also, I see in your configure.ac.in that you use Lex and Yacc.
> Therefore, your package should depend on host-bison and host-flex.
> These are not mandatory dependencies of Buildroot.

OK, updated.

I'm planning to fix the autoreconf bits in a future petitboot change, so
this should get a little simpler later.

Thanks for the review, I'll post a new series soon.

Cheers,


Jeremy

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

* [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools
  2014-02-03  5:37     ` Jeremy Kerr
  2014-02-03  7:04       ` Thomas Petazzoni
@ 2014-02-28  7:11       ` Jeremy Kerr
  2014-02-28  7:37         ` Thomas Petazzoni
  1 sibling, 1 reply; 38+ messages in thread
From: Jeremy Kerr @ 2014-02-28  7:11 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

>>> +	select BR2_PACKAGE_LIBELF
>>> +	select BR2_PACKAGE_DTC
>>> +	select BR2_PACKAGE_DTC_PROGRAMS
>>
>> I have no idea how kexec-lite works, but I'm a bit surprised by the
>> dependency on dtc. Does it builds the Device Tree source at runtime on
>> the target?
> 
> Yes; if no device-tree blob is provided on the command-line, it will
> invoke dtc to generate one from the current system (ie, from
> /proc/device-tree).

OK, I'm slightly incorrect here - kexec-lite requires the dtc libraries
at build-time (we need to manipulate the device tree to update the
reserved memory map), and may also call dtc at runtime too.

So, I'd propose a:

	select BR2_PACKAGE_DTC
	# run-time dependency only
	select BR2_PACKAGE_DTC_PROGRAMS

- is that sensible?

Cheers,


Jeremy

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

* [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools
  2014-02-28  7:11       ` Jeremy Kerr
@ 2014-02-28  7:37         ` Thomas Petazzoni
  0 siblings, 0 replies; 38+ messages in thread
From: Thomas Petazzoni @ 2014-02-28  7:37 UTC (permalink / raw)
  To: buildroot

Dear Jeremy Kerr,

On Fri, 28 Feb 2014 15:11:24 +0800, Jeremy Kerr wrote:

> OK, I'm slightly incorrect here - kexec-lite requires the dtc libraries
> at build-time (we need to manipulate the device tree to update the
> reserved memory map), and may also call dtc at runtime too.
> 
> So, I'd propose a:
> 
> 	select BR2_PACKAGE_DTC
> 	# run-time dependency only
> 	select BR2_PACKAGE_DTC_PROGRAMS
> 
> - is that sensible?

In theory, yes. In practice, since you need BR2_PACKAGE_DTC at build
time, it means that you will have "dtc" in the <pkg>_DEPENDENCIES
variable of your package, which means that the dtc package (both the
library and programs) will be built before your package. So practically
speaking, BR2_PACKAGE_DTC_PROGRAMS will not really be treated as a
run-time dependency only, because it's not provided by a separate
package than dtc.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [RFC, PATCH 2/8] package/dropbear: Add separate configuration options for client and server
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 2/8] package/dropbear: Add separate configuration options for client and server Jeremy Kerr
@ 2014-03-03 23:46   ` Yann E. MORIN
  2014-03-03 23:54     ` Jeremy Kerr
  2014-03-04  0:14   ` Gustavo Zacarias
  1 sibling, 1 reply; 38+ messages in thread
From: Yann E. MORIN @ 2014-03-03 23:46 UTC (permalink / raw)
  To: buildroot

J?r?my, All,

On 2014-01-16 16:52 +0800, Jeremy Kerr spake thusly:
[--SNIP--]
> index 68c3b71a..4a7327b7 100644
> --- a/package/dropbear/Config.in
> +++ b/package/dropbear/Config.in
> @@ -8,6 +8,18 @@ config BR2_PACKAGE_DROPBEAR
>  
>  if BR2_PACKAGE_DROPBEAR
>  
> +config BR2_PACKAGE_DROPBEAR_SERVER
> +	bool "dropbear ssh server"
> +	default y
> +	help
> +	  Enable the dropbear ssh server, run from init
> +
> +config BR2_PACKAGE_DROPBEAR_CLIENT
> +	bool "dropbear ssh client"
> +	default y
> +	help
> +	  Enable the dropbear ssh client, scp and utilities

What if none is selected? What about:

    config BR2_PACKAGE_DROPBEAR_HAS_CLIENT
        def_bool y
        depends on !BR2_PACKAGE_DROPBEAR_CLIENT
        select BR2_PACKAGE_DROPBEAR_SERVER

    config BR2_PACKAGE_DROPBEAR_SERVER
        bool "dropbear ssh server"

    config BR2_PACKAGE_DROPBEAR_CLIENT
        bool "dropbear ssh client"

(with your help entries, of course).

> diff --git a/package/dropbear/dropbear.mk b/package/dropbear/dropbear.mk
> index 3ef6c8da..a1cc5691 100644
> --- a/package/dropbear/dropbear.mk
> +++ b/package/dropbear/dropbear.mk
> @@ -7,7 +7,7 @@
>  DROPBEAR_VERSION = 2013.62
>  DROPBEAR_SITE = http://matt.ucc.asn.au/dropbear/releases
>  DROPBEAR_SOURCE = dropbear-$(DROPBEAR_VERSION).tar.bz2
> -DROPBEAR_TARGET_BINS = dbclient dropbearkey dropbearconvert scp ssh
> +DROPBEAR_TARGET_BINS = dropbearkey dropbearconvert
>  DROPBEAR_MAKE =	$(MAKE) MULTI=1 SCPPROGRESS=1 \
>  		PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
		                   ^^^^^^^^
Should we not disable dbclient if it is not selected?

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [RFC, PATCH 2/8] package/dropbear: Add separate configuration options for client and server
  2014-03-03 23:46   ` Yann E. MORIN
@ 2014-03-03 23:54     ` Jeremy Kerr
  0 siblings, 0 replies; 38+ messages in thread
From: Jeremy Kerr @ 2014-03-03 23:54 UTC (permalink / raw)
  To: buildroot

Hi Yann,

> On 2014-01-16 16:52 +0800, Jeremy Kerr spake thusly:
> [--SNIP--]
>> index 68c3b71a..4a7327b7 100644
>> --- a/package/dropbear/Config.in
>> +++ b/package/dropbear/Config.in
>> @@ -8,6 +8,18 @@ config BR2_PACKAGE_DROPBEAR
>>  
>>  if BR2_PACKAGE_DROPBEAR
>>  
>> +config BR2_PACKAGE_DROPBEAR_SERVER
>> +	bool "dropbear ssh server"
>> +	default y
>> +	help
>> +	  Enable the dropbear ssh server, run from init
>> +
>> +config BR2_PACKAGE_DROPBEAR_CLIENT
>> +	bool "dropbear ssh client"
>> +	default y
>> +	help
>> +	  Enable the dropbear ssh client, scp and utilities
> 
> What if none is selected?

Then neither the client nor server is installed; is that an issue?

We could just have a comment (when !_CLIENT && !_SERVER) to notify the
user that it's not a sensible configuration...

>> diff --git a/package/dropbear/dropbear.mk b/package/dropbear/dropbear.mk
>> index 3ef6c8da..a1cc5691 100644
>> --- a/package/dropbear/dropbear.mk
>> +++ b/package/dropbear/dropbear.mk
>> @@ -7,7 +7,7 @@
>>  DROPBEAR_VERSION = 2013.62
>>  DROPBEAR_SITE = http://matt.ucc.asn.au/dropbear/releases
>>  DROPBEAR_SOURCE = dropbear-$(DROPBEAR_VERSION).tar.bz2
>> -DROPBEAR_TARGET_BINS = dbclient dropbearkey dropbearconvert scp ssh
>> +DROPBEAR_TARGET_BINS = dropbearkey dropbearconvert
>>  DROPBEAR_MAKE =	$(MAKE) MULTI=1 SCPPROGRESS=1 \
>>  		PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
> 		                   ^^^^^^^^
> Should we not disable dbclient if it is not selected?

We should. I'll sort this out in my next series.

Thanks for the review!


Jeremy

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

* [Buildroot] [RFC, PATCH 2/8] package/dropbear: Add separate configuration options for client and server
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 2/8] package/dropbear: Add separate configuration options for client and server Jeremy Kerr
  2014-03-03 23:46   ` Yann E. MORIN
@ 2014-03-04  0:14   ` Gustavo Zacarias
  2014-03-04  1:07     ` Jeremy Kerr
  1 sibling, 1 reply; 38+ messages in thread
From: Gustavo Zacarias @ 2014-03-04  0:14 UTC (permalink / raw)
  To: buildroot

On 01/16/2014 05:52 AM, Jeremy Kerr wrote:

> Currently, the dropbear package installs both client and server
> components. For example, this means that when we only want the
> client binaries, we also get the server run from init.
> 
> Even though it's a multi-call binary (the client and server
> exist in the same executable), we'd like to selectively install the
> links and init scripts. This change introduces separate configuration
> options (both 'default y') for the client and server bits.

Normally we don't make initscript installation an option and since the
dropbear package options are essentially a no-op what's the point?
(if you don't want sshd to startup on boot you can use a post build
script to just remove the initscript from the target, that's the
recommended way).
Regards.

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

* [Buildroot] [RFC, PATCH 2/8] package/dropbear: Add separate configuration options for client and server
  2014-03-04  0:14   ` Gustavo Zacarias
@ 2014-03-04  1:07     ` Jeremy Kerr
  2014-03-04  1:44       ` Gustavo Zacarias
  0 siblings, 1 reply; 38+ messages in thread
From: Jeremy Kerr @ 2014-03-04  1:07 UTC (permalink / raw)
  To: buildroot

Hi Gustavo,

> Normally we don't make initscript installation an option

I think dropbear is a bit exceptional here, as both server and client
are in the one package.

> and since the
> dropbear package options are essentially a no-op what's the point?

There are some scenarios where there's no point starting a SSH server
(in my case, it's because there's no persistent storage, so no
persistent host keys). However, I'd still like a ssh/scp client to be
available.

> (if you don't want sshd to startup on boot you can use a post build
> script to just remove the initscript from the target, that's the
> recommended way).

But isn't something that will go upstream and be available in a
defconfig, right?

Regards,


Jeremy

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

* [Buildroot] [RFC, PATCH 2/8] package/dropbear: Add separate configuration options for client and server
  2014-03-04  1:07     ` Jeremy Kerr
@ 2014-03-04  1:44       ` Gustavo Zacarias
  2014-03-04  1:51         ` Jeremy Kerr
  0 siblings, 1 reply; 38+ messages in thread
From: Gustavo Zacarias @ 2014-03-04  1:44 UTC (permalink / raw)
  To: buildroot

On 03/03/2014 10:07 PM, Jeremy Kerr wrote:

> Hi Gustavo,

Hi Jeremy.

>> Normally we don't make initscript installation an option
> 
> I think dropbear is a bit exceptional here, as both server and client
> are in the one package.
> 
>> and since the
>> dropbear package options are essentially a no-op what's the point?
> 
> There are some scenarios where there's no point starting a SSH server
> (in my case, it's because there's no persistent storage, so no
> persistent host keys). However, I'd still like a ssh/scp client to be
> available.

Well you'll want at least one of the options of dropbear, there's no
point in excluding both.
My common sense tells me you'll always want the client anyway, it's no
security threat or space-consuming menace, so why not add just a SERVER
option maybe?
BR2_PACKAGE_DROPBEAR -> builds and install the client portion.
BR2_PACKAGE_DROPBEAR_SERVER -> installs the server bits (default=y for
compatibility reasons).
Let's see others chiming in though...

>> (if you don't want sshd to startup on boot you can use a post build
>> script to just remove the initscript from the target, that's the
>> recommended way).
> 
> But isn't something that will go upstream and be available in a
> defconfig, right?

That's still open to debate, until now all defconfigs were supposed to
be minimal, but there's a growing consensus that featured or demo
defconfigs are desired and useful.
It's just a matter of doing it right and documenting it at this point i
think.
Regards.

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

* [Buildroot] [RFC, PATCH 2/8] package/dropbear: Add separate configuration options for client and server
  2014-03-04  1:44       ` Gustavo Zacarias
@ 2014-03-04  1:51         ` Jeremy Kerr
  2014-03-04 18:36           ` Yann E. MORIN
  0 siblings, 1 reply; 38+ messages in thread
From: Jeremy Kerr @ 2014-03-04  1:51 UTC (permalink / raw)
  To: buildroot

Hi Gustavo,

>> There are some scenarios where there's no point starting a SSH server
>> (in my case, it's because there's no persistent storage, so no
>> persistent host keys). However, I'd still like a ssh/scp client to be
>> available.
> 
> Well you'll want at least one of the options of dropbear, there's no
> point in excluding both.
> My common sense tells me you'll always want the client anyway, it's no
> security threat or space-consuming menace, so why not add just a SERVER
> option maybe?
> BR2_PACKAGE_DROPBEAR -> builds and install the client portion.
> BR2_PACKAGE_DROPBEAR_SERVER -> installs the server bits (default=y for
> compatibility reasons).

That sounds pretty good to me too. I'd be happy to implement whatever
the general consensus is :)

>> But isn't something that will go upstream and be available in a
>> defconfig, right?
> 
> That's still open to debate, until now all defconfigs were supposed to
> be minimal, but there's a growing consensus that featured or demo
> defconfigs are desired and useful.

OK, understood.

If the defconfig isn't upstream, I'd need to provide both a config and a
postinst script, and whoever is replicating the build needs to point the
config to the postinst script correctly. Having the dropbear server
available as a simple config option allows me to either use a defconfig,
or provide a single defconfig file, to allow others to build a
petitboot-compatible builtroot image, without having to mess around too
much.

Cheers,


Jeremy

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

* [Buildroot] [RFC, PATCH 2/8] package/dropbear: Add separate configuration options for client and server
  2014-03-04  1:51         ` Jeremy Kerr
@ 2014-03-04 18:36           ` Yann E. MORIN
  0 siblings, 0 replies; 38+ messages in thread
From: Yann E. MORIN @ 2014-03-04 18:36 UTC (permalink / raw)
  To: buildroot

Jeremy, All,

On 2014-03-04 09:51 +0800, Jeremy Kerr spake thusly:
> >> There are some scenarios where there's no point starting a SSH server
> >> (in my case, it's because there's no persistent storage, so no
> >> persistent host keys). However, I'd still like a ssh/scp client to be
> >> available.
> > 
> > Well you'll want at least one of the options of dropbear, there's no
> > point in excluding both.
> > My common sense tells me you'll always want the client anyway, it's no
> > security threat or space-consuming menace, so why not add just a SERVER
> > option maybe?
> > BR2_PACKAGE_DROPBEAR -> builds and install the client portion.
> > BR2_PACKAGE_DROPBEAR_SERVER -> installs the server bits (default=y for
> > compatibility reasons).
> 
> That sounds pretty good to me too. I'd be happy to implement whatever
> the general consensus is :)

OK for me. But make sure the server is "default y", so old .config files
still work.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [RFC, PATCH 1/8] package/busybox: Add facility for DHCP hooks
  2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 1/8] package/busybox: Add facility for DHCP hooks Jeremy Kerr
@ 2014-03-04 20:01   ` Yann E. MORIN
  0 siblings, 0 replies; 38+ messages in thread
From: Yann E. MORIN @ 2014-03-04 20:01 UTC (permalink / raw)
  To: buildroot

Jeremy, All,

On 2014-01-16 16:52 +0800, Jeremy Kerr spake thusly:
> The (u)dhcpc hook installed by the busybox package configures the
> network and exits. If we want to do anything further with a DHCP lease,
> we'd have to replace the script entirely.
> 
> This change introduces a .d directory for hooks (based on the script
> filename), which are executed after the interface configuration. This
> allows packages to drop a script file in the .d directory to perform
> actions on DHCP events.
> 
> We'll use this in a later change to notify petitboot of DHCP boot
> information.
> 
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

I'm not against such a change, but there is a gotcha, see below...

[--SNIP--]
> diff --git a/package/busybox/udhcpc.script b/package/busybox/udhcpc.script
> index 43742fbd..8930d4a8 100755
> --- a/package/busybox/udhcpc.script
> +++ b/package/busybox/udhcpc.script
> @@ -63,4 +63,13 @@ case "$1" in
>  		;;
>  esac
>  
> +HOOK_DIR="$0.d"
> +if [ -d "$HOOK_DIR" ]
> +then
> +	for HOOK in $HOOK_DIR/*; do
> +		$HOOK "$@"

If the directory exists, but there is no hook, then HOOK will have the
value '${HOKK_DIR}/*', and this will result in a error.

You have to do something like:

    for hook in "${HOOK_DIR}/"*; do
        [ -f "${hook}" -a -x "${hook}" ] || continue
        "${hook}" "${@}"
    done

And then you do not need to protect with the if-block.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

end of thread, other threads:[~2014-03-04 20:01 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-16  8:52 [Buildroot] [RFC, PATCH 0/8] Enable a buildroot-based petitboot bootloader Jeremy Kerr
2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 7/8] package/iprutils: Add IBM Power RAID utilities Jeremy Kerr
2014-01-16 13:24   ` Jerzy Grzegorek
2014-01-17  1:58     ` Jeremy Kerr
2014-01-30 20:54   ` Thomas Petazzoni
2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 1/8] package/busybox: Add facility for DHCP hooks Jeremy Kerr
2014-03-04 20:01   ` Yann E. MORIN
2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 4/8] package/powerpc-utils: Add powerpc hardware utilities Jeremy Kerr
2014-01-16  9:30   ` Baruch Siach
2014-01-16 13:11   ` Jerzy Grzegorek
2014-01-29  8:12   ` Thomas Petazzoni
2014-01-30  1:51     ` Jeremy Kerr
2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 2/8] package/dropbear: Add separate configuration options for client and server Jeremy Kerr
2014-03-03 23:46   ` Yann E. MORIN
2014-03-03 23:54     ` Jeremy Kerr
2014-03-04  0:14   ` Gustavo Zacarias
2014-03-04  1:07     ` Jeremy Kerr
2014-03-04  1:44       ` Gustavo Zacarias
2014-03-04  1:51         ` Jeremy Kerr
2014-03-04 18:36           ` Yann E. MORIN
2014-01-16  8:52 ` [Buildroot] [RFC,PATCH 8/8] Add powerpc petitboot defconfig Jeremy Kerr
2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools Jeremy Kerr
2014-01-16  9:36   ` Baruch Siach
2014-01-17  1:51     ` Jeremy Kerr
2014-01-16 13:17   ` Jerzy Grzegorek
2014-01-30 19:46   ` Thomas Petazzoni
2014-02-03  5:37     ` Jeremy Kerr
2014-02-03  7:04       ` Thomas Petazzoni
2014-02-28  7:11       ` Jeremy Kerr
2014-02-28  7:37         ` Thomas Petazzoni
2014-01-30 19:47   ` Thomas Petazzoni
2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 6/8] package/petitboot: Add petitboot, the userspace bootloader Jeremy Kerr
2014-01-30 20:51   ` Thomas Petazzoni
2014-02-28  5:39     ` Jeremy Kerr
2014-01-16  8:52 ` [Buildroot] [RFC, PATCH 3/8] package/ncurses: Allow building wide char support Jeremy Kerr
2014-01-30 19:44   ` Thomas Petazzoni
2014-02-28  2:53     ` Jeremy Kerr
2014-01-17  2:16 ` [Buildroot] [RFC, PATCH 0/8] Enable a buildroot-based petitboot bootloader Jeremy Kerr

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.