Improve powerpc-utils with librtas
v2 cover Improve powerpc-utils with librtas
Many useful functions are missing from powerpc-utils when built by buildroot, because they depend on librtas which is not included.
This set adds the librtas package, a small patch to fix a problem with it's make install target, and tweaks the powerpc-utils config to include it. This makes the following additional programs available from powerpc-utils:
* uesensor
* set_poweron_time
* drmgr
* lsslot
* activate_firmware
* rtas_ibm_get_vpd
* serv_config
* rtas_event_decode
* sys_ident
Changes v1 -> v2:
Patch 1/2: librtas: new package
Remove redundant INSTALL_TARGET=yes.
Add patch description and patch signed-off-by.
Rename patch with correct prefix (0001-).
Patch 2/2: powerpc-utils: optionally use librtas
Make librtas support in powerpc-utils optional due to size concerns.
Sam Bobroff (2):
librtas: new package
powerpc-utils: optionally use librtas
package/Config.in | 1 + ...0001-librtas-install-librtas.so.1-symlink.patch | 31 ++++++++++++++++++++ package/librtas/Config.in | 9 ++++++ package/librtas/librtas.mk | 26 ++++++++++++++++ package/powerpc-utils/Config.in | 18 ++++++++++++ package/powerpc-utils/powerpc-utils.mk | 5 ++++ 6 files changed, 90 insertions(+) create mode 100644 package/librtas/0001-librtas-install-librtas.so.1-symlink.patch create mode 100644 package/librtas/Config.in create mode 100644 package/librtas/librtas.mk
Signature · 1 line
1.7.10.4
PATCH v2 1/2 librtas: new package
---
v2:
Remove redundant INSTALL_TARGET=yes.
Add patch description and patch signed-off-by.
Rename patch with correct prefix (0001-).
package/Config.in | 1 + ...0001-librtas-install-librtas.so.1-symlink.patch | 31 ++++++++++++++++++++ package/librtas/Config.in | 9 ++++++ package/librtas/librtas.mk | 26 ++++++++++++++++ 4 files changed, 67 insertions(+) create mode 100644 package/librtas/0001-librtas-install-librtas.so.1-symlink.patch create mode 100644 package/librtas/Config.in create mode 100644 package/librtas/librtas.mk
package/Config.in +1 -0
@@ -832,6 +832,7 @@ menu "Hardware handling" source "package/libphidget/Config.in" source "package/libqmi/Config.in" source "package/libraw1394/Config.in" + source "package/librtas/Config.in" source "package/librtlsdr/Config.in" source "package/libserial/Config.in" source "package/libserialport/Config.in"
package/librtas/0001-librtas-install-librtas.so.1-symlink.patch new file +31 -0
@@ -0,0 +1,31 @@ +Add a line to the librtas Makefile to create librtas.so.1 when +performing "make install". + +Without this patch programs linked with librtas will fail at run time: + +error while loading shared libraries: librtas.so.1: cannot open shared +object file: No such file or directory + +A patch has been submitted upstream so it is likely that this patch +can be dropped after the next release of librtas. + +Signed-off-by: Sam Bobroff <[email protected]> +--- + librtas_src/Makefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/librtas_src/Makefile b/librtas_src/Makefile +index 3a10222..deba29d 100644 +--- a/librtas_src/Makefile ++++ b/librtas_src/Makefile +@@ -33,6 +33,7 @@ install: + @$(call install_lib,$(LIBRTAS),$(DESTDIR)) + @$(call install_inc,$(HEADERS),$(DESTDIR)) + @ln -sf $(LIBRTAS) $(DESTDIR)/$(LIB_DIR)$(call is_lib64,$(LIBRTAS))/$(LIBRTAS_SONAME) ++ @ln -sf $(LIBRTAS) $(DESTDIR)/$(LIB_DIR)$(call is_lib64,$(LIBRTAS))/$(LIBRTAS_SONAME).1 + + uninstall: + @$(call uninstall_lib,$(LIBRTAS),$(DESTDIR)) +-- +1.7.10.4 +
package/librtas/Config.in new file +9 -0
@@ -0,0 +1,9 @@ +config BR2_PACKAGE_LIBRTAS + bool "librtas" + depends on BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le + help + The librtas package provides an interface for Run-Time Abstraction + Services (RTAS) calls on PAPR platforms. The libraries allow users to + examine and manipulate hardware, and parse RTAS events. + + http://librtas.sourceforge.net/
package/librtas/librtas.mk new file +26 -0
@@ -0,0 +1,26 @@ +################################################################################ +# +# librtas +# +################################################################################ + +LIBRTAS_VERSION = 1.3.13 +LIBRTAS_SITE = http://downloads.sourceforge.net/project/librtas +LIBRTAS_LICENSE = Common Public License Version 1.0 +LIBRTAS_LICENSE_FILES = COPYRIGHT +LIBRTAS_INSTALL_STAGING = YES + +define LIBRTAS_BUILD_CMDS + $(MAKE) -C $(@D) CC="$(TARGET_CC)" LD="$(TARGET_LD)" +endef + +define LIBRTAS_INSTALL_STAGING_CMDS + $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install +endef + +define LIBRTAS_INSTALL_TARGET_CMDS + $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install +endef + + +$(eval $(generic-package))
Signature · 1 line
1.7.10.4
PATCH v2 2/2 powerpc-utils: optionally use librtas
In reply to Sam BobroffNow that librtas is available, optionally use it with powerpc-utils to enable it's RTAS dependant functionality. It is used by default, as most distros do, but made optional because it adds several new programs and significantly increases the size of the installed package.
---
v2:
Make librtas support in powerpc-utils optional due to size concerns.
package/powerpc-utils/Config.in | 18 ++++++++++++++++++ package/powerpc-utils/powerpc-utils.mk | 5 +++++ 2 files changed, 23 insertions(+)
package/powerpc-utils/Config.in +18 -0
@@ -6,3 +6,21 @@ config BR2_PACKAGE_POWERPC_UTILS System utilities for PowerPC machines. http://sourceforge.net/projects/powerpc-utils/ + +if BR2_PACKAGE_POWERPC_UTILS + +config BR2_PACKAGE_POWERPC_UTILS_RTAS + bool "RTAS support" + select BR2_PACKAGE_LIBRTAS + default y + help + Enable support for functions that require RTAS. + + This adds a dependency on librtas and provides the following + additional features at the cost of increasing the installed package + size from about 0.5MB to about 2MB: + ppc64_cpu --run-mode, uesensor, set_poweron_time, drmgr, lsslot, + activate_firmware, rtas_ibm_get_vpd, serv_config, + rtas_event_decode, sys_ident. + +endif
package/powerpc-utils/powerpc-utils.mk +5 -0
@@ -7,10 +7,15 @@ POWERPC_UTILS_VERSION = 1.2.24 POWERPC_UTILS_SITE = http://downloads.sourceforge.net/project/powerpc-utils/powerpc-utils POWERPC_UTILS_DEPENDENCIES = zlib +ifeq ($(BR2_PACKAGE_POWERPC_UTILS_RTAS),y) +POWERPC_UTILS_DEPENDENCIES += librtas +endif POWERPC_UTILS_LICENSE = Common Public License Version 1.0 POWERPC_UTILS_LICENSE_FILES = COPYRIGHT +ifeq ($(BR2_PACKAGE_POWERPC_UTILS_RTAS),) POWERPC_UTILS_CONF_OPTS = --without-librtas +endif POWERPC_UTILS_CONF_ENV = \ ax_cv_check_cflags___fstack_protector_all=$(if $(BR2_TOOLCHAIN_HAS_SSP),yes,no)
Signature · 1 line
1.7.10.4
PATCH v2 2/2 powerpc-utils: optionally use librtas
Hi Sam,
Quoted 7 lines · Sam Bobroff
package/powerpc-utils/powerpc-utils.mk +0
-0@@ -7,10 +7,15 @@ POWERPC_UTILS_VERSION = 1.2.24 POWERPC_UTILS_SITE = http://downloads.sourceforge.net/project/powerpc-utils/powerpc-utils
package/powerpc-utils/powerpc-utils.mk line 18
Quoted 10 lines
package/powerpc-utils/powerpc-utils.mk +5
-0POWERPC_UTILS_DEPENDENCIES = zlib +ifeq ($(BR2_PACKAGE_POWERPC_UTILS_RTAS),y) +POWERPC_UTILS_DEPENDENCIES += librtas +endif POWERPC_UTILS_LICENSE = Common Public License Version 1.0 POWERPC_UTILS_LICENSE_FILES = COPYRIGHT +ifeq ($(BR2_PACKAGE_POWERPC_UTILS_RTAS),) POWERPC_UTILS_CONF_OPTS = --without-librtas +endif
The usual convention is to put dependency handling in one place, and to have both "with" and "without".
ifeq ($(BR2_PACKAGE_POWERPC_UTILS_RTAS),y)POWERPC_UTILS_DEPENDENCIES += librtasPOWERPC_UTILS_CONF_OPTS = --with-librtas
elsePOWERPC_UTILS_CONF_OPTS = --without-librtas
endif
baruch
Signature · 3 lines
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -PATCH v2 2/2 powerpc-utils: optionally use librtas
Quoted 24 lines · Baruch Siach
Hi Sam,
Quoted 7 lines · Sam Bobroff
package/powerpc-utils/powerpc-utils.mk +0
-0@@ -7,10 +7,15 @@ POWERPC_UTILS_VERSION = 1.2.24 POWERPC_UTILS_SITE = http://downloads.sourceforge.net/project/powerpc-utils/powerpc-utilspackage/powerpc-utils/powerpc-utils.mk line 18
Quoted 10 lines
package/powerpc-utils/powerpc-utils.mk +5
-0POWERPC_UTILS_DEPENDENCIES = zlib +ifeq ($(BR2_PACKAGE_POWERPC_UTILS_RTAS),y) +POWERPC_UTILS_DEPENDENCIES += librtas +endif POWERPC_UTILS_LICENSE = Common Public License Version 1.0 POWERPC_UTILS_LICENSE_FILES = COPYRIGHT +ifeq ($(BR2_PACKAGE_POWERPC_UTILS_RTAS),) POWERPC_UTILS_CONF_OPTS = --without-librtas +endifThe usual convention is to put dependency handling in one place, and to have both "with" and "without".
Quoted 8 lines
ifeq ($(BR2_PACKAGE_POWERPC_UTILS_RTAS),y)
POWERPC_UTILS_DEPENDENCIES+= librtasPOWERPC_UTILS_CONF_OPTS= --with-librtas
elsePOWERPC_UTILS_CONF_OPTS= --without-librtas
endifbaruch
OK. Will do.
Thanks,
Sam.