From 4c017900c85ac480292723b83c90e736ca437376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Wed, 27 Aug 2014 15:02:09 +0200 Subject: [PATCH] tools: strip rumpkernel based tools Until now, the rumpkernel based tools were installed with all symbols included. This accounts for about 200MiB used space on 64Bit system. Stripping the binaries prior to installation brings the space requirements down to 20MiB. Fixes #1245. --- tool/tool_chain_rump | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tool/tool_chain_rump b/tool/tool_chain_rump index 202a1cbe6..2ef50c29e 100755 --- a/tool/tool_chain_rump +++ b/tool/tool_chain_rump @@ -18,6 +18,8 @@ help: .PHONY: build help install +.NOTPARALLEL: install + # # Rump tool list # @@ -95,7 +97,7 @@ $(BUILD_DIR)/bin/rump_server: $(CONTRIB_DIR)/.compile.tag $(BUILD_DIR) build: $(CONTRIB_DIR) $(BUILD_DIR)/bin/rump_server -install: $(CONTRIB_DIR) $(BUILD_DIR)/bin/rump_server +copy: $(CONTRIB_DIR) $(BUILD_DIR)/bin/rump_server $(ECHO) "$(BRIGHT_COL)installing rump tools to '$(INSTALL_LOCATION)'...$(DEFAULT_COL)" $(VERBOSE)sudo mkdir -p $(INSTALL_LOCATION)/bin >/dev/null 2>&1 || true $(VERBOSE)sudo mkdir -p $(INSTALL_LOCATION)/share/man >/dev/null 2>&1 || true @@ -103,6 +105,22 @@ install: $(CONTRIB_DIR) $(BUILD_DIR)/bin/rump_server $(VERBOSE)sudo cp -a $(BUILD_DIR)/lib/ $(INSTALL_LOCATION) $(VERBOSE)sudo cp -a $(BUILD_DIR)/share/man/man* $(INSTALL_LOCATION)/share/man +# +# Since at least the libraries are installed with 444 permission by the +# NetBSD build framework and it requires some effort we strip the binaries +# manually by calling strip(1) with root permission prior to copying the +# binaries. +# + +strip-binaries: $(CONTRIB_DIR) $(BUILD_DIR)/bin/rump_server + $(ECHO) "$(BRIGHT_COL)stripping binaries prior to installation...$(DEFAULT_COL)" + $(VERBOSE)sudo find $(BUILD_DIR)/bin -type f \ + -exec strip --strip-all {} \; > /dev/null 2>&1 + $(VERBOSE)sudo find $(BUILD_DIR)/lib -type f \ + -exec strip --strip-all {} \; > /dev/null 2>&1 + +install: strip-binaries copy + # # Clean rules #