Compiling dropbear 2015.67 for Zenfone 2 (x86-64) - ZenFone 2 General

Hi,
This is a guide on compiling the latest (as of 2015-06-24) dropbear SSH daemon (2015.67) for the Zenfone 2 but should also work for other x86-64 architecture Android devices. The guide is mainly based off the work from the blog http://blog.xulforum.org/index.php?post/2013/12/19/Compiling-Dropbear-for-a-Nexus-7-tablet which is an excellent guide to getting an older version of dropbear running on Android devices.
I've modified the patch made by the original author to work on the latest dropbear version. There are not much changes from ver 2013.58 to 2015.67. The main difference seems to be the support for Elliptical Curve encryption.
** START DISCLAIMER **
I did not write the original codes/patch myself and have not scrutinized it for any security issues. USE IT AT YOUR OWN RISK.
** END DISCLAIMER **
Here's the list of requirements :-
1) Dropbear 2015.67 source code - dropbear-2015.67.tar.bz2 (https://matt.ucc.asn.au/dropbear/releases/dropbear-2015.67.tar.bz2)
2) Patch to compile for Android - dropbear-v67-android-patch-20150629 (https://goo.gl/LBokgG)
3) A recent Linux distro (I use Ubuntu 14.04.2 LTS) running x86-64.
4) Development tools i.e. C compiler, linker, etc... all the necessary tools to run configure, make, etc..
Steps :-
(1) Extract the source code to a directory of its own :-
Code:
tar xjf dropbear-2015.67.tar.bz2
cd dropbear-2015.67
(2) Patch the source :-
Code:
patch -p1 < dropbear-v67-android-patch-20150629
(3) Run configure :-
Code:
./configure --disable-zlib --disable-largefile --disable-loginfunc \
--disable-shadow --disable-utmp --disable-utmpx --disable-wtmp \
--disable-wtmpx --disable-pututline --disable-pututxline --disable-lastlog
(4) Run make :-
Code:
STATIC=1 MULTI=1 SCPPROGRESS=0 PROGRAMS="dropbear dropbearkey scp dbclient" make strip
(5) You should end up with a single static binary "dropbearmulti" which you should link dropbear, dbclient/ssh, dropbearkey and scp to.
Code:
./dropbear -h
Dropbear server v2015.67 [URL]https://matt.ucc.asn.au/dropbear/dropbear.html[/URL]
Usage: ./dropbear [options]
-A Android Mode, specify a user explicitly
-N Android Mode, user name
-C Android Mode, password
-R Android Mode, public key file (authorized_keys)
-U Android Mode, UID
-G Android Mode, GID
-b bannerfile Display the contents of bannerfile before user login
(default: none)
-r keyfile Specify hostkeys (repeatable)
defaults:
dss /etc/dropbear/dropbear_dss_host_key
rsa /etc/dropbear/dropbear_rsa_host_key
ecdsa /etc/dropbear/dropbear_ecdsa_host_key
-F Don't fork into background
-E Log to stderr rather than syslog
-m Don't display the motd on login
-w Disallow root logins
-s Disable password logins
-g Disable password logins for root
-B Allow blank password logins
-j Disable local port forwarding
-k Disable remote port forwarding
-a Allow connections to forwarded ports from any host
-p [address:]port
Listen on specified tcp port (and optionally address),
up to 10 can be specified
(default port is 22 if none specified)
-P PidFile Create pid file PidFile
(default /var/run/dropbear.pid)
-i Start for inetd
-W <receive_window_buffer> (default 24576, larger may be faster, max 1MB)
-K <keepalive> (0 is never, default 0, in seconds)
-I <idle_timeout> (0 is never, default 0, in seconds)
-V Version
I will assume you know what to do with the binary file generated so will not elaborate on the process.
Hope it works for you guys. I'll be happy to help out anyone who needs more details.
Cheers.
UPDATE: 2015-06-29
- I've updated the patch to fix dbclient/ssh client using password authentication.

Hi all,
For those of you using the dropbear ssh client and encountering a seg fault when using password authentication, I've fixed the patch now and it should be working.
Cheers.

wolfdude said:
I will assume you know what to do with the binary file generated so will not elaborate on the process.
Hope it works for you guys. I'll be happy to help out anyone who needs more details.
Click to expand...
Click to collapse
Ehm...
Replacing the not working dropbear binaries of ARM-oriented SSHD servers with a link to this should solve the problem discussed here ...
is it right ?!
Thanks again

Val3r10 said:
Ehm...
Replacing the not working dropbear binaries of ARM-oriented SSHD servers with a link to this should solve the problem discussed here ...
is it right ?!
Thanks again
Click to expand...
Click to collapse
In a nutshell, you will need to copy dropbearmulti to /system/xbin, create some symbolic links to it (dropbear, dropbearkey, dbclient, scp), run dropbearkey to generate your host keys, copy your client pubkey to /data/dropbear/authorized_keys and then startup dropbear with parameters like :-
Code:
dropbear -A -N root -R /data/dropbear/authorized_keys
Hope this helps.
Cheers.

wolfdude said:
[...] and then startup dropbear with parameters like :-
Hope this helps.
Click to expand...
Click to collapse
Thanks. Got that.
Actually I mean I would replace - with the symlink - the x86 binary file inside one of the above mentionned packages, i.e. QuickSSHd or SSHDroid, to make them compatible with ZE55xML...
I'm trying and reporting here

Related

[Guide][G800F/M/Y][7.1.2][UNOFFICIAL] Build Slim ROM 7 Nougat from Source

