Open NICHOLAS85 opened 4 years ago
Hi @NICHOLAS85 ! Thank you for report!
The problem is that portable zsh is using glibc
now.
Right now we're working on new zsh portable version which could resolve this issue.
I'll back to you soon.
@NICHOLAS85 try this please. Here is statically linked portable zsh:
pip install --upgrade xxh-xxh # to xxh 0.6.1
xxhp install xxh-shell-zsh-romkatv
xxh myhost +s xxh-shell-zsh-romkatv +if
Is it working for you?
After upgrading and installing the *romkatv
zsh I, unfortunately, run into the same issue:
Something went wrong while running zsh on host:
./zsh.sh: line 24: /private/var/mobile/.xxh/xxh/shells/xxh-shell-zsh-romkatv/build/zsh-5.8-linux-x86_64-static/bin/zsh: cannot execute binary file: Exec format error
./zsh.sh: line 24: /private/var/mobile/.xxh/xxh/shells/xxh-shell-zsh-romkatv/build/zsh-5.8-linux-x86_64-static/bin/zsh: cannot execute binary file: Exec format error
Thank you for test! Do you know any ways to repeat the issue without having Jailbroken iPhone? Short search for dockerized solution gives not so enough info.
I see the one way: build zsh on iPhone. You could try to do it using similar instructions as in zsh-portable Dockerfile for ubuntu or alpine or in zsh-bin with musl. The first way is more simpler than second. If you'll get success share the result and I add it as xxh-shell-ios
.
I’ll try to build a portable binary at some point in the future. At the moment I am limited in space on my Phone and may not be able to install all the build requirements. Alternatively there is a compiled Zsh package I could install via my package manager on my iPhone. It’s not portable or self contained like the binaries you linked so I don’t think it’d be useful for xxh but I’d like to know if I would still be able to connect to this device and have a familiar Zsh environment provided by xxh using the locally installed Zsh.
As I understand you want to install zsh on iPhone manually and then you want to connect using xxh? Am I right?
In this case you can just fork xxh-shell-bash-zero and rename to xxh-shell-zsh-zero with appropriate changes. This allows you to create xxh-plugins (call it xxh-plugin-zsh-<anyname>
) and just connect to the iphone using preinstalled zsh on the host with xxh-plugins (may be xxh-plugin-zsh-ohmyzsh will work without changes).
The second way is to fork xxh-shell-zsh
and rename to xxh-shell-zsh-iphone
with replacing zsh archive to your zsh build for iphone. It will be your own xxh-shell for iphone and you will be connect ordinary with xxh iphone +s xxh-shell-zsh-iphone
.
Hey @NICHOLAS85 ! You can try new portable zsh build for darwin:
mkdir -p /tmp/zsh && cd /tmp/zsh
curl -fSLO -- "https://github.com/romkatv/zsh-bin/releases/download/v3.0.1/zsh-5.8-darwin-x86_64.tar.gz"
tar -xzf zsh-5.8-darwin-x86_64.tar.gz
mv zsh-5.8-darwin-x86_64 zsh
./zsh/share/zsh/5.8/scripts/relocate
./zsh/bin/zsh
It it works for you we can pack it as xxh-shell.
I get a Bad CPU type in executable
when trying to run relocate or the Zsh executable. Here’s the output of uname -a
if it helps:
Darwin Nicks-iPhone 19.0.0 Darwin Kernel Version 19.0.0: Wed Oct 9 22:42:11 PDT 2019; root:xnu-6153.42.1~1/RELEASE_ARM64_T8015 iPhone10,6 arm64 D221AP Darwin
@romkatv please take a look.
mkdir -p /tmp/zsh && cd /tmp/zsh curl -fSLO -- "https://github.com/romkatv/zsh-bin/releases/download/v3.0.1/zsh-5.8-darwin-x86_64.tar.gz" tar -xzf zsh-5.8-darwin-x86_64.tar.gz mv zsh-5.8-darwin-x86_64 zsh ./zsh/share/zsh/5.8/scripts/relocate ./zsh/bin/zsh
This will install zsh-bin for Darwin x86_64. Naturally, it'll only work on x86_64. Given that iPhone has ARM CPU, it won't work there.
Note that these instructions aren't from https://github.com/romkatv/zsh-bin#installation. Here's what you would get if you follow the official instructions on a jailbroken iPhone:
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/romkatv/zsh-bin/master/install)"
[error] there is no prebuilt binary for your architecture
See https://github.com/romkatv/zsh-bin#compiling if you'd
like to build it yourself.
There is no released binary for jailbroken iPhone.
Here is a repo which let's you build Zsh for iOS: https://github.com/ProcursusTeam/Procursus It may be useful if you all are interested in packaging an iOS version
The message moved to #4
Is your feature request related to a problem? Please describe. I am currently attempting to connect to a Jailbroken iPhone but am greeted with the following error:
Something went wrong while running zsh on host: ./zsh.sh: line 11: ./zsh: cannot execute binary file: Exec format error ./zsh.sh: line 12: ./zsh: cannot execute binary file: Exec format error
Describe the solution you'd like If it were possible to detect the correct architecture and use the correctly built zsh executable to run I believe this issue would go away.
For community: ⬇️ Please click the 👍 reaction instead of leaving a
+1
or 👍 comment