* [Buildroot] [PATCH 03/10 v2] package/ncurses: Remove duplicated library install code
2014-03-12 3:45 [Buildroot] [PATCH 00/10 v2] Enable a buildroot-based petitboot bootloader Jeremy Kerr
@ 2014-03-12 3:45 ` Jeremy Kerr
2014-03-12 3:49 ` Jeremy Kerr
2014-03-12 3:54 ` [Buildroot] [PATCH v2.1] " Jeremy Kerr
2014-03-12 3:45 ` [Buildroot] [PATCH 04/10 v2] package/ncurses: Allow building wide char support Jeremy Kerr
` (8 subsequent siblings)
9 siblings, 2 replies; 17+ messages in thread
From: Jeremy Kerr @ 2014-03-12 3:45 UTC (permalink / raw)
To: buildroot
Currently, the ncurses package conditionally defines macros to install
the panel, form and menu libraries. This means we duplicate the install
step for each library type.
Rather than defining a set of macros, this change introduces a variable
for the set of installed libraries, $(NCURSES_LIBS-y). We use this in a
single macro to perform the library installation in one place.
Based on a change suggested by Thomas Petazzoni
<thomas.petazzoni@free-electrons.com>.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
---
package/ncurses/ncurses.mk | 33 ++++++++++-----------------------
1 file changed, 10 insertions(+), 23 deletions(-)
diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
index e180a95..c2e1c3f 100644
--- a/package/ncurses/ncurses.mk
+++ b/package/ncurses/ncurses.mk
@@ -36,6 +36,11 @@ ifeq ($(BR2_PACKAGE_BUSYBOX),y)
NCURSES_DEPENDENCIES += busybox
endif
+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
+
ifneq ($(BR2_ENABLE_DEBUG),y)
NCURSES_CONF_OPT += --without-debug
endif
@@ -45,27 +50,13 @@ define NCURSES_BUILD_CMDS
endef
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/
-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/
-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/
+define NCURSES_INSTALL_TARGET_LIBS
+ for lib in $(NCURSES_LIBS-y); do \
+ cp -dpf $(NCURSES_DIR)/lib/$${lib}.so* $(TARGET_DIR)/usr/lib/; \
+ done
endef
endif
-endif
-
ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PROGS),y)
define NCURSES_INSTALL_TARGET_PROGS
for x in $(NCURSES_PROGS); do \
@@ -78,11 +69,7 @@ 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/)
- $(NCURSES_INSTALL_TARGET_PANEL)
- $(NCURSES_INSTALL_TARGET_FORM)
- $(NCURSES_INSTALL_TARGET_MENU)
- $(NCURSES_INSTALL_TARGET_PROGS)
+ $(NCURSES_INSTALL_TARGET_LIBS)
ln -snf /usr/share/terminfo $(TARGET_DIR)/usr/lib/terminfo
mkdir -p $(TARGET_DIR)/usr/share/terminfo/x
cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm $(TARGET_DIR)/usr/share/terminfo/x
^ permalink raw reply related [flat|nested] 17+ messages in thread* [Buildroot] [PATCH 03/10 v2] package/ncurses: Remove duplicated library install code
2014-03-12 3:45 ` [Buildroot] [PATCH 03/10 v2] package/ncurses: Remove duplicated library install code Jeremy Kerr
@ 2014-03-12 3:49 ` Jeremy Kerr
2014-03-12 3:54 ` [Buildroot] [PATCH v2.1] " Jeremy Kerr
1 sibling, 0 replies; 17+ messages in thread
From: Jeremy Kerr @ 2014-03-12 3:49 UTC (permalink / raw)
To: buildroot
Hi all,
> - $(if $(BR2_PREFER_STATIC_LIB),,cp -dpf $(NCURSES_DIR)/lib/libncurses.so* $(TARGET_DIR)/usr/lib/)
> - $(NCURSES_INSTALL_TARGET_PANEL)
> - $(NCURSES_INSTALL_TARGET_FORM)
> - $(NCURSES_INSTALL_TARGET_MENU)
> - $(NCURSES_INSTALL_TARGET_PROGS)
> + $(NCURSES_INSTALL_TARGET_LIBS)
Hmm, looks like I went overboard with deleting lines here; we still need
NCURSES_INSTALL_TARGET_PROGS.
Updated patch coming.
Jeremy
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH v2.1] package/ncurses: Remove duplicated library install code
2014-03-12 3:45 ` [Buildroot] [PATCH 03/10 v2] package/ncurses: Remove duplicated library install code Jeremy Kerr
2014-03-12 3:49 ` Jeremy Kerr
@ 2014-03-12 3:54 ` Jeremy Kerr
2014-03-23 22:25 ` Peter Korsgaard
1 sibling, 1 reply; 17+ messages in thread
From: Jeremy Kerr @ 2014-03-12 3:54 UTC (permalink / raw)
To: buildroot
Currently, the ncurses package conditionally defines macros to install
the panel, form and menu libraries. This means we duplicate the install
step for each library type.
Rather than defining a set of macros, this change introduces a variable
for the set of installed libraries, $(NCURSES_LIBS-y). We use this in a
single macro to perform the library installation in one place.
Based on a change suggested by Thomas Petazzoni
<thomas.petazzoni@free-electrons.com>.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
---
v2.1: Fix NCURSES_INSTALL_TARGET_PROGS deletion
---
package/ncurses/ncurses.mk | 32 ++++++++++----------------------
1 file changed, 10 insertions(+), 22 deletions(-)
diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
index e180a95..9805113 100644
--- a/package/ncurses/ncurses.mk
+++ b/package/ncurses/ncurses.mk
@@ -36,6 +36,11 @@ ifeq ($(BR2_PACKAGE_BUSYBOX),y)
NCURSES_DEPENDENCIES += busybox
endif
+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
+
ifneq ($(BR2_ENABLE_DEBUG),y)
NCURSES_CONF_OPT += --without-debug
endif
@@ -45,27 +50,13 @@ define NCURSES_BUILD_CMDS
endef
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/
-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/
-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/
+define NCURSES_INSTALL_TARGET_LIBS
+ for lib in $(NCURSES_LIBS-y); do \
+ cp -dpf $(NCURSES_DIR)/lib/$${lib}.so* $(TARGET_DIR)/usr/lib/; \
+ done
endef
endif
-endif
-
ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PROGS),y)
define NCURSES_INSTALL_TARGET_PROGS
for x in $(NCURSES_PROGS); do \
@@ -78,10 +69,7 @@ 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/)
- $(NCURSES_INSTALL_TARGET_PANEL)
- $(NCURSES_INSTALL_TARGET_FORM)
- $(NCURSES_INSTALL_TARGET_MENU)
+ $(NCURSES_INSTALL_TARGET_LIBS)
$(NCURSES_INSTALL_TARGET_PROGS)
ln -snf /usr/share/terminfo $(TARGET_DIR)/usr/lib/terminfo
mkdir -p $(TARGET_DIR)/usr/share/terminfo/x
^ permalink raw reply related [flat|nested] 17+ messages in thread* [Buildroot] [PATCH v2.1] package/ncurses: Remove duplicated library install code
2014-03-12 3:54 ` [Buildroot] [PATCH v2.1] " Jeremy Kerr
@ 2014-03-23 22:25 ` Peter Korsgaard
0 siblings, 0 replies; 17+ messages in thread
From: Peter Korsgaard @ 2014-03-23 22:25 UTC (permalink / raw)
To: buildroot
>>>>> "Jeremy" == Jeremy Kerr <jk@ozlabs.org> writes:
> Currently, the ncurses package conditionally defines macros to install
> the panel, form and menu libraries. This means we duplicate the install
> step for each library type.
> Rather than defining a set of macros, this change introduces a variable
> for the set of installed libraries, $(NCURSES_LIBS-y). We use this in a
> single macro to perform the library installation in one place.
> Based on a change suggested by Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com>.
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
> ---
> v2.1: Fix NCURSES_INSTALL_TARGET_PROGS deletion
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH 04/10 v2] package/ncurses: Allow building wide char support
2014-03-12 3:45 [Buildroot] [PATCH 00/10 v2] Enable a buildroot-based petitboot bootloader Jeremy Kerr
2014-03-12 3:45 ` [Buildroot] [PATCH 03/10 v2] package/ncurses: Remove duplicated library install code Jeremy Kerr
@ 2014-03-12 3:45 ` Jeremy Kerr
2014-03-12 3:45 ` [Buildroot] [PATCH 06/10 v2] package/powerpc-utils: Add powerpc hardware utilities Jeremy Kerr
` (7 subsequent siblings)
9 siblings, 0 replies; 17+ messages in thread
From: Jeremy Kerr @ 2014-03-12 3:45 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 | 6 ++++++
package/ncurses/ncurses.mk | 24 ++++++++++++++++++++++--
2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/package/ncurses/Config.in b/package/ncurses/Config.in
index e8ab710..b90ec9e 100644
--- a/package/ncurses/Config.in
+++ b/package/ncurses/Config.in
@@ -10,6 +10,12 @@ config BR2_PACKAGE_NCURSES
if BR2_PACKAGE_NCURSES
+config BR2_PACKAGE_NCURSES_WCHAR
+ bool "enable wide char support"
+ depends on BR2_USE_WCHAR
+ help
+ Enable wide char & UTF-8 support in ncurses libraries
+
config BR2_PACKAGE_NCURSES_TARGET_PANEL
bool "ncurses libpanel in target"
help
diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
index c2e1c3f..445f259 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$(NCURSES_LIB_SUFFIX)5-config
NCURSES_CONF_OPT = \
$(if $(BR2_PREFER_STATIC_LIB),--without-shared,--with-shared) \
@@ -36,6 +36,24 @@ ifeq ($(BR2_PACKAGE_BUSYBOX),y)
NCURSES_DEPENDENCIES += busybox
endif
+ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
+NCURSES_CONF_OPT += --enable-widec
+NCURSES_LIB_SUFFIX = w
+
+define NCURSES_LINK_LIBS
+ for lib in $(NCURSES_LIBS-y); do \
+ ln -sf $${lib}$(NCURSES_LIB_SUFFIX).so \
+ $(1)/usr/lib/$${lib}.so; \
+ done
+endef
+
+NCURSES_LINK_TARGET_LIBS = $(call NCURSES_LINK_LIBS, $(TARGET_DIR))
+NCURSES_LINK_STAGING_LIBS = $(call NCURSES_LINK_LIBS, $(STAGING_DIR))
+
+NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_LINK_STAGING_LIBS
+
+endif
+
NCURSES_LIBS-y = libncurses
NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_MENU) += libmenu
NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_PANEL) += libpanel
@@ -52,7 +70,8 @@ endef
ifneq ($(BR2_PREFER_STATIC_LIB),y)
define NCURSES_INSTALL_TARGET_LIBS
for lib in $(NCURSES_LIBS-y); do \
- cp -dpf $(NCURSES_DIR)/lib/$${lib}.so* $(TARGET_DIR)/usr/lib/; \
+ cp -dpf $(NCURSES_DIR)/lib/$${lib}$(NCURSES_LIB_SUFFIX).so* \
+ $(TARGET_DIR)/usr/lib/; \
done
endef
endif
@@ -70,6 +89,7 @@ endif
define NCURSES_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)/usr/lib
$(NCURSES_INSTALL_TARGET_LIBS)
+ $(NCURSES_LINK_TARGET_LIBS)
ln -snf /usr/share/terminfo $(TARGET_DIR)/usr/lib/terminfo
mkdir -p $(TARGET_DIR)/usr/share/terminfo/x
cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm $(TARGET_DIR)/usr/share/terminfo/x
^ permalink raw reply related [flat|nested] 17+ messages in thread* [Buildroot] [PATCH 06/10 v2] package/powerpc-utils: Add powerpc hardware utilities
2014-03-12 3:45 [Buildroot] [PATCH 00/10 v2] Enable a buildroot-based petitboot bootloader Jeremy Kerr
2014-03-12 3:45 ` [Buildroot] [PATCH 03/10 v2] package/ncurses: Remove duplicated library install code Jeremy Kerr
2014-03-12 3:45 ` [Buildroot] [PATCH 04/10 v2] package/ncurses: Allow building wide char support Jeremy Kerr
@ 2014-03-12 3:45 ` Jeremy Kerr
2014-03-12 3:45 ` [Buildroot] [PATCH 10/10 v2] Add powerpc petitboot defconfig Jeremy Kerr
` (6 subsequent siblings)
9 siblings, 0 replies; 17+ messages in thread
From: Jeremy Kerr @ 2014-03-12 3:45 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.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
---
package/Config.in | 1
package/powerpc-utils/Config.in | 5
package/powerpc-utils/powerpc-utils-01-add-subdir-objects-automake-option.patch | 71 ++++++++++
package/powerpc-utils/powerpc-utils.mk | 16 ++
4 files changed, 93 insertions(+)
diff --git a/package/Config.in b/package/Config.in
index 70e5a7f..5fe0594 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1062,6 +1062,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 0000000..c919094
--- /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-01-add-subdir-objects-automake-option.patch b/package/powerpc-utils/powerpc-utils-01-add-subdir-objects-automake-option.patch
new file mode 100644
index 0000000..0311280
--- /dev/null
+++ b/package/powerpc-utils/powerpc-utils-01-add-subdir-objects-automake-option.patch
@@ -0,0 +1,71 @@
+From c9e3c0cde53b4b77728590bd2375e62a3dfaaf62 Mon Sep 17 00:00:00 2001
+From: Jeremy Kerr <jk@ozlabs.org>
+Date: Wed, 12 Mar 2014 10:43:46 +0800
+Subject: [PATCH] automake: Add subdir-objects automake option
+
+Current git builds fail for me, with:
+
+ configure.ac:13: installing 'build-aux/compile'
+ automake: warnings are treated as errors
+ src/Makefile.am:8: warning: source file 'common/pseries_platform.c' is in a subdirectory,
+ src/Makefile.am:8: but option 'subdir-objects' is disabled
+ automake: warning: possible forward-incompatibility.
+ automake: At least a source file is in a subdirectory, but the 'subdir-objects'
+ automake: automake option hasn't been enabled. For now, the corresponding output
+ automake: object file(s) will be placed in the top-level directory. However,
+ automake: this behaviour will change in future Automake versions: they will
+ automake: unconditionally cause object files to be placed in the same subdirectory
+ automake: of the corresponding sources.
+ automake: You are advised to start using 'subdir-objects' option throughout your
+ automake: project, to avoid future incompatibilities.
+ src/drmgr/Makefile.am:9: warning: source file '$(COM_DIR)/pseries_platform.c' is in a subdirectory,
+ src/drmgr/Makefile.am:9: but option 'subdir-objects' is disabled
+ autoreconf: automake failed with exit status: 1
+
+Using:
+
+automake (GNU automake) 1.14.1
+
+Since we're using objects in subdirectories, we need the subdir-objects
+atuomake option.
+
+Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
+---
+ Makefile.am | 2 +-
+ src/Makefile.am | 2 ++
+ src/drmgr/Makefile.am | 2 ++
+ 3 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 35df9f7..b3309c7 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,4 +1,4 @@
+-AUTOMAKE_OPTIONS = foreign
++AUTOMAKE_OPTIONS = foreign subdir-objects
+ SUBDIRS = src man scripts
+
+ docdir = $(datadir)/doc/packages/@PACKAGE@
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 8f17cd2..18403b8 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -1,3 +1,5 @@
++AUTOMAKE_OPTIONS = subdir-objects
++
+ AM_CFLAGS = -Wall -g -I common/
+ AM_LDFLAGS =
+
+diff --git a/src/drmgr/Makefile.am b/src/drmgr/Makefile.am
+index 2127b0d..4255fac 100644
+--- a/src/drmgr/Makefile.am
++++ b/src/drmgr/Makefile.am
+@@ -1,3 +1,5 @@
++AUTOMAKE_OPTIONS = subdir-objects
++
+ COM_DIR = $(top_srcdir)/src/common
+
+ AM_CFLAGS = -Wall -g -I $(COM_DIR)
+--
+1.8.3.2
+
diff --git a/package/powerpc-utils/powerpc-utils.mk b/package/powerpc-utils/powerpc-utils.mk
new file mode 100644
index 0000000..6f8448c
--- /dev/null
+++ b/package/powerpc-utils/powerpc-utils.mk
@@ -0,0 +1,16 @@
+################################################################################
+#
+# powerpc-utils
+#
+################################################################################
+
+POWERPC_UTILS_VERSION = 64fe85e9473d05607dd8deda5023c7dd426216a5
+POWERPC_UTILS_SITE = git://git.code.sf.net/p/powerpc-utils/powerpc-utils
+POWERPC_UTILS_AUTORECONF = YES
+POWERPC_UTILS_DEPENDENCIES = zlib
+POWERPC_UTILS_LICENSE = Common Public License Version 1.0
+POWERPC_UTILS_LICENSE_FILES = COPYRIGHT
+
+POWERPC_UTILS_CONF_OPT = --without-librtas
+
+$(eval $(autotools-package))
^ permalink raw reply related [flat|nested] 17+ messages in thread* [Buildroot] [PATCH 10/10 v2] Add powerpc petitboot defconfig
2014-03-12 3:45 [Buildroot] [PATCH 00/10 v2] Enable a buildroot-based petitboot bootloader Jeremy Kerr
` (2 preceding siblings ...)
2014-03-12 3:45 ` [Buildroot] [PATCH 06/10 v2] package/powerpc-utils: Add powerpc hardware utilities Jeremy Kerr
@ 2014-03-12 3:45 ` Jeremy Kerr
2014-03-12 3:45 ` [Buildroot] [PATCH 08/10 v2] package/petitboot: Add petitboot, the userspace bootloader Jeremy Kerr
` (5 subsequent siblings)
9 siblings, 0 replies; 17+ messages in thread
From: Jeremy Kerr @ 2014-03-12 3:45 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 0000000..eb4a56a
--- /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_WCHAR=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] 17+ messages in thread* [Buildroot] [PATCH 08/10 v2] package/petitboot: Add petitboot, the userspace bootloader
2014-03-12 3:45 [Buildroot] [PATCH 00/10 v2] Enable a buildroot-based petitboot bootloader Jeremy Kerr
` (3 preceding siblings ...)
2014-03-12 3:45 ` [Buildroot] [PATCH 10/10 v2] Add powerpc petitboot defconfig Jeremy Kerr
@ 2014-03-12 3:45 ` Jeremy Kerr
2014-03-12 22:16 ` Yann E. MORIN
2014-03-12 3:45 ` [Buildroot] [PATCH 05/10 v2] package/dtc: Update to v1.4.0 Jeremy Kerr
` (4 subsequent siblings)
9 siblings, 1 reply; 17+ messages in thread
From: Jeremy Kerr @ 2014-03-12 3:45 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 | 13 +++
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 | 64 +++++++++++++++++++
package/petitboot/removable-event-poll.rules | 4 +
8 files changed, 127 insertions(+)
diff --git a/package/Config.in b/package/Config.in
index e8662e0..d98688c 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1063,6 +1063,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 0000000..f5ffe8e
--- /dev/null
+++ b/package/petitboot/Config.in
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_PETITBOOT
+ bool "petitboot"
+ depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV
+ select BR2_PACKAGE_UDEV
+ select BR2_PACKAGE_NCURSES
+ # run-time dependency only
+ select BR2_PACKAGE_KEXEC_LITE if !BR2_PACKAGE_KEXEC
+ # run-time dependency only
+ 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 0000000..6570200
--- /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 0000000..ebdf944
--- /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 0000000..0175e76
--- /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 0000000..7464856
--- /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 0000000..8370fa2
--- /dev/null
+++ b/package/petitboot/petitboot.mk
@@ -0,0 +1,64 @@
+################################################################################
+#
+# petitboot
+#
+################################################################################
+
+PETITBOOT_VERSION = bddd4552cced1a45d26e06de74d61c1fe464e140
+PETITBOOT_SITE = git://git.ozlabs.org/home/jk/git/petitboot
+PETITBOOT_DEPENDENCIES = ncurses udev host-autoconf host-automake host-libtool \
+ host-bison host-flex
+PETITBOOT_LICENSE = GPLv2
+PETITBOOT_LICENSE_FILES = COPYING
+
+PETITBOOT_CONF_OPT += --with-ncurses --without-twin-x11 --without-twin-fbdev \
+ --localstatedir=/var \
+ HOST_PROG_KEXEC=/usr/sbin/kexec \
+ HOST_PROG_SHUTDOWN=/usr/libexec/petitboot/bb-kexec-reboot \
+ $(if $(BR2_PACKAGE_BUSYBOX),--with-tftp=busybox)
+
+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
+
+# shorten any full git versions
+PETITBOOT_BOOTSTRAP_VERSION = $(shell echo "$(PETITBOOT_VERSION)" | \
+ sed 's,^\([[:xdigit:]]\{8\}\)[[:xdigit:]]*$$,\1,')
+
+define PETITBOOT_PRE_CONFIGURE_BOOTSTRAP
+ (cd $(@D) && ./bootstrap $(PETITBOOT_BOOTSTRAP_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 0000000..b736aef
--- /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] 17+ messages in thread* [Buildroot] [PATCH 08/10 v2] package/petitboot: Add petitboot, the userspace bootloader
2014-03-12 3:45 ` [Buildroot] [PATCH 08/10 v2] package/petitboot: Add petitboot, the userspace bootloader Jeremy Kerr
@ 2014-03-12 22:16 ` Yann E. MORIN
0 siblings, 0 replies; 17+ messages in thread
From: Yann E. MORIN @ 2014-03-12 22:16 UTC (permalink / raw)
To: buildroot
Jeremy, All,
On 2014-03-12 11:45 +0800, Jeremy Kerr spake thusly:
> This change adds the petitboot package, a bootloader that exists in
> userspace, and uses the kexec facility to boot into a new kernel.
[--SNIP--]
> diff --git a/package/petitboot/Config.in b/package/petitboot/Config.in
> new file mode 100644
> index 0000000..f5ffe8e
> --- /dev/null
> +++ b/package/petitboot/Config.in
> @@ -0,0 +1,13 @@
> +config BR2_PACKAGE_PETITBOOT
> + bool "petitboot"
> + depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV
> + select BR2_PACKAGE_UDEV
Package udev no longer exists. udev is now a virtual package that is
provided by eother systemd of eudev. So you can not 'select'
BR2_PACKAGE_UDEV.
You should instead use:
depends on BR2_PACKAGE_HAS_UDEV
[--SNIP--]
> diff --git a/package/petitboot/petitboot.mk b/package/petitboot/petitboot.mk
> new file mode 100644
> index 0000000..8370fa2
> --- /dev/null
> +++ b/package/petitboot/petitboot.mk
> @@ -0,0 +1,64 @@
> +################################################################################
> +#
> +# petitboot
> +#
> +################################################################################
[--SNIP--]
> +define PETITBOOT_PRE_CONFIGURE_BOOTSTRAP
> + (cd $(@D) && ./bootstrap $(PETITBOOT_BOOTSTRAP_VERSION))
> +endef
> +
> +PETITBOOT_PRE_CONFIGURE_HOOKS += PETITBOOT_PRE_CONFIGURE_BOOTSTRAP
I find it too bad that an autotools package can not be autoreconf'ed.
I've looked a bit at what this bootstrap does, and all it really is used
for is to shoehorn the veersion in configure.ac.
Since you seem to be involved in petitboot, here's a suggestion to do it
otherwise:
- move the version stuff out of ./bootstrap, into its own script, eg.
./version.sh
- change configure.ac to use AC_INIT as thus:
AC_INIT([petitboot],
[m4_esyscmd_s([./version.sh])],
[Geoff Levand <geoff@infradead.org>])
Then the package will be entirely autoreconf-igurable. ;-)
I haven't looked further in the patch, just pointing out a few things I
spotted on a cursory look.
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] 17+ messages in thread
* [Buildroot] [PATCH 05/10 v2] package/dtc: Update to v1.4.0
2014-03-12 3:45 [Buildroot] [PATCH 00/10 v2] Enable a buildroot-based petitboot bootloader Jeremy Kerr
` (4 preceding siblings ...)
2014-03-12 3:45 ` [Buildroot] [PATCH 08/10 v2] package/petitboot: Add petitboot, the userspace bootloader Jeremy Kerr
@ 2014-03-12 3:45 ` Jeremy Kerr
2014-03-29 15:18 ` Thomas Petazzoni
2014-03-12 3:45 ` [Buildroot] [PATCH 09/10 v2] package/iprutils: Add IBM Power RAID utilities Jeremy Kerr
` (3 subsequent siblings)
9 siblings, 1 reply; 17+ messages in thread
From: Jeremy Kerr @ 2014-03-12 3:45 UTC (permalink / raw)
To: buildroot
Currently, we're using an untagged commit of dtc. Since inclusion in
buildroot, version 1.4.0 has been released, which includes new
endian-annotated type defintions.
We want to use these type definitions in kexec-lite, so update to the
new release.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
---
package/dtc/dtc.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/dtc/dtc.mk b/package/dtc/dtc.mk
index a230e60..a6898f2 100644
--- a/package/dtc/dtc.mk
+++ b/package/dtc/dtc.mk
@@ -4,7 +4,7 @@
#
################################################################################
-DTC_VERSION = e4b497f367a3b2ae99cc52089a14a221b13a76ef
+DTC_VERSION = v1.4.0
DTC_SITE = git://git.jdl.com/software/dtc.git
DTC_LICENSE = GPLv2+/BSD-2c
DTC_LICENSE_FILES = README.license GPL
^ permalink raw reply related [flat|nested] 17+ messages in thread* [Buildroot] [PATCH 05/10 v2] package/dtc: Update to v1.4.0
2014-03-12 3:45 ` [Buildroot] [PATCH 05/10 v2] package/dtc: Update to v1.4.0 Jeremy Kerr
@ 2014-03-29 15:18 ` Thomas Petazzoni
0 siblings, 0 replies; 17+ messages in thread
From: Thomas Petazzoni @ 2014-03-29 15:18 UTC (permalink / raw)
To: buildroot
Dear Jeremy Kerr,
On Wed, 12 Mar 2014 11:45:57 +0800, Jeremy Kerr wrote:
> Currently, we're using an untagged commit of dtc. Since inclusion in
> buildroot, version 1.4.0 has been released, which includes new
> endian-annotated type defintions.
>
> We want to use these type definitions in kexec-lite, so update to the
> new release.
>
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Applied, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH 09/10 v2] package/iprutils: Add IBM Power RAID utilities
2014-03-12 3:45 [Buildroot] [PATCH 00/10 v2] Enable a buildroot-based petitboot bootloader Jeremy Kerr
` (5 preceding siblings ...)
2014-03-12 3:45 ` [Buildroot] [PATCH 05/10 v2] package/dtc: Update to v1.4.0 Jeremy Kerr
@ 2014-03-12 3:45 ` Jeremy Kerr
2014-03-29 15:17 ` Thomas Petazzoni
2014-03-12 3:45 ` [Buildroot] [PATCH 07/10 v2] package/kexec-lite: Add a package for the kexec-lite tools Jeremy Kerr
` (2 subsequent siblings)
9 siblings, 1 reply; 17+ messages in thread
From: Jeremy Kerr @ 2014-03-12 3:45 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-01-dont-use-gettext.patch | 30 ++++++++++++
package/iprutils/iprutils.mk | 26 ++++++++++
4 files changed, 67 insertions(+)
diff --git a/package/Config.in b/package/Config.in
index d98688c..d62731d 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1056,6 +1056,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 0000000..d72688f
--- /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-01-dont-use-gettext.patch b/package/iprutils/iprutils-01-dont-use-gettext.patch
new file mode 100644
index 0000000..8d3d5dd
--- /dev/null
+++ b/package/iprutils/iprutils-01-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 0000000..15de9af
--- /dev/null
+++ b/package/iprutils/iprutils.mk
@@ -0,0 +1,26 @@
+################################################################################
+#
+# 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 -m 0755 $(@D)/iprconfig $(TARGET_DIR)/sbin/iprconfig
+ $(INSTALL) -D -m 0755 $(@D)/iprupdate $(TARGET_DIR)/sbin/iprupdate
+ $(INSTALL) -D -m 0755 $(@D)/iprdump $(TARGET_DIR)/sbin/iprdump
+ $(INSTALL) -D -m 0755 $(@D)/iprinit $(TARGET_DIR)/sbin/iprinit
+ $(INSTALL) -D -m 0755 $(@D)/iprdbg $(TARGET_DIR)/sbin/iprdbg
+endef
+
+$(eval $(generic-package))
^ permalink raw reply related [flat|nested] 17+ messages in thread* [Buildroot] [PATCH 09/10 v2] package/iprutils: Add IBM Power RAID utilities
2014-03-12 3:45 ` [Buildroot] [PATCH 09/10 v2] package/iprutils: Add IBM Power RAID utilities Jeremy Kerr
@ 2014-03-29 15:17 ` Thomas Petazzoni
0 siblings, 0 replies; 17+ messages in thread
From: Thomas Petazzoni @ 2014-03-29 15:17 UTC (permalink / raw)
To: buildroot
Dear Jeremy Kerr,
I've applied your patch, with a few corrections (see below).
On Wed, 12 Mar 2014 11:45:57 +0800, Jeremy Kerr wrote:
> diff --git a/package/iprutils/Config.in b/package/iprutils/Config.in
> new file mode 100644
> index 0000000..d72688f
> --- /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
Here I've added the URL of the upstream project on SourceForge.
> diff --git a/package/iprutils/iprutils.mk b/package/iprutils/iprutils.mk
> new file mode 100644
> index 0000000..15de9af
> --- /dev/null
> +++ b/package/iprutils/iprutils.mk
> @@ -0,0 +1,26 @@
> +################################################################################
> +#
> +# 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
Here instead of CC=$(TARGET_CC) and LD=$(TARGET_LD), I've used
$(TARGET_CONFIGURE_OPTS), which also ensures CFLAGS and al. are passed.
This required adding another patch to the package so that our CFLAGS
can be passed from the environment and can be added with the
package-specific CFLAGS.
> +define IPRUTILS_INSTALL_TARGET_CMDS
> + $(INSTALL) -D -m 0755 $(@D)/iprconfig $(TARGET_DIR)/sbin/iprconfig
> + $(INSTALL) -D -m 0755 $(@D)/iprupdate $(TARGET_DIR)/sbin/iprupdate
> + $(INSTALL) -D -m 0755 $(@D)/iprdump $(TARGET_DIR)/sbin/iprdump
> + $(INSTALL) -D -m 0755 $(@D)/iprinit $(TARGET_DIR)/sbin/iprinit
> + $(INSTALL) -D -m 0755 $(@D)/iprdbg $(TARGET_DIR)/sbin/iprdbg
> +endef
And I've replaced that my using the "make install" target of the
package Makefile, which was doing the same thing. "make install" is
also installing manpages, which is probably why you didn't use it, but
Buildroot anyway automatically removes documentation from the target,
such as manpages. Therefore, we prefer to use the package "make
install", which is more likely to continue to work in the future.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH 07/10 v2] package/kexec-lite: Add a package for the kexec-lite tools
2014-03-12 3:45 [Buildroot] [PATCH 00/10 v2] Enable a buildroot-based petitboot bootloader Jeremy Kerr
` (6 preceding siblings ...)
2014-03-12 3:45 ` [Buildroot] [PATCH 09/10 v2] package/iprutils: Add IBM Power RAID utilities Jeremy Kerr
@ 2014-03-12 3:45 ` Jeremy Kerr
2014-03-12 3:45 ` [Buildroot] [PATCH 01/10 v2] package/busybox: Add facility for DHCP hooks Jeremy Kerr
2014-03-12 3:45 ` [Buildroot] [PATCH 02/10 v2] package/dropbear: Add separate configuration option for dropbear server Jeremy Kerr
9 siblings, 0 replies; 17+ messages in thread
From: Jeremy Kerr @ 2014-03-12 3:45 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 | 12 +++
package/kexec-lite/kexec-lite-01-clean-restart.patch | 34 +++++++++++
package/kexec-lite/kexec-lite.mk | 22 +++++++
4 files changed, 69 insertions(+)
diff --git a/package/Config.in b/package/Config.in
index 5fe0594..e8662e0 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -53,6 +53,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 0000000..daf7eb9
--- /dev/null
+++ b/package/kexec-lite/Config.in
@@ -0,0 +1,12 @@
+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 package is a tiny implementation of the kexec userspace
+ components, for devicetree-based platforms.
diff --git a/package/kexec-lite/kexec-lite-01-clean-restart.patch b/package/kexec-lite/kexec-lite-01-clean-restart.patch
new file mode 100644
index 0000000..faaa93a
--- /dev/null
+++ b/package/kexec-lite/kexec-lite-01-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 0000000..aa09abc
--- /dev/null
+++ b/package/kexec-lite/kexec-lite.mk
@@ -0,0 +1,22 @@
+################################################################################
+#
+# kexec-lite
+#
+################################################################################
+
+KEXEC_LITE_VERSION = 0e30677d8232595c135772e1121b7be98c118e13
+KEXEC_LITE_SITE = $(call github,antonblanchard,kexec-lite,$(KEXEC_LITE_VERSION))
+KEXEC_LITE_LICENSE = GPL
+KEXEC_LITE_DEPENDENCIES = libelf dtc
+
+define KEXEC_LITE_BUILD_CMDS
+ $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ -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] 17+ messages in thread* [Buildroot] [PATCH 01/10 v2] package/busybox: Add facility for DHCP hooks
2014-03-12 3:45 [Buildroot] [PATCH 00/10 v2] Enable a buildroot-based petitboot bootloader Jeremy Kerr
` (7 preceding siblings ...)
2014-03-12 3:45 ` [Buildroot] [PATCH 07/10 v2] package/kexec-lite: Add a package for the kexec-lite tools Jeremy Kerr
@ 2014-03-12 3:45 ` Jeremy Kerr
2014-03-12 3:45 ` [Buildroot] [PATCH 02/10 v2] package/dropbear: Add separate configuration option for dropbear server Jeremy Kerr
9 siblings, 0 replies; 17+ messages in thread
From: Jeremy Kerr @ 2014-03-12 3:45 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 | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index 793ffb9..0a094e1 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -206,6 +206,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 e23d1f1..50c52e6 100755
--- a/package/busybox/udhcpc.script
+++ b/package/busybox/udhcpc.script
@@ -64,4 +64,10 @@ case "$1" in
;;
esac
+HOOK_DIR="$0.d"
+for hook in "${HOOK_DIR}/"*; do
+ [ -f "${hook}" -a -x "${hook}" ] || continue
+ "${hook}" "${@}"
+done
+
exit 0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [Buildroot] [PATCH 02/10 v2] package/dropbear: Add separate configuration option for dropbear server
2014-03-12 3:45 [Buildroot] [PATCH 00/10 v2] Enable a buildroot-based petitboot bootloader Jeremy Kerr
` (8 preceding siblings ...)
2014-03-12 3:45 ` [Buildroot] [PATCH 01/10 v2] package/busybox: Add facility for DHCP hooks Jeremy Kerr
@ 2014-03-12 3:45 ` Jeremy Kerr
9 siblings, 0 replies; 17+ messages in thread
From: Jeremy Kerr @ 2014-03-12 3:45 UTC (permalink / raw)
To: buildroot
Currently, the dropbear package installs both client and server
components. This means that when we only want the client binaries, we
also get the server, which is run from init.
Even though it's a multi-call binary (the client and server
exist in the same executable), we can define which parts are
compiled-in. We'd also like to selectively install the links and init
scripts.
This change introduces a separate configuration for the dropbear server.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
---
package/dropbear/Config.in | 6 ++++++
package/dropbear/dropbear.mk | 11 +++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/package/dropbear/Config.in b/package/dropbear/Config.in
index 68c3b71..9ff5f47 100644
--- a/package/dropbear/Config.in
+++ b/package/dropbear/Config.in
@@ -8,6 +8,12 @@ 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_DISABLE_REVERSEDNS
bool "disable reverse DNS lookups"
help
diff --git a/package/dropbear/dropbear.mk b/package/dropbear/dropbear.mk
index 2ac6211..b393c8a 100644
--- a/package/dropbear/dropbear.mk
+++ b/package/dropbear/dropbear.mk
@@ -8,8 +8,9 @@ DROPBEAR_VERSION = 2014.63
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_MAKE_PROGRAMS = $(filter-out ssh, $(DROPBEAR_TARGET_BINS))
DROPBEAR_MAKE = $(MAKE) MULTI=1 SCPPROGRESS=1 \
- PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
+ PROGRAMS="$(DROPBEAR_MAKE_PROGRAMS)"
DROPBEAR_LICENSE = MIT, BSD-2c-like, BSD-2c
DROPBEAR_LICENSE_FILES = LICENSE
@@ -18,6 +19,10 @@ ifeq ($(BR2_PREFER_STATIC_LIB),y)
DROPBEAR_MAKE += STATIC=1
endif
+ifeq ($(BR2_PACKAGE_DROPBEAR_SERVER),y)
+DROPBEAR_TARGET_BINS += dropbear
+endif
+
define DROPBEAR_FIX_XAUTH
$(SED) 's,^#define XAUTH_COMMAND.*/xauth,#define XAUTH_COMMAND "/usr/bin/xauth,g' $(@D)/options.h
endef
@@ -43,6 +48,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
@@ -59,6 +65,7 @@ endef
else
DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_DISABLE_STANDALONE
endif
+endif
ifeq ($(BR2_PACKAGE_DROPBEAR_DISABLE_REVERSEDNS),)
DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_ENABLE_REVERSE_DNS
@@ -82,7 +89,7 @@ endif
define DROPBEAR_INSTALL_TARGET_CMDS
$(INSTALL) -m 755 $(@D)/dropbearmulti $(TARGET_DIR)/usr/sbin/dropbear
- for f in $(DROPBEAR_TARGET_BINS); do \
+ for f in $(filter-out dropbear,$(DROPBEAR_TARGET_BINS)); do \
ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/$$f ; \
done
endef
^ permalink raw reply related [flat|nested] 17+ messages in thread