Skip to content

Conversation

Sam2159
Copy link

@Sam2159 Sam2159 commented Jul 3, 2025

Some changes needed to run this project also on Android.

For the wiki:
The commands to install the dependencies are:

pkg install glib cmake git wget autoconf nettle ninja binutils x11-repo mesa git dtc zlib ninja cmake gnutls capstone xorgproto && pkg install sdl2 mesa-dev libtasn1 xorg-server xterm fluxbox libssh attr sdl2 gtk3 libpixman pkg-config texinfo m4 libssh capstone xorgproto automake libtool python termux-x11-nightly xfce4

git clone https://github.com/lzfse/lzfse.git && cd lzfse && cmake -DCMAKE_INSTALL_PREFIX=/data/data/com.termux/files/usr/ -DCMAKE_POLICY_VERSION_MINIMUM=3.5 && make && make install

The rest of the commands are the same as for Linux, except for ../configure , where the --disable-guest-agent flag needs to be added. This avoids using the getloadavg function, which is not supported on Android (as far as I know). And before running the vm, a graphical environment should be started, using, for example, Termux:X11.

Sam2159 added 21 commits July 1, 2025 21:35
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
Signed-off-by: Sam2159 <81921831+Sam2159@users.noreply.github.com>
@TERMZL0ckd0wn
Copy link

TERMZL0ckd0wn commented Jul 13, 2025

Hey I'm trying to build lzfse but it this happened

Cloning into 'lzfse'...
remote: Enumerating objects: 203, done.                    remote: Total 203 (delta 0), reused 0 (delta 0), pack-reused 203 (from 1)
Receiving objects: 100% (203/203), 98.72 KiB | 1.25 MiB/s, done.
Resolving deltas: 100% (116/116), done.
CMake Warning:                                               No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.           

CMake Warning (dev) at CMakeLists.txt:1 (project):
  cmake_minimum_required() should be called prior to this top-level project()                                           call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.                                           This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is Clang 20.1.7
-- Detecting C compiler ABI info                           -- Detecting C compiler ABI info - done
-- Check for working C compiler: /data/data/com.termux/files/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.                                                                                                                      Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.    
  Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

Is there a way to fix this?

@TERMZL0ckd0wn
Copy link

Ok I've fixed it by changing the cmake_minimum_requirement to VERSION 3.5 in CmakeLists.txt

@Sam2159
Copy link
Author

Sam2159 commented Jul 13, 2025

You just need to add the

-DCMAKE_POLICY_VERSION_MINIMUM=3.5

flag in the cmake command. I'll edit my pull request comment to include it.

@TERMZL0ckd0wn
Copy link

TERMZL0ckd0wn commented Jul 13, 2025

Is there a way to install img4 and img4tools without root?

@TERMZL0ckd0wn
Copy link

img4tool needs libgeneral and it requires root to install

@aspauldingcode
Copy link

With termux you can do propt or chroot (rootful)
So the propt way might allow without root

@TERMZL0ckd0wn
Copy link

How can I do that?

@Capibarak
Copy link

The --disable-guest-agent doesn't work when I need to do the ../configure command

@v1sh4l420
Copy link

Hi, I'm a noob. Have you successfully booted it on Android device? If yes then can you make a noob friendly tutorial?

@zachary17556
Copy link

im having trouble installing img4tool and img4 on termux
i have been trying for a couple of days now
any help would be welcome

@aspauldingcode
Copy link

im having trouble installing img4tool and img4 on termux

i have been trying for a couple of days now

any help would be welcome

Have you tried compiling img4tool and img4 from source?

@VisualEhrmanntraut
Copy link
Member

img4tool should no longer be required

if (*fd < 0) {
#ifdef __ANDROID__
char path[] = "/data/data/com.termux/files/usr/tmp/memfd-XXXXXX";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this break Android compilation outside of Termux (e.g. with the android NDK)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

8 participants