* [Buildroot] [PATCH 5/7 v3] package/kexec-lite: Add a package for the kexec-lite tools
2014-06-17 5:21 [Buildroot] [PATCH 0/7 v3] Enable a buildroot-based petitboot bootloader Jeremy Kerr
@ 2014-06-17 5:21 ` Jeremy Kerr
2014-07-17 20:54 ` Thomas Petazzoni
2014-06-17 5:21 ` [Buildroot] [PATCH 3/7 v3] package/ncurses: Allow building wide char support Jeremy Kerr
` (5 subsequent siblings)
6 siblings, 1 reply; 25+ messages in thread
From: Jeremy Kerr @ 2014-06-17 5:21 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 125f3f0..b0d4d47 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -56,6 +56,7 @@ menu "Debugging, profiling and benchmark"
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..b5bd58f
--- /dev/null
+++ b/package/kexec-lite/Config.in
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_KEXEC_LITE
+ bool "kexec-lite"
+ depends on BR2_powerpc || BR2_powerpc64
+ 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..e47edc6
--- /dev/null
+++ b/package/kexec-lite/kexec-lite.mk
@@ -0,0 +1,22 @@
+################################################################################
+#
+# kexec-lite
+#
+################################################################################
+
+KEXEC_LITE_VERSION = fb8543fea3beb0522b5a63a74ea1a845dbd7b954
+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] 25+ messages in thread* [Buildroot] [PATCH 5/7 v3] package/kexec-lite: Add a package for the kexec-lite tools
2014-06-17 5:21 ` [Buildroot] [PATCH 5/7 v3] package/kexec-lite: Add a package for the kexec-lite tools Jeremy Kerr
@ 2014-07-17 20:54 ` Thomas Petazzoni
0 siblings, 0 replies; 25+ messages in thread
From: Thomas Petazzoni @ 2014-07-17 20:54 UTC (permalink / raw)
To: buildroot
Dear Jeremy Kerr,
On Tue, 17 Jun 2014 13:21:47 +0800, Jeremy Kerr wrote:
> Kexec-lite is a tiny impementation of kexec for devicetree-based
> platforms.
>
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Thanks, applied, with a bunch of minor changes. From the commit log:
[Thomas:
- Add !BR2_PREFER_STATIC_LIB dependency, inherited from the dtc
package
- Fix license to be GPLv2+, and not just GPL.
- Use $(TARGET_CONFIGURE_OPTS) instead of manually passing CC, LD,
CFLAGS.
- Use a full path as the target of $(INSTALL)]
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 25+ messages in thread
* [Buildroot] [PATCH 3/7 v3] package/ncurses: Allow building wide char support
2014-06-17 5:21 [Buildroot] [PATCH 0/7 v3] Enable a buildroot-based petitboot bootloader Jeremy Kerr
2014-06-17 5:21 ` [Buildroot] [PATCH 5/7 v3] package/kexec-lite: Add a package for the kexec-lite tools Jeremy Kerr
@ 2014-06-17 5:21 ` Jeremy Kerr
2014-07-04 16:58 ` Gustavo Zacarias
2014-06-17 5:21 ` [Buildroot] [PATCH 7/7 v3] Add powerpc64 petitboot defconfig Jeremy Kerr
` (4 subsequent siblings)
6 siblings, 1 reply; 25+ messages in thread
From: Jeremy Kerr @ 2014-06-17 5:21 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 4bba8f1..bd2aac0 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
@@ -56,7 +74,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
@@ -74,6 +93,7 @@ endif
define NCURSES_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)/usr/lib
$(NCURSES_INSTALL_TARGET_LIBS)
+ $(NCURSES_LINK_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] 25+ messages in thread* [Buildroot] [PATCH 3/7 v3] package/ncurses: Allow building wide char support
2014-06-17 5:21 ` [Buildroot] [PATCH 3/7 v3] package/ncurses: Allow building wide char support Jeremy Kerr
@ 2014-07-04 16:58 ` Gustavo Zacarias
2014-07-16 17:04 ` Thomas De Schampheleire
0 siblings, 1 reply; 25+ messages in thread
From: Gustavo Zacarias @ 2014-07-04 16:58 UTC (permalink / raw)
To: buildroot
On 06/17/2014 02:21 AM, Jeremy Kerr wrote:
> 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>
Hi.
I'm testing this patch for bug #6950 goodness.
In principle what you do seems fine rather than going the split approach
like it's mentioned in the bug.
However the patch needs a little tweak:
> +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
You're basically not dealing with the static version of the libraries
here, this breaks at least tmux (it statically links in ncurses), and
i'm sure many other BR2_PREFER_STATIC_LIB=y scenarios.
A big allyespackageconfig run revealed a couple of packages breaking,
namely nano and statserial, i've already cooked patches for them and
send them shortly to the list.
Otherwise it seems all is great.
Thanks.
Regards.
^ permalink raw reply [flat|nested] 25+ messages in thread* [Buildroot] [PATCH 3/7 v3] package/ncurses: Allow building wide char support
2014-07-04 16:58 ` Gustavo Zacarias
@ 2014-07-16 17:04 ` Thomas De Schampheleire
2014-07-17 0:24 ` Jeremy Kerr
0 siblings, 1 reply; 25+ messages in thread
From: Thomas De Schampheleire @ 2014-07-16 17:04 UTC (permalink / raw)
To: buildroot
Hi Jeremy, Gustavo,
On Fri, Jul 4, 2014 at 6:58 PM, Gustavo Zacarias
<gustavo@zacarias.com.ar> wrote:
> On 06/17/2014 02:21 AM, Jeremy Kerr wrote:
>
>> 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>
>
> Hi.
> I'm testing this patch for bug #6950 goodness.
> In principle what you do seems fine rather than going the split approach
> like it's mentioned in the bug.
> However the patch needs a little tweak:
>
>> +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
>
> You're basically not dealing with the static version of the libraries
> here, this breaks at least tmux (it statically links in ncurses), and
> i'm sure many other BR2_PREFER_STATIC_LIB=y scenarios.
>
> A big allyespackageconfig run revealed a couple of packages breaking,
> namely nano and statserial, i've already cooked patches for them and
> send them shortly to the list.
>
> Otherwise it seems all is great.
Could any of you respin and repost the patch with this comment taken
into account?
Thanks a lot,
Thomas
^ permalink raw reply [flat|nested] 25+ messages in thread* [Buildroot] [PATCH 3/7 v3] package/ncurses: Allow building wide char support
2014-07-16 17:04 ` Thomas De Schampheleire
@ 2014-07-17 0:24 ` Jeremy Kerr
2014-07-17 0:43 ` Gustavo Zacarias
0 siblings, 1 reply; 25+ messages in thread
From: Jeremy Kerr @ 2014-07-17 0:24 UTC (permalink / raw)
To: buildroot
Hi Thomas,
> Could any of you respin and repost the patch with this comment taken
> into account?
Sure, will do.
Gustavo - is this breakage simply with BR2_PREFER_STATIC_LIB? or is
there some better way to reproduce this issue, so I can ensure my new
patch fixes this?
Thanks,
Jeremy
^ permalink raw reply [flat|nested] 25+ messages in thread
* [Buildroot] [PATCH 3/7 v3] package/ncurses: Allow building wide char support
2014-07-17 0:24 ` Jeremy Kerr
@ 2014-07-17 0:43 ` Gustavo Zacarias
0 siblings, 0 replies; 25+ messages in thread
From: Gustavo Zacarias @ 2014-07-17 0:43 UTC (permalink / raw)
To: buildroot
On 07/16/2014 09:24 PM, Jeremy Kerr wrote:
> Sure, will do.
>
> Gustavo - is this breakage simply with BR2_PREFER_STATIC_LIB? or is
> there some better way to reproduce this issue, so I can ensure my new
> patch fixes this?
>
> Thanks,
Hi Jeremy, thanks for getting back.
A quick fix would be:
----
ifeq ($(BR2_PREFER_STATIC_LIB),y)
define NCURSES_LINK_LIBS
for lib in $(NCURSES_LIBS-y); do \
ln -sf $${lib}$(NCURSES_LIB_SUFFIX).a \
$(1)/usr/lib/$${lib}.a; \
done
endef
else
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
endif
----
The only scenario that i could fail with static builds is blackfin with
flat targets, the ncurses widechar build breaks in a very odd way, which
i exclude via:
----
config BR2_PACKAGE_NCURSES_WCHAR
bool "enable wide char support"
depends on BR2_USE_WCHAR
# Build broken @ curses.priv.h with bad declarations
depends on !(BR2_bfin && BR2_BINFMT_FLAT)
help
Enable wide char & UTF-8 support in ncurses libraries
----
Unless someone wants to dig deep into that breakage and fix it i guess
it's fine to exclude that combination.
Regards.
^ permalink raw reply [flat|nested] 25+ messages in thread
* [Buildroot] [PATCH 7/7 v3] Add powerpc64 petitboot defconfig
2014-06-17 5:21 [Buildroot] [PATCH 0/7 v3] Enable a buildroot-based petitboot bootloader Jeremy Kerr
2014-06-17 5:21 ` [Buildroot] [PATCH 5/7 v3] package/kexec-lite: Add a package for the kexec-lite tools Jeremy Kerr
2014-06-17 5:21 ` [Buildroot] [PATCH 3/7 v3] package/ncurses: Allow building wide char support Jeremy Kerr
@ 2014-06-17 5:21 ` Jeremy Kerr
2014-10-12 15:02 ` Arnout Vandecappelle
2014-06-17 5:21 ` [Buildroot] [PATCH 2/7 v3] package/dropbear: Add separate configuration option for dropbear server Jeremy Kerr
` (3 subsequent siblings)
6 siblings, 1 reply; 25+ messages in thread
From: Jeremy Kerr @ 2014-06-17 5:21 UTC (permalink / raw)
To: buildroot
A simple defconfig for building a petitboot-based bootloader for
powerpc64 machines.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
---
configs/powerpc64_petitboot_defconfig | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/configs/powerpc64_petitboot_defconfig b/configs/powerpc64_petitboot_defconfig
new file mode 100644
index 0000000..fa629ab
--- /dev/null
+++ b/configs/powerpc64_petitboot_defconfig
@@ -0,0 +1,17 @@
+BR2_powerpc64=y
+BR2_GENERATE_LOCALE="en_US.UTF-8"
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
+BR2_TARGET_GENERIC_GETTY_PORT="hvc0"
+BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=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_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_XZ=y
^ permalink raw reply related [flat|nested] 25+ messages in thread* [Buildroot] [PATCH 7/7 v3] Add powerpc64 petitboot defconfig
2014-06-17 5:21 ` [Buildroot] [PATCH 7/7 v3] Add powerpc64 petitboot defconfig Jeremy Kerr
@ 2014-10-12 15:02 ` Arnout Vandecappelle
2014-10-20 3:27 ` Jeremy Kerr
0 siblings, 1 reply; 25+ messages in thread
From: Arnout Vandecappelle @ 2014-10-12 15:02 UTC (permalink / raw)
To: buildroot
On 17/06/14 07:21, Jeremy Kerr wrote:
> A simple defconfig for building a petitboot-based bootloader for
> powerpc64 machines.
It would be nice if you could also create one for a qemu target, so people can
actually experiment with it.
>
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
>
> ---
> configs/powerpc64_petitboot_defconfig | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/configs/powerpc64_petitboot_defconfig b/configs/powerpc64_petitboot_defconfig
> new file mode 100644
> index 0000000..fa629ab
> --- /dev/null
> +++ b/configs/powerpc64_petitboot_defconfig
> @@ -0,0 +1,17 @@
> +BR2_powerpc64=y
> +BR2_GENERATE_LOCALE="en_US.UTF-8"
> +BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
> +BR2_TARGET_GENERIC_GETTY_PORT="hvc0"
> +BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
> +BR2_PACKAGE_LINUX_FIRMWARE=y
> +BR2_PACKAGE_LINUX_FIRMWARE_BNX2X=y
> +BR2_PACKAGE_LINUX_FIRMWARE_CXGB4=y
> +BR2_PACKAGE_NCURSES_WCHAR=y
Is this needed?
> +BR2_PACKAGE_DROPBEAR=y
Is this useful?
> +# BR2_PACKAGE_DROPBEAR_SERVER is not set
> +BR2_PACKAGE_ETHTOOL=y
Is this useful?
> +BR2_PACKAGE_NETCAT=y
Is this useful?
> +BR2_PACKAGE_RSYNC=y
Is this useful?
> +BR2_PACKAGE_PETITBOOT=y
> +BR2_TARGET_ROOTFS_CPIO=y
> +BR2_TARGET_ROOTFS_CPIO_XZ=y
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 25+ messages in thread
* [Buildroot] [PATCH 7/7 v3] Add powerpc64 petitboot defconfig
2014-10-12 15:02 ` Arnout Vandecappelle
@ 2014-10-20 3:27 ` Jeremy Kerr
2014-10-21 21:31 ` Arnout Vandecappelle
0 siblings, 1 reply; 25+ messages in thread
From: Jeremy Kerr @ 2014-10-20 3:27 UTC (permalink / raw)
To: buildroot
Hi Arnout,
> It would be nice if you could also create one for a qemu target, so people can
> actually experiment with it.
This build should work fine for qemu, is there something else I should
be doing here?
>> --- /dev/null
>> +++ b/configs/powerpc64_petitboot_defconfig
>> @@ -0,0 +1,17 @@
>> +BR2_powerpc64=y
>> +BR2_GENERATE_LOCALE="en_US.UTF-8"
>> +BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
>> +BR2_TARGET_GENERIC_GETTY_PORT="hvc0"
>> +BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
>> +BR2_PACKAGE_LINUX_FIRMWARE=y
>> +BR2_PACKAGE_LINUX_FIRMWARE_BNX2X=y
>> +BR2_PACKAGE_LINUX_FIRMWARE_CXGB4=y
>> +BR2_PACKAGE_NCURSES_WCHAR=y
>
> Is this needed?
Yes, we need this to display boot labels that contain non-ASCII
characters. Fedora uses "Schr?dinger?s cat", for example...
>> +BR2_PACKAGE_DROPBEAR=y
>
> Is this useful?
>
>> +# BR2_PACKAGE_DROPBEAR_SERVER is not set
>> +BR2_PACKAGE_ETHTOOL=y
>
> Is this useful?
>
>> +BR2_PACKAGE_NETCAT=y
>
> Is this useful?
>
>> +BR2_PACKAGE_RSYNC=y
>
> Is this useful?
We've found that these four utilities have been very useful in debugging
boot issues; dropbear, netcat and rsync for remote access / file
transfer, and ethtool for network-device firmware management.
However, if we want to keep the defconfig as minimal as possible (rather
than the configuration that I've assumed users will generally need), we
can remove these.
Regards,
Jeremy
^ permalink raw reply [flat|nested] 25+ messages in thread
* [Buildroot] [PATCH 7/7 v3] Add powerpc64 petitboot defconfig
2014-10-20 3:27 ` Jeremy Kerr
@ 2014-10-21 21:31 ` Arnout Vandecappelle
0 siblings, 0 replies; 25+ messages in thread
From: Arnout Vandecappelle @ 2014-10-21 21:31 UTC (permalink / raw)
To: buildroot
On 20/10/14 05:27, Jeremy Kerr wrote:
> Hi Arnout,
>
>> It would be nice if you could also create one for a qemu target, so people can
>> actually experiment with it.
>
> This build should work fine for qemu, is there something else I should
> be doing here?
Because of the firmware lines, I thought that it was for some specific hardware.
It would be better to take qemu_ppc64_pseries_defconfig and add the
petitboot-specific things. I'd also name it
qemu_ppc64_pseries_petitboot_defconfig to make this explicit. Or alternatively,
petitboot_qemu_ppc64_pseries_defconfig.
>
>>> --- /dev/null
>>> +++ b/configs/powerpc64_petitboot_defconfig
>>> @@ -0,0 +1,17 @@
>>> +BR2_powerpc64=y
>>> +BR2_GENERATE_LOCALE="en_US.UTF-8"
>>> +BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
>>> +BR2_TARGET_GENERIC_GETTY_PORT="hvc0"
>>> +BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
>>> +BR2_PACKAGE_LINUX_FIRMWARE=y
>>> +BR2_PACKAGE_LINUX_FIRMWARE_BNX2X=y
>>> +BR2_PACKAGE_LINUX_FIRMWARE_CXGB4=y
>>> +BR2_PACKAGE_NCURSES_WCHAR=y
>>
>> Is this needed?
>
> Yes, we need this to display boot labels that contain non-ASCII
> characters. Fedora uses "Schr?dinger?s cat", for example...
Doesn't sound really essential, but probably OK.
>
>>> +BR2_PACKAGE_DROPBEAR=y
>>
>> Is this useful?
>>
>>> +# BR2_PACKAGE_DROPBEAR_SERVER is not set
>>> +BR2_PACKAGE_ETHTOOL=y
>>
>> Is this useful?
>>
>>> +BR2_PACKAGE_NETCAT=y
>>
>> Is this useful?
>>
>>> +BR2_PACKAGE_RSYNC=y
>>
>> Is this useful?
>
> We've found that these four utilities have been very useful in debugging
> boot issues; dropbear, netcat and rsync for remote access / file
> transfer, and ethtool for network-device firmware management.
>
> However, if we want to keep the defconfig as minimal as possible (rather
> than the configuration that I've assumed users will generally need), we
> can remove these.
Yes, we try to have minimal defconfigs.
It would also be nice to create board/qemu/ppc64-pseries/readme-petitboot.txt
that explains how you can run this defconfig.
I guess petitboot takes some kind of configuration file that specifies what
you're going to boot into. It would be nice to have in the readme an example of
how you can boot into another buildroot image (e.g. qemu_ppc64_pseries_defconfig).
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 25+ messages in thread
* [Buildroot] [PATCH 2/7 v3] package/dropbear: Add separate configuration option for dropbear server
2014-06-17 5:21 [Buildroot] [PATCH 0/7 v3] Enable a buildroot-based petitboot bootloader Jeremy Kerr
` (2 preceding siblings ...)
2014-06-17 5:21 ` [Buildroot] [PATCH 7/7 v3] Add powerpc64 petitboot defconfig Jeremy Kerr
@ 2014-06-17 5:21 ` Jeremy Kerr
2014-07-17 19:44 ` Gustavo Zacarias
2014-06-17 5:21 ` [Buildroot] [PATCH 6/7 v3] package/petitboot: Add petitboot, the userspace bootloader Jeremy Kerr
` (2 subsequent siblings)
6 siblings, 1 reply; 25+ messages in thread
From: Jeremy Kerr @ 2014-06-17 5:21 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 3a39169..4fa26da 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
mkdir -p $(TARGET_DIR)/etc/dropbear
^ permalink raw reply related [flat|nested] 25+ messages in thread* [Buildroot] [PATCH 2/7 v3] package/dropbear: Add separate configuration option for dropbear server
2014-06-17 5:21 ` [Buildroot] [PATCH 2/7 v3] package/dropbear: Add separate configuration option for dropbear server Jeremy Kerr
@ 2014-07-17 19:44 ` Gustavo Zacarias
2014-07-23 21:50 ` Thomas Petazzoni
0 siblings, 1 reply; 25+ messages in thread
From: Gustavo Zacarias @ 2014-07-17 19:44 UTC (permalink / raw)
To: buildroot
On 06/17/2014 02:21 AM, Jeremy Kerr wrote:
> 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.
Hi.
This can be disabled in a post build script by removing the initscript
directly.
If it were a build option that saves space in the target i'd say yay,
but it's not.
And it's a slippery rope since the same could be said/done to countless
other packages that have client-server functionality like openssh,
netsnmp, openvpn and so on.
Others might disagree with me of course.
Regards.
^ permalink raw reply [flat|nested] 25+ messages in thread
* [Buildroot] [PATCH 2/7 v3] package/dropbear: Add separate configuration option for dropbear server
2014-07-17 19:44 ` Gustavo Zacarias
@ 2014-07-23 21:50 ` Thomas Petazzoni
0 siblings, 0 replies; 25+ messages in thread
From: Thomas Petazzoni @ 2014-07-23 21:50 UTC (permalink / raw)
To: buildroot
Dear Gustavo Zacarias,
On Thu, 17 Jul 2014 16:44:37 -0300, Gustavo Zacarias wrote:
> This can be disabled in a post build script by removing the initscript
> directly.
> If it were a build option that saves space in the target i'd say yay,
> but it's not.
> And it's a slippery rope since the same could be said/done to countless
> other packages that have client-server functionality like openssh,
> netsnmp, openvpn and so on.
> Others might disagree with me of course.
Agreed. Therefore, I've marked the patch as rejected in patchwork.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 25+ messages in thread
* [Buildroot] [PATCH 6/7 v3] package/petitboot: Add petitboot, the userspace bootloader
2014-06-17 5:21 [Buildroot] [PATCH 0/7 v3] Enable a buildroot-based petitboot bootloader Jeremy Kerr
` (3 preceding siblings ...)
2014-06-17 5:21 ` [Buildroot] [PATCH 2/7 v3] package/dropbear: Add separate configuration option for dropbear server Jeremy Kerr
@ 2014-06-17 5:21 ` Jeremy Kerr
2014-10-12 14:55 ` Arnout Vandecappelle
2014-06-17 5:21 ` [Buildroot] [PATCH 4/7 v3] package/powerpc-utils: Add powerpc hardware utilities Jeremy Kerr
2014-06-17 5:21 ` [Buildroot] [PATCH 1/7 v3] package/busybox: Add facility for DHCP hooks Jeremy Kerr
6 siblings, 1 reply; 25+ messages in thread
From: Jeremy Kerr @ 2014-06-17 5:21 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 | 21 +++++++
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, 128 insertions(+)
diff --git a/package/Config.in b/package/Config.in
index b0d4d47..a769d33 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1116,6 +1116,7 @@ endif
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..d1e1783
--- /dev/null
+++ b/package/petitboot/Config.in
@@ -0,0 +1,21 @@
+config BR2_PACKAGE_PETITBOOT
+ bool "petitboot"
+ # petitboot needs udev /dev management
+ depends on BR2_PACKAGE_HAS_UDEV
+ select BR2_PACKAGE_NCURSES
+ select BR2_PACKAGE_NCURSES_TARGET_PANEL
+ select BR2_PACKAGE_NCURSES_TARGET_FORM
+ select BR2_PACKAGE_NCURSES_TARGET_MENU
+ # 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 || BR2_powerpc64
+ # run-time dependency only
+ select BR2_PACKAGE_IPRUTILS if BR2_powerpc || BR2_powerpc64
+ help
+ Petitboot is a small kexec-based bootloader
+
+ http://www.kernel.org/pub/linux/kernel/people/geoff/petitboot/petitboot.html
+
+comment "petitboot requires udev to be enabled"
+ depends on !BR2_PACKAGE_HAS_UDEV
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..1bbf522
--- /dev/null
+++ b/package/petitboot/petitboot.mk
@@ -0,0 +1,57 @@
+################################################################################
+#
+# petitboot
+#
+################################################################################
+
+PETITBOOT_VERSION = 509fca5ca2733a741521ae4332400d54d95ee073
+PETITBOOT_SITE = git://ozlabs.org/~jk/petitboot
+PETITBOOT_DEPENDENCIES = ncurses udev host-bison host-flex
+PETITBOOT_LICENSE = GPLv2
+PETITBOOT_LICENSE_FILES = COPYING
+
+PETITBOOT_AUTORECONF = YES
+PETITBOOT_AUTORECONF_OPT = -i
+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_WCHAR),y)
+PETITBOOT_CONF_OPT += --with-ncursesw MENU_LIB=-lmenuw FORM_LIB=-lformw
+endif
+
+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] 25+ messages in thread* [Buildroot] [PATCH 6/7 v3] package/petitboot: Add petitboot, the userspace bootloader
2014-06-17 5:21 ` [Buildroot] [PATCH 6/7 v3] package/petitboot: Add petitboot, the userspace bootloader Jeremy Kerr
@ 2014-10-12 14:55 ` Arnout Vandecappelle
2014-10-20 3:22 ` Jeremy Kerr
0 siblings, 1 reply; 25+ messages in thread
From: Arnout Vandecappelle @ 2014-10-12 14:55 UTC (permalink / raw)
To: buildroot
Hi Jeremy,
On 17/06/14 07:21, Jeremy Kerr wrote:
> 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 | 21 +++++++
> 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, 128 insertions(+)
>
> diff --git a/package/Config.in b/package/Config.in
> index b0d4d47..a769d33 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1116,6 +1116,7 @@ endif
> 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..d1e1783
> --- /dev/null
> +++ b/package/petitboot/Config.in
> @@ -0,0 +1,21 @@
> +config BR2_PACKAGE_PETITBOOT
> + bool "petitboot"
> + # petitboot needs udev /dev management
> + depends on BR2_PACKAGE_HAS_UDEV
It looks to me that it also relies on udhcpc, which would mean you need to
depend on BUSYBOX. But of course, the thing still works even without udhcpc, it
would just not react to dhcp/bootp, right?
> + select BR2_PACKAGE_NCURSES
> + select BR2_PACKAGE_NCURSES_TARGET_PANEL
> + select BR2_PACKAGE_NCURSES_TARGET_FORM
> + select BR2_PACKAGE_NCURSES_TARGET_MENU
> + # 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 || BR2_powerpc64
> + # run-time dependency only
> + select BR2_PACKAGE_IPRUTILS if BR2_powerpc || BR2_powerpc64
> + help
> + Petitboot is a small kexec-based bootloader
We probably want a little more explanation about how you can use petitboot,
i.e. make a very small buildroot config with just petitboot and an initramfs
filesystem, and use that to boot a full-fledged system which doesn't even need
to be buildroot-based.
> +
> + http://www.kernel.org/pub/linux/kernel/people/geoff/petitboot/petitboot.html
> +
> +comment "petitboot requires udev to be enabled"
> + depends on !BR2_PACKAGE_HAS_UDEV
> 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
Why is this needed? I mean, we could do this in general in buildroot but do we
really want it?
> +
> +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
Why are we not using start-stop-daemon here like in all other init scripts?
> + ;;
> + *)
> + 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
Can you shed some light about why this script is needed and why it's not part
of petitboot itself?
> 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"
It would make a lot more sense to me to use BR2_TARGET_GENERIC_GETTY_PORT and
leave it up to the user to update the ui-rules for his particular configuration,
if necessary.
> diff --git a/package/petitboot/petitboot.mk b/package/petitboot/petitboot.mk
> new file mode 100644
> index 0000000..1bbf522
> --- /dev/null
> +++ b/package/petitboot/petitboot.mk
> @@ -0,0 +1,57 @@
> +################################################################################
> +#
> +# petitboot
> +#
> +################################################################################
> +
> +PETITBOOT_VERSION = 509fca5ca2733a741521ae4332400d54d95ee073
> +PETITBOOT_SITE = git://ozlabs.org/~jk/petitboot
> +PETITBOOT_DEPENDENCIES = ncurses udev host-bison host-flex
> +PETITBOOT_LICENSE = GPLv2
> +PETITBOOT_LICENSE_FILES = COPYING
> +
> +PETITBOOT_AUTORECONF = YES
> +PETITBOOT_AUTORECONF_OPT = -i
> +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)
Indentation should be just a single tab.
With so many options, I prefer one per line. But that's just nitpicking.
> +
> +ifdef PETITBOOT_DEBUG
> +PETITBOOT_CONF_OPT += --enable-debug
> +endif
I guess these three lines should be removed?
> +
> +ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
> +PETITBOOT_CONF_OPT += --with-ncursesw MENU_LIB=-lmenuw FORM_LIB=-lformw
> +endif
> +
> +PETITBOOT_PRE_CONFIGURE_HOOKS += PETITBOOT_PRE_CONFIGURE_BOOTSTRAP
PETITBOOT_PRE_CONFIGURE_BOOTSTRAP doesn't seem to be defined.
> +
> +define PETITBOOT_POST_INSTALL
Instead of _POST_INSTALL, we generally use more specific names like
PETITBOOT_INSTALL_CONFIG_AND_SCRIPTS. But again, that's just nitpicking.
> + $(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/
These should be installed using the PETITBOOT_INSTALL_INIT_SYSV commands. Not
that it's very likely that someone will use petitboot+systemd, but who knows...
> + $(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/
Even though after patch 1/7 this directory is created in busybox, you should
still create the directory here as well. Especially because you don't depend on
busybox so it may not have been created yet.
> +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"
Why is this not part of petitboot itself?
Regards,
Arnout
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 25+ messages in thread* [Buildroot] [PATCH 6/7 v3] package/petitboot: Add petitboot, the userspace bootloader
2014-10-12 14:55 ` Arnout Vandecappelle
@ 2014-10-20 3:22 ` Jeremy Kerr
2014-10-21 21:19 ` Arnout Vandecappelle
0 siblings, 1 reply; 25+ messages in thread
From: Jeremy Kerr @ 2014-10-20 3:22 UTC (permalink / raw)
To: buildroot
Hi Arnout,
Thanks for taking a look at this!
>> diff --git a/package/petitboot/Config.in b/package/petitboot/Config.in
>> new file mode 100644
>> index 0000000..d1e1783
>> --- /dev/null
>> +++ b/package/petitboot/Config.in
>> @@ -0,0 +1,21 @@
>> +config BR2_PACKAGE_PETITBOOT
>> + bool "petitboot"
>> + # petitboot needs udev /dev management
>> + depends on BR2_PACKAGE_HAS_UDEV
>
> It looks to me that it also relies on udhcpc, which would mean you need to
> depend on BUSYBOX. But of course, the thing still works even without udhcpc, it
> would just not react to dhcp/bootp, right?
That's correct; local boot would still work fine without a DHCP client.
>> + select BR2_PACKAGE_NCURSES
>> + select BR2_PACKAGE_NCURSES_TARGET_PANEL
>> + select BR2_PACKAGE_NCURSES_TARGET_FORM
>> + select BR2_PACKAGE_NCURSES_TARGET_MENU
>> + # 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 || BR2_powerpc64
>> + # run-time dependency only
>> + select BR2_PACKAGE_IPRUTILS if BR2_powerpc || BR2_powerpc64
>> + help
>> + Petitboot is a small kexec-based bootloader
>
> We probably want a little more explanation about how you can use petitboot,
> i.e. make a very small buildroot config with just petitboot and an initramfs
> filesystem, and use that to boot a full-fledged system which doesn't even need
> to be buildroot-based.
You mean just in the help section here?
>> 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
>
> Why is this needed? I mean, we could do this in general in buildroot but do we
> really want it?
Since the ncurses-based petitboot UI is brought up on init on local
serial consoles, we want to suppress kernel printk output, otherwise
it'll corrupt the ncurses terminal state.
>> --- /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
>
> Why are we not using start-stop-daemon here like in all other init scripts?
No reason at all, I'll update this :)
>> 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
>
> Can you shed some light about why this script is needed and why it's not part
> of petitboot itself?
This script is used as busybox init's "restart" action, and is called by
init, once all processes have been stopped.
It needs to be invoked by init, as petitboot is no longer running at
this point. Because it's specific to buildroot with busybox init, I
haven't included the script in the petitboot distribution.
>> 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"
>
> It would make a lot more sense to me to use BR2_TARGET_GENERIC_GETTY_PORT and
> leave it up to the user to update the ui-rules for his particular configuration,
> if necessary.
What do you mean by the ui-rules here? Is this something that could
still be defined in the general busybox config?
>> diff --git a/package/petitboot/petitboot.mk b/package/petitboot/petitboot.mk
>> new file mode 100644
>> index 0000000..1bbf522
>> --- /dev/null
>> +++ b/package/petitboot/petitboot.mk
>> @@ -0,0 +1,57 @@
>> +################################################################################
>> +#
>> +# petitboot
>> +#
>> +################################################################################
>> +
>> +PETITBOOT_VERSION = 509fca5ca2733a741521ae4332400d54d95ee073
>> +PETITBOOT_SITE = git://ozlabs.org/~jk/petitboot
>> +PETITBOOT_DEPENDENCIES = ncurses udev host-bison host-flex
>> +PETITBOOT_LICENSE = GPLv2
>> +PETITBOOT_LICENSE_FILES = COPYING
>> +
>> +PETITBOOT_AUTORECONF = YES
>> +PETITBOOT_AUTORECONF_OPT = -i
>> +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)
>
> Indentation should be just a single tab.
>
> With so many options, I prefer one per line. But that's just nitpicking.
Makes sense, I'll update.
>
>> +
>> +ifdef PETITBOOT_DEBUG
>> +PETITBOOT_CONF_OPT += --enable-debug
>> +endif
>
> I guess these three lines should be removed?
I've been using this to allow a single way of building a debug petitboot
system:
make ... PETITBOOT_DEBUG=1
However, petitboot now allows debug selection at runtime, so this is no
longer really required. I'll remove it.
>
>> +
>> +ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
>> +PETITBOOT_CONF_OPT += --with-ncursesw MENU_LIB=-lmenuw FORM_LIB=-lformw
>> +endif
>> +
>> +PETITBOOT_PRE_CONFIGURE_HOOKS += PETITBOOT_PRE_CONFIGURE_BOOTSTRAP
>
> PETITBOOT_PRE_CONFIGURE_BOOTSTRAP doesn't seem to be defined.
>
>> +
>> +define PETITBOOT_POST_INSTALL
>
> Instead of _POST_INSTALL, we generally use more specific names like
> PETITBOOT_INSTALL_CONFIG_AND_SCRIPTS. But again, that's just nitpicking.
OK, makes sense.
>
>> + $(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/
>
> These should be installed using the PETITBOOT_INSTALL_INIT_SYSV commands. Not
> that it's very likely that someone will use petitboot+systemd, but who knows...
ok, neat.
>
>> + $(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/
>
> Even though after patch 1/7 this directory is created in busybox, you should
> still create the directory here as well. Especially because you don't depend on
> busybox so it may not have been created yet.
Sure, OK.
>
>> +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"
>
> Why is this not part of petitboot itself?
You mean the file should be shipped with petitboot? or that the sysfs
attribute should be set directly by petitboot instead of udev?
This configuration is only required when petitboot is running on
buildroot; other OSes generally have this attribute set already. Because
it's somewhat OS-dependent, I haven't included it in generic petitboot.
Cheers,
Jeremy
^ permalink raw reply [flat|nested] 25+ messages in thread* [Buildroot] [PATCH 6/7 v3] package/petitboot: Add petitboot, the userspace bootloader
2014-10-20 3:22 ` Jeremy Kerr
@ 2014-10-21 21:19 ` Arnout Vandecappelle
0 siblings, 0 replies; 25+ messages in thread
From: Arnout Vandecappelle @ 2014-10-21 21:19 UTC (permalink / raw)
To: buildroot
On 20/10/14 05:22, Jeremy Kerr wrote:
> Hi Arnout,
>
[snip]
>>> + help
>>> + Petitboot is a small kexec-based bootloader
>>
>> We probably want a little more explanation about how you can use petitboot,
>> i.e. make a very small buildroot config with just petitboot and an initramfs
>> filesystem, and use that to boot a full-fledged system which doesn't even need
>> to be buildroot-based.
>
> You mean just in the help section here?
Yes, I mean in the help section. Petitboot is pretty special, because it's not
just a package that you install in your buildroot-generated rootfs and that you
use at runtime, but it's also not a bootloader in the buildroot sense. This
should be clarified somewhere, and the help text is probably the best place.
>>> 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
>>
>> Why is this needed? I mean, we could do this in general in buildroot but do we
>> really want it?
>
> Since the ncurses-based petitboot UI is brought up on init on local
> serial consoles, we want to suppress kernel printk output, otherwise
> it'll corrupt the ncurses terminal state.
OK I see. Could you add an explanatory comment?
But does this work? udev is already started before (S10 in case of eudev, and
systemd starts it almost immediately). So it's possible that the pb-console is
already started before you do this printk. So I think this should be in S07 or
something.
[snip]
>>> 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
>>
>> Can you shed some light about why this script is needed and why it's not part
>> of petitboot itself?
>
> This script is used as busybox init's "restart" action, and is called by
> init, once all processes have been stopped.
>
> It needs to be invoked by init, as petitboot is no longer running at
> this point. Because it's specific to buildroot with busybox init, I
> haven't included the script in the petitboot distribution.
OK. Then its installation should also only be done if the init system is
busybox, and probably you'll need to fixup inittab so the restart action is
actually included.
>
>>> 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"
>>
>> It would make a lot more sense to me to use BR2_TARGET_GENERIC_GETTY_PORT and
>> leave it up to the user to update the ui-rules for his particular configuration,
>> if necessary.
>
> What do you mean by the ui-rules here?
I mean: if the user wants to launch the pb-console on more than one port, then
they should install a custom petitboot-console-ui.rules file in their overlay.
> Is this something that could
> still be defined in the general busybox config?
Yes, petitboot-console-ui.rules could be simplified to
SUBSYSTEM=="tty", KERNEL=="@GETTY_PORT@",
RUN+="/usr/libexec/petitboot/pb-console --getty --detach -- -n -i 0 $name vt100"
and during installation you sed the @GETTY_PORT@ into BR2_TARGET_GENERIC_GETTY_PORT.
Of course, only if that is defined.
Oh and BTW in that case the getty line should also be removed from inittab. So
you'd be fighting against the finalize hook that adds that getty line... Hmm, tough.
Perhaps the solution is to depend on !BR2_TARGET_GENERIC_GETTY (and add an
appropriate comment to Config.in) and to add the equivalent options to the
petitboot Config.in file.
>
>>> diff --git a/package/petitboot/petitboot.mk b/package/petitboot/petitboot.mk
>>> new file mode 100644
>>> index 0000000..1bbf522
>>> --- /dev/null
>>> +++ b/package/petitboot/petitboot.mk
>>> @@ -0,0 +1,57 @@
>>> +################################################################################
>>> +#
>>> +# petitboot
>>> +#
>>> +################################################################################
>>> +
>>> +PETITBOOT_VERSION = 509fca5ca2733a741521ae4332400d54d95ee073
>>> +PETITBOOT_SITE = git://ozlabs.org/~jk/petitboot
>>> +PETITBOOT_DEPENDENCIES = ncurses udev host-bison host-flex
BTW, when the initscripts package is merged, you'll probably have to depend on
that, because you need to fix up the init scripts.
>>> +PETITBOOT_LICENSE = GPLv2
>>> +PETITBOOT_LICENSE_FILES = COPYING
>>> +
>>> +PETITBOOT_AUTORECONF = YES
>>> +PETITBOOT_AUTORECONF_OPT = -i
>>> +PETITBOOT_CONF_OPT += --with-ncurses --without-twin-x11 --without-twin-fbdev \
_OPT has now been renamed to _OPTS.
>>> + --localstatedir=/var \
localstatedir=/var is now passed automatically.
>>> + HOST_PROG_KEXEC=/usr/sbin/kexec \
>>> + HOST_PROG_SHUTDOWN=/usr/libexec/petitboot/bb-kexec-reboot \
>>> + $(if $(BR2_PACKAGE_BUSYBOX),--with-tftp=busybox)
[snip]
I'm afraid that petitboot is something so intrusive that it will take us a
while to get it working well (much like the problems we have with systemd). The
defconfig that you provide already helps a lot, though.
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 25+ messages in thread
* [Buildroot] [PATCH 4/7 v3] package/powerpc-utils: Add powerpc hardware utilities
2014-06-17 5:21 [Buildroot] [PATCH 0/7 v3] Enable a buildroot-based petitboot bootloader Jeremy Kerr
` (4 preceding siblings ...)
2014-06-17 5:21 ` [Buildroot] [PATCH 6/7 v3] package/petitboot: Add petitboot, the userspace bootloader Jeremy Kerr
@ 2014-06-17 5:21 ` Jeremy Kerr
2014-07-17 21:07 ` Thomas Petazzoni
2014-06-17 5:21 ` [Buildroot] [PATCH 1/7 v3] package/busybox: Add facility for DHCP hooks Jeremy Kerr
6 siblings, 1 reply; 25+ messages in thread
From: Jeremy Kerr @ 2014-06-17 5:21 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.mk | 16 ++++++++++++++++
3 files changed, 22 insertions(+)
diff --git a/package/Config.in b/package/Config.in
index f43e985..125f3f0 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1115,6 +1115,7 @@ endif
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-ng/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.mk b/package/powerpc-utils/powerpc-utils.mk
new file mode 100644
index 0000000..c9cc096
--- /dev/null
+++ b/package/powerpc-utils/powerpc-utils.mk
@@ -0,0 +1,16 @@
+################################################################################
+#
+# powerpc-utils
+#
+################################################################################
+
+POWERPC_UTILS_VERSION = v1.4
+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] 25+ messages in thread* [Buildroot] [PATCH 4/7 v3] package/powerpc-utils: Add powerpc hardware utilities
2014-06-17 5:21 ` [Buildroot] [PATCH 4/7 v3] package/powerpc-utils: Add powerpc hardware utilities Jeremy Kerr
@ 2014-07-17 21:07 ` Thomas Petazzoni
0 siblings, 0 replies; 25+ messages in thread
From: Thomas Petazzoni @ 2014-07-17 21:07 UTC (permalink / raw)
To: buildroot
Dear Jeremy Kerr,
On Tue, 17 Jun 2014 13:21:47 +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.
>
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Thanks, applied with minor changes, as outlined in the commit log:
[Thomas:
- Add dependency on PowerPC architecture in Config.in.
- Add homepage in Config.in help text.]
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 25+ messages in thread
* [Buildroot] [PATCH 1/7 v3] package/busybox: Add facility for DHCP hooks
2014-06-17 5:21 [Buildroot] [PATCH 0/7 v3] Enable a buildroot-based petitboot bootloader Jeremy Kerr
` (5 preceding siblings ...)
2014-06-17 5:21 ` [Buildroot] [PATCH 4/7 v3] package/powerpc-utils: Add powerpc hardware utilities Jeremy Kerr
@ 2014-06-17 5:21 ` Jeremy Kerr
2014-07-23 21:58 ` Yann E. MORIN
` (2 more replies)
6 siblings, 3 replies; 25+ messages in thread
From: Jeremy Kerr @ 2014-06-17 5:21 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 c368b80..bddeb63 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -222,6 +222,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] 25+ messages in thread* [Buildroot] [PATCH 1/7 v3] package/busybox: Add facility for DHCP hooks
2014-06-17 5:21 ` [Buildroot] [PATCH 1/7 v3] package/busybox: Add facility for DHCP hooks Jeremy Kerr
@ 2014-07-23 21:58 ` Yann E. MORIN
2014-10-12 14:14 ` Arnout Vandecappelle
2015-01-02 18:28 ` Thomas Petazzoni
2 siblings, 0 replies; 25+ messages in thread
From: Yann E. MORIN @ 2014-07-23 21:58 UTC (permalink / raw)
To: buildroot
Jeremy, All,
On 2014-06-17 13:21 +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>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Regards,
Yann E. MORIN.
> ---
> 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 c368b80..bddeb63 100644
> --- a/package/busybox/busybox.mk
> +++ b/package/busybox/busybox.mk
> @@ -222,6 +222,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
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| 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] 25+ messages in thread* [Buildroot] [PATCH 1/7 v3] package/busybox: Add facility for DHCP hooks
2014-06-17 5:21 ` [Buildroot] [PATCH 1/7 v3] package/busybox: Add facility for DHCP hooks Jeremy Kerr
2014-07-23 21:58 ` Yann E. MORIN
@ 2014-10-12 14:14 ` Arnout Vandecappelle
2015-01-02 18:28 ` Thomas Petazzoni
2 siblings, 0 replies; 25+ messages in thread
From: Arnout Vandecappelle @ 2014-10-12 14:14 UTC (permalink / raw)
To: buildroot
On 17/06/14 07:21, Jeremy Kerr wrote:
> 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>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
I could do some nitpicking but it's good enough as it is.
Regards,
Arnout
>
> ---
> 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 c368b80..bddeb63 100644
> --- a/package/busybox/busybox.mk
> +++ b/package/busybox/busybox.mk
> @@ -222,6 +222,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
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 25+ messages in thread* [Buildroot] [PATCH 1/7 v3] package/busybox: Add facility for DHCP hooks
2014-06-17 5:21 ` [Buildroot] [PATCH 1/7 v3] package/busybox: Add facility for DHCP hooks Jeremy Kerr
2014-07-23 21:58 ` Yann E. MORIN
2014-10-12 14:14 ` Arnout Vandecappelle
@ 2015-01-02 18:28 ` Thomas Petazzoni
2 siblings, 0 replies; 25+ messages in thread
From: Thomas Petazzoni @ 2015-01-02 18:28 UTC (permalink / raw)
To: buildroot
Dear Jeremy Kerr,
On Tue, 17 Jun 2014 13:21:47 +0800, Jeremy Kerr wrote:
> 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>
Thanks, applied after reworking on top of the latest Buildroot.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 25+ messages in thread