Skip to content

v1.1.14

Choose a tag to compare

@github-actions github-actions released this 29 Nov 06:48
· 33 commits to main since this release

変更内容

1.1.14: 新しい実行エンジン z2k を選べるようにしました。既定はこれまでどおり z2root で、更新しただけでは動き方は変わりません(1.0.217〜1.1.14 の変更をまとめた版です)。

  • z2k を選べるように: ⚙設定 › Linux環境 › 実行エンジン で、z2root と z2k を切り替えられます。選んだエンジンは、新しく開いたタブから使われます。新しいエンジンなので、うまく動かないものがあれば z2root に戻してください。z2k が起動できない端末では、自動で z2root で起動します。
    • しくみ: z2root は、プログラムがシステムコールを呼ぶたびに外から止めて見張ります。z2k は、プログラムのプロセスの中で処理します。外と行き来しない分、速くなります。
    • 速さ(同じ端末で z2root と比べた目安):
      • 作業フォルダを調べる(getcwd): 約 25 倍
      • ファイルを開いて閉じる: 約 3.5 倍
      • スレッドの待ち合わせ(futex): 約 3.3 倍
      • Python でフォルダをたどる: 約 2.2 倍
      • find でフォルダをたどる: 約 2 倍
      • プログラムをたくさん起動する: 約 1.7 倍
      • ただし、fork と wait を短く何度も繰り返す処理だけは、2 割ほど遅くなります。
    • できるようになったこと(root なしで、z2k を選んだタブの中で):
      • コンテナ: Podman と Docker が動きます。イメージの取得(pull)・作成(build)・起動(run・exec・logs・stop)、ポートの公開(-p)、コンテナどうしのネットワーク(bridge)と名前引き、外への通信まで使えます。
      • 名前空間: unshare や crun で、プロセス(pid)・ホスト名(UTS)・マウント・ネットワーク・IPC・ユーザーを分けて動かせます。
      • ネットワークの設定: コンテナの中の ip・nft(nftables)で、仮想のネットワーク(veth・bridge・経路)を組めます。スマホ本体の通信は変わりません。
      • FUSE: sshfs でほかのマシンのフォルダをマウントできます。
      • プロセス間の通信: SysV IPC(共有メモリ・セマフォ・メッセージキュー)と POSIX のメッセージキューが使えます。
  • スマホの再起動の後: OS の中の /run を空にしてから起動するようにしました(本物の Linux と同じ)。再起動の後に Podman が「current system boot ID differs from cached boot ID」で止まっていたのが直ります。/tmp は消しません。
  • z2-update --apk <ファイル>: 手元にある z2term の APK を、入れ替えの確認画面まで出せるようにしました(z2term と同じ署名のものだけ)。ssh などから cmd package で入れる方法は、今の Android では断られます。
  • z2-session:
    • z2-session new --os ubuntu のように、コマンドから OS を選んでタブを開けるようにしました。
    • z2-session send で文字を入れても、送り先のタブへ画面が切り替わらないようにしました。
    • z2-session new --help で「--help」という名前のタブが開いていたのを直しました。
  • ほかのコマンド:
    • z2run --help が使い方を出さず、「--help」というプログラムを起こそうとしていたのを直しました。GUI の一式が無い OS では、パッケージを入れ始めていました。
    • z2-pacman-keyring --help と z2menu --help も、使い方を出して終わるようにしました。
    • z2-server list は、1 件も登録が無いときも失敗にせず、案内を出して終わります。
  • タブ:
    • タブの一覧の右端にある 📡(ブロードキャスト)の入口が、閉じなかったのを直しました。
    • ブロードキャストしていないときのピンチは、ピンチしたタブだけの文字の大きさを変えます。
    • タブを閉じても、擬似端末がアプリの中に開いたまま残っていたのを直しました。
    • アプリを更新した直後やタブを足した直後に、最初の案内が一瞬表示されていたのを直しました。
  • 16KB ページの機種: メモリを 16KB 単位で扱う機種(Android 15 以降の一部)でも、アプリと実行エンジンが読み込めるようにしました。

Changes

1.1.14: The new execution engine z2k can now be chosen. The default is still z2root, so updating alone does not change how things run (this release gathers the changes from 1.0.217 to 1.1.14).

  • z2k can be chosen: switch between z2root and z2k in ⚙ Settings › Linux › Execution engine. The chosen engine is used by tabs opened afterwards. As a new engine, if something does not work on it, switch back to z2root. On a device where z2k cannot start, z2root is used automatically.
    • How it works: z2root stops a program from outside every time it makes a system call and watches it. z2k handles them inside the program's own process, so it is faster without the round trips.
    • Speed (rough figures against z2root on the same phone):
      • Looking up the working folder (getcwd): about 25×
      • Opening and closing a file: about 3.5×
      • Thread wake-ups (futex): about 3.3×
      • Walking folders in Python: about 2.2×
      • Walking folders with find: about 2×
      • Starting many programs: about 1.7×
      • Only very short, repeated fork-and-wait loops are about 20% slower.
    • What it adds (without root, in tabs using z2k):
      • Containers: Podman and Docker run. Pulling and building images, run / exec / logs / stop, publishing ports with -p, bridge networking between containers with name resolution, and reaching outside all work.
      • Namespaces: unshare and crun can separate processes (pid), hostname (UTS), mounts, network, IPC and users.
      • Network setup: ip and nft (nftables) inside containers build virtual networks (veth, bridge, routes). The phone's own networking is not changed.
      • FUSE: sshfs can mount folders from other machines.
      • Inter-process communication: SysV IPC (shared memory, semaphores, message queues) and POSIX message queues are available.
  • After the phone restarts: the OS's /run is emptied before it starts (as on real Linux). This fixes Podman stopping with "current system boot ID differs from cached boot ID" after a restart. /tmp is left alone.
  • z2-update --apk <file>: takes a z2term APK you already have to the install screen (only one with the same signature as the installed z2term). Installing with cmd package from ssh and the like is refused on current Android.
  • z2-session:
    • Tabs can be opened in a chosen OS from the command line, as in z2-session new --os ubuntu.
    • z2-session send no longer switches the screen to the tab it types into.
    • z2-session new --help no longer opens a tab named "--help".
  • Other commands:
    • z2run --help no longer tries to start a program called "--help" instead of printing its usage. On an OS without the GUI set, it started installing packages.
    • z2-pacman-keyring --help and z2menu --help now print their usage and exit.
    • z2-server list no longer fails when nothing is registered; it prints a note and exits.
  • Tabs:
    • The 📡 (broadcast) entry at the right end of the tab list now closes.
    • A pinch while not broadcasting changes the text size of the pinched tab only.
    • Closing a tab no longer leaves its pseudo-terminal open inside the app.
    • The first-launch guide no longer flashes right after an app update or when a tab is added.
  • 16 KB page devices: the app and the execution engines now load on devices that manage memory in 16 KB pages (some devices with Android 15 or later).

Full Changelog: v1.0.216...v1.1.14