Skip to contentSkip to conversation

coreutils: Do not install uptime

PATCH New Vicente Olivert Riera 3 participants 6 messages Sep 10, 2014 – Sep 13, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 coreutils: Do not install uptime

coreutils' uptime doesn't work and its execution fails with a message like this one:

uptime: couldn't get boot time: No such file or directory

busybox and procps-ng provide a working alternative.

This is a common old problem as we can see here:

https://lists.openwrt.org/pipermail/openwrt-devel/2011-March/010006.html

---
 package/coreutils/coreutils.mk |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
package/coreutils/coreutils.mk +2 -1
index 07a1347..7457b79 100644
@@ -61,7 +61,8 @@ COREUTILS_CONF_ENV = ac_cv_c_restrict=no \
 		PERL=missing
 
 COREUTILS_CONF_OPT = --disable-rpath \
-		--enable-install-program=hostname
+		--enable-install-program=hostname \
+		--enable-no-install-program=uptime
 
 define COREUTILS_POST_INSTALL
 	# some things go in root rather than usr
Signature · 1 line
1.7.1
#1 lore raw

PATCH 2/2 procps-ng: Fix installation and take precedence over busybox

Currently procps-ng binaries are installed under $(TARGET_DIR)/usr/usr instead of $(TARGET_DIR)/usr, which would be the expected. This is caused because the default value of the --exec-prefix configure option is /usr, and Buildroot always adds --prefix=/usr to the configure option. We fix this by setting --exec-prefix to an empty value.

At the same time we make sure the procps-ng binaries have precedence over the busybox ones.

---
 package/procps-ng/procps-ng.mk |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
package/procps-ng/procps-ng.mk +10 -0
index c327b4f..cedd667 100644
@@ -13,9 +13,19 @@ PROCPS_NG_INSTALL_STAGING = YES
 
 PROCPS_NG_DEPENDENCIES = ncurses
 
+# If both procps-ng and busybox are selected, make certain procps-ng
+# wins the fight over who gets to have their utils actually installed.
+ifeq ($(BR2_PACKAGE_BUSYBOX),y)
+PROCPS_NG_DEPENDENCIES += busybox
+endif
+
 ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
 PROCPS_NG_DEPENDENCIES += gettext
 PROCPS_NG_CONF_OPT += LIBS=-lintl
 endif
 
+# We need this to make procps-ng binaries installed in $(TARGET_DIR)/usr
+# instead of $(TARGET_DIR)/usr/usr
+PROCPS_NG_CONF_OPT += --exec-prefix=
+
 $(eval $(autotools-package))
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/2 procps-ng: Fix installation and take precedence over busybox

Dear Vicente Olivert Riera,

Quoted 6 lines · Vicente Olivert Riera

Currently procps-ng binaries are installed under $(TARGET_DIR)/usr/usr instead of $(TARGET_DIR)/usr, which would be the expected. This is caused because the default value of the --exec-prefix configure option is /usr, and Buildroot always adds --prefix=/usr to the configure option. We fix this by setting --exec-prefix to an empty value.

Quoted 8 lines

At the same time we make sure the procps-ng binaries have precedence over the busybox ones.

---
 package/procps-ng/procps-ng.mk |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 2/2 procps-ng: Fix installation and take precedence over busybox

In reply to Vicente Olivert Riera
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Vicente" == Vicente Olivert Riera <[email protected]> writes:

Currently procps-ng binaries are installed under $(TARGET_DIR)/usr/usr instead of $(TARGET_DIR)/usr, which would be the expected. This is caused because the default value of the --exec-prefix configure option is /usr, and Buildroot always adds --prefix=/usr to the configure option. We fix this by setting --exec-prefix to an empty value.

Quoted 5 lines

At the same time we make sure the procps-ng binaries have precedence over the busybox ones.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 1/2 coreutils: Do not install uptime

In reply to Vicente Olivert Riera

Dear Vicente Olivert Riera,

Quoted 22 lines · Vicente Olivert Riera

coreutils' uptime doesn't work and its execution fails with a message like this one:

uptime: couldn't get boot time: No such file or directory

busybox and procps-ng provide a working alternative.

This is a common old problem as we can see here:

https://lists.openwrt.org/pipermail/openwrt-devel/2011-March/010006.html

---
 package/coreutils/coreutils.mk |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
package/coreutils/coreutils.mk +0 -0
index 07a1347..7457b79 100644

package/coreutils/coreutils.mk COREUTILS_CONF_ENV = ac_cv_c_restrict=no \ · line 65

Quoted 6 lines
package/coreutils/coreutils.mk +2 -1
@@ -61,7 +61,8 @@ COREUTILS_CONF_ENV = ac_cv_c_restrict=no \
 		PERL=missing
 
 COREUTILS_CONF_OPT = --disable-rpath \
-		--enable-install-program=hostname
+		--enable-install-program=hostname \
+		--enable-no-install-program=uptime

I think this is not the proper fix. A more appropriate fix is to actually get uptime to work, which is a oneliner. See my patch posted at http://patchwork.ozlabs.org/patch/387971/.

I'll mark your patch as Rejected in patchwork. Of course, if you disagree, feel free to turn back your patch to the "New" state with an explanation.

Thanks a lot for noticing this issue in the first place!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 1/2 coreutils: Do not install uptime

Quoted 27 lines · Thomas Petazzoni

Dear Vicente Olivert Riera,

Quoted 24 lines · Vicente Olivert Riera

coreutils' uptime doesn't work and its execution fails with a message like this one:

uptime: couldn't get boot time: No such file or directory

busybox and procps-ng provide a working alternative.

This is a common old problem as we can see here:

   https://lists.openwrt.org/pipermail/openwrt-devel/2011-March/010006.html
---
  package/coreutils/coreutils.mk |    3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)
package/coreutils/coreutils.mk +0 -0
index 07a1347..7457b79 100644
@@ -61,7 +61,8 @@ COREUTILS_CONF_ENV = ac_cv_c_restrict=no \
  		PERL=missing
 
Quoted 8 lines

package/coreutils/coreutils.mk COREUTILS_CONF_ENV = ac_cv_c_restrict=no \ · line 65

Quoted 4 lines
package/coreutils/coreutils.mk +2 -1
  COREUTILS_CONF_OPT = --disable-rpath \
-		--enable-install-program=hostname
+		--enable-install-program=hostname \
+		--enable-no-install-program=uptime

I think this is not the proper fix. A more appropriate fix is to actually get uptime to work, which is a oneliner. See my patch posted at http://patchwork.ozlabs.org/patch/387971/.

I have tested it and it works fine.

Quoted 3 lines

I'll mark your patch as Rejected in patchwork. Of course, if you disagree, feel free to turn back your patch to the "New" state with an explanation.

I don't disagree. I also think it's better to have a working coreutils' uptime instead of disabling it.

Quoted 1 line

Thanks a lot for noticing this issue in the first place!

You are welcome.

Quoted 1 line

Thomas

Signature · 1 line
Vincent