-
Notifications
You must be signed in to change notification settings - Fork 18
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
Check if busybox exists #2
base: master
Are you sure you want to change the base?
Conversation
jbruechert
commented
Jul 10, 2017
•
edited
Loading
edited
- Please merge only after Preconfigure SSH on device #1
ede1190
to
b9cb07e
Compare
halium-install
Outdated
wget https://github.com/meefik/busybox/raw/master/app/src/main/assets/intel/static/bin/busybox -O busybox/busybox | ||
elif [ $device_architecture = armv7l ]; then | ||
wget https://github.com/meefik/busybox/raw/master/app/src/main/assets/arm/static/bin/busybox -O busybox/busybox | ||
elif [ $device_architecture = arm64 ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should use an armv7l or arm64. Also apparently arm64 can also be called aarch64 but I don't have such devices to test.
halium-install
Outdated
{ | ||
export device_architecture=$(do_shell "uname -m") | ||
export busybox_exists=$(do_shell "if [ -d /sbin/busybox ]; then echo true; else echo false; fi") | ||
mkdir busybox |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move the mkdir in the else part of the next if as we don't need that directory if busybox already exists.
halium-install
Outdated
echo 'Using already installed busybox' | ||
else | ||
if [ $device_architecture = x86_64 ]; then | ||
wget https://github.com/meefik/busybox/raw/master/app/src/main/assets/intel/static/bin/busybox -O busybox/busybox |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could actually build our own busybox, or just use a prebuilt static one from busybox.net? I wouldn't necessarily use busybox from a random busybox app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are not having armv7 builds I think ... Correct me if I'm wrong. Of course you're right, if you fing a better source, I'll use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use the armv6l variant from https://busybox.net/downloads/binaries/1.26.2-defconfig-multiarch/ . It's working just fine on armv7
halium-install
Outdated
wget https://github.com/meefik/busybox/raw/master/app/src/main/assets/arm/static/bin/busybox -O busybox/busybox | ||
fi | ||
|
||
adb push busybox/busybox /sbin/busybox |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually why do we need the busybox/ folder on the host at all? It's only a single binary...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that was because I earlier downloaded more to the folder. It's now unnecessary. Thank you for pointing that out.
If it works, it's good :) |
23a3ed8
to
fd76886
Compare
halium-install
Outdated
elif [ $device_architecture = arm64 ]; then | ||
elif [ $device_architecture = aarch64 ]; then | ||
wget https://github.com/meefik/busybox/raw/master/app/src/main/assets/arm/static/bin/busybox | ||
elif [ $device_architecture = armv8l ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should do if device_architecture is armv7l or aarch64 or armv8l and not three seperate branches that do exactly the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm new to bash and didn't know it can do this. Will of course correct :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep looks good :)
@@ -1,4 +1,4 @@ | |||
#!/bin/sh | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work with /bin/sh, so I switched to bash. If you know any reason why we should only use the sh, please report :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depends what's symlinked to /bin/sh. On Arch it's bash by default but I don't know about other distros. /bin/bash ensures we get bash.
I tested the changes with my device, which already has busybox installed. If you still need further testing, we need a device without busybox installed in recovery. |