Third party Harmonix wrapped interface simulation compatibility for HarmonyOS PC system that enables devs to run linux elf binary with alpine rootfs support
Run linux elf binary (alpine rootfs also supported) on HarmonyOS PC, inspired by Termony, based on harmony-qemu.
Harmonix
Run linux elf binary (alpine rootfs also supported) on HarmonyOS PC, inspired by Termony, based on harmony-qemu.
Originally for quick verification to integrate qemu-user to Termony.
Working in progress, in the early stages.
Build
To build and install to your device, see Build Termony on Linux
Usage
Build and sign hap of Harmonix
or download unsigned hap from Release page and sign by your self
Install Harmonix to your HarmonyOS PC
Download alpine minimal root filesystem from https://alpinelinux.org/downloads/ (aarch64 or x64)
In HiShell, extract rootfs tar.gz file to data directory, for example
/data/storage/el2/base/files/alpine
Run qemu-harmonix-aarch64 to load busybox shell with rootfs and environment variables
cd /data/storage/el2/base/files/alpine
qemu-harmonix-aarch64 -E PATH=/bin:/usr/bin:/sbin -E HOME=/root -L ./ ./bin/busybox sh -c 'cd ~ && sh'
cd to
/
and runbusybox ls
, the root changed!
cd /
ls
bin dev etc home lib media mnt opt proc root run sbin srv sys tmp usr var
apk
is also runnable
apk add gcc
gcc
can compile aHello World
to run
gcc hello.c -o hello
./hello
Problems
There may be some problems, such as
Some syscalls may not be relocated to rootfs
Path may not be relocated as expected
Hard link is not supported now
Other problems
Third party Harmonix interface simulation compatibility via Linux ABI of HongMeng Kernel for HarmonyOS PC system that enables devs to run linux elf binary with alpine rootfs support.
Source: hackeris/Harmonix: Run Linux ELF binary on HarmonyOS PC