Overview
I've created a very simple #!/bin/bash script (attached) to automate the initial build or subsequent rebuild of SpookCity138's ROM:
Slim Rom 7 for the Samsung S5 mini G800f (kminilte). The script simply automates the steps and processes created by others (none of which is my own work - all credit goes to the original creators). I have only tested this script on my own working environment: Gnome Ubuntu 17.04; 16GB RAM; i7-7700HQ; If your environment differs from this your experience may differ from mine.
How to Execute script
See readme at: https://github.com/fidoedidoe/build_scripts
Thanks
@spookcity138, @jimmy999x. Taking the time to educate me at each and every tentative step and demonstrating great patience
Contributors
spookcity138
jimmy999x
Script Source
The latest version of the script (and others for different devices) can be found here: https://github.com/fidoedidoe/build_scripts
SpookCity138's ROM
https://forum.xda-developers.com/galaxy-s5-mini/development/rom-slim-rom-7-nougat-t3558926
Created 2017-09-20
Last Updated 2017-12-09
There are sources to build this ROM for the Snapdragon variant (G800H)? It's a very good device, but simply there is not a single Nougat ROM for it...
wow, excellent, I have reviewed the code (I have not executed it yet) looks pretty good, it should work, I have to copy your script and modify it for other roms, thanks!
edit 1: it is possible to use this script (I use it and it works perfect) to automate even more the process of configuring the compilation environment https://github.com/akhilnarang/scripts
Also, for Ubunt 16.04 I added a couple more to make it easier some things:
cmake
nautilus (optional)
phablet-tools
unrar
silversearcher-ag (this is optional, but extremely useful for me, allows me to find the problematic lines inside a document or folder)
lfom said:
There are sources to build this ROM for the Snapdragon variant (G800H)? It's a very good device, but simply there is not a single Nougat ROM for it...
Click to expand...
Click to collapse
You need to apply some SELinux, CAF, And CM/LOS Patches to build a Nougat ROM for G800H, or that rom will not boot, or will shall not pass from build errors.
Is not a easy task.....
lfom said:
There are sources to build this ROM for the Snapdragon variant (G800H)? It's a very good device, but simply there is not a single Nougat ROM for it...
Click to expand...
Click to collapse
i found this on YT
so far so good for me
give it a try
https://youtu.be/UPOpJgqnlf8
not working for me -- using xubuntu 17.10
ko_taka said:
not working for me -- using xubuntu 17.10
Click to expand...
Click to collapse
Script updated on github (follow links for build_slimrom7_kminilte.sh). Tested on my laptop (Ubuntu gnome 17.04) and SlimRom7 version 1.17 builds successfully (although I have yet to test the build on the device). I'll update the attached zip in the opening page in the coming days, but as a general rule github is the best place to find latest version(s).
Thanks to @spookcity138 (again) for taking time the time and offering sound help / advice identifying the issues and resolve (the issue was within applying device specific patches ./apply.sh).
I am on 40GB partition. Not enough?
perly terminated.
Fetching projects: 70% (381/544) fatal: unable to access 'https://android.googlesource.com/platform/hardware/akm/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
Fetching projects: 73% (398/544) fatal: unable to access 'https://android.googlesource.com/platform/system/connectivity/shill/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
fatal: unable to access 'https://android.googlesource.com/platform/external/jsr330/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
Fetching projects: 74% (403/544) fatal: unable to access 'https://android.googlesource.com/platform/external/jsr330/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
error: Cannot fetch platform/external/jsr330
Fetching projects: 78% (425/544) fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: index-pack failed
error: index-pack died
fatal: index-pack failed
fatal: index-pack failed
fatal: index-pack failed
fatal: index-pack failed
fatal: index-pack failed
error: Cannot fetch SlimRoms/frameworks_base
Click to expand...
Click to collapse
ko_taka said:
I am on 40GB partition. Not enough?
Click to expand...
Click to collapse
Yeah,you're running out of space. I don't recall exactly what the sources and the build of a nougat ROM take,space wise. It seems a little weird you were running out of space syncing the sources. If I recall correctly nougat sources are somewhere between 25-30GB. I could be wrong though. The actual build itself (the out folder) also takes a fair bit of space. Again,just guessing,but around 15-20GB. I would say 60GB would be what you need.
hi spookcity138, nice to see you around
I haven't coded that so I'm feeling a bit lost
The process finally ended (now I am on 80GB partition)
I do not know where is the build if that built anything
those are the last lines
build_slimrom7_kminilte.sh: 176: build_slimrom7_kminilte.sh: [[: not found
Remove references to OmniRom recovery...
remove config_uriBlruEnabled references, spoils the build...
alter local manifest files for slimrom 7 build compatability...
insert text into file: frameworks/base/core/res/res/values/config.xml...
delete file cm_arrays.xml...
remove flipflap stuff from device/samsung/smdk3470-common/smdk3470-common.mk...
build_slimrom7_kminilte.sh: 205: read: Illegal option -t
build_slimrom7_kminilte.sh: 210: build_slimrom7_kminilte.sh: [[: not found
patching file include/telephony/ril.h
Hunk #1 FAILED at 31.
Hunk #2 succeeded at 395 (offset -1 lines).
Hunk #3 succeeded at 409 (offset -1 lines).
Hunk #4 succeeded at 569 (offset -1 lines).
Hunk #5 succeeded at 624 (offset -1 lines).
Hunk #6 succeeded at 1023 (offset -1 lines).
Hunk #7 succeeded at 5217 (offset -1 lines).
Hunk #8 succeeded at 5866 (offset -1 lines).
1 out of 8 hunks FAILED -- saving rejects to file include/telephony/ril.h.rej
manually reapplying failed Hunk #1...
patching file ril/Android.mk
patching file ril/libril/Android.mk
patching file ril/libril/ril.cpp
patching file ril/libsecril-client/Android.mk
applying frameworks_av to frameworks/av
Applying: av: Add samsung wfd service
Applying: add Android M MediaBufferGroup:MediaBufferGroup() for libwvm.so
applying frameworks_native to frameworks/native
Applying: Revert "Remove Parcel::writeIntPtr."
Applying: add missing const getSensorList() for MM gpsd (G800FXXU1CPK5)
applying hardware_libhardware to hardware/libhardware
applying hardware_ril to hardware/ril
Applying: ril: recover on crash
applying hardware_samsung_ril to hardware/samsung/ril
Applying: add SetAudioMode and SetSoundClockMode for MM audio-ril
applying packages_services_Telephony to packages/services/Telephony
./apply.sh: line 24: cd: /home/ferran/android/build_scripts/packages/services/Telephony: No such file or directory
build_slimrom7_kminilte.sh: 238: read: Illegal option -t
build_slimrom7_kminilte.sh: 243: build_slimrom7_kminilte.sh: [[: not found
prepare device specific code...
build_slimrom7_kminilte.sh: 249: build_slimrom7_kminilte.sh: source: not found
build_slimrom7_kminilte.sh: 250: build_slimrom7_kminilte.sh: lunch: not found
running croot...
build_slimrom7_kminilte.sh: 253: build_slimrom7_kminilte.sh: croot: not found
build_slimrom7_kminilte.sh: 262: read: Illegal option -t
build_slimrom7_kminilte.sh: 267: build_slimrom7_kminilte.sh: [[: not found
running mka bacon...
build_slimrom7_kminilte.sh: 273: build_slimrom7_kminilte.sh: mka: not found
Click to expand...
Click to collapse
ko_taka said:
hi spookcity138, nice to see you around
I haven't coded that so I'm feeling a bit lost
The process finally ended (now I am on 80GB partition)
I do not know where is the build if that built anything
those are the last lines
Click to expand...
Click to collapse
The build did not start. It applied the patches successfully (all but one where there was an error) Then it is just a serious of failures. I have not used this script so I cant say specifically where you are going wrong. Does the script have executable permissions? (I assume so as it partially worked) Do you have all of the need dependencies for building Android? Thats not the issue I don't think,but you need them either way. Other than that I am not real sure honestly. You may need to wait for @fidoedidoe to help you. I'll reply back if any possible reason comes to mind.
ko_taka said:
hi spookcity138, nice to see you around
I haven't coded that so I'm feeling a bit lost
The process finally ended (now I am on 80GB partition)
I do not know where is the build if that built anything
those are the last lines
Click to expand...
Click to collapse
Hi @ko_taka
@spookcity138 is correct, the script failed...when it succeeds it's pretty clear the last few messages published will read along the lines of: "Package Complete: .../out/target/product/kminilte/Slim-kminilte-7.1.2.build.1.17-UNOFFICIAL-20171209-1401.zip" followed by "#### make completed successfully (24:30 (mm:ss)) ####" (note the build time will vary depending on the power of your build machine and utilisation of ccache). Oh, FYI - my build folder is ~95GB in size (the ../out/ folder is 26GB and the ../.repo/ folder is 47GB!!)
Back to the script failure....first verify the following variable in the build_slimrom7_kminilte.sh is defined correctly for your environment:
Code:
WORK_DIRECTORY="$HOME/android/slimrom7"
For my personal build environment I keep the script (build_slimrom7_kminilte.sh) in a separate folder to where the source is located and the build is output to (just so i can purge those folders without losing the build script). FYI on your laptop your folder structure should look something like that shown below, with build_slimrom7.kminilte.sh stored in the folder .../build_scripts
Code:
/home/ferran/android/build_scripts
/home/ferran/android/slimrom7
Once the above is verified...the primary issue you have is every time you see "...[[: not found", the script is hitting an issue. Check that the first line of the script contains the line "#!/bin/bash ", this is called "shebang" and it tells your shell what program to interpret the script with, in our case we need "Bash". I'm now wondering what OS / Shell you're using (I use Ubuntu Gnome 17.04 with Bash version 4.4.7) does yours differ from this? To verify your Bash version:
Code:
$ bash -version
GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)
Copyright © 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
You could try forcing your shell to use bash (from memory), by switching to the /build_scripts/ folder and running the following command (do not use sudo or any elevated permissions):
Code:
$ cd /home/ferran/android/build_scripts
$ ./build_slimrom7_kminilte.sh
Let me know how you get on, in essence the script is failing on the evaluation lines where "if [[....]]" is used. if we can't get it to work, in your case, the script may need to be altered to change the evaluation (perhaps "if [...]" would be more suitable). Anyway - give me some feedback and lets see if we can get you a little further.
my bash is 4.4.12
working directory had been set correctly
I removed the double [[ leaving a simple [ same with ]] closing brackets
it says Illegal option -t in line 238
this is line 238: read -r -p "6/7. Initialise environment for Build <Y/n>? (automatically continues unprompted after 10 seconds): " -t 10 -e -i Y PROMPT
it also says [: Y: unexpected operator on line 243
this is line 243: if [ ! $PROMPT =~ ^[Yy]$ ]; then
Timte to time I was getting errors while fetching
TLS errors
I found it is due gnutls package and applied the following solution:
compile git with openssl. To do this, run the following commands:
sudo apt-get update
sudo apt-get install build-essential fakeroot dpkg-dev libcurl4-openssl-dev
sudo apt-get build-dep git
mkdir ~/git-openssl
cd ~/git-openssl
apt-get source git
dpkg-source -x git_1.7.9.5-1.dsc
cd git-1.7.9.5
(Remember to replace 1.7.9.5 with the actual version of git in your system.)
Then, edit debian/control file (run the command: gksu gedit debian/control) and replace all instances of libcurl4-gnutls-dev with libcurl4-openssl-dev.
Then build the package (if it's failing on test, you can remove the line TEST=test from the file debian/rules):
sudo dpkg-buildpackage -rfakeroot -b
Install new package:
x86_64: sudo dpkg -i ../git_1.7.9.5-1_amd64.deb
Click to expand...
Click to collapse
I'm using git-openssl build now
Just started the fetching process again
I'm under virtual machine on a host with a proper firewall configuration -- maybe that caused the connection problems while fetching
ko_taka said:
my bash is 4.4.12
working directory had been set correctly
I removed the double [[ leaving a simple [ same with ]] closing brackets
it says Illegal option -t in line 238
this is line 238: read -r -p "6/7. Initialise environment for Build <Y/n>? (automatically continues unprompted after 10 seconds): " -t 10 -e -i Y PROMPT
it also says [: Y: unexpected operator on line 243
this is line 243: if [ ! $PROMPT =~ ^[Yy]$ ]; then
Click to expand...
Click to collapse
Sounds like we're making progress. This is good. So, reading around the subject of square brackets vs double. It transpires converting the evaluations from double square brackets ([[..]]) to singles ([..]) may** change how variables are referenced. In my script I was forced to use double square brackets to correctly evaluate the response from the "read -r....." (read input) command (where it evaluates when upper or lower case Y is entered). If this command is changed from double square brackets to single ones the command then fails (on my setup). Further to this, in your reply it appears you're also having issues with the "read" command, for some reason your version doesn't support the -t directive (which waits for N seconds - ie: -t 5 will wait 5 seconds for user input).
For now the easiest thing to do is to remove *all* of the steps in the script that awaits input from the user to continue processing the script (they are non essential vanity items primarily used while I was building out the script). There are 7 is these in the script (look for "1/7", "2/7", "3/7", etc etc), just comment out (insert # at beginning of each line) for all 7 instances. There are ~10 lines per instance, examples of how instance #1 and #7 should look after editing is below. Just do the same for all 7 instances in your script and re run the script.
Code:
...
...
#PROMPT=""
#read -r -p "1/7. Initialise/Reinitialise Repo, first 'repo init' will take hours <Y/n>? (automatically continues unpromted after 5 seconds): " -t 5 -e -i Y PROMPT
#echo
#if [ -z "$PROMPT" ]; then
# PROMPT="Y"
#fi
#if [[ ! $PROMPT =~ ^[Yy]$ ]]; then
# echo "Response: '$PROMPT', exiting!"
# exit 1
#fi
...
...
#PROMPT=""
#read -r -p "7/7. Build rom (this segment can take hours) <Y/n>? (automatically continues unprompted after 10 seconds): " -t 10 -e -i Y PROMPT
#echo
#if [ -z "$PROMPT" ]; then
# PROMPT="Y"
#fi
#if [[ ! $PROMPT =~ ^[Yy]$ ]]; then
# echo "Response: '$PROMPT', exiting!"
# exit 1
#fi
...
I'd be really interested in knowing what OS you're using (Ubuntu, Mac, etc along with version) perhaps I can use this detail to come up with a more generic version of the script.
Good luck, let me know how you get on.
ko_taka said:
Timte to time I was getting errors while fetching
TLS errors
I found it is due gnutls package and applied the following solution:
I'm using git-openssl build now
Just started the fetching process again
I'm under virtual machine on a host with a proper firewall configuration -- maybe that caused the connection problems while fetching
Click to expand...
Click to collapse
I'd also try changing the value of the variable: REPO_SYNC_THREADS in the script to something lower (more suitable to your internet bandwidth / performance), try 2 or 4 and build up from there. ie: REPO_SYNC_THREADS=2
I think the problem was on GIT .. confusing I think so
I would be waiting a message like (file doesnt exist or something like that)
anyway I still with compiling errors but now is quite different
I am using virtualbox (Xubuntu 17.10) on Mac OS 10.13.2 Mac Mini 2014 entry level
applying packages_services_Telephony to packages/services/Telephony
./apply.sh: line 24: cd: /home/ferran/android/slimrom7/packages/services/Telephony: No such file or directory
6/7. Initialise environment for Build <Y/n>? (automatically continues unprompted after 10 seconds): Y
prepare device specific code...
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/generic/mini-emulator-mips64/vendorsetup.sh
including device/generic/mini-emulator-mips/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including device/samsung/kminilte/vendorsetup.sh
build/envsetup.sh: line 1716: vendor/slim/build/envsetup.sh: No such file or directory
build/core/product_config.mk:250: *** _nic.PRODUCTS.[[device/samsung/kminilte/slim.mk]]: "vendor/slim/config/common_full_phone.mk" does not exist. Stop.
build/envsetup.sh: line 624: vendor/slim/build/tools/roomservice.py: No such file or directory
build/core/product_config.mk:250: *** _nic.PRODUCTS.[[device/samsung/kminilte/slim.mk]]: "vendor/slim/config/common_full_phone.mk" does not exist. Stop.
cat: /home/ferran/android/slimrom7/vendor/slim/build/envsetup.sh: No such file or directory
cat: /home/ferran/android/slimrom7/vendor/slim/build/envsetup.sh: No such file or directory
build/core/product_config.mk:250: *** _nic.PRODUCTS.[[device/samsung/kminilte/slim.mk]]: "vendor/slim/config/common_full_phone.mk" does not exist. Stop.
** Don't have a product spec for: 'slim_kminilte'
** Do you have the right repo manifest?
running croot...
mka clean/clobber needed...
./build_slimrom7_kminilte.sh: line 257: mka: command not found
7/7. Build rom (this segment can take hours) <Y/n>? (automatically continues unprompted after 10 seconds): Y
running mka bacon...
./build_slimrom7_kminilte.sh: line 273: mka: command not found
Click to expand...
Click to collapse
ko_taka said:
I think the problem was on GIT .. confusing I think so
I would be waiting a message like (file doesnt exist or something like that)
anyway I still with compiling errors but now is quite different
I am using virtualbox (Xubuntu 17.10) on Mac OS 10.13.2 Mac Mini 2014 entry level
Click to expand...
Click to collapse
Thanks for the feedback. At first glance it looks to me like your issue is less to do with the script and more to do with not having all the source locally. Seeing commands such as running ./apply.sh (puled down with the source) error reporting "file not found" is the smoking gun.
Right now I'd be tempted to say ensure you've successfully pulled the primary SlimRom7 source locally. It may be easier to do this outside of the script by running the following:
Code:
$ cd /home/ferran/android/slimrom7/
$ repo forall -vc "git reset --hard" --quiet
$ repo sync --jobs="2"
Keep an eye out of timeouts / 404 while it's syncing the repo's (the third of the three commands above). If you get errors just keep rerunning the "repo sync" command given above while in the correct directory until it completes without error. Once you have that done successfully, change the the build_scripts directory and re-run the script. If you see timeouts / 404 in the script output then you might have to manually run the "git clone" commands to see which one is causing the issue(s).
why does need that much space?
I was executing
$ repo forall -vc "git reset --hard" --quiet
$ repo sync --jobs="2"
Click to expand...
Click to collapse
I am getting the message "out of space"
80GB full of source code and even need more space??
ko_taka said:
why does need that much space?
I was executing
I am getting the message "out of space"
80GB full of source code and even need more space??
Click to expand...
Click to collapse
Use a disk usage analysis tool to find out whether earlier failed attempts pulled source down to multiple locations (when the script was failing).. I mentioned in an earlier post the size of the repo, look back 5 or 6 posts. Don't forget the bulk of the source will be contained in a hidden folder named /.repo/ check this folder doesn't exist outside of the build folder (/slimrom7/)...looking at earlier attempts I'd fist check your /build_scripts/ folder for the hidden .repo folder and if there delete it. Good luck

[EXE] Static Linux binaries for ARM/Android (Cryptsetup, EncFS, F2FS-Tools, Testdisk, PhotoRec,..)

Native ARM/static Linux binaries
(for all ARMv7+ compatible platforms)
Open-source Linux binaries that are either not available on Android (e.g. in Termux)
or make sense to be statically compiled (e.g. to run in TWRP/recovery for data recovery).
These are root tools and might damage your device severely. Use at your own risk. I take no responsibility whatsoever. If in doubt don't use them.​
Minimum CPU: ARMv7/vfpv3-d16. Compiled against musl-libc/Android Kernel 3.4. Binaries are static, bionic/libc independent and should run on Android, TWRP, emulator or any other compatible ARM device. Musl is patched (info)(info2)(patch file: patch -p0 -u -b -i musl-android-smp.patch) to iterate CPU cores by /proc/stat instead of _SC_NPROCESSORS_CONF/sched_getaffinity to prevent false detection due to ARM cpu core powersaving (permanently turning cores on/off). This should report CPU cores more reliably to multithreading apps.
Example instructions how to build EncFS can be found here.
Some Cryptsetup compile recipes are here.
Changelog:
20190923 - f2fs-tools added
20190915 - dislocker, ntfs-3g, mount.exfat-fuse added
20190910 - VeraCrypt v1.24-b5 added
20191215 - musl smp patch added
20191224 - hstr v2.2.0 updated
20191225 - Testdisk, PhotoRec v7.2-wip-dec2019 updated
20200103 - tar v1.32 updated (with selinux, acl, xattr support)
20200513 - Cryptsetup v2.3.2 added
20200518 - fscrypt 0.2.7, strace56(aarch64) added
20200525 - p7zip v17.01 added
20200603 - parted v3.3 added
20200606 - fxz v1.1.0alpha added
20201212 - ddrescue v1.25 added
20201212 - Cryptsetup v2.3.4 updated
20210113 - f2fs-tools updated to v1.14.0
20210125 - Several tools compiled by @Borovets. See 'Misc' tools.
20210413 - Cryptsetup v2.3.5 updated
20210916 - Cryptsetup v2.4.1 updated. Thx to @misterhsp.
20211108 - rsync v3.2.3 updated
20211118 - Cryptsetup v2.4.2 updated. Thx to @misterhsp.
20220103 - mmc-utils added
20220106 - More tools from @Borovets. See spoiler.
Spoiler
bash-5.1.16-[1]-[2022.01.05].tar.gz
openssl3-3.0.1-[2021.12.14]-static.tar.gz
tree-2.0.0-[2021.12.23]-static.tar.gz
e2fsprogs-1.46.5-[2021.12.31]-static.tar.gz
openssl-1.1.1-m-[2021.12.15]-static.tar.gz
libsqlite-3.37.1-[2021.12.30]-static.tar.gz
ldns-host-1.7.1-[2021.12.30]-static.tar.gz
bootimg-info-2.0-[2021.12.18]-static.tar.gz
bc-5.2.1-[2021.12.29]-static.tar.gz
openssl3-tool-3.0.1-[2021.12.14]-static.tar.gz
openssl-tool-1.1.1-m-[2021.12.15]-static.tar.gz
sqlite-3.37.1-[2021.12.30]-static.tar.gz
stunnel-5.61-[2021.12.17]-static.tar.gz
toybox-0.8.6-borovets-295-applets-[2021.12.30]-static.tar.gz
unrar-6.10-beta-3-[2021.12.11]-static.tar.gz
zstd-1.5.1-[2021.12.22]-static.tar.gz
20220107 - parted v3.4 updated
20220113 - cryptsetup v2.4.3 updated. Thx to @misterhsp.
20220114 - gptfdisk v1.0.8 added
20220212 - tar v1.34 updated
20220622 - gptfdisk v1.0.9 (armv7) added
20220724 - dialog v1.3 added
20220728 - f2fs tools v1.15.0 updated
20220730 - cryptsetup v2.5.0 updated. Thx to @misterhsp.
20220806 - 7z-zstd v22.01 added. Thx to @xenosaur
20220910 - rsync v3.2.6 updated
20220913 - htop v3.2.1 added
20220913 - gocryptfs v2.3 updated. Thx to @misterhsp
20220922 - veracrypt v1.25.9 updated
20220924 - fdisk v2.38.1 and file v5.43 added
20221129 - cryptsetup v2.6.0 updated. Thx to @misterhsp
20221213 - f2fs tools v1.15.0 fixed (uuid.h missing)
20230215 - cryptsetup v2.6.1 updated. Thx to @misterhsp
20230307 - gocryptfs v2.3.1. Thx to @misterhsp
Data recovery tools:
- PhotoRec 7.2 - PhotoRec is file data recovery software designed to recover lost files including video, documents and archives from hard disks, CD-ROMs, and lost pictures (thus the Photo Recovery name) from digital camera memory. PhotoRec ignores the file system and goes after the underlying data, so it will still work even if your media's file system has been severely damaged or reformatted.
- Testdisk 7.2 - Recover lost partitions and partition tables. For external sdcards. Never use it on internal mmc unless you know what you're doing.
- ext4magic 0.3.2 (with supplementary gnu date binary that can handle relative time like 'date -d "-20minutes" +%s')
- fidentity - A little utility sharing PhotoRec signature database. It identifies the type of data contained in a file and reports the extension as seen by PhotoRec.
- debugfs - Might be helpful on ext2 systems or other stuff.
- strace 4.20 - For debugging. Mainly to catch syslog messages (as Android has no traditional /dev/log buffer).
- strace 5.6 - For aarch64.
- ddrescue v1.25 - Data recovery tool for block devices with errors.
Compression tools:
p7zip v17.01 (fork) - (Download) A new p7zip fork with additional codecs and improvements
pixz - Parallel, indexed xz compressor
xz - Multicore aware version of xz/lzma (use --thread=0)
tar v1.32 - Tar provides the ability to create tar archives, as well as various other kinds of manipulation. Download below. More builds from @mirfatif here.
fxz - (Download) FXZ Utils is a fork of XZ Utils. It adds a multi-threaded radix match finder and optimized encoder.
Misc:
- hexcurse v1.60.0 - Hexcurse is a curses-base hex editing utility that can open, edit, and save files, editing both the hexadecimal and decimal values. 'ncurses' ui layout depends on TERM env variable. Change temporary with eg. 'TERM=xterm-256color hexcurse <file>'. See /system/etc/terminfo for possible terminals (xterm-256color, linux..).
- nethogs v0.8.5 - ncurse/nettop-like per-app separated speedmeter and traffic counter supporting high refresh rate. Try 'nethogs -d0' (speedmeter) or 'nethogs -v1' (traffic counter).
- rsync v3.2.3 - rsync is an open source utility that provides fast incremental file transfer. (--with-rsyncd-conf=/data/etc/rsyncd.conf)
- smbnetfs v0.6.1 - SMBNetFS is a Linux/FreeBSD filesystem that allow you to use samba/microsoft network in the same manner as the network neighborhood in Microsoft Windows. More info see below.
- progress v0.14 - Linux tool to show progress for cp, mv, dd, ... (formerly known as cv). Download here.
- archivemount (20180801) - A fuse filesystem for mounting archives in formats supported by libarchive. Download here.
- squashfuse v0.1.103 - FUSE filesystem to mount squashfs archives Download here.
- FuseISO - FuseISO is a FUSE module to mount ISO filesystem images (.iso, .nrg, .bin, .mdf and .img files). It currently support plain ISO9660 Level 1 and 2, Rock Ridge, Joliet, and zisofs. Download here.
- HSTR v2.2.0 - HSTR (HiSToRy) is a command line utility that brings improved Bash/zsh command completion from the history. It aims to make completion easier and more efficient than Ctrl-r. (If history is empty try setting HISTFILE in /system/etc/bash/bashrc e.g. export HISTFILE=/data/.bash_history).
- GNU screen, tmux - Thanks to @mirfatif.
- dislocker, ntfs-3g, mount.exfat-fuse - Thanks to @mirfatif.
- f2fs-tools - Thanks to @mirfatif. Update: v1.14.0 here.
- parted v3.3 - GNU Parted (the name being the conjunction of the two words PARTition and EDitor) is a free partition editor, used for creating and deleting partitions. Note: It might be useful to partition external sdcards (e.g. to limit adoptable storage). I do not recommend to use it on internal memory. It might brick your phone.
- Several tools compiled by @Borovets
Spoiler: Borovets tools
Borovets tools 2021.01.25
arptables-0.0.5-[2021.01.17]-static.zip
autoflushtest-1.0-[2021.01.14]-static.zip
btrfs-compsize-1.3-[build-2]-[2020.12.27].zip
btyacc-3.0-[2021.01.18]-static.zip
c-blosc-1.21.1-development-[2020.12.22].zip
c-blosc2-2.0.0-beta-6-development-[2020.04.21].zip
cabextract-1.9.1-[2021.01.08]-static.zip
compsize-1.3-[2021.01.07]-static.zip
convert-color-space-0.1-[2021.01.18]-static.zip
cpustat-0.02.13-[2021.01.13]-static.zip
doxygen-1.9.2-[2021.01.17]-static.zip
ed-1.17-[2021.01.11]-static.zip
hello-2.10-[2021.01.08]-static.zip
htop-3.0.5-[2021.01.13]-static.zip
ipcalc-ng-1.0.0-[2020.12.28]-static.zip
iw-5.9-[2021.01.08]-static.zip
libsqlite-3.34.1-[2021.01.20].zip
libtar-1.2.20-[2021.01.16]-static.zip
m5-1.0-[2020.12.31]-static.zip
sqlite-3.34.1-[2021.01.20]-static.zip
Borovets tools 2021.01.27
lcab-1.0-beta-12-[2021.01.17].zip
memdump-1.01-[2021.01.25].zip
memdumper-0.4-[2021.01.25].zip
memtester-4.5.0-[2021.01.09].zip
tcpdump-4.99.0-[libcap-1.9.1]-[2021.01.05].zip
wget2-1.99.2-[2020.12.12].zip
wolfssl-4.5.0-[2020.12.12].zip
xfsprogs-5.10.0-[2021.01.01].zip
Crypttools:
(These crypttools are mostly frontend tools for the main backend that resides in the kernel. If your kernel hasn't been configured accordingly at compile time you might not be able to use all features.)
Cryptsetup v2.3.5 - (Download) Cryptsetup is an utility used to conveniently setup disk encryption based on DMCrypt kernel module. These include plain dm-crypt volumes, LUKS volumes, loop-AES and TrueCrypt (including VeraCrypt extension) format.
eCryptfs-utils v111 - Frontend tools for the enterprise cryptographic filesystem for Linux. That's what Android/Google use for encryption. It's file-based (no container) and mounting can be automated by Termux widget. Needs shared libraries but is still portable. See notes below.
EncFS v1.9.5 - EncFS provides an encrypted filesystem in user-space. It runs in userspace, using the FUSE library for the filesystem interface.
gocryptfs - An encrypted overlay filesystem written in Go. Download here. Thanks to @mirfatif.
VeraCrypt - VeraCrypt is a free open source disk encryption software. Download here. Thanks to @mirfatif.
fscrypt 0.2.7 - (Download) fscrypt is a high-level tool for the management of Linux filesystem encryption. Needs at least kernel 4.1.
Crypttools info:
Cryptsetup:
General Notes:
- Features like TrueCrypt, VeraCrypt and LUKS2 need 'userspace crypto api' enabled in kernel. Most Android kernels are probably not configured for that and you have to recompile your kernel or contact your kernel maintainer. For kernel 3.4 you need this:
Code:
CONFIG_CRYPTO_USER=y
CONFIG_CRYPTO_USER_API=y
CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_CRYPTO_USER_API_SKCIPHER=y
- If 'cryptsetup benchmark' is incomplete and says 'userspace crypto api not available' you might be affected. You can still use LUKS1 though. A full benchmark looks like this:
Code:
# cryptsetup benchmark
# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1 249186 iterations per second for 256-bit key
PBKDF2-sha256 327680 iterations per second for 256-bit key
PBKDF2-sha512 58829 iterations per second for 256-bit key
PBKDF2-ripemd160 227555 iterations per second for 256-bit key
PBKDF2-whirlpool 33539 iterations per second for 256-bit key
argon2i 4 iterations, 208288 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
argon2id 4 iterations, 207817 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
# Algorithm | Key | Encryption | Decryption
aes-cbc 128b 77.8 MiB/s 88.4 MiB/s
serpent-cbc 128b N/A N/A
twofish-cbc 128b 58.5 MiB/s 61.9 MiB/s
aes-cbc 256b 61.5 MiB/s 68.4 MiB/s
serpent-cbc 256b N/A N/A
twofish-cbc 256b 58.5 MiB/s 61.8 MiB/s
aes-xts 256b 95.1 MiB/s 86.9 MiB/s
serpent-xts 256b N/A N/A
twofish-xts 256b 60.0 MiB/s 61.8 MiB/s
aes-xts 512b 74.1 MiB/s 67.2 MiB/s
serpent-xts 512b N/A N/A
twofish-xts 512b 60.3 MiB/s 62.0 MiB/s
LUKS:
Code:
** 10MB test image (luks.img) **
dd if=/dev/zero of=luks.img bs=1M count 10M
cryptsetup luksFormat luks.img
cryptsetup open luks.img myluks
mke2fs -t ext4 /dev/mapper/myluks
mkdir luks
mount /dev/mapper/myluks luks
** luks folder is ready here **
umount luks
cryptsetup close myluks
- If standard luksFormat cipher (aes-xts-plain64) doesn't work (not supported by your kernel) you can try one of the more compatible ciphers:
Code:
cryptsetup luksFormat -c cbc-essiv:sha256 luks.img myluks
cryptsetup luksFormat -c aes-plain luks.img myluks
- For LUKS2 (experimental) use:
Code:
cryptsetup luksFormat --type luks2 luks.img
- Use "cryptsetup -v --debug" for more verbose output (debugging). In case of errors.
Veracrypt:
Code:
cryptsetup open --type tcrypt --veracrypt veracrypt.tc myvera
cryptsetup status myvera
mkdir /data/myvera
mount /dev/mapper/myvera /data/myvera
umount /data/myvera
cryptsetup close myvera
- Use container from desktop system (created with real Veracrypt)
- "veracrypt.tc" is the veracrypt container name
- "myvera" is an arbitrary name (handle)
- Use "cryptsetup -v --debug" for more verbose output (debugging). In case of errors.
eCryptfs-utils:
General Notes:
These tools are not built statically as they explicitly rely on 'dlopen' (plugin system). Instead they are compiled with relative rpaths (./libs). That means dependencies (libraries in subfolders) must be present in the binaries folder and you have to be in the binaries folder itself (with 'cd') before invoking any binary. By this the binaries are still portable (system independent) as long as the subfolders are present. I've put the files into a tar.gz archive so permissions should be set +x already. Extract the archive into /data/local/bin for 'Example' below.
Code:
mkdir -p /data/local/bin
cd /data/local/bin
tar xf crypttools.armv7.20180204.tar.gz
cd ecryptfs
./ecryptfs-stat --help
More info: ArchLinux Wiki
Example:
Tested on /sdcard based on FUSE filesystem. sdcardfs untested. Might need selinux permissive.
We create a folder /sdcard/pics that can be enabled (files present) or disabled (no files present) by a click on a widget button (Termux script) and entering our password. The encryption is done on a per-file basis. The actual files are stored encrypted in /sdcard/efs/pics.
- You might need SuperSU or Magisk Superuser for 'su -mm'. That makes sure that all apps can see the mounted folder (mount namespace separation).
- Busybox needed
- Install Termux and Termux:Widget from F-Droid or Playstore
- Start it and enter:
Code:
pkg upgrade
pkg install tsu
exit
- Create script /data/data/com.termux/files/home/.shortcuts/efs-pics.sh and make sure permissions(700) and owner (take from parent folder) are correct.
Code:
#!/system/xbin/bash
su -mm -c "/system/xbin/bash -c /data/local/scripts/$(basename "$0")"
- Create script /data/local/scripts/efs-pics.sh (770/root):
Code:
#!/system/xbin/bash
set -e
PATH=$PATH:/data/data/com.termux/files/usr/bin
# Necessary because rpaths are relative
cd /data/local/bin/ecryptfs
# /data/myefskey contains the salted key.
# Don't forget to make a backup.
# Without it encrypted data is lost.
function enter_passphrase {
read -p "Enter passphrase: " passphrase
sig=$(printf "%s" "$passphrase" | ./ecryptfs-insert-wrapped-passphrase-into-keyring /data/myefskey -) || exit
sig=$(echo $sig | cut -d "[" -f2 | cut -d "]" -f1)
}
CPATH1="/data/media/0/efs/pics"
CPATH2="/data/media/0/pics"
if ! mountpoint -q ${CPATH2}; then
enter_passphrase
echo ""
mount -t ecryptfs -o ecryptfs_sig=$sig,ecryptfs_fnek_sig=$sig,ecryptfs_cipher=aes,ecryptfs_key_bytes=16 ${CPATH1} ${CPATH2} || (echo "$(basename "$0") mount failed!"; exit)
./keyctl clear @u
echo "$(basename "$0") mount successful! :)"
else
umount ${CPATH2} || (echo "$(basename "$0") umount error $? :("; exit)
echo "$(basename "$0") umount successful :)"
fi
# uncomment to force-close Termux window
# killall com.termux
- If your rom uses encryption already (/data/data) beware the './keyctl clear @u' command. It might flush *all* keys in the kernel including the Android encryption one (i'm not sure). This might lead to unpredicted behavior. Either comment it out (then your once injected key remains in the kernel keystore and someone could simply remount your folder without passphrase) or make yourself familiar with the keyctl command and handle it yourself. My phone is not encrypted so i cannot help here.
- Create random keyfile (/data/myefskey) and wrap it with passphrase. This might need 1-2 minutes depending on your devices entropy pool (/dev/random). Backup this key (/data/myefskey). Without it your encrypted data is lost. And don't forget the trailing '-' (minus) at the end of the line, it's important.
Code:
cd /data/local/bin/ecryptfs
read -p "Enter passphrase: " passphrase; printf "%s\n%s" $(busybox od -x -N 100 --width=30 /dev/random | head -n 1 | busybox sed "s/^0000000//" | busybox sed "s/[[:space:]]*//g") "${passphrase}" | ./ecryptfs-wrap-passphrase /data/myefskey -
- Create folders:
Code:
mkdir -p /sdcard/efs/pics /sdcard/pics
- Create Widget (Termux) and select 'efs-pics.sh'.
- Start it and enter your passphrase (you used above). If everything goes well (it will tell you) you can place files into /sdcard/pics and scrambled files should come up in /sdcard/efs/pics. Never write into /sdcard/efs/pics directly.
- Activate widget again. /sdcard/pics should get emptied.
- Optional: You can set /data/media/0/efs/pics to 700/root so no one can access/see the encrypted data.
SMBNetFS info:
Note: The library paths are relative. You need to be in the folder (with 'cd') to spawn the executable (./smbnetfs). You can extract the archive wherever you want though as far as the file/folder structure remains intact.
Example:
Code:
mount -o remount,rw /
mkdir -p /data/local/bin /mnt/cifs
mount -o remount,ro /
tar xf smbnetfs.tar.gz -C /data/local/bin
cd /data/local/bin/smbnetfs
export HOME=/data/local/bin/smbnetfs/home
* enter your smb credentials into smbnetfs/home/.smb/smbnetfs.auth (eg. auth "192.168.1.2" "${user}" "${pass}")
./smbnetfs /mnt/cifs
cd /mnt/cifs/192.168.1.2/${share}
I think it usually should list the samba environment in /mnt/cifs but i'm not sure which prerequisites are necessary for that (edit: maybe it needs real workgroup/hostname instead of IPs). If nothing comes up this should work:
The folder 192.168.1.2/${share} is unreachable by Androids folder picker (unless you can enter the path manually). So either pre-create the folder structure beforehand (mkdir -p /mnt/cifs/192.168.1.2/${share}) and add/register the folder to your app by folder picker (eg. MXPlayer) and then overmount that with the actual ${share}. Or bindmount the folder:
Code:
mount --bind /mnt/cifs/192.168.1.2/${share} /mnt/cifs2
Edit: Another option is to let smbnetfs create a static link (actually a symbolic link) to the share in the mountpoint root (/mnt/cifs). Its not as robust as the bindmount though. MXPlayer doesn't find any files (even though the folder picker shows the folders properly).
Code:
echo "link myfiles 192.168.1.2/${share}" > /data/local/bin/smbnetfs/home/.smb/smbnetfs.host
chmod 700 /data/local/bin/smbnetfs/home/.smb/smbnetfs.host
I've noticed that MXPlayer shows the samba folders just for a glimpse of a second. But if you enter one of the local folders and then go back all samba folders are there. Not sure why this is happening or maybe its just my system.
Edit2: Not yet tested but.. check the permissions. Its possible that SMBNetFS mounts with 755 or something. That's inaccessible for Android apps. Try this:
Code:
./smbnetfs -o umask=000,noatime,noexec,nodev,nosuid /mnt/cifs
Samba 4.8.3 configuration:
Code:
_idmap_modules=idmap_rid,idmap_hash,idmap_tdb2
_pdb_modules=pdb_tdbsam,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4
_auth_modules=auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4
waf configure --prefix=/tmp/myout \
-C \
--sysconfdir=./conf/etc/samba \
--with-configdir=./conf/etc/samba \
--localstatedir=./conf/var \
--libexecdir=./conf/usr/lib \
--enable-fhs \
--with-lockdir=./conf/var/cache/samba \
--with-piddir=./conf/run/samba \
--with-logfilebase=./conf/var/log/samba \
--without-pam \
--without-systemd \
--without-ads \
--with-shared-modules=$_idmap_modules,$_pdb_modules,$_auth_modules \
--disable-cups \
--without-gettext \
--bundled-libraries=NONE,com_err,ldb,uid_wrapper,resolv_wrapper,socket_wrapper,nss_wrapper,ntdb,roken,wind,hx509,asn1,heimbase,hcrypto,krb5,gssapi,heimntlm,hdb,kdc,cmocka,talloc,tdb,pytdb,ldb,pyldb,tevent,pytevent \
--disable-rpath-install \
--disable-python --without-ad-dc --without-acl-support --without-ldap \
--hostcc=/usr/bin/gcc \
--cross-compile --cross-execute='qemu-arm -L /media/devpart/qemu/root'
waf build -j4
waf install
Compression tools added.
Next are crypttools (ecryptfs-utils, cryptsetup).
DualJoe said:
Compression tools added.
Next are crypttools (ecryptfs-utils, cryptsetup).
Click to expand...
Click to collapse
Please add ecryptfs-simple
xyne.archlinux.ca/projects/ecryptfs-simple
Thanks.
Ecryptfs-simple is not POSIX compliant. It relies on an argv interface (to parse command-line parameters) that is a GNU extension that musl doesn't support.
The original eCryptFS is simple enough anyway (and its the upstream project). I will provide a quickstart example and a one button GUI controlled solution (Termux widget) to handle it.
Please to add gifsicle,
http://github.com/kohler/gifsicle
Thanks.
I only have gifsicle. The other ones are too complex for my setup atm.
DualJoe said:
I only have gifsicle. The other ones are too complex for my setup atm.
Click to expand...
Click to collapse
Thank you very much.
Please help me again to build giflossy (fork of gifsicle).
I really need it to compress (--lossy=N) the Gif file to be smaller.
https://github.com/kornelski/giflossy
Thanks.
Do you use them directly on your phone for web postings or something? What's your use case to not prefer a desktop system for this?
DualJoe said:
Do you use them directly on your phone for web postings or something? What's your use case to not prefer a desktop system for this?
Click to expand...
Click to collapse
I use it directly on the phone, for learning purposes.
Using it on the phone is so handy that it can be easily used anywhere.
Thanks.
Please help me again to build lbzip2
http://lbzip2.org/
Thanks.
Here it is.
DualJoe said:
Compression tools added.
Next are crypttools (ecryptfs-utils, cryptsetup).
Click to expand...
Click to collapse
When will Crypttools be released.
I've waited for the major update of cryptsetup. Its out now indeed. I should get it up this week.
Crypttools and quickstart tutorials added.
Mountpoint is not writable (eCryptfs)
DualJoe said:
Crypttools and quickstart tutorials added.
Click to expand...
Click to collapse
Can't write to mountpoint.
# touch /sdcard/pics/test
touch: /sdcard/pics/test: Permission denied
# cp file /sdcard/pics
cp: can't create '/sdcard/pics/file': Permission denied
buengeut said:
touch: /sdcard/pics/test: Permission denied
Click to expand...
Click to collapse
What are your permissions?
Code:
# stat /data/media/0/pics
Access: (775/drwxrwxr-x) Uid: (1023/media_rw) Gid: (1023/media_rw)
# stat /data/media/0/efs
Access: (775/drwxrwxr-x) Uid: (1023/media_rw) Gid: (1023/media_rw)
# stat /data/media/0/efs/pics
Access: (775/drwxrwxr-x) Uid: (1023/media_rw) Gid: (1023/media_rw)
How does your mount look like?
Code:
# mount |grep pics
/data/media/0/efs/pics on /data/media/0/pics type ecryptfs (rw,relatime,ecryptfs_fnek_sig=56b1f3c519fb3412,ecryptfs_sig=56b1f3c519fb3412,ecryptfs_cipher=aes,ecryptfs_key_bytes=16)
Is /sdcard linked?
Code:
# ls -l /sdcard
lrwxrwxrwx 1 root root 21 May 10 1973 /sdcard -> /storage/self/primary
What Android version and kernel do you have?
DualJoe said:
What are your permissions?
Code:
# stat /data/media/0/pics
Access: (775/drwxrwxr-x) Uid: (1023/media_rw) Gid: (1023/media_rw)
# stat /data/media/0/efs
Access: (775/drwxrwxr-x) Uid: (1023/media_rw) Gid: (1023/media_rw)
# stat /data/media/0/efs/pics
Access: (775/drwxrwxr-x) Uid: (1023/media_rw) Gid: (1023/media_rw)
How does your mount look like?
Code:
# mount |grep pics
/data/media/0/efs/pics on /data/media/0/pics type ecryptfs (rw,relatime,ecryptfs_fnek_sig=56b1f3c519fb3412,ecryptfs_sig=56b1f3c519fb3412,ecryptfs_cipher=aes,ecryptfs_key_bytes=16)
Is /sdcard linked?
Code:
# ls -l /sdcard
lrwxrwxrwx 1 root root 21 May 10 1973 /sdcard -> /storage/self/primary
What Android version and kernel do you have?
Click to expand...
Click to collapse
Android 6.0 kernel 3.18.14
/sdcard is symlink to /mnt/sdcard, i changed /sdcard to /mnt/sdcard
Code:
# mount -t ecryptfs
/mnt/sdcard/efs/pics on /mnt/sdcard/pics type ecryptfs (rw,relatime,ecryptfs_fnek_sig=1b77138d91206e66,ecryptfs_sig=1b77138d91206e66,ecryptfs_cipher=aes,ecryptfs_key_bytes=16)
Code:
# stat /mnt/sdcard/pics
Access: (775/drwxrwxr-x) Uid: (1000/ system) Gid: (1015/sdcard_rw)
# stat /mnt/sdcard/efs
Access: (775/drwxrwxr-x) Uid: (1000/ system) Gid: (1015/sdcard_rw)
# stat /mnt/sdcard/efs/pics
Access: (775/drwxrwxr-x) Uid: (1000/ system) Gid: (1015/sdcard_rw)
Code:
# touch /mnt/sdcard/pics/test
touch: /mnt/sdcard/pics/test: Permission denied
What about the permissions of /data/media/0 folders? That's the most important part.
If your sdcard is not at /data/media/0 you probably don't have a multiuser environment (older phone?) and /mnt/sdcard is probably a real partition. This is early Kitkat partition layout (/sdcard and /data have separate partitions). On later systems both are on /data partition and /sdcard is abstracted by a FUSE file system that would automatically set the proper permissions whenever you write something to it (even as root).
In case you are on an old layout you would need to set proper permissions to /sdcard/pics and /sdcard/efs yourself. Just take a look at the other folders with 'ls -l /mnt/sdcard' and set accordingly. You would also need to change /data/media/0 to /mnt/sdcard in the script.
What do you get with this?
Code:
# mount |grep sdcard
# mount |grep storage
What phone is it? Kernel 3.18 doesn't sound all too old.
Edit: Another theory is your internal sdcard is scardfs or something. If so, it might break "stacking" folders (mount over). Try to use /data/pics and /data/efs/pics as a test.
It works in Permissive mode (setenforce 0)
I need Busybox with SELinux-enabled and use it to set it to Permissive mode
Code:
# busybox getenforce
Enforcing
# busybox setenforce 0
# busybox getenforce
Permissive
And then execute the efs-pics.sh and test it
Code:
# cp file /mnt/sdcard/pics ; echo $?
[b]0[/b]
# ls /mnt/sdcard/pics
[b]file[/b]
Horreee.... it Works.

[GUIDE]Creating your own Firefox ‘Data Saver’ proxy Browser

Introduction
Hello XDA. My name’s Chris and in this guide I’ll try to show you how to set up your own independent “Data Saver” proxy similar to the one we know from Google Chrome browser. I have to warn you that the steps needed require moderate knowledge and might not be easy to follow for the beginners. It also requires setting up some software on your server (Ubuntu 16.04 in my case) prior to following this guide. You can find tutorials on how to do so in Prerequisites section below.
Prerequisites
- Server running Linux distro (Ubuntu 16.04 x64 in my case as I said above)
- Wireguard or other VPN (OpenVPN) setup on the server that is useable on your device (I’ll go with wireguard, so here’s a great tutorial to set that up: https://www.digitalocean.com/commun...t-to-point-vpn-with-wireguard-on-ubuntu-16-04 . It's pretty straightforward.)
- Machine to build (preferably gcloud or some other buildserver)
- Time
Environment
We’ll start of with installing libraries & additional tools needed to build Android itself just to make sure everything’s ready to move on later:
Code:
sudo apt-get install git ccache automake lzop bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 g++-multilib python-networkx libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make opting libjpeg8 libjpeg-dev openssl ssl-cert maven mercurial libnss3-tools
Okay, so that’s about it for automated install of packages. We’ll also need newest version of golang and Ubuntu repos do not provide that by default so we will install It and set work directory manually:
Code:
mkdir -p ~/golang
cd ~/golang
wget https://dl.google.com/go/go1.10.1.linux-amd64.tar.gz
tar -xvf go1.10.1.linux-amd64.tar.gz
sudo mv go /usr/local
mkdir -p ~/go
Now that it is installed let’s add it to our PATH environment by editing .profile:
Code:
sudo nano ~/.profile
Add these lines at the end of the file:
Code:
export PATH=$PATH:/usr/local/go/bin
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
Save the file and run
Code:
source ~/.profile
To refresh your env setup.
That’s it for now when it comes to your environment setup. We may be installing other packages needed in this guide later.
Installing the Proxy server
Let’s proceed to setting our proxy server that will do all the compression work we want it to. We’ll be using Compy proxy here since it supports ssl which is a must for almost all modern websites nowadays. Let’s download the source we need:
Code:
go get github.com/barnacs/compy
Now we are ready to compile our proxy server binary:
Code:
cd go/src/github.com/barnacs/compy/
go install
Our binary should be located in ~/go/bin so lets try to run it and see if it’s okay
Code:
cd ~/go/bin
./compy -help
This should print all of the arguments we can pass to our proxy. I prefer to have easy access to running it on boot without setting any paths so I’ll move my binary to /usr/bin of my server.
Code:
sudo mv compy /usr/bin
sudo chmod a+x /usr/bin/compy
Generating Self-signed Certificate & Running the Server
Since w plan on using our proxy with SSL traffic we have to provide our own SSL certificate. I just went ahead an generated self-signed to not bother myself with getting it the other way:
Code:
mkdir -p ~/keys
cd ~/keys
openssl req -x509 -newkey rsa:2048 -nodes -keyout cert.key -out cert.crt -days 36500
openssl is going to ask you a few details. Fill those in however you want as it doesn’t matter much since you will be the only one using that certificate anyway. After doing so you should have two files in your keys folder:
Code:
cert.key
cert.crt
Now you may test run compy with those keys to see if everything’s okay. I’ll run it on port 8888:
Code:
compy -host :8888 -ca ~/keys/cert.crt -cakey ~/keys/cert.key -gif false -brotli 8 -gzip 7 -jpeg 75 -png -minify
As you can see we have our keys specified twice. That’s due to workaround applied earlier, don’t worry about it. If everything’s okay you should now see something like this:
Code:
2018/04/05 09:46:49 compy listening on :8888
Since our proxy server seems to run correctly, we may also add some iptables to make it accessible only from our VPN peer address:
Code:
sudo apt-get install iptables-persistent
sudo iptables -A INPUT -p udp -s 10.0.0.0/24 --dport 8888 -j ACCEPT
sudo iptables -A INPUT -p tcp -s 10.0.0.0/24 --dport 8888 -j ACCEPT
sudo iptables -A INPUT -p udp -s 0.0.0.0/0 --dport 8888 -j DROP
sudo iptables -A INPUT -p tcp -s 0.0.0.0/0 --dport 8888 -j DROP
sudo dpkg-reconfigure iptables-persistent
From now on your proxy should be accessible only through your Wireguard VPN connection. At this point it’s safe to run our proxy in the background at system bootup. I do that via crontab:
Code:
sudo crontab -e
Add this line in the end of a file (change the settings if you want to):
Code:
@reboot compy -host :8888 -ca ~/keys/cert.crt -cakey ~/keys/cert.key -gif false -brotli 8 -gzip 7 -jpeg 75 -png -minify
Save the file and you're done with server config.
Server is ready. What now?
Now we need a way to make use of our server and that’s the moment where the fun begins. We could of course add our SSL certificate to Android system certs and try to use our proxy globally BUT that will result in most of apps refusing to connect to their services due to SSL Pinning as our MiTM proxy signs the traffic with our self-signed certificate so non-browser traffic would be essentially dead. Since I haven’t found reliable way to set proxy for individual apps nor disable SSL Pinning on Android 8.1 I had to try my luck finding browser that support proxy setup and Firefox does just that via about:config.
Here comes another problem. Firefox doesn’t use system certificate store so trying to setup our proxy there will result in “Unsafe connection” errors that won’t allow us to visit any website due to the fact the browser doesn’t trust our certificate. I also haven’t found any reliable way to add the cert into newest versions of the browser so the easiest way around that was compiling it from source with the certificate bundled in. Well, let’s go then.
Sync Fennec source
Development variant of Firefox is named Fennec. I recommend doing these steps on some build server as it will be faster than on regular machine. We will use Mercurial to download newest source. It got installed when we were setting up our Env so you can just proceed to clone the repo:
Code:
mkdir -p ~/fennec
cd ~/fennec
hg clone https://hg.mozilla.org/mozilla-central
Wait for the sync to complete. It can take a while so in the meantime we can go forward with other things.
Prepare certificate for Fennec
So we have our cert files we generated earlier used by the proxy. Now we need to convert our cert to format used by mozilla in their browser sources. First we need to convert our certificate into .der format
Code:
cd ~/keys
openssl x509 -in cert.crt -out cert.der -outform DER
Then we will convert it into certdata.txt format for us to use.
Code:
nss-addbuiltin -n ProxyCert -t "C,C,C" -i cert.der >> certdata.txt
We should get quite lengthy file certdata.txt that contains our certificate in the format needed by Fennec sources. We will add it there in a few moments.
Adding the certificate into browser source
Okay so the sync finished and our certdata is ready. Now we need to append it to file provided in Fennec sources:
Code:
cat ~/keys/certdata.txt >> ~/fennec/mozilla-central/security/nss/lib/ckfw/builtins/certdata.txt
Now our browser is ready to be built.
Building Fennec
Let’s move on to our final part: Building the browser. First let the building environment setup by itself.
Code:
cd ~/fennec/mozilla-cental
./mach bootstrap
You will be prompted with a question which version of Firefox you want to build. Naturally, I chose 4. Firefox for Android. Some additional package installs and dependencies downloads will occur at this point. This might take some time. You may need to agree to Android SDK licence and make some other chocies like Mercurial install. Choose Do not install Mercurial as we have it already. Then in another Mercurial dialogue choose No.
After the sync is complete we will get the suggested content of mozconfig file that is needed for the build:
Code:
# Build Firefox for Android:
ac_add_options --enable-application=mobile/android
ac_add_options --target=arm-linux-androideabi
# With the following Android SDK and NDK:
ac_add_options --with-android-sdk="/home/chris/.mozbuild/android-sdk-linux"
ac_add_options --with-android-ndk="/home/chris/.mozbuild/android-ndk-r15c"
Create the file with nano and paste your config there:
Code:
nano mozconfig
Now before we start the build we will need to update gcc toolchain since Ubuntu 16.04 comes with gcc 5.4 and Fennec needs at least 6.1 to build:
Code:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
sudo apt-get install gcc-6 g++-6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
Verify our install with gcc -v
Code:
gcc version 6.3.0 20170519 (Ubuntu/Linaro 6.3.0-18ubuntu2~16.04)
We also need to download rust toolchain for arm target and then we may start the build:
Code:
source ~/.profile
rustup target add armv7-linux-oideabi
./mach build
This will take a lot of time. On Google Cloud build took me around 50 minutes so you may take your rest now and go out for a walk/grab some coffee etc. Anyway, after it’s done run:
Code:
./mach package
To generate your new browser fennec-61.0a1.en-US.android-arm.apk file. It should be somewhere in
Code:
~/fennec/mozilla-central/ objdir-droid/dist
Copy it over to your device and install. Time for some tests.
Setting up the browser & Testing
After installing your fresh Fennec build proceed to open about:config in the address bar and setup proxy as follows (replace ip and port with the ones you used):
Code:
network.proxy.http
10.0.0.1
network.proxy.http_port
8888
network.proxy.ssl
10.0.0.1
network.proxy.ssl_port
8888
network.proxy.type
1
network.proxy.no_proxies_on
10.0.0.1
Try to load any https website while running compy proxy on your server. It should work now:
Screenshot of browser and console output
Enjoy your self-made data compressing browser. Remember to support the developers of open source software used in this guide. Perhaps later I'll attach some more screenshot of the final product.
Links & References:
Compy proxy
Wireguard
Mozilla Cert Storage Info
Hi! Thanks for the guide. I managed to compile Compy using Termux with golang.

Set Maximum CPU frequency on any Android ROM for the HP TOUCHPAD

The maximum and minimum cpu frequencies allow by the Kernel can be set to all the Android ROM ever made for the HP TOUCHPAD until now and forever!
This is apply as a native setting ( as shipped from the factory, we could say )
The ROM will not be modify, no need for ROOT access or install SuperSu or any Apps.
It can be done to an existing installed ROM, no need to re-flash, is safe and will not damage your installation or prevent you from using your TP. Even if you do not do it right, you will get your TP running as always.
This is only done in a Linux OS, I am using ubuntu, which it can also be run under a Virtual Machine in any other OS.
1. Get the boot.img from the zip ROM or the current uImage from the TP boot directory.
(The boot.img must be copy to the root/hpboot directory of the PC, not on the tablet)
2. Run each of this commands separately in terminal in the directory the boot.img is.
dumpimage -i boot.img kernel.uImage
dumpimage -i boot.img -p 1 ram
dd if=ram of=ramdisk.img.gz bs=64 skip=1
gunzip ramdisk.img.gz
mkdir ramdisk; cd ramdisk
cpio -i < ../ramdisk.img
3. Go to the ramdisk direcoty and open this file in a text editor:
init.tenderloin.power.rc
Copy and Paste under # CPU Scaling and # CPU boost the following:
Note: You can add different settings to each cpu0 or cpu1.
Different frequencies to each and also assigned different Governors to each cpu.
You have total and individual control.
# CPU Scaling
# Replace the numbers at the first two lines at the end with the frequencies your TP can handle.
# Replace the numbers at the last two lines at the end with the frequencies your TP can handle.
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 192000
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 192000
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 1782000
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq 1782000
# Configure Performance Governor
# This is optional, but it will speed boot time using both CPU at maximum frequencies.
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "performance"
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "performance"
# CPU boost
# Set your desire speed can not be higher than your maximum frequencies.
write /sys/module/cpu_boost/parameters/boost_ms 20
write /sys/module/cpu_boost/parameters/sync_threshold 1782000
write /sys/module/cpu_boost/parameters/input_boost_freq 1782000
You can configure the type of governor after the system finished booting on this line. Is all up to the Kernel and your choice, but interactive is good.
# Configure Interactive
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "interactive"
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "interactive"
4. Save the changes and repack the ramdisk with kernel.
Open Terminal in the ramdisk folder and paste:
find . | cpio --create --format='newc' | gzip > ../ramdisk_Pack.img
5. Go to the folder where the original boot.img file is and you should have a file ( ramdisk_Pack.img )
Paste the following two commands:
mkimage -A arm -O linux -T ramdisk -C none -a 0x00000000 -n "TENDERLOIN MAX CPU" -d ./ramdisk_Pack.img ./ramdisk.uImage
mkimage -A arm -T multi -C none -n "Tenderloin Android MAX CPU" -d kernel.uImage:ramdisk.uImage uImage.Android_MAX_CPU
6. There is a file name uImage.Android_MAX_CPU in the same folder as your original boot.img, copy it to your TP boot directory and reboot.
If you enter a wrong frequency and it did not finished then do a hard reset and select the other boot image and use it as always. If it finished booting then you are running faster than ever!
To take in consideration:
The Kernel in the ROM has the frequencies that supports, most of the ROM comes with a top frequencies of 1782000. The SKZ kernel allows for a maximum frequency of 1890000.
The HP Touchpad where made with different suppliers of components. Due to this differences not all supports the same maximum frequencies. Very few can work under 1890000 or 18360000. But you can get lucky and have one. You should know and test the maximum speed that it will take, you can do that with Kernels apps before making modifications to the Boot Image, also the minimum frequencies are important as well.
The advantages of creating your own personal Maximum Speed Boot Image:
1 You will get faster boot time as the CPUs are set to work after the system starts the booting process and do not have to wait until the GUI starts and the Kernel app applies the settings.
2. Keep your ROM secure, no ROOT and no Super User, use it as is.
3. Less apps to install to take space and waste of Memory. Kernel apps and Super User have background services that are all time running just to give you the extra speed. Other apps can get the extra Ram for more processing.
4. There is more benefits of running the device at a higher frequency with no extra processing power, than have multiple apps to fine tune your CPU and governors but use resources.
View attachment 4613960
I don't know how to do with this, please help.
[email protected]:/mnt/g/devices/tenderloin/12.5.1/ramdisk$ find . | cpio –create –format=’newc’ | gzip > ../rak_Pack.img
cpio: You must specify one of -oipt options.
Try `cpio --help' or `cpio --usage' for more information.
Try 'cpio --help' or 'cpio --usage' for more information.
In this post I did a detail explanation on how to unpack the boot image.
https://forum.xda-developers.com/hp-touchpad/development/make-root-permanet-read-write-to-t3846567
Create a directory on root ( hpboot ) copy and paste the command on terminal as is on the post and it should work.
View attachment 4614596
[email protected]:/mnt/g/devices/tenderloin$ cd ./hpboot/
[email protected]:/mnt/g/devices/tenderloin/hpboot$ ls
boot.img
[email protected]:/mnt/g/devices/tenderloin/hpboot$ dumpimage -i boot.img kernel.uImage
[email protected]:/mnt/g/devices/tenderloin/hpboot$ dumpimage -i boot.img -p 1 ram
[email protected]:/mnt/g/devices/tenderloin/hpboot$ dd if=ram of=ramdisk.img.gz bs=64 skip=1
28781+1 records in
28781+1 records out
1842017 bytes (1.8 MB, 1.8 MiB) copied, 0.431285 s, 4.3 MB/s
[email protected]:/mnt/g/devices/tenderloin/hpboot$ gunzip ramdisk.img.gz
[email protected]:/mnt/g/devices/tenderloin/hpboot$ mkdir ramdisk; cd ramdisk
[email protected]:/mnt/g/devices/tenderloin/hpboot/ramdisk$ cpio -i < ../ramdisk.img
6819 blocks
[email protected]:/mnt/g/devices/tenderloin/hpboot/ramdisk$ find . | cpio –create –format=’newc’ | gzip > ../rakRW.img
cpio: You must specify one of -oipt options.
Try `cpio --help' or `cpio --usage' for more information.
Try 'cpio --help' or 'cpio --usage' for more information.
[email protected]:/mnt/g/devices/tenderloin/hpboot/ramdisk$
I did it due to https://forum.xda-developers.com/hp-...te-to-t3846567 , but it stuck just like last time I did it.
What does this mean?
cpio: You must specify one of -oipt options.
I can not see the picture you attached and the link does not work.
Are you doing all the commands inside a Linux machine?
zcarrt said:
--SNIP--
[email protected]:/mnt/g/devices/tenderloin/hpboot/ramdisk$ find . | cpio –create –format=’newc’ | gzip > ../rakRW.img
cpio: You must specify one of -oipt options.
Try `cpio --help' or `cpio --usage' for more information.
--SNIP--
Click to expand...
Click to collapse
It may be copied wrong. It should be: cpio --create -–format=’newc’ (not one dash but two, i.e. not -create, -format, but --create, --format)
The working path shows: [email protected]:/mnt/g/devices/tenderloin/hpboot$
I am not a Linux guru, but it look the boot.img is on the root of the tablet and not the PC.
The commands will only work properly if the directory is created in the root of the PC no where else.
((correction))
Yes, you are correct, is something about pasting a double dash that it turns into a hyphen (single dash). When editing the post it shows as intended, double dash. When publish, shows as a single dash, unless the font size is change on here and type again.
How I did it:
Enter the command in ubuntu terminal ( worked ) then copy and paste into LibreOffice Writer.
Write the guide, then copy and paste into the forum, to avoid any mistakes.
Then surprise ! a double dash is change to a hyphen and I am not even aware of it..!
Thanks for correcting!
HP_TOUCHPAD said:
The working path shows: [email protected]:/mnt/g/devices/tenderloin/hpboot$
I am not a Linux guru, but it look the boot.img is on the root of the tablet and not the PC.
The commands will only work properly if the directory is created in the root of the PC no where else.
Click to expand...
Click to collapse
I thought that, too, but there wouldn't be enough room for the dd command to work, and the error message wouldn't have been a cpio error.
my path:
[email protected]:~/hpboot$
There should not be any mounted device anywhere.
HP_TOUCHPAD said:
I can not see the picture you attached and the link does not work.
Are you doing all the commands inside a Linux machine?
Click to expand...
Click to collapse
I did it in windows 10 Ubuntu bash last time , I will try it properly in a Linux machine again. Thanks.
zcarrt said:
I did it in windows 10 Ubuntu bash last time , I will try it properly in a Linux machine again. Thanks.
Click to expand...
Click to collapse
The problem was on the formatting on my post. When I paste the guide for some reason it shows as a hyphen instead of a double dash.
I corrected the error. This is how it should be, also should work in the windows10 linux subsystem.
find . | cpio --create --format='newc' | gzip > ../ramdisk_Pack.img
Stuck on step 5.
Not clear where to "paste" the 2 lines. I "pasted" them in terminal but get the following:
Usage: mkimage -l image
-l ==> list image header information
mkimage [-x] -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file...] image
-A ==> set architecture to 'arch'
-O ==> set operating system to 'os'
-T ==> set image type to 'type'
-C ==> set compression type 'comp'
-a ==> set load address to 'addr' (hex)
-e ==> set entry point to 'ep' (hex)
-n ==> set image name to 'name'
-d ==> use image data from 'datafile'
-x ==> set XIP (execute in place)
mkimage [-D dtc_options] [-f fit-image.its|-F] fit-image
-D => set all options for device tree compiler
-f => input filename for FIT source
Signing / verified boot not supported (CONFIG_FIT_SIGNATURE undefined)
mkimage -V ==> print version information and exit
Use -T to see a list of available image types
Any help please?
Thanks.
kojam said:
Stuck on step 5.
Not clear where to "paste" the 2 lines. I "pasted" them in terminal but get the following:
go to this post and run the script, if all work on your system then you have everything to build it.
https://forum.xda-developers.com/showpost.php?p=78028080&postcount=4
Click to expand...
Click to collapse
HP_TOUCHPAD said:
kojam said:
Stuck on step 5.
Not clear where to "paste" the 2 lines. I "pasted" them in terminal but get the following:
5. Go to the folder where the original boot.img file is and you should have a file ( ramdisk_Pack.img )
Paste the following two commands:
mkimage -A arm -O linux -T ramdisk -C none -a 0x00000000 -n “TENDERLOIN MAX CPU” -d ./ramdisk_Pack.img ./ramdisk.uImage
mkimage -A arm -T multi -C none -n “Tenderloin Android MAX CPU” -d kernel.uImage:ramdisk.uImage uImage.Android_MAX_CPU
go to this post and run the script, if all work on your system then you have everything to build it.
https://forum.xda-developers.com/showpost.php?p=78028080&postcount=4
Click to expand...
Click to collapse
Thanks for your reply.
I was in that folder (where ramdisk_Pack.img is) in terminal, then I entered/pasted those commands in terminal...
What am I doing wrong? Explain it to me like I'm 5yrs old please. LOL :laugh::silly:
Thanks a million!
Click to expand...
Click to collapse
kojam said:
HP_TOUCHPAD said:
Thanks for your reply.
I was in that folder (where ramdisk_Pack.img is) in terminal, then I entered/pasted those commands in terminal...
What am I doing wrong? Explain it to me like I'm 5yrs old please. LOL :laugh::silly:
Thanks a million!
Click to expand...
Click to collapse
My apologies, you did everything right. The error was in the command I posted which is now corrected.
This is how it happen:
I created the commands in ubuntu text editor, then wrote the instructions in LibreOffice Writer, then copy and paste everything to this forum. Then the apostrophe character got changed and that is why the command was not working.
I tested the commands one by one and I was able to finish the process, you should be able to do it also. This is a learning process and I thank you for trying it and finding out the errors.
Redo everything again as I also corrected the changes for the CPU speed.
Click to expand...
Click to collapse
HP_TOUCHPAD said:
kojam said:
My apologies, you did everything right. The error was in the command I posted which is now corrected.
This is how it happen:
I created the commands in ubuntu text editor, then wrote the instructions in LibreOffice Writer, then copy and paste everything to this forum. Then the apostrophe character got changed and that is why the command was not working.
I tested the commands one by one and I was able to finish the process, you should be able to do it also. This is a learning process and I thank you for trying it and finding out the errors.
Redo everything again as I also corrected the changes for the CPU speed.
Click to expand...
Click to collapse
Quite alright friend.
It is I who thanks you for this.
I was able to get create the file after following your update/corrected instructions.
Thanks again!
Click to expand...
Click to collapse
HP_TOUCHPAD said:
kojam said:
My apologies, you did everything right. The error was in the command I posted which is now corrected.
This is how it happen:
I created the commands in ubuntu text editor, then wrote the instructions in LibreOffice Writer, then copy and paste everything to this forum. Then the apostrophe character got changed and that is why the command was not working.
I tested the commands one by one and I was able to finish the process, you should be able to do it also. This is a learning process and I thank you for trying it and finding out the errors.
Redo everything again as I also corrected the changes for the CPU speed.
Click to expand...
Click to collapse
Thanks!
Worked!
Click to expand...
Click to collapse

How To Guide How To Install Windows Or Linux ISOs on your Android Devices - Windows 10 Nox Lab + Working Arm Distros for your phone using Termux

Update: A new thread is created to house "premade" linux distros. The first premade environment is an Ubuntu distro, installed using proot-distro in termux, Takes only a few minutes to restore the backup, else instructions are provided to build the environment yourself from scratch.
[GUIDE][NO-ROOT] How to install Ubuntu and other Linux Distros on Your Phone or Android TV Box, using Termux
NOTICE: THIS METHOD IS ONLY FOR NON ROOTED DEVICES PROOT-DISTRO GITHUB PAGE Hello Friends! Today I wanted to start a thread that will house prebuilt Linux environments, as well as instructions for building the Linux environments yourself...
forum.xda-developers.com
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Or you can visit this thread and use method 2 to remote connect to your phone using windows RDC and have a much easier time programing vms in termux's qemu. A warning the windows arm editions break xrdp at least for me. It may be user error, I am unsure. Let me know if you have trouble too or success
[GUIDE][NO-ROOT] How to Remotely Connect to Your Phone, or Any Android Device, Using Termux and a PC
Hello Friends~! Today I wanted to teach you how to remotely connect to your phone, or any android device, using Termux and a PC. This example assumes your android device is on the same wireless network as your pc. In order to remote into our...
forum.xda-developers.com
Spoiler: UBUNTU ARM 64 FOR PHONE IN TERMUX
This machine seems to be working fine out of the box
How To Install Windows Or Linux ISOs on your Android Devices - Windows 10 Nox Lab + Working Arm Distros for your phone using Termux
Update: A new thread is created to house "premade" linux distros. The first premade environment is an Ubuntu distro, installed using proot-distro in termux, Takes only a few minutes to restore the backup, else instructions are provided to build...
forum.xda-developers.com
Spoiler: KALI LINUX NETHUNTER FOR PHONE IN TERMUX
This machine runs amazing once you do all the troubleshooting steps included in the comments
How To Install Windows Or Linux ISOs on your Android Devices - Windows 10 Nox Lab + Working Arm Distros for your phone using Termux
Update: A new thread is created to house "premade" linux distros. The first premade environment is an Ubuntu distro, installed using proot-distro in termux, Takes only a few minutes to restore the backup, else instructions are provided to build...
forum.xda-developers.com
Spoiler: WINDOWS 10 ARM
This one can really use some work, maybe someone can figure out what is wrong with it
How To Install Windows Or Linux ISOs on your Android Devices - Windows 10 Nox Lab + Working Arm Distros for your phone using Termux
Update: A new thread is created to house "premade" linux distros. The first premade environment is an Ubuntu distro, installed using proot-distro in termux, Takes only a few minutes to restore the backup, else instructions are provided to build...
forum.xda-developers.com
You can do the same for win11, get the image off archive.org but it wont work well unless your phone supports KVM or you have a work around
Spoiler: THE ORIGINAL GUIDE / NOX LAB FOR KNOWLEDGE PURPOSES --OUTDATED
As an edit and an update, the method listed below uses x86_64 version of qemu which will not run well on our phones. This guide also uses an android emulator to teach basics of building a virtual machine in qemu, but in practice on a phone it will be much different, when we use an Arm version of qemu. I am leaving this guide up though as it was fundamental in helping myself personally to even begin to understand qemu and the architectures and how to use the code.
This guide uses a modded nox android emulator which can be found HERE
Hello Friends~!
Today I will be walking you through using Termux, QEMU, and a VNC server to Run Windows or Linux isos on Your Android Devices as well as Android Emulators like Nox on Windows 10.
Spoiler: QEMU-SYSTEM-X86_64-HEADLESS SETUP
DOWNLOAD TERMU:
TERMU.zip
drive.google.com
Paste your iso and termu's apps in Barenox/bin, then install them in Nox.
Spoiler: PIC
Then install the apks by using the apk button on nox
BUILDING QEMU
In Termux, type:
Code:
pkg install x11-repo
apt-get upgrade -y
pkg install qemu-utils -y
pkg install qemu-system-x86-64-headless -y
BUILDING THE VIRTUAL MACHINE'S ENVIRONMENT
In Termux, type:
Code:
mkdir win7
cd win7
qemu-img create -f qcow2 win7.img 100G
A note here is that the name or command "win7" can be any iso you want to install.
For instance, you have an Ubuntu iso you want to install, use:
Code:
mkdir ubuntu
cd ubuntu
qemu-img create -f qcow2 ubuntu.img 100G
Then change the name of your iso to "ubuntu.iso" and so forth
100G can be edited as well. If you are worried about hard drive space, no need.
It is saved in qemu's take on sparse image format, "qcow2 files" (QEMU Copy On Write) thus only taking up space as you use it.
USING ADB TO PUSH THE ISO
In Barenox/bin
Open command prompt from the toolbar and run:
Code:
adb push win7.iso /data/data/com.termux/files/home/win7
Take note that /data/data/com.termux/... etc is where termux stores everything
Spoiler: PIC
BUILDING THE VIRTUAL MACHINE
In termux type:
Code:
qemu-system-x86_64 -smp 2 -net nic -net user -device AC97 -m 2048 -vnc 127.0.0.1:7 -cdrom win7.iso -hda win7.img
Take note that the port of "7" after our local server ip of 127.0.0.1 can be edited. I set this to 7 since this is windows 7
This is in reference to the "5900" port number asked for with VNC.
Install your vnc app. I used "vnc viewer"
The server ip will be 127.0.0.1 if asked and the port is 5907
or
127.0.0.1:5907
Spoiler: PIC
tadah~!
RUNNING THE MACHINE LATER
In termux
Code:
cd win7
qemu-system-x86_64 -smp 2 -net nic -net user -device AC97 -m 2048 -vnc 127.0.0.1:7 -hda win7.img
Then reopen the VNC App
These steps have all been automated, see the EXECUTABLE SCRIPTS section
IF YOU LEARN BETTER VISUALLY HERE IS A VIDEO OF THE STEPS
Spoiler: REFS
Termux Direct Apk DL:
https://f-droid.org/repo/com.termux_117.apk
VNC:
Download VNC Viewer | VNC® Connect
Control VNC® enabled computers with VNC® Viewer.
www.realvnc.com
This Guide Helped Me Get Started:
GitHub - blanckth/qemuTermux: Use QEMU in Termux as a full virtual machine and Deploy Any OS and iso
Use QEMU in Termux as a full virtual machine and Deploy Any OS and iso - GitHub - blanckth/qemuTermux: Use QEMU in Termux as a full virtual machine and Deploy Any OS and iso
github.com
This Guide Helped Me To Understand How To "Run a Batch" in Linux (.sh)
How to create batch files on Windows & Linux to automate small and complex tasks
While working on our computers we sometimes need to do repetitive tasks almost every single day. However, there is a simple way you can automate those tasks by
www.how2shout.com
What is a VNC?
What is a VCN? Benefits and Providers of Virtual Network Computing
Helped Me To Reprogram Parameters
QEMU documentation - QEMU
www.qemu.org
QCOW2 File - What is a .qcow2 file and how do I open it?
Learn about .QCOW2 files and view a list of programs that open them.
fileinfo.com
Difference Between Qemu and KVM – The Geek Diary
www.thegeekdiary.com
Spoiler: Outdated QTemu Tool history
INSTALL.md · master · QtEmu / gui · GitLab
Front-end for qemu emulator
gitlab.com
## Development
Urs Wolfer started QtEmu as school project. Ben Klopfenstein began adding some features that he wanted.
And in 2009 the project stoped its development.
In 2017 Sergio Carlavilla started from scrach the development of the 2.0 version. The new UI has based on
VirtualBox OSE and Virt-manager.
QtEmu / gui · GitLab
Front-end for qemu emulator
gitlab.com
original repo
GitHub - uwolfer/qtemu: This project is UNMAINTAINED. QtEmu is a graphical user interface for QEMU written in Qt4. Active fork: https://gitlab.com/qtemu
This project is UNMAINTAINED. QtEmu is a graphical user interface for QEMU written in Qt4. Active fork: https://gitlab.com/qtemu - GitHub - uwolfer/qtemu: This project is UNMAINTAINED. QtEmu is a g...
github.com
Building Android for Qemu: A Step-by-Step Guide
Developing Linux for Android on Qemu allows you to do some things that are not necessarily possible using the stock emulator.
www.collabora.com
AArch64 - Wikipedia
en.wikipedia.org
How to launch ARM aarch64 VM with QEMU from scratch.
The below instructions will allow for bringing up an ARM VM from scratch.
futurewei-cloud.github.io
Ubuntu – Error
Run u-boot in qemu
GitHub - qemu/u-boot: Mirror of git.qemu.org/u-boot.git
Mirror of git.qemu.org/u-boot.git. Contribute to qemu/u-boot development by creating an account on GitHub.
github.com
How to Use DD Show Progress Command in Linux? {2 Options Explained}
Use the dd command to show progress in the Linux terminal. Add the status attribute to see progress output or run dd with the pv command.
phoenixnap.com
/dev/zero - Wikipedia
en.wikipedia.org
Purpose of /dev/zero?
I tried to cat /dev/zero, and it didn't seem to do anything. I googled /dev/zero, and it says it's basically a blank file with infinite size. Is cat printing an infinite number of non-existent char...
unix.stackexchange.com
Features/PC System Flash - QEMU
wiki.qemu.org
https://forum.xda-developers.com/attachments/dd-png.5593745/
dd: different unit for bs, skip and count?
I am trying to copy a partition from an entire disk image. This command is working: dd if=image.iso of=test bs=512 skip=1161215 count=32768 In order to increase the speed, I'd like to set a bigge...
askubuntu.com
Android On Windows, With Windows~!
Looks great, will give it a try later. Thanks for the time & effort!
========================
SOURCES
==========
==================​
Spoiler: QEMU-SYSTEM-X86_64 SOURCES
Spoiler: REQUIRED APPS
TERMU.zip
drive.google.com
(112M)
Spoiler: WINDOWS 7 SOURCE
Spoiler: PREREQUISITES
A Rooted Device
You need to have Qemu Built already, have made your directory, and changed to it for the scripts to work
I.E hand type this part in Termux
Code:
pkg install x11-repo
apt-get upgrade -y
pkg install qemu-utils -y
pkg install qemu-system-x86-64-headless -y
mkdir win7
cd win7
qemu-img create -f qcow2 win7.img 100G
Spoiler: DOWNLOAD
WIN7SOURCE.zip
drive.google.com
(2.9G)
Spoiler: HOW TO USE ALL FEATURES
Copy the source files and paste them into barenox/bin, then execute the .push-all.bat script. When the adb push has completed, you can now run this code.
In Termux:
Code:
./hinstall.sh
After you have completed the installation, the parameters attaching a disk drive are no longer needed, hence the "hrun.sh" script. This script allows you to easily boot your new machine after changing to the machine's folder in Termux.
In Termux:
Code:
./hrun.sh
Then open your vnc app. IP and PORT info: 127.0.0.1:5907
The source files contain pre-built scripts for your convenience. If you would rather build your own, or understand fully what these are, please see the EXECUTABLE SCRIPTS comment below.
Spoiler: PREMADE INFO
Hello, for your convenience, a pre-installed hdd has been uploaded for this machine. What does that mean? You can bypass the Windows installation and all the steps required to do the setup, by simply pushing the Premade files and running ./hrun.sh
SEE PREMADES SECTION IN COMMENTS
Spoiler: HEADLESS SOURCE CODE
Code:
install:
mkdir win7
cd win7
qemu-img create -f qcow2 win7.img 100G
qemu-system-x86_64 -smp 2 -net nic -net user -device AC97 -m 2048 -vnc 127.0.0.1:7 -cdrom win7.iso -hda win7.img
run later:
cd win7
qemu-system-x86_64 -smp 2 -net nic -net user -device AC97 -m 2048 -vnc 127.0.0.1:7 -hda win7.img
iso obtained from:
My google Drive Vault
vnc ip and port:
127.0.0.1:7
127.0.0.1:5907
adb push path:
adb push win7.iso /data/data/com.termux/files/home/win7
adb push hinstall.sh /data/data/com.termux/files/home/win7
adb push hrun.sh /data/data/com.termux/files/home/win7
chmod path:
adb shell chmod 777 /data/data/com.termux/files/home/win7/hinstall.sh
adb shell chmod 777 /data/data/com.termux/files/home/win7/hrun.sh
commands:
./hinstall.sh
./hrun.sh
Spoiler: TINY7 SOURCE
Spoiler: PREREQUISITES
A Rooted Device
You need to have Qemu Built already, have made your directory, and changed to it for the scripts to work
I.E hand type this part in Termux
Code:
pkg install x11-repo
apt-get upgrade -y
pkg install qemu-utils -y
pkg install qemu-system-x86-64-headless -y
mkdir tiny7
cd tiny7
qemu-img create -f qcow2 tiny7.img 100G
Spoiler: DOWNLOAD
TINY7SOURCE.zip
drive.google.com
(691M)
Spoiler: HOW TO USE ALL FEATURES
First half of video is using the Premade, second half is SOURCES
Copy the source files and paste them into barenox/bin, then execute the .push-all.bat script. When the adb push has completed, you can now run this code.
In Termux:
Code:
./hinstall.sh
After you have completed the installation, the parameters attaching a disk drive are no longer needed, hence the "hrun.sh" script. This script allows you to easily boot your new machine after changing to the machine's folder in Termux.
In Termux:
Code:
./hrun.sh
Then open your vnc app. IP and PORT info: 127.0.0.1:5903
The source files contain pre-built scripts for your convenience. If you would rather build your own, or understand fully what these are, please see the EXECUTABLE SCRIPTS comment below.
Spoiler: PREMADE INFO
Hello, for your convenience, a pre-installed hdd has been uploaded for this machine. What does that mean? You can bypass the Windows installation and all the steps required to do the setup, by simply pushing the Premade files and running ./hrun.sh
SEE PREMADES SECTION IN COMMENTS
Spoiler: PROGRAMMER'S NOTES
Remember that Windows 7 is ancient now and takes (took) forever to setup, even as small as this is.
With this machine, first select "CUSTOM Install", then just set it and forget it. Tiny 7 has a built in script that executes after the initial setup completes, so when you get to this part, you are done, despite what the window says. The script hangs, as it is way outdated, we need to remove it. Close the window and delete the experience folder and delete enable quick launcher
Then we need to delete the actual script
Open task manager, find the PROCESS activate.exe, click on it once to select it, and at the top of vnc viewer, select the mouse icon to activate the left click option. at the bottom right if you click, it will allow you to open the side menu to open the file location. So, open the file location first, then select end task. Delete the install folder
alternatively, you can go into C:\Windows and delete the install folder
You'll notice that this is going to break the internet explorer and file manager shortcuts on your desktop. Just remove the shortcuts, and open the windows menu, search for internet, then right click and copy internet explorer. Go to your desktop and paste a short cut
Spoiler: HEADLESS SOURCE CODE
Code:
install:
mkdir tiny7
cd tiny7
qemu-img create -f qcow2 tiny7.img 100G
qemu-system-x86_64 -smp 2 -net nic -net user -device AC97 -m 2048 -vnc 127.0.0.1:3 -cdrom tiny7.iso -hda tiny7.img
run later:
cd tiny7
qemu-system-x86_64 -smp 2 -net nic -net user -device AC97 -m 2048 -vnc 127.0.0.1:3 -hda tiny7.img
iso obtained from:
https://archive.org/download/tiny-7/Tiny7.iso
vnc ip and port:
127.0.0.1:3
127.0.0.1:5903
adb push path:
adb push win7.iso /data/data/com.termux/files/home/tiny7
adb push hinstall.sh /data/data/com.termux/files/home/tiny7
adb push hrun.sh /data/data/com.termux/files/home/tiny7
chmod path:
adb shell chmod 777 /data/data/com.termux/files/home/tiny7/hinstall.sh
adb shell chmod 777 /data/data/com.termux/files/home/tiny7/hrun.sh
commands:
./hinstall.sh
./hrun.sh
========================
PREMADES
==========
==================​
Spoiler: QEMU-SYSTEM-X86_64 PREMADE IMAGES
Spoiler: REQUIRED APPS
TERMU.zip
drive.google.com
(112M)
Spoiler: WINDOWS 7
Spoiler: STOCK: WINDOWS 7 ULTIMATE SP1 (64 BIT) PREMADE
Spoiler: PREREQUISITES
A Rooted Device
You need to have Qemu Built already, have made your directory, and changed to it for the scripts to work
I.E hand type this part in Termux
Code:
pkg install x11-repo
apt-get upgrade -y
pkg install qemu-utils -y
pkg install qemu-system-x86-64-headless -y
mkdir win7
cd win7
Spoiler: DOWNLOAD
WIN7ULTSP1STOCKHDD.zip
drive.google.com
(3.1G)
Spoiler: HOW TO USE
It says Tiny7 but the steps are the same. First half is a PREMADE installation demo, second half is a SOURCES demo
This premade hard drive image saves us the time of installing windows. It is fully setup and ready to play with.
To use it, copy all the files to barenox/bin and run the .push-all.bat script.
If using your own device, paste the files into your adb folder or just execute the script if you have your adb permissions wrapped.
When it has completed, in Termux type:
Code:
./hrun.sh
Open your vnc app. IP and PORT info: 127.0.0.1:5907
And that will load the premade machine for you. It will simply boot into windows
Nothing has been added here, so if you want to run games and what not, there may be dependencies required. I will build a box that is game ready in the future with the 64bit edition.
Spoiler: MOD: WINDOWS 7, TINY 7 (32 BIT) PREMADE
Spoiler: PREREQUISITES
A Rooted Device
You need to have Qemu Built already, have made your directory, and changed to it for the scripts to work
I.E hand type this part in Termux
Code:
pkg install x11-repo
apt-get upgrade -y
pkg install qemu-utils -y
pkg install qemu-system-x86-64-headless -y
mkdir tiny7
cd tiny7
Spoiler: DOWNLOAD
TINY7HDD.zip
drive.google.com
(615M)
Spoiler: HOW TO USE
First half is a PREMADE installation demo, second half is a SOURCES demo
This premade hard drive image saves us the time of installing windows. It is fully setup and ready to play with.
To use it, copy all the files to barenox/bin and run the .push-all.bat script.
If using your own device, paste the files into your adb folder or just execute the script if you have your adb permissions wrapped.
When it has completed, in Termux type:
Code:
./hrun.sh
Open your vnc app. IP and PORT info: 127.0.0.1:5903
And that will load the premade machine for you. It will simply boot into windows
Nothing has been added here, so if you want to run games and what not, there may be dependencies required. I will build a box that is game ready in the future with the 64bit edition.
See Tiny7's Tree Under SOURCES. The PROGRAMMER'S NOTES Tree contains detailed instructions for how this was Programmed. I had to figure out how to remove the old script that came with this iso, and documented the steps there for others. Note that the preinstalled machine has been cleaned of the problematic INSTALL folder and the internet explorer shortcut corrected for you.
More MODS will be added as they are built
TERMUX AND REPO KNOWLEDGE​
Spoiler: TERMUX PROPERTIES AND USER BINARIES
Spoiler: CODE
The following code was used to pull Termux's properties File
Code:
adb pull /data/data/com.termux/files/home/.termux/termux.properties
Spoiler: FILE
Code:
### After making changes and saving you need to run `termux-reload-settings`
### to update the terminal. All information here can also be found on the
### wiki: https://wiki.termux.com/wiki/Terminal_Settings
###############
# General
###############
### Allow external applications to execute arbitrary commands within Termux.
### This potentially could be a security issue, so option is disabled by
### default. Uncomment to enable.
# allow-external-apps = true
### Default working directory that will be used when launching the app.
# default-working-directory = /data/data/com.termux/files/home
### Uncomment to disable toasts shown on terminal session change.
# disable-terminal-session-change-toast = true
### Uncomment to not show soft keyboard on application start.
# hide-soft-keyboard-on-startup = true
### Uncomment to let keyboard toggle button to enable or disable software
### keyboard instead of showing/hiding it.
# soft-keyboard-toggle-behaviour = enable/disable
### Adjust terminal scrollback buffer. Max is 50000. May have negative
### impact on performance.
# terminal-transcript-rows = 2000
### Uncomment to use volume keys for adjusting volume and not for the
### extra keys functionality.
# volume-keys = volume
###############
# Fullscreen mode
###############
### Uncomment to let Termux start in full screen mode.
# fullscreen = true
### Uncomment to attempt workaround layout issues when running in
### full screen mode.
# use-fullscreen-workaround = true
###############
# Cursor
###############
### Cursor blink rate. Values 0, 100 - 2000.
# terminal-cursor-blink-rate = 0
### Cursor style: block, bar, underline.
# terminal-cursor-style = block
###############
# Extra keys
###############
### Settings for choosing which set of symbols to use for illustrating keys.
### Choose between default, arrows-only, arrows-all, all and none
# extra-keys-style = default
### Force capitalize all text in extra keys row button labels.
# extra-keys-text-all-caps = true
### Default extra-key configuration
# extra-keys = [[ESC, TAB, CTRL, ALT, {key: '-', popup: '|'}, DOWN, UP]]
### Two rows with more keys
# extra-keys = [['ESC','/','-','HOME','UP','END','PGUP'], \
# ['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN']]
### Configuration with additional popup keys (swipe up from an extra key)
# extra-keys = [[ \
# {key: ESC, popup: {macro: "CTRL f d", display: "tmux exit"}}, \
# {key: CTRL, popup: {macro: "CTRL f BKSP", display: "tmux ←"}}, \
# {key: ALT, popup: {macro: "CTRL f TAB", display: "tmux →"}}, \
# {key: TAB, popup: {macro: "ALT a", display: A-a}}, \
# {key: LEFT, popup: HOME}, \
# {key: DOWN, popup: PGDN}, \
# {key: UP, popup: PGUP}, \
# {key: RIGHT, popup: END}, \
# {macro: "ALT j", display: A-j, popup: {macro: "ALT g", display: A-g}}, \
# {key: KEYBOARD, popup: {macro: "CTRL d", display: exit}} \
# ]]
###############
# Colors/themes
###############
### Force black colors for drawer and dialogs
# use-black-ui = true
###############
# HW keyboard shortcuts
###############
### Disable hardware keyboard shortcuts.
# disable-hardware-keyboard-shortcuts = true
### Open a new terminal with ctrl + t (volume down + t)
# shortcut.create-session = ctrl + t
### Go one session down with (for example) ctrl + 2
# shortcut.next-session = ctrl + 2
### Go one session up with (for example) ctrl + 1
# shortcut.previous-session = ctrl + 1
### Rename a session with (for example) ctrl + n
# shortcut.rename-session = ctrl + n
###############
# Bell key
###############
### Vibrate device (default).
# bell-character = vibrate
### Beep with a sound.
# bell-character = beep
### Ignore bell character.
# bell-character = ignore
###############
# Back key
###############
### Send the Escape key.
# back-key=escape
### Hide keyboard or leave app (default).
# back-key=back
###############
# Keyboard issue workarounds
###############
### Letters might not appear until enter is pressed on Samsung devices
# enforce-char-based-input = true
### ctrl+space (for marking text in emacs) does not work on some devices
# ctrl-space-workaround = true
Spoiler: MORE TERMUX KNOWLEDGE
Internal and external storage - Termux Wiki
wiki.termux.com
Spoiler: BUILT IN BINARIES
Spoiler: QEMU X11 REPOS
QEMU-SYSTEM-X86_64 7.0 USER MANUAL PART 1​
Spoiler: SHOW
X86_64 USER MANUAL PART 2​
Spoiler: SHOW
EXECUTABLE SCRIPTS​
Spoiler: SHOW
Spoiler: HEADLESS INSTALL SCRIPT
This script simply saves us the time of retyping the virtual's machine's installation parameters by running "./hinstall.sh"
Spoiler: PREREQUISITES
A Rooted Device To Be Able To Modify and Execute Your New Scripts
You need to have Qemu Built already, have made your directory, and changed to it for the scripts to work
I.E hand type this part
Code:
pkg install x11-repo
apt-get upgrade -y
pkg install qemu-utils -y
pkg install qemu-system-x86-64-headless -y
mkdir win7
cd win7
qemu-img create -f qcow2 win7.img 100G
Make a new text file on your desktop. Call it hinstall
Open the text file and paste in:
Code:
qemu-system-x86_64 -smp 2 -net nic -net user -device AC97 -m 2048 -vnc 127.0.0.1:7 -cdrom win7.iso -hda win7.img
Spoiler: PIC
Save the file, change the extension to .sh, and paste it into barenox/bin.
Open command prompt from the toolbar and paste:
Code:
adb push hinstall.sh /data/data/com.termux/files/home/win7
adb root
adb shell chmod 777 /data/data/com.termux/files/home/win7.hinstall.sh
./hinstall.sh
Spoiler: PIC
Now run this in Termux: (In the win7 directory, per this example, minus the top picture xD)
Code:
./hinstall.sh
and that will start the virtual machine for us, without us needing to type in the steps. I have automated all this further, It will be added to the SOURCE section eventually
Spoiler: HEADLESS RUN SCRIPT
This script simply saves us the time of retyping the virtual's machine's parameters by running "./hrun.sh"
Make a new text file on your desktop. Call it hrun
Open the text file and paste in:
Code:
qemu-system-x86_64 -smp 2 -net nic -net user -device AC97 -m 2048 -vnc 127.0.0.1:7 -hda win7.img
Save the file, change the extension to .sh, and paste it into barenox/bin.
Open command prompt from the toolbar and paste:
Code:
adb push hrun.sh /data/data/com.termux/files/home/win7
adb root
adb shell chmod 777 /data/data/com.termux/files/home/win7.hrun.sh
You are now able to start your windows 7 vm in Termux by changing to the win7 directory and typing
Code:
./hrun.sh
Then open your vnc or spice app
Spoiler: ADB PUSH ALL SCRIPT
This is a simple script to automate pushing the windows iso, the hinstall.sh file. and hrun.sh file.
Simply paste the text in a new document and name it something like ".PUSHALL.bat"
We add the period at the beginning so the script will appear at the top of file list when added to the bin folder.
Spoiler: PIC
Code:
adb push win7.iso /data/data/com.termux/files/home/win7
adb push hinstall.sh /data/data/com.termux/files/home/win7
adb push hrun.sh /data/data/com.termux/files/home/win7
adb root
adb shell chmod 777 /data/data/com.termux/files/home/win7/hinstall.sh
adb shell chmod 777 /data/data/com.termux/files/home/win7/hrun.sh
The final commands in the script, adb root and chmod, allow us to modify the scripts we sent over, so they are allowed to be executed in Termux by using ./ and then the file name, like: ./hinstall.sh
You would then paste all these files into barenox/bin (or your adb directory if working on your own device) and run the .push-all.bat file, it will go through and automatically push over the iso and files, and chmod them for us. (You would need root permissions for this sort of automation)
See Windows 7 SOURCE for further documentation. (Work In Progress)
Spoiler: PULL VIRTUAL MACHINE'S HDD
You can make a batch file to easily pull the machine's hdd
Code:
adb pull /data/data/com.termux/files/home/win7/win7.img
Spoiler: HOW TO EDIT SCRIPTS IN WINDOWS
Right click and edit the batch and sh files
press ctrl plus h and replace as needed
To Edit the .sh without need of other program just change it to ".txt" and edit in there, then change back
Spoiler: HOW TO EDIT SCRIPTS IN TERMUX
In Termux, you can use the command "nano" then your file name, to edit the file in the shell
Make your edits here
Then press ctrl + x and then ENTER to save and close the file. You need to use Termux's built in ctrl button and then press X
Spoiler: SU HOME CODE
When you go into superuser mode in Termux, it forces you into the Root directory on your android device. You can create a script called home.sh
with code:
Code:
cd /data/data/com.termux/files/home/
and adb push and chmod the script, so now after you type su,
you can type ./home.sh and be rerouted to your termux home with all your machines
Will add more as I make them
PROGRAMMER'S NOTES​
Spoiler: SHOW
Spoiler: WINDOWS7
There's no additional programming notes here, other than to select custom install when you first run the disk in the emulator, else it will cause a loop.
Win7 is such a sweet baby <3 at least for the initial setup. Now we can finness the creation by adding certain dependencies to play windows games like .net framework, haxm and more but I will do that another day
Spoiler: TINY7
This is the only entry that is actually located in it's SOURCES tree, I am unable to move it bc it has a lot of images
Spoiler: WINDOWS 11 ARM
Spoiler: OBTAINING THE ISO
Spoiler: UUPDUMP
If you're not familiar with using UUPDUMP, I'll walk you through using them to get the Windows 11 ARM iso. You could use this site for other Windows Related ISOs and products but that will not be covered here.
UUP dump
UUP dump lets you download Unified Update Platform files, like Windows Insider updates, directly from Windows Update.
uupdump.net
Select the arm64 version for latest public build
Select only Windows Home (Unless you need pro for its built in tools)
Uncheck include updates
Unzip the package and run the uup download windows cmd
When the dl finishes, you can identify your iso's name by this line in cmd prompt. You can then rename it to what you like
Spoiler: DOWNLOAD WIN11 ARM
If you don't want to have to do the uupdump steps, I have uploaded my copy of windows 11 arm from them, to gdrive for us <3
DOWNLOAD:
win11arm.iso
drive.google.com
(4.16GB)
Spoiler: QEMU-IMG HACK, MAY BE USEFUL WITH OTHER PROGRAMS
To even be able to view the help file for qemu-img in Termux, I had to use Root explorer to copy the binary from data/data/com.termux/files/usr/bin
and paste it to data/data/com.termux/files/home
That allowed me to be able to call the help command and not get a packaging error. Even when using su to break out of the terminal's sandbox, I was unable to run the command.
Evidently the way termux stores usr added packages, breaks the logic when executing certain functionality, so this is a good "hack" if you need to see a certain tool's help file
Spoiler: AARCH64 EFI DRIVER
Download the driver from here:
Ubuntu – Error
Unzip the package, and open the folder until you get here:
Then copy the efi driver and adb push it to your arm system folder, in this case I am working on windows 11 arm so the path will be
Code:
adb push QEMU_EFI.fd /data/data/com.termux/files/home/win11arm
We have to add the efi driver to our machine's build directory, as opposed to the usr/share folder as shown in an example i listed earlier, due to us building in Termux.
PROGRAMMER'S NOTES​
QEMU-IMG (QEMU UTILITIES)​
Spoiler: SHOW
QEMU-SYSTEM-X86_64 CPU LIST​
Spoiler: SHOW
QEMU-SYSTEM-ARM 7.0 USER MANUAL PART 1​
Spoiler: SHOW
ARM USER MANUAL PART 2​
Spoiler: SHOW
ARM SYSTEM CPU LIST
QEMU-SYSTEM-AARCH64(ARM64)USER MANUAL ​
Spoiler: SHOW
​
AARCH64 USER MANUAL PART 2​
Spoiler: SHOW
​available cpus
Working on this build now. The very first step involves us using an efi driver. This has been added to the programming notes. The beginner code I am building with has been added to the SOURCES tree. Starting with figuring out WIN11ARM then we build android
If anyone makes anything cool feel free to share, it can be any of the qemu systems.
Spoiler: notes
This will eventually be moved into more relevant areas, as per usual. Just jotting down notes so I don't have to start from scratch.
I'm building based off a guide from here https://futurewei-cloud.github.io/ARM-Datacenter/qemu/how-to-launch-aarch64-vm/
There's been new REFS added to the OP to support knowledge gained from this man's Wonderful post. The programming and code is going to differ based on QEMU being at 7.0 at this point in time.
In order to properly flash the memory sets to the pflash file we are going to create, we will use a system binary called "zero". This can be located on any android device in the dev folder.
These articles are great illustrators of the usefulness (and age!) of this file system, to better understand what we are asking the dd program to do with it
/dev/zero - Wikipedia
en.wikipedia.org
Purpose of /dev/zero?
I tried to cat /dev/zero, and it didn't seem to do anything. I googled /dev/zero, and it says it's basically a blank file with infinite size. Is cat printing an infinite number of non-existent char...
unix.stackexchange.com
Im having troubles understanding what a pflash exactly is besides the qemu documentation https://wiki.qemu.org/Features/PC_System_Flash
Qemu won't load images if they aren't formatted RAW and the semantics in doing so with a pflash in qemu 7.0 are different. This is such an obscure area, it's hard to find everything... so kinda making it up as we go haha
The install code is having this error
https://forum.xda-developers.com/attachments/dd-png.5593745/
dd: different unit for bs, skip and count?
I am trying to copy a partition from an entire disk image. This command is working: dd if=image.iso of=test bs=512 skip=1161215 count=32768 In order to increase the speed, I'd like to set a bigge...
askubuntu.com
I have no idea what I am doing, so if there is someone smarter that can help enlighten us on how to do things properly that would be awesome. Otherwise I will continue to poke, prod, break, and remake until something works xD
taking a break on this for a few days to focus on the shield again. will be back~! <3
David Bombal has a good guide up how to get Kali Linux Nethunter on any android device (no root needed) using termux, and in it he showcases a different vnc app. I will investigate this share in the future. Just saving it and sharing it <3 https://davidbombal.com/kali-linux-nethunter-android-install-in-5-minutes-rootless/
Have been looking for a proper guide to actually emulate x86-based Windows on modern ARM64 Snapdragon chips for years, and somehow you descended from xda heaven. Thank you, I'll be having a fun few weeks of spare time now. I will report any progress or issues I encounter down the road.
Hi. I'm trying to find the guide to use a pre-made image (Tiny7.img) instead of creating a new for starters to get a grip on stuff, but I can't find it.
Could you help me? @jenneh
@tehdomic sorry it got buried in everything. the direct google link is here https://drive.google.com/file/d/12uP_rIEoPzqHqh0UqbsLDw6IqYbtNY4K/view
the comment the info is under here with the instructions, they are in the download area.
How To Install Windows Or Linux ISOs on your Android Devices - Windows 10 Nox Lab + Working Arm Distros for your phone using Termux
Update: A new thread is created to house "premade" linux distros. The first premade environment is an Ubuntu distro, installed using proot-distro in termux, Takes only a few minutes to restore the backup, else instructions are provided to build...
forum.xda-developers.com
Spoiler: show

Categories

Resources