Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates bash static version (including binaries) #26

Merged
merged 3 commits into from
Feb 11, 2020
Merged

updates bash static version (including binaries) #26

merged 3 commits into from
Feb 11, 2020

Conversation

mathieu-aubin
Copy link
Contributor

this pr includes updated binaries for linux and osx, stripped and compressed with upx

To avoid having to change the readme file whenever a newer statically linked version of bash is used, removes version number
changes bash statically linked version
strips linux binary to reduce size #
detects if upx is installed and if so, compress to further reduce binary sizes
@josegonzalez
Copy link
Collaborator

Can you add in the version that you added? As well, would be good if you could document how you created the new upx compressed files :)

@mathieu-aubin
Copy link
Contributor Author

if you check the modified Makefile... it shows the exact commands how to create the upx files.

BASH_STATIC_VERSION is defined in the makefile at the top.

	curl -#SLk https://github.com/robxu9/bash-static/releases/download/$(BASH_STATIC_VERSION)/bash-linux \
		> $(BASH_DIR)/linux/bash && strip $(BASH_DIR)/linux/bash

	curl -#SLk https://github.com/robxu9/bash-static/releases/download/$(BASH_STATIC_VERSION)/bash-osx \
		> $(BASH_DIR)/osx/bash

	chmod +x $(BASH_DIR)/*/bash

	# if upx is present, compress bash binaries
	if [ `command -v upx` ]; then upx --8mib-ram --best --brute --ultra-brute -9 $(BASH_DIR)/*/bash; fi

basically, if upx is found, then run upx --8mib-ram --best --brute --ultra-brute -9 FILE

@mathieu-aubin
Copy link
Contributor Author

this 213414f shows everything and is exactly how i have made them

> $(BASH_DIR)/osx/bash
chmod +x $(BASH_DIR)/**/*
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i removed the double star ** here since this is only available when shopt globstar is enabled

curl -Ls https://github.com/robxu9/bash-static/releases/download/4.3.30/bash-osx \

curl -#SLk https://github.com/robxu9/bash-static/releases/download/$(BASH_STATIC_VERSION)/bash-linux \
> $(BASH_DIR)/linux/bash && strip $(BASH_DIR)/linux/bash
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only linux executable gets stripped

@josegonzalez
Copy link
Collaborator

<3 Thanks!

@josegonzalez josegonzalez merged commit e8e5c97 into progrium:master Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants