diff mbox series

[v3,3/4] lmbench: emulate --prefix to avoid scattering binaries all over

Message ID 20210510180049.61421-5-vgupta@synopsys.com
State New
Headers show
Series None | expand

Commit Message

Vineet Gupta May 10, 2021, 6 p.m. UTC
- moves all lmbench binaries to <target>/lmbench/bin/<ARCH>
 - scripts copied to <target>/lmbench/scripts
 - scripts/os overwritten to setup "OS" as expected by LMBench runtime scripts

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
 package/lmbench/lmbench.mk | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Thomas Petazzoni May 10, 2021, 8:09 p.m. UTC | #1
On Mon, 10 May 2021 11:00:48 -0700
Vineet Gupta via buildroot <buildroot@busybox.net> wrote:

>  - moves all lmbench binaries to <target>/lmbench/bin/<ARCH>
>  - scripts copied to <target>/lmbench/scripts
>  - scripts/os overwritten to setup "OS" as expected by LMBench runtime scripts
> 
> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

Where are lmbench binaries currently installed? Because /lmbench/ looks
really really odd as an installation location.

Thomas
Vineet Gupta May 10, 2021, 8:22 p.m. UTC | #2
On 5/10/21 1:09 PM, Thomas Petazzoni wrote:
> On Mon, 10 May 2021 11:00:48 -0700
> Vineet Gupta via buildroot <buildroot@busybox.net> wrote:
>
>>   - moves all lmbench binaries to <target>/lmbench/bin/<ARCH>
>>   - scripts copied to <target>/lmbench/scripts
>>   - scripts/os overwritten to setup "OS" as expected by LMBench runtime scripts
>>
>> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
> Where are lmbench binaries currently installed? Because /lmbench/ looks
> really really odd as an installation location.

They are currently scattered over in /usr/sbin I think.
Indeed /lmbench is non LSB etc, but it is one stop shop if one wanted to 
remove everything lmbench specific from target rootfs.
I guess one could do /usr/sbin/lmbench/{bin,scripts}

-Vineet
Yann E. MORIN May 17, 2021, 4:59 p.m. UTC | #3
Vineet, All,

On 2021-05-10 20:22 +0000, Vineet Gupta via buildroot spake thusly:
> On 5/10/21 1:09 PM, Thomas Petazzoni wrote:
> > On Mon, 10 May 2021 11:00:48 -0700
> > Vineet Gupta via buildroot <buildroot@busybox.net> wrote:
> >
> >>   - moves all lmbench binaries to <target>/lmbench/bin/<ARCH>
> >>   - scripts copied to <target>/lmbench/scripts
> >>   - scripts/os overwritten to setup "OS" as expected by LMBench runtime scripts
> >>
> >> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
> > Where are lmbench binaries currently installed? Because /lmbench/ looks
> > really really odd as an installation location.
> 
> They are currently scattered over in /usr/sbin I think.

    $ cat output/cat build/lmbench-3.0-a9/.files-list.txt
    lmbench,./usr/bin/bw_file_rd
    lmbench,./usr/bin/bw_mem
    lmbench,./usr/bin/bw_mmap_rd
    [...]
    lmbench,./usr/bin/stream
    lmbench,./usr/bin/timing_o
    lmbench,./usr/bin/tlb
    lmbench,./usr/lib/libmbench.a

That is, everything is in /usr/bin, except for the static library
(which gets trimmed away during tsarget-finalize anyway) which is in
/usr/lib/.

And apart from the tools and the static library, nothing else is
installed, not even a header, so the the static library is only private
to lmbench anyway.

> Indeed /lmbench is non LSB etc, but it is one stop shop if one wanted to 
> remove everything lmbench specific from target rootfs.
> I guess one could do /usr/sbin/lmbench/{bin,scripts}

But why would you want to enable lmbench, and remove it from target?

So, for me, there is no reason for this patch: lmbench already installs
everything in standard locations, and if one does not want lmbench tools
on the target, just do not enable the lmbench package to begin with.

Regards,
Yann E. MORIN.
diff mbox series

Patch

diff --git a/package/lmbench/lmbench.mk b/package/lmbench/lmbench.mk
index 2f3b19b5f820..ed075d20dafe 100644
--- a/package/lmbench/lmbench.mk
+++ b/package/lmbench/lmbench.mk
@@ -36,7 +36,14 @@  define LMBENCH_BUILD_CMDS
 endef
 
 define LMBENCH_INSTALL_TARGET_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) CFLAGS="$(TARGET_CFLAGS)" OS=$(ARCH) CC="$(TARGET_CC)" BASE=$(TARGET_DIR)/usr -C $(@D)/src install
+	mkdir -p $(TARGET_DIR)/lmbench/tmp
+	mkdir -p $(TARGET_DIR)/lmbench/scripts
+	$(TARGET_MAKE_ENV) $(MAKE) CFLAGS="$(TARGET_CFLAGS)" OS=$(ARCH) CC="$(TARGET_CC)" BASE=$(TARGET_DIR)/lmbench/tmp -C $(@D)/src install
+	mkdir -p $(TARGET_DIR)/lmbench/bin/$(ARCH)
+	mv $(TARGET_DIR)/lmbench/tmp/bin/* $(TARGET_DIR)/lmbench/bin/$(ARCH)
+	rm -rf $(TARGET_DIR)/lmbench/tmp/
+	cp -rfd $(@D)/scripts/ $(TARGET_DIR)/lmbench/.
+	echo "echo ${ARCH}" >  $(TARGET_DIR)/lmbench/scripts/os
 endef
 
 $(eval $(generic-package))