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
Adding shell utilities to Blink #281
Conversation
To compile: 1) run ./configure 2) replace lib/config.h with lib/myConfig.h 3) open Xcode project 4) when compiled, move framework to ../Frameworks
To compile, use XCode project
To compile: use XCode project.
Just a quick note before reviewing or talking in more detail. The GNU Coreutils are under the GPL3, and unfortunately it is incompatible with Blink - Mosh iOS clause. But maybe we can build the BSD versions? |
Hi,
On 13 Jun 2017, at 19:57, carloscabanero ***@***.***> wrote:
Just a quick note before reviewing or talking in more detail. The GNU Coreutils are under the GPL3, and unfortunately it is incompatible with Blink - Mosh iOS clause. But maybe we can build the BSD versions?
Damn! I knew there would be some licensing issues, but not so fast.
I'll look at the BSD version of the tools. On the plus side, the commands are easier to tinker with.
Best,
Nicolas Holzschuch
… —
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#281 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AHsmUHArvINDexm7TyyGFW2UCrGlTtX7ks5sDs2WgaJpZM4N4w3c>.
|
Hi,
On 13 Jun 2017, at 19:57, carloscabanero ***@***.*** ***@***.***>> wrote:
Just a quick note before reviewing or talking in more detail. The GNU Coreutils are under the GPL3, and unfortunately it is incompatible with Blink - Mosh iOS clause. But maybe we can build the BSD versions?
Quick question: is the *Apple* license OK?
By far the easiest utilities to port are the ones from Apple's own Open Source effort:
https://opensource.apple.com <https://opensource.apple.com/>
Reading the source code, it seems to be following the BSD licence:
/*
* Copyright (c) 1989, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Michael Fischbein.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
Best regards,
Nicolas Holzschuch
|
This is a tricky one, that is the original 4-clause BSD, which is incompatible with GPLv3. The problem is clause 3. But FreeBSD relicensed all their code to a compatible 3-clause one, including the Core Utils we care about (reason why in their license files they skip the 3). The code is technically the same, do you think we can use that one? |
Thanks! I will prepare a new version for the Raw branch with this included. Don’t know what people will do with it, but interesting to figure out! :) |
file_cmds is now complete (all commands that make sense / can work are implemented).
What would make this massively useful is to have |
I'll look into it, but it's a long shot. |
Hi @yury, |
Hi @holzschu, Sure! that would be great. It will be v2.1 release? Or it is better to fork ios_system? What do you think? |
@holzschu, I also pass err stream to ios_system. That way |
Hi @yury,
|
Hi @holzschu,
|
One more thing @holzschu, the last Blink version works with descriptors instead of streams, so we don't need to do fprintf all the time, etc... This may be useful and easier to port some of the tools and keep them in sync. |
I don't see the change to descriptors yet in the main branch. The switch from streams to descriptors will require some changes in ios_system and its API. With the current architecture, it should be relatively easy (but not instantaneous). |
Blink will continue to support both,. Just mentioned that in case it helps you with maintenance as usually this apps expect descriptors and not streams. |
Hi @holzschu, We plan to migrate to new folders structure:
Quick search showed that you do checks if files exists and fallback to known defaults in curl_ios_static/src/tool_operate.c But maybe I missed something? |
Hi @yury, I don't think I'm accessing the other ones. |
Hi @yury,
|
Hi @yury, According to the man page, |
hi @holzschu, About commenting setlocale in mosh. We did that at first. It didn't crash, but utf8 sequences are corrupted. About set |
Hi @yury, |
Hi @holzschu, https://github.com/yury/blink/blob/rn/Blink/AppDelegate.m#L59 NSString *locales_path = [mainBundle pathForResource:@"locales" ofType:@"bundle"];
setenv("PATH_LOCALE", locales_path.UTF8String, forceOverwrite); |
yep, it is only LC_CTYPE in the bundle |
Hi @yury, |
Hi @holzschu, Here the short video what I get. |
Hi @yury, |
Quick question: does adding |
actually not. |
oh, sorry! It works! |
@holzschu thanks a lot! Testing... |
Alright, it has been quite a ride but we could finally put all the pieces together!! Thanks a lot @holzschu for such a great work. We will continue contributing to tools on your repo 👍 |
That is both awesome and overwhelming. It's awesome that you guys continue contributing to the tools! |
I suggest an extension to Blink, giving basic shell commands inside the shell (cp, rm, mv...)
This might help user in managing their private keys, or storing files locally.
This is based on GNU coreutils, edited so they compile for iOS and work as functions instead of commands. For each command (e.g. "ls") I rename its main function (e.g. "ls_main"), and call this function from inside MCPSession.m
The full list of commands available:
cd ln ls cp mv rm mkdir rmdir touch pwd
setenv env printenv
id groups realpath uname
For more functionalities, I suggest also compiling VimIOS and creating an App Group, so the two apps can share files. Once this is done, you can edit files in VimIOS and copy/delete them in Blink.
Only a small set of the GNU coreutils are available: some of them don't make sense in a sandboxed environment (kill, nohup, nice, chown), others don't work in a function because of local variables (df), still others send their output to STDOUT_FILENO instead of stdout, which was too complicated to change (cat).