Skip to content

Commit 03ffca2

Browse files
committed
update README and startup prompt
1 parent 3a75cce commit 03ffca2

File tree

2 files changed

+27
-34
lines changed

2 files changed

+27
-34
lines changed

README.md

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
Run linux elf binary (alpine rootfs also supported) on HarmonyOS PC, inspired by [Termony](https://github.com/TermonyHQ/Termony), based on [harmony-qemu](https://github.com/hackeris/harmony-qemu).
44

5-
Originally for quick verification to integrate qemu-user to [Termony](https://github.com/TermonyHQ/Termony).
6-
7-
Working in progress, in the early stages.
5+
Working in progress.
86

97
![Run in HiShell](./docs/images/screen_202507192054.png)
108

@@ -15,37 +13,32 @@ To build and install to your device, see [Build Termony on Linux](https://github
1513
# Usage
1614

1715
- Build and sign hap of Harmonix
18-
- or download unsigned hap from [Release page](https://github.com/hackeris/Harmonix/releases) and sign by your self
16+
- or download unsigned hap from [Release page](https://github.com/hackeris/Harmonix/releases) and sign the hap by your self
1917
- Install Harmonix to your HarmonyOS PC
20-
- Download alpine minimal root filesystem from https://alpinelinux.org/downloads/ (aarch64 or x64)
21-
- In HiShell, extract rootfs tar.gz file to data directory, for example `/data/storage/el2/base/files/alpine`
22-
- Run qemu-harmonix-aarch64 to load busybox shell with rootfs and environment variables
23-
```shell
24-
cd /data/storage/el2/base/files/alpine
25-
qemu-harmonix-aarch64 -E PATH=/bin:/usr/bin:/sbin -E HOME=/root -L ./ ./bin/busybox sh -c 'cd ~ && sh'
26-
```
27-
- cd to `/` and run `busybox ls`, the root changed!
28-
```shell
29-
cd /
30-
ls
31-
bin dev etc home lib media mnt opt proc root run sbin srv sys tmp usr var
32-
```
33-
- `apk` is also runnable
34-
```shell
35-
apk add gcc
36-
```
37-
- `gcc` can compile a `Hello World` to run
18+
- Open Harmonix or HiShell, and run `harmonix_install_alpine` to install Alpine Linux
19+
- After Alpine Linux installed, run `harmonix_run_alpine` to start Alpine Linux
20+
- Run `cd /` cd to `/` and run `ls`, you can see the root changed!
21+
- Run `uname -a` to display system info.
22+
23+
## x86_64
24+
25+
You can also run Linux program of x86_64 on HarmonyOS PC by qemu-harmonix-x86_64 in Harmonix.
26+
27+
- Download alpine minimal root filesystem from [https://alpinelinux.org/downloads/](https://alpinelinux.org/downloads/), choose "Mini root filesystem" -> "x86_64"
28+
- Extract downloaded rootfs tar.gz file to data directory, for example `/data/storage/el2/base/files/alpine_x64`
29+
- Run qemu-harmonix-x86_64 to load busybox shell with rootfs and environment variables
3830
```shell
39-
gcc hello.c -o hello
40-
./hello
31+
cd /data/storage/el2/base/files/alpine_x64
32+
qemu-harmonix-x86_64 -E PATH=/bin:/usr/bin:/sbin -E HOME=/root -L ./ ./bin/busybox sh -c 'cd ~ && sh'
4133
```
42-
![GCC compiles Hello World](docs/images/screen_202507192010.png)
34+
- Run `uname -a` to display system info.
4335

44-
# Problems
36+
# Features
4537

46-
There may be some problems, such as
38+
- In Alpine Linux, you can use `apk` to install packages.
39+
- Install `gcc` and `musl-dev` by `apk add gcc musl-dev`, then you can compile C code and run.
40+
- Install `python` by `apk add python3`, then you can run python script.
41+
- Install `openjdk17-jdk` by `apk add openjdk17-jdk`, then you can compile Java code by `javac`.
42+
- More external programs from packages works.
4743

48-
- Some syscalls may not be relocated to rootfs
49-
- Path may not be relocated as expected
50-
- Hard link is not supported now
51-
- Other problems
44+
![GCC compiles Hello World](docs/images/screen_202507192010.png)

entry/src/main/resources/rawfile/term.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function onTerminalReady() {
106106
hterm.openUrl = (url) => native.openLink(url);
107107

108108
io.print('Welcome to Harmonix! A project to run Linux ELF binary on HarmonyOS.\r\n');
109-
io.print('Now aarch64 and x86_64 ELF binary are supported(by harmonix-qemu-aarch64 and harmonix-qemu-x86_64).\r\n');
109+
io.print('Now ELF binary of aarch64 and x86_64 are supported (by qemu-harmonix-aarch64 \r\nand qemu-harmonix-x86_64).\r\n');
110110
io.print('\r\n');
111111
io.print(
112112
' _ _ _ \r\n' +
@@ -120,9 +120,9 @@ function onTerminalReady() {
120120
io.print('To install or reinstall Alpine Linux, run `harmonix_install_alpine`.\r\n');
121121
io.print('To start Alpine Linux, run `harmonix_run_alpine`.\r\n');
122122
io.print('\r\n');
123-
io.print('You can also use Harmonix in HiShell. To uninstall from HiShell, run `harmonix_remove_alpine`\r\n');
123+
io.print('You can also use Harmonix in HiShell. To uninstall from HiShell, run \r\n`harmonix_remove_alpine`\r\n');
124124
io.print('\r\n');
125-
io.print('To customize linux root filesystem or run x86_64, see harmonix_install_alpine and harmonix_run_alpine script.\r\n');
125+
io.print('To customize linux root filesystem or run x86_64, see harmonix_install_alpine \r\nand harmonix_run_alpine script.\r\n');
126126

127127
native.load();
128128
native.syncFocus();

0 commit comments

Comments
 (0